mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-09-29 15:30:48 +00:00
Be a little smarter about our detection of the placed sign
When placing a sign against a tile entity (such as a turtle or chest), we would consider that block the "placed" one instead, meaning the text was never set. This solution isn't entirely ideal either, but short of capturing block snapshots I'm not sure of a better solution. Fixes #552
This commit is contained in:
parent
914df8b0c7
commit
d405316a4b
@ -365,7 +365,7 @@ public class TurtlePlaceCommand implements ITurtleCommand
|
|||||||
|
|
||||||
// Do the deploying (put everything in the players inventory)
|
// Do the deploying (put everything in the players inventory)
|
||||||
boolean placed = false;
|
boolean placed = false;
|
||||||
|
TileEntity existingTile = turtle.getWorld().getTileEntity( position );
|
||||||
|
|
||||||
// See PlayerInteractionManager.processRightClickBlock
|
// See PlayerInteractionManager.processRightClickBlock
|
||||||
PlayerInteractEvent.RightClickBlock event = ForgeHooks.onRightClickBlock( turtlePlayer, EnumHand.MAIN_HAND, position, side, new Vec3d( hitX, hitY, hitZ ) );
|
PlayerInteractEvent.RightClickBlock event = ForgeHooks.onRightClickBlock( turtlePlayer, EnumHand.MAIN_HAND, position, side, new Vec3d( hitX, hitY, hitZ ) );
|
||||||
@ -409,12 +409,11 @@ public class TurtlePlaceCommand implements ITurtleCommand
|
|||||||
{
|
{
|
||||||
World world = turtle.getWorld();
|
World world = turtle.getWorld();
|
||||||
TileEntity tile = world.getTileEntity( position );
|
TileEntity tile = world.getTileEntity( position );
|
||||||
if( tile == null )
|
if( tile == null || tile == existingTile )
|
||||||
{
|
{
|
||||||
BlockPos newPosition = WorldUtil.moveCoords( position, side );
|
tile = world.getTileEntity( WorldUtil.moveCoords( position, side ) );
|
||||||
tile = world.getTileEntity( newPosition );
|
|
||||||
}
|
}
|
||||||
if( tile != null && tile instanceof TileEntitySign )
|
if( tile instanceof TileEntitySign )
|
||||||
{
|
{
|
||||||
TileEntitySign signTile = (TileEntitySign) tile;
|
TileEntitySign signTile = (TileEntitySign) tile;
|
||||||
String s = (String)extraArguments[0];
|
String s = (String)extraArguments[0];
|
||||||
|
Loading…
Reference in New Issue
Block a user