Skip to content

Commit

Permalink
1.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Rin committed Nov 2, 2024
1 parent f688995 commit 0ddd95e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 24 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions src/main/java/mizurin/shieldmod/ShieldMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mizurin/shieldmod/mixins/DazedMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public boolean hurt(Entity attacker, int damage, DamageType type) {
return false;
}

@Inject(method = "init()V", at = @At("TAIL"))
@Inject(method = "<init>", at = @At("TAIL"))
public void defineSyncStatus(CallbackInfo ci){
entityData.define(DATA_DAZE, 0);
entityData.define(DATA_FREEZE, 0);
Expand Down
24 changes: 10 additions & 14 deletions src/main/java/mizurin/shieldmod/mixins/ShieldMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down Expand Up @@ -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<Boolean> 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ItemStack> 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))
Expand Down

0 comments on commit 0ddd95e

Please sign in to comment.