mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 05:19:41 +00:00
Potion Effect Amplifier
This commit is contained in:
1 parent
953a706846
commit
d45bfde162
4 files changed
+56
-14
No files matched your search
@@ -58,7 +58,13 @@ public class SubGuiNpcMeleeProperties extends SubGuiInterface implements ITextfi
|
||||
if (stats.potionType != EnumPotionType.Fire) {
|
||||
y += 30;
|
||||
addLabel(new GuiNpcLabel(7, "stats.amplify", guiLeft + 5, y + 5));
|
||||
addButton(new GuiButtonBiDirectional(7, guiLeft + 85, y, 52, 20, new String[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"}, stats.potionAmp));
|
||||
if (stats.potionType == EnumPotionType.Manual) {
|
||||
addTextField(new GuiNpcTextField(7, this, fontRendererObj, guiLeft + 85, y, 52, 18, stats.potionAmp + ""));
|
||||
getTextField(7).integersOnly = true;
|
||||
getTextField(7).setMinMaxDefault(0, 255, 0);
|
||||
} else {
|
||||
addButton(new GuiButtonBiDirectional(7, guiLeft + 85, y, 52, 20, new String[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"}, stats.potionAmp));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,6 +82,8 @@ public class SubGuiNpcMeleeProperties extends SubGuiInterface implements ITextfi
|
||||
stats.knockback = textfield.getInteger();
|
||||
} else if (textfield.id == 6) {
|
||||
stats.potionDuration = textfield.getInteger();
|
||||
} else if (textfield.id == 7) {
|
||||
stats.potionAmp = textfield.getInteger();
|
||||
} else if (textfield.id == 8) {
|
||||
stats.potionManualId = textfield.getInteger();
|
||||
}
|
||||
@@ -84,7 +92,11 @@ public class SubGuiNpcMeleeProperties extends SubGuiInterface implements ITextfi
|
||||
protected void actionPerformed(GuiButton guibutton) {
|
||||
GuiNpcButton button = (GuiNpcButton) guibutton;
|
||||
if (button.id == 5) {
|
||||
stats.potionType = EnumPotionType.fromOrdinal(button.getValue());
|
||||
EnumPotionType newType = EnumPotionType.fromOrdinal(button.getValue());
|
||||
if (stats.potionType == EnumPotionType.Manual && newType != EnumPotionType.Manual) {
|
||||
stats.potionAmp = 0;
|
||||
}
|
||||
stats.potionType = newType;
|
||||
initGui();
|
||||
}
|
||||
if (button.id == 7) {
|
||||
|
||||
@@ -97,7 +97,13 @@ public class SubGuiNpcProjectiles extends SubGuiInterface implements ITextfieldL
|
||||
} else {
|
||||
internalY += 30;
|
||||
addLabel(new GuiNpcLabel(70, "stats.amplify", guiLeft + 210, internalY + 5));
|
||||
addButton(new GuiButtonBiDirectional(10, guiLeft + 280, internalY, 52, 20, new String[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"}, stats.pEffAmp));
|
||||
if (stats.pEffect == EnumPotionType.Manual) {
|
||||
addTextField(new GuiNpcTextField(10, this, fontRendererObj, guiLeft + 280, internalY, 52, 20, stats.pEffAmp + ""));
|
||||
getTextField(10).integersOnly = true;
|
||||
getTextField(10).setMinMaxDefault(0, 255, 0);
|
||||
} else {
|
||||
addButton(new GuiButtonBiDirectional(10, guiLeft + 280, internalY, 52, 20, new String[]{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"}, stats.pEffAmp));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,6 +138,8 @@ public class SubGuiNpcProjectiles extends SubGuiInterface implements ITextfieldL
|
||||
stats.pSpeed = textfield.getInteger();
|
||||
} else if (textfield.id == 5) {
|
||||
stats.pDur = textfield.getInteger();
|
||||
} else if (textfield.id == 10) {
|
||||
stats.pEffAmp = textfield.getInteger();
|
||||
} else if (textfield.id == 11) {
|
||||
stats.pManualId = textfield.getInteger();
|
||||
}
|
||||
@@ -154,7 +162,11 @@ public class SubGuiNpcProjectiles extends SubGuiInterface implements ITextfieldL
|
||||
stats.pArea = button.getValue();
|
||||
}
|
||||
if (button.id == 4) {
|
||||
stats.pEffect = EnumPotionType.fromOrdinal(button.getValue());
|
||||
EnumPotionType newType = EnumPotionType.fromOrdinal(button.getValue());
|
||||
if (stats.pEffect == EnumPotionType.Manual && newType != EnumPotionType.Manual) {
|
||||
stats.pEffAmp = 0;
|
||||
}
|
||||
stats.pEffect = newType;
|
||||
initGui();
|
||||
}
|
||||
if (button.id == 5) {
|
||||
|
||||
Reference in new issue
Block a user