Fix nanosaber log spam
This commit is contained in:
parent
08087871a1
commit
e0300d3a05
1 changed files with 15 additions and 15 deletions
|
@ -120,34 +120,34 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player,
|
public ActionResult<ItemStack> onItemRightClick(final World world, final EntityPlayer player,
|
||||||
EnumHand hand) {
|
final EnumHand hand) {
|
||||||
ItemStack stack = player.getHeldItem(hand);
|
final ItemStack stack = player.getHeldItem(hand);
|
||||||
if (player.isSneaking()) {
|
if (player.isSneaking()) {
|
||||||
if (!PoweredItem.canUseEnergy(cost, stack)) {
|
if (!PoweredItem.canUseEnergy(this.cost, stack)) {
|
||||||
ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString(
|
ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString(
|
||||||
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.nanosaberEnergyErrorTo") + " "
|
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.nanosaberEnergyErrorTo") + " "
|
||||||
+ TextFormatting.GOLD + I18n
|
+ TextFormatting.GOLD + I18n
|
||||||
.translateToLocal("techreborn.message.nanosaberActivate")));
|
.translateToLocal("techreborn.message.nanosaberActivate")));
|
||||||
} else {
|
} else {
|
||||||
if (stack.getTagCompound() == null || !stack.getTagCompound().getBoolean("isActive")) {
|
if (stack.getTagCompound() == null || !stack.getTagCompound().getBoolean("isActive")) {
|
||||||
if (stack.getTagCompound() == null) {
|
if (stack.getTagCompound() == null) {
|
||||||
stack.setTagCompound(new NBTTagCompound());
|
stack.setTagCompound(new NBTTagCompound());
|
||||||
}
|
}
|
||||||
stack.getTagCompound().setBoolean("isActive", true);
|
stack.getTagCompound().setBoolean("isActive", true);
|
||||||
if (!world.isRemote && ConfigTechReborn.NanosaberChat) {
|
if (world.isRemote && ConfigTechReborn.NanosaberChat) {
|
||||||
ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString(
|
ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString(
|
||||||
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " "
|
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " "
|
||||||
+ TextFormatting.GOLD + I18n
|
+ TextFormatting.GOLD + I18n
|
||||||
.translateToLocal("techreborn.message.nanosaberActive")));
|
.translateToLocal("techreborn.message.nanosaberActive")));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
stack.getTagCompound().setBoolean("isActive", false);
|
stack.getTagCompound().setBoolean("isActive", false);
|
||||||
if (!world.isRemote && ConfigTechReborn.NanosaberChat) {
|
if (world.isRemote && ConfigTechReborn.NanosaberChat) {
|
||||||
ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString(
|
ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString(
|
||||||
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " "
|
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " "
|
||||||
+ TextFormatting.GOLD + I18n
|
+ TextFormatting.GOLD + I18n
|
||||||
.translateToLocal("techreborn.message.nanosaberInactive")));
|
.translateToLocal("techreborn.message.nanosaberInactive")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue