Merge branch 'packet' into animation-events-2

This commit is contained in:
Kam committed 2025-02-12 22:37:52 -05:00
commit 16f2901fbc
119 files changed
+2688 -931

No files matched your search

@@ -12,34 +12,11 @@ public class PlayerEffect implements IPlayerEffect {
public byte level;
public int index;
public PlayerEffect(int id, int duration, byte level) {
public PlayerEffect(int id, int duration, byte level, int index) {
this.id = id;
this.duration = duration;
this.level = level;
}
public static PlayerEffect readEffectData(NBTTagCompound nbt) {
int id = nbt.getInteger("Id");
int index = nbt.getInteger("Index");
if (id > 0) {
CustomEffectController controller = CustomEffectController.getInstance();
boolean found = controller.has(id);
// StatusEffectController.getInstance().customEffects.containsKey(id);
if (found) {
byte level = nbt.getByte("Level");
int dur = nbt.getInteger("Dur");
return new PlayerEffect(id, dur, level);
}
}
return null;
}
public NBTTagCompound writeEffectData(NBTTagCompound nbt) {
nbt.setInteger("Id", this.id);
nbt.setByte("Level", this.level);
nbt.setInteger("Dur", this.duration);
nbt.setInteger("Index", this.index);
return nbt;
this.index = index;
}
@Override
@@ -74,7 +51,7 @@ public class PlayerEffect implements IPlayerEffect {
@Override
public String getName() {
CustomEffect effect = CustomEffectController.getInstance().get(this.id);
CustomEffect effect = CustomEffectController.getInstance().get(this.id, this.index);
if(effect != null)
return effect.getName();
@@ -84,7 +61,7 @@ public class PlayerEffect implements IPlayerEffect {
@Override
public void performEffect(IPlayer player) {
if (player != null && player.getMCEntity() != null && player.getMCEntity() instanceof EntityPlayer) {
CustomEffect effect = CustomEffectController.getInstance().get(this.id);
CustomEffect effect = CustomEffectController.getInstance().get(this.id, this.index);
if(effect != null)
effect.onTick((EntityPlayer) player.getMCEntity(), this);
}
@@ -46,8 +46,7 @@ public class PlayerEffectData {
effect.duration = duration;
effect.level = level;
} else {
effect = new PlayerEffect(id, duration, level);
effect.index = index;
effect = new PlayerEffect(id, duration, level, index);
effects.put(key, effect);
}
}
@@ -30,6 +30,10 @@ public class RecipesDefault {
addRecipe("Mob Cloner", CustomItems.cloner, true, "XX","XY"," Y",'X', Items.bread,'Y', Items.stick);
addRecipe("Carpentry Bench", CustomItems.carpentyBench, true, "XYX","Z Z","Z Z", 'X', Blocks.planks, 'Z', Items.stick, 'Y', Blocks.crafting_table);
ItemStack anvil = new ItemStack(CustomItems.carpentyBench);
anvil.setItemDamage(1);
addRecipe("Anvil", anvil, true, "XXX","Z Z","Z Z", 'X', Blocks.iron_block, 'Z', Items.iron_ingot);
if(!ConfigMain.DisableExtraItems){
addRecipe("Mana", CustomItems.mana, true, "XY",'X',Items.redstone,'Y',Items.glowstone_dust);
addRecipe("Gun Wooden", CustomItems.gunWood, false, "XXXY"," ZM "," M ",'Y', Blocks.lever, 'M', Items.stick, 'Z', Blocks.stone_button,'X', Blocks.planks);
@@ -146,7 +150,7 @@ public class RecipesDefault {
addRecipe("Sign Wood5", new ItemStack(CustomItems.sign, 1, 4), false, "YYY", "XXX", "XXX", 'X', new ItemStack(Blocks.planks,1,4), 'Y', Items.iron_ingot);
addRecipe("Sign Wood6", new ItemStack(CustomItems.sign, 1, 5), false, "YYY", "XXX", "XXX", 'X', new ItemStack(Blocks.planks,1,5), 'Y', Items.iron_ingot);
addRecipe("Lamp", new ItemStack(CustomItems.lamp), false, "XXX","YZY","XXX", 'X', Items.iron_ingot, 'Y', Blocks.glass, 'Z', Blocks.torch);
addRecipe("Lamp", new ItemStack(CustomItems.lantern), false, "XXX","YZY","XXX", 'X', Items.iron_ingot, 'Y', Blocks.glass, 'Z', Blocks.torch);
addRecipe("Candle", new ItemStack(CustomItems.candle), false, "XZX"," X ", 'X', Items.iron_ingot, 'Z', Blocks.torch);
addRecipe("BigSign", new ItemStack(CustomItems.bigsign, 2), false, "XXX","XXX","XXX", 'X', Blocks.planks);