Skip to content

Commit 97e58eb

Browse files
committed
Small adjustments to the meter and upgrades.
Signed-off-by: King Lemming <kinglemming@gmail.com>
1 parent ceb8cdf commit 97e58eb

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/main/java/cofh/thermalfoundation/item/ItemMeter.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package cofh.thermalfoundation.item;
22

3-
import cofh.api.block.IBlockConfigGui;
3+
import cofh.api.block.IConfigGui;
44
import cofh.api.block.IBlockInfo;
55
import cofh.api.tileentity.ITileInfo;
66
import cofh.core.item.ItemMulti;
@@ -58,31 +58,27 @@ private boolean doMultimeterUseFirst(ItemStack stack, EntityPlayer player, World
5858
ArrayList<ITextComponent> info = new ArrayList<>();
5959

6060
if (ServerHelper.isClientWorld(world)) {
61-
if (block instanceof IBlockConfigGui || block instanceof IBlockInfo) {
62-
ServerHelper.sendItemUsePacket(world, pos, side, hand, hitX, hitY, hitZ);
61+
if (block instanceof IConfigGui || block instanceof IBlockInfo) {
6362
return true;
6463
}
6564
TileEntity tile = world.getTileEntity(pos);
6665
return tile instanceof ITileInfo;
6766
}
68-
if (player.isSneaking() && block instanceof IBlockConfigGui) {
69-
if (((IBlockConfigGui) block).openConfigGui(world, pos, side, player)) {
67+
if (player.isSneaking() && block instanceof IConfigGui) {
68+
if (((IConfigGui) block).openConfigGui(world, pos, side, player)) {
7069
return true;
7170
}
7271
}
7372
if (block instanceof IBlockInfo) {
7473
((IBlockInfo) (block)).getBlockInfo(info, world, pos, side, player, false);
75-
7674
ChatHelper.sendIndexedChatMessagesToPlayer(player, info);
7775
info.clear();
7876
return true;
7977
} else {
8078
TileEntity tile = world.getTileEntity(pos);
8179
if (tile instanceof ITileInfo) {
82-
if (ServerHelper.isServerWorld(world)) {
83-
((ITileInfo) tile).getTileInfo(info, side, player, false);
84-
ChatHelper.sendIndexedChatMessagesToPlayer(player, info);
85-
}
80+
((ITileInfo) tile).getTileInfo(info, side, player, false);
81+
ChatHelper.sendIndexedChatMessagesToPlayer(player, info);
8682
info.clear();
8783
return true;
8884
}

src/main/java/cofh/thermalfoundation/item/ItemUpgrade.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ public EnumActionResult onItemUseFirst(EntityPlayer player, World world, BlockPo
115115
ChatHelper.sendIndexedChatMessageToPlayer(player, new TextComponentTranslation("chat.thermalfoundation.upgrade.install.failure"));
116116
}
117117
return EnumActionResult.SUCCESS;
118+
} else if (((IUpgradeable) tile).canUpgrade(stack)) {
119+
return EnumActionResult.SUCCESS;
118120
}
119121
}
120122
return EnumActionResult.PASS;

0 commit comments

Comments
 (0)