1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-14 04:00:30 +00:00

Replace magic values with Forge constants

Gonna have to replace these in 1.17 as Minecraft exposes these by
default!
This commit is contained in:
Jonathan Coates 2021-11-23 21:17:34 +00:00
parent d9b3f17b52
commit 603119e1e6
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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