Adjust charge obtained when using grogar's bell and allow for stealing a charged creeper's charge

This commit is contained in:
Sollace 2023-05-05 23:23:14 +01:00
parent 5a88206bf5
commit 81c7f8c25c
2 changed files with 15 additions and 4 deletions

View file

@ -34,7 +34,6 @@ import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
public class BellItem extends Item implements ChargeableItem {
public BellItem(Settings settings) {
super(settings);
}
@ -149,10 +148,18 @@ public class BellItem extends Item implements ChargeableItem {
if (living.asEntity() instanceof MobEntity mob) {
mob.setTarget(null);
}
amountDrawn = Math.max(living.asEntity().getWidth(), living.asEntity().getHeight()) + living.asEntity().getHealth();
if (living.asEntity() instanceof CreeperEntity creeper) {
creeper.setFuseSpeed(0);
creeper.setFuseSpeed(-1);
if (creeper.getDataTracker().get(CreeperEntity.CHARGED)) {
creeper.getDataTracker().set(CreeperEntity.CHARGED, false);
amountDrawn += 60;
}
creeper.getDataTracker().set(CreeperEntity.IGNITED, false);
}
amountDrawn = Math.max(living.asEntity().getWidth(), living.asEntity().getHeight());
if (living.asEntity() instanceof IllagerEntity) {
particleType = ParticleTypes.ANGRY_VILLAGER;
}

View file

@ -2,6 +2,10 @@ accessWidener v1 named
accessible class net/minecraft/client/render/RenderLayer$MultiPhaseParameters
accessible method net/minecraft/client/render/RenderLayer of (Ljava/lang/String;Lnet/minecraft/client/render/VertexFormat;Lnet/minecraft/client/render/VertexFormat$DrawMode;IZZLnet/minecraft/client/render/RenderLayer$MultiPhaseParameters;)Lnet/minecraft/client/render/RenderLayer$MultiPhase;
accessible class net/minecraft/client/render/item/HeldItemRenderer$HandRenderType
accessible method net/minecraft/world/GameRules register (Ljava/lang/String;Lnet/minecraft/world/GameRules$Category;Lnet/minecraft/world/GameRules$Type;)Lnet/minecraft/world/GameRules$Key;
accessible method net/minecraft/world/GameRules$BooleanRule create (Z)Lnet/minecraft/world/GameRules$Type;
accessible method net/minecraft/world/GameRules$IntRule create (I)Lnet/minecraft/world/GameRules$Type;
accessible field net/minecraft/entity/mob/CreeperEntity CHARGED Lnet/minecraft/entity/data/TrackedData;
accessible field net/minecraft/entity/mob/CreeperEntity IGNITED Lnet/minecraft/entity/data/TrackedData;