More Cleanup

This commit is contained in:
Kam committed 2025-05-20 13:53:32 -04:00
1 parent 43bc1eb81f
commit ae7e7018c5
12 files changed
+39 -42

No files matched your search

+7 -7
View File
@@ -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);
@@ -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);
}
@@ -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";
}
@@ -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();
@@ -105,7 +105,7 @@ public class SubGuiScriptParticle extends SubGuiInterface implements ITextfieldL
}
@Override
public void close(){
public void close() {
GuiNpcTextField.unfocus();
super.close();
}
@@ -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();
@@ -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
@@ -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;
}
@@ -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());
}
@@ -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);
}
@@ -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;
@@ -522,12 +522,12 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> 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;
}