From 280f23b404e8f90adbb55f1f0b54d47cb5834598 Mon Sep 17 00:00:00 2001 From: Charbonnier Cylian Date: Tue, 19 Nov 2024 17:59:24 +0100 Subject: [PATCH] Add option to enable/disable zombie villager converting to visitor (#10456) * Add option to enable/disable zombie villager converting to visitor * add language * fix upercase --------- Co-authored-by: Marc Hermans --- .../com/minecolonies/api/configuration/ServerConfiguration.java | 2 ++ src/main/java/com/minecolonies/core/event/EventHandler.java | 2 +- src/main/resources/assets/minecolonies/lang/manual_en_us.json | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/minecolonies/api/configuration/ServerConfiguration.java b/src/main/java/com/minecolonies/api/configuration/ServerConfiguration.java index 88b9842ee22..955e671e751 100755 --- a/src/main/java/com/minecolonies/api/configuration/ServerConfiguration.java +++ b/src/main/java/com/minecolonies/api/configuration/ServerConfiguration.java @@ -37,6 +37,7 @@ public class ServerConfiguration extends AbstractConfiguration public final ForgeConfigSpec.IntValue maxTreeSize; public final ForgeConfigSpec.BooleanValue noSupplyPlacementRestrictions; public final ForgeConfigSpec.BooleanValue skyRaiders; + public final ForgeConfigSpec.BooleanValue convertZombieVillagerToVisitor; /* --------------------------------------------------------------------------- * * ------------------- ######## Research settings ######## ------------------- * @@ -147,6 +148,7 @@ protected ServerConfiguration(final ForgeConfigSpec.Builder builder) maxTreeSize = defineInteger(builder, "maxtreesize", 400, 1, 1000); noSupplyPlacementRestrictions = defineBoolean(builder, "nosupplyplacementrestrictions", false); skyRaiders = defineBoolean(builder, "skyraiders", false); + convertZombieVillagerToVisitor = defineBoolean(builder, "convertzombievillagertovisitor", true); swapToCategory(builder, "research"); researchCreativeCompletion = defineBoolean(builder, "researchcreativecompletion", true); diff --git a/src/main/java/com/minecolonies/core/event/EventHandler.java b/src/main/java/com/minecolonies/core/event/EventHandler.java index b8812e661be..4808dffc9b0 100755 --- a/src/main/java/com/minecolonies/core/event/EventHandler.java +++ b/src/main/java/com/minecolonies/core/event/EventHandler.java @@ -801,7 +801,7 @@ public static void onCropTrample(BlockEvent.FarmlandTrampleEvent event) public static void onEntityConverted(@NotNull final LivingConversionEvent.Pre event) { LivingEntity entity = event.getEntity(); - if (entity instanceof ZombieVillager && event.getOutcome() == EntityType.VILLAGER) + if (MineColonies.getConfig().getServer().convertZombieVillagerToVisitor.get() && entity instanceof ZombieVillager && event.getOutcome() == EntityType.VILLAGER) { final Level world = entity.getCommandSenderWorld(); final IColony colony = IColonyManager.getInstance().getIColony(world, entity.blockPosition()); diff --git a/src/main/resources/assets/minecolonies/lang/manual_en_us.json b/src/main/resources/assets/minecolonies/lang/manual_en_us.json index 6c9047a6175..66eef231fea 100644 --- a/src/main/resources/assets/minecolonies/lang/manual_en_us.json +++ b/src/main/resources/assets/minecolonies/lang/manual_en_us.json @@ -85,6 +85,8 @@ "minecolonies.config.nosupplyplacementrestrictions.comment": "Disables supply camp placing restrictions, intended for skyworlds and similar", "minecolonies.config.skyraiders": "Enable raiders to spawn in the sky", "minecolonies.config.skyraiders.comment": "Raiders will spawn in the sky if this is enabled", + "minecolonies.config.convertzombievillagertovisitor": "Enable zombie villager convert to visitor", + "minecolonies.config.convertzombievillagertovisitor.comment": "Zombie villager when converted will be transformed into visitor if this is enabled", "minecolonies.config.disableemptycolonies": "Disable Empty Colonies", "minecolonies.config.disableemptycolonies.comment": "Will stop empty colonies from being generated in the world - Needs world Reload", "minecolonies.config.averageemptycolonydistance": "Average Empty Colony Distance - Needs Complete Restart",