From 0ddd95e95604fad165a3f58db9de4307bc0e6de8 Mon Sep 17 00:00:00 2001 From: Rin Date: Fri, 1 Nov 2024 19:59:55 -0500 Subject: [PATCH] 1.1.2 --- gradle.properties | 2 +- .../java/mizurin/shieldmod/ShieldMod.java | 1 + .../shieldmod/entities/EntityIceBall.java | 1 - .../mizurin/shieldmod/mixins/DazedMixin.java | 2 +- .../mizurin/shieldmod/mixins/ShieldMixin.java | 24 ++++++++----------- .../mixins/WorldFeatureLabyrinthMixin.java | 19 +++++++++------ 6 files changed, 25 insertions(+), 24 deletions(-) diff --git a/gradle.properties b/gradle.properties index dd0ebc3..ed5675c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,6 +11,6 @@ halplibe_version=4.1.3 terrain_api_version=1.4.4-7.2-pre1 # Mod -mod_version=1.1.1 +mod_version=1.1.2 mod_group=Mizuri-n mod_name=Rin's Fortress diff --git a/src/main/java/mizurin/shieldmod/ShieldMod.java b/src/main/java/mizurin/shieldmod/ShieldMod.java index a44e765..cf9bfad 100644 --- a/src/main/java/mizurin/shieldmod/ShieldMod.java +++ b/src/main/java/mizurin/shieldmod/ShieldMod.java @@ -61,6 +61,7 @@ public void beforeGameStart() { EntityHelper.createEntity(EntityRock.class, ++entityID, "pebbleShield", () -> new SnowballRenderer(Item.ammoPebble)); EntityHelper.createEntity(EntityFire.class, ++entityID, "entityFire", () -> new SnowballRenderer(Block.fire.asItem())); EntityHelper.createEntity(EntityWeb.class, ++entityID, "entityWeb", () -> new SnowballRenderer(Block.cobweb.asItem())); + EntityHelper.createEntity(EntityIceBall.class, ++entityID, "ammoSnow", () -> new SnowballRenderer(Item.ammoSnowball)); NetEntityHandler.registerNetworkEntry(new NetShieldEntry(), 8000); NetEntityHandler.registerNetworkEntry(new NetPotionEntry(), 8001); diff --git a/src/main/java/mizurin/shieldmod/entities/EntityIceBall.java b/src/main/java/mizurin/shieldmod/entities/EntityIceBall.java index 5bffc14..68349f6 100644 --- a/src/main/java/mizurin/shieldmod/entities/EntityIceBall.java +++ b/src/main/java/mizurin/shieldmod/entities/EntityIceBall.java @@ -4,7 +4,6 @@ import net.minecraft.core.HitResult; import net.minecraft.core.entity.EntityLiving; import net.minecraft.core.entity.projectile.EntityProjectile; -import net.minecraft.core.entity.projectile.EntitySnowball; import net.minecraft.core.item.Item; import net.minecraft.core.util.helper.DamageType; import net.minecraft.core.world.World; diff --git a/src/main/java/mizurin/shieldmod/mixins/DazedMixin.java b/src/main/java/mizurin/shieldmod/mixins/DazedMixin.java index 99223ee..6893868 100644 --- a/src/main/java/mizurin/shieldmod/mixins/DazedMixin.java +++ b/src/main/java/mizurin/shieldmod/mixins/DazedMixin.java @@ -33,7 +33,7 @@ public boolean hurt(Entity attacker, int damage, DamageType type) { return false; } - @Inject(method = "init()V", at = @At("TAIL")) + @Inject(method = "", at = @At("TAIL")) public void defineSyncStatus(CallbackInfo ci){ entityData.define(DATA_DAZE, 0); entityData.define(DATA_FREEZE, 0); diff --git a/src/main/java/mizurin/shieldmod/mixins/ShieldMixin.java b/src/main/java/mizurin/shieldmod/mixins/ShieldMixin.java index 752483f..0f856a5 100644 --- a/src/main/java/mizurin/shieldmod/mixins/ShieldMixin.java +++ b/src/main/java/mizurin/shieldmod/mixins/ShieldMixin.java @@ -147,10 +147,6 @@ public void parryHitbox(World world, EntityPlayer player) { } } -// if (entity instanceof EntityFireball) { -// entity.hurt(player, 1, DamageType.COMBAT); -// world.playSoundAtEntity(player, player, "mob.ghast.fireball", 0.66f, 1.0f); -// } if (entity instanceof EntityCannonball) { @@ -231,16 +227,16 @@ public void parryHitbox(World world, EntityPlayer player) { @Inject(method = "hurt", at = @At("HEAD"), cancellable = true) public void injectHurt(Entity attacker, int damage, DamageType type, CallbackInfoReturnable ci) { if (attacker instanceof EntityMonster || attacker instanceof EntityArrow) { - if (this.world.difficultySetting == 0) { - damage = 0; - } - - if (this.world.difficultySetting == 1) { - damage = damage / 3 + 1; - } - - if (this.world.difficultySetting == 3) { - damage = damage * 3 / 2; + switch(this.world.difficultySetting){ + case 0: + damage = 0; + break; + case 1: + damage = damage / 3 + 1; + break; + case 3: + damage = damage * 3 / 2; + break; } } // check if we are holding the shield item. diff --git a/src/main/java/mizurin/shieldmod/mixins/WorldFeatureLabyrinthMixin.java b/src/main/java/mizurin/shieldmod/mixins/WorldFeatureLabyrinthMixin.java index f848477..0f0c90a 100644 --- a/src/main/java/mizurin/shieldmod/mixins/WorldFeatureLabyrinthMixin.java +++ b/src/main/java/mizurin/shieldmod/mixins/WorldFeatureLabyrinthMixin.java @@ -25,14 +25,19 @@ public class WorldFeatureLabyrinthMixin { @Inject(method = "pickCheckLootItem(Ljava/util/Random;)Lnet/minecraft/core/item/ItemStack;", at = @At(value = "FIELD", target = "Lnet/minecraft/core/world/generate/feature/WorldFeatureLabyrinth;treasureGenerated:Z", ordinal = 1, shift = At.Shift.AFTER), cancellable = true) private void addTreasure(Random random, CallbackInfoReturnable cir) { - if (isCold && random.nextInt(2) == 0) { - cir.setReturnValue(new ItemStack(Shields.tearShield)); + if (isCold) { + if(random.nextInt(2) == 0) { + cir.setReturnValue(new ItemStack(Shields.tearShield)); + } } - if(isHot && random.nextInt(2)== 0){ - cir.setReturnValue(new ItemStack(Shields.rockyHelmet)); - } - if(!isHot && !isCold && random.nextInt(2)== 0){ - cir.setReturnValue(new ItemStack(Shields.regenAmulet)); + else if(isHot){ + if (random.nextInt(2)== 0) { + cir.setReturnValue(new ItemStack(Shields.rockyHelmet)); + } + } else { + if (random.nextInt(2) == 0) { + cir.setReturnValue(new ItemStack(Shields.regenAmulet)); + } } } @Inject(method = "generate(Lnet/minecraft/core/world/World;Ljava/util/Random;III)Z", at = @At(value = "FIELD", target = "net/minecraft/core/world/generate/feature/WorldFeatureLabyrinth.slabBlock : I", ordinal = 0))