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,35 +50,25 @@ 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(new NBTTagCompound());
|
||||||
stack.setTagCompound(null);
|
stack.getTagCompound().setInteger("x", pos.getX());
|
||||||
if (!world.isRemote && ConfigTechReborn.FreqTransmitterChat) {
|
stack.getTagCompound().setInteger("y", pos.getY());
|
||||||
ChatUtils.sendNoSpamMessages(MessageIDs.freqTransmitterID, new TextComponentString(
|
stack.getTagCompound().setInteger("z", pos.getZ());
|
||||||
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.coordsHaveBeen") + " "
|
stack.getTagCompound().setInteger("dim", world.provider.getDimension());
|
||||||
+ TextFormatting.GOLD + I18n.translateToLocal("techreborn.message.cleared")));
|
|
||||||
}
|
|
||||||
return EnumActionResult.PASS;
|
|
||||||
} else {
|
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
|
||||||
stack.getTagCompound().setInteger("x", pos.getX());
|
|
||||||
stack.getTagCompound().setInteger("y", pos.getY());
|
|
||||||
stack.getTagCompound().setInteger("z", pos.getZ());
|
|
||||||
stack.getTagCompound().setInteger("dim", world.provider.getDimension());
|
|
||||||
|
|
||||||
if (!world.isRemote && ConfigTechReborn.FreqTransmitterChat) {
|
if (!world.isRemote && ConfigTechReborn.FreqTransmitterChat) {
|
||||||
ChatUtils.sendNoSpamMessages(MessageIDs.freqTransmitterID, new TextComponentString(
|
ChatUtils.sendNoSpamMessages(MessageIDs.freqTransmitterID, new TextComponentString(
|
||||||
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " X: " +
|
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " X: " +
|
||||||
TextFormatting.GOLD + pos.getX() +
|
TextFormatting.GOLD + pos.getX() +
|
||||||
TextFormatting.GRAY + " Y: " +
|
TextFormatting.GRAY + " Y: " +
|
||||||
TextFormatting.GOLD + pos.getY() +
|
TextFormatting.GOLD + pos.getY() +
|
||||||
TextFormatting.GRAY + " Z: " +
|
TextFormatting.GRAY + " Z: " +
|
||||||
TextFormatting.GOLD + pos.getZ() +
|
TextFormatting.GOLD + pos.getZ() +
|
||||||
TextFormatting.GRAY + " " + I18n.translateToLocal("techreborn.message.in") + " " +
|
TextFormatting.GRAY + " " + I18n.translateToLocal("techreborn.message.in") + " " +
|
||||||
TextFormatting.GOLD + DimensionManager.getProviderType(world.provider.getDimension())
|
TextFormatting.GOLD + DimensionManager.getProviderType(world.provider.getDimension())
|
||||||
.getName() + " (" + world.provider.getDimension() + ")"));
|
.getName() + " (" + world.provider.getDimension() + ")"));
|
||||||
}
|
|
||||||
return EnumActionResult.SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
return EnumActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -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