diff --git a/src/com/ryandw11/structure/CustomStructures.java b/src/com/ryandw11/structure/CustomStructures.java index 91a11bf..c367225 100644 --- a/src/com/ryandw11/structure/CustomStructures.java +++ b/src/com/ryandw11/structure/CustomStructures.java @@ -2,21 +2,12 @@ import java.io.File; import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.StandardCopyOption; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Objects; +import java.util.*; import com.ryandw11.structure.loottables.customitems.CustomItemManager; -import com.ryandw11.structure.structure.Structure; import com.ryandw11.structure.structure.StructureBuilder; import com.ryandw11.structure.structure.StructureHandler; -import com.ryandw11.structure.structure.properties.StructureLimitations; -import com.ryandw11.structure.structure.properties.StructureLocation; -import com.ryandw11.structure.structure.properties.StructureProperties; -import com.ryandw11.structure.structure.properties.StructureYSpawning; +import com.ryandw11.structure.structure.properties.*; import com.ryandw11.structure.utils.RandomCollection; import org.bukkit.Bukkit; import org.bukkit.configuration.ConfigurationSection; @@ -228,9 +219,9 @@ private void updateConfig(){ builder.setChance(section.getInt("Chance.Number"), section.getInt("Chance.OutOf")); if(section.contains("whitelistSpawnBlocks")) - builder.setStructureLimitations(new StructureLimitations(section.getStringList("whitelistSpawnBlocks"))); + builder.setStructureLimitations(new StructureLimitations(section.getStringList("whitelistSpawnBlocks"), new BlockLevelLimit(), new HashMap<>())); else - builder.setStructureLimitations(new StructureLimitations(new ArrayList<>())); + builder.setStructureLimitations(new StructureLimitations(new ArrayList<>(), new BlockLevelLimit(), new HashMap<>())); StructureLocation structLocation = new StructureLocation(); if(section.contains("AllowedWorlds") && section.contains("AllWorlds")){ diff --git a/src/com/ryandw11/structure/SchematicHandeler.java b/src/com/ryandw11/structure/SchematicHandeler.java index 132f7ca..1f50819 100644 --- a/src/com/ryandw11/structure/SchematicHandeler.java +++ b/src/com/ryandw11/structure/SchematicHandeler.java @@ -2,6 +2,7 @@ import java.io.File; import java.io.FileInputStream; +import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -9,16 +10,18 @@ import com.ryandw11.structure.structure.Structure; import com.ryandw11.structure.utils.GetBlocksInArea; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.block.BlockState; -import org.bukkit.block.Chest; -import org.bukkit.block.Container; -import org.bukkit.block.DoubleChest; -import org.bukkit.block.Sign; +import com.sk89q.worldedit.IncompleteRegionException; +import com.sk89q.worldedit.bukkit.WorldEditPlugin; +import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard; +import com.sk89q.worldedit.extent.clipboard.io.*; +import com.sk89q.worldedit.function.operation.ForwardExtentCopy; +import com.sk89q.worldedit.internal.annotation.Selection; +import com.sk89q.worldedit.regions.CuboidRegion; +import com.sk89q.worldedit.regions.Region; +import org.bukkit.*; +import org.bukkit.block.*; import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; import org.bukkit.inventory.BrewerInventory; import org.bukkit.inventory.FurnaceInventory; import org.bukkit.inventory.Inventory; @@ -33,9 +36,6 @@ import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.extent.clipboard.Clipboard; -import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat; -import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats; -import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.operation.Operations; import com.sk89q.worldedit.math.BlockVector3; @@ -109,7 +109,7 @@ public void schemHandle(Location loc, String filename, boolean useAir, RandomCol //Schedule the signs & containers replacement task int finalRotY = rotY; - List containersAndSignsLocations = getContainersAndSignsLocations(ch.getClipboard(), loc, finalRotY); + List containersAndSignsLocations = getContainersAndSignsLocations(ch.getClipboard(), loc, finalRotY, structure); for (Location location : containersAndSignsLocations) { if (location.getBlock().getState() instanceof Container) { replaceContainerContent(lootTables, location); @@ -117,7 +117,44 @@ public void schemHandle(Location loc, String filename, boolean useAir, RandomCol replaceSignWithMob(location); } } + } + + /** + * Create a schematic and save it to the schematics folder in the CustomStructures plugin. + * @param name The name of the schematic. + * @param player The player. + * @param w The world + * @return If the operation was successful. + */ + public boolean createSchematic(String name, Player player, World w) { + try{ + WorldEditPlugin worldEditPlugin = (WorldEditPlugin) Bukkit.getServer().getPluginManager().getPlugin("WorldEdit"); + assert worldEditPlugin != null; + Region selection = worldEditPlugin.getSession(player).getSelection(BukkitAdapter.adapt(w)); + CuboidRegion region = new CuboidRegion(selection.getWorld(), selection.getMinimumPoint(), selection.getMaximumPoint()); + BlockArrayClipboard clipboard = new BlockArrayClipboard(region); + + try (EditSession editSession = WorldEdit.getInstance().getEditSessionFactory().getEditSession(selection.getWorld(), -1)) { + ForwardExtentCopy forwardExtentCopy = new ForwardExtentCopy( + editSession, region, clipboard, region.getMinimumPoint() + ); + // configure here + Operations.complete(forwardExtentCopy); + } catch (WorldEditException e) { + e.printStackTrace(); + } + File file = new File(plugin.getDataFolder() + File.separator + "schematics" + File.separator + name + ".schem"); + + try (ClipboardWriter writer = BuiltInClipboardFormat.SPONGE_SCHEMATIC.getWriter(new FileOutputStream(file))) { + writer.write(clipboard); + } catch (IOException e) { + e.printStackTrace(); + } + return true; + } catch (IncompleteRegionException ex){ + return false; + } } /** @@ -128,7 +165,7 @@ public void schemHandle(Location loc, String filename, boolean useAir, RandomCol * @param rotation The rotate value (in degrees). * @return The list of locations */ - private List getContainersAndSignsLocations(Clipboard clipboard, Location pasteLocation, int rotation) { + private List getContainersAndSignsLocations(Clipboard clipboard, Location pasteLocation, int rotation, Structure structure) { BlockVector3 originalOrigin = clipboard.getOrigin(); BlockVector3 originalMinimumPoint = clipboard.getRegion().getMinimumPoint(); @@ -150,6 +187,7 @@ private List getContainersAndSignsLocations(Clipboard clipboard, Locat List locations = new ArrayList<>(); for (Location location : GetBlocksInArea.getLocationListBetween(minLoc, maxLoc)) { + Block block = location.getBlock(); BlockState blockState = location.getBlock().getState(); if (blockState instanceof Container) { @@ -184,6 +222,14 @@ private List getContainersAndSignsLocations(Clipboard clipboard, Locat } } else if (blockState instanceof Sign) { locations.add(location); + }else{ + // For the block replacement system. + if(!structure.getStructureLimitations().getBlockReplacement().isEmpty()){ + if(structure.getStructureLimitations().getBlockReplacement().containsKey(block.getType())){ + block.setType(structure.getStructureLimitations().getBlockReplacement().get(block.getType())); + block.getState().update(); + } + } } }// return locations; @@ -192,9 +238,9 @@ private List getContainersAndSignsLocations(Clipboard clipboard, Locat /** * Checks to see if a location is not already inside of a list of locations. * - * @param locations - * @param location - * @return + * @param locations The list of locations. + * @param location The location to check + * @return If it is not already in. */ private boolean isNotAlreadyIn(List locations, Location location) { for (Location auxLocation : locations) { @@ -208,8 +254,8 @@ private boolean isNotAlreadyIn(List locations, Location location) { /** * Replace the contents of a container with the loottable. * - * @param lootTables - * @param location + * @param lootTables The loot table + * @param location The location of the container. */ private void replaceContainerContent(RandomCollection lootTables, Location location) { if(lootTables.isEmpty()) return; @@ -234,7 +280,7 @@ private void replaceContainerContent(RandomCollection lootTables, Loc /** * Spawn a mob with the signs. * - * @param location + * @param location The location of the sign. */ private void replaceSignWithMob(Location location) { Sign sign = (Sign) location.getBlock().getState(); diff --git a/src/com/ryandw11/structure/commands/SCommand.java b/src/com/ryandw11/structure/commands/SCommand.java index 3cd079a..eb64429 100644 --- a/src/com/ryandw11/structure/commands/SCommand.java +++ b/src/com/ryandw11/structure/commands/SCommand.java @@ -1,5 +1,6 @@ package com.ryandw11.structure.commands;; +import com.ryandw11.structure.SchematicHandeler; import com.ryandw11.structure.structure.Structure; import org.bukkit.ChatColor; import org.bukkit.Material; @@ -133,6 +134,31 @@ public boolean onCommand(CommandSender sender, Command cmd, String s, String[] a } p.getInventory().addItem(item); p.sendMessage(ChatColor.GREEN + "Successfully retrieved that item!"); + }else if(args.length == 1 && args[0].equalsIgnoreCase("createschem")){ + if(!sender.hasPermission("customstructures.createschematic")){ + sender.sendMessage(ChatColor.RED + "You do not have permission for this command!"); + return true; + } + sender.sendMessage(ChatColor.RED + "You must specify the name in order to create a schematic."); + } + else if(args.length == 2 && args[0].equalsIgnoreCase("createschem")){ + if(!sender.hasPermission("customstructures.createschematic")){ + sender.sendMessage(ChatColor.RED + "You do not have permission for this command!"); + return true; + } + if(!(sender instanceof Player)){ + sender.sendMessage(ChatColor.RED + "This command is for players only!"); + return true; + } + Player p = (Player) sender; + String name = args[1]; + SchematicHandeler handeler = new SchematicHandeler(); + if(handeler.createSchematic(name, p, p.getWorld())){ + p.sendMessage(ChatColor.GREEN + "Successfully created a schematic with the name of " + ChatColor.GOLD + name + ChatColor.GREEN + "!"); + p.sendMessage(ChatColor.GREEN + "You can now use " + ChatColor.GOLD + name + ".schem" + ChatColor.GREEN + " in a structure."); + }else{ + p.sendMessage(ChatColor.RED + "The world edit region seems to be incomplete! Try making a selection first!"); + } } else { if (sender.hasPermission("customstructures.info")) { @@ -144,7 +170,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String s, String[] a sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&3Github wiki:&2 https://github.com/ryandw11/CustomStructures/wiki")); sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&3Commands:")); - sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&3/cs reload - &2Reload the plugin.")); + sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&3/cstructure reload - &2Reload the plugin.")); sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&3/cstructure test (name) - &2Paste the defined structure.")); sender.sendMessage(ChatColor.translateAlternateColorCodes('&', @@ -155,6 +181,8 @@ public boolean onCommand(CommandSender sender, Command cmd, String s, String[] a "&3/cstructure checkKey - &2Get the key of an item you are holding in your hand.")); sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&3/cstructure getItem {key} - &2Get the item of the key specified.")); + sender.sendMessage(ChatColor.translateAlternateColorCodes('&', + "&3/cstructure createschem {name} - &2Create a schematic from the current worldedit selection (This is automatically save to the CustomStructures schematic folder).")); } else { sender.sendMessage(ChatColor.RED + "You do not have permission for this command."); } diff --git a/src/com/ryandw11/structure/loottables/LootTable.java b/src/com/ryandw11/structure/loottables/LootTable.java index 294fe3f..9888475 100644 --- a/src/com/ryandw11/structure/loottables/LootTable.java +++ b/src/com/ryandw11/structure/loottables/LootTable.java @@ -7,7 +7,6 @@ import java.util.List; import java.util.Map; -import org.bukkit.Bukkit; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.file.FileConfiguration; @@ -50,7 +49,6 @@ private void loadItems() { if(lootTablesFC.getString("Items." + itemID + ".Type").equalsIgnoreCase("CUSTOM")){ int amount = this.lootTablesFC.getInt("Items." + itemID + ".Amount"); int weight = this.lootTablesFC.getInt("Items." + itemID + ".Weight"); - Bukkit.getLogger().info(itemID); ItemStack item = CustomStructures.getInstance().getCustomItemManager().getItem(this.lootTablesFC.getString("Items." + itemID + ".Key")); if(item == null){ CustomStructures.getInstance().getLogger().warning("Cannot find a custom item with the id of " + itemID + diff --git a/src/com/ryandw11/structure/structure/properties/BlockLevelLimit.java b/src/com/ryandw11/structure/structure/properties/BlockLevelLimit.java new file mode 100644 index 0000000..c0970f4 --- /dev/null +++ b/src/com/ryandw11/structure/structure/properties/BlockLevelLimit.java @@ -0,0 +1,58 @@ +package com.ryandw11.structure.structure.properties; + +import org.bukkit.configuration.file.FileConfiguration; + +public class BlockLevelLimit { + private String mode; + + private int x1, z1, x2, z2; + + public BlockLevelLimit(String mode, int x1, int z1, int x2, int z2){ + this.mode = mode; + this.x1 = x1; + this.z1 = z1; + this.x2 = x2; + this.z2 = z2; + } + + public BlockLevelLimit(){ + mode = "NONE"; + } + + public BlockLevelLimit(FileConfiguration fileConfiguration){ + if(!fileConfiguration.contains("StructureLimitations.BlockLevelLimit")){ + mode = "NONE"; + return; + } + + this.mode = fileConfiguration.getString("StructureLimitations.BlockLevelLimit.mode"); + this.x1 = fileConfiguration.getInt("StructureLimitations.BlockLevelLimit.cornerOne.x"); + this.z1 = fileConfiguration.getInt("StructureLimitations.BlockLevelLimit.cornerOne.z"); + this.x2 = fileConfiguration.getInt("StructureLimitations.BlockLevelLimit.cornerTwo.x"); + this.z2 = fileConfiguration.getInt("StructureLimitations.BlockLevelLimit.cornerTwo.z"); + } + + public boolean isEnabled(){ + return mode.equalsIgnoreCase("none"); + } + + public String getMode(){ + return mode; + } + + public int getX1(){ + return x1; + } + + public int getX2(){ + return x2; + } + + public int getZ1(){ + return z1; + } + + public int getZ2(){ + return z2; + } +} diff --git a/src/com/ryandw11/structure/structure/properties/StructureLimitations.java b/src/com/ryandw11/structure/structure/properties/StructureLimitations.java index d3bff05..e29818f 100644 --- a/src/com/ryandw11/structure/structure/properties/StructureLimitations.java +++ b/src/com/ryandw11/structure/structure/properties/StructureLimitations.java @@ -1,24 +1,39 @@ package com.ryandw11.structure.structure.properties; +import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.configuration.file.FileConfiguration; -import java.util.ArrayList; -import java.util.List; +import java.util.*; public class StructureLimitations { private List whitelistSpawnBlocks; + private BlockLevelLimit blockLevelLimit; + private Map blockReplacement; public StructureLimitations(FileConfiguration configuration){ if(!configuration.contains("StructureLimitations.whitelistSpawnBlocks")) whitelistSpawnBlocks = new ArrayList<>(); else whitelistSpawnBlocks = configuration.getStringList("StructureLimitations.whitelistSpawnBlocks"); + + this.blockLevelLimit = new BlockLevelLimit(configuration); + + blockReplacement = new HashMap<>(); + if(configuration.contains("StructureLimitations.replacement_blocks")){ + for(String s : Objects.requireNonNull(configuration.getConfigurationSection("StructureLimitations.replacement_blocks")).getKeys(false)){ + Material firstMaterial = Material.getMaterial(s); + Material secondMaterial = Material.getMaterial(Objects.requireNonNull(configuration.getString("StructureLimitations.replacement_blocks." + s))); + blockReplacement.put(firstMaterial, secondMaterial); + } + } } - public StructureLimitations(List whitelistSpawnBlocks){ + public StructureLimitations(List whitelistSpawnBlocks, BlockLevelLimit blockLevelLimit, Map blockReplacement){ this.whitelistSpawnBlocks = whitelistSpawnBlocks; + this.blockLevelLimit = blockLevelLimit; + this.blockReplacement = blockReplacement; } public List getWhitelistBlocks(){ @@ -33,4 +48,12 @@ public boolean hasBlock(Block b){ } return false; } + + public BlockLevelLimit getBlockLevelLimit(){ + return blockLevelLimit; + } + + public Map getBlockReplacement(){ + return blockReplacement; + } } diff --git a/src/com/ryandw11/structure/utils/StructurePicker.java b/src/com/ryandw11/structure/utils/StructurePicker.java index dc22713..714bf4b 100644 --- a/src/com/ryandw11/structure/utils/StructurePicker.java +++ b/src/com/ryandw11/structure/utils/StructurePicker.java @@ -5,6 +5,7 @@ import com.ryandw11.structure.structure.Structure; import com.ryandw11.structure.structure.StructureHandler; +import com.ryandw11.structure.structure.properties.BlockLevelLimit; import com.ryandw11.structure.structure.properties.StructureYSpawning; import org.bukkit.Chunk; import org.bukkit.Material; @@ -44,74 +45,94 @@ public StructurePicker(Block bl, Chunk ch, CustomStructures plugin) { @Override public void run() { - currentStructure++; - if (currentStructure >= structureHandler.getStructures().size()) { - this.cancel(); - return; - } - - Structure structure = structureHandler.getStructure(currentStructure); - StructureYSpawning structureSpawnSettings = structure.getStructureLocation().getSpawnSettings(); + try{ + currentStructure++; + if (currentStructure >= structureHandler.getStructures().size()) { + this.cancel(); + return; + } - // Calculate the chance. - if (!structure.canSpawn(bl, ch)) - return; + Structure structure = structureHandler.getStructure(currentStructure); + StructureYSpawning structureSpawnSettings = structure.getStructureLocation().getSpawnSettings(); + + // Calculate the chance. + if (!structure.canSpawn(bl, ch)) + return; + + // Allows the structure to spawn based on the ocean floor. (If the floor is not found than it just returns with the top of the water). + if (structureSpawnSettings.isOceanFloor()) { + if (bl.getType() == Material.WATER) { + for (int i = bl.getY(); i >= 4; i--) { + if (ch.getBlock(0, i, 0).getType() != Material.WATER) { + bl = ch.getBlock(0, i, 0); + break; + } + } + } + } - // Allows the structure to spawn based on the ocean floor. (If the floor is not found than it just returns with the top of the water). - if (structureSpawnSettings.isOceanFloor()) { - if (bl.getType() == Material.WATER) { - for (int i = bl.getY(); i >= 4; i--) { - if (ch.getBlock(0, i, 0).getType() != Material.WATER) { + // Allows the structures to no longer spawn on plant life. + if (structure.getStructureProperties().isIgnoringPlants() && CSConstants.leafBlocks.contains(bl.getType())) { + for (int i = bl.getY(); i <= 4; i--) { + if (!CSConstants.leafBlocks.contains(ch.getBlock(0, i, 0).getType())) { bl = ch.getBlock(0, i, 0); break; } } } - } - // Allows the structures to no longer spawn on plant life. - if (structure.getStructureProperties().isIgnoringPlants() && CSConstants.leafBlocks.contains(bl.getType())) { - for (int i = bl.getY(); i <= 4; i--) { - if (!CSConstants.leafBlocks.contains(ch.getBlock(0, i, 0).getType())) { - bl = ch.getBlock(0, i, 0); - break; - } + // calculate spawny + if (!structureSpawnSettings.isOceanFloor()) { + bl = ch.getBlock(0, structureSpawnSettings.getHeight(bl.getY()), 0); } - } - - // calculate spawny - if (!structureSpawnSettings.isOceanFloor()) { - bl = ch.getBlock(0, structureSpawnSettings.getHeight(bl.getY()), 0); - } - if (!structure.getStructureLimitations().hasBlock(bl)) - return; + if (!structure.getStructureLimitations().hasBlock(bl)) + return; - // If it can spawn in water - if (!structure.getStructureProperties().canSpawnInWater()) { - if (bl.getType() == Material.WATER) return; - } + // If it can spawn in water + if (!structure.getStructureProperties().canSpawnInWater()) { + if (bl.getType() == Material.WATER) return; + } - // If the structure can spawn in lava - if (!structure.getStructureProperties().canSpawnInLavaLakes()) { - if (bl.getType() == Material.LAVA) return; - } + // If the structure can spawn in lava + if (!structure.getStructureProperties().canSpawnInLavaLakes()) { + if (bl.getType() == Material.LAVA) return; + } - // Now to finally paste the schematic - SchematicHandeler sh = new SchematicHandeler(); - plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () -> { - try { - sh.schemHandle(bl.getLocation(), - structure.getSchematic(), - structure.getStructureProperties().canPlaceAir(), - structure.getLootTables(), - structure); - } catch (IOException | WorldEditException e) { - e.printStackTrace(); + // If the structure can follows block level limit. + if(structure.getStructureLimitations().getBlockLevelLimit().isEnabled()){ + BlockLevelLimit limit = structure.getStructureLimitations().getBlockLevelLimit(); + for(int x = limit.getX1(); x <= limit.getX2(); x++){ + for(int z = limit.getZ1(); z <= limit.getZ2(); z++){ + Block b = ch.getWorld().getBlockAt(x, bl.getY(), z); + if(b.getType() == Material.AIR) return; + } + } } - }); - this.cancel();// return after pasting + // Now to finally paste the schematic + SchematicHandeler sh = new SchematicHandeler(); + plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () -> { + try { + sh.schemHandle(bl.getLocation(), + structure.getSchematic(), + structure.getStructureProperties().canPlaceAir(), + structure.getLootTables(), + structure); + } catch (IOException | WorldEditException e) { + e.printStackTrace(); + } + }); + + this.cancel();// return after pasting + }catch(Exception ex){ + this.cancel(); + plugin.getLogger().severe("An error was encountered during the schematic pasting section."); + plugin.getLogger().severe("The task was stopped for the safety of your server!"); + plugin.getLogger().severe("For more information enable debug mode."); + if(plugin.isDebug()) + ex.printStackTrace(); + } } protected ArrayList getBiomes(String s) { diff --git a/src/config.yml b/src/config.yml index 9dcaa10..dda3cae 100644 --- a/src/config.yml +++ b/src/config.yml @@ -15,49 +15,5 @@ bstats: true #Allow Plugins to delete structures at will. allowDeletion: true -Schematics: - - demo - -Schematics: - #Change the name bellow with what you want. - demo: - #The schematic file. Make sure to include the .schem - Schematic: 'demo.schem' - #What biome this a schematic can spawn in. Change to all for all. - Biome: 'all' - #The chance option - Chance: - #The number that can be picked out of 1000. So if 1 is picked than it spawns. - Number: 1 - #The number that the ratio is out off. - OutOf: 1000 - #If the structure can spawn in all worlds. - AllWorlds: true - #If the above is false then the worlds it can spawn in: - AllowedWorlds: - - world - #The y cord the structure will spawn on. Use top if you want it to be on the surface. - SpawnY: top - #If you want air to be placed. True is air will be placed. False is air won't be placed. - PlaceAir: true - #Ignore stuff like grass and leaves. - ignorePlants: true - #Properties of the structure for the water. - Ocean_Properties: - #If you want the structure to spawn in water or lava. - spawnInLiquid: false - #If the structure picks a spot in the ocean or in a lake it will spawn at the floor of it. - #(SpawnY must be set to top) - useOceanFloor: true - #If the structure should be randomly rotated. - randomRotation: false - #Whitelisted blocks that the structure can spawn on. Remove this list if you do not want a whitelist. - whitelistSpawnBlocks: - - Grass_block - - Dirt - - Stone - - air - #List of lootTables for this Schematic, name and weight - #Weight determines how often it will be chosen out of all the entries in the list. - LootTables: - lootTable: 5 \ No newline at end of file +Structures: + - demo \ No newline at end of file diff --git a/src/structures/demo.yml b/src/structures/demo.yml index c32ebb0..c3cafcd 100644 --- a/src/structures/demo.yml +++ b/src/structures/demo.yml @@ -24,6 +24,7 @@ StructureLimitations: - Stone - air + # This could cause issue with lag depending on how large the search area is. BlockLevelLimit: mode: flat cornerOne: @@ -33,6 +34,11 @@ StructureLimitations: x: -5 z: -5 + # This could cause issues with lag depending on how many blocks you have + # to replace. + replacement_blocks: + 'STONE': 'AIR' + #List of lootTables for this Schematic, name and weight #Weight determines how often it will be chosen out of all the entries in the list. LootTables: