mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 17:39:39 +00:00
Merge branch 'dev' into syntax-highlighter-unified
This commit is contained in:
commit
c0ce53a814
150 files changed
+3376
-1479
No files matched your search
@@ -2,10 +2,10 @@ package noppes.npcs.controllers.data;
|
||||
|
||||
import kamkeel.npcs.controllers.AbilityController;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.controllers.data.ability.AbilityPhase;
|
||||
import kamkeel.npcs.controllers.data.ability.ChainedAbility;
|
||||
import kamkeel.npcs.controllers.data.ability.IAbilityAction;
|
||||
import kamkeel.npcs.controllers.data.ability.ToggleEntry;
|
||||
import kamkeel.npcs.controllers.data.ability.enums.AbilityPhase;
|
||||
import kamkeel.npcs.controllers.data.ability.data.ChainedAbility;
|
||||
import kamkeel.npcs.controllers.data.ability.data.IAbilityAction;
|
||||
import kamkeel.npcs.controllers.data.ability.data.entry.AbilityToggleEntry;
|
||||
import kamkeel.npcs.controllers.data.ability.type.AbilityGuard;
|
||||
import kamkeel.npcs.controllers.data.telegraph.TelegraphInstance;
|
||||
import kamkeel.npcs.network.packets.data.ability.AbilityCooldownSyncPacket;
|
||||
@@ -23,7 +23,6 @@ import net.minecraft.util.DamageSource;
|
||||
import noppes.npcs.AbstractDataAbilities;
|
||||
import noppes.npcs.EventHooks;
|
||||
import noppes.npcs.LogWriter;
|
||||
import noppes.npcs.NoppesUtilPlayer;
|
||||
import noppes.npcs.api.ability.IPlayerAbilityData;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
@@ -807,6 +806,9 @@ public class PlayerAbilityData extends AbstractDataAbilities implements IPlayerA
|
||||
if (currentAbility == null || !currentAbility.isExecuting()) {
|
||||
return amount;
|
||||
}
|
||||
if (currentAbility.isInvulnerableForCurrentPhase()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
net.minecraft.entity.Entity sourceEntity = source.getEntity();
|
||||
EntityLivingBase attacker = sourceEntity instanceof EntityLivingBase ? (EntityLivingBase) sourceEntity : null;
|
||||
@@ -938,6 +940,9 @@ public class PlayerAbilityData extends AbstractDataAbilities implements IPlayerA
|
||||
if (wasFlyingAtLock) {
|
||||
flags |= PlayerAbilityStatePacket.FLAG_WAS_FLYING_AT_LOCK;
|
||||
}
|
||||
if (currentAbility.getPhase() == AbilityPhase.ACTIVE) {
|
||||
flags |= PlayerAbilityStatePacket.FLAG_ACTIVE_PHASE;
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
|
||||
@@ -995,7 +1000,7 @@ public class PlayerAbilityData extends AbstractDataAbilities implements IPlayerA
|
||||
|
||||
// Active toggles (compound format with state)
|
||||
NBTTagList toggleList = new NBTTagList();
|
||||
for (Map.Entry<String, ToggleEntry> entry : activeToggles.entrySet()) {
|
||||
for (Map.Entry<String, AbilityToggleEntry> entry : activeToggles.entrySet()) {
|
||||
NBTTagCompound toggleNbt = new NBTTagCompound();
|
||||
toggleNbt.setString("Key", entry.getKey());
|
||||
toggleNbt.setInteger("State", entry.getValue().getState());
|
||||
|
||||
@@ -2,7 +2,6 @@ package noppes.npcs.controllers.data;
|
||||
|
||||
import kamkeel.npcs.controllers.AbilityController;
|
||||
import kamkeel.npcs.controllers.data.ability.Ability;
|
||||
import kamkeel.npcs.network.PacketHandler;
|
||||
import kamkeel.npcs.network.packets.data.ability.AbilityHotbarSyncPacket;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
|
||||
@@ -10,8 +10,10 @@ public class SkinOverlay implements ISkinOverlay {
|
||||
|
||||
public boolean glow = true;
|
||||
public boolean blend = true;
|
||||
|
||||
public float alpha = 1.0F;
|
||||
public float size = 1.0F;
|
||||
public int color = 0xFFFFFF;
|
||||
|
||||
public float speedX = 0.0F;
|
||||
public float speedY = 0.0F;
|
||||
@@ -78,6 +80,15 @@ public class SkinOverlay implements ISkinOverlay {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setColor(int color) {
|
||||
this.color = Math.max(0, color);
|
||||
this.updateClient();
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setTextureScale(float scaleX, float scaleY) {
|
||||
this.scaleX = scaleX;
|
||||
this.scaleY = scaleY;
|
||||
@@ -131,6 +142,11 @@ public class SkinOverlay implements ISkinOverlay {
|
||||
this.blend = compound.getBoolean("SkinOverlayBlend");
|
||||
this.alpha = compound.getFloat("SkinOverlayAlpha");
|
||||
this.size = compound.getFloat("SkinOverlaySize");
|
||||
if(compound.hasKey("SkinOverlayColor")){
|
||||
this.color = compound.getInteger("SkinOverlayColor");
|
||||
} else {
|
||||
this.color = 0xFFFFFF;
|
||||
}
|
||||
this.speedX = compound.getFloat("SkinOverlaySpeedX");
|
||||
this.speedY = compound.getFloat("SkinOverlaySpeedY");
|
||||
this.scaleX = compound.getFloat("SkinOverlayScaleX");
|
||||
@@ -146,6 +162,7 @@ public class SkinOverlay implements ISkinOverlay {
|
||||
compound.setBoolean("SkinOverlayBlend", this.getBlend());
|
||||
compound.setFloat("SkinOverlayAlpha", this.getAlpha());
|
||||
compound.setFloat("SkinOverlaySize", this.getSize());
|
||||
compound.setInteger("SkinOverlayColor", this.getColor());
|
||||
compound.setFloat("SkinOverlaySpeedX", this.getSpeedX());
|
||||
compound.setFloat("SkinOverlaySpeedY", this.getSpeedY());
|
||||
compound.setFloat("SkinOverlayScaleX", this.getTextureScaleX());
|
||||
|
||||
Reference in new issue
Block a user