From 603119e1e6ade513ef5e55860081fbd5a6e0c18f Mon Sep 17 00:00:00 2001 From: Jonathan Coates Date: Tue, 23 Nov 2021 21:17:34 +0000 Subject: [PATCH] Replace magic values with Forge constants Gonna have to replace these in 1.17 as Minecraft exposes these by default! --- .../java/dan200/computercraft/shared/common/TileGeneric.java | 3 ++- .../computercraft/shared/turtle/core/TurtlePlaceCommand.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/dan200/computercraft/shared/common/TileGeneric.java b/src/main/java/dan200/computercraft/shared/common/TileGeneric.java index 7e3fd349b..0654044a0 100644 --- a/src/main/java/dan200/computercraft/shared/common/TileGeneric.java +++ b/src/main/java/dan200/computercraft/shared/common/TileGeneric.java @@ -16,6 +16,7 @@ import net.minecraft.util.ActionResultType; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; +import net.minecraftforge.common.util.Constants; import javax.annotation.Nonnull; @@ -35,7 +36,7 @@ public abstract class TileGeneric extends TileEntity setChanged(); BlockPos pos = getBlockPos(); BlockState state = getBlockState(); - getLevel().sendBlockUpdated( pos, state, state, 3 ); + getLevel().sendBlockUpdated( pos, state, state, Constants.BlockFlags.DEFAULT ); } @Nonnull diff --git a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java index 1f2b217bb..415776bcf 100644 --- a/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java +++ b/src/main/java/dan200/computercraft/shared/turtle/core/TurtlePlaceCommand.java @@ -33,6 +33,7 @@ import net.minecraft.util.text.StringTextComponent; import net.minecraft.world.World; import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.Constants; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.wrapper.InvWrapper; @@ -324,7 +325,7 @@ public class TurtlePlaceCommand implements ITurtleCommand } } signTile.setChanged(); - world.sendBlockUpdated( tile.getBlockPos(), tile.getBlockState(), tile.getBlockState(), 3 ); + world.sendBlockUpdated( tile.getBlockPos(), tile.getBlockState(), tile.getBlockState(), Constants.BlockFlags.DEFAULT ); } private static class ErrorMessage