Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Rin committed Oct 31, 2024
1 parent 8c78c4d commit e536f47
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/main/java/mizurin/shieldmod/entities/EntityIceBall.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
import mizurin.shieldmod.interfaces.IDazed;
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;

public class EntityIceBall extends EntitySnowball {
public class EntityIceBall extends EntityProjectile {
public EntityIceBall(World world) {
super(world);
this.modelItem = Item.ammoSnowball;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/mizurin/shieldmod/entities/EntityWeb.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public EntityWeb(World world) {

public void init() {
super.init();
this.defaultProjectileSpeed = 0.95F;

}
@Override
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/mizurin/shieldmod/mixins/DazedMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import mizurin.shieldmod.interfaces.IDazed;
import net.minecraft.core.entity.Entity;
import net.minecraft.core.entity.player.EntityPlayer;
import net.minecraft.core.util.helper.DamageType;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand Down Expand Up @@ -32,12 +31,15 @@ public boolean hurt(Entity attacker, int damage, DamageType type) {
@Unique
public int remainingFreezeTicks;


//Mirrors the fire status effect but cannot be put out and slows the entity.
@Inject(method = "baseTick()V", at = @At("HEAD"))
public void inject(CallbackInfo callbackInfo) {
if (this.remainingDazedTicks > 0) {

this.xd *= 0.85D;
this.zd *= 0.85D;

if (this.remainingDazedTicks % 16 == 0) {
this.hurt( null, 1, DamageType.COMBAT);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ protected Entity findPlayerToAttack() {
}

/**
* @author McRin
* @reason Balls
* @author Rin
* @reason SnowBalls
*/
@Overwrite
public void attackEntity(Entity entity, float distance) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void attackEntity(Entity entity, float distance) {
double d2 = entity.y + (double)entity.getHeadHeight() - 0.2 - web.y;
float f1 = MathHelper.sqrt_double(dX * dX + dZ * dZ) * 0.2F;
this.world.playSoundAtEntity((Entity)null, this, "random.bow", 0.5F, 0.4F / (this.random.nextFloat() * 0.4F + 0.8F));
web.setHeading(dX, d2 + (double) f1, dZ, 0.8F, 1.0F);
web.setHeading(dX, d2 + (double) f1, dZ, 1F, 1.0F);
this.world.entityJoinedWorld(web);

}
Expand Down
11 changes: 7 additions & 4 deletions src/main/java/mizurin/shieldmod/mixins/ShieldMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ 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 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 @@ -344,6 +344,9 @@ public void injectHurt(Entity attacker, int damage, DamageType type, CallbackInf
at = @At(value = "HEAD")
)
public void tickMixin(CallbackInfo ci){



ItemStack stack = inventory.mainInventory[inventory.currentItem];
if (stack != null) {
if (stack.getItem() instanceof ShieldItem) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/mizurin/shieldmod/mixins/WorldMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public class WorldMixin {
World thisObject = (World)(Object)this;

/**
* @author
* @reason
* @author Rin
* @reason Leather armor reduce aggro range
*/
@Overwrite
public EntityPlayer getClosestPlayer(double x, double y, double z, double radius) {
Expand Down

0 comments on commit e536f47

Please sign in to comment.