From 81c7f8c25c26a789597c3f1d5f378b012442d7c9 Mon Sep 17 00:00:00 2001 From: Sollace Date: Fri, 5 May 2023 23:23:14 +0100 Subject: [PATCH] Adjust charge obtained when using grogar's bell and allow for stealing a charged creeper's charge --- .../com/minelittlepony/unicopia/item/BellItem.java | 13 ++++++++++--- src/main/resources/unicopia.aw | 6 +++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/item/BellItem.java b/src/main/java/com/minelittlepony/unicopia/item/BellItem.java index 01b87bac..809462e1 100644 --- a/src/main/java/com/minelittlepony/unicopia/item/BellItem.java +++ b/src/main/java/com/minelittlepony/unicopia/item/BellItem.java @@ -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; } diff --git a/src/main/resources/unicopia.aw b/src/main/resources/unicopia.aw index d25f58d3..2b7d36d4 100644 --- a/src/main/resources/unicopia.aw +++ b/src/main/resources/unicopia.aw @@ -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; \ No newline at end of file +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; \ No newline at end of file