diff --git a/pom.xml b/pom.xml index ae644ea..fe27226 100644 --- a/pom.xml +++ b/pom.xml @@ -55,14 +55,14 @@ 2.0.9 1.21.7-R0.1-SNAPSHOT - 1.21.7-R0.1-SNAPSHOT + 1.21.8-R0.1-SNAPSHOT 3.3.0 ${build.version}-SNAPSHOT -LOCAL - 3.0.1 + 3.2.0 BentoBoxWorld_Boxed bentobox-world @@ -183,6 +183,12 @@ ${spigot.version} provided + + org.spigotmc...... + spigot + 1.21.7-R0.1-SNAPSHOT + provided + org.spigotmc..... spigot diff --git a/src/main/java/world/bentobox/boxed/Settings.java b/src/main/java/world/bentobox/boxed/Settings.java index ca20d18..06240b7 100644 --- a/src/main/java/world/bentobox/boxed/Settings.java +++ b/src/main/java/world/bentobox/boxed/Settings.java @@ -86,6 +86,10 @@ public class Settings implements WorldSettings { @ConfigComment("Other plugins may override this setting") @ConfigEntry(path = "world.difficulty") private Difficulty difficulty = Difficulty.NORMAL; + + @ConfigComment("Allow structures to generate in the seed world") + @ConfigEntry(path = "world.allow-structures") + private boolean allowStructures; @ConfigComment("Spawn limits. These override the limits set in bukkit.yml") @ConfigComment("If set to a negative number, the server defaults will be used") @@ -1801,4 +1805,15 @@ public void setDisallowTeamMemberIslands(boolean disallowTeamMemberIslands) { this.disallowTeamMemberIslands = disallowTeamMemberIslands; } + public boolean isAllowStructures() { + return allowStructures; + } + + /** + * @param allowStructures the allowStructures to set + */ + public void setAllowStructures(boolean allowStructures) { + this.allowStructures = allowStructures; + } + } diff --git a/src/main/java/world/bentobox/boxed/generators/chunks/AbstractBoxedChunkGenerator.java b/src/main/java/world/bentobox/boxed/generators/chunks/AbstractBoxedChunkGenerator.java index 421ee44..766580a 100644 --- a/src/main/java/world/bentobox/boxed/generators/chunks/AbstractBoxedChunkGenerator.java +++ b/src/main/java/world/bentobox/boxed/generators/chunks/AbstractBoxedChunkGenerator.java @@ -136,8 +136,7 @@ public boolean shouldGenerateMobs() { @Override public boolean shouldGenerateStructures() { - return false; - //return this.addon.getSettings().isAllowStructures(); + return this.addon.getSettings().isAllowStructures(); } } diff --git a/src/main/java/world/bentobox/boxed/nms/v1_21_8_R0_1_SNAPSHOT/GetMetaData.java b/src/main/java/world/bentobox/boxed/nms/v1_21_8_R0_1_SNAPSHOT/GetMetaData.java new file mode 100644 index 0000000..0c8f3ff --- /dev/null +++ b/src/main/java/world/bentobox/boxed/nms/v1_21_8_R0_1_SNAPSHOT/GetMetaData.java @@ -0,0 +1,22 @@ +package world.bentobox.boxed.nms.v1_21_8_R0_1_SNAPSHOT; + +import org.bukkit.Location; +import org.bukkit.block.Block; +import org.bukkit.craftbukkit.v1_21_R5.CraftWorld; + +import net.minecraft.core.BlockPosition; +import net.minecraft.world.level.block.entity.TileEntity; +import world.bentobox.boxed.nms.AbstractMetaData; + +public class GetMetaData extends AbstractMetaData { + + @Override + public String nmsData(Block block) { + Location w = block.getLocation(); + CraftWorld cw = (CraftWorld) w.getWorld(); // CraftWorld is NMS one + // for 1.13+ (we have use WorldServer) + TileEntity te = cw.getHandle().c_(new BlockPosition(w.getBlockX(), w.getBlockY(), w.getBlockZ())); + return getData(te, "getUpdatePacket", "tag"); + } + +} \ No newline at end of file diff --git a/src/main/resources/locales/en-US.yml b/src/main/resources/locales/en-US.yml index 437a1f5..caca989 100755 --- a/src/main/resources/locales/en-US.yml +++ b/src/main/resources/locales/en-US.yml @@ -898,7 +898,7 @@ boxed: saved: '&a Placed and saved to structures.yml' failed: '&c Could not be saved to structures.yml. Check console for error' unknown: '&c Unknown parameter: [label]' - undo-success: '&a Undone. Some changes cannot be undone.'' + undo-success: '&a Undone. Some changes cannot be undone.' island: go: parameters: '[home number]'