From c7569d2c46eacba27b2f2772f6092612ae948189 Mon Sep 17 00:00:00 2001 From: cheaterpaul Date: Thu, 5 Oct 2023 18:21:31 +0200 Subject: [PATCH 01/17] add player arguments to commands --- .../command/test/GarlicCheckCommand.java | 7 ++-- .../vampirism/command/test/MinionCommand.java | 39 +++++++++++-------- .../assets/vampirism/lang/en_us.json | 2 +- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/main/java/de/teamlapen/vampirism/command/test/GarlicCheckCommand.java b/src/main/java/de/teamlapen/vampirism/command/test/GarlicCheckCommand.java index 43a4ce7e34..f64fceea55 100644 --- a/src/main/java/de/teamlapen/vampirism/command/test/GarlicCheckCommand.java +++ b/src/main/java/de/teamlapen/vampirism/command/test/GarlicCheckCommand.java @@ -1,5 +1,6 @@ package de.teamlapen.vampirism.command.test; +import com.mojang.brigadier.arguments.BoolArgumentType; import com.mojang.brigadier.builder.ArgumentBuilder; import de.teamlapen.lib.lib.util.BasicCommand; import de.teamlapen.vampirism.api.EnumStrength; @@ -19,14 +20,14 @@ public class GarlicCheckCommand extends BasicCommand { return Commands.literal("garlicCheck") .requires(context -> context.hasPermission(PERMISSION_LEVEL_CHEAT)) .executes(context -> garlicCheck(context.getSource(), context.getSource().getPlayerOrException(), false)) - .then(Commands.literal("print")) - .executes(context -> garlicCheck(context.getSource(), context.getSource().getPlayerOrException(), true)); + .then(Commands.argument("print", BoolArgumentType.bool()) + .executes(context -> garlicCheck(context.getSource(), context.getSource().getPlayerOrException(), BoolArgumentType.getBool(context, "print")))); } @SuppressWarnings("SameReturnValue") private static int garlicCheck(@NotNull CommandSourceStack commandSource, @NotNull ServerPlayer asPlayer, boolean print) { if (commandSource.getEntity() != null && commandSource.getEntity() instanceof Player) { - commandSource.sendSuccess(() -> Component.translatable("command.vampirism.test.garliccheck.strength" + VampirismAPI.getVampirismWorld(asPlayer.getCommandSenderWorld()).map(w -> w.getStrengthAtChunk(new ChunkPos(asPlayer.blockPosition()))).orElse(EnumStrength.NONE)), true); + commandSource.sendSuccess(() -> Component.translatable("command.vampirism.test.garliccheck.strength", VampirismAPI.getVampirismWorld(asPlayer.getCommandSenderWorld()).map(w -> w.getStrengthAtChunk(new ChunkPos(asPlayer.blockPosition()))).orElse(EnumStrength.NONE)), true); } if (print) { VampirismWorld.getOpt(asPlayer.getCommandSenderWorld()).ifPresent(vw -> vw.printDebug(commandSource)); diff --git a/src/main/java/de/teamlapen/vampirism/command/test/MinionCommand.java b/src/main/java/de/teamlapen/vampirism/command/test/MinionCommand.java index 7b0ab450f1..c1dbde29e9 100644 --- a/src/main/java/de/teamlapen/vampirism/command/test/MinionCommand.java +++ b/src/main/java/de/teamlapen/vampirism/command/test/MinionCommand.java @@ -26,7 +26,9 @@ import de.teamlapen.vampirism.world.MinionWorldData; import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; +import net.minecraft.commands.arguments.EntityArgument; import net.minecraft.network.chat.Component; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.player.Player; import org.jetbrains.annotations.NotNull; @@ -54,10 +56,18 @@ public class MinionCommand extends BasicCommand { ) ) ) - .then(Commands.literal("recall").executes(context -> recall(context.getSource()))) - .then(Commands.literal("respawnAll").executes(context -> respawn(context.getSource()))) - .then(Commands.literal("purge").executes(context -> purge(context.getSource()))) - .executes(context -> 0); + .then(Commands.literal("recall") + .executes(context -> recall(context.getSource(), context.getSource().getPlayerOrException())) + .then(Commands.argument("target", EntityArgument.player()) + .executes(context -> recall(context.getSource(), EntityArgument.getPlayer(context, "target"))))) + .then(Commands.literal("respawnAll") + .executes(context -> respawn(context.getSource(), context.getSource().getPlayerOrException())) + .then(Commands.argument("target", EntityArgument.player()) + .executes(context -> respawn(context.getSource(), EntityArgument.getPlayer(context, "target"))))) + .then(Commands.literal("purge") + .executes(context -> purge(context.getSource(), context.getSource().getPlayerOrException())) + .then(Commands.argument("target", EntityArgument.player()) + .executes(context -> purge(context.getSource(), EntityArgument.getPlayer(context, "target"))))); } @@ -104,14 +114,13 @@ private static int spawnNewMinion(@NotNull CommandSourceS } @SuppressWarnings("SameReturnValue") - private static int recall(@NotNull CommandSourceStack ctx) throws CommandSyntaxException { - Player p = ctx.getPlayerOrException(); - FactionPlayerHandler fph = FactionPlayerHandler.get(p); + private static int recall(@NotNull CommandSourceStack ctx, ServerPlayer player) throws CommandSyntaxException { + FactionPlayerHandler fph = FactionPlayerHandler.get(player); if (fph.getMaxMinions() > 0) { PlayerMinionController controller = MinionWorldData.getData(ctx.getServer()).getOrCreateController(fph); Collection ids = controller.recallMinions(true); for (Integer id : ids) { - controller.createMinionEntityAtPlayer(id, p); + controller.createMinionEntityAtPlayer(id, player); } } else { throw fail.create("Can't have minions"); @@ -122,14 +131,13 @@ private static int recall(@NotNull CommandSourceStack ctx) throws CommandSyntaxE @SuppressWarnings("SameReturnValue") - private static int respawn(@NotNull CommandSourceStack ctx) throws CommandSyntaxException { - Player p = ctx.getPlayerOrException(); - FactionPlayerHandler fph = FactionPlayerHandler.get(p); + private static int respawn(@NotNull CommandSourceStack ctx, ServerPlayer player) throws CommandSyntaxException { + FactionPlayerHandler fph = FactionPlayerHandler.get(player); if (fph.getMaxMinions() > 0) { PlayerMinionController controller = MinionWorldData.getData(ctx.getServer()).getOrCreateController(fph); Collection ids = controller.getUnclaimedMinions(); for (Integer id : ids) { - controller.createMinionEntityAtPlayer(id, p); + controller.createMinionEntityAtPlayer(id, player); } } else { @@ -140,10 +148,9 @@ private static int respawn(@NotNull CommandSourceStack ctx) throws CommandSyntax } @SuppressWarnings("SameReturnValue") - private static int purge(@NotNull CommandSourceStack ctx) throws CommandSyntaxException { - Player p = ctx.getPlayerOrException(); - MinionWorldData.getData(ctx.getServer()).purgeController(p.getUUID()); - p.displayClientMessage(Component.literal("Reload world"), false); + private static int purge(@NotNull CommandSourceStack ctx, ServerPlayer player) throws CommandSyntaxException { + MinionWorldData.getData(ctx.getServer()).purgeController(player.getUUID()); + ((Player) player).displayClientMessage(Component.literal("Reload world"), false); return 0; } } diff --git a/src/main/resources/assets/vampirism/lang/en_us.json b/src/main/resources/assets/vampirism/lang/en_us.json index 1a3bb7157e..c9fc73e352 100644 --- a/src/main/resources/assets/vampirism/lang/en_us.json +++ b/src/main/resources/assets/vampirism/lang/en_us.json @@ -960,7 +960,7 @@ "command.vampirism.test.garlicprofiler.tick": "Tick", "command.vampirism.test.garlicprofiler.garlic": "Garlic", "command.vampirism.test.garlicprofiler.print": "%s: %s|%s", - "command.vampirism.test.garliccheck.strength": "garlic strength: %s", + "command.vampirism.test.garliccheck.strength": "Garlic Strength: %s", "command.vampirism.test.entity.notbiteable": "Not biteable %s", "command.vampirism.test.village.no_village": "No village nearby", "command.vampirism.test.village.success": "Successfully converted village to faction %s", From 8c38bb2b4a39419fa93a8a8ffb56dce7ddb71b71 Mon Sep 17 00:00:00 2001 From: cheaterpaul Date: Wed, 11 Oct 2023 21:09:25 +0200 Subject: [PATCH 02/17] disable holy water damage when pvp is turned off close #1263 --- .../teamlapen/vampirism/items/HolyWaterSplashBottleItem.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/teamlapen/vampirism/items/HolyWaterSplashBottleItem.java b/src/main/java/de/teamlapen/vampirism/items/HolyWaterSplashBottleItem.java index 52221416ed..b9a78ea391 100644 --- a/src/main/java/de/teamlapen/vampirism/items/HolyWaterSplashBottleItem.java +++ b/src/main/java/de/teamlapen/vampirism/items/HolyWaterSplashBottleItem.java @@ -1,7 +1,6 @@ package de.teamlapen.vampirism.items; import de.teamlapen.lib.lib.util.UtilLib; -import de.teamlapen.vampirism.VampirismMod; import de.teamlapen.vampirism.api.blocks.HolyWaterEffectConsumer; import de.teamlapen.vampirism.entity.ThrowableItemEntity; import de.teamlapen.vampirism.util.DamageHandler; @@ -53,7 +52,9 @@ protected void impactEntities(@NotNull ThrowableItemEntity bottleEntity, ItemSta if (!list1.isEmpty()) { for (LivingEntity entity : list1) { - DamageHandler.affectEntityHolyWaterSplash(entity, getStrength(getVampirismTier()), bottleEntity.distanceToSqr(entity), result.getType() == HitResult.Type.ENTITY, thrower instanceof LivingEntity ? (LivingEntity) thrower : null); + if (thrower instanceof Player source && entity instanceof Player target && source.canHarmPlayer(target)) { + DamageHandler.affectEntityHolyWaterSplash(entity, getStrength(getVampirismTier()), bottleEntity.distanceToSqr(entity), result.getType() == HitResult.Type.ENTITY, thrower instanceof LivingEntity ? (LivingEntity) thrower : null); + } } } } From 05cb55d92d0284d5c00ff344fb41392de4b83611 Mon Sep 17 00:00:00 2001 From: cheaterpaul Date: Sat, 14 Oct 2023 00:49:24 +0200 Subject: [PATCH 03/17] fix settings provider fallback --- .../de/teamlapen/vampirism/misc/SettingsProvider.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/java/de/teamlapen/vampirism/misc/SettingsProvider.java b/src/main/java/de/teamlapen/vampirism/misc/SettingsProvider.java index 1270b803f5..531e0de531 100644 --- a/src/main/java/de/teamlapen/vampirism/misc/SettingsProvider.java +++ b/src/main/java/de/teamlapen/vampirism/misc/SettingsProvider.java @@ -6,9 +6,7 @@ import com.google.gson.reflect.TypeToken; import com.google.gson.stream.JsonReader; import de.teamlapen.lib.lib.util.ResourceLocationTypeAdapter; -import de.teamlapen.vampirism.REFERENCE; import de.teamlapen.vampirism.VampirismMod; -import de.teamlapen.vampirism.api.VReference; import de.teamlapen.vampirism.api.settings.ISettingsProvider; import de.teamlapen.vampirism.api.settings.Supporter; import net.minecraft.resources.ResourceLocation; @@ -24,13 +22,9 @@ import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; -import java.nio.ByteBuffer; import java.util.*; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.Flow; import java.util.stream.Collectors; -import java.util.stream.Stream; public class SettingsProvider implements ISettingsProvider { @@ -103,7 +97,7 @@ private Optional> checkSettings(Map settings if (error != null) { LOGGER.error("Failed to retrieve settings from server", error); } - if (false) { + if (VampirismMod.inDev || settings != null) { InputStream inputStream = VampirismMod.class.getResourceAsStream("/default_remote_config.json"); if (inputStream != null) { try { @@ -120,7 +114,7 @@ private Optional> checkSupporter(Collection fil if (error != null) { LOGGER.error("Failed to retrieve supporter from server", error); } - if (false) { + if (VampirismMod.inDev || file != null) { InputStream inputStream = VampirismMod.class.getResourceAsStream("/supporters.json"); if (inputStream != null) { try { From 3077964914279ce367d0b92d80e2adbfe3378ede Mon Sep 17 00:00:00 2001 From: cheaterpaul Date: Sat, 14 Oct 2023 00:50:19 +0200 Subject: [PATCH 04/17] update supporter - add supermike - update minecraft usernames - update name for paul --- src/main/resources/supporters.json | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/resources/supporters.json b/src/main/resources/supporters.json index 134385fdd2..5de73ccb23 100755 --- a/src/main/resources/supporters.json +++ b/src/main/resources/supporters.json @@ -39,7 +39,7 @@ }, { "name": "Cultist Courn", - "texture": "cournualllama2", + "texture": "CournBread", "type": 15, "status": 2 }, @@ -62,6 +62,12 @@ "type": 15, "status": 2, "bookId": "volqonah" + }, + { + "name": "Merciless Mike", + "texture": "supermike1999", + "type": 13, + "status": 1 } ], "hunters": [ @@ -72,7 +78,7 @@ "status": 0 }, { - "name": "Paul the Hunter", + "name": "Perilous Paul", "texture": "cheaterpaul", "type": 1, "status": 0 @@ -92,7 +98,7 @@ }, { "name": "Marcus Walker", - "texture": "RebelT", + "texture": "TheR3belT", "type": 2, "status": 1 }, From 4d7ddcaa9473a5d29fc75a38fc66819af908bba1 Mon Sep 17 00:00:00 2001 From: maxanier Date: Mon, 28 Aug 2023 22:44:31 +0200 Subject: [PATCH 05/17] Fix #1255 --- .../de/teamlapen/vampirism/entity/hunter/BasicHunterEntity.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/de/teamlapen/vampirism/entity/hunter/BasicHunterEntity.java b/src/main/java/de/teamlapen/vampirism/entity/hunter/BasicHunterEntity.java index dcf83006b9..ad45e5b290 100644 --- a/src/main/java/de/teamlapen/vampirism/entity/hunter/BasicHunterEntity.java +++ b/src/main/java/de/teamlapen/vampirism/entity/hunter/BasicHunterEntity.java @@ -255,6 +255,8 @@ public SpawnGroupData finalizeSpawn(@NotNull ServerLevelAccessor worldIn, @NotNu if (!(reason == MobSpawnType.SPAWN_EGG || reason == MobSpawnType.BUCKET || reason == MobSpawnType.CONVERSION || reason == MobSpawnType.COMMAND) && this.getRandom().nextInt(50) == 0) { this.setItemSlot(EquipmentSlot.HEAD, HunterVillage.createBanner()); } + getEntityData().set(TYPE, this.getRandom().nextInt(TYPES)); + SpawnGroupData livingData = super.finalizeSpawn(worldIn, difficultyIn, reason, spawnDataIn, dataTag); if (this.getRandom().nextInt(4) == 0) { From 30c88dd7c6bb425401202bdc892beb28219597f9 Mon Sep 17 00:00:00 2001 From: maxanier Date: Sat, 14 Oct 2023 23:18:10 +0200 Subject: [PATCH 06/17] Fix 8c38bb2b4a39419fa93a8a8ffb56dce7ddb71b71 --- .../teamlapen/vampirism/items/HolyWaterSplashBottleItem.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/teamlapen/vampirism/items/HolyWaterSplashBottleItem.java b/src/main/java/de/teamlapen/vampirism/items/HolyWaterSplashBottleItem.java index b9a78ea391..dbe866961e 100644 --- a/src/main/java/de/teamlapen/vampirism/items/HolyWaterSplashBottleItem.java +++ b/src/main/java/de/teamlapen/vampirism/items/HolyWaterSplashBottleItem.java @@ -52,9 +52,10 @@ protected void impactEntities(@NotNull ThrowableItemEntity bottleEntity, ItemSta if (!list1.isEmpty()) { for (LivingEntity entity : list1) { - if (thrower instanceof Player source && entity instanceof Player target && source.canHarmPlayer(target)) { - DamageHandler.affectEntityHolyWaterSplash(entity, getStrength(getVampirismTier()), bottleEntity.distanceToSqr(entity), result.getType() == HitResult.Type.ENTITY, thrower instanceof LivingEntity ? (LivingEntity) thrower : null); + if (thrower instanceof Player source && entity instanceof Player target && !source.canHarmPlayer(target)) { + continue; } + DamageHandler.affectEntityHolyWaterSplash(entity, getStrength(getVampirismTier()), bottleEntity.distanceToSqr(entity), result.getType() == HitResult.Type.ENTITY, thrower instanceof LivingEntity ? (LivingEntity) thrower : null); } } } From 9a484bb3cd53273a5c0cd97f4d39930a5daab42c Mon Sep 17 00:00:00 2001 From: maxanier Date: Sat, 14 Oct 2023 14:33:07 +0200 Subject: [PATCH 07/17] Minions should not attack team players or players at all if PVP is disabled Close #1268 --- .../teamlapen/vampirism/entity/minion/MinionEntity.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/teamlapen/vampirism/entity/minion/MinionEntity.java b/src/main/java/de/teamlapen/vampirism/entity/minion/MinionEntity.java index aeaa6ee580..7126ab8c0d 100644 --- a/src/main/java/de/teamlapen/vampirism/entity/minion/MinionEntity.java +++ b/src/main/java/de/teamlapen/vampirism/entity/minion/MinionEntity.java @@ -21,6 +21,7 @@ import de.teamlapen.vampirism.inventory.MinionContainer; import de.teamlapen.vampirism.util.DamageHandler; import de.teamlapen.vampirism.util.IPlayerOverlay; +import de.teamlapen.vampirism.util.Permissions; import de.teamlapen.vampirism.util.PlayerSkinHelper; import de.teamlapen.vampirism.world.MinionWorldData; import net.minecraft.core.NonNullList; @@ -118,7 +119,8 @@ protected MinionEntity(EntityType type, Level world, this.hardAttackPredicate = livingEntity -> { boolean flag1 = getLordOpt().map(ILordPlayer::getPlayer).filter(entity -> entity == livingEntity).isPresent(); //Don't attack lord boolean flag2 = livingEntity instanceof MinionEntity && ((MinionEntity) livingEntity).getLordID().filter(id -> getLordID().map(id2 -> id == id2).orElse(false)).isPresent(); //Don't attack other minions of lord - return !flag1 && !flag2; + boolean flag3 = livingEntity instanceof Player otherPlayer && getLordOpt().map(ILordPlayer::getPlayer).map(player -> !player.canHarmPlayer(otherPlayer)).orElse(!Permissions.isPvpEnabled(otherPlayer)); + return !flag1 && !flag2 && !flag3; }; setDontDropEquipment(); this.peaceful = true; @@ -184,7 +186,7 @@ public void die(@NotNull DamageSource cause) { /** * Copy of {@link net.minecraft.world.entity.Mob} but with modified DamageSource * Check if code still up-to-date - * TODO 1.20 + * TODO 1.21 */ @Override public boolean doHurtTarget(@NotNull Entity entityIn) { @@ -211,6 +213,8 @@ public boolean doHurtTarget(@NotNull Entity entityIn) { if (entityIn instanceof Player player) { this.maybeDisableShield(player, this.getMainHandItem(), player.isUsingItem() ? player.getUseItem() : ItemStack.EMPTY); } + + //Usually only players call the hurt enemy method on the itemstack if (!this.level().isClientSide && !itemstack.isEmpty() && entityIn instanceof LivingEntity) { itemstack.getItem().hurtEnemy(itemstack, (LivingEntity) entityIn, this); if (itemstack.isEmpty()) { From 8f46f130a216cce53e8d52aed4dc55f543c9ed2c Mon Sep 17 00:00:00 2001 From: maxanier Date: Mon, 28 Aug 2023 22:23:25 +0200 Subject: [PATCH 08/17] Fix #1254 --- .../entity/player/vampire/actions/BatVampireAction.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/de/teamlapen/vampirism/entity/player/vampire/actions/BatVampireAction.java b/src/main/java/de/teamlapen/vampirism/entity/player/vampire/actions/BatVampireAction.java index 9fd407e140..202ae73289 100644 --- a/src/main/java/de/teamlapen/vampirism/entity/player/vampire/actions/BatVampireAction.java +++ b/src/main/java/de/teamlapen/vampirism/entity/player/vampire/actions/BatVampireAction.java @@ -20,7 +20,6 @@ import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; import org.jetbrains.annotations.NotNull; import java.util.UUID; @@ -59,7 +58,6 @@ public boolean canBeUsedBy(@NotNull IVampirePlayer vampire) { && vampire.isGettingGarlicDamage(vampire.getRepresentingEntity().level()) == EnumStrength.NONE && !vampire.getActionHandler().isActionActive(VampireActions.VAMPIRE_RAGE.get()) && !vampire.getRepresentingPlayer().isInWater() - && !(vampire.getRepresentingPlayer().getCommandSenderWorld().dimension() == Level.END) && !VampirismConfig.SERVER.batDimensionBlacklist.get().contains(vampire.getRepresentingPlayer().getCommandSenderWorld().dimension().location().toString()) && (vampire.getRepresentingEntity().getVehicle() == null); } @@ -116,7 +114,7 @@ public boolean onUpdate(@NotNull IVampirePlayer vampire) { } else if (vampire.isGettingGarlicDamage(vampire.getRepresentingEntity().level()) != EnumStrength.NONE && !vampire.isRemote()) { vampire.getRepresentingEntity().sendSystemMessage(Component.translatable("text.vampirism.cant_fly_garlic")); return true; - } else if (VampirismConfig.SERVER.batDimensionBlacklist.get().contains(vampire.getRepresentingPlayer().getCommandSenderWorld().dimension().location().toString()) && vampire.getRepresentingPlayer().getCommandSenderWorld().dimension() == Level.END) { + } else if (VampirismConfig.SERVER.batDimensionBlacklist.get().contains(vampire.getRepresentingPlayer().getCommandSenderWorld().dimension().location().toString())) { vampire.getRepresentingPlayer().sendSystemMessage(Component.translatable("text.vampirism.cant_fly_dimension")); return true; } else { From 60bcd8a9b20efa2383eef57a3a128ccbc9c9b7a9 Mon Sep 17 00:00:00 2001 From: maxanier Date: Sun, 15 Oct 2023 13:30:56 +0200 Subject: [PATCH 09/17] Ensure golem adheres to the village faction (even after chunk load) --- .../GolemTargetNonVillageFactionGoal.java | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/teamlapen/vampirism/entity/ai/goals/GolemTargetNonVillageFactionGoal.java b/src/main/java/de/teamlapen/vampirism/entity/ai/goals/GolemTargetNonVillageFactionGoal.java index f145eb31e8..53246d5d0b 100644 --- a/src/main/java/de/teamlapen/vampirism/entity/ai/goals/GolemTargetNonVillageFactionGoal.java +++ b/src/main/java/de/teamlapen/vampirism/entity/ai/goals/GolemTargetNonVillageFactionGoal.java @@ -30,9 +30,35 @@ public GolemTargetNonVillageFactionGoal(@NotNull IronGolem creature) { this.golem = creature; } + @Override + public boolean canContinueToUse() { + if (golem.tickCount % 16 == 0) { + if (determineGolemFaction()) { + return false; + } + } + return super.canContinueToUse(); + } + @SuppressWarnings({"unchecked", "rawtypes"}) @Override public boolean canUse() { + if (golem.tickCount < 20) return false; // Some delay to allow nearby totems to load + return super.canUse(); + } + + @Override + protected void findTarget() { + determineGolemFaction(); + super.findTarget(); + } + + /** + * Determine the faction of the golem by checking for nearby totems. Update the targetConditions accordingly + * + * @return Whether the faction has changed + */ + private boolean determineGolemFaction() { IFaction faction = VReference.HUNTER_FACTION; if (VampirismConfig.BALANCE.golemAttackNonVillageFaction.get()) { Optional tile = TotemHelper.getTotemNearPos(((ServerLevel) this.golem.level()), this.golem.blockPosition(), true); @@ -41,8 +67,8 @@ public boolean canUse() { if (faction != this.faction) { this.targetConditions.selector(predicates.computeIfAbsent(this.faction = faction, faction1 -> VampirismAPI.factionRegistry().getPredicate(faction1, true, true, false, false, null))); + return true; } - - return super.canUse(); + return false; } } \ No newline at end of file From 10b866f2fa68797b4a1f2eb569b9add34cf92656 Mon Sep 17 00:00:00 2001 From: maxanier Date: Sun, 15 Oct 2023 14:13:04 +0200 Subject: [PATCH 10/17] Render used crucifix correctly regardless of used hand --- .../teamlapen/vampirism/client/renderer/RenderHandler.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/teamlapen/vampirism/client/renderer/RenderHandler.java b/src/main/java/de/teamlapen/vampirism/client/renderer/RenderHandler.java index 9ee2b150d3..5d1bfb6f8d 100644 --- a/src/main/java/de/teamlapen/vampirism/client/renderer/RenderHandler.java +++ b/src/main/java/de/teamlapen/vampirism/client/renderer/RenderHandler.java @@ -244,9 +244,10 @@ public void onRenderLivingPre(RenderLivingEvent.@NotNull Pre 0) { - if (player.getMainHandItem().getItem() instanceof CrucifixItem) { - int i = player.getMainArm() == HumanoidArm.RIGHT ? 1 : -1; + if (player != null && player.isUsingItem() && player.getUseItemRemainingTicks() > 0 && event.getHand() == player.getUsedItemHand()) { + if (event.getItemStack().getItem() instanceof CrucifixItem) { + HumanoidArm humanoidarm = event.getHand() == InteractionHand.MAIN_HAND ? player.getMainArm() : player.getMainArm().getOpposite(); + int i = humanoidarm == HumanoidArm.RIGHT ? 1 : -1; event.getPoseStack().translate(((float) -i * 0.56F), -0.0, -0.2F); } } From 5139cf6e6950f2449090ecb2c658009458e7a468 Mon Sep 17 00:00:00 2001 From: maxanier Date: Sun, 15 Oct 2023 14:36:17 +0200 Subject: [PATCH 11/17] Cleanup. Update Forge and GuideAPI to recommended --- README.md | 3 ++- gradle.properties | 4 ++-- .../entity/ai/goals/GolemTargetNonVillageFactionGoal.java | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b253b8c236..aa2079b0f2 100755 --- a/README.md +++ b/README.md @@ -29,8 +29,9 @@ The following labeling scheme is used: - *discussion*: Looking for feedback - *enhancement*: Any minor tweak that can be introduced in minor releases - *feature*: Any change that takes more time to implement and test +- *accepted*: Any feature/enhancement that is planned to be implemented eventually - *1.12-1.***: Affecting only a specific MC version -- *v1.8-v1.**: Bug affecting or enhancement targeting a specific Vamprism release branch +- *v1.8-v1.**: Bug affecting or enhancement targeting a specific Vampirism release branch - *latest*: Bug affecting or enhancement targeting the latest (potentially unreleased) Vampirism branch diff --git a/gradle.properties b/gradle.properties index 68e8fe379e..5f81385d33 100755 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx3G # forge minecraft_version=1.20.1 minecraft_version_range=[1.20.1,1.21) -forge_version=47.1.0 +forge_version=47.2.0 forge_version_range=[47,) loader_version_range=[47,) mappings_channel=parchment @@ -38,5 +38,5 @@ include_terrablender=true #Dependencies/Optional Libraries jei_mc_version=1.20.1 jei_version=15.0.0.12 -guideapi_version=1.20.1-2.2.6-alpha+20230617-1850 +guideapi_version=1.20.1-2.2.6 terrablender_version=1.20.1-3.0.0.164 diff --git a/src/main/java/de/teamlapen/vampirism/entity/ai/goals/GolemTargetNonVillageFactionGoal.java b/src/main/java/de/teamlapen/vampirism/entity/ai/goals/GolemTargetNonVillageFactionGoal.java index 53246d5d0b..a016888fc7 100644 --- a/src/main/java/de/teamlapen/vampirism/entity/ai/goals/GolemTargetNonVillageFactionGoal.java +++ b/src/main/java/de/teamlapen/vampirism/entity/ai/goals/GolemTargetNonVillageFactionGoal.java @@ -40,7 +40,7 @@ public boolean canContinueToUse() { return super.canContinueToUse(); } - @SuppressWarnings({"unchecked", "rawtypes"}) + @Override public boolean canUse() { if (golem.tickCount < 20) return false; // Some delay to allow nearby totems to load @@ -58,6 +58,7 @@ protected void findTarget() { * * @return Whether the faction has changed */ + @SuppressWarnings({"unchecked", "rawtypes"}) private boolean determineGolemFaction() { IFaction faction = VReference.HUNTER_FACTION; if (VampirismConfig.BALANCE.golemAttackNonVillageFaction.get()) { From 17c1f82de3958c0b5b3cf8f50826dd855c47065f Mon Sep 17 00:00:00 2001 From: maxanier Date: Sun, 15 Oct 2023 15:21:06 +0200 Subject: [PATCH 12/17] Revert part of "use forge gui offset to render faction level" This reverts part of commit 7209e2d6 --- .../client/gui/overlay/FactionLevelOverlay.java | 2 +- .../vampirism/config/VampirismConfig.java | 15 ++------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/main/java/de/teamlapen/vampirism/client/gui/overlay/FactionLevelOverlay.java b/src/main/java/de/teamlapen/vampirism/client/gui/overlay/FactionLevelOverlay.java index 68b0b7458e..37e6eb8264 100644 --- a/src/main/java/de/teamlapen/vampirism/client/gui/overlay/FactionLevelOverlay.java +++ b/src/main/java/de/teamlapen/vampirism/client/gui/overlay/FactionLevelOverlay.java @@ -31,7 +31,7 @@ public void render(@NotNull ForgeGui gui, @NotNull GuiGraphics graphics, float p text = String.valueOf(handler.getCurrentLevel()); } int x = (this.mc.getWindow().getGuiScaledWidth() - this.mc.font.width(text)) / 2 + VampirismConfig.CLIENT.guiLevelOffsetX.get(); - int y = this.mc.getWindow().getGuiScaledHeight() - VampirismConfig.CLIENT.guiLevelOffsetY.get() - 39; + int y = this.mc.getWindow().getGuiScaledHeight() - VampirismConfig.CLIENT.guiLevelOffsetY.get(); graphics.drawString(this.mc.font, text, x + 1, y, 0, false); graphics.drawString(this.mc.font, text, x - 1, y, 0, false); graphics.drawString(this.mc.font, text, x, y + 1, 0, false); diff --git a/src/main/java/de/teamlapen/vampirism/config/VampirismConfig.java b/src/main/java/de/teamlapen/vampirism/config/VampirismConfig.java index 68830b20ad..91e1eb3684 100644 --- a/src/main/java/de/teamlapen/vampirism/config/VampirismConfig.java +++ b/src/main/java/de/teamlapen/vampirism/config/VampirismConfig.java @@ -2,7 +2,6 @@ import de.teamlapen.lib.lib.util.UtilLib; -import de.teamlapen.vampirism.REFERENCE; import de.teamlapen.vampirism.VampirismMod; import de.teamlapen.vampirism.api.ThreadSafeAPI; import de.teamlapen.vampirism.api.VampirismAPI; @@ -16,12 +15,9 @@ import net.minecraftforge.fml.config.ModConfig; import net.minecraftforge.fml.event.config.ModConfigEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; -import org.apache.commons.compress.archivers.sevenz.CLI; import org.apache.commons.lang3.tuple.Pair; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.apache.maven.artifact.versioning.ArtifactVersion; -import org.apache.maven.artifact.versioning.DefaultArtifactVersion; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -124,12 +120,7 @@ public static void finalizeAndRegisterConfig() { public static void onLoad(final ModConfigEvent.@NotNull Loading configEvent) { if (configEvent.getConfig().getType() == ModConfig.Type.SERVER) { ((SundamageRegistry) VampirismAPI.sundamageRegistry()).reloadConfiguration(); - } - if (configEvent.getConfig().getSpec() == clientSpec) { - if (CLIENT.guiLevelOffsetYOld.get() == 0) { - CLIENT.guiLevelOffsetYOld.set(CLIENT.guiLevelOffsetY.get()); - CLIENT.guiLevelOffsetY.set(CLIENT.guiLevelOffsetY.get() - 49); - } + } } @@ -256,7 +247,6 @@ public static class Client { public final ForgeConfigSpec.BooleanValue disableHudActionDurationRendering; public final ForgeConfigSpec.ConfigValue actionOrder; public final ForgeConfigSpec.ConfigValue minionTaskOrder; - public final ForgeConfigSpec.IntValue guiLevelOffsetYOld; Client(ForgeConfigSpec.@NotNull Builder builder) { builder.comment("Client configuration settings") @@ -274,7 +264,7 @@ public static class Client { builder.comment("Configure GUI").push("gui"); guiLevelOffsetX = builder.comment("X-Offset of the level indicator from the center in pixels").defineInRange("levelOffsetX", 0, -250, 250); - guiLevelOffsetY = builder.comment("Y-Offset of the level indicator from the bottom in pixels").defineInRange("levelOffsetY", 0, 0, 270); + guiLevelOffsetY = builder.comment("Y-Offset of the level indicator from the bottom in pixels").defineInRange("levelOffsetY", 47, 0, 270); guiSkillButton = builder.comment("Render skill menu button in inventory").define("skillButtonEnable", true); overrideGuiSkillButtonX = builder.comment("Force the guiSkillButton to the following x position from the center of the inventory, default value is 125").defineInRange("overrideGuiSkillButtonX", 125, Integer.MIN_VALUE, Integer.MAX_VALUE); overrideGuiSkillButtonY = builder.comment("Force the guiSkillButton to the following y position from the center of the inventory, default value is -22").defineInRange("overrideGuiSkillButtonY", -22, Integer.MIN_VALUE, Integer.MAX_VALUE); @@ -289,7 +279,6 @@ public static class Client { builder.push("internal"); actionOrder = builder.comment("Action ordering").define("actionOrder", "", ClientConfigHelper::testActions); minionTaskOrder = builder.comment("Minion task ordering").define("minionTaskOrder", "", ClientConfigHelper::testTasks); - guiLevelOffsetYOld = builder.comment("Old fixed Y offset of level overlay").defineInRange("levelOffsetYOld", 0, 0, 270); builder.pop(); builder.pop(); From 53fed6ffc4e88a185d666d8272f574ecec024ffb Mon Sep 17 00:00:00 2001 From: maxanier Date: Sun, 15 Oct 2023 15:16:51 +0200 Subject: [PATCH 13/17] Adjust spawn weights for more barons/advanced vampires --- .../de/teamlapen/vampirism/world/biome/VampirismBiomes.java | 4 ++-- .../de/teamlapen/vampirism/world/gen/VampirismFeatures.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/teamlapen/vampirism/world/biome/VampirismBiomes.java b/src/main/java/de/teamlapen/vampirism/world/biome/VampirismBiomes.java index 27a9305ed3..26ee2e2906 100644 --- a/src/main/java/de/teamlapen/vampirism/world/biome/VampirismBiomes.java +++ b/src/main/java/de/teamlapen/vampirism/world/biome/VampirismBiomes.java @@ -21,8 +21,8 @@ public class VampirismBiomes { public static @NotNull Biome createVampireForest(HolderGetter featureGetter, HolderGetter> carverGetter) { MobSpawnSettings.Builder mobSpawnBuilder = new MobSpawnSettings.Builder(); mobSpawnBuilder.creatureGenerationProbability(0.25f); - mobSpawnBuilder.addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(ModEntities.VAMPIRE.get(), 35, 1, 3)); - mobSpawnBuilder.addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(ModEntities.VAMPIRE_BARON.get(), 10, 1, 1)); + mobSpawnBuilder.addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(ModEntities.VAMPIRE.get(), 80, 1, 3)); + mobSpawnBuilder.addSpawn(MobCategory.MONSTER, new MobSpawnSettings.SpawnerData(ModEntities.VAMPIRE_BARON.get(), 27, 1, 1)); mobSpawnBuilder.addSpawn(MobCategory.AMBIENT, new MobSpawnSettings.SpawnerData(ModEntities.BLINDING_BAT.get(), 60, 2, 4)); mobSpawnBuilder.addSpawn(MobCategory.CREATURE, new MobSpawnSettings.SpawnerData(ModEntities.DUMMY_CREATURE.get(), 80, 3, 6)); diff --git a/src/main/java/de/teamlapen/vampirism/world/gen/VampirismFeatures.java b/src/main/java/de/teamlapen/vampirism/world/gen/VampirismFeatures.java index 221b53a941..0e202d2011 100644 --- a/src/main/java/de/teamlapen/vampirism/world/gen/VampirismFeatures.java +++ b/src/main/java/de/teamlapen/vampirism/world/gen/VampirismFeatures.java @@ -166,7 +166,7 @@ public static void createBiomeModifier(BootstapContext context) { HolderGetter biomeLookup = context.lookup(Registries.BIOME); HolderGetter placedFeatureLookup = context.lookup(Registries.PLACED_FEATURE); context.register(VAMPIRE_SPAWN, ExtendedAddSpawnsBiomeModifier.singleSpawn(biomeLookup.getOrThrow(ModTags.Biomes.HasSpawn.VAMPIRE), biomeLookup.getOrThrow(ModTags.Biomes.NoSpawn.VAMPIRE), new ExtendedAddSpawnsBiomeModifier.ExtendedSpawnData(ModEntities.VAMPIRE.get(), 80, 1, 3, MobCategory.MONSTER))); - context.register(ADVANCED_VAMPIRE_SPAWN,ExtendedAddSpawnsBiomeModifier.singleSpawn(biomeLookup.getOrThrow(ModTags.Biomes.HasSpawn.ADVANCED_VAMPIRE), biomeLookup.getOrThrow(ModTags.Biomes.NoSpawn.ADVANCED_VAMPIRE), new ExtendedAddSpawnsBiomeModifier.ExtendedSpawnData(ModEntities.ADVANCED_VAMPIRE.get(), 25, 1, 3, MobCategory.MONSTER))); + context.register(ADVANCED_VAMPIRE_SPAWN, ExtendedAddSpawnsBiomeModifier.singleSpawn(biomeLookup.getOrThrow(ModTags.Biomes.HasSpawn.ADVANCED_VAMPIRE), biomeLookup.getOrThrow(ModTags.Biomes.NoSpawn.ADVANCED_VAMPIRE), new ExtendedAddSpawnsBiomeModifier.ExtendedSpawnData(ModEntities.ADVANCED_VAMPIRE.get(), 30, 1, 3, MobCategory.MONSTER))); context.register(VAMPIRE_DUNGEON_MODIFIER, new ForgeBiomeModifiers.AddFeaturesBiomeModifier(biomeLookup.getOrThrow(ModTags.Biomes.HasStructure.VAMPIRE_DUNGEON), HolderSet.direct(placedFeatureLookup.getOrThrow(VampirismFeatures.VAMPIRE_DUNGEON_PLACED)), GenerationStep.Decoration.UNDERGROUND_STRUCTURES)); } From 0ca5261a519a91e25365c0a90e8f5a190c460584 Mon Sep 17 00:00:00 2001 From: maxanier Date: Sat, 21 Oct 2023 13:02:29 +0200 Subject: [PATCH 14/17] Prevent hunter mobs from taking revenge when hit by another hunter mob. Closes #1270 --- .../teamlapen/vampirism/entity/hunter/BasicHunterEntity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/teamlapen/vampirism/entity/hunter/BasicHunterEntity.java b/src/main/java/de/teamlapen/vampirism/entity/hunter/BasicHunterEntity.java index ad45e5b290..ec69086d35 100644 --- a/src/main/java/de/teamlapen/vampirism/entity/hunter/BasicHunterEntity.java +++ b/src/main/java/de/teamlapen/vampirism/entity/hunter/BasicHunterEntity.java @@ -7,6 +7,7 @@ import de.teamlapen.vampirism.api.entity.actions.EntityActionTier; import de.teamlapen.vampirism.api.entity.actions.IEntityActionUser; import de.teamlapen.vampirism.api.entity.hunter.IBasicHunter; +import de.teamlapen.vampirism.api.entity.hunter.IHunterMob; import de.teamlapen.vampirism.api.entity.hunter.IVampirismCrossbowUser; import de.teamlapen.vampirism.api.items.IVampirismCrossbow; import de.teamlapen.vampirism.api.world.ICaptureAttributes; @@ -507,7 +508,7 @@ protected void registerGoals() { this.goalSelector.addGoal(8, new LookAtPlayerGoal(this, VampireBaseEntity.class, 17F)); this.goalSelector.addGoal(8, new RandomLookAroundGoal(this)); - this.targetSelector.addGoal(1, new HurtByTargetGoal(this)); + this.targetSelector.addGoal(1, new HurtByTargetGoal(this, IHunterMob.class)); this.targetSelector.addGoal(2, new AttackVillageGoal<>(this)); this.targetSelector.addGoal(2, new DefendVillageGoal<>(this));//Should automatically be mutually exclusive with attack village this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Player.class, 5, true, false, VampirismAPI.factionRegistry().getPredicate(getFaction(), true, false, false, false, null))); From 12ec10faefdf19d237075a2bc9640aab872667a1 Mon Sep 17 00:00:00 2001 From: cheaterpaul Date: Sat, 21 Oct 2023 13:50:19 +0200 Subject: [PATCH 15/17] make garlic and vampire orchid compostable --- .../lib/lib/util/RegisterHelper.java | 25 +++++++++++++++++++ .../teamlapen/vampirism/core/ModBlocks.java | 23 +++++------------ .../de/teamlapen/vampirism/core/ModItems.java | 4 ++- 3 files changed, 34 insertions(+), 18 deletions(-) create mode 100644 src/lib/java/de/teamlapen/lib/lib/util/RegisterHelper.java diff --git a/src/lib/java/de/teamlapen/lib/lib/util/RegisterHelper.java b/src/lib/java/de/teamlapen/lib/lib/util/RegisterHelper.java new file mode 100644 index 0000000000..e761e5fafc --- /dev/null +++ b/src/lib/java/de/teamlapen/lib/lib/util/RegisterHelper.java @@ -0,0 +1,25 @@ +package de.teamlapen.lib.lib.util; + +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.ItemLike; +import net.minecraft.world.level.block.*; + +public class RegisterHelper { + + public static T compostable(T item, float chance) { + ComposterBlock.COMPOSTABLES.put(item, chance); + return item; + } + + public static T flammable(T block, int encouragement, int flammability) { + FireBlock fireblock = (FireBlock) Blocks.FIRE; + fireblock.setFlammable(block, encouragement, flammability); + return block; + } + + public static T potted(T potBlock, ResourceLocation plant) { + FlowerPotBlock pot = (FlowerPotBlock) Blocks.FLOWER_POT; + pot.addPlant(plant, () -> potBlock); + return potBlock; + } +} diff --git a/src/main/java/de/teamlapen/vampirism/core/ModBlocks.java b/src/main/java/de/teamlapen/vampirism/core/ModBlocks.java index aa8c13eda8..b2a2d0e4a3 100755 --- a/src/main/java/de/teamlapen/vampirism/core/ModBlocks.java +++ b/src/main/java/de/teamlapen/vampirism/core/ModBlocks.java @@ -28,6 +28,8 @@ import java.util.function.Supplier; import java.util.stream.Collectors; +import static de.teamlapen.lib.lib.util.RegisterHelper.*; + /** * Handles all block registrations and reference. */ @@ -35,7 +37,6 @@ public class ModBlocks { public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, REFERENCE.MODID); - //Blocks public static final RegistryObject ALCHEMICAL_CAULDRON = registerWithItem("alchemical_cauldron", AlchemicalCauldronBlock::new); public static final RegistryObject ALCHEMICAL_FIRE = BLOCKS.register("alchemical_fire", AlchemicalFireBlock::new); public static final RegistryObject ALTAR_INFUSION = registerWithItem("altar_infusion", AltarInfusionBlock::new); @@ -76,12 +77,8 @@ public class ModBlocks { public static final RegistryObject TOTEM_TOP_CRAFTED = registerWithItem("totem_top_crafted", () -> new TotemTopBlock(true, new ResourceLocation("none"))); public static final RegistryObject TOTEM_TOP_VAMPIRISM_VAMPIRE_CRAFTED = BLOCKS.register("totem_top_vampirism_vampire_crafted", () -> new TotemTopBlock(true, REFERENCE.VAMPIRE_PLAYER_KEY)); public static final RegistryObject TOTEM_TOP_VAMPIRISM_HUNTER_CRAFTED = BLOCKS.register("totem_top_vampirism_hunter_crafted", () -> new TotemTopBlock(true, REFERENCE.HUNTER_PLAYER_KEY)); - public static final RegistryObject VAMPIRE_ORCHID = registerWithItem("vampire_orchid", () -> new VampirismFlowerBlock(VampirismFlowerBlock.TYPE.ORCHID)); - public static final RegistryObject POTTED_VAMPIRE_ORCHID = BLOCKS.register("potted_vampire_orchid", () -> { - FlowerPotBlock block = new FlowerPotBlock(() -> (FlowerPotBlock) Blocks.FLOWER_POT, VAMPIRE_ORCHID, Block.Properties.of().noCollission().isViewBlocking(UtilLib::never).pushReaction(PushReaction.DESTROY).instabreak()); - ((FlowerPotBlock) Blocks.FLOWER_POT).addPlant(VAMPIRE_ORCHID.getId(), () -> block); - return block; - }); + public static final RegistryObject VAMPIRE_ORCHID = registerWithItem("vampire_orchid", () -> compostable(new VampirismFlowerBlock(VampirismFlowerBlock.TYPE.ORCHID), 0.65f)); + public static final RegistryObject POTTED_VAMPIRE_ORCHID = BLOCKS.register("potted_vampire_orchid", () -> potted(new FlowerPotBlock(() -> (FlowerPotBlock) Blocks.FLOWER_POT, VAMPIRE_ORCHID, Block.Properties.of().noCollission().isViewBlocking(UtilLib::never).pushReaction(PushReaction.DESTROY).instabreak()), VAMPIRE_ORCHID.getId())); public static final RegistryObject WEAPON_TABLE = registerWithItem("weapon_table", WeaponTableBlock::new); public static final RegistryObject POTION_TABLE = registerWithItem("potion_table", PotionTableBlock::new); public static final RegistryObject DARK_SPRUCE_LEAVES = registerWithItem("dark_spruce_leaves", DarkSpruceLeavesBlock::new); @@ -94,16 +91,8 @@ public class ModBlocks { public static final RegistryObject TOMBSTONE3 = registerWithItem("tombstone3", () -> new VampirismSplitBlock(BlockBehaviour.Properties.of().mapColor(MapColor.STONE).pushReaction(PushReaction.DESTROY).strength(2, 6), BlockVoxelshapes.tomb3_base, BlockVoxelshapes.tomb3_top, true).markDecorativeBlock()); public static final RegistryObject GRAVE_CAGE = registerWithItem("grave_cage", () -> new VampirismHorizontalBlock(BlockBehaviour.Properties.of().mapColor(MapColor.METAL).strength(6, 8).requiresCorrectToolForDrops().sound(SoundType.METAL), BlockVoxelshapes.grave_cage).markDecorativeBlock()); public static final RegistryObject CURSED_GRASS = registerWithItem("cursed_grass", () -> new CursedGrass(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_BLACK).randomTicks().strength(0.6F).sound(SoundType.GRASS))); - public static final RegistryObject CURSED_ROOTS = registerWithItem("cursed_roots", () -> { - BushBlock bush = new BushBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED).isViewBlocking(UtilLib::never).pushReaction(PushReaction.DESTROY).ignitedByLava().replaceable().noCollission().instabreak().sound(SoundType.GRASS)); - ((FireBlock) Blocks.FIRE).setFlammable(bush, 60, 100); - return bush; - }); - public static final RegistryObject POTTED_CURSED_ROOTS = BLOCKS.register("potted_cursed_roots", () -> { - FlowerPotBlock block = new FlowerPotBlock(() -> (FlowerPotBlock) Blocks.FLOWER_POT, CURSED_ROOTS, Block.Properties.of().noCollission().isViewBlocking(UtilLib::never).pushReaction(PushReaction.DESTROY).ignitedByLava().replaceable().instabreak().noOcclusion()); - ((FlowerPotBlock) Blocks.FLOWER_POT).addPlant(CURSED_ROOTS.getId(), () -> block); - return block; - }); + public static final RegistryObject CURSED_ROOTS = registerWithItem("cursed_roots", () -> flammable(new BushBlock(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_RED).isViewBlocking(UtilLib::never).pushReaction(PushReaction.DESTROY).ignitedByLava().replaceable().noCollission().instabreak().sound(SoundType.GRASS)),60, 100)); + public static final RegistryObject POTTED_CURSED_ROOTS = BLOCKS.register("potted_cursed_roots", () -> potted(new FlowerPotBlock(() -> (FlowerPotBlock) Blocks.FLOWER_POT, CURSED_ROOTS, Block.Properties.of().noCollission().isViewBlocking(UtilLib::never).pushReaction(PushReaction.DESTROY).ignitedByLava().replaceable().instabreak().noOcclusion()), CURSED_ROOTS.getId())); public static final RegistryObject DARK_SPRUCE_PLANKS = registerWithItem("dark_spruce_planks", () -> new Block(BlockBehaviour.Properties.of().mapColor(MapColor.COLOR_GRAY).ignitedByLava().mapColor(MapColor.COLOR_GRAY).strength(2.0F, 3.0F).sound(SoundType.WOOD))); public static final RegistryObject CURSED_SPRUCE_PLANKS = registerWithItem("cursed_spruce_planks", () -> new Block(BlockBehaviour.Properties.of().ignitedByLava().mapColor(MapColor.CRIMSON_HYPHAE).strength(2.0F, 3.0F).sound(SoundType.WOOD))); public static final RegistryObject STRIPPED_DARK_SPRUCE_LOG = registerWithItem("stripped_dark_spruce_log", () -> new LogBlock(MapColor.COLOR_BLACK, MapColor.COLOR_GRAY)); diff --git a/src/main/java/de/teamlapen/vampirism/core/ModItems.java b/src/main/java/de/teamlapen/vampirism/core/ModItems.java index e6e4496d3d..9b3f82aec5 100755 --- a/src/main/java/de/teamlapen/vampirism/core/ModItems.java +++ b/src/main/java/de/teamlapen/vampirism/core/ModItems.java @@ -42,6 +42,8 @@ import java.util.function.Supplier; import java.util.stream.Collectors; +import static de.teamlapen.lib.lib.util.RegisterHelper.compostable; + /** * Handles all item registrations and reference. */ @@ -151,7 +153,7 @@ public boolean isFoil(ItemStack stack) { public static final RegistryObject INJECTION_SANGUINARE = register("injection_sanguinare", () -> new InjectionItem(InjectionItem.TYPE.SANGUINARE)); public static final RegistryObject IMPURE_BLOOD_BUCKET = register("impure_blood_bucket", CreativeModeTabs.TOOLS_AND_UTILITIES, () -> new BucketItem(ModFluids.IMPURE_BLOOD, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1))); - public static final RegistryObject ITEM_GARLIC = register("item_garlic", GarlicItem::new); + public static final RegistryObject ITEM_GARLIC = register("item_garlic", () -> compostable(new GarlicItem(), 0.65F)); public static final RegistryObject GARLIC_BREAD = register("garlic_bread", GarlicBreadItem::new); public static final RegistryObject ITEM_ALCHEMICAL_FIRE = register("item_alchemical_fire", AlchemicalFireItem::new); From ba23dbe6e1628ae658d1935fb033515085e77305 Mon Sep 17 00:00:00 2001 From: cheaterpaul Date: Sat, 21 Oct 2023 13:55:54 +0200 Subject: [PATCH 16/17] add ModAi class for storing ai brain related objects --- .../de/teamlapen/vampirism/core/ModAi.java | 19 +++++++++++++++++++ .../teamlapen/vampirism/core/ModVillage.java | 8 +++++--- .../vampirism/core/RegistryManager.java | 1 + .../converted/ConvertedVillagerEntity.java | 3 ++- 4 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 src/main/java/de/teamlapen/vampirism/core/ModAi.java diff --git a/src/main/java/de/teamlapen/vampirism/core/ModAi.java b/src/main/java/de/teamlapen/vampirism/core/ModAi.java new file mode 100644 index 0000000000..9336789f3d --- /dev/null +++ b/src/main/java/de/teamlapen/vampirism/core/ModAi.java @@ -0,0 +1,19 @@ +package de.teamlapen.vampirism.core; + +import de.teamlapen.vampirism.REFERENCE; +import de.teamlapen.vampirism.entity.ai.sensing.VampireVillagerHostilesSensor; +import net.minecraft.world.entity.ai.sensing.SensorType; +import net.minecraftforge.eventbus.api.IEventBus; +import net.minecraftforge.registries.DeferredRegister; +import net.minecraftforge.registries.ForgeRegistries; +import net.minecraftforge.registries.RegistryObject; + +public class ModAi { + public static final DeferredRegister> SENSOR_TYPES = DeferredRegister.create(ForgeRegistries.SENSOR_TYPES, REFERENCE.MODID); + + public static final RegistryObject> VAMPIRE_VILLAGER_HOSTILES = SENSOR_TYPES.register("vampire_villager_hostiles", () -> new SensorType<>(VampireVillagerHostilesSensor::new)); + + static void register(IEventBus bus) { + SENSOR_TYPES.register(bus); + } +} diff --git a/src/main/java/de/teamlapen/vampirism/core/ModVillage.java b/src/main/java/de/teamlapen/vampirism/core/ModVillage.java index 878c5e1bf0..fcbfaed0bb 100644 --- a/src/main/java/de/teamlapen/vampirism/core/ModVillage.java +++ b/src/main/java/de/teamlapen/vampirism/core/ModVillage.java @@ -30,7 +30,6 @@ public class ModVillage { public static final DeferredRegister PROFESSIONS = DeferredRegister.create(ForgeRegistries.VILLAGER_PROFESSIONS, REFERENCE.MODID); public static final DeferredRegister POI_TYPES = DeferredRegister.create(ForgeRegistries.POI_TYPES, REFERENCE.MODID); - public static final DeferredRegister> SENSOR_TYPES = DeferredRegister.create(ForgeRegistries.SENSOR_TYPES, REFERENCE.MODID); public static final DeferredRegister SCHEDULES = DeferredRegister.create(ForgeRegistries.SCHEDULES, REFERENCE.MODID); public static final RegistryObject HUNTER_TOTEM = POI_TYPES.register("hunter_totem", () -> new PoiType(getAllStates(ModBlocks.TOTEM_TOP_VAMPIRISM_HUNTER.get(), ModBlocks.TOTEM_TOP_VAMPIRISM_HUNTER_CRAFTED.get()), 1, 1)); @@ -38,7 +37,11 @@ public class ModVillage { public static final RegistryObject NO_FACTION_TOTEM = POI_TYPES.register("no_faction_totem", () -> new PoiType(getAllStates(ModBlocks.TOTEM_TOP.get(), ModBlocks.TOTEM_TOP_CRAFTED.get()), 1, 1)); public static final RegistryObject ALTAR_CLEANSING = POI_TYPES.register("church_altar", () -> new PoiType(getAllStates(ModBlocks.ALTAR_CLEANSING.get()), 1, 1)); - public static final RegistryObject> VAMPIRE_VILLAGER_HOSTILES = SENSOR_TYPES.register("vampire_villager_hostiles", () -> new SensorType<>(VampireVillagerHostilesSensor::new)); + /** + * @deprecated use {@link ModAi#VAMPIRE_VILLAGER_HOSTILES} instead + */ + @Deprecated(forRemoval = true) + public static final RegistryObject> VAMPIRE_VILLAGER_HOSTILES = ModAi.VAMPIRE_VILLAGER_HOSTILES; public static final RegistryObject CONVERTED_DEFAULT = SCHEDULES.register("converted_default", () -> new ScheduleBuilder(new Schedule()).changeActivityAt(12000, Activity.IDLE).changeActivityAt(10, Activity.REST).changeActivityAt(14000, Activity.WORK).changeActivityAt(21000, Activity.MEET).changeActivityAt(23000, Activity.IDLE).build()); @@ -51,7 +54,6 @@ public class ModVillage { static void register(IEventBus bus) { POI_TYPES.register(bus); PROFESSIONS.register(bus); - SENSOR_TYPES.register(bus); SCHEDULES.register(bus); } diff --git a/src/main/java/de/teamlapen/vampirism/core/RegistryManager.java b/src/main/java/de/teamlapen/vampirism/core/RegistryManager.java index 211e6a2d4b..6337482787 100644 --- a/src/main/java/de/teamlapen/vampirism/core/RegistryManager.java +++ b/src/main/java/de/teamlapen/vampirism/core/RegistryManager.java @@ -56,6 +56,7 @@ public static void setupRegistries(@NotNull IEventBus modbus) { ModSounds.register(modbus); ModTasks.register(modbus); ModTiles.register(modbus); + ModAi.register(modbus); ModVillage.register(modbus); VampireActions.register(modbus); HunterActions.register(modbus); diff --git a/src/main/java/de/teamlapen/vampirism/entity/converted/ConvertedVillagerEntity.java b/src/main/java/de/teamlapen/vampirism/entity/converted/ConvertedVillagerEntity.java index 713df99413..103c1c2dfd 100644 --- a/src/main/java/de/teamlapen/vampirism/entity/converted/ConvertedVillagerEntity.java +++ b/src/main/java/de/teamlapen/vampirism/entity/converted/ConvertedVillagerEntity.java @@ -9,6 +9,7 @@ import de.teamlapen.vampirism.api.entity.player.vampire.IBloodStats; import de.teamlapen.vampirism.blockentity.TotemBlockEntity; import de.teamlapen.vampirism.core.ModAdvancements; +import de.teamlapen.vampirism.core.ModAi; import de.teamlapen.vampirism.core.ModVillage; import de.teamlapen.vampirism.entity.VampirismVillagerEntity; import de.teamlapen.vampirism.entity.player.vampire.VampirePlayer; @@ -64,7 +65,7 @@ public class ConvertedVillagerEntity extends VampirismVillagerEntity implements static { SENSOR_TYPES = Lists.newArrayList(Villager.SENSOR_TYPES); SENSOR_TYPES.remove(SensorType.VILLAGER_HOSTILES); - SENSOR_TYPES.add(ModVillage.VAMPIRE_VILLAGER_HOSTILES.get()); + SENSOR_TYPES.add(ModAi.VAMPIRE_VILLAGER_HOSTILES.get()); } private @NotNull EnumStrength garlicCache = EnumStrength.NONE; From 2e9f4dc61f687d188ffd459c5be6adf79b9c601c Mon Sep 17 00:00:00 2001 From: cheaterpaul Date: Wed, 25 Oct 2023 23:08:21 +0200 Subject: [PATCH 17/17] animate vampire cloak --- .../client/model/armor/CloakModel.java | 134 ++++++++++++------ .../items/ColoredVampireClothingItem.java | 6 +- .../mixin/client/HumanoidArmorLayerMixin.java | 28 ++++ .../teamlapen/vampirism/util/MixinHooks.java | 2 + src/main/resources/vampirism.mixins.json | 1 + 5 files changed, 124 insertions(+), 47 deletions(-) create mode 100644 src/main/java/de/teamlapen/vampirism/mixin/client/HumanoidArmorLayerMixin.java diff --git a/src/main/java/de/teamlapen/vampirism/client/model/armor/CloakModel.java b/src/main/java/de/teamlapen/vampirism/client/model/armor/CloakModel.java index 0960c2308f..63f6dee29e 100644 --- a/src/main/java/de/teamlapen/vampirism/client/model/armor/CloakModel.java +++ b/src/main/java/de/teamlapen/vampirism/client/model/armor/CloakModel.java @@ -2,6 +2,7 @@ import com.google.common.collect.ImmutableList; import de.teamlapen.vampirism.client.core.ModEntitiesRender; +import de.teamlapen.vampirism.util.MixinHooks; import net.minecraft.client.Minecraft; import net.minecraft.client.model.HumanoidModel; import net.minecraft.client.model.geom.ModelPart; @@ -10,10 +11,14 @@ import net.minecraft.client.model.geom.builders.LayerDefinition; import net.minecraft.client.model.geom.builders.MeshDefinition; import net.minecraft.client.model.geom.builders.PartDefinition; +import net.minecraft.util.Mth; +import net.minecraft.world.entity.LivingEntity; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import org.jetbrains.annotations.NotNull; +import static net.minecraft.client.renderer.entity.LivingEntityRenderer.isEntityUpsideDown; + @OnlyIn(Dist.CLIENT) public class CloakModel extends VampirismArmorModel { @@ -29,11 +34,12 @@ public class CloakModel extends VampirismArmorModel { private static CloakModel cloakItemModel; - public static CloakModel getAdjustedCloak(HumanoidModel wearerModel) { + public static CloakModel getAdjustedCloak(HumanoidModel wearerModel, LivingEntity entity) { if (cloakItemModel == null) { cloakItemModel = new CloakModel(Minecraft.getInstance().getEntityModels().bakeLayer(ModEntitiesRender.CLOAK)); } cloakItemModel.copyFromHumanoid(wearerModel); + cloakItemModel.setupAnimation(entity); return cloakItemModel; } @@ -74,47 +80,91 @@ public CloakModel(@NotNull ModelPart part) { shoulderright = part.getChild(SHOULDER_RIGHT); } -// @Override -// public void setupAnim(@NotNull LivingEntity entity, float f, float f1, float ageInTicks, float netHeadYaw, float headPitch) { -// super.setupAnim(entity, f, f1, ageInTicks, netHeadYaw, headPitch); -// //Isn't use afaik -// -// -// boolean flag = entity != null && entity.getFallFlyingTicks() > 4; -// -// float f6 = 1.0F; -// if (flag) { -// f6 = (float) (entity.getDeltaMovement().x * entity.getDeltaMovement().x + entity.getDeltaMovement().y * entity.getDeltaMovement().y -// + entity.getDeltaMovement().z * entity.getDeltaMovement().z); -// f6 = f6 / 0.2F; -// f6 = f6 * f6 * f6; -// } -// -// if (f6 < 1.0F) { -// f6 = 1.0F; -// } -// -// float rotation = Mth.cos(f * 0.6662F) * 1.4F * f1 / f6; -// if (rotation < 0.0F) -// rotation *= -1; -// this.cloakback.xRot = 0.0872665F + (rotation / 3); -// this.leftlong.xRot = 0.0872665F + (rotation / 3); -// this.rightlong.xRot = 0.0872665F + (rotation / 3); -// this.leftmedium.xRot = 0.0872665F + (rotation / 3); -// this.rightmedium.xRot = 0.0872665F + (rotation / 3); -// this.rightshort.xRot = 0.0872665F + (rotation / 3); -// this.leftshort.xRot = 0.0872665F + (rotation / 3); -// -// if (this.crouching) { -// this.cloakback.xRot += 0.5F; -// this.leftlong.xRot += 0.5F; -// this.rightlong.xRot += 0.5F; -// this.leftmedium.xRot += 0.5F; -// this.rightmedium.xRot += 0.5F; -// this.leftshort.xRot += 0.5F; -// this.rightshort.xRot += 0.5F; -// } -// } + private void setupAnimation(LivingEntity entity) { + boolean shouldSit = entity.isPassenger() && (entity.getVehicle() != null && entity.getVehicle().shouldRiderSit()); + + float f = Mth.rotLerp(MixinHooks.armorLayerPartialTicks, entity.yBodyRotO, entity.yBodyRot); + float f1 = Mth.rotLerp(MixinHooks.armorLayerPartialTicks, entity.yHeadRotO, entity.yHeadRot); + float f2 = f1 - f; + + float f6 = Mth.lerp(MixinHooks.armorLayerPartialTicks, entity.xRotO, entity.getXRot()); + + if (shouldSit && entity.getVehicle() instanceof LivingEntity livingentity) { + f = Mth.rotLerp(MixinHooks.armorLayerPartialTicks, livingentity.yBodyRotO, livingentity.yBodyRot); + f2 = f1 - f; + float f3 = Mth.wrapDegrees(f2); + if (f3 < -85.0F) { + f3 = -85.0F; + } + + if (f3 >= 85.0F) { + f3 = 85.0F; + } + + f = f1 - f3; + if (f3 * f3 > 2500.0F) { + f += f3 * 0.2F; + } + + f2 = f1 - f; + } + + if (isEntityUpsideDown(entity)) { + f6 *= -1.0F; + f2 *= -1.0F; + } + + float f8 = 0.0F; + float f5 = 0.0F; + if (!shouldSit && entity.isAlive()) { + f8 = entity.walkAnimation.speed(MixinHooks.armorLayerPartialTicks); + f5 = entity.walkAnimation.position(MixinHooks.armorLayerPartialTicks); + if (entity.isBaby()) { + f5 *= 3.0F; + } + + if (f8 > 1.0F) { + f8 = 1.0F; + } + } + cloakItemModel.setupAnim(entity, f5, f8,entity.tickCount + MixinHooks.armorLayerPartialTicks, f2, f6); + } + + public void setupAnim(@NotNull LivingEntity entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch) { + boolean flag = entity != null && entity.getFallFlyingTicks() > 4; + + float f6 = 1.0F; + if (flag) { + f6 = (float) (entity.getDeltaMovement().x * entity.getDeltaMovement().x + entity.getDeltaMovement().y * entity.getDeltaMovement().y + entity.getDeltaMovement().z * entity.getDeltaMovement().z); + f6 = f6 / 0.2F; + f6 = f6 * f6 * f6; + } + + if (f6 < 1.0F) { + f6 = 1.0F; + } + + float rotation = Mth.cos(limbSwing * 0.6662F) * 1.4F * (limbSwingAmount / 1.8f) / f6; + if (rotation < 0.0F) + rotation *= -1; + this.cloakback.xRot = 0.0872665F + (rotation / 3); + this.leftlong.xRot = 0.0872665F + (rotation / 3); + this.rightlong.xRot = 0.0872665F + (rotation / 3); + this.leftmedium.xRot = 0.0872665F + (rotation / 3); + this.rightmedium.xRot = 0.0872665F + (rotation / 3); + this.rightshort.xRot = 0.0872665F + (rotation / 3); + this.leftshort.xRot = 0.0872665F + (rotation / 3); + + if (entity.isCrouching()) { + this.cloakback.xRot += 0.5F; + this.leftlong.xRot += 0.5F; + this.rightlong.xRot += 0.5F; + this.leftmedium.xRot += 0.5F; + this.rightmedium.xRot += 0.5F; + this.leftshort.xRot += 0.5F; + this.rightshort.xRot += 0.5F; + } + } @Override protected @NotNull Iterable getBodyModels() { diff --git a/src/main/java/de/teamlapen/vampirism/items/ColoredVampireClothingItem.java b/src/main/java/de/teamlapen/vampirism/items/ColoredVampireClothingItem.java index f6907ac603..b469178d0d 100644 --- a/src/main/java/de/teamlapen/vampirism/items/ColoredVampireClothingItem.java +++ b/src/main/java/de/teamlapen/vampirism/items/ColoredVampireClothingItem.java @@ -34,12 +34,8 @@ public ColoredVampireClothingItem(@NotNull ArmorItem.Type type, EnumModel model, @Override public void initializeClient(@NotNull Consumer consumer) { consumer.accept(new IClientItemExtensions() { - @SuppressWarnings({"UnnecessaryDefault", "DuplicateBranchesInSwitch", "SwitchStatementWithTooFewBranches"}) public @NotNull Model getGenericArmorModel(LivingEntity livingEntity, ItemStack itemStack, EquipmentSlot equipmentSlot, HumanoidModel original) { - return switch (model) { - case CLOAK -> CloakModel.getAdjustedCloak(original); - default -> CloakModel.getAdjustedCloak(original); - }; + return CloakModel.getAdjustedCloak(original, livingEntity); } } ); diff --git a/src/main/java/de/teamlapen/vampirism/mixin/client/HumanoidArmorLayerMixin.java b/src/main/java/de/teamlapen/vampirism/mixin/client/HumanoidArmorLayerMixin.java new file mode 100644 index 0000000000..34be3e3010 --- /dev/null +++ b/src/main/java/de/teamlapen/vampirism/mixin/client/HumanoidArmorLayerMixin.java @@ -0,0 +1,28 @@ +package de.teamlapen.vampirism.mixin.client; + +import com.mojang.blaze3d.vertex.PoseStack; +import de.teamlapen.vampirism.util.MixinHooks; +import net.minecraft.client.model.HumanoidModel; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.entity.RenderLayerParent; +import net.minecraft.client.renderer.entity.layers.HumanoidArmorLayer; +import net.minecraft.client.renderer.entity.layers.RenderLayer; +import net.minecraft.world.entity.LivingEntity; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +@Mixin(HumanoidArmorLayer.class) +public abstract class HumanoidArmorLayerMixin, A extends HumanoidModel> extends RenderLayer { + + @Deprecated + private HumanoidArmorLayerMixin(RenderLayerParent pRenderer) { + super(pRenderer); + } + + @Inject(method = "render(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;ILnet/minecraft/world/entity/LivingEntity;FFFFFF)V", at = @At("HEAD")) + public void render(PoseStack pMatrixStack, MultiBufferSource pBuffer, int pPackedLight, T pLivingEntity, float pLimbSwing, float pLimbSwingAmount, float pPartialTicks, float pAgeInTicks, float pNetHeadYaw, float pHeadPitch, CallbackInfo ci) { + MixinHooks.armorLayerPartialTicks = pPartialTicks; + } +} diff --git a/src/main/java/de/teamlapen/vampirism/util/MixinHooks.java b/src/main/java/de/teamlapen/vampirism/util/MixinHooks.java index 9ebac123d2..8215036c6d 100644 --- a/src/main/java/de/teamlapen/vampirism/util/MixinHooks.java +++ b/src/main/java/de/teamlapen/vampirism/util/MixinHooks.java @@ -28,6 +28,8 @@ public class MixinHooks { */ public static boolean enforcingGlowing_bloodVision = false; + public static float armorLayerPartialTicks; + public static void addSingleInstanceStructure(@NotNull List structures) { onlyOneStructure.addAll(structures.stream().map(MixinHooks::singleJigsawString).toList()); } diff --git a/src/main/resources/vampirism.mixins.json b/src/main/resources/vampirism.mixins.json index d255a4e60a..1e7229c388 100644 --- a/src/main/resources/vampirism.mixins.json +++ b/src/main/resources/vampirism.mixins.json @@ -43,6 +43,7 @@ "client": [ "client.AgeableModelAccessor", "client.BossOverlayGuiAccessor", + "client.HumanoidArmorLayerMixin", "client.LevelRendererMixin", "client.LivingEntityRendererAccessor", "client.ResourceLoadStateTrackerMixin",