if (MainProxy.isPipeControllerEquipped(entityplayer)) {
if(MainProxy.isServer(entityplayer.worldObj)) {
if(settings == null || settings.openNetworkMonitor) {
NewGuiHandler.getGui(PipeController.class).setTilePos(container).open(entityplayer);
} else {
entityplayer.addChatComponentMessage(new ChatComponentTranslation("lp.chat.permissiondenied"));
}
}
return true;
}
if(handleClick(entityplayer, settings)) {
return true;
}
if (entityplayer.getCurrentEquippedItem() == null) {
if (!entityplayer.isSneaking()) return false;
if(MainProxy.isClient(entityplayer.worldObj)) {
if(!LogisticsHUDRenderer.instance().hasLasers()) {
MainProxy.sendPacketToServer(PacketHandler.getPacket(RequestRoutingLasersPacket.class).setPosX(getX()).setPosY(getY()).setPosZ(getZ()));
} else {
LogisticsHUDRenderer.instance().resetLasers();
}
}
if (LPConstants.DEBUG) {
doDebugStuff(entityplayer);
}
return true;
}
if (entityplayer.getCurrentEquippedItem().getItem() == LogisticsPipes.LogisticsRemoteOrderer) {
if(MainProxy.isServer(entityplayer.worldObj)) {
if(settings == null || settings.openRequest) {
entityplayer.openGui(LogisticsPipes.instance, GuiIDs.GUI_Normal_Orderer_ID, getWorld(), getX(), getY(), getZ());
} else {
entityplayer.addChatComponentMessage(new ChatComponentTranslation("lp.chat.permissiondenied"));
}
}
return true;
}
if (SimpleServiceLocator.toolWrenchHandler.isWrenchEquipped(entityplayer) && SimpleServiceLocator.toolWrenchHandler.canWrench(entityplayer, this.getX(), this.getY(), this.getZ())) {
if(MainProxy.isServer(entityplayer.worldObj)) {
if (settings == null || settings.openGui) {
if (getLogisticsModule() != null && getLogisticsModule() instanceof LogisticsGuiModule) {
((LogisticsGuiModule)getLogisticsModule()).getPipeGuiProviderForModule().setTilePos(this.container).open(entityplayer);
} else {
onWrenchClicked(entityplayer);
}
} else {
entityplayer.addChatComponentMessage(new ChatComponentTranslation("lp.chat.permissiondenied"));
}
}
SimpleServiceLocator.toolWrenchHandler.wrenchUsed(entityplayer, this.getX(), this.getY(), this.getZ());
return true;
}