Created
January 31, 2015 22:35
-
-
Save xbony2/152fa78cacd2f155226e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This class is a stub, obviously. | |
TileEntityRangeTrigger trigger; | |
private boolean checked; | |
@Override | |
public boolean mousePressed(Minecraft minecraft, int i, int j) { | |
if (super.mousePressed(minecraft, i, j)) { | |
checked = !checked; | |
int value = checked ? -2 : -1; | |
trigger.setInvertRedstone(checked); | |
NetworkHelper nh = new NetworkHelper(); | |
System.out.println("DEBUG STUFF"); | |
try { | |
Method m1 = nh.getClass().getMethod("initiateClientTileEntityEvent", TileEntity.class, int.class); | |
m1.setAccessible(true); | |
m1.invoke(trigger, value); | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} | |
return true; | |
} else { | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment