From 8c8815dc45d4aac231e32ca9bed4210ff3e71dcb Mon Sep 17 00:00:00 2001 From: Kam Date: Wed, 4 Mar 2026 20:56:06 -0500 Subject: [PATCH 1/9] Various Changes / Health Preservation to Request Spawn Data --- .../packets/data/RequestProperSpawnData.java | 50 +++++-------------- .../noppes/npcs/client/ClientTickHandler.java | 2 - .../npcs/entity/EntityNPCInterface.java | 19 ++++++- 3 files changed, 31 insertions(+), 40 deletions(-) diff --git a/src/main/java/kamkeel/npcs/network/packets/data/RequestProperSpawnData.java b/src/main/java/kamkeel/npcs/network/packets/data/RequestProperSpawnData.java index e747bf62c..fce6c13fa 100644 --- a/src/main/java/kamkeel/npcs/network/packets/data/RequestProperSpawnData.java +++ b/src/main/java/kamkeel/npcs/network/packets/data/RequestProperSpawnData.java @@ -9,7 +9,6 @@ import kamkeel.npcs.network.PacketClient; import kamkeel.npcs.network.PacketHandler; import kamkeel.npcs.network.enums.EnumPlayerPacket; import kamkeel.npcs.network.packets.data.npc.UpdateNpcPacket; -import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -17,16 +16,10 @@ import net.minecraft.nbt.NBTTagCompound; import noppes.npcs.entity.EntityNPCInterface; import java.io.IOException; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; public class RequestProperSpawnData extends AbstractPacket { public static final String packetName = "Player|SpawnData"; - private static final int BATCH_LIMIT = 5; - - private static final Set entitiesToFix = new HashSet<>(); - private static long lastBatchAttemptMillis = 0L; + private static final long REQUEST_COOLDOWN_MILLIS = 1000L; private int entityId; public RequestProperSpawnData() {} @@ -37,8 +30,7 @@ public class RequestProperSpawnData extends AbstractPacket { @SideOnly(Side.CLIENT) public static void clear() { - entitiesToFix.clear(); - lastBatchAttemptMillis = 0L; + // No backlog queue to clear. } @Override @@ -81,40 +73,24 @@ public class RequestProperSpawnData extends AbstractPacket { if (entityID <= 0) return; - if (npc.clientFixAttempts++ < 3) { - PacketClient.sendClient(new RequestProperSpawnData(entityID)); - } else { - entitiesToFix.add(entityID); - } + long now = System.currentTimeMillis(); + if (now - npc.clientFixLastRequestMillis < REQUEST_COOLDOWN_MILLIS) + return; + if (npc.clientFixAttempts >= 3) + return; + + npc.clientFixLastRequestMillis = now; + npc.clientFixAttempts++; + PacketClient.sendClient(new RequestProperSpawnData(entityID)); } @SideOnly(Side.CLIENT) public static boolean canDoBatchUpdate() { - return System.currentTimeMillis() - lastBatchAttemptMillis >= 5000; + return false; } @SideOnly(Side.CLIENT) public static void handleBacklog() { - Minecraft mc = Minecraft.getMinecraft(); - if (mc == null || mc.theWorld == null || mc.thePlayer == null) - return; - - if (entitiesToFix.isEmpty()) - return; - // Remove entity checks if they're no longer loaded - entitiesToFix.removeIf(value -> !(mc.theWorld.getEntityByID(value) instanceof EntityNPCInterface)); - - Iterator it = entitiesToFix.iterator(); - int count = 0; - - while (it.hasNext() && count < BATCH_LIMIT) { - PacketClient.sendClient(new RequestProperSpawnData(it.next())); - it.remove(); - count++; - } - - if (count != 0) { - lastBatchAttemptMillis = System.currentTimeMillis(); - } + // No batch backlog. Requests are immediate and throttled in reportMissingData(). } } diff --git a/src/main/java/noppes/npcs/client/ClientTickHandler.java b/src/main/java/noppes/npcs/client/ClientTickHandler.java index c0b501c4d..1f6e1bf34 100644 --- a/src/main/java/noppes/npcs/client/ClientTickHandler.java +++ b/src/main/java/noppes/npcs/client/ClientTickHandler.java @@ -193,8 +193,6 @@ public class ClientTickHandler { return; if (mc.theWorld.getTotalWorldTime() % 20 == 0) { // Update every second - if (RequestProperSpawnData.canDoBatchUpdate()) - RequestProperSpawnData.handleBacklog(); updateCompassMarks(); } } diff --git a/src/main/java/noppes/npcs/entity/EntityNPCInterface.java b/src/main/java/noppes/npcs/entity/EntityNPCInterface.java index 6045317d8..3eed36105 100644 --- a/src/main/java/noppes/npcs/entity/EntityNPCInterface.java +++ b/src/main/java/noppes/npcs/entity/EntityNPCInterface.java @@ -236,6 +236,7 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti // For Client-Side Use Only public int clientFixAttempts = 0; + public long clientFixLastRequestMillis = 0L; public EntityNPCInterface(World world) { super(world); @@ -483,7 +484,14 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti } if (wasKilled != isKilled() && wasKilled) { - reset(); + if (!worldObj.isRemote) { + reset(); + } else { + // Client-side full reset can create health oscillation when spawn data is being repaired. + deathTime = 0; + currentAnimation = EnumAnimation.NONE; + updateHitbox(); + } } wasKilled = isKilled(); @@ -1838,6 +1846,7 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti NBTTagCompound compound = new NBTTagCompound(); display.writeToNBT(compound); compound.setDouble("MaxHealth", stats.maxHealth); + compound.setFloat("CurrentHealth", getHealth()); compound.setTag("Armor", NBTTags.nbtItemStackList(inventory.getArmor())); compound.setTag("Weapons", NBTTags.nbtItemStackList(inventory.getWeapons())); compound.setInteger("Speed", ais.getWalkingSpeed()); @@ -1892,6 +1901,7 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti return; } + float preservedHealth = getHealth(); stats.maxHealth = compound.getDouble("MaxHealth"); ais.setWalkingSpeed(compound.getInteger("Speed")); stats.hideKilledBody = compound.getBoolean("DeadBody"); @@ -1916,6 +1926,12 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti ais.bodyOffsetY = compound.getFloat("OffsetY"); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(stats.maxHealth); + if (compound.hasKey("CurrentHealth", Constants.NBT.TAG_FLOAT)) { + setHealth(MathHelper.clamp_float(compound.getFloat("CurrentHealth"), 0.0F, getMaxHealth())); + } else { + // Keep previous client health if packet came from an older sender format. + setHealth(MathHelper.clamp_float(preservedHealth, 0.0F, getMaxHealth())); + } inventory.setArmor(NBTTags.getItemStackList(compound.getTagList("Armor", 10))); inventory.setWeapons(NBTTags.getItemStackList(compound.getTagList("Weapons", 10))); advanced.setRole(compound.getInteger("Role")); @@ -1990,6 +2006,7 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti return true; } clientFixAttempts = 0; + clientFixLastRequestMillis = 0L; return false; } From 82f9ecaf4a0e439c1ac7626e8a22c88e5f4d1ba5 Mon Sep 17 00:00:00 2001 From: Vidal Date: Thu, 5 Mar 2026 01:45:58 -0300 Subject: [PATCH 2/9] Submodules --- gradle-plugins | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle-plugins b/gradle-plugins index dc0350128..19dc9a836 160000 --- a/gradle-plugins +++ b/gradle-plugins @@ -1 +1 @@ -Subproject commit dc0350128ae8bc81ddde6615816b29f35de2959c +Subproject commit 19dc9a836148062fa744b9a9ca87391f84274b44 From 9cf43d9f7e151980ae2ddf046009d85796875749 Mon Sep 17 00:00:00 2001 From: Vidal Date: Thu, 5 Mar 2026 02:35:53 -0300 Subject: [PATCH 3/9] Renamed AMMO to COUNT and cleaned up legacy code --- gradle-plugins | 2 +- .../ability/conditions/ConditionItem.java | 26 +++++-------------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/gradle-plugins b/gradle-plugins index dc0350128..19dc9a836 160000 --- a/gradle-plugins +++ b/gradle-plugins @@ -1 +1 @@ -Subproject commit dc0350128ae8bc81ddde6615816b29f35de2959c +Subproject commit 19dc9a836148062fa744b9a9ca87391f84274b44 diff --git a/src/main/java/kamkeel/npcs/controllers/data/ability/conditions/ConditionItem.java b/src/main/java/kamkeel/npcs/controllers/data/ability/conditions/ConditionItem.java index 221a68f63..21c8669ea 100644 --- a/src/main/java/kamkeel/npcs/controllers/data/ability/conditions/ConditionItem.java +++ b/src/main/java/kamkeel/npcs/controllers/data/ability/conditions/ConditionItem.java @@ -15,7 +15,7 @@ import java.util.List; public class ConditionItem extends AbilityCondition { public enum UsageType { - ARMOR, HOLDING, AMMO, OFFHAND; + ARMOR, HOLDING, COUNT, OFFHAND; public static UsageType fromOrdinal(int ordinal) { UsageType[] values = values(); @@ -40,7 +40,7 @@ public class ConditionItem extends AbilityCondition { private ArmorSlot armorSlot = ArmorSlot.BOOTS; private boolean fullArmorSet = false; - // AMMO + PLAYER only + // COUNT + PLAYER only private int requiredCount = 1; public ConditionItem() { @@ -55,8 +55,8 @@ public class ConditionItem extends AbilityCondition { return checkHolding(entity); case ARMOR: return checkArmor(entity); - case AMMO: - return checkAmmo(entity); + case COUNT: + return checkCount(entity); case OFFHAND: return checkOffhand(entity); default: @@ -75,17 +75,7 @@ public class ConditionItem extends AbilityCondition { return matchesItem(entity.getEquipmentInSlot(slot)); } - private boolean checkFullArmor(EntityLivingBase entity) { - for (int i = 0; i < 4; i++) { - int slot = i + 1; - if (!matchesItem(i, entity.getEquipmentInSlot(slot))) - return false; - } - - return true; - } - - private boolean checkAmmo(EntityLivingBase entity) { + private boolean checkCount(EntityLivingBase entity) { if (entity instanceof EntityPlayer) { return checkPlayerInventoryCount((EntityPlayer) entity); } @@ -121,10 +111,6 @@ public class ConditionItem extends AbilityCondition { } private boolean matchesItem(ItemStack stack) { - return matchesItem(0, stack); - } - - private boolean matchesItem(int index, ItemStack stack) { if (stack == null || itemName == null || itemName.isEmpty()) return false; String registryName = net.minecraft.item.Item.itemRegistry.getNameForObject(stack.getItem()); return itemName.equals(registryName); @@ -148,7 +134,7 @@ public class ConditionItem extends AbilityCondition { defs.add(FieldDef.intField("condition.item_count", this::getRequiredCount, this::setRequiredCount) .range(1, 64) - .visibleWhen(() -> usageType == UsageType.AMMO && userType.allowsPlayer()) + .visibleWhen(() -> usageType == UsageType.COUNT && userType.allowsPlayer()) .hover("condition.hover.required_count")); } From 6007b49271e9e0038d61c342fef4dbe42f14211a Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 5 Mar 2026 00:53:19 -0500 Subject: [PATCH 4/9] Fix Texture Pathing Removing Icons --- .../client/renderer/RenderNPCInterface.java | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/src/main/java/noppes/npcs/client/renderer/RenderNPCInterface.java b/src/main/java/noppes/npcs/client/renderer/RenderNPCInterface.java index f3c91d547..748db40d4 100644 --- a/src/main/java/noppes/npcs/client/renderer/RenderNPCInterface.java +++ b/src/main/java/noppes/npcs/client/renderer/RenderNPCInterface.java @@ -609,7 +609,26 @@ public class RenderNPCInterface extends RenderLiving { InputStream inputstream = null; try { TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); - texturemanager.deleteTexture(location); + + // Compute the hash-based skin location first + ResourceLocation skinLocation = location; + try { + MessageDigest digest = MessageDigest.getInstance("MD5"); + byte[] hash = digest.digest(npc.display.texture.getBytes("UTF-8")); + StringBuilder sb = new StringBuilder(2 * hash.length); + for (byte b : hash) { + sb.append(String.format("%02x", b & 0xff)); + } + if (npc.display.modelType == 0) { + skinLocation = new ResourceLocation("skin/" + sb.toString()); + } else { + skinLocation = new ResourceLocation("skin64/" + sb.toString()); + } + } catch (Exception ignored) { + } + + // Delete old processed skin texture if cached (prevents GL texture leak) + texturemanager.deleteTexture(skinLocation); IResource iresource = Minecraft.getMinecraft().getResourceManager().getResource(location); inputstream = iresource.getInputStream(); @@ -625,22 +644,8 @@ public class RenderNPCInterface extends RenderLiving { ImageDownloadAlt object = new ImageDownloadAlt(null, npc.display.texture, SkinManager.field_152793_a, new ImageBufferDownloadAlt(true)); object.setBufferedImage(bufferedimage); - try { - MessageDigest digest = MessageDigest.getInstance("MD5"); - byte[] hash = digest.digest(npc.display.texture.getBytes("UTF-8")); - StringBuilder sb = new StringBuilder(2 * hash.length); - for (byte b : hash) { - sb.append(String.format("%02x", b & 0xff)); - } - if (npc.display.modelType == 0) { - location = new ResourceLocation("skin/" + sb.toString()); - } else { - location = new ResourceLocation("skin64/" + sb.toString()); - } - } catch (Exception ignored) { - } - texturemanager.loadTexture(location, object); - return location; + texturemanager.loadTexture(skinLocation, object); + return skinLocation; } finally { if (inputstream != null) { inputstream.close(); From dbca3da639b52aff9700afed35337823c0350d55 Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 5 Mar 2026 01:37:44 -0500 Subject: [PATCH 5/9] Fix some Packet / Language Handling for Race Condition --- .../noppes/npcs/client/gui/GuiScript.java | 29 +++++++++++++--- .../client/gui/script/GuiScriptInterface.java | 33 +++++++++++++++---- .../data/IScriptHandlerPacket.java | 6 ++++ 3 files changed, 57 insertions(+), 11 deletions(-) diff --git a/src/main/java/noppes/npcs/client/gui/GuiScript.java b/src/main/java/noppes/npcs/client/gui/GuiScript.java index 7420d4387..febb3c9b1 100644 --- a/src/main/java/noppes/npcs/client/gui/GuiScript.java +++ b/src/main/java/noppes/npcs/client/gui/GuiScript.java @@ -184,6 +184,14 @@ public class GuiScript extends GuiScriptInterface { addButton(new GuiNpcButton(100, guiLeft + 315, guiTop + 25, 50, 20, "gui.copy")); addButton(new GuiNpcButton(107, guiLeft + 315, guiTop + 70, 80, 20, "script.loadscript")); + // Disable all buttons until server data arrives + if (!serverDataReceived) { + for (int btnId : new int[]{100, 101, 102, 107}) { + GuiNpcButton btn = getButton(btnId); + if (btn != null) btn.enabled = false; + } + } + GuiCustomScroll scroll = new GuiCustomScroll(this, 0).setUnselectable(); scroll.setSize(100, 120); scroll.guiLeft = guiLeft + 315; @@ -222,12 +230,18 @@ public class GuiScript extends GuiScriptInterface { addButton(new GuiNpcButton(104, guiLeft + 294, guiTop + 48, 50, 20, new String[]{"gui.no", "gui.yes"}, script.enabled ? 1 : 0)); - // Disable language/enabled controls until server data actually arrives - getButton(103).enabled = serverDataReceived && languageOptions.size() > 0; - getButton(104).enabled = serverDataReceived; - if (MinecraftServer.getServer() != null) addButton(new GuiNpcButton(106, guiLeft + 232, guiTop + 71, 150, 20, "script.openfolder")); + + // Disable all buttons until server data arrives + if (!serverDataReceived) { + for (int btnId : new int[]{100, 102, 103, 104, 105, 106}) { + GuiNpcButton btn = getButton(btnId); + if (btn != null) btn.enabled = false; + } + } else { + getButton(103).enabled = languageOptions.size() > 0; + } } @Override @@ -342,6 +356,11 @@ public class GuiScript extends GuiScriptInterface { @Override public void setGuiData(NBTTagCompound compound) { + // Only process the actual NPCScriptPacket response (has ScriptLanguage + Languages) + // Ignore unrelated packets (e.g. script config with ScriptsEnabled/GlobalNPCScriptsEnabled) + if (!compound.hasKey("ScriptLanguage") && !compound.hasKey("Languages")) { + return; + } script.readFromNBT(compound); loadLanguagesData(compound); loaded = true; @@ -349,7 +368,7 @@ public class GuiScript extends GuiScriptInterface { @Override public void save() { - if (loaded) { + if (loaded && serverDataReceived) { setScript(); NPCScriptPacket.Save(script.writeToNBT(new NBTTagCompound())); } diff --git a/src/main/java/noppes/npcs/client/gui/script/GuiScriptInterface.java b/src/main/java/noppes/npcs/client/gui/script/GuiScriptInterface.java index 3d91446c9..fa64fb9a9 100644 --- a/src/main/java/noppes/npcs/client/gui/script/GuiScriptInterface.java +++ b/src/main/java/noppes/npcs/client/gui/script/GuiScriptInterface.java @@ -311,6 +311,14 @@ public class GuiScriptInterface extends GuiNPCInterface implements GuiYesNoCallb this.addButton(new GuiNpcButton(107, left1, this.guiTop + 66 + yoffset, 80, 20, "script.loadscript")); + // Disable all buttons until server data arrives + if (!serverDataReceived) { + for (int btnId : new int[]{100, 101, 102, 105, 107, 113}) { + GuiNpcButton btn = getButton(btnId); + if (btn != null) btn.enabled = false; + } + } + GuiCustomScroll scroll = (new GuiCustomScroll(this, 0)).setUnselectable(); scroll.setSize(100, (int) ((double) this.ySize * 0.54D) - yoffset * 2); scroll.guiLeft = left1; @@ -344,11 +352,6 @@ public class GuiScriptInterface extends GuiNPCInterface implements GuiYesNoCallb this.addButton(new GuiNpcButton(104, var9 + 60, this.guiTop + 31, 50, 20, new String[]{"gui.no", "gui.yes"}, this.handler.getEnabled() ? 1 : 0)); - // Disable language/enabled controls until server data actually arrives - // (serverDataReceived is only set in loadLanguagesData, not by getLanguageOptions injecting Java) - this.getButton(103).enabled = serverDataReceived && languageOptions.size() > 0; - this.getButton(104).enabled = serverDataReceived; - if (this.player.worldObj.isRemote) { this.addButton(new GuiNpcButton(106, var9, this.guiTop + 55, 150, 20, "script.openfolder")); } @@ -357,6 +360,17 @@ public class GuiScriptInterface extends GuiNPCInterface implements GuiYesNoCallb this.addButton(new GuiNpcButton(112, var9 + 81, this.guiTop + 78, 80, 20, "gui.forum")); this.addButton(new GuiNpcButton(110, var9, this.guiTop + 99, 80, 20, "script.apidoc")); this.addButton(new GuiNpcButton(111, var9 + 81, this.guiTop + 99, 80, 20, "script.apisrc")); + + // Disable all buttons until server data arrives + if (!serverDataReceived) { + for (int btnId : new int[]{100, 102, 103, 104, 106, 109, 110, 111, 112}) { + GuiNpcButton btn = getButton(btnId); + if (btn != null) btn.enabled = false; + } + } else { + // Language button requires options to be available + this.getButton(103).enabled = languageOptions.size() > 0; + } } public GuiScriptInterface setDimensions(int x, int y) { @@ -750,6 +764,9 @@ public class GuiScriptInterface extends GuiNPCInterface implements GuiYesNoCallb public void setGuiData(NBTTagCompound compound) { if (handler instanceof IScriptHandlerPacket) { IScriptHandlerPacket.GuiDataResult result = ((IScriptHandlerPacket) handler).setGuiData(compound); + if (result == null) { + return; // Unrelated packet, ignore + } if (result.kind == IScriptHandlerPacket.GuiDataKind.LOAD_COMPLETE) { loaded = true; return; @@ -765,6 +782,10 @@ public class GuiScriptInterface extends GuiNPCInterface implements GuiYesNoCallb return; } + // For non-IScriptHandlerPacket handlers, ignore unrelated packets + if (!compound.hasKey("ScriptLanguage") && !compound.hasKey("Languages")) { + return; + } loadLanguagesData(compound); } @@ -808,7 +829,7 @@ public class GuiScriptInterface extends GuiNPCInterface implements GuiYesNoCallb } public void save() { - if (!loaded) + if (!loaded || !serverDataReceived) return; this.setScript(); diff --git a/src/main/java/noppes/npcs/controllers/data/IScriptHandlerPacket.java b/src/main/java/noppes/npcs/controllers/data/IScriptHandlerPacket.java index 88ff5fb94..fdc3e3202 100644 --- a/src/main/java/noppes/npcs/controllers/data/IScriptHandlerPacket.java +++ b/src/main/java/noppes/npcs/controllers/data/IScriptHandlerPacket.java @@ -53,6 +53,12 @@ public interface IScriptHandlerPacket extends IScriptHandler { return new GuiDataResult(GuiDataKind.LOAD_COMPLETE, -1); } + // Ignore unrelated packets (e.g. ScriptInfoPacket config data) + // that don't contain any expected keys for this handler + if (!compound.hasKey("Tab") && !compound.hasKey("ScriptLanguage") && !compound.hasKey("ScriptEnabled")) { + return null; + } + if (!compound.hasKey("Tab")) { setLanguage(compound.getString("ScriptLanguage")); setEnabled(compound.getBoolean("ScriptEnabled")); From e309794fd710dc8df6142d04f970aed4cc88f2d1 Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 5 Mar 2026 02:18:34 -0500 Subject: [PATCH 6/9] Custom Ability Telegraph Controls, Inner Radius Fix --- src/api | 2 +- .../client/renderer/TelegraphRenderer.java | 120 +++++-- .../controllers/data/ability/Ability.java | 18 +- .../data/ability/CustomAbility.java | 318 +++++++++++++++++- .../data/ability/type/AbilityCutter.java | 7 +- .../data/ability/type/AbilityDodge.java | 5 +- .../controllers/data/telegraph/Telegraph.java | 8 + .../noppes/npcs/AbstractDataAbilities.java | 5 + 8 files changed, 440 insertions(+), 43 deletions(-) diff --git a/src/api b/src/api index 4e9642531..5eb98d172 160000 --- a/src/api +++ b/src/api @@ -1 +1 @@ -Subproject commit 4e96425314a9fd2d3e48f68cff5fc7ee69f87213 +Subproject commit 5eb98d172eedfa0727e8ec9769bc2edad36a1ce4 diff --git a/src/main/java/kamkeel/npcs/client/renderer/TelegraphRenderer.java b/src/main/java/kamkeel/npcs/client/renderer/TelegraphRenderer.java index 9bcf473ac..dc653e73f 100644 --- a/src/main/java/kamkeel/npcs/client/renderer/TelegraphRenderer.java +++ b/src/main/java/kamkeel/npcs/client/renderer/TelegraphRenderer.java @@ -105,7 +105,7 @@ public class TelegraphRenderer { renderLine(telegraph.getLength(), telegraph.getWidth(), red, green, blue, alpha); break; case CONE: - renderCone(telegraph.getLength(), telegraph.getAngle(), red, green, blue, alpha); + renderCone(telegraph.getLength(), telegraph.getAngle(), telegraph.getInnerRadius(), red, green, blue, alpha); break; case POINT: renderPoint(red, green, blue, alpha); @@ -207,42 +207,98 @@ public class TelegraphRenderer { tessellator.draw(); } - private void renderCone(float length, float angle, float r, float g, float b, float a) { + private void renderCone(float length, float angle, float innerRadius, float r, float g, float b, float a) { float halfAngleRad = (float) Math.toRadians(angle / 2); Tessellator tessellator = Tessellator.instance; - tessellator.startDrawing(GL11.GL_TRIANGLE_FAN); - tessellator.setColorRGBA_F(r, g, b, a); - // Origin point - tessellator.addVertex(0, 0, 0); + if (innerRadius <= 0) { + // Standard cone: triangle fan from origin + tessellator.startDrawing(GL11.GL_TRIANGLE_FAN); + tessellator.setColorRGBA_F(r, g, b, a); - // Arc points - for (int i = 0; i <= CONE_SEGMENTS; i++) { - float segmentAngle = -halfAngleRad + (halfAngleRad * 2 * i) / CONE_SEGMENTS; - double x = Math.sin(segmentAngle) * length; - double z = Math.cos(segmentAngle) * length; - tessellator.addVertex(x, 0, z); + tessellator.addVertex(0, 0, 0); + + for (int i = 0; i <= CONE_SEGMENTS; i++) { + float segmentAngle = -halfAngleRad + (halfAngleRad * 2 * i) / CONE_SEGMENTS; + double x = Math.sin(segmentAngle) * length; + double z = Math.cos(segmentAngle) * length; + tessellator.addVertex(x, 0, z); + } + + tessellator.draw(); + + // Border + tessellator.startDrawing(GL11.GL_LINE_STRIP); + tessellator.setColorRGBA_F(r, g, b, Math.min(1.0f, a * 2)); + + tessellator.addVertex(0, 0.01, 0); + + for (int i = 0; i <= CONE_SEGMENTS; i++) { + float segmentAngle = -halfAngleRad + (halfAngleRad * 2 * i) / CONE_SEGMENTS; + double x = Math.sin(segmentAngle) * length; + double z = Math.cos(segmentAngle) * length; + tessellator.addVertex(x, 0.01, z); + } + + tessellator.addVertex(0, 0.01, 0); + + tessellator.draw(); + } else { + // Truncated cone: strip between inner and outer arcs + tessellator.startDrawing(GL11.GL_TRIANGLE_STRIP); + tessellator.setColorRGBA_F(r, g, b, a); + + for (int i = 0; i <= CONE_SEGMENTS; i++) { + float segmentAngle = -halfAngleRad + (halfAngleRad * 2 * i) / CONE_SEGMENTS; + double sinA = Math.sin(segmentAngle); + double cosA = Math.cos(segmentAngle); + + tessellator.addVertex(sinA * length, 0, cosA * length); + tessellator.addVertex(sinA * innerRadius, 0, cosA * innerRadius); + } + + tessellator.draw(); + + // Border: outer arc + float borderAlpha = Math.min(1.0f, a * 2); + tessellator.startDrawing(GL11.GL_LINE_STRIP); + tessellator.setColorRGBA_F(r, g, b, borderAlpha); + + for (int i = 0; i <= CONE_SEGMENTS; i++) { + float segmentAngle = -halfAngleRad + (halfAngleRad * 2 * i) / CONE_SEGMENTS; + tessellator.addVertex(Math.sin(segmentAngle) * length, 0.01, Math.cos(segmentAngle) * length); + } + + tessellator.draw(); + + // Border: inner arc + tessellator.startDrawing(GL11.GL_LINE_STRIP); + tessellator.setColorRGBA_F(r, g, b, borderAlpha); + + for (int i = 0; i <= CONE_SEGMENTS; i++) { + float segmentAngle = -halfAngleRad + (halfAngleRad * 2 * i) / CONE_SEGMENTS; + tessellator.addVertex(Math.sin(segmentAngle) * innerRadius, 0.01, Math.cos(segmentAngle) * innerRadius); + } + + tessellator.draw(); + + // Border: side edges connecting inner and outer arcs + tessellator.startDrawing(GL11.GL_LINES); + tessellator.setColorRGBA_F(r, g, b, borderAlpha); + + double sinStart = Math.sin(-halfAngleRad); + double cosStart = Math.cos(-halfAngleRad); + tessellator.addVertex(sinStart * innerRadius, 0.01, cosStart * innerRadius); + tessellator.addVertex(sinStart * length, 0.01, cosStart * length); + + double sinEnd = Math.sin(halfAngleRad); + double cosEnd = Math.cos(halfAngleRad); + tessellator.addVertex(sinEnd * innerRadius, 0.01, cosEnd * innerRadius); + tessellator.addVertex(sinEnd * length, 0.01, cosEnd * length); + + tessellator.draw(); } - - tessellator.draw(); - - // Draw border - tessellator.startDrawing(GL11.GL_LINE_STRIP); - tessellator.setColorRGBA_F(r, g, b, Math.min(1.0f, a * 2)); - - tessellator.addVertex(0, 0.01, 0); - - for (int i = 0; i <= CONE_SEGMENTS; i++) { - float segmentAngle = -halfAngleRad + (halfAngleRad * 2 * i) / CONE_SEGMENTS; - double x = Math.sin(segmentAngle) * length; - double z = Math.cos(segmentAngle) * length; - tessellator.addVertex(x, 0.01, z); - } - - tessellator.addVertex(0, 0.01, 0); - - tessellator.draw(); } private void renderPoint(float r, float g, float b, float a) { @@ -344,7 +400,7 @@ public class TelegraphRenderer { renderLine(telegraph.getLength(), telegraph.getWidth(), red, green, blue, alpha); break; case CONE: - renderCone(telegraph.getLength(), telegraph.getAngle(), red, green, blue, alpha); + renderCone(telegraph.getLength(), telegraph.getAngle(), telegraph.getInnerRadius(), red, green, blue, alpha); break; case POINT: renderPoint(red, green, blue, alpha); diff --git a/src/main/java/kamkeel/npcs/controllers/data/ability/Ability.java b/src/main/java/kamkeel/npcs/controllers/data/ability/Ability.java index fbad42cb3..f97c619ac 100644 --- a/src/main/java/kamkeel/npcs/controllers/data/ability/Ability.java +++ b/src/main/java/kamkeel/npcs/controllers/data/ability/Ability.java @@ -597,6 +597,18 @@ public abstract class Ability implements IAbility, IAbilityAction { return 45.0f; } + public float getTelegraphInnerRadius() { + return 0.0f; + } + + /** + * Override to return true if the ability type manages its own telegraph GUI controls. + * When true, the base class will skip adding the default telegraph section. + */ + public boolean hasOwnTelegraphControls() { + return false; + } + /** * Returns true if the caster is a player (not an NPC). * Use this instead of checking {@code target != null} to make NPC/Player @@ -875,7 +887,7 @@ public abstract class Ability implements IAbility, IAbilityAction { .tab("Effects")); TelegraphType tType = getTelegraphType(); - if (tType != null && tType != TelegraphType.NONE) { + if (tType != null && tType != TelegraphType.NONE && !hasOwnTelegraphControls()) { defs.add(FieldDef.section("ability.section.telegraph").tab("Effects") .hover("telegraph." + tType.name().toLowerCase())); defs.add(FieldDef.boolField("ability.showTelegraph", this::isShowTelegraph, this::setShowTelegraph) @@ -1015,13 +1027,13 @@ public abstract class Ability implements IAbility, IAbilityAction { telegraph = Telegraph.circle(getTelegraphRadius()); break; case RING: - telegraph = Telegraph.ring(getTelegraphRadius(), getTelegraphRadius() * 0.5f); + telegraph = Telegraph.ring(getTelegraphRadius(), getTelegraphInnerRadius()); break; case LINE: telegraph = Telegraph.line(getTelegraphLength(), getTelegraphWidth()); break; case CONE: - telegraph = Telegraph.cone(getTelegraphLength(), getTelegraphAngle()); + telegraph = Telegraph.cone(getTelegraphLength(), getTelegraphAngle(), getTelegraphInnerRadius()); break; case POINT: telegraph = new Telegraph("", TelegraphType.POINT); diff --git a/src/main/java/kamkeel/npcs/controllers/data/ability/CustomAbility.java b/src/main/java/kamkeel/npcs/controllers/data/ability/CustomAbility.java index 045a12e5d..4795e7363 100644 --- a/src/main/java/kamkeel/npcs/controllers/data/ability/CustomAbility.java +++ b/src/main/java/kamkeel/npcs/controllers/data/ability/CustomAbility.java @@ -1,8 +1,12 @@ package kamkeel.npcs.controllers.data.ability; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import kamkeel.npcs.controllers.data.ability.enums.LockMode; import kamkeel.npcs.controllers.data.ability.enums.TargetingMode; import kamkeel.npcs.controllers.data.ability.enums.UserType; +import kamkeel.npcs.controllers.data.telegraph.Telegraph; +import kamkeel.npcs.controllers.data.telegraph.TelegraphInstance; import kamkeel.npcs.controllers.data.telegraph.TelegraphType; import net.minecraft.entity.EntityLivingBase; import net.minecraft.nbt.NBTTagCompound; @@ -28,6 +32,17 @@ public class CustomAbility extends Ability implements ICustomAbility { private int durationTicks = 20; + // Telegraph dimension fields + private float tRadius = 5.0f; + private float tInnerRadius = 0.0f; + private float tLength = 5.0f; + private float tWidth = 2.0f; + private float tAngle = 45.0f; + + // Telegraph timing + private int telegraphActiveTicks = 0; + private boolean syncTelegraphWithDuration = true; + public CustomAbility() { this.typeId = "ability.cnpc.custom"; this.name = "Custom"; @@ -77,6 +92,139 @@ public class CustomAbility extends Ability implements ICustomAbility { return true; } + @Override + public boolean hasOwnTelegraphControls() { + return true; + } + + // ==================== TELEGRAPH OVERRIDES ==================== + + @Override + public boolean keepTelegraphDuringActive() { + return getResolvedTelegraphActiveTicks() > 0; + } + + /** + * Returns the effective telegraph active ticks: synced from duration or manual value. + */ + public int getResolvedTelegraphActiveTicks() { + if (syncTelegraphWithDuration) { + return durationTicks; + } + return telegraphActiveTicks; + } + + @Override + public TelegraphInstance createTelegraph(EntityLivingBase caster, EntityLivingBase target) { + if (!isShowTelegraph() || getTelegraphType() == TelegraphType.NONE) { + return null; + } + + Telegraph telegraph; + double x, y, z; + float yaw = caster.rotationYaw; + TelegraphType tType = getTelegraphType(); + + boolean positionAtCaster = targetingMode == TargetingMode.AOE_SELF || + targetingMode == TargetingMode.SELF || + tType == TelegraphType.LINE || + tType == TelegraphType.CONE; + + if (positionAtCaster) { + x = caster.posX; + y = findGroundLevel(caster.worldObj, caster.posX, caster.posY, caster.posZ); + z = caster.posZ; + } else if (target != null) { + x = target.posX; + y = findGroundLevel(caster.worldObj, target.posX, target.posY, target.posZ); + z = target.posZ; + } else { + x = caster.posX; + y = findGroundLevel(caster.worldObj, caster.posX, caster.posY, caster.posZ); + z = caster.posZ; + } + + switch (tType) { + case CIRCLE: + telegraph = Telegraph.circle(tRadius); + break; + case RING: + telegraph = Telegraph.ring(tRadius, tInnerRadius); + break; + case LINE: + telegraph = Telegraph.line(tLength, tWidth); + break; + case CONE: + telegraph = Telegraph.cone(tLength, tAngle, tInnerRadius); + break; + case POINT: + telegraph = new Telegraph("", TelegraphType.POINT); + break; + case SQUARE: + telegraph = Telegraph.square(tRadius); + break; + default: + return null; + } + + int activeTicks = getResolvedTelegraphActiveTicks(); + int totalDuration = windUpTicks + activeTicks; + telegraph.setDurationTicks(Math.max(1, totalDuration)); + telegraph.setColor(windUpColor); + telegraph.setWarningColor(activeColor); + if (windUpTicks > 0) { + telegraph.setWarningStartTick(windUpTicks); + } else { + telegraph.setWarningStartTick(0); + } + telegraph.setHeightOffset(telegraphHeightOffset); + + TelegraphInstance instance = new TelegraphInstance(telegraph, x, y, z, yaw); + instance.setCasterEntityId(caster.getEntityId()); + + if (positionAtCaster) { + instance.setEntityIdToFollow(caster.getEntityId()); + if (tType == TelegraphType.LINE || tType == TelegraphType.CONE) { + if (!isRotationLockedDuringWindup()) { + if (target != null) { + instance.setTargetEntityId(target.getEntityId()); + } else { + instance.setTrackFollowedEntityYaw(true); + } + } + } + } else if (target != null) { + instance.setEntityIdToFollow(target.getEntityId()); + } + + return instance; + } + + @Override + public float getTelegraphRadius() { + return tRadius; + } + + @Override + public float getTelegraphInnerRadius() { + return tInnerRadius; + } + + @Override + public float getTelegraphLength() { + return tLength; + } + + @Override + public float getTelegraphWidth() { + return tWidth; + } + + @Override + public float getTelegraphAngle() { + return tAngle; + } + // ==================== FIELDS ==================== @Override @@ -89,6 +237,62 @@ public class CustomAbility extends Ability implements ICustomAbility { this.durationTicks = Math.max(0, ticks); } + public float getTRadius() { + return tRadius; + } + + public void setTRadius(float radius) { + this.tRadius = Math.max(0, radius); + } + + public float getTInnerRadius() { + return tInnerRadius; + } + + public void setTInnerRadius(float innerRadius) { + this.tInnerRadius = Math.max(0, innerRadius); + } + + public float getTLength() { + return tLength; + } + + public void setTLength(float length) { + this.tLength = Math.max(0, length); + } + + public float getTWidth() { + return tWidth; + } + + public void setTWidth(float width) { + this.tWidth = Math.max(0, width); + } + + public float getTAngle() { + return tAngle; + } + + public void setTAngle(float angle) { + this.tAngle = Math.max(0, angle); + } + + public int getTelegraphActiveTicks() { + return telegraphActiveTicks; + } + + public void setTelegraphActiveTicks(int ticks) { + this.telegraphActiveTicks = Math.max(0, ticks); + } + + public boolean isSyncTelegraphWithDuration() { + return syncTelegraphWithDuration; + } + + public void setSyncTelegraphWithDuration(boolean sync) { + this.syncTelegraphWithDuration = sync; + } + // ==================== ICustomAbility ==================== @Override @@ -104,6 +308,31 @@ public class CustomAbility extends Ability implements ICustomAbility { } } + @Override + public void setTelegraphRadius(float radius) { + this.tRadius = Math.max(0, radius); + } + + @Override + public void setTelegraphInnerRadius(float innerRadius) { + this.tInnerRadius = Math.max(0, innerRadius); + } + + @Override + public void setTelegraphLength(float length) { + this.tLength = Math.max(0, length); + } + + @Override + public void setTelegraphWidth(float width) { + this.tWidth = Math.max(0, width); + } + + @Override + public void setTelegraphAngle(float angle) { + this.tAngle = Math.max(0, angle); + } + @Override public int getTargetingModeType() { return getTargetingMode().ordinal(); @@ -122,15 +351,30 @@ public class CustomAbility extends Ability implements ICustomAbility { @Override public void writeTypeNBT(NBTTagCompound nbt) { nbt.setInteger("durationTicks", durationTicks); + nbt.setFloat("tRadius", tRadius); + nbt.setFloat("tInnerRadius", tInnerRadius); + nbt.setFloat("tLength", tLength); + nbt.setFloat("tWidth", tWidth); + nbt.setFloat("tAngle", tAngle); + nbt.setInteger("telegraphActiveTicks", telegraphActiveTicks); + nbt.setBoolean("syncTelegraphWithDuration", syncTelegraphWithDuration); } @Override public void readTypeNBT(NBTTagCompound nbt) { this.durationTicks = Math.max(0, nbt.getInteger("durationTicks")); + this.tRadius = nbt.hasKey("tRadius") ? nbt.getFloat("tRadius") : 5.0f; + this.tInnerRadius = nbt.hasKey("tInnerRadius") ? nbt.getFloat("tInnerRadius") : 0.0f; + this.tLength = nbt.hasKey("tLength") ? nbt.getFloat("tLength") : 5.0f; + this.tWidth = nbt.hasKey("tWidth") ? nbt.getFloat("tWidth") : 2.0f; + this.tAngle = nbt.hasKey("tAngle") ? nbt.getFloat("tAngle") : 45.0f; + this.telegraphActiveTicks = nbt.hasKey("telegraphActiveTicks") ? nbt.getInteger("telegraphActiveTicks") : 0; + this.syncTelegraphWithDuration = nbt.hasKey("syncTelegraphWithDuration") ? nbt.getBoolean("syncTelegraphWithDuration") : true; } // ==================== GUI ==================== + @SideOnly(Side.CLIENT) @Override public void getAbilityDefinitions(List defs) { // User Type (NPC / Player / Both) @@ -141,10 +385,6 @@ public class CustomAbility extends Ability implements ICustomAbility { defs.add(FieldDef.enumField("ability.targetingMode", TargetingMode.class, this::getTargetingMode, this::setTargetingMode)); - // Telegraph Shape - defs.add(FieldDef.enumField("ability.telegraphShape", TelegraphType.class, - this::getTelegraphType, this::setTelegraphType)); - // Toggle section defs.add(FieldDef.section("ability.section.toggle")); defs.add(FieldDef.boolField("ability.toggleEnabled", @@ -161,5 +401,75 @@ public class CustomAbility extends Ability implements ICustomAbility { defs.add(FieldDef.intField("ability.duration", this::getDurationTicks, this::setDurationTicks) .range(0, 6000) .visibleWhen(() -> !this.isToggleable())); + + // ── Telegraph Controls (Effects tab) ───────────────────────── + defs.add(FieldDef.section("ability.section.telegraph").tab("Effects")); + defs.add(FieldDef.enumField("ability.telegraphShape", TelegraphType.class, + this::getTelegraphType, this::setTelegraphType).tab("Effects")); + defs.add(FieldDef.boolField("ability.showTelegraph", this::isShowTelegraph, this::setShowTelegraph) + .tab("Effects").visibleWhen(this::hasTelegraphShape)); + defs.add(FieldDef.colorSubGui("ability.windUpColor", this::getWindUpColor, this::setWindUpColor) + .tab("Effects").visibleWhen(this::isTelegraphVisible)); + defs.add(FieldDef.colorSubGui("ability.activeColor", this::getActiveColor, this::setActiveColor) + .tab("Effects").visibleWhen(this::isTelegraphVisible)); + defs.add(FieldDef.floatField("ability.telegraphHeight", this::getTelegraphHeightOffset, this::setTelegraphHeightOffset) + .tab("Effects").visibleWhen(this::isTelegraphVisible)); + + // Telegraph active duration with sync toggle (mirrors windup sync pattern) + defs.add(FieldDef.row( + FieldDef.intField("ability.telegraphActiveTicks", this::getTelegraphActiveTicks, this::setTelegraphActiveTicks).range(0, 6000), + FieldDef.boolField("ability.syncTelegraph", this::isSyncTelegraphWithDuration, this::setSyncTelegraphWithDuration) + .hover("ability.hover.syncTelegraph") + ).tab("Effects").visibleWhen(() -> isTelegraphVisible() && !isSyncTelegraphWithDuration())); + defs.add(FieldDef.row( + FieldDef.labelField("ability.telegraphActiveTicks", () -> getResolvedTelegraphActiveTicks() + "t"), + FieldDef.boolField("ability.syncTelegraph", this::isSyncTelegraphWithDuration, this::setSyncTelegraphWithDuration) + .hover("ability.hover.syncTelegraph") + ).tab("Effects").visibleWhen(() -> isTelegraphVisible() && isSyncTelegraphWithDuration())); + + // Shape-specific dimension fields + defs.add(FieldDef.floatField("ability.telegraphRadius", this::getTRadius, this::setTRadius) + .tab("Effects").visibleWhen(() -> isTelegraphVisible() && needsRadius())); + defs.add(FieldDef.floatField("ability.telegraphInnerRadius", this::getTInnerRadius, this::setTInnerRadius) + .tab("Effects").visibleWhen(() -> isTelegraphVisible() && needsInnerRadius())); + defs.add(FieldDef.floatField("ability.telegraphLength", this::getTLength, this::setTLength) + .tab("Effects").visibleWhen(() -> isTelegraphVisible() && needsLength())); + defs.add(FieldDef.floatField("ability.telegraphWidth", this::getTWidth, this::setTWidth) + .tab("Effects").visibleWhen(() -> isTelegraphVisible() && needsWidth())); + defs.add(FieldDef.floatField("ability.telegraphAngle", this::getTAngle, this::setTAngle) + .tab("Effects").visibleWhen(() -> isTelegraphVisible() && needsAngle())); + } + + // ==================== TELEGRAPH VISIBILITY HELPERS ==================== + + private boolean hasTelegraphShape() { + return getTelegraphType() != TelegraphType.NONE; + } + + private boolean isTelegraphVisible() { + return hasTelegraphShape() && isShowTelegraph(); + } + + private boolean needsRadius() { + TelegraphType t = getTelegraphType(); + return t == TelegraphType.CIRCLE || t == TelegraphType.RING || t == TelegraphType.SQUARE; + } + + private boolean needsInnerRadius() { + TelegraphType t = getTelegraphType(); + return t == TelegraphType.RING || t == TelegraphType.CONE; + } + + private boolean needsLength() { + TelegraphType t = getTelegraphType(); + return t == TelegraphType.LINE || t == TelegraphType.CONE; + } + + private boolean needsWidth() { + return getTelegraphType() == TelegraphType.LINE; + } + + private boolean needsAngle() { + return getTelegraphType() == TelegraphType.CONE; } } diff --git a/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityCutter.java b/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityCutter.java index 8c6fecc4c..36dec1715 100644 --- a/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityCutter.java +++ b/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityCutter.java @@ -122,7 +122,7 @@ public class AbilityCutter extends Ability implements IAbilityCutter { return null; } - Telegraph telegraph = Telegraph.cone(getTelegraphLength(), getTelegraphAngle()); + Telegraph telegraph = Telegraph.cone(getTelegraphLength(), getTelegraphAngle(), getTelegraphInnerRadius()); int totalDuration = windUpTicks + getActiveDurationTicks(); telegraph.setDurationTicks(totalDuration); telegraph.setColor(windUpColor); @@ -162,6 +162,11 @@ public class AbilityCutter extends Ability implements IAbilityCutter { return arcAngle; } + @Override + public float getTelegraphInnerRadius() { + return innerRadius; + } + @Override public void onExecute(EntityLivingBase caster, EntityLivingBase target) { hitEntities.clear(); diff --git a/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityDodge.java b/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityDodge.java index 4672998bc..2938af70b 100644 --- a/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityDodge.java +++ b/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityDodge.java @@ -111,9 +111,10 @@ public class AbilityDodge extends AbilityDefend implements IAbilityDodge { @SideOnly(Side.CLIENT) @Override protected void getTypeDefinitions(List defs) { - defs.add(FieldDef.section("ability.section.dodgeAnimations").tab("Effects")); - FieldDef.insertAfter(defs, "ability.dazedAnimation", + FieldDef.section("ability.section.dodgeAnimations").tab("Effects")); + + FieldDef.insertAfter(defs, "ability.section.dodgeAnimations", FieldDef.animSubGui("ability.dodgeAnimation1", this::getDodgeAnimation1Id, this::setDodgeAnimation1Id, this::getDodgeAnimation1Name, this::setDodgeAnimation1Name) diff --git a/src/main/java/kamkeel/npcs/controllers/data/telegraph/Telegraph.java b/src/main/java/kamkeel/npcs/controllers/data/telegraph/Telegraph.java index d67cadeea..a12292263 100644 --- a/src/main/java/kamkeel/npcs/controllers/data/telegraph/Telegraph.java +++ b/src/main/java/kamkeel/npcs/controllers/data/telegraph/Telegraph.java @@ -152,6 +152,14 @@ public class Telegraph { return t; } + public static Telegraph cone(float length, float angle, float innerRadius) { + Telegraph t = new Telegraph("", TelegraphType.CONE); + t.length = length; + t.angle = angle; + t.innerRadius = innerRadius; + return t; + } + public static Telegraph point() { return new Telegraph("", TelegraphType.POINT); } diff --git a/src/main/java/noppes/npcs/AbstractDataAbilities.java b/src/main/java/noppes/npcs/AbstractDataAbilities.java index 635c4507f..63f632b5b 100644 --- a/src/main/java/noppes/npcs/AbstractDataAbilities.java +++ b/src/main/java/noppes/npcs/AbstractDataAbilities.java @@ -1021,6 +1021,11 @@ public abstract class AbstractDataAbilities { * Execute an ability immediately (no windup). Called when windUpTicks is 0. */ protected void executeImmediate(Ability ability, EntityLivingBase target) { + // Spawn telegraph for abilities that persist during active phase (e.g., Custom Ability) + if (ability.keepTelegraphDuringActive()) { + spawnTelegraph(ability, target); + } + // Play active sound and animation playAbilitySound(ability.getActiveSound()); playAbilityAnimation(ability.getActiveAnimation()); From 3919831857ff5251415145bf0a654cfa5fca84ce Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 5 Mar 2026 02:20:26 -0500 Subject: [PATCH 7/9] LANGS --- .../data/ability/CustomAbility.java | 33 ++++++++++++------- .../data/ability/type/AbilityCutter.java | 1 + .../assets/customnpcs/lang/en_US.lang | 18 ++++++++++ 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/src/main/java/kamkeel/npcs/controllers/data/ability/CustomAbility.java b/src/main/java/kamkeel/npcs/controllers/data/ability/CustomAbility.java index 4795e7363..fd9d32d39 100644 --- a/src/main/java/kamkeel/npcs/controllers/data/ability/CustomAbility.java +++ b/src/main/java/kamkeel/npcs/controllers/data/ability/CustomAbility.java @@ -405,19 +405,25 @@ public class CustomAbility extends Ability implements ICustomAbility { // ── Telegraph Controls (Effects tab) ───────────────────────── defs.add(FieldDef.section("ability.section.telegraph").tab("Effects")); defs.add(FieldDef.enumField("ability.telegraphShape", TelegraphType.class, - this::getTelegraphType, this::setTelegraphType).tab("Effects")); + this::getTelegraphType, this::setTelegraphType).tab("Effects") + .hover("ability.hover.telegraphShape")); defs.add(FieldDef.boolField("ability.showTelegraph", this::isShowTelegraph, this::setShowTelegraph) - .tab("Effects").visibleWhen(this::hasTelegraphShape)); + .tab("Effects").visibleWhen(this::hasTelegraphShape) + .hover("ability.hover.showTelegraph")); defs.add(FieldDef.colorSubGui("ability.windUpColor", this::getWindUpColor, this::setWindUpColor) - .tab("Effects").visibleWhen(this::isTelegraphVisible)); + .tab("Effects").visibleWhen(this::isTelegraphVisible) + .hover("ability.hover.windUpColor")); defs.add(FieldDef.colorSubGui("ability.activeColor", this::getActiveColor, this::setActiveColor) - .tab("Effects").visibleWhen(this::isTelegraphVisible)); + .tab("Effects").visibleWhen(this::isTelegraphVisible) + .hover("ability.hover.activeColor")); defs.add(FieldDef.floatField("ability.telegraphHeight", this::getTelegraphHeightOffset, this::setTelegraphHeightOffset) - .tab("Effects").visibleWhen(this::isTelegraphVisible)); + .tab("Effects").visibleWhen(this::isTelegraphVisible) + .hover("ability.hover.telegraphHeight")); // Telegraph active duration with sync toggle (mirrors windup sync pattern) defs.add(FieldDef.row( - FieldDef.intField("ability.telegraphActiveTicks", this::getTelegraphActiveTicks, this::setTelegraphActiveTicks).range(0, 6000), + FieldDef.intField("ability.telegraphActiveTicks", this::getTelegraphActiveTicks, this::setTelegraphActiveTicks).range(0, 6000) + .hover("ability.hover.telegraphActiveTicks"), FieldDef.boolField("ability.syncTelegraph", this::isSyncTelegraphWithDuration, this::setSyncTelegraphWithDuration) .hover("ability.hover.syncTelegraph") ).tab("Effects").visibleWhen(() -> isTelegraphVisible() && !isSyncTelegraphWithDuration())); @@ -429,15 +435,20 @@ public class CustomAbility extends Ability implements ICustomAbility { // Shape-specific dimension fields defs.add(FieldDef.floatField("ability.telegraphRadius", this::getTRadius, this::setTRadius) - .tab("Effects").visibleWhen(() -> isTelegraphVisible() && needsRadius())); + .tab("Effects").visibleWhen(() -> isTelegraphVisible() && needsRadius()) + .hover("ability.hover.telegraphRadius")); defs.add(FieldDef.floatField("ability.telegraphInnerRadius", this::getTInnerRadius, this::setTInnerRadius) - .tab("Effects").visibleWhen(() -> isTelegraphVisible() && needsInnerRadius())); + .tab("Effects").visibleWhen(() -> isTelegraphVisible() && needsInnerRadius()) + .hover("ability.hover.telegraphInnerRadius")); defs.add(FieldDef.floatField("ability.telegraphLength", this::getTLength, this::setTLength) - .tab("Effects").visibleWhen(() -> isTelegraphVisible() && needsLength())); + .tab("Effects").visibleWhen(() -> isTelegraphVisible() && needsLength()) + .hover("ability.hover.telegraphLength")); defs.add(FieldDef.floatField("ability.telegraphWidth", this::getTWidth, this::setTWidth) - .tab("Effects").visibleWhen(() -> isTelegraphVisible() && needsWidth())); + .tab("Effects").visibleWhen(() -> isTelegraphVisible() && needsWidth()) + .hover("ability.hover.telegraphWidth")); defs.add(FieldDef.floatField("ability.telegraphAngle", this::getTAngle, this::setTAngle) - .tab("Effects").visibleWhen(() -> isTelegraphVisible() && needsAngle())); + .tab("Effects").visibleWhen(() -> isTelegraphVisible() && needsAngle()) + .hover("ability.hover.telegraphAngle")); } // ==================== TELEGRAPH VISIBILITY HELPERS ==================== diff --git a/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityCutter.java b/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityCutter.java index 36dec1715..7454dd3f0 100644 --- a/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityCutter.java +++ b/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityCutter.java @@ -461,6 +461,7 @@ public class AbilityCutter extends Ability implements IAbilityCutter { FieldDef.row( FieldDef.floatField("ability.arcAngle", this::getArcAngle, this::setArcAngle), FieldDef.floatField("ability.innerRadius", this::getInnerRadius, this::setInnerRadius) + .hover("ability.hover.innerRadius") ), FieldDef.floatField("ability.sweepSpeed", this::getSweepSpeed, this::setSweepSpeed), FieldDef.intField("ability.spinDuration", this::getSpinDurationTicks, this::setSpinDurationTicks) diff --git a/src/main/resources/assets/customnpcs/lang/en_US.lang b/src/main/resources/assets/customnpcs/lang/en_US.lang index e6dc2779e..e23ef2d11 100644 --- a/src/main/resources/assets/customnpcs/lang/en_US.lang +++ b/src/main/resources/assets/customnpcs/lang/en_US.lang @@ -1772,6 +1772,14 @@ ability.dodgeAnimation3=Dodge Animation 3 ability.showTelegraph=Show Telegraph ability.windUpColor=Wind Up Color ability.activeColor=Active Color +ability.telegraphHeight=Height Offset +ability.telegraphRadius=Radius +ability.telegraphInnerRadius=Inner Radius +ability.telegraphLength=Length +ability.telegraphWidth=Width +ability.telegraphAngle=Angle +ability.telegraphActiveTicks=Active Ticks +ability.syncTelegraph=Sync Duration # Section Headers ability.section.timing=Timing @@ -2108,6 +2116,16 @@ ability.hover.canCounter=Enable counterattack when blocking damage ability.hover.counterType=Flat = fixed damage, Percent = % of blocked damage ability.hover.affectsCaster=Hazard can damage the NPC that created it ability.hover.sweepMode=Swipe = single arc attack, Spin = continuous rotation +ability.hover.innerRadius=Minimum distance from caster. Entities closer than this are not hit. Creates a donut-shaped dead zone. Also shown on the telegraph. +ability.hover.telegraphShape=Shape of the telegraph warning indicator. Different shapes use different size parameters. +ability.hover.telegraphHeight=Vertical offset from the ground for telegraph rendering +ability.hover.telegraphRadius=Radius of the telegraph shape (used by Circle, Ring, Square) +ability.hover.telegraphInnerRadius=Inner radius creating a hollow center. Used by Ring (donut) and Cone (truncated wedge). +ability.hover.telegraphLength=Forward distance of the telegraph shape (used by Line, Cone) +ability.hover.telegraphWidth=Side-to-side width of the telegraph (used by Line) +ability.hover.telegraphAngle=Spread angle in degrees (used by Cone) +ability.hover.telegraphActiveTicks=How long the telegraph stays visible during the active phase (20 ticks = 1 second). Set to 0 for windup-only telegraph. +ability.hover.syncTelegraph=When enabled, telegraph active duration automatically matches the ability duration ability.hover.launching=When enabled, wall launches forward dealing damage and knockback # Energy Barrier Abilities From 37d4b97a44dc64682f9433c731e84c7958438740 Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 5 Mar 2026 03:15:47 -0500 Subject: [PATCH 8/9] Ability Checking --- .../npcs/controllers/AbilityController.java | 12 ++ .../controllers/data/ability/Ability.java | 31 +++- .../data/ability/data/IAbilityAction.java | 10 ++ .../hud/ability/AbilityHotbarComponent.java | 27 ++- .../inventory/SubGuiSelectAbilityForSlot.java | 160 ------------------ .../controllers/data/PlayerAbilityData.java | 6 + 6 files changed, 79 insertions(+), 167 deletions(-) delete mode 100644 src/main/java/noppes/npcs/client/gui/player/inventory/SubGuiSelectAbilityForSlot.java diff --git a/src/main/java/kamkeel/npcs/controllers/AbilityController.java b/src/main/java/kamkeel/npcs/controllers/AbilityController.java index 5d3c19ebf..f365aadd1 100644 --- a/src/main/java/kamkeel/npcs/controllers/AbilityController.java +++ b/src/main/java/kamkeel/npcs/controllers/AbilityController.java @@ -81,6 +81,7 @@ public class AbilityController implements IAbilityHandler { private final List extenders = new ArrayList<>(); private final Map> conditionTypes = new HashMap<>(); private final List> flightCheckers = new ArrayList<>(); + private final List> activationCheckers = new ArrayList<>(); // ── Chained Abilities ────────────────────────────────────────────────── private final Map chainedAbilities = new LinkedHashMap<>(); // name → ChainedAbility @@ -1019,6 +1020,17 @@ public class AbilityController implements IAbilityHandler { return false; } + public void registerActivationChecker(Predicate checker) { + activationCheckers.add(checker); + } + + public boolean canPlayerActivate(EntityPlayer player) { + for (Predicate checker : activationCheckers) { + if (!checker.test(player)) return false; + } + return true; + } + /** * Fire onAbilityStart on all extenders. Returns false if ANY extender cancels. */ diff --git a/src/main/java/kamkeel/npcs/controllers/data/ability/Ability.java b/src/main/java/kamkeel/npcs/controllers/data/ability/Ability.java index f97c619ac..9c40d9c19 100644 --- a/src/main/java/kamkeel/npcs/controllers/data/ability/Ability.java +++ b/src/main/java/kamkeel/npcs/controllers/data/ability/Ability.java @@ -64,6 +64,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.function.Predicate; public abstract class Ability implements IAbility, IAbilityAction { @@ -156,6 +157,15 @@ public abstract class Ability implements IAbility, IAbilityAction { protected transient int defaultIconWidth = 48; protected transient int defaultIconHeight = 48; + /** + * Optional player requirement predicate. When set, the ability is only visible + * and usable by players for whom this predicate returns true. + * Evaluated on-demand (no polling). Null means no requirement (always available). + *

+ * This is transient — set programmatically by addons, not saved to NBT. + */ + protected transient Predicate playerRequirement; + /** * A single layer of a default ability icon. Each layer has a texture, * an optional dynamic color source, and optional per-state texture variants. @@ -1774,7 +1784,10 @@ public abstract class Ability implements IAbility, IAbilityAction { } public Ability deepCopy() { - return AbilityController.Instance.fromNBT(this.writeNBT(false)); + Ability copy = AbilityController.Instance.fromNBT(this.writeNBT(false)); + if (copy != null) + copy.playerRequirement = this.playerRequirement; + return copy; } @Override @@ -2358,6 +2371,22 @@ public abstract class Ability implements IAbility, IAbilityAction { this.allowedBy = allowedBy; } + public Predicate getPlayerRequirement() { + return playerRequirement; + } + + public void setPlayerRequirement(Predicate requirement) { + this.playerRequirement = requirement; + } + + /** + * Check if this ability is available for the given player. + * Returns true if no requirement is set, or if the requirement predicate passes. + */ + public boolean isAvailableFor(EntityPlayer player) { + return playerRequirement == null || playerRequirement.test(player); + } + public boolean isIgnoreCooldown() { return ignoreCooldown; } diff --git a/src/main/java/kamkeel/npcs/controllers/data/ability/data/IAbilityAction.java b/src/main/java/kamkeel/npcs/controllers/data/ability/data/IAbilityAction.java index 341fdd061..164215f3c 100644 --- a/src/main/java/kamkeel/npcs/controllers/data/ability/data/IAbilityAction.java +++ b/src/main/java/kamkeel/npcs/controllers/data/ability/data/IAbilityAction.java @@ -5,6 +5,7 @@ import kamkeel.npcs.controllers.data.ability.AbilityAction; import kamkeel.npcs.controllers.data.ability.enums.UserType; import kamkeel.npcs.controllers.data.ability.conditions.AbilityCondition; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import java.util.List; @@ -40,6 +41,15 @@ public interface IAbilityAction { boolean checkConditionsForPlayer(EntityLivingBase caster); + /** + * Check if this action is available for the given player. + * Used for visibility filtering (HUD, selection) and activation gating. + * Returns true by default (no requirement). + */ + default boolean isAvailableFor(EntityPlayer player) { + return true; + } + /** * Whether this action is a chained ability (sequence of abilities) vs an individual ability. */ diff --git a/src/main/java/noppes/npcs/client/gui/hud/ability/AbilityHotbarComponent.java b/src/main/java/noppes/npcs/client/gui/hud/ability/AbilityHotbarComponent.java index d08ee1bed..201abfcd0 100644 --- a/src/main/java/noppes/npcs/client/gui/hud/ability/AbilityHotbarComponent.java +++ b/src/main/java/noppes/npcs/client/gui/hud/ability/AbilityHotbarComponent.java @@ -8,7 +8,7 @@ import kamkeel.npcs.controllers.data.ability.data.IAbilityAction; import kamkeel.npcs.network.PacketHandler; import kamkeel.npcs.network.packets.player.ability.AbilityHotbarSelectPacket; import net.minecraft.client.Minecraft; -import noppes.npcs.client.ClientProxy; +import net.minecraft.entity.player.EntityPlayer; import noppes.npcs.client.ClientAbilityState; import noppes.npcs.client.KeyPressHandler; import net.minecraft.client.gui.FontRenderer; @@ -527,19 +527,34 @@ public class AbilityHotbarComponent extends HudComponent { PlayerAbilityHotbarData hotbarData = playerData.hotbarData; if (hotbarData == null) return; + EntityPlayer clientPlayer = Minecraft.getMinecraft().thePlayer; + boolean globalBlock = clientPlayer != null && AbilityController.Instance != null + && !AbilityController.Instance.canPlayerActivate(clientPlayer); + for (int i = 0; i < TOTAL_SLOTS; i++) { AbilityHotbarData slotData = hotbarData.slots[i]; String key = slotData.isEmpty() ? null : slotData.abilityKey; Ability ability = null; IAbilityAction action = null; if (key != null && AbilityController.Instance != null) { - if (slotData.isChainKey()) { - action = AbilityController.Instance.resolveChainedAbility(slotData.getResolveKey()); + if (globalBlock) { + key = null; } else { - ability = AbilityController.Instance.resolveAbility(key); - action = ability; + if (slotData.isChainKey()) { + action = AbilityController.Instance.resolveChainedAbility(slotData.getResolveKey()); + } else { + ability = AbilityController.Instance.resolveAbility(key); + action = ability; + } + if (ability == null && action == null) key = null; + + // Hide abilities whose player requirement is not met + if (action != null && clientPlayer != null && !action.isAvailableFor(clientPlayer)) { + key = null; + ability = null; + action = null; + } } - if (ability == null && action == null) key = null; } slots[i].setAbility(key, ability, action); } diff --git a/src/main/java/noppes/npcs/client/gui/player/inventory/SubGuiSelectAbilityForSlot.java b/src/main/java/noppes/npcs/client/gui/player/inventory/SubGuiSelectAbilityForSlot.java deleted file mode 100644 index d15ce860a..000000000 --- a/src/main/java/noppes/npcs/client/gui/player/inventory/SubGuiSelectAbilityForSlot.java +++ /dev/null @@ -1,160 +0,0 @@ -package noppes.npcs.client.gui.player.inventory; - -import kamkeel.npcs.controllers.AbilityController; -import kamkeel.npcs.controllers.data.ability.Ability; -import kamkeel.npcs.controllers.data.ability.data.ChainedAbility; -import net.minecraft.client.gui.GuiButton; -import noppes.npcs.client.ClientCacheHandler; -import noppes.npcs.client.gui.util.GuiCustomScroll; -import noppes.npcs.client.gui.util.GuiNpcButton; -import noppes.npcs.client.gui.util.GuiNpcTextField; -import noppes.npcs.client.gui.util.ICustomScrollListener; -import noppes.npcs.client.gui.util.ITextfieldListener; -import noppes.npcs.client.gui.util.SubGuiInterface; -import noppes.npcs.controllers.data.AbilityHotbarData; -import noppes.npcs.controllers.data.PlayerData; - -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -/** - * SubGui for selecting an ability to assign to a hotbar slot. - * Uses ability keys internally to avoid duplicate display name collisions. - */ -public class SubGuiSelectAbilityForSlot extends SubGuiInterface implements ICustomScrollListener, ITextfieldListener { - private LinkedHashMap keyToDisplay = new LinkedHashMap<>(); - private List scrollKeys = new ArrayList<>(); - private GuiCustomScroll scrollAbilities; - private int selectedIndex = -1; - private String search = ""; - - public boolean confirmed = false; - public String selectedAbilityKey = null; - public int slotIndex; - public boolean removeAbility = false; - - public SubGuiSelectAbilityForSlot(int slotIndex) { - this.slotIndex = slotIndex; - this.closeOnEsc = true; - this.drawDefaultBackground = true; - xSize = 256 + 10; - this.setBackground("menubg.png"); - } - - @Override - public void initGui() { - super.initGui(); - guiTop = (this.height - ySize) / 2 + 10; - - if (scrollAbilities == null) { - scrollAbilities = new GuiCustomScroll(this, 0, 0); - scrollAbilities.setSize(177, 185); - } - - scrollAbilities.guiLeft = guiLeft + 4; - scrollAbilities.guiTop = guiTop + 4; - addScroll(scrollAbilities); - - loadAbilities(); - scrollAbilities.setList(getSearchList()); - - addTextField(new GuiNpcTextField(55, this, fontRendererObj, guiLeft + 4, guiTop + 192, 177, 20, search)); - - addButton(new GuiNpcButton(0, guiLeft + 183, guiTop + 4, 79, 20, "gui.add")); - addButton(new GuiNpcButton(1, guiLeft + 183, guiTop + 26, 79, 20, "gui.cancel")); - addButton(new GuiNpcButton(2, guiLeft + 183, guiTop + 88, 79, 20, "gui.remove")); - } - - private void loadAbilities() { - keyToDisplay.clear(); - PlayerData playerData = ClientCacheHandler.playerData; - if (playerData == null || playerData.abilityData == null) { - return; - } - - List abilities = playerData.abilityData.getUnlockedAbilityList(); - for (String key : abilities) { - String displayName; - if (key.startsWith(AbilityHotbarData.CHAIN_PREFIX)) { - String chainKey = key.substring(AbilityHotbarData.CHAIN_PREFIX.length()); - ChainedAbility chain = AbilityController.Instance != null ? - AbilityController.Instance.resolveChainedAbility(chainKey) : null; - displayName = chain != null ? "\u00A76\u2726 " + chain.getDisplayName() : key; - } else { - Ability ability = AbilityController.Instance != null ? - AbilityController.Instance.resolveAbility(key) : null; - displayName = ability != null ? ability.getDisplayName() : key; - } - keyToDisplay.put(key, displayName); - } - } - - @Override - public void actionPerformed(GuiButton button) { - int id = button.id; - - if (id == 0 && selectedIndex >= 0 && selectedIndex < scrollKeys.size()) { - confirmed = true; - selectedAbilityKey = scrollKeys.get(selectedIndex); - this.close(); - } - if (id == 1) { - this.close(); - } - if (id == 2) { - this.removeAbility = true; - this.close(); - } - } - - @Override - public void customScrollClicked(int i, int i1, int i2, GuiCustomScroll guiCustomScroll) { - if (guiCustomScroll == scrollAbilities) { - selectedIndex = scrollAbilities.selected; - } - } - - @Override - public void customScrollDoubleClicked(String selection, GuiCustomScroll guiCustomScroll) { - if (guiCustomScroll == scrollAbilities && selectedIndex >= 0 && selectedIndex < scrollKeys.size()) { - confirmed = true; - selectedAbilityKey = scrollKeys.get(selectedIndex); - this.close(); - } - } - - @Override - public void unFocused(GuiNpcTextField guiNpcTextField) { - } - - @Override - public void keyTyped(char c, int i) { - super.keyTyped(c, i); - if (getTextField(55) != null) { - if (getTextField(55).isFocused()) { - if (search.equals(getTextField(55).getText())) - return; - search = getTextField(55).getText().toLowerCase(); - scrollAbilities.resetScroll(); - selectedIndex = -1; - scrollAbilities.setList(getSearchList()); - } - } - } - - private List getSearchList() { - scrollKeys.clear(); - List displayNames = new ArrayList<>(); - - for (Map.Entry entry : keyToDisplay.entrySet()) { - String displayName = entry.getValue(); - if (search.isEmpty() || displayName.toLowerCase().contains(search)) { - scrollKeys.add(entry.getKey()); - displayNames.add(displayName); - } - } - return displayNames; - } -} diff --git a/src/main/java/noppes/npcs/controllers/data/PlayerAbilityData.java b/src/main/java/noppes/npcs/controllers/data/PlayerAbilityData.java index b6aa3f4d0..35d6c4239 100644 --- a/src/main/java/noppes/npcs/controllers/data/PlayerAbilityData.java +++ b/src/main/java/noppes/npcs/controllers/data/PlayerAbilityData.java @@ -381,6 +381,9 @@ public class PlayerAbilityData extends AbstractDataAbilities implements IPlayerA public boolean activateAbility(EntityPlayer player, String key) { if (player.worldObj.isRemote || key == null || key.isEmpty()) return false; + // Global activation check (e.g., addon-registered restrictions) + if (!AbilityController.Instance.canPlayerActivate(player)) return false; + // Can't activate if already executing if (currentAbility != null && currentAbility.isExecuting()) return false; if (isExecutingChain()) return false; @@ -395,6 +398,9 @@ public class PlayerAbilityData extends AbstractDataAbilities implements IPlayerA // Check conditions (skip target-requiring ones) if (!action.checkConditionsForPlayer(player)) return false; + // Check player requirement (visibility/availability gate) + if (!action.isAvailableFor(player)) return false; + // Dispatch: chain vs ability if (action.isChain()) { if (isOnCooldown()) return false; From 211f741a64d066f3e22d60ba9291fb6c7612f997 Mon Sep 17 00:00:00 2001 From: Kam Date: Thu, 5 Mar 2026 04:41:56 -0500 Subject: [PATCH 9/9] 1.11 Beta 14 --- build.gradle | 2 +- src/main/java/noppes/npcs/CustomNpcs.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index bcdbd58f1..1659a54cd 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { id 'idea' } -version = "1.11-beta13.1" +version = "1.11-beta14" group= "kamkeel.customnpc-plus" archivesBaseName = "CustomNPC-Plus" diff --git a/src/main/java/noppes/npcs/CustomNpcs.java b/src/main/java/noppes/npcs/CustomNpcs.java index 8fa190ecc..23dc8401b 100644 --- a/src/main/java/noppes/npcs/CustomNpcs.java +++ b/src/main/java/noppes/npcs/CustomNpcs.java @@ -124,7 +124,7 @@ import java.util.HashSet; import java.util.Set; import java.util.function.Consumer; -@Mod(modid = "customnpcs", name = "CustomNPC+", version = "1.11-beta13.1") +@Mod(modid = "customnpcs", name = "CustomNPC+", version = "1.11-beta14") public class CustomNpcs { @SidedProxy(clientSide = "noppes.npcs.client.ClientProxy", serverSide = "noppes.npcs.CommonProxy")