Skip to content

Instantly share code, notes, and snippets.

@xbony2
Created January 31, 2015 22:35
Show Gist options
  • Save xbony2/152fa78cacd2f155226e to your computer and use it in GitHub Desktop.
Save xbony2/152fa78cacd2f155226e to your computer and use it in GitHub Desktop.
//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