Skip to content

Commit

Permalink
Merge pull request #5 from GTNewHorizons/fix-disabled
Browse files Browse the repository at this point in the history
Fix inventory scanning always disabled
  • Loading branch information
Dream-Master authored Feb 22, 2024
2 parents 5f4e2a7 + f5839f9 commit 06837a5
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public class ClientProxy extends CommonProxy {
private static final int INVENTORY_PLAYER_WIDTH = 52;
private static final int INVENTORY_PLAYER_HEIGHT = 70;

private boolean isEnabled;
private boolean missingMessageSent;
private Item thaumometer;
private Slot mouseSlot;
Expand Down Expand Up @@ -87,7 +86,6 @@ public void clientTick(TickEvent.ClientTickEvent event) {
new ChatComponentText(
"This server does not have Thaumcraft Inventory Scanning installed. It will be disabled."));
missingMessageSent = true;
isEnabled = false;
}
return;
}
Expand Down Expand Up @@ -177,7 +175,7 @@ public void clientTick(TickEvent.ClientTickEvent event) {

@SubscribeEvent
public void onTooltip(ItemTooltipEvent event) {
if (isEnabled && event.itemStack.getItem() == thaumometer) {
if (TCInventoryScanning.isServerSideInstalled && event.itemStack.getItem() == thaumometer) {
event.toolTip.add("\u00a76" + I18n.format("tcinventoryscan:thaumometerTooltip"));
if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) {
String[] lines = I18n.format("tcinventoryscan:thaumometerTooltipMore").split("\\\\n");
Expand All @@ -190,7 +188,7 @@ public void onTooltip(ItemTooltipEvent event) {

@SubscribeEvent
public void onDrawScreen(GuiScreenEvent.DrawScreenEvent.Post event) {
if (isEnabled && event.gui instanceof GuiContainer) {
if (TCInventoryScanning.isServerSideInstalled && event.gui instanceof GuiContainer) {
Minecraft mc = Minecraft.getMinecraft();
EntityPlayer entityPlayer = mc.thePlayer;
boolean oldHoveringPlayer = isHoveringPlayer;
Expand Down

0 comments on commit 06837a5

Please sign in to comment.