Let players set freq. transmitter to interactive block (shift click no longer clears on blocks) and unify tooltip
This commit is contained in:
parent
ab1b1ca409
commit
718fc53bbd
1 changed files with 20 additions and 30 deletions
|
@ -50,15 +50,6 @@ public class ItemFrequencyTransmitter extends ItemTRNoDestroy {
|
||||||
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos,
|
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos,
|
||||||
EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
|
EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
|
||||||
ItemStack stack = player.getHeldItem(hand);
|
ItemStack stack = player.getHeldItem(hand);
|
||||||
if (player.isSneaking()) {
|
|
||||||
stack.setTagCompound(null);
|
|
||||||
if (!world.isRemote && ConfigTechReborn.FreqTransmitterChat) {
|
|
||||||
ChatUtils.sendNoSpamMessages(MessageIDs.freqTransmitterID, new TextComponentString(
|
|
||||||
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.coordsHaveBeen") + " "
|
|
||||||
+ TextFormatting.GOLD + I18n.translateToLocal("techreborn.message.cleared")));
|
|
||||||
}
|
|
||||||
return EnumActionResult.PASS;
|
|
||||||
} else {
|
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
stack.setTagCompound(new NBTTagCompound());
|
||||||
stack.getTagCompound().setInteger("x", pos.getX());
|
stack.getTagCompound().setInteger("x", pos.getX());
|
||||||
stack.getTagCompound().setInteger("y", pos.getY());
|
stack.getTagCompound().setInteger("y", pos.getY());
|
||||||
|
@ -79,7 +70,6 @@ public class ItemFrequencyTransmitter extends ItemTRNoDestroy {
|
||||||
}
|
}
|
||||||
return EnumActionResult.SUCCESS;
|
return EnumActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player,
|
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player,
|
||||||
|
@ -105,9 +95,9 @@ public class ItemFrequencyTransmitter extends ItemTRNoDestroy {
|
||||||
int z = stack.getTagCompound().getInteger("z");
|
int z = stack.getTagCompound().getInteger("z");
|
||||||
int dim = stack.getTagCompound().getInteger("dim");
|
int dim = stack.getTagCompound().getInteger("dim");
|
||||||
|
|
||||||
list.add("X: " + x);
|
list.add(TextFormatting.GRAY + "X: " + TextFormatting.GOLD + x);
|
||||||
list.add("Y: " + y);
|
list.add(TextFormatting.GRAY + "Y: " + TextFormatting.GOLD + y);
|
||||||
list.add("X: " + z);
|
list.add(TextFormatting.GRAY + "Z: " + TextFormatting.GOLD + z);
|
||||||
list.add(TextFormatting.DARK_GRAY + DimensionManager.getProviderType(dim).getName());
|
list.add(TextFormatting.DARK_GRAY + DimensionManager.getProviderType(dim).getName());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue