mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 15:49:43 +00:00
Lightning, Orb and Beam Improvements. Outer Glow Configurations for Abilities
This commit is contained in:
1 parent
651f2d0d84
commit
6c7c72b0f9
29 files changed
+2372
-207
No files matched your search
@@ -144,11 +144,12 @@ import noppes.npcs.client.renderer.RenderNpcCrystal;
|
||||
import noppes.npcs.client.renderer.RenderNpcDragon;
|
||||
import noppes.npcs.client.renderer.RenderNpcSlime;
|
||||
import noppes.npcs.client.renderer.RenderProjectile;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilityOrbCube;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilityOrb;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilityDisc;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilityLaser;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilityBeam;
|
||||
import kamkeel.npcs.client.renderer.RenderAbilitySweeper;
|
||||
import kamkeel.npcs.client.renderer.lightning.LightningHandler;
|
||||
import kamkeel.npcs.entity.EntityAbilityOrb;
|
||||
import kamkeel.npcs.entity.EntityAbilityDisc;
|
||||
import kamkeel.npcs.entity.EntityAbilityLaser;
|
||||
@@ -261,8 +262,7 @@ public class ClientProxy extends CommonProxy {
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityNpcDragon.class, new RenderNpcDragon(new ModelNpcDragon(0.0F), 0.5F));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityNpcSlime.class, new RenderNpcSlime(new ModelNpcSlime(16), new ModelNpcSlime(0), 0.25F));
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityProjectile.class, new RenderProjectile());
|
||||
// RenderingRegistry.registerEntityRenderingHandler(EntityAbilityOrb.class, new RenderAbilityOrb());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityAbilityOrb.class, new RenderAbilityOrbCube());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityAbilityOrb.class, new RenderAbilityOrb());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityAbilityDisc.class, new RenderAbilityDisc());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityAbilityLaser.class, new RenderAbilityLaser());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityAbilityBeam.class, new RenderAbilityBeam());
|
||||
@@ -340,6 +340,9 @@ public class ClientProxy extends CommonProxy {
|
||||
TelegraphManager.initClient();
|
||||
MinecraftForge.EVENT_BUS.register(new TelegraphRenderer());
|
||||
|
||||
// Lightning effect rendering system
|
||||
MinecraftForge.EVENT_BUS.register(new LightningHandler());
|
||||
|
||||
if (ConfigClient.InventoryGuiEnabled) {
|
||||
MinecraftForge.EVENT_BUS.register(new TabRegistry());
|
||||
if (TabRegistry.getTabList().isEmpty()) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import kamkeel.npcs.client.renderer.lightning.LightningBolt;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphManager;
|
||||
import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.player.CheckPlayerValue;
|
||||
@@ -115,6 +116,9 @@ public class ClientTickHandler {
|
||||
if (TelegraphManager.ClientInstance != null) {
|
||||
TelegraphManager.ClientInstance.tick(mc.theWorld);
|
||||
}
|
||||
|
||||
// Update lightning bolts for ability effects
|
||||
LightningBolt.updateAll();
|
||||
if (Minecraft.getMinecraft().thePlayer != null && (prevWidth != mc.displayWidth || prevHeight != mc.displayHeight)) {
|
||||
prevWidth = mc.displayWidth;
|
||||
prevHeight = mc.displayHeight;
|
||||
|
||||
@@ -126,6 +126,28 @@ public class SubGuiAbilityDisc extends SubGuiAbilityConfig {
|
||||
// Row 3: Rotation Speed
|
||||
addLabel(new GuiNpcLabel(204, "ability.rotationSpeed", labelX, y + 5));
|
||||
addTextField(createFloatField(204, fieldX, y, 50, disc.getRotationSpeed()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 4: Lightning Effect Enabled
|
||||
addLabel(new GuiNpcLabel(205, "ability.lightning", labelX, y + 5));
|
||||
addButton(new GuiNpcButton(205, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, disc.hasLightningEffect() ? 1 : 0));
|
||||
|
||||
// Only show Lightning settings if Lightning is enabled
|
||||
if (disc.hasLightningEffect()) {
|
||||
y += 24;
|
||||
|
||||
// Row 5: Density + Radius
|
||||
addLabel(new GuiNpcLabel(206, "ability.lightningDensity", labelX, y + 5));
|
||||
GuiNpcTextField densityField = new GuiNpcTextField(206, this, fontRendererObj, fieldX, y, 55, 18, String.valueOf(disc.getLightningDensity()));
|
||||
densityField.setMinMaxDefaultFloat(0.01f, 5.0f, 0.15f);
|
||||
addTextField(densityField);
|
||||
|
||||
addLabel(new GuiNpcLabel(207, "ability.lightningRadius", col2LabelX, y + 5));
|
||||
GuiNpcTextField radiusField = new GuiNpcTextField(207, this, fontRendererObj, col2FieldX, y, 55, 18, String.valueOf(disc.getLightningRadius()));
|
||||
radiusField.setMinMaxDefaultFloat(0.1f, 10.0f, 0.5f);
|
||||
addTextField(radiusField);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -160,6 +182,10 @@ public class SubGuiAbilityDisc extends SubGuiAbilityConfig {
|
||||
disc.setOuterColorEnabled(value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 205:
|
||||
disc.setLightningEffect(value == 1);
|
||||
initGui();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,6 +248,12 @@ public class SubGuiAbilityDisc extends SubGuiAbilityConfig {
|
||||
case 204:
|
||||
disc.setRotationSpeed(parseFloat(field, disc.getRotationSpeed()));
|
||||
break;
|
||||
case 206:
|
||||
disc.setLightningDensity(parseFloat(field, disc.getLightningDensity()));
|
||||
break;
|
||||
case 207:
|
||||
disc.setLightningRadius(parseFloat(field, disc.getLightningRadius()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,6 +127,28 @@ public class SubGuiAbilityEnergyBeam extends SubGuiAbilityConfig {
|
||||
// Row 3: Rotation Speed
|
||||
addLabel(new GuiNpcLabel(204, "ability.rotationSpeed", labelX, y + 5));
|
||||
addTextField(createFloatField(204, fieldX, y, 50, beam.getRotationSpeed()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 4: Lightning Effect Enabled (only affects head)
|
||||
addLabel(new GuiNpcLabel(205, "ability.lightning", labelX, y + 5));
|
||||
addButton(new GuiNpcButton(205, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, beam.hasLightningEffect() ? 1 : 0));
|
||||
|
||||
// Only show Lightning settings if Lightning is enabled
|
||||
if (beam.hasLightningEffect()) {
|
||||
y += 24;
|
||||
|
||||
// Row 5: Density + Radius
|
||||
addLabel(new GuiNpcLabel(206, "ability.lightningDensity", labelX, y + 5));
|
||||
GuiNpcTextField densityField = new GuiNpcTextField(206, this, fontRendererObj, fieldX, y, 55, 18, String.valueOf(beam.getLightningDensity()));
|
||||
densityField.setMinMaxDefaultFloat(0.01f, 5.0f, 0.15f);
|
||||
addTextField(densityField);
|
||||
|
||||
addLabel(new GuiNpcLabel(207, "ability.lightningRadius", col2LabelX, y + 5));
|
||||
GuiNpcTextField radiusField = new GuiNpcTextField(207, this, fontRendererObj, col2FieldX, y, 55, 18, String.valueOf(beam.getLightningRadius()));
|
||||
radiusField.setMinMaxDefaultFloat(0.1f, 10.0f, 0.5f);
|
||||
addTextField(radiusField);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -158,6 +180,10 @@ public class SubGuiAbilityEnergyBeam extends SubGuiAbilityConfig {
|
||||
beam.setOuterColorEnabled(value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 205:
|
||||
beam.setLightningEffect(value == 1);
|
||||
initGui();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,6 +249,12 @@ public class SubGuiAbilityEnergyBeam extends SubGuiAbilityConfig {
|
||||
case 204:
|
||||
beam.setRotationSpeed(parseFloat(field, beam.getRotationSpeed()));
|
||||
break;
|
||||
case 206:
|
||||
beam.setLightningDensity(parseFloat(field, beam.getLightningDensity()));
|
||||
break;
|
||||
case 207:
|
||||
beam.setLightningRadius(parseFloat(field, beam.getLightningRadius()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,6 +111,28 @@ public class SubGuiAbilityLaserShot extends SubGuiAbilityConfig {
|
||||
GuiNpcTextField widthField = createFloatField(203, col2FieldX, y, 55, laser.getOuterColorWidth());
|
||||
widthField.setEnabled(laser.isOuterColorEnabled());
|
||||
addTextField(widthField);
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: Lightning Effect Enabled
|
||||
addLabel(new GuiNpcLabel(204, "ability.lightning", labelX, y + 5));
|
||||
addButton(new GuiNpcButton(204, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, laser.hasLightningEffect() ? 1 : 0));
|
||||
|
||||
// Only show Lightning settings if Lightning is enabled
|
||||
if (laser.hasLightningEffect()) {
|
||||
y += 24;
|
||||
|
||||
// Row 4: Density + Radius
|
||||
addLabel(new GuiNpcLabel(205, "ability.lightningDensity", labelX, y + 5));
|
||||
GuiNpcTextField densityField = new GuiNpcTextField(205, this, fontRendererObj, fieldX, y, 55, 18, String.valueOf(laser.getLightningDensity()));
|
||||
densityField.setMinMaxDefaultFloat(0.01f, 5.0f, 0.15f);
|
||||
addTextField(densityField);
|
||||
|
||||
addLabel(new GuiNpcLabel(206, "ability.lightningRadius", col2LabelX, y + 5));
|
||||
GuiNpcTextField radiusField = new GuiNpcTextField(206, this, fontRendererObj, col2FieldX, y, 55, 18, String.valueOf(laser.getLightningRadius()));
|
||||
radiusField.setMinMaxDefaultFloat(0.1f, 10.0f, 0.5f);
|
||||
addTextField(radiusField);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -139,6 +161,10 @@ public class SubGuiAbilityLaserShot extends SubGuiAbilityConfig {
|
||||
laser.setOuterColorEnabled(value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 204:
|
||||
laser.setLightningEffect(value == 1);
|
||||
initGui();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,6 +191,12 @@ public class SubGuiAbilityLaserShot extends SubGuiAbilityConfig {
|
||||
case 203:
|
||||
laser.setOuterColorWidth(parseFloat(field, laser.getOuterColorWidth()));
|
||||
break;
|
||||
case 205:
|
||||
laser.setLightningDensity(parseFloat(field, laser.getLightningDensity()));
|
||||
break;
|
||||
case 206:
|
||||
laser.setLightningRadius(parseFloat(field, laser.getLightningRadius()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,36 +87,58 @@ public class SubGuiAbilityOrb extends SubGuiAbilityConfig {
|
||||
int col2LabelX = guiLeft + 180;
|
||||
int col2FieldX = guiLeft + 260;
|
||||
|
||||
// Row 1: Inner Color + Outer Color
|
||||
// Row 1: Inner Color + Rotation Speed
|
||||
addLabel(new GuiNpcLabel(200, "ability.innerColor", labelX, y + 5));
|
||||
String innerHex = String.format("%06X", orb.getInnerColor() & 0xFFFFFF);
|
||||
GuiNpcButton innerColorBtn = new GuiNpcButton(200, fieldX, y, 55, 20, innerHex);
|
||||
innerColorBtn.setTextColor(orb.getInnerColor() & 0xFFFFFF);
|
||||
addButton(innerColorBtn);
|
||||
|
||||
addLabel(new GuiNpcLabel(201, "ability.outerColor", col2LabelX, y + 5));
|
||||
String outerHex = String.format("%06X", orb.getOuterColor() & 0xFFFFFF);
|
||||
GuiNpcButton outerColorBtn = new GuiNpcButton(201, col2FieldX, y, 55, 20, outerHex);
|
||||
outerColorBtn.setTextColor(orb.getOuterColor() & 0xFFFFFF);
|
||||
outerColorBtn.setEnabled(orb.isOuterColorEnabled());
|
||||
addButton(outerColorBtn);
|
||||
addLabel(new GuiNpcLabel(204, "ability.rotationSpeed", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(204, col2FieldX, y, 55, orb.getRotationSpeed()));
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 2: Outer Color Enabled + Outer Color Width
|
||||
// Row 2: Outer Glow Enabled
|
||||
addLabel(new GuiNpcLabel(202, "ability.outerEnabled", labelX, y + 5));
|
||||
addButton(new GuiNpcButton(202, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, orb.isOuterColorEnabled() ? 1 : 0));
|
||||
|
||||
addLabel(new GuiNpcLabel(203, "ability.outerWidth", col2LabelX, y + 5));
|
||||
GuiNpcTextField widthField = createFloatField(203, col2FieldX, y, 55, orb.getOuterColorWidth());
|
||||
widthField.setEnabled(orb.isOuterColorEnabled());
|
||||
addTextField(widthField);
|
||||
// Only show Outer Color and Width if Outer Glow is enabled
|
||||
if (orb.isOuterColorEnabled()) {
|
||||
y += 24;
|
||||
|
||||
// Row 3: Outer Color + Outer Width
|
||||
addLabel(new GuiNpcLabel(201, "ability.outerColor", labelX, y + 5));
|
||||
String outerHex = String.format("%06X", orb.getOuterColor() & 0xFFFFFF);
|
||||
GuiNpcButton outerColorBtn = new GuiNpcButton(201, fieldX, y, 55, 20, outerHex);
|
||||
outerColorBtn.setTextColor(orb.getOuterColor() & 0xFFFFFF);
|
||||
addButton(outerColorBtn);
|
||||
|
||||
addLabel(new GuiNpcLabel(203, "ability.outerWidth", col2LabelX, y + 5));
|
||||
addTextField(createFloatField(203, col2FieldX, y, 55, orb.getOuterColorWidth()));
|
||||
}
|
||||
|
||||
y += 24;
|
||||
|
||||
// Row 3: Rotation Speed
|
||||
addLabel(new GuiNpcLabel(204, "ability.rotationSpeed", labelX, y + 5));
|
||||
addTextField(createFloatField(204, fieldX, y, 50, orb.getRotationSpeed()));
|
||||
// Row 4: Lightning Effect Enabled
|
||||
addLabel(new GuiNpcLabel(205, "ability.lightning", labelX, y + 5));
|
||||
addButton(new GuiNpcButton(205, fieldX, y, 50, 20, new String[]{"gui.no", "gui.yes"}, orb.hasLightningEffect() ? 1 : 0));
|
||||
|
||||
// Only show Lightning settings if Lightning is enabled
|
||||
if (orb.hasLightningEffect()) {
|
||||
y += 24;
|
||||
|
||||
// Row 5: Density + Radius
|
||||
addLabel(new GuiNpcLabel(206, "ability.lightningDensity", labelX, y + 5));
|
||||
GuiNpcTextField densityField = new GuiNpcTextField(206, this, fontRendererObj, fieldX, y, 55, 18, String.valueOf(orb.getLightningDensity()));
|
||||
densityField.setMinMaxDefaultFloat(0.01f, 5.0f, 0.15f);
|
||||
addTextField(densityField);
|
||||
|
||||
addLabel(new GuiNpcLabel(207, "ability.lightningRadius", col2LabelX, y + 5));
|
||||
GuiNpcTextField radiusField = new GuiNpcTextField(207, this, fontRendererObj, col2FieldX, y, 55, 18, String.valueOf(orb.getLightningRadius()));
|
||||
radiusField.setMinMaxDefaultFloat(0.1f, 10.0f, 0.5f);
|
||||
addTextField(radiusField);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -148,6 +170,10 @@ public class SubGuiAbilityOrb extends SubGuiAbilityConfig {
|
||||
orb.setOuterColorEnabled(value == 1);
|
||||
initGui();
|
||||
break;
|
||||
case 205:
|
||||
orb.setLightningEffect(value == 1);
|
||||
initGui();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,6 +233,12 @@ public class SubGuiAbilityOrb extends SubGuiAbilityConfig {
|
||||
case 204:
|
||||
orb.setRotationSpeed(parseFloat(field, orb.getRotationSpeed()));
|
||||
break;
|
||||
case 206:
|
||||
orb.setLightningDensity(parseFloat(field, orb.getLightningDensity()));
|
||||
break;
|
||||
case 207:
|
||||
orb.setLightningRadius(parseFloat(field, orb.getLightningRadius()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user