diff --git a/src/main/java/kamkeel/npcs/controllers/AbilityController.java b/src/main/java/kamkeel/npcs/controllers/AbilityController.java index 66c057929..a55322dc1 100644 --- a/src/main/java/kamkeel/npcs/controllers/AbilityController.java +++ b/src/main/java/kamkeel/npcs/controllers/AbilityController.java @@ -474,8 +474,6 @@ public class AbilityController implements IAbilityHandler { changed = true; } - // An active toggle holds the resolved Ability directly and keeps ticking it, - // so drop it without firing onToggle against an unregistered ability. if (uuid != null && !uuid.isEmpty()) { pData.abilityData.setToggleEntryDirect(uuid, 0); } 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 d944f7535..0d5b2f35c 100644 --- a/src/main/java/kamkeel/npcs/controllers/data/ability/Ability.java +++ b/src/main/java/kamkeel/npcs/controllers/data/ability/Ability.java @@ -1172,8 +1172,6 @@ public abstract class Ability implements IAbility, IAbilityAction { this.burstIndex = 0; this.burstEntities.clear(); - // Use the effective windup, not the raw field: when the windup is synced to an - // animation the raw field is not the duration that actually applies. if (getWindUpTicks() <= 0) { this.phase = AbilityPhase.ACTIVE; } else { diff --git a/src/main/java/kamkeel/npcs/controllers/data/ability/extender/IAbilityExtender.java b/src/main/java/kamkeel/npcs/controllers/data/ability/extender/IAbilityExtender.java index 2a0b90344..0f5357989 100644 --- a/src/main/java/kamkeel/npcs/controllers/data/ability/extender/IAbilityExtender.java +++ b/src/main/java/kamkeel/npcs/controllers/data/ability/extender/IAbilityExtender.java @@ -110,15 +110,7 @@ public interface IAbilityExtender { } /** - * Called when a barrier entity takes a melee hit, allowing extenders to scale the damage. - * A barrier is a plain Entity, so no LivingHurtEvent fires for it and an extender has no - * other opportunity to scale melee against it the way it scales {@link #modifyBarrierHealth}. - * Cumulative: all extenders apply in sequence, each receiving the previous output. - * - * @param barrier The barrier being hit - * @param attacker The entity dealing the hit - * @param baseDamage The damage after the barrier's own melee multiplier - * @return The modified damage value + * Modify melee damage dealt to a barrier. Cumulative across all extenders. */ default float modifyBarrierMeleeDamage(EntityEnergyBarrier barrier, EntityLivingBase attacker, float baseDamage) { return baseDamage; diff --git a/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityDefend.java b/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityDefend.java index 4826daee4..06314e651 100644 --- a/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityDefend.java +++ b/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityDefend.java @@ -74,8 +74,6 @@ public abstract class AbilityDefend extends Ability implements IAbilityDefend { hitCount = 0; lastAttacker = null; lastDamageTaken = 0.0f; - // NPCs reuse one ability instance, so every transient field has to be cleared here. - // A leftover pendingCompletion would end the next activation on its first tick. pendingDefendAnimation = null; defendAnimEndTick = -1; lastDefendTick = -1; diff --git a/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityProjectile.java b/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityProjectile.java index 3caabc678..cd46c9772 100644 --- a/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityProjectile.java +++ b/src/main/java/kamkeel/npcs/controllers/data/ability/type/AbilityProjectile.java @@ -97,8 +97,6 @@ public class AbilityProjectile extends Ability implements IAbilityProjectile { dz /= len; } - // A rotation-locked NPC cannot turn to follow the target, so it can only hit what its - // frozen heading still covers - the same cone the player hit scan uses. if (isRotationLockedForCurrentPhase()) { Vec3 look = caster.getLookVec(); if (look != null && (dx * look.xCoord + dy * look.yCoord + dz * look.zCoord) < 0.95) { diff --git a/src/main/java/kamkeel/npcs/controllers/data/ability/type/energy/AbilityEnergyProjectile.java b/src/main/java/kamkeel/npcs/controllers/data/ability/type/energy/AbilityEnergyProjectile.java index 723781d36..aa0f19403 100644 --- a/src/main/java/kamkeel/npcs/controllers/data/ability/type/energy/AbilityEnergyProjectile.java +++ b/src/main/java/kamkeel/npcs/controllers/data/ability/type/energy/AbilityEnergyProjectile.java @@ -249,9 +249,6 @@ public abstract class AbilityEnergyProjectile */ protected EntityLivingBase getLaunchTarget(EntityLivingBase caster, EntityLivingBase target) { if (isPlayerCaster(caster)) return null; - // A rotation-locked NPC cannot turn, so launching from the target's position would let - // it fire a perfectly aimed shot regardless of where it is facing. Fall back to the - // look vector, which reflects the frozen heading. if (isRotationLockedForCurrentPhase()) return null; return target; } diff --git a/src/main/java/kamkeel/npcs/entity/EntityAbilityLaser.java b/src/main/java/kamkeel/npcs/entity/EntityAbilityLaser.java index f8f5d44f5..d5dc0b809 100644 --- a/src/main/java/kamkeel/npcs/entity/EntityAbilityLaser.java +++ b/src/main/java/kamkeel/npcs/entity/EntityAbilityLaser.java @@ -264,10 +264,7 @@ public class EntityAbilityLaser extends EntityEnergyProjectile { Vec3 anchorPos = AnchorPointHelper.calculateAnchorPosition(livingOwner, anchorData); setPosition(anchorPos.xCoord, anchorPos.yCoord, anchorPos.zCoord); - // Converge on the point the owner is aiming at, not on the target itself. Aiming - // straight at the target would re-derive the direction every tick and ignore the - // rotation the owner is actually allowed to reach, which is what track speed and - // rotation lock constrain. + // Aim where the owner is looking so track speed and rotation lock still apply. double aimX = livingOwner.posX + dirX * maxLength; double aimY = livingOwner.posY + livingOwner.getEyeHeight() + dirY * maxLength; double aimZ = livingOwner.posZ + dirZ * maxLength; diff --git a/src/main/java/kamkeel/npcs/entity/EntityAbilityZone.java b/src/main/java/kamkeel/npcs/entity/EntityAbilityZone.java index 529d59d74..be3593091 100644 --- a/src/main/java/kamkeel/npcs/entity/EntityAbilityZone.java +++ b/src/main/java/kamkeel/npcs/entity/EntityAbilityZone.java @@ -155,7 +155,6 @@ public class EntityAbilityZone extends Entity implements IEntityAdditionalSpawnD // HAZARD-SPECIFIC PROPERTIES // ═══════════════════════════════════════════════════════════════════ - /** Floor on how often a hazard pulses, so a small interval cannot turn into a per-tick scan. */ public static final int MIN_DAMAGE_INTERVAL = 5; private float damagePerSecond = 1.0f; @@ -520,8 +519,6 @@ public class EntityAbilityZone extends Entity implements IEntityAdditionalSpawnD if (!isInZone(entity)) continue; if (damagePerSecond > 0) { - // The configured value is damage per second, so a pulse deals the share of a - // second it covers. Applying it whole made the real rate depend on the interval. applyDamage(entity, owner, damagePerSecond * (damageInterval / 20.0f)); } diff --git a/src/main/java/kamkeel/npcs/entity/EntityEnergyBarrier.java b/src/main/java/kamkeel/npcs/entity/EntityEnergyBarrier.java index da9edb676..ce20144b4 100644 --- a/src/main/java/kamkeel/npcs/entity/EntityEnergyBarrier.java +++ b/src/main/java/kamkeel/npcs/entity/EntityEnergyBarrier.java @@ -117,7 +117,6 @@ public abstract class EntityEnergyBarrier extends EntityEnergyAbility { protected EnergyBarrierData barrierData = new EnergyBarrierData(); protected float currentHealth; protected int ticksAlive = 0; - /** Absolute world time the barrier expires at, so ticks it misses cannot extend it. */ protected long barrierDeathTime = -1; // ==================== DATA WATCHER INDICES ==================== @@ -443,9 +442,7 @@ public abstract class EntityEnergyBarrier extends EntityEnergyAbility { Entity attacker = source.getEntity(); - // A barrier is a plain Entity, so no LivingHurtEvent fires for it and nothing scales the - // hit the way it would against a living target - vanilla hands us the bare attackDamage - // attribute. Run the scaling here instead, or the barrier only ever takes a point of it. + // No LivingHurtEvent fires for a barrier, so scale the hit here. if (attacker instanceof EntityLivingBase) { damage = AbilityController.Instance.fireModifyBarrierMeleeDamage(this, (EntityLivingBase) attacker, damage); } @@ -526,15 +523,12 @@ public abstract class EntityEnergyBarrier extends EntityEnergyAbility { } } - // Set the deadline on the first tick after charging, so lifetime starts when the - // barrier is actually up. Counting elapsed ticks instead would let any tick the - // entity misses - chunk unload, for one - extend it past its configured duration. if (barrierDeathTime < 0 && !isCharging()) { barrierDeathTime = worldObj.getTotalWorldTime() + (barrierData.useDuration ? barrierData.durationTicks : BARRIER_HARD_LIFETIME_CAP); } - // Duration check, and the hard lifetime cap for barriers with no duration + // Duration check if (barrierDeathTime >= 0 && worldObj.getTotalWorldTime() >= barrierDeathTime) { onBarrierDestroyed(); this.setDead(); diff --git a/src/main/java/kamkeel/npcs/network/packets/player/ability/AbilityHotbarSelectPacket.java b/src/main/java/kamkeel/npcs/network/packets/player/ability/AbilityHotbarSelectPacket.java index 87affdc1b..e691c5d23 100644 --- a/src/main/java/kamkeel/npcs/network/packets/player/ability/AbilityHotbarSelectPacket.java +++ b/src/main/java/kamkeel/npcs/network/packets/player/ability/AbilityHotbarSelectPacket.java @@ -50,8 +50,6 @@ public final class AbilityHotbarSelectPacket extends AbstractPacket { // Deselect data.abilityData.setSelectedIndex(-1); } else { - // A key the player no longer has deselects rather than leaving the previous - // selection in place, which would fire a different ability than the one shown. data.abilityData.setSelectedIndex(data.abilityData.getUnlockedAbilityList().indexOf(key)); } data.save(); diff --git a/src/main/java/noppes/npcs/AbstractDataAbilities.java b/src/main/java/noppes/npcs/AbstractDataAbilities.java index 12f1fd793..8a0305405 100644 --- a/src/main/java/noppes/npcs/AbstractDataAbilities.java +++ b/src/main/java/noppes/npcs/AbstractDataAbilities.java @@ -788,8 +788,7 @@ public abstract class AbstractDataAbilities { // Script may have completed/cancelled the ability during the tick event if (currentAbility == null) return; if (!currentAbility.isExecuting()) { - // tick() itself can end the ability (DAZED -> IDLE). Run its completion here, - // otherwise it stays the current ability forever and nothing else can start. + // tick() can end the ability (DAZED -> IDLE) if (phaseChanged && currentAbility.getPhase() == AbilityPhase.IDLE) { handleAbilityCompletion(target); } diff --git a/src/main/java/noppes/npcs/CommonProxy.java b/src/main/java/noppes/npcs/CommonProxy.java index 0c60d14ac..1e6e64ebb 100644 --- a/src/main/java/noppes/npcs/CommonProxy.java +++ b/src/main/java/noppes/npcs/CommonProxy.java @@ -225,11 +225,6 @@ public class CommonProxy implements IGuiHandler { public void buildPackageIndex() { } - /** - * Called from the mod's FMLLoadCompleteEvent, after every other mod has finished loading. - * Anything that has to observe another mod's registrations belongs here rather than in - * load(), and it stays on the proxy so client-only types never reach the server. - */ public void loadComplete() { } diff --git a/src/main/java/noppes/npcs/CustomNpcs.java b/src/main/java/noppes/npcs/CustomNpcs.java index 7274a490e..68080765a 100644 --- a/src/main/java/noppes/npcs/CustomNpcs.java +++ b/src/main/java/noppes/npcs/CustomNpcs.java @@ -343,9 +343,6 @@ public class CustomNpcs { @EventHandler public void loadComplete(FMLLoadCompleteEvent ev) { - // Runs after every other mod has loaded. Kept on the proxy: the client side registers - // inventory tabs, and naming those types here would drag client-only GUI classes into - // a class the server loads. proxy.loadComplete(); proxy.buildPackageIndex(); diff --git a/src/main/java/noppes/npcs/DataAbilities.java b/src/main/java/noppes/npcs/DataAbilities.java index 3888df2d5..cd53d7eb8 100644 --- a/src/main/java/noppes/npcs/DataAbilities.java +++ b/src/main/java/noppes/npcs/DataAbilities.java @@ -191,9 +191,7 @@ public class DataAbilities extends AbstractDataAbilities { long now = npc.worldObj.getTotalWorldTime(); if (ability.isPerAbilityCooldown() && ability.getCooldownTicks() > 0) { - // The ability's own cooldown is tracked against the ability, so the global timer - // only paces how often the NPC acts. Folding the ability's cooldown into it as - // well would always outlast the per-ability entry and make it unreachable. + // Global timer only paces the NPC; the ability tracks its own cooldown cooldownEndTime = now + baseCooldown; setPerAbilityCooldown(ability.getName(), now + ability.getCooldownTicks(), ability.getCooldownTicks()); } else { diff --git a/src/main/java/noppes/npcs/VersionCompatibility.java b/src/main/java/noppes/npcs/VersionCompatibility.java index ee81b2012..2edd3db18 100644 --- a/src/main/java/noppes/npcs/VersionCompatibility.java +++ b/src/main/java/noppes/npcs/VersionCompatibility.java @@ -25,10 +25,7 @@ public class VersionCompatibility { compound.setInteger("AimType", !aimShot ? 0 : 1); } - // Fire projectiles used to ignite unconditionally. The ignite check now also requires - // pBurnItem, which reads false when the key is absent, so restore it for anything - // saved before the flag existed. Shipped alongside revision 23, so anything already - // at 23 was written by a build that had the flag. + // Restore burning on Fire projectiles saved before pBurnItem existed if (compound.hasKey("pEffect") && !compound.hasKey("pBurnItem")) { if (EnumPotionType.fromOrdinal(compound.getInteger("pEffect")) == EnumPotionType.Fire) { compound.setBoolean("pBurnItem", true); diff --git a/src/main/java/noppes/npcs/ai/EntityAITransform.java b/src/main/java/noppes/npcs/ai/EntityAITransform.java index b0c3fa30e..ac7381b99 100644 --- a/src/main/java/noppes/npcs/ai/EntityAITransform.java +++ b/src/main/java/noppes/npcs/ai/EntityAITransform.java @@ -10,9 +10,6 @@ public class EntityAITransform extends EntityAIBase { public EntityAITransform(EntityNPCInterface npc) { this.npc = npc; - // No mutex: this only polls the world time and flips the transform, it drives nothing. - // Claiming PASSIVE let any running movement or look task starve it, so the day/night - // swap only fired in the gaps where those yielded - such as while saying a line. setMutexBits(0); } diff --git a/src/main/java/noppes/npcs/client/ClientProxy.java b/src/main/java/noppes/npcs/client/ClientProxy.java index 2c5edf9e2..cb2fc765b 100644 --- a/src/main/java/noppes/npcs/client/ClientProxy.java +++ b/src/main/java/noppes/npcs/client/ClientProxy.java @@ -852,8 +852,7 @@ public class ClientProxy extends CommonProxy { @Override public void loadComplete() { - // Deferred from load() so TConstruct has registered its own tabs first - registering - // ours before it left the vanilla tab duplicated. + // Deferred from load() so TConstruct registers its tabs first if (ConfigClient.InventoryGuiEnabled) { MinecraftForge.EVENT_BUS.register(new TabRegistry()); if (TabRegistry.getTabList().isEmpty()) { diff --git a/src/main/java/noppes/npcs/client/gui/SubGuiTrapPresetSelector.java b/src/main/java/noppes/npcs/client/gui/SubGuiTrapPresetSelector.java index 086e27569..6d6042f32 100644 --- a/src/main/java/noppes/npcs/client/gui/SubGuiTrapPresetSelector.java +++ b/src/main/java/noppes/npcs/client/gui/SubGuiTrapPresetSelector.java @@ -13,14 +13,6 @@ public class SubGuiTrapPresetSelector extends SubGuiInterface { public String selectedPreset = null; - /** - * Builds the trap editor's preset field. - *

- * This lives here rather than in AbilityTrap because the lambda below carries this class in - * its method descriptor. AbilityTrap is a both-side class, and @SideOnly does not strip the - * synthetic lambda methods it generates - so anything reflecting over its declared methods - * on a server would resolve that descriptor and fail to find this client-only type. - */ public static FieldDef createPresetField(java.util.function.Consumer applyPreset) { return FieldDef.subGuiField("gui.applyPreset", SubGuiTrapPresetSelector::new, diff --git a/src/main/java/noppes/npcs/client/gui/SubGuiZonePresetSelector.java b/src/main/java/noppes/npcs/client/gui/SubGuiZonePresetSelector.java index 5bdc9c291..5ef40539d 100644 --- a/src/main/java/noppes/npcs/client/gui/SubGuiZonePresetSelector.java +++ b/src/main/java/noppes/npcs/client/gui/SubGuiZonePresetSelector.java @@ -13,14 +13,6 @@ public class SubGuiZonePresetSelector extends SubGuiInterface { public String selectedPreset = null; - /** - * Builds the zone editor's preset field. - *

- * This lives here rather than in AbilityZone because the lambda below carries this class in - * its method descriptor. AbilityZone is a both-side class, and @SideOnly does not strip the - * synthetic lambda methods it generates - so anything reflecting over its declared methods - * on a server would resolve that descriptor and fail to find this client-only type. - */ public static FieldDef createPresetField(java.util.function.Consumer applyPreset) { return FieldDef.subGuiField("gui.applyPreset", SubGuiZonePresetSelector::new, diff --git a/src/main/java/noppes/npcs/client/gui/advanced/SubGuiAbilityMagic.java b/src/main/java/noppes/npcs/client/gui/advanced/SubGuiAbilityMagic.java index 8f555017a..2afa7a90b 100644 --- a/src/main/java/noppes/npcs/client/gui/advanced/SubGuiAbilityMagic.java +++ b/src/main/java/noppes/npcs/client/gui/advanced/SubGuiAbilityMagic.java @@ -39,14 +39,6 @@ public class SubGuiAbilityMagic extends SubGuiInterface implements ICustomScroll private GuiNpcTextField splitField; - /** - * Builds the ability editor's magic field. - *

- * This lives here rather than in Ability because the lambdas below carry this class in - * their method descriptors. Ability is a both-side class, and anything reflecting over its - * declared methods on a server - Nashorn's adapter generator, for one - would resolve those - * descriptors and fail to find this client-only type. - */ public static FieldDef createMagicField(MagicData magicData) { return FieldDef.subGuiField("ability.magic.editor", () -> new SubGuiAbilityMagic(magicData.copy()), diff --git a/src/main/java/noppes/npcs/client/gui/advanced/SubGuiCustomEffectSelect.java b/src/main/java/noppes/npcs/client/gui/advanced/SubGuiCustomEffectSelect.java index 233ad8ece..f4ecf1e0e 100644 --- a/src/main/java/noppes/npcs/client/gui/advanced/SubGuiCustomEffectSelect.java +++ b/src/main/java/noppes/npcs/client/gui/advanced/SubGuiCustomEffectSelect.java @@ -27,14 +27,6 @@ import java.util.Map; @SideOnly(Side.CLIENT) public class SubGuiCustomEffectSelect extends SubGuiInterface implements ICustomScrollListener, ITextfieldListener { - /** - * Builds the condition editor's effect-select field. - *

- * This lives here rather than in ConditionHasEffect because the lambdas below carry this - * class in their method descriptors. The condition is a both-side class, and @SideOnly does - * not strip the synthetic lambda methods it generates - so anything reflecting over its - * declared methods on a server would resolve those descriptors and fail to find this type. - */ public static FieldDef createSelectField(ConditionHasEffect condition) { return FieldDef.subGuiField("condition.select_effect", () -> new SubGuiCustomEffectSelect(condition.getEffectId(), condition.getEffectIndex()), diff --git a/src/main/java/noppes/npcs/client/gui/roles/GuiNpcTraderSetup.java b/src/main/java/noppes/npcs/client/gui/roles/GuiNpcTraderSetup.java index 1e5aab8d1..b00eacb18 100644 --- a/src/main/java/noppes/npcs/client/gui/roles/GuiNpcTraderSetup.java +++ b/src/main/java/noppes/npcs/client/gui/roles/GuiNpcTraderSetup.java @@ -117,12 +117,11 @@ public class GuiNpcTraderSetup extends GuiContainerNPCInterface2 implements ITex @Override public void save() { - // Linking to a different market already replaced the server's role with that market's - // data. Pushing this GUI's pre-link state back would overwrite the market being linked to. + // Relinking already loaded the target market server-side if (marketRelinked) return; - // Save the role first so the market is written from the edited data, not the stale data. + // Role first, so the market is written from the edited data PacketClient.sendClient(new RoleSavePacket(role.writeToNBT(new NBTTagCompound()))); PacketClient.sendClient(new TraderMarketSavePacket(role.marketName, false)); } diff --git a/src/main/java/noppes/npcs/client/gui/select/GuiQuestSelection.java b/src/main/java/noppes/npcs/client/gui/select/GuiQuestSelection.java index cf805fe44..cd149fdcd 100644 --- a/src/main/java/noppes/npcs/client/gui/select/GuiQuestSelection.java +++ b/src/main/java/noppes/npcs/client/gui/select/GuiQuestSelection.java @@ -29,14 +29,6 @@ public class GuiQuestSelection extends SubGuiInterface implements ICustomScrollL private QuestCategory selectedCategory; public Quest selectedQuest; - /** - * Builds the condition editor's quest-select field. - *

- * This lives here rather than in ConditionQuestCompleted because the lambdas below carry - * this class in their method descriptors. The condition is a both-side class, and @SideOnly - * does not strip the synthetic lambda methods it generates - so anything reflecting over its - * declared methods on a server would resolve those descriptors and fail to find this type. - */ public static FieldDef createConditionField(ConditionQuestCompleted condition) { return FieldDef.subGuiField("condition.select_quest", () -> new GuiQuestSelection(condition.getQuestId()), diff --git a/src/main/java/noppes/npcs/client/gui/util/GuiNPCInterface.java b/src/main/java/noppes/npcs/client/gui/util/GuiNPCInterface.java index 24d08cff2..79e721b92 100644 --- a/src/main/java/noppes/npcs/client/gui/util/GuiNPCInterface.java +++ b/src/main/java/noppes/npcs/client/gui/util/GuiNPCInterface.java @@ -516,10 +516,7 @@ public abstract class GuiNPCInterface extends GuiScreen { boolean subGui = hasSubGui(); - // Mouse.getDWheel() clears the accumulated delta, so only the first caller in a frame - // ever sees it. Read it once here and let each widget take it in turn; anything that - // consumes it zeroes it so later widgets - the script editor, for one - are not left - // reading an already-drained wheel. + // Read the wheel once; each widget zeroes it when it consumes it mouseScroll = Mouse.getDWheel(); drawCenteredString(fontRendererObj, title, width / 2, guiTop + 4, 0xffffff); diff --git a/src/main/java/noppes/npcs/client/gui/util/GuiScriptTextArea.java b/src/main/java/noppes/npcs/client/gui/util/GuiScriptTextArea.java index 70283b7e0..8bd2cfa45 100644 --- a/src/main/java/noppes/npcs/client/gui/util/GuiScriptTextArea.java +++ b/src/main/java/noppes/npcs/client/gui/util/GuiScriptTextArea.java @@ -624,8 +624,6 @@ public class GuiScriptTextArea extends GuiNpcTextField { int maxScroll = Math.max(0, getPaddedLineCount() - container.visibleLines); // Handle mouse wheel scroll - // Take whatever the parent screen has left for this frame rather than polling the wheel - // again - the poll is destructive and the parent has already drained it. int wheelDelta = listener instanceof GuiNPCInterface ? ((GuiNPCInterface) listener).mouseScroll : Mouse.getDWheel(); if (listener instanceof GuiNPCInterface) { ((GuiNPCInterface) listener).mouseScroll = 0; diff --git a/src/main/java/noppes/npcs/client/gui/util/GuiScriptTextArea1.java b/src/main/java/noppes/npcs/client/gui/util/GuiScriptTextArea1.java index a5a555514..fbe194b34 100644 --- a/src/main/java/noppes/npcs/client/gui/util/GuiScriptTextArea1.java +++ b/src/main/java/noppes/npcs/client/gui/util/GuiScriptTextArea1.java @@ -486,8 +486,6 @@ public class GuiScriptTextArea1 extends GuiNpcTextField { int maxScroll = Math.max(0, getPaddedLineCount() - container.visibleLines); // Handle mouse wheel scroll - // Take whatever the parent screen has left for this frame rather than polling the wheel - // again - the poll is destructive and the parent has already drained it. int wheelDelta = listener instanceof GuiNPCInterface ? ((GuiNPCInterface) listener).mouseScroll : Mouse.getDWheel(); if (listener instanceof GuiNPCInterface) { ((GuiNPCInterface) listener).mouseScroll = 0; diff --git a/src/main/java/noppes/npcs/client/gui/util/script/interpreter/type/TypeInfo.java b/src/main/java/noppes/npcs/client/gui/util/script/interpreter/type/TypeInfo.java index df406ebba..be16c40f4 100644 --- a/src/main/java/noppes/npcs/client/gui/util/script/interpreter/type/TypeInfo.java +++ b/src/main/java/noppes/npcs/client/gui/util/script/interpreter/type/TypeInfo.java @@ -328,10 +328,6 @@ public class TypeInfo { return fromGenericType(type, new HashSet>()); } - /** - * @param resolving type variables whose bounds are currently being expanded, so a - * self-referential bound such as {@code E extends Enum} terminates - */ private static TypeInfo fromGenericType(Type type, Set> resolving) { if (type == null) return null; @@ -383,7 +379,6 @@ public class TypeInfo { if (type instanceof TypeVariable) { TypeVariable typeVar = (TypeVariable) type; String varName = typeVar.getName(); - // Already expanding this variable - emit it unbounded rather than recursing forever if (!resolving.add(typeVar)) { return TypeInfo.typeParameter(varName); } diff --git a/src/main/java/noppes/npcs/client/model/part/tails/ModelMonkeyTail.java b/src/main/java/noppes/npcs/client/model/part/tails/ModelMonkeyTail.java index 347b5ebfa..17cf611ea 100644 --- a/src/main/java/noppes/npcs/client/model/part/tails/ModelMonkeyTail.java +++ b/src/main/java/noppes/npcs/client/model/part/tails/ModelMonkeyTail.java @@ -34,8 +34,6 @@ public class ModelMonkeyTail extends ModelRenderer { public ModelMonkeyTail(ModelBiped base) { super(base); - // Cancels ModelTail's rotationPointY of 11 so the boxes land where JBRA puts them - // on players: plain tail at 10, wrapped tail at 0. float heightFactor = -11.0f; (this.monkey_large = new ModelRenderer(base, 38, 54)).addBox(-2.0f, -2.0f, 0.0f, 4, 4, 6); diff --git a/src/main/java/noppes/npcs/controllers/DialogController.java b/src/main/java/noppes/npcs/controllers/DialogController.java index b65e1ef5e..a80fd2f8d 100644 --- a/src/main/java/noppes/npcs/controllers/DialogController.java +++ b/src/main/java/noppes/npcs/controllers/DialogController.java @@ -84,14 +84,9 @@ public class DialogController implements IDialogHandler { lastUsedDialogID = id; Dialog dialog = category.dialogs.get(id); if (dialogs.containsKey(id)) { - // Dialog IDs live in the filename, not inside the JSON body, - // so a simple rename permanently resolves the conflict. File catDir = new File(getDir(), category.title); - // Find the next free ID. It has to clear three things: the ids already - // registered globally, the ids this category still holds but has not - // reached yet, and any file already on disk - renameTo overwrites - // silently on POSIX, so landing on an existing file would destroy it. + // Skip ids held globally, by this category, or already on disk int newId = lastUsedDialogID; do { newId++; diff --git a/src/main/java/noppes/npcs/controllers/QuestController.java b/src/main/java/noppes/npcs/controllers/QuestController.java index 3d9b707b3..50cca4311 100644 --- a/src/main/java/noppes/npcs/controllers/QuestController.java +++ b/src/main/java/noppes/npcs/controllers/QuestController.java @@ -78,14 +78,9 @@ public class QuestController implements IQuestHandler { lastUsedQuestID = id; Quest quest = category.quests.get(id); if (quests.containsKey(id)) { - // Quest IDs live in the filename, not inside the JSON body, - // so a simple rename permanently resolves the conflict. File catDir = new File(getDir(), category.title); - // Find the next free ID. It has to clear three things: the ids already - // registered globally, the ids this category still holds but has not - // reached yet, and any file already on disk - renameTo overwrites - // silently on POSIX, so landing on an existing file would destroy it. + // Skip ids held globally, by this category, or already on disk int newId = lastUsedQuestID; do { newId++; diff --git a/src/main/java/noppes/npcs/controllers/data/PlayerAbilityData.java b/src/main/java/noppes/npcs/controllers/data/PlayerAbilityData.java index 1da16a3af..720d838e6 100644 --- a/src/main/java/noppes/npcs/controllers/data/PlayerAbilityData.java +++ b/src/main/java/noppes/npcs/controllers/data/PlayerAbilityData.java @@ -832,8 +832,6 @@ public class PlayerAbilityData extends AbstractDataAbilities implements IPlayerA currentTarget = null; lastAbilityActivationTime = -1; - // Cooldowns are absolute world-time deadlines and are restored from NBT, so relogging - // must not clear them or it becomes a way to bypass them. interruptCooldownRolled = false; // Reset sync tracking so next sync sends fresh state @@ -1049,7 +1047,6 @@ public class PlayerAbilityData extends AbstractDataAbilities implements IPlayerA } compound.setTag("ActiveToggles", toggleList); - // Cooldowns are absolute world-time deadlines, so they stay meaningful across sessions NBTTagCompound cooldowns = new NBTTagCompound(); cooldowns.setLong("GlobalEnd", cooldownEndTime); cooldowns.setInteger("GlobalDuration", globalCooldownDuration); diff --git a/src/main/java/noppes/npcs/roles/RoleTrader.java b/src/main/java/noppes/npcs/roles/RoleTrader.java index 717754abf..853d33bd2 100644 --- a/src/main/java/noppes/npcs/roles/RoleTrader.java +++ b/src/main/java/noppes/npcs/roles/RoleTrader.java @@ -97,11 +97,6 @@ public class RoleTrader extends RoleInterface { readFromNBT(nbttagcompound, true); } - /** - * @param loadFromMarket pull the linked market's stored data over the compound just read. - * False when the compound is an admin edit, which is authoritative and - * would otherwise be overwritten by the market it is about to be saved to. - */ public void readFromNBT(NBTTagCompound nbttagcompound, boolean loadFromMarket) { String oldMarket = marketName; marketName = nbttagcompound.getString("TraderMarket");