This code:
Code:
public boolean processButtonClick(int interfaceId, int componentId, int slotId, int slotId2, int packetId) {
if (interfaceId == 18) {
if (componentId == 9) {
if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET)
unprotect(slotId);
} else if (componentId == 17) {
if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET)
protect(slotId2);
} else if (componentId == 45) {
if (slotId > RESPAWN_LOCATIONS.length)
return false;
currentHub = 255 + slotId;
}
return false;
}
return true;
}
Whenever I click on items on that get ready to respawn interface nothing happens (or eclipse buttonhandler click..... message). How do I make so whenever I click on those buttons/items it's getting read from processButtonClick from deathevent and not from buttonhhandler.java.
I have tried this code;
Code:
if (!player.getControlerManager().processButtonClick(interfaceId,
componentId, slotId, slotId2, packetId))
return;
Doesnt work either.
Have tried to make code like this in buttonhandler;
Code:
if (interfaceId == 18) {
if (componentId == 9) {
if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET)
unprotect(slotId);
} else if (componentId == 17) {
if (packetId == WorldPacketsDecoder.ACTION_BUTTON1_PACKET)
protect(slotId2);
} else if (componentId == 45) {
if (slotId > RESPAWN_LOCATIONS.length)
return false;
currentHub = 255 + slotId;
}
return false;
}
Fixed errors and such, but I still got errors when I clicked on the items.