This commit is contained in:
modmuss50 2020-03-25 19:36:02 +00:00
parent 8679c9398f
commit 11290e89e7
28 changed files with 63 additions and 53 deletions

View file

@ -65,12 +65,12 @@ license {
group = 'TechReborn' group = 'TechReborn'
dependencies { dependencies {
minecraft "com.mojang:minecraft:20w12a" minecraft "com.mojang:minecraft:20w13a"
mappings "net.fabricmc:yarn:20w12a+build.3:v2" mappings "net.fabricmc:yarn:20w13a+build.1:v2"
modImplementation "net.fabricmc:fabric-loader:0.7.8+build.187" modImplementation "net.fabricmc:fabric-loader:0.7.8+build.189"
//Fabric api //Fabric api
modImplementation "net.fabricmc.fabric-api:fabric-api:0.5.5+build.311-1.16" modImplementation "net.fabricmc.fabric-api:fabric-api:0.5.6+build.313-1.16"
optionalDependency ("me.shedaniel:RoughlyEnoughItems:4.1.1-unstable") optionalDependency ("me.shedaniel:RoughlyEnoughItems:4.1.1-unstable")
optionalDependency ('io.github.cottonmc:LibCD:2.3.0+1.15.2') optionalDependency ('io.github.cottonmc:LibCD:2.3.0+1.15.2')

View file

@ -107,8 +107,8 @@ public class CableBlockEntity extends BlockEntity
@Override @Override
public void fromTag(CompoundTag compound) { public void fromTag(BlockState blockState, CompoundTag compound) {
super.fromTag(compound); super.fromTag(blockState, compound);
if (compound.contains("energy")) { if (compound.contains("energy")) {
energy = compound.getDouble("energy"); energy = compound.getDouble("energy");
} }

View file

@ -24,6 +24,7 @@
package techreborn.blockentity.generator; package techreborn.blockentity.generator;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntityType; import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
@ -181,8 +182,8 @@ public abstract class BaseFluidGeneratorBlockEntity extends PowerAcceptorBlockEn
} }
@Override @Override
public void fromTag(CompoundTag tagCompound) { public void fromTag(BlockState blockState, CompoundTag tagCompound) {
super.fromTag(tagCompound); super.fromTag(blockState, tagCompound);
tank.read(tagCompound); tank.read(tagCompound);
} }

View file

@ -25,6 +25,7 @@
package techreborn.blockentity.generator; package techreborn.blockentity.generator;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
@ -228,13 +229,13 @@ public class SolarPanelBlockEntity extends PowerAcceptorBlockEntity implements I
} }
@Override @Override
public void fromTag(CompoundTag tag) { public void fromTag(BlockState blockState, CompoundTag tag) {
if (world == null) { if (world == null) {
// We are in BlockEntity.create method during chunk load. // We are in BlockEntity.create method during chunk load.
this.checkOverfill = false; this.checkOverfill = false;
} }
updatePanel(); updatePanel();
super.fromTag(tag); super.fromTag(blockState, tag);
} }
// MachineBaseBlockEntity // MachineBaseBlockEntity

View file

@ -127,8 +127,8 @@ public abstract class AbstractIronMachineBlockEntity extends MachineBaseBlockEnt
// MachineBaseBlockEntity // MachineBaseBlockEntity
@Override @Override
public void fromTag(CompoundTag compoundTag) { public void fromTag(BlockState blockState, CompoundTag compoundTag) {
super.fromTag(compoundTag); super.fromTag(blockState, compoundTag);
burnTime = compoundTag.getInt("BurnTime"); burnTime = compoundTag.getInt("BurnTime");
totalBurnTime = compoundTag.getInt("TotalBurnTime"); totalBurnTime = compoundTag.getInt("TotalBurnTime");
progress = compoundTag.getInt("Progress"); progress = compoundTag.getInt("Progress");

View file

@ -24,6 +24,7 @@
package techreborn.blockentity.machine.iron; package techreborn.blockentity.machine.iron;
import net.minecraft.block.BlockState;
import net.minecraft.entity.ExperienceOrbEntity; import net.minecraft.entity.ExperienceOrbEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -125,8 +126,8 @@ public class IronFurnaceBlockEntity extends AbstractIronMachineBlockEntity imple
} }
@Override @Override
public void fromTag(CompoundTag compoundTag) { public void fromTag(BlockState blockState, CompoundTag compoundTag) {
super.fromTag(compoundTag); super.fromTag(blockState, compoundTag);
experience = compoundTag.getFloat("Experience"); experience = compoundTag.getFloat("Experience");
} }

View file

@ -24,6 +24,7 @@
package techreborn.blockentity.machine.misc; package techreborn.blockentity.machine.misc;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -74,11 +75,11 @@ public class AlarmBlockEntity extends BlockEntity
} }
@Override @Override
public void fromTag(CompoundTag compound) { public void fromTag(BlockState blockState, CompoundTag compound) {
if (compound != null && compound.contains("selectedSound")) { if (compound != null && compound.contains("selectedSound")) {
selectedSound = compound.getInt("selectedSound"); selectedSound = compound.getInt("selectedSound");
} }
super.fromTag(compound); super.fromTag(blockState, compound);
} }
// ITickable // ITickable

View file

@ -24,6 +24,7 @@
package techreborn.blockentity.machine.multiblock; package techreborn.blockentity.machine.multiblock;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@ -99,8 +100,8 @@ public class FluidReplicatorBlockEntity extends GenericMachineBlockEntity implem
// TilePowerAcceptor // TilePowerAcceptor
@Override @Override
public void fromTag(final CompoundTag tagCompound) { public void fromTag(BlockState blockState, final CompoundTag tagCompound) {
super.fromTag(tagCompound); super.fromTag(blockState, tagCompound);
tank.read(tagCompound); tank.read(tagCompound);
} }

View file

@ -24,6 +24,7 @@
package techreborn.blockentity.machine.multiblock; package techreborn.blockentity.machine.multiblock;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
@ -346,8 +347,8 @@ public class FusionControlComputerBlockEntity extends PowerAcceptorBlockEntity
} }
@Override @Override
public void fromTag(final CompoundTag tagCompound) { public void fromTag(BlockState blockState, final CompoundTag tagCompound) {
super.fromTag(tagCompound); super.fromTag(blockState, tagCompound);
this.crafingTickTime = tagCompound.getInt("crafingTickTime"); this.crafingTickTime = tagCompound.getInt("crafingTickTime");
this.neededPower = tagCompound.getInt("neededPower"); this.neededPower = tagCompound.getInt("neededPower");
this.hasStartedCrafting = tagCompound.getBoolean("hasStartedCrafting"); this.hasStartedCrafting = tagCompound.getBoolean("hasStartedCrafting");

View file

@ -100,8 +100,8 @@ public class IndustrialGrinderBlockEntity extends GenericMachineBlockEntity impl
} }
@Override @Override
public void fromTag(final CompoundTag tagCompound) { public void fromTag(BlockState blockState, final CompoundTag tagCompound) {
super.fromTag(tagCompound); super.fromTag(blockState, tagCompound);
tank.read(tagCompound); tank.read(tagCompound);
} }

View file

@ -102,8 +102,8 @@ public class IndustrialSawmillBlockEntity extends GenericMachineBlockEntity impl
// TilePowerAcceptor // TilePowerAcceptor
@Override @Override
public void fromTag(final CompoundTag tagCompound) { public void fromTag(BlockState blockState, final CompoundTag tagCompound) {
super.fromTag(tagCompound); super.fromTag(blockState, tagCompound);
tank.read(tagCompound); tank.read(tagCompound);
} }

View file

@ -24,6 +24,7 @@
package techreborn.blockentity.machine.tier1; package techreborn.blockentity.machine.tier1;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.CraftingInventory; import net.minecraft.inventory.CraftingInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -431,11 +432,11 @@ public class AutoCraftingTableBlockEntity extends PowerAcceptorBlockEntity
} }
@Override @Override
public void fromTag(CompoundTag tag) { public void fromTag(BlockState blockState, CompoundTag tag) {
if (tag.contains("locked")) { if (tag.contains("locked")) {
locked = tag.getBoolean("locked"); locked = tag.getBoolean("locked");
} }
super.fromTag(tag); super.fromTag(blockState, tag);
} }
// TileMachineBase // TileMachineBase

View file

@ -24,6 +24,7 @@
package techreborn.blockentity.machine.tier1; package techreborn.blockentity.machine.tier1;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
@ -110,8 +111,8 @@ public class PlayerDectectorBlockEntity extends PowerAcceptorBlockEntity impleme
} }
@Override @Override
public void fromTag(CompoundTag tag) { public void fromTag(BlockState blockState, CompoundTag tag) {
super.fromTag(tag); super.fromTag(blockState, tag);
owenerUdid = tag.getString("ownerID"); owenerUdid = tag.getString("ownerID");
} }

View file

@ -24,6 +24,7 @@
package techreborn.blockentity.machine.tier1; package techreborn.blockentity.machine.tier1;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.CraftingInventory; import net.minecraft.inventory.CraftingInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -348,8 +349,8 @@ public class RollingMachineBlockEntity extends PowerAcceptorBlockEntity
} }
@Override @Override
public void fromTag(final CompoundTag tagCompound) { public void fromTag(BlockState blockState, final CompoundTag tagCompound) {
super.fromTag(tagCompound); super.fromTag(blockState, tagCompound);
this.isRunning = tagCompound.getBoolean("isRunning"); this.isRunning = tagCompound.getBoolean("isRunning");
this.tickTime = tagCompound.getInt("tickTime"); this.tickTime = tagCompound.getInt("tickTime");
this.locked = tagCompound.getBoolean("locked"); this.locked = tagCompound.getBoolean("locked");

View file

@ -140,8 +140,8 @@ public class ChunkLoaderBlockEntity extends MachineBaseBlockEntity implements IT
} }
@Override @Override
public void fromTag(CompoundTag nbttagcompound) { public void fromTag(BlockState blockState, CompoundTag nbttagcompound) {
super.fromTag(nbttagcompound); super.fromTag(blockState, nbttagcompound);
this.radius = nbttagcompound.getInt("radius"); this.radius = nbttagcompound.getInt("radius");
this.ownerUdid = nbttagcompound.getString("ownerUdid"); this.ownerUdid = nbttagcompound.getString("ownerUdid");
if(!StringUtils.isBlank(ownerUdid)){ if(!StringUtils.isBlank(ownerUdid)){

View file

@ -24,6 +24,7 @@
package techreborn.blockentity.storage.energy; package techreborn.blockentity.storage.energy;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
@ -143,8 +144,8 @@ public class AdjustableSUBlockEntity extends EnergyStorageBlockEntity implements
} }
@Override @Override
public void fromTag(CompoundTag nbttagcompound) { public void fromTag(BlockState blockState, CompoundTag nbttagcompound) {
super.fromTag(nbttagcompound); super.fromTag(blockState, nbttagcompound);
this.OUTPUT = nbttagcompound.getInt("output"); this.OUTPUT = nbttagcompound.getInt("output");
} }

View file

@ -24,6 +24,7 @@
package techreborn.blockentity.storage.energy.idsu; package techreborn.blockentity.storage.energy.idsu;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -101,8 +102,8 @@ public class InterdimensionalSUBlockEntity extends EnergyStorageBlockEntity impl
} }
@Override @Override
public void fromTag(CompoundTag nbttagcompound) { public void fromTag(BlockState blockState, CompoundTag nbttagcompound) {
super.fromTag(nbttagcompound); super.fromTag(blockState, nbttagcompound);
this.ownerUdid = nbttagcompound.getString("ownerUdid"); this.ownerUdid = nbttagcompound.getString("ownerUdid");
} }

View file

@ -24,6 +24,7 @@
package techreborn.blockentity.storage.fluid; package techreborn.blockentity.storage.fluid;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntityType; import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -104,8 +105,8 @@ public class TankUnitBaseBlockEntity extends MachineBaseBlockEntity implements I
} }
@Override @Override
public void fromTag(final CompoundTag tagCompound) { public void fromTag(BlockState blockState, final CompoundTag tagCompound) {
super.fromTag(tagCompound); super.fromTag(blockState, tagCompound);
if (tagCompound.contains("unitType")) { if (tagCompound.contains("unitType")) {
this.type = TRContent.TankUnit.valueOf(tagCompound.getString("unitType")); this.type = TRContent.TankUnit.valueOf(tagCompound.getString("unitType"));
configureEntity(type); configureEntity(type);

View file

@ -261,8 +261,8 @@ public class StorageUnitBaseBlockEntity extends MachineBaseBlockEntity
} }
@Override @Override
public void fromTag(CompoundTag tagCompound) { public void fromTag(BlockState blockState, CompoundTag tagCompound) {
super.fromTag(tagCompound); super.fromTag(blockState, tagCompound);
if (tagCompound.contains("unitType")) { if (tagCompound.contains("unitType")) {
this.type = TRContent.StorageUnit.valueOf(tagCompound.getString("unitType")); this.type = TRContent.StorageUnit.valueOf(tagCompound.getString("unitType"));

View file

@ -27,7 +27,6 @@ package techreborn.blocks.cable;
import net.minecraft.block.*; import net.minecraft.block.*;
import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityContext;
import net.minecraft.entity.LivingEntity; import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.fluid.Fluid; import net.minecraft.fluid.Fluid;
@ -212,7 +211,7 @@ public class CableBlock extends BlockWithEntity implements Waterloggable {
} }
@Override @Override
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, EntityContext entityContext) { public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext shapeContext) {
if (state.get(COVERED)) { if (state.get(COVERED)) {
return VoxelShapes.fullCube(); return VoxelShapes.fullCube();
} }

View file

@ -27,7 +27,6 @@ package techreborn.blocks.lighting;
import net.fabricmc.fabric.api.block.FabricBlockSettings; import net.fabricmc.fabric.api.block.FabricBlockSettings;
import net.minecraft.block.*; import net.minecraft.block.*;
import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.EntityContext;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemPlacementContext; import net.minecraft.item.ItemPlacementContext;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -85,7 +84,7 @@ public class BlockLamp extends BaseBlockEntityProvider {
} }
@Override @Override
public VoxelShape getOutlineShape(BlockState blockState, BlockView blockView, BlockPos blockPos, EntityContext entityContext) { public VoxelShape getOutlineShape(BlockState blockState, BlockView blockView, BlockPos blockPos, ShapeContext shapeContext) {
return shape[blockState.get(FACING).ordinal()]; return shape[blockState.get(FACING).ordinal()];
} }

View file

@ -28,9 +28,9 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockRenderType;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Material; import net.minecraft.block.Material;
import net.minecraft.block.ShapeContext;
import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.item.TooltipContext; import net.minecraft.client.item.TooltipContext;
import net.minecraft.entity.EntityContext;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemPlacementContext; import net.minecraft.item.ItemPlacementContext;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -159,7 +159,7 @@ public class BlockAlarm extends BaseBlockEntityProvider {
@Override @Override
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, EntityContext entityContext) { public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext shapeContext) {
return shape[getFacing(state).ordinal()]; return shape[getFacing(state).ordinal()];
} }

View file

@ -71,7 +71,7 @@ public class BlockRubberLog extends PillarBlock {
public static BooleanProperty HAS_SAP = BooleanProperty.of("hassap"); public static BooleanProperty HAS_SAP = BooleanProperty.of("hassap");
public BlockRubberLog() { public BlockRubberLog() {
super(Settings.method_26240(Material.WOOD, (blockState) -> MaterialColor.SPRUCE) super(Settings.of(Material.WOOD, (blockState) -> MaterialColor.SPRUCE)
.strength(2.0F, 2f) .strength(2.0F, 2f)
.sounds(BlockSoundGroup.WOOD) .sounds(BlockSoundGroup.WOOD)
.ticksRandomly()); .ticksRandomly());

View file

@ -76,7 +76,7 @@ public abstract class BaseDynamicFluidBakedModel implements BakedModel, FabricBa
if (fluid != Fluids.EMPTY) { if (fluid != Fluids.EMPTY) {
FluidRenderHandler fluidRenderHandler = FluidRenderHandlerRegistry.INSTANCE.get(fluid); FluidRenderHandler fluidRenderHandler = FluidRenderHandlerRegistry.INSTANCE.get(fluid);
BakedModel fluidModel = bakedModelManager.getModel(getFluidModel()); BakedModel fluidModel = bakedModelManager.getModel(getFluidModel());
int fluidColor = fluidRenderHandler.getFluidColor(MinecraftClient.getInstance().world, MinecraftClient.getInstance().player.getSenseCenterPos(), fluid.getDefaultState()); int fluidColor = fluidRenderHandler.getFluidColor(MinecraftClient.getInstance().world, MinecraftClient.getInstance().player.getBlockPos(), fluid.getDefaultState());
Sprite fluidSprite = fluidRenderHandler.getFluidSprites(MinecraftClient.getInstance().world, BlockPos.ORIGIN, fluid.getDefaultState())[0]; Sprite fluidSprite = fluidRenderHandler.getFluidSprites(MinecraftClient.getInstance().world, BlockPos.ORIGIN, fluid.getDefaultState())[0];
int color = new Color((float) (fluidColor >> 16 & 255) / 255.0F, (float) (fluidColor >> 8 & 255) / 255.0F, (float) (fluidColor & 255) / 255.0F).getColor(); int color = new Color((float) (fluidColor >> 16 & 255) / 255.0F, (float) (fluidColor >> 8 & 255) / 255.0F, (float) (fluidColor & 255) / 255.0F).getColor();
context.pushTransform(quad -> { context.pushTransform(quad -> {

View file

@ -89,7 +89,7 @@ public class EntityNukePrimed extends TntEntity {
if (!TechRebornConfig.nukeEnabled) { if (!TechRebornConfig.nukeEnabled) {
return; return;
} }
RebornExplosion nukeExplosion = new RebornExplosion(getSenseCenterPos(), world, TechRebornConfig.nukeRadius); RebornExplosion nukeExplosion = new RebornExplosion(getBlockPos(), world, TechRebornConfig.nukeRadius);
nukeExplosion.setLivingBase(getCausingEntity()); nukeExplosion.setLivingBase(getCausingEntity());
nukeExplosion.explode(); nukeExplosion.explode();
} }

View file

@ -117,7 +117,7 @@ public class StackToolTipHandler implements ItemTooltipCallback {
boolean hasData = false; boolean hasData = false;
if (stack.hasTag() && stack.getTag().contains("blockEntity_data")) { if (stack.hasTag() && stack.getTag().contains("blockEntity_data")) {
CompoundTag blockEntityData = stack.getTag().getCompound("blockEntity_data"); CompoundTag blockEntityData = stack.getTag().getCompound("blockEntity_data");
blockEntity.fromTag(blockEntityData); blockEntity.fromTag(blockEntity.getCachedState(), blockEntityData);
hasData = true; hasData = true;
components.add(new LiteralText("Block data contained").formatted(Formatting.DARK_GREEN)); components.add(new LiteralText("Block data contained").formatted(Formatting.DARK_GREEN));
} }

View file

@ -51,7 +51,7 @@ public class ScrapBoxItem extends Item {
List<RebornRecipe> scrapboxRecipeList = ModRecipes.SCRAPBOX.getRecipes(world); List<RebornRecipe> scrapboxRecipeList = ModRecipes.SCRAPBOX.getRecipes(world);
int random = world.random.nextInt(scrapboxRecipeList.size()); int random = world.random.nextInt(scrapboxRecipeList.size());
ItemStack out = scrapboxRecipeList.get(random).getOutputs().get(0); ItemStack out = scrapboxRecipeList.get(random).getOutputs().get(0);
WorldUtils.dropItem(out, world, player.getSenseCenterPos()); WorldUtils.dropItem(out, world, player.getBlockPos());
stack.decrement(1); stack.decrement(1);
} }
return new TypedActionResult<>(ActionResult.SUCCESS, stack); return new TypedActionResult<>(ActionResult.SUCCESS, stack);

View file

@ -38,8 +38,8 @@ public class PaintingToolItem extends Item {
BlockState blockState = context.getWorld().getBlockState(context.getBlockPos()); BlockState blockState = context.getWorld().getBlockState(context.getBlockPos());
if (player.isSneaking()) { if (player.isSneaking()) {
if (blockState.method_26216(context.getWorld(), context.getBlockPos()) if (blockState.isOpaqueFullCube(context.getWorld(), context.getBlockPos())
&& blockState.getBlock().getDefaultState().method_26216(context.getWorld(), context.getBlockPos())) { && blockState.getBlock().getDefaultState().isOpaqueFullCube(context.getWorld(), context.getBlockPos())) {
context.getStack().getOrCreateTag().put("cover", NbtHelper.fromBlockState(blockState)); context.getStack().getOrCreateTag().put("cover", NbtHelper.fromBlockState(blockState));
return ActionResult.SUCCESS; return ActionResult.SUCCESS;
} }