diff --git a/src/main/java/noppes/npcs/EventHooks.java b/src/main/java/noppes/npcs/EventHooks.java index 18931ac86..34269f4a1 100644 --- a/src/main/java/noppes/npcs/EventHooks.java +++ b/src/main/java/noppes/npcs/EventHooks.java @@ -876,7 +876,7 @@ public class EventHooks { public static void onPartyFinished(Party party, Quest quest) { EntityPlayer player = party.getPartyLeader(); - if(player != null){ + if (player != null) { PlayerDataScript handler = ScriptController.Instance.getPlayerScripts(player); PartyEvent.PartyQuestCompletedEvent event = new PartyEvent.PartyQuestCompletedEvent(party, quest); handler.callScript(EnumScriptType.PARTY_QUEST_COMPLETED, event); @@ -886,7 +886,7 @@ public class EventHooks { public static void onPartyQuestSet(Party party, PartyEvent.PartyQuestSetEvent event) { EntityPlayer player = party.getPartyLeader(); - if(player != null){ + if (player != null) { PlayerDataScript handler = ScriptController.Instance.getPlayerScripts(player); handler.callScript(EnumScriptType.PARTY_QUEST_SET, event); NpcAPI.EVENT_BUS.post(event); @@ -895,7 +895,7 @@ public class EventHooks { public static void onPartyTurnIn(Party party, PartyEvent.PartyQuestTurnedInEvent event) { EntityPlayer player = party.getPartyLeader(); - if(player != null){ + if (player != null) { PlayerDataScript handler = ScriptController.Instance.getPlayerScripts(player); handler.callScript(EnumScriptType.PARTY_QUEST_TURNED_IN, event); NpcAPI.EVENT_BUS.post(event); @@ -904,7 +904,7 @@ public class EventHooks { public static void onPartyInvite(Party party, PartyEvent.PartyInviteEvent event) { EntityPlayer player = party.getPartyLeader(); - if(player != null){ + if (player != null) { PlayerDataScript handler = ScriptController.Instance.getPlayerScripts(player); handler.callScript(EnumScriptType.PARTY_INVITE, event); NpcAPI.EVENT_BUS.post(event); @@ -913,7 +913,7 @@ public class EventHooks { public static void onPartyKick(Party party, PartyEvent.PartyKickEvent event) { EntityPlayer player = party.getPartyLeader(); - if(player != null){ + if (player != null) { PlayerDataScript handler = ScriptController.Instance.getPlayerScripts(player); handler.callScript(EnumScriptType.PARTY_KICK, event); NpcAPI.EVENT_BUS.post(event); @@ -922,7 +922,7 @@ public class EventHooks { public static void onPartyLeave(Party party, PartyEvent.PartyLeaveEvent event) { EntityPlayer player = party.getPartyLeader(); - if(player != null){ + if (player != null) { PlayerDataScript handler = ScriptController.Instance.getPlayerScripts(player); handler.callScript(EnumScriptType.PARTY_LEAVE, event); NpcAPI.EVENT_BUS.post(event); @@ -931,7 +931,7 @@ public class EventHooks { public static void onPartyDisband(Party party, PartyEvent.PartyDisbandEvent event) { EntityPlayer player = party.getPartyLeader(); - if(player != null){ + if (player != null) { PlayerDataScript handler = ScriptController.Instance.getPlayerScripts(player); handler.callScript(EnumScriptType.PARTY_DISBAND, event); NpcAPI.EVENT_BUS.post(event); diff --git a/src/main/java/noppes/npcs/client/NoppesUtil.java b/src/main/java/noppes/npcs/client/NoppesUtil.java index ede0e0df9..620142564 100644 --- a/src/main/java/noppes/npcs/client/NoppesUtil.java +++ b/src/main/java/noppes/npcs/client/NoppesUtil.java @@ -194,7 +194,7 @@ public class NoppesUtil { Dialog dialog = new Dialog(); dialog.readNBT(compound); GuiScreen gui = Minecraft.getMinecraft().currentScreen; - if(!(gui instanceof GuiDialogInteract)) { + if (!(gui instanceof GuiDialogInteract)) { if (ConfigExperimental.ModernGuiSystem) { if (dialog.hasQuest()) { CustomNpcs.proxy.openGui(player, new GuiModernQuestDialog(npc, dialog.getQuest(), dialog, -2)); @@ -204,8 +204,7 @@ public class NoppesUtil { } else { CustomNpcs.proxy.openGui(player, new GuiDialogInteract(npc, dialog)); } - } - else { + } else { GuiDialogInteract dia = (GuiDialogInteract) gui; dia.appendDialog(dialog); } diff --git a/src/main/java/noppes/npcs/client/gui/SubGuiMagicCycle.java b/src/main/java/noppes/npcs/client/gui/SubGuiMagicCycle.java index 1ffbd9b07..ab975d3ae 100644 --- a/src/main/java/noppes/npcs/client/gui/SubGuiMagicCycle.java +++ b/src/main/java/noppes/npcs/client/gui/SubGuiMagicCycle.java @@ -78,10 +78,10 @@ public class SubGuiMagicCycle extends SubGuiInterface implements ITextfieldListe String index = "gui.unused"; String priority = "gui.unused"; - if(cycle.layout == EnumDiagramLayout.MANUAL) { + if (cycle.layout == EnumDiagramLayout.MANUAL) { index = "X"; priority = "Y"; - } else if(cycle.layout.isManual()) { + } else if (cycle.layout.isManual()) { index = "magic.index"; priority = "magic.priority"; } diff --git a/src/main/java/noppes/npcs/client/gui/SubGuiNpcDialogVisual.java b/src/main/java/noppes/npcs/client/gui/SubGuiNpcDialogVisual.java index 4e32baa4f..e58b90810 100644 --- a/src/main/java/noppes/npcs/client/gui/SubGuiNpcDialogVisual.java +++ b/src/main/java/noppes/npcs/client/gui/SubGuiNpcDialogVisual.java @@ -41,9 +41,9 @@ public class SubGuiNpcDialogVisual extends SubGuiInterface implements ISubGuiLis GuiMenuTopButton general = new GuiMenuTopButton(1, guiLeft + 4, guiTop - 17, "General"); GuiMenuTopButton spacing = new GuiMenuTopButton(2, general.xPosition + general.getWidth(), guiTop - 17, "Spacing"); GuiMenuTopButton images = new GuiMenuTopButton(3, spacing.xPosition + spacing.getWidth(), guiTop - 17, "Images"); - GuiMenuTopButton colours = new GuiMenuTopButton(5, images.xPosition + images.getWidth(), guiTop - 17, "Colors"); + GuiMenuTopButton colours = new GuiMenuTopButton(5, images.xPosition + images.getWidth(), guiTop - 17, "Colors"); - topButtons = new GuiMenuTopButton[]{general,images,spacing,close,colours}; + topButtons = new GuiMenuTopButton[]{general, images, spacing, close, colours}; for (GuiMenuTopButton button : topButtons) { button.active = button.id == activeMenu; addButton(button); @@ -243,8 +243,7 @@ public class SubGuiNpcDialogVisual extends SubGuiInterface implements ISubGuiLis getButton(24).setVisible(dialogImage.imageType == 0); getLabel(21).enabled = dialogImage.imageType == 0; } - } - else if (activeMenu == 5) { + } else if (activeMenu == 5) { addButton(new GuiNpcButtonYesNo(10, guiLeft + 180, y += 22, 60, 20, dialog.colorData.getEnableColorSettings())); addLabel(new GuiNpcLabel(10, "dialog.enableColorSettings", guiLeft + 4, y + 5)); if (dialog.colorData.getEnableColorSettings()) { @@ -432,7 +431,7 @@ public class SubGuiNpcDialogVisual extends SubGuiInterface implements ISubGuiLis if (activeMenu == 5) { DialogColorData colData = dialog.colorData; if (button.id == 10) { - colData.setEnableColorSettings(button.getValue()==1); + colData.setEnableColorSettings(button.getValue() == 1); } if (button.id == 11) { setSubGui(new SubGuiColorSelector(colData.getLineColor1())); @@ -497,13 +496,13 @@ public class SubGuiNpcDialogVisual extends SubGuiInterface implements ISubGuiLis colData.setLineColor1(((SubGuiColorSelector) subgui).color); } else if (lastColorClicked == 3) { colData.setLineColor2(((SubGuiColorSelector) subgui).color); - }else if (lastColorClicked == 4) { + } else if (lastColorClicked == 4) { colData.setLineColor3(((SubGuiColorSelector) subgui).color); - }else if (lastColorClicked == 5) { + } else if (lastColorClicked == 5) { colData.setSlotColor(((SubGuiColorSelector) subgui).color); - }else if (lastColorClicked == 6) { + } else if (lastColorClicked == 6) { colData.setButtonAcceptColor(((SubGuiColorSelector) subgui).color); - }else if (lastColorClicked == 7) { + } else if (lastColorClicked == 7) { colData.setButtonRejectColor(((SubGuiColorSelector) subgui).color); } initGui(); diff --git a/src/main/java/noppes/npcs/client/gui/SubGuiScriptParticle.java b/src/main/java/noppes/npcs/client/gui/SubGuiScriptParticle.java index d28977979..2cd7587e6 100644 --- a/src/main/java/noppes/npcs/client/gui/SubGuiScriptParticle.java +++ b/src/main/java/noppes/npcs/client/gui/SubGuiScriptParticle.java @@ -105,7 +105,7 @@ public class SubGuiScriptParticle extends SubGuiInterface implements ITextfieldL } @Override - public void close(){ + public void close() { GuiNpcTextField.unfocus(); super.close(); } diff --git a/src/main/java/noppes/npcs/client/gui/player/modern/BlurEventHandler.java b/src/main/java/noppes/npcs/client/gui/player/modern/BlurEventHandler.java index 7726d9a3b..cf06df1f9 100644 --- a/src/main/java/noppes/npcs/client/gui/player/modern/BlurEventHandler.java +++ b/src/main/java/noppes/npcs/client/gui/player/modern/BlurEventHandler.java @@ -16,12 +16,13 @@ public class BlurEventHandler { if (Minecraft.getMinecraft().theWorld != null) { EntityRenderer er = Minecraft.getMinecraft().entityRenderer; if (er.getShaderGroup() == null && (event.gui instanceof GuiModernDialogInteract) || (event.gui instanceof GuiModernQuestDialog)) { - loadEffect(er,new ResourceLocation("customnpcs", "shaders/post/blur.json")); - } else if (er.getShaderGroup()!=null && !(event.gui instanceof GuiModernDialogInteract)) { + loadEffect(er, new ResourceLocation("customnpcs", "shaders/post/blur.json")); + } else if (er.getShaderGroup() != null && !(event.gui instanceof GuiModernDialogInteract)) { er.deactivateShader(); } } } + public static void loadEffect(EntityRenderer er, ResourceLocation p_175069_1_) { if (er.theShaderGroup != null) { er.theShaderGroup.deleteShaderGroup(); diff --git a/src/main/java/noppes/npcs/client/gui/util/GuiNpcSquareButton.java b/src/main/java/noppes/npcs/client/gui/util/GuiNpcSquareButton.java index affd0ad52..5c8d10eb5 100644 --- a/src/main/java/noppes/npcs/client/gui/util/GuiNpcSquareButton.java +++ b/src/main/java/noppes/npcs/client/gui/util/GuiNpcSquareButton.java @@ -102,7 +102,7 @@ public class GuiNpcSquareButton extends GuiNpcButton { } // Or if click is in the icon area, we also treat it as a click. return mouseX >= xPosition && mouseX < xPosition + size && - mouseY >= yPosition && mouseY < yPosition + iconAreaHeight; + mouseY >= yPosition && mouseY < yPosition + iconAreaHeight; } @Override diff --git a/src/main/java/noppes/npcs/client/gui/util/GuiTexturedButton.java b/src/main/java/noppes/npcs/client/gui/util/GuiTexturedButton.java index cf246292b..cb9657083 100644 --- a/src/main/java/noppes/npcs/client/gui/util/GuiTexturedButton.java +++ b/src/main/java/noppes/npcs/client/gui/util/GuiTexturedButton.java @@ -93,8 +93,8 @@ public class GuiTexturedButton extends GuiNpcButton { mc.getTextureManager().bindTexture(this.location); this.drawTexturedModalRect(0, 0, this.textureX, this.textureY, this.width, this.height); GL11.glTranslated(0.0D, 0.0D, 0.1D); - this.drawCenteredString(mc.fontRenderer, this.label, (int) (this.xPosition + ((float)this.width)*scale / 2f), - (int) (this.yPosition+(((float)this.height)*scale- ClientProxy.Font.height()+4) / 2f), this.color); + this.drawCenteredString(mc.fontRenderer, this.label, (int) (this.xPosition + ((float) this.width) * scale / 2f), + (int) (this.yPosition + (((float) this.height) * scale - ClientProxy.Font.height() + 4) / 2f), this.color); } else { FontRenderer fontrenderer = mc.fontRenderer; mc.getTextureManager().bindTexture(buttonTextures); @@ -159,12 +159,11 @@ public class GuiTexturedButton extends GuiNpcButton { } @Override - public boolean mousePressed(Minecraft minecraft, int i, int j) - { + public boolean mousePressed(Minecraft minecraft, int i, int j) { boolean bo = this.enabled && this.visible && i >= this.xPosition && j >= this.yPosition - && i < this.xPosition + this.width*scale && j < this.yPosition + this.height*scale; - if(bo && display != null && display.length != 0){ - setDisplay((getValue()+1) % display.length); + && i < this.xPosition + this.width * scale && j < this.yPosition + this.height * scale; + if (bo && display != null && display.length != 0) { + setDisplay((getValue() + 1) % display.length); } return bo; } diff --git a/src/main/java/noppes/npcs/controllers/CustomEffectController.java b/src/main/java/noppes/npcs/controllers/CustomEffectController.java index bd3cf8531..167af222a 100644 --- a/src/main/java/noppes/npcs/controllers/CustomEffectController.java +++ b/src/main/java/noppes/npcs/controllers/CustomEffectController.java @@ -520,7 +520,7 @@ public class CustomEffectController implements ICustomEffectHandler { @Override public int getEffectDuration(IPlayer player, ICustomEffect effect) { - if(effect == null) + if (effect == null) return -1; return getEffectDuration(player, effect.getID(), effect.getIndex()); } diff --git a/src/main/java/noppes/npcs/controllers/CustomGuiController.java b/src/main/java/noppes/npcs/controllers/CustomGuiController.java index 66decf7de..7ee9306f8 100644 --- a/src/main/java/noppes/npcs/controllers/CustomGuiController.java +++ b/src/main/java/noppes/npcs/controllers/CustomGuiController.java @@ -77,7 +77,7 @@ public class CustomGuiController { public static void onButton(CustomGuiEvent.ButtonEvent event) { EntityPlayer player = (EntityPlayer) event.player.getMCEntity(); - if(player != null){ + if (player != null) { ScriptGui gui = getOpenGui(player); if (checkGui(event) && gui != null) { gui.getScriptHandler(player).callScript(EnumScriptType.CUSTOM_GUI_BUTTON, event); @@ -88,7 +88,7 @@ public class CustomGuiController { public static void onSlotChange(CustomGuiEvent.SlotEvent event) { EntityPlayer player = (EntityPlayer) event.player.getMCEntity(); - if(player != null){ + if (player != null) { ScriptGui gui = getOpenGui(player); if (checkGui(event) && gui != null) { gui.getScriptHandler(player).callScript(EnumScriptType.CUSTOM_GUI_SLOT, event); @@ -99,7 +99,7 @@ public class CustomGuiController { public static boolean onSlotClick(CustomGuiEvent.SlotClickEvent event) { EntityPlayer player = (EntityPlayer) event.player.getMCEntity(); - if(player != null){ + if (player != null) { ScriptGui gui = getOpenGui(player); if (checkGui(event) && gui != null) { gui.getScriptHandler(player).callScript(EnumScriptType.CUSTOM_GUI_SLOT_CLICKED, event); @@ -110,7 +110,7 @@ public class CustomGuiController { public static void onCustomGuiUnfocused(CustomGuiEvent.UnfocusedEvent event) { EntityPlayer player = (EntityPlayer) event.player.getMCEntity(); - if(player != null){ + if (player != null) { ScriptGui gui = getOpenGui(player); if (checkGui(event) && gui != null) { gui.getScriptHandler(player).callScript(EnumScriptType.CUSTOM_GUI_TEXTFIELD, event); @@ -121,7 +121,7 @@ public class CustomGuiController { public static void onScrollClick(CustomGuiEvent.ScrollEvent event) { EntityPlayer player = (EntityPlayer) event.player.getMCEntity(); - if(player != null){ + if (player != null) { ScriptGui gui = getOpenGui(player); if (checkGui(event) && gui != null) { gui.getScriptHandler(player).callScript(EnumScriptType.CUSTOM_GUI_SCROLL, event); @@ -132,7 +132,7 @@ public class CustomGuiController { public static void onClose(CustomGuiEvent.CloseEvent event) { EntityPlayer player = (EntityPlayer) event.player.getMCEntity(); - if(player != null){ + if (player != null) { PlayerDataScript handler = ScriptController.Instance.getPlayerScripts(player); handler.callScript(EnumScriptType.CUSTOM_GUI_CLOSED, event); } diff --git a/src/main/java/noppes/npcs/controllers/data/action/Action.java b/src/main/java/noppes/npcs/controllers/data/action/Action.java index 0ff50dbee..cc8762f45 100644 --- a/src/main/java/noppes/npcs/controllers/data/action/Action.java +++ b/src/main/java/noppes/npcs/controllers/data/action/Action.java @@ -4,7 +4,6 @@ import noppes.npcs.api.handler.data.IAction; import noppes.npcs.scripted.ScriptedActionManager; import java.util.HashMap; -import java.util.LinkedList; import java.util.Map; import java.util.function.Consumer; diff --git a/src/main/java/noppes/npcs/scripted/entity/ScriptNpc.java b/src/main/java/noppes/npcs/scripted/entity/ScriptNpc.java index 8ffb84820..7ba7136df 100644 --- a/src/main/java/noppes/npcs/scripted/entity/ScriptNpc.java +++ b/src/main/java/noppes/npcs/scripted/entity/ScriptNpc.java @@ -522,12 +522,12 @@ public class ScriptNpc extends ScriptLiving imp return npc.stats.aimType == 1; } - public void aimWhileShooting(boolean aimWhileShooting){ + public void aimWhileShooting(boolean aimWhileShooting) { npc.stats.aimType = (byte) (aimWhileShooting ? 1 : 0); } public void setAimType(byte aimWhileShooting) { - if(aimWhileShooting < 0 || aimWhileShooting > 2) + if (aimWhileShooting < 0 || aimWhileShooting > 2) return; npc.stats.aimType = aimWhileShooting; }