mirror of
https://github.com/BentoBoxWorld/Boxed.git
synced 2025-01-20 20:51:27 +01:00
Register custom structures
This commit is contained in:
parent
7047565dca
commit
e4e7106613
1
src/.gitignore
vendored
Normal file
1
src/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/.DS_Store
|
@ -1,9 +1,7 @@
|
||||
package world.bentobox.boxed.listeners;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
@ -108,7 +106,8 @@ public class NewAreaListener implements Listener {
|
||||
addon.saveResource("structures/" + js + ".nbt", false);
|
||||
File structureFile = new File(addon.getDataFolder(), "structures/" + js + ".nbt");
|
||||
try {
|
||||
Bukkit.getStructureManager().loadStructure(structureFile);
|
||||
Structure s = Bukkit.getStructureManager().loadStructure(structureFile);
|
||||
Bukkit.getStructureManager().registerStructure(NamespacedKey.fromString("minecraft:boxed/" + js), s);
|
||||
addon.log("Loaded " + js + ".nbt");
|
||||
} catch (IOException e) {
|
||||
addon.logError("Error trying to load " + structureFile.getAbsolutePath());
|
||||
|
Loading…
Reference in New Issue
Block a user