diff --git a/src/main/java/ninja/bytecode/iris/Iris.java b/src/main/java/ninja/bytecode/iris/Iris.java index a4b8910ab..573df929d 100644 --- a/src/main/java/ninja/bytecode/iris/Iris.java +++ b/src/main/java/ninja/bytecode/iris/Iris.java @@ -31,7 +31,6 @@ import org.bukkit.util.Vector; import com.google.gson.Gson; import ninja.bytecode.iris.generator.IrisChunkGenerator; -import ninja.bytecode.iris.legacy.GenObject; import ninja.bytecode.iris.object.IrisBiome; import ninja.bytecode.iris.object.IrisDimension; import ninja.bytecode.iris.object.IrisObject; @@ -53,8 +52,6 @@ import ninja.bytecode.iris.wand.WandController; import ninja.bytecode.shuriken.collections.KList; import ninja.bytecode.shuriken.collections.KMap; import ninja.bytecode.shuriken.execution.J; -import ninja.bytecode.shuriken.execution.TaskExecutor; -import ninja.bytecode.shuriken.execution.TaskExecutor.TaskGroup; import ninja.bytecode.shuriken.format.Form; import ninja.bytecode.shuriken.json.JSONException; import ninja.bytecode.shuriken.json.JSONObject; @@ -219,52 +216,6 @@ public class Iris extends JavaPlugin implements BoardProvider if(args.length >= 1) { - if(args[0].equalsIgnoreCase("convert") && args.length == 1) - { - File folder = new File(getDataFolder(), "convert"); - - if(folder.exists() && folder.isDirectory()) - { - KList objects = new KList<>(); - lookForObjects(folder, objects); - TaskExecutor tx = new TaskExecutor(32, Thread.MIN_PRIORITY, "Iris Converter"); - TaskGroup g = tx.startWork(); - info("Converting " + Form.f(objects.size()) + " Objects"); - O max = new O().set(objects.size()); - O at = new O().set(0); - for(File i : objects) - { - g.queue(() -> - { - try - { - IrisObject o = GenObject.loadAsModern(i); - File ff = new File(i.getParentFile(), o.getLoadKey() + ".iob"); - - o.write(new File(i.getParentFile(), o.getLoadKey() + ".iob")); - - Iris.info("Converting [" + at.get() + " of " + max.get() + "]: " + i.getName() + " to " + ff.getName()); - } - - catch(Throwable e) - { - e.printStackTrace(); - error("Failed to convert " + i.getName()); - } - - i.delete(); - at.set(at.get() + 1); - }); - } - - J.a(() -> - { - g.execute(); - Iris.info("Done!"); - }); - } - } - if(args[0].equalsIgnoreCase("goto") && args.length == 2) { if(sender instanceof Player) @@ -567,7 +518,6 @@ public class Iris extends JavaPlugin implements BoardProvider imsg(sender, "/iris wand l1 - Set wand pos 1 where looking"); imsg(sender, "/iris wand l2 - Set wand pos 2 where looking"); } - } if(args[0].equalsIgnoreCase("save") && args.length >= 2) @@ -578,6 +528,7 @@ public class Iris extends JavaPlugin implements BoardProvider { o.write(new File(getDataFolder(), "objects/" + args[1] + ".iob")); imsg(sender, "Saved " + "objects/" + args[1] + ".iob"); + ((Player) sender).getWorld().playSound(((Player) sender).getLocation(), Sound.BLOCK_ENCHANTMENT_TABLE_USE, 1f, 1.5f); } catch(IOException e) @@ -613,6 +564,8 @@ public class Iris extends JavaPlugin implements BoardProvider { o.read(new File(getDataFolder(), "objects/" + args[1] + ".iob")); imsg(sender, "Loaded " + "objects/" + args[1] + ".iob"); + + ((Player) sender).getWorld().playSound(((Player) sender).getLocation(), Sound.BLOCK_ENCHANTMENT_TABLE_USE, 1f, 1.5f); Location block = ((Player) sender).getTargetBlock((Set) null, 256).getLocation().clone().add(0, 1, 0); if(intoWand && WandController.isWand(wand)) @@ -716,25 +669,6 @@ public class Iris extends JavaPlugin implements BoardProvider return false; } - private void lookForObjects(File folder, KList objects) - { - if(folder.isDirectory()) - { - for(File i : folder.listFiles()) - { - if(i.isDirectory()) - { - lookForObjects(i, objects); - } - - if(i.getName().endsWith(".ish")) - { - objects.add(i); - } - } - } - } - public void imsg(CommandSender s, String msg) { s.sendMessage(ChatColor.GREEN + "[" + ChatColor.DARK_GRAY + "Iris" + ChatColor.GREEN + "]" + ChatColor.GRAY + ": " + msg); diff --git a/src/main/java/ninja/bytecode/iris/generator/BiomeChunkGenerator.java b/src/main/java/ninja/bytecode/iris/generator/BiomeChunkGenerator.java index 820b6d5c2..e9fed2c8d 100644 --- a/src/main/java/ninja/bytecode/iris/generator/BiomeChunkGenerator.java +++ b/src/main/java/ninja/bytecode/iris/generator/BiomeChunkGenerator.java @@ -11,6 +11,7 @@ import ninja.bytecode.iris.layer.GenLayerBiome; import ninja.bytecode.iris.object.InferredType; import ninja.bytecode.iris.object.IrisBiome; import ninja.bytecode.iris.object.IrisBiomeGeneratorLink; +import ninja.bytecode.iris.object.IrisDimension; import ninja.bytecode.iris.object.IrisGenerator; import ninja.bytecode.iris.object.IrisRegion; import ninja.bytecode.iris.util.BiomeResult; @@ -28,18 +29,22 @@ import ninja.bytecode.shuriken.math.M; public abstract class BiomeChunkGenerator extends DimensionChunkGenerator { protected ReentrantLock regLock; - protected KMap generators; + private KMap generators; + private KMap ceilingGenerators; protected GenLayerBiome glBiome; protected CNG masterFracture; - protected KMap biomeHitCache; + private KMap biomeHitCache; + private KMap ceilingBiomeHitCache; protected ChronoLatch cwarn = new ChronoLatch(1000); public BiomeChunkGenerator(String dimensionName) { super(dimensionName); generators = new KMap<>(); + ceilingGenerators = new KMap<>(); regLock = new ReentrantLock(); biomeHitCache = new KMap<>(); + ceilingBiomeHitCache = new KMap<>(); } public void onInit(World world, RNG rng) @@ -49,15 +54,24 @@ public abstract class BiomeChunkGenerator extends DimensionChunkGenerator masterFracture = CNG.signature(rng.nextParallelRNG(13)).scale(0.12); } + public KMap getBiomeHitCache() + { + return getDimension().isInverted() ? ceilingBiomeHitCache : biomeHitCache; + } + + @Override public void onHotloaded() { + super.onHotloaded(); biomeHitCache = new KMap<>(); - generators.clear(); + ceilingBiomeHitCache = new KMap<>(); loadGenerators(); } - public void registerGenerator(IrisGenerator g) + public void registerGenerator(IrisGenerator g, IrisDimension dim) { + KMap generators = dim.isInverted() ? ceilingGenerators : this.generators; + regLock.lock(); if(g.getLoadKey() == null || generators.containsKey(g.getLoadKey())) { @@ -69,11 +83,16 @@ public abstract class BiomeChunkGenerator extends DimensionChunkGenerator generators.put(g.getLoadKey(), g); } + protected KMap getGenerators() + { + return getDimension().isInverted() ? ceilingGenerators : generators; + } + protected double getBiomeHeight(double rx, double rz) { double h = 0; - for(IrisGenerator i : generators.values()) + for(IrisGenerator i : getGenerators().values()) { h += interpolateGenerator(rx, rz, i); } @@ -118,10 +137,23 @@ public abstract class BiomeChunkGenerator extends DimensionChunkGenerator protected void loadGenerators() { + generators.clear(); + ceilingGenerators.clear(); + loadGenerators(((CeilingChunkGenerator) this).getFloorDimension()); + loadGenerators(((CeilingChunkGenerator) this).getCeilingDimension()); + } + + protected void loadGenerators(IrisDimension dim) + { + if(dim == null) + { + return; + } + KList touch = new KList<>(); KList loadQueue = new KList<>(); - for(String i : getDimension().getRegions()) + for(String i : dim.getRegions()) { IrisRegion r = Iris.data.getRegionLoader().load(i); @@ -141,7 +173,7 @@ public abstract class BiomeChunkGenerator extends DimensionChunkGenerator { touch.add(next); IrisBiome biome = Iris.data.getBiomeLoader().load(next); - biome.getGenerators().forEach((i) -> registerGenerator(i.getCachedGenerator())); + biome.getGenerators().forEach((i) -> registerGenerator(i.getCachedGenerator(), dim)); loadQueue.addAll(biome.getChildren()); } } @@ -188,16 +220,16 @@ public abstract class BiomeChunkGenerator extends DimensionChunkGenerator ChunkPosition pos = new ChunkPosition(x, z); - if(biomeHitCache.containsKey(pos)) + if(getBiomeHitCache().containsKey(pos)) { - return biomeHitCache.get(pos); + return getBiomeHitCache().get(pos); } double wx = getModifiedX(x, z); double wz = getModifiedZ(x, z); IrisRegion region = glBiome.getRegion(wx, wz); BiomeResult res = glBiome.generateRegionData(wx, wz, x, z, region); - biomeHitCache.put(pos, res); + getBiomeHitCache().put(pos, res); return res; } diff --git a/src/main/java/ninja/bytecode/iris/generator/CeilingChunkGenerator.java b/src/main/java/ninja/bytecode/iris/generator/CeilingChunkGenerator.java new file mode 100644 index 000000000..3296ebadf --- /dev/null +++ b/src/main/java/ninja/bytecode/iris/generator/CeilingChunkGenerator.java @@ -0,0 +1,129 @@ +package ninja.bytecode.iris.generator; + +import org.bukkit.Material; +import org.bukkit.block.data.BlockData; + +import ninja.bytecode.iris.Iris; +import ninja.bytecode.iris.object.IrisDimension; +import ninja.bytecode.iris.util.InvertedBiomeGrid; +import ninja.bytecode.iris.util.RNG; + +public abstract class CeilingChunkGenerator extends ParallaxChunkGenerator +{ + protected boolean generatingCeiling = false; + + public CeilingChunkGenerator(String dimensionName, int threads) + { + super(dimensionName, threads); + } + + @Override + protected void onGenerate(RNG random, int x, int z, ChunkData data, BiomeGrid grid) + { + targetFloor(); + generate(random, x, z, data, grid); + + if(getFloorDimension().isMirrorCeiling()) + { + writeInverted(copy(data), data); + } + + else if(getCeilingDimension() != null) + { + ChunkData ceiling = createChunkData(world); + InvertedBiomeGrid ceilingGrid = new InvertedBiomeGrid(grid); + targetCeiling(); + generate(random, x, z, ceiling, ceilingGrid); + writeInverted(ceiling, data); + } + } + + private void targetFloor() + { + generatingCeiling = false; + } + + private void targetCeiling() + { + generatingCeiling = true; + } + + private void generate(RNG random, int x, int z, ChunkData ceiling, BiomeGrid grid) + { + super.onGenerate(random, x, z, ceiling, grid); + } + + @Override + public IrisDimension getDimension() + { + return generatingCeiling ? getCeilingDimension() : getFloorDimension(); + } + + public IrisDimension getFloorDimension() + { + return super.getDimension(); + } + + public IrisDimension getCeilingDimension() + { + if(getFloorDimension().getCeiling().isEmpty()) + { + return null; + } + + IrisDimension c = Iris.data.getDimensionLoader().load(getFloorDimension().getCeiling()); + + if(c != null) + { + c.setInverted(true); + } + + return c; + } + + public void writeInverted(ChunkData data, ChunkData into) + { + for(int i = 0; i < 16; i++) + { + for(int j = 0; j < data.getMaxHeight(); j++) + { + for(int k = 0; k < 16; k++) + { + BlockData b = data.getBlockData(i, j, k); + + if(b == null || b.getMaterial().equals(Material.AIR)) + { + continue; + } + + into.setBlock(i, data.getMaxHeight() - j, k, b); + } + } + } + } + + public ChunkData copy(ChunkData d) + { + ChunkData copy = createChunkData(world); + + for(int i = 0; i < 16; i++) + { + for(int j = 0; j < d.getMaxHeight(); j++) + { + for(int k = 0; k < 16; k++) + { + BlockData b = d.getBlockData(i, j, k); + + if(b == null || b.getMaterial().equals(Material.AIR)) + { + continue; + } + + copy.setBlock(i, j, k, b); + } + } + } + + return copy; + } +} diff --git a/src/main/java/ninja/bytecode/iris/generator/IrisChunkGenerator.java b/src/main/java/ninja/bytecode/iris/generator/IrisChunkGenerator.java index 47f73ad16..ddd4ffe38 100644 --- a/src/main/java/ninja/bytecode/iris/generator/IrisChunkGenerator.java +++ b/src/main/java/ninja/bytecode/iris/generator/IrisChunkGenerator.java @@ -14,7 +14,7 @@ import ninja.bytecode.iris.util.BiomeResult; @Data @EqualsAndHashCode(callSuper = false) -public class IrisChunkGenerator extends ParallaxChunkGenerator implements IrisContext +public class IrisChunkGenerator extends CeilingChunkGenerator implements IrisContext { private Method initLighting; diff --git a/src/main/java/ninja/bytecode/iris/generator/ParallaxChunkGenerator.java b/src/main/java/ninja/bytecode/iris/generator/ParallaxChunkGenerator.java index 66ba7c751..f3cb3815a 100644 --- a/src/main/java/ninja/bytecode/iris/generator/ParallaxChunkGenerator.java +++ b/src/main/java/ninja/bytecode/iris/generator/ParallaxChunkGenerator.java @@ -1,6 +1,7 @@ package ninja.bytecode.iris.generator; import java.io.IOException; +import java.util.concurrent.locks.ReentrantLock; import org.bukkit.World; import org.bukkit.block.data.BlockData; @@ -9,7 +10,9 @@ import lombok.Data; import lombok.EqualsAndHashCode; import ninja.bytecode.iris.Iris; import ninja.bytecode.iris.object.IrisBiome; +import ninja.bytecode.iris.object.IrisDepositGenerator; import ninja.bytecode.iris.object.IrisObjectPlacement; +import ninja.bytecode.iris.object.IrisRegion; import ninja.bytecode.iris.object.atomics.AtomicSliver; import ninja.bytecode.iris.object.atomics.AtomicSliverMap; import ninja.bytecode.iris.object.atomics.AtomicWorldData; @@ -27,13 +30,17 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple { private KMap sliverCache; protected AtomicWorldData parallaxMap; + private KMap ceilingSliverCache; + protected AtomicWorldData ceilingParallaxMap; private MasterLock masterLock; + private ReentrantLock lock = new ReentrantLock(); private int sliverBuffer; public ParallaxChunkGenerator(String dimensionName, int threads) { super(dimensionName, threads); sliverCache = new KMap<>(); + ceilingSliverCache = new KMap<>(); sliverBuffer = 0; masterLock = new MasterLock(); } @@ -41,7 +48,13 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple public void onInit(World world, RNG rng) { super.onInit(world, rng); - parallaxMap = new AtomicWorldData(world); + parallaxMap = new AtomicWorldData(world, "floor"); + ceilingParallaxMap = new AtomicWorldData(world, "ceiling"); + } + + protected KMap getSliverCache() + { + return getDimension().isInverted() ? ceilingSliverCache : sliverCache; } protected void onClose() @@ -51,6 +64,7 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple try { parallaxMap.unloadAll(true); + ceilingParallaxMap.unloadAll(true); } catch(IOException e) @@ -65,6 +79,11 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple return sampleSliver(x, z).getHighestBlock(); } + public int getHighestGround(int x, int z) + { + return sampleSliver(x, z).getHighestGround(); + } + @Override public void set(int x, int y, int z, BlockData d) { @@ -102,6 +121,11 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple return getParallaxChunk(x, z).isWorldGenerated(); } + public AtomicWorldData getParallaxMap() + { + return getDimension().isInverted() ? ceilingParallaxMap : parallaxMap; + } + public AtomicSliverMap getParallaxChunk(int x, int z) { try @@ -121,7 +145,7 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple protected void onPostGenerate(RNG random, int x, int z, ChunkData data, BiomeGrid grid, HeightMap height, BiomeMap biomeMap) { super.onPostGenerate(random, x, z, data, grid, height, biomeMap); - biomeHitCache.clear(); + getBiomeHitCache().clear(); if(getDimension().isPlaceObjects()) { @@ -133,6 +157,8 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple getSliverCache().clear(); getMasterLock().clear(); } + + super.onPostParallaxPostGenerate(random, x, z, data, grid, height, biomeMap); } protected void onGenerateParallax(RNG random, int x, int z) @@ -161,12 +187,39 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple getTx().queue(key, () -> { IrisBiome b = sampleTrueBiome((i * 16) + 7, (j * 16) + 7).getBiome(); + IrisRegion r = sampleRegion((i * 16) + 7, (j * 16) + 7); + RNG ro = random.nextParallelRNG(496888 + i + j); + int g = 1; for(IrisObjectPlacement k : b.getObjects()) { placeObject(k, i, j, random.nextParallelRNG((34 * ((i * 30) + (j * 30) + g++) * i * j) + i - j + 3569222)); } + + for(IrisDepositGenerator k : getDimension().getDeposits()) + { + for(int l = 0; l < ro.i(k.getMinPerChunk(), k.getMaxPerChunk()); l++) + { + k.generate((x * 16) + ro.nextInt(16), (z * 16) + ro.nextInt(16), ro, this); + } + } + + for(IrisDepositGenerator k : r.getDeposits()) + { + for(int l = 0; l < ro.i(k.getMinPerChunk(), k.getMaxPerChunk()); l++) + { + k.generate((x * 16) + ro.nextInt(16), (z * 16) + ro.nextInt(16), ro, this); + } + } + + for(IrisDepositGenerator k : b.getDeposits()) + { + for(int l = 0; l < ro.i(k.getMinPerChunk(), k.getMaxPerChunk()); l++) + { + k.generate((x * 16) + ro.nextInt(16), (z * 16) + ro.nextInt(16), ro, this); + } + } }); getParallaxChunk(ii, jj).setParallaxGenerated(true); @@ -176,7 +229,7 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple getTx().waitFor(key); } - protected void placeObject(IrisObjectPlacement o, int x, int z, RNG rng) + public void placeObject(IrisObjectPlacement o, int x, int z, RNG rng) { for(int i = 0; i < o.getTriesForChunk(rng); i++) { @@ -189,15 +242,21 @@ public abstract class ParallaxChunkGenerator extends TerrainChunkGenerator imple { ChunkPosition key = new ChunkPosition(x, z); - if(sliverCache.containsKey(key)) + if(getSliverCache().containsKey(key)) { - return sliverCache.get(key); + return getSliverCache().get(key); } AtomicSliver s = new AtomicSliver(x & 15, z & 15); onGenerateColumn(x >> 4, z >> 4, x, z, x & 15, z & 15, s, null); - sliverCache.put(key, s); + getSliverCache().put(key, s); return s; } + + @Override + public boolean isPreventingDecay() + { + return getDimension().isPreventLeafDecay(); + } } diff --git a/src/main/java/ninja/bytecode/iris/generator/TerrainChunkGenerator.java b/src/main/java/ninja/bytecode/iris/generator/TerrainChunkGenerator.java index 4ab16d412..1a5cd282c 100644 --- a/src/main/java/ninja/bytecode/iris/generator/TerrainChunkGenerator.java +++ b/src/main/java/ninja/bytecode/iris/generator/TerrainChunkGenerator.java @@ -29,13 +29,12 @@ import ninja.bytecode.shuriken.math.M; public abstract class TerrainChunkGenerator extends ParallelChunkGenerator { protected static final BlockData AIR = Material.AIR.createBlockData(); - protected static final BlockData STONE = Material.STONE.createBlockData(); - protected static final BlockData WATER = Material.WATER.createBlockData(); private KList updateBlocks = new KList<>(); private ReentrantLock relightLock = new ReentrantLock(); private long lastUpdateRequest = M.ms(); private long lastChunkLoad = M.ms(); - private GenLayerCave glCaves; + private GenLayerCave glCave; + private RNG rockRandom; public TerrainChunkGenerator(String dimensionName, int threads) { @@ -45,7 +44,8 @@ public abstract class TerrainChunkGenerator extends ParallelChunkGenerator public void onInit(World world, RNG rng) { super.onInit(world, rng); - glCaves = new GenLayerCave(this, rng); + rockRandom = getMasterRandom().nextParallelRNG(2858678); + glCave = new GenLayerCave(this, rng.nextParallelRNG(238948)); } public void queueUpdate(int x, int y, int z) @@ -130,7 +130,7 @@ public abstract class TerrainChunkGenerator extends ParallelChunkGenerator } } - else + else if(!getDimension().isInverted()) { if(biomeMap != null) { @@ -151,12 +151,12 @@ public abstract class TerrainChunkGenerator extends ParallelChunkGenerator if(underwater) { - block = seaLayers.hasIndex(fluidHeight - k) ? layers.get(depth) : WATER; + block = seaLayers.hasIndex(fluidHeight - k) ? layers.get(depth) : getDimension().getFluid(rockRandom, wx, k, wz); } else { - block = layers.hasIndex(depth) ? layers.get(depth) : STONE; + block = layers.hasIndex(depth) ? layers.get(depth) : getDimension().getRock(rockRandom, wx, k, wz); depth++; } @@ -247,12 +247,22 @@ public abstract class TerrainChunkGenerator extends ParallelChunkGenerator @Override protected void onPostGenerate(RNG random, int x, int z, ChunkData data, BiomeGrid grid, HeightMap height, BiomeMap biomeMap) + { + onPreParallaxPostGenerate(random, x, z, data, grid, height, biomeMap); + } + + protected void onPreParallaxPostGenerate(RNG random, int x, int z, ChunkData data, BiomeGrid grid, HeightMap height, BiomeMap biomeMap) + { + + } + + protected void onPostParallaxPostGenerate(RNG random, int x, int z, ChunkData data, BiomeGrid grid, HeightMap height, BiomeMap biomeMap) { for(int i = 0; i < 16; i++) { for(int j = 0; j < 16; j++) { - glCaves.genCaves((x << 4) + i, (z << 4) + j, i, j, data, height); + glCave.genCaves((x << 4) + i, (z << 4) + j, i, j, data, height); } } } diff --git a/src/main/java/ninja/bytecode/iris/legacy/GenObject.java b/src/main/java/ninja/bytecode/iris/legacy/GenObject.java deleted file mode 100644 index 670d42a8e..000000000 --- a/src/main/java/ninja/bytecode/iris/legacy/GenObject.java +++ /dev/null @@ -1,547 +0,0 @@ -package ninja.bytecode.iris.legacy; - -import java.io.DataInputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.function.Consumer; -import java.util.function.Supplier; -import java.util.zip.GZIPInputStream; - -import org.bukkit.Bukkit; -import org.bukkit.Material; -import org.bukkit.block.BlockFace; -import org.bukkit.block.data.BlockData; -import org.bukkit.material.Directional; -import org.bukkit.material.Ladder; -import org.bukkit.material.MaterialData; -import org.bukkit.material.Stairs; -import org.bukkit.material.Vine; -import org.bukkit.util.BlockVector; -import org.bukkit.util.Vector; - -import ninja.bytecode.iris.Iris; -import ninja.bytecode.iris.object.IrisObject; -import ninja.bytecode.iris.util.Direction; -import ninja.bytecode.iris.util.VectorMath; -import ninja.bytecode.shuriken.collections.KList; -import ninja.bytecode.shuriken.collections.KMap; -import ninja.bytecode.shuriken.execution.J; -import ninja.bytecode.shuriken.logging.L; - -public class GenObject -{ - public static IDLibrary lib = new IDLibrary(); - private boolean centeredHeight; - private int w; - private int h; - private int d; - private int failures; - private int successes; - private boolean gravity; - private String name = "?"; - private KMap s; - private KMap slopeCache; - private KMap gravityCache; - private BlockVector mount; - private int maxslope; - private int baseslope; - private boolean hydrophilic; - private boolean submerged; - private int mountHeight; - private BlockVector shift; - - public GenObject(int w, int h, int d) - { - this.w = w; - this.h = h; - this.d = d; - shift = new BlockVector(); - s = new KMap<>(); - centeredHeight = false; - gravity = false; - maxslope = -1; - baseslope = 0; - hydrophilic = false; - submerged = false; - } - - public void recalculateMountShift() - { - int ly = Integer.MAX_VALUE; - - for(SBlockVector i : s.keySet()) - { - if(i.getY() < ly) - { - ly = (int) i.getY(); - } - } - - KList fmount = new KList<>(); - - for(SBlockVector i : s.keySet()) - { - if(i.getY() == ly) - { - fmount.add(i); - } - } - - double avx[] = new double[fmount.size()]; - double avy[] = new double[fmount.size()]; - double avz[] = new double[fmount.size()]; - int c = 0; - - for(SBlockVector i : fmount) - { - avx[c] = i.getX(); - avy[c] = i.getY(); - avz[c] = i.getZ(); - c++; - } - - mountHeight = avg(avy); - mount = new BlockVector(0, 0, 0); - } - - private KMap getSlopeCache() - { - if(slopeCache == null) - { - computeSlopeCache(); - } - - return slopeCache; - } - - private KMap getGravityCache() - { - if(gravityCache == null) - { - computeGravityCache(); - } - - return gravityCache; - } - - private void computeGravityCache() - { - gravityCache = new KMap<>(); - - for(SBlockVector i : s.keySet()) - { - SChunkVectorShort v = new SChunkVectorShort(i.getX(), i.getZ()); - - if(!gravityCache.containsKey(v) || gravityCache.get(v).getY() > i.getY()) - { - gravityCache.put(v, i); - } - } - } - - private void computeSlopeCache() - { - slopeCache = new KMap<>(); - int low = Integer.MAX_VALUE; - - for(SBlockVector i : s.keySet()) - { - SChunkVectorShort v = new SChunkVectorShort(i.getX(), i.getZ()); - - if(!slopeCache.containsKey(v) || slopeCache.get(v).getY() > i.getY()) - { - slopeCache.put(v, i); - } - } - - for(SChunkVectorShort i : slopeCache.keySet()) - { - int f = (int) slopeCache.get(i).getY(); - - if(f < low) - { - low = f; - } - } - - for(SChunkVectorShort i : slopeCache.k()) - { - int f = (int) slopeCache.get(i).getY(); - - if(f > low - baseslope) - { - slopeCache.remove(i); - } - } - } - - private int avg(double[] v) - { - double g = 0; - - for(int i = 0; i < v.length; i++) - { - g += v[i]; - } - - return (int) Math.round(g / (double) v.length); - } - - public void setCenteredHeight() - { - this.centeredHeight = true; - } - - public int getW() - { - return w; - } - - public int getH() - { - return h; - } - - public int getD() - { - return d; - } - - public KMap getSchematic() - { - return s; - } - - public int getWidth() - { - return w; - } - - public int getDepth() - { - return d; - } - - public void read(InputStream in, boolean gzip) throws IOException - { - @SuppressWarnings("resource") - GZIPInputStream gzi = gzip ? new GZIPInputStream(in) : null; - DataInputStream din = new DataInputStream(gzip ? gzi : in); - readDirect(din); - din.close(); - } - - @SuppressWarnings("deprecation") - public void readDirect(DataInputStream din) throws IOException - { - w = din.readInt(); - h = din.readInt(); - d = din.readInt(); - int l = din.readInt(); - clear(); - - for(int i = 0; i < l; i++) - { - SBlockVector v = new SBlockVector(din.readInt(), din.readInt(), din.readInt()); - int id = din.readInt(); - byte dat = (byte) din.readInt(); - Material mat = IDLibrary.getMaterial(id); - BlockData data = Bukkit.getUnsafe().fromLegacy(Bukkit.getUnsafe().toLegacy(mat), dat); - - if(data != null) - { - s.put(v, data); - } - - else - { - throw new RuntimeException("Failed to convert"); - } - } - } - - public BlockData get(int x, int y, int z) - { - return s.get(new SBlockVector(x, y, z)); - } - - public boolean has(int x, int y, int z) - { - return s.containsKey(new SBlockVector(x, y, z)); - } - - public void put(int x, int y, int z, BlockData mb) - { - s.put(new SBlockVector(x, y, z), mb); - } - - public GenObject copy() - { - GenObject s = new GenObject(w, h, d); - s.fill(this.s); - s.centeredHeight = centeredHeight; - s.name = name; - return s; - } - - public void clear() - { - s.clear(); - } - - public void fill(KMap b) - { - clear(); - s.putAll(b); - } - - public int sh(int g) - { - int m = (g / 2); - return g % 2 == 0 ? m : m + 1; - } - - public static GenObject load(InputStream in) throws IOException - { - GenObject s = new GenObject(1, 1, 1); - s.read(in, true); - - return s; - } - - public static IrisObject loadAsModern(File f) throws IOException - { - GenObject legacy = new GenObject(1, 1, 1); - legacy.name = f.getName().replaceAll("\\Q.ish\\E", ""); - FileInputStream fin = new FileInputStream(f); - legacy.read(fin, true); - - IrisObject object = new IrisObject(legacy.w, legacy.h, legacy.d); - object.setLoadKey(legacy.name); - - for(SBlockVector i : legacy.s.k()) - { - object.getBlocks().put(new BlockVector(i.getX(), i.getY(), i.getZ()), legacy.s.get(i)); - } - - return object; - } - - public static GenObject load(File f) throws IOException - { - GenObject s = new GenObject(1, 1, 1); - s.name = f.getName().replaceAll("\\Q.ish\\E", ""); - FileInputStream fin = new FileInputStream(f); - s.read(fin, true); - - return s; - } - - public String getName() - { - return name; - } - - public void setName(String name) - { - this.name = name; - } - - private byte toGlazedTCDir(BlockFace b) - { - switch(b) - { - case NORTH: - return 0; - case EAST: - return 1; - case SOUTH: - return 2; - case WEST: - return 3; - default: - break; - } - - return 0; - } - - private BlockFace getGlazedTCDir(byte d2) - { - switch(d2) - { - case 0: - return BlockFace.NORTH; - case 1: - return BlockFace.EAST; - case 2: - return BlockFace.SOUTH; - case 3: - return BlockFace.WEST; - } - - return BlockFace.NORTH; - } - - private BlockFace rotate(Direction from, Direction to, BlockFace face) - { - return Direction.getDirection(from.angle(Direction.getDirection(face).toVector(), to)).getFace(); - } - - public double getSuccess() - { - return (double) successes / ((double) successes + (double) failures); - } - - public int getFailures() - { - return failures; - } - - public int getSuccesses() - { - return successes; - } - - public int getPlaces() - { - return successes + failures; - } - - public void dispose() - { - s.clear(); - } - - public void setGravity(boolean gravity) - { - this.gravity = gravity; - } - - public void setShift(int x, int y, int z) - { - shift = new BlockVector(x, y, z); - } - - public boolean isCenteredHeight() - { - return centeredHeight; - } - - public boolean isGravity() - { - return gravity; - } - - public BlockVector getMount() - { - return mount; - } - - public int getMaxslope() - { - return maxslope; - } - - public int getBaseslope() - { - return baseslope; - } - - public boolean isHydrophilic() - { - return hydrophilic; - } - - public boolean isSubmerged() - { - return submerged; - } - - public int getMountHeight() - { - return mountHeight; - } - - public BlockVector getShift() - { - return shift; - } - - public void setCenteredHeight(boolean centeredHeight) - { - this.centeredHeight = centeredHeight; - } - - public void setW(int w) - { - this.w = w; - } - - public void setH(int h) - { - this.h = h; - } - - public void setD(int d) - { - this.d = d; - } - - public void setFailures(int failures) - { - this.failures = failures; - } - - public void setSuccesses(int successes) - { - this.successes = successes; - } - - public void setSlopeCache(KMap slopeCache) - { - this.slopeCache = slopeCache; - } - - public void setGravityCache(KMap gravityCache) - { - this.gravityCache = gravityCache; - } - - public void setMount(BlockVector mount) - { - this.mount = mount; - } - - public void setMaxslope(int maxslope) - { - this.maxslope = maxslope; - } - - public void setBaseslope(int baseslope) - { - this.baseslope = baseslope; - } - - public void setHydrophilic(boolean hydrophilic) - { - this.hydrophilic = hydrophilic; - } - - public void setSubmerged(boolean submerged) - { - this.submerged = submerged; - } - - public void setMountHeight(int mountHeight) - { - this.mountHeight = mountHeight; - } - - public void setShift(BlockVector shift) - { - this.shift = shift; - } -} \ No newline at end of file diff --git a/src/main/java/ninja/bytecode/iris/legacy/IDLibrary.java b/src/main/java/ninja/bytecode/iris/legacy/IDLibrary.java deleted file mode 100644 index 5831e58e6..000000000 --- a/src/main/java/ninja/bytecode/iris/legacy/IDLibrary.java +++ /dev/null @@ -1,276 +0,0 @@ -// -// Decompiled by Procyon v0.5.36 -// - -package ninja.bytecode.iris.legacy; - -import java.util.EnumSet; - -import org.bukkit.Bukkit; -import org.bukkit.Material; -import org.bukkit.inventory.ItemStack; -import org.bukkit.material.MaterialData; -import org.bukkit.plugin.java.JavaPlugin; - -public class IDLibrary -{ - public static final String SEPARATOR = ":"; - private static final String Spawn_Egg_Id = "383"; - private static final int Spawn_Egg_Id_I = Integer.parseInt("383"); - private static final IDList List = new IDList(); - - public static boolean isInt(final String ID) - { - try - { - Integer.parseInt(ID); - return true; - } - catch(Exception e) - { - return false; - } - } - - private static boolean isLegacy() - { - try - { - Material.valueOf("CONDUIT"); - return false; - } - catch(Exception e) - { - return true; - } - } - - public static Material getMaterial(String ID) - { - if(isLegacy()) - { - final ItemStack IS = getItemStack(ID); - return (IS == null) ? null : IS.getType(); - } - ID = ID.replace(" ", "").toUpperCase(); - Material t = List.getMaterial(ID.contains(":") ? ID : (String.valueOf(ID) + ":" + "0")); - if(t != null) - { - return t; - } - try - { - t = Material.valueOf(ID); - if(List.getIDData(t) != null) - { - return t; - } - } - catch(Exception ex) - { - } - if(ID.startsWith("383")) - { - return null; - } - if(!ID.contains(":") && !isInt(ID)) - { - try - { - t = Material.valueOf(ID); - if(t != null) - { - return t; - } - } - catch(Exception ex2) - { - } - } - if(ID.contains(":")) - { - final String[] IDs = ID.split(":"); - try - { - return getMaterial(Integer.parseInt(IDs[0]), Byte.parseByte(IDs[1])); - } - catch(Exception e) - { - final Material m = Material.getMaterial("LEGACY_" + IDs[0], false); - try - { - return (m == null) ? m : getMaterial(m.getId(), Byte.parseByte(IDs[1])); - } - catch(Exception e2) - { - return null; - } - } - } - try - { - return getMaterial(Integer.parseInt(ID)); - } - catch(Exception e3) - { - final Material i = Material.getMaterial("LEGACY_" + ID, false); - return (i == null) ? i : getMaterial(i.getId(), (byte) 0); - } - } - - public static Material getMaterial(final int ID) - { - return getMaterial(ID, (byte) 0); - } - - public static Material getMaterial(final int ID, final byte Data) - { - for(final Material i : EnumSet.allOf(Material.class)) - { - try - { - if(i.getId() == ID) - { - final Material m = Bukkit.getUnsafe().fromLegacy(new MaterialData(i, Data)); - return ((m == Material.AIR && (ID != 0 || Data != 0)) || (Data != 0 && m == Bukkit.getUnsafe().fromLegacy(new MaterialData(i, (byte) 0)))) ? List.getMaterial(String.valueOf(ID) + ":" + Data) : m; - } - continue; - } - catch(IllegalArgumentException ex) - { - } - } - return null; - } - - public static ItemStack getItemStack(String ID) - { - if(isLegacy()) - { - final ItemStack IS = null; - ID = ID.replace(" ", "").toUpperCase(); - if(!ID.contains(":")) - { - ID = String.valueOf(ID) + ":" + "0"; - } - final String[] I = ID.split(":"); - int id = 0; - try - { - id = Integer.parseInt(I[0]); - } - catch(NumberFormatException e) - { - try - { - id = Material.valueOf(I[0]).getId(); - } - catch(IllegalArgumentException e2) - { - return IS; - } - } - try - { - for(final Material i : EnumSet.allOf(Material.class)) - { - if(i.getId() == id) - { - return new ItemStack(i, 1, (short) Integer.parseInt(I[1])); - } - } - } - catch(Exception ex) - { - } - return IS; - } - final Material M = getMaterial(ID); - return (M == null) ? null : new ItemStack(getMaterial(ID), 1); - } - - public static String getIDData(final Material M) - { - final byte d = getData(M); - return String.valueOf(getID(M)) + ((d == 0) ? "" : (":" + d)); - } - - public static int getID(final Material M) - { - if(isLegacy()) - { - M.getId(); - } - final int d = List.getID(M); - if(d != -1) - { - return d; - } - final int i = Bukkit.getUnsafe().toLegacy(M).getId(); - return (i != Spawn_Egg_Id_I && (i != 0 || (i == 0 && M == Material.AIR))) ? i : 0; - } - - public static byte getData(final Material M) - { - if(isLegacy()) - { - return 0; - } - final byte d = List.getData(M); - if(d != -1) - { - return d; - } - final int i = Bukkit.getUnsafe().toLegacy(M).getId(); - return (byte) ((i != Spawn_Egg_Id_I && (i != 0 || (i == 0 && M == Material.AIR))) ? getData(M, i, Bukkit.getUnsafe().toLegacy(M)) : 0); - } - - private static byte getData(final Material M, final int ID, final Material O) - { - for(final Material i : EnumSet.allOf(Material.class)) - { - try - { - if(i.getId() != ID) - { - continue; - } - for(byte i2 = 0; i2 <= 15; ++i2) - { - if(M.equals((Object) Bukkit.getUnsafe().fromLegacy(new MaterialData(i, i2)))) - { - return i2; - } - } - } - catch(IllegalArgumentException ex) - { - } - } - return 0; - } - - public static String getIDData(final ItemStack IS) - { - final byte d = getData(IS); - return String.valueOf(getID(IS)) + ((d == 0) ? "" : (":" + d)); - } - - public static int getID(final ItemStack IS) - { - if(!isLegacy()) - { - return getID(IS.getType()); - } - return IS.getType().getId(); - } - - public static byte getData(final ItemStack IS) - { - if(!isLegacy()) - { - return getData(IS.getType()); - } - return IS.getData().getData(); - } -} diff --git a/src/main/java/ninja/bytecode/iris/legacy/IDList.java b/src/main/java/ninja/bytecode/iris/legacy/IDList.java deleted file mode 100644 index efab3599c..000000000 --- a/src/main/java/ninja/bytecode/iris/legacy/IDList.java +++ /dev/null @@ -1,3003 +0,0 @@ -// -// Decompiled by Procyon v0.5.36 -// - -package ninja.bytecode.iris.legacy; - -import java.util.Iterator; -import java.util.HashMap; -import org.bukkit.Material; -import java.util.Map; - -public class IDList -{ - private final Map list; - - public IDList() - { - this.list = new HashMap(); - try - { - this.list.put("68:0", Material.valueOf("WALL_SIGN")); - } - catch(IllegalArgumentException ex) - { - } - try - { - this.list.put("72:1", Material.valueOf("SPRUCE_PRESSURE_PLATE")); - } - catch(IllegalArgumentException ex2) - { - } - try - { - this.list.put("72:2", Material.valueOf("BIRCH_PRESSURE_PLATE")); - } - catch(IllegalArgumentException ex3) - { - } - try - { - this.list.put("72:3", Material.valueOf("JUNGLE_PRESSURE_PLATE")); - } - catch(IllegalArgumentException ex4) - { - } - try - { - this.list.put("72:4", Material.valueOf("ACACIA_PRESSURE_PLATE")); - } - catch(IllegalArgumentException ex5) - { - } - try - { - this.list.put("72:5", Material.valueOf("DARK_OAK_PRESSURE_PLATE")); - } - catch(IllegalArgumentException ex6) - { - } - try - { - this.list.put("75:0", Material.valueOf("REDSTONE_WALL_TORCH")); - } - catch(IllegalArgumentException ex7) - { - } - try - { - this.list.put("96:1", Material.valueOf("SPRUCE_TRAPDOOR")); - } - catch(IllegalArgumentException ex8) - { - } - try - { - this.list.put("96:2", Material.valueOf("BIRCH_TRAPDOOR")); - } - catch(IllegalArgumentException ex9) - { - } - try - { - this.list.put("96:3", Material.valueOf("JUNGLE_TRAPDOOR")); - } - catch(IllegalArgumentException ex10) - { - } - try - { - this.list.put("96:4", Material.valueOf("ACACIA_TRAPDOOR")); - } - catch(IllegalArgumentException ex11) - { - } - try - { - this.list.put("96:5", Material.valueOf("DARK_OAK_TRAPDOOR")); - } - catch(IllegalArgumentException ex12) - { - } - try - { - this.list.put("104:1", Material.valueOf("ATTACHED_PUMPKIN_STEM")); - } - catch(IllegalArgumentException ex13) - { - } - try - { - this.list.put("105:1", Material.valueOf("ATTACHED_MELON_STEM")); - } - catch(IllegalArgumentException ex14) - { - } - try - { - this.list.put("143:1", Material.valueOf("SPRUCE_BUTTON")); - } - catch(IllegalArgumentException ex15) - { - } - try - { - this.list.put("143:2", Material.valueOf("BIRCH_BUTTON")); - } - catch(IllegalArgumentException ex16) - { - } - try - { - this.list.put("143:3", Material.valueOf("JUNGLE_BUTTON")); - } - catch(IllegalArgumentException ex17) - { - } - try - { - this.list.put("143:4", Material.valueOf("ACACIA_BUTTON")); - } - catch(IllegalArgumentException ex18) - { - } - try - { - this.list.put("143:5", Material.valueOf("DARK_OAK_BUTTON")); - } - catch(IllegalArgumentException ex19) - { - } - try - { - this.list.put("355:0", Material.valueOf("WHITE_BED")); - } - catch(IllegalArgumentException ex20) - { - } - try - { - this.list.put("355:14", Material.valueOf("RED_BED")); - } - catch(IllegalArgumentException ex21) - { - } - try - { - this.list.put("383:0", Material.valueOf("BAT_SPAWN_EGG")); - } - catch(IllegalArgumentException ex22) - { - } - try - { - this.list.put("383:1", Material.valueOf("BLAZE_SPAWN_EGG")); - } - catch(IllegalArgumentException ex23) - { - } - try - { - this.list.put("383:2", Material.valueOf("CAVE_SPIDER_SPAWN_EGG")); - } - catch(IllegalArgumentException ex24) - { - } - try - { - this.list.put("383:3", Material.valueOf("CHICKEN_SPAWN_EGG")); - } - catch(IllegalArgumentException ex25) - { - } - try - { - this.list.put("383:4", Material.valueOf("COD_SPAWN_EGG")); - } - catch(IllegalArgumentException ex26) - { - } - try - { - this.list.put("383:5", Material.valueOf("COW_SPAWN_EGG")); - } - catch(IllegalArgumentException ex27) - { - } - try - { - this.list.put("383:6", Material.valueOf("CREEPER_SPAWN_EGG")); - } - catch(IllegalArgumentException ex28) - { - } - try - { - this.list.put("383:7", Material.valueOf("DOLPHIN_SPAWN_EGG")); - } - catch(IllegalArgumentException ex29) - { - } - try - { - this.list.put("383:8", Material.valueOf("DONKEY_SPAWN_EGG")); - } - catch(IllegalArgumentException ex30) - { - } - try - { - this.list.put("383:9", Material.valueOf("DROWNED_SPAWN_EGG")); - } - catch(IllegalArgumentException ex31) - { - } - try - { - this.list.put("383:10", Material.valueOf("ELDER_GUARDIAN_SPAWN_EGG")); - } - catch(IllegalArgumentException ex32) - { - } - try - { - this.list.put("383:11", Material.valueOf("ENDERMAN_SPAWN_EGG")); - } - catch(IllegalArgumentException ex33) - { - } - try - { - this.list.put("383:12", Material.valueOf("ENDERMITE_SPAWN_EGG")); - } - catch(IllegalArgumentException ex34) - { - } - try - { - this.list.put("383:13", Material.valueOf("EVOKER_SPAWN_EGG")); - } - catch(IllegalArgumentException ex35) - { - } - try - { - this.list.put("383:14", Material.valueOf("GHAST_SPAWN_EGG")); - } - catch(IllegalArgumentException ex36) - { - } - try - { - this.list.put("383:15", Material.valueOf("GUARDIAN_SPAWN_EGG")); - } - catch(IllegalArgumentException ex37) - { - } - try - { - this.list.put("383:16", Material.valueOf("HORSE_SPAWN_EGG")); - } - catch(IllegalArgumentException ex38) - { - } - try - { - this.list.put("383:17", Material.valueOf("HUSK_SPAWN_EGG")); - } - catch(IllegalArgumentException ex39) - { - } - try - { - this.list.put("383:18", Material.valueOf("LLAMA_SPAWN_EGG")); - } - catch(IllegalArgumentException ex40) - { - } - try - { - this.list.put("383:19", Material.valueOf("MAGMA_CUBE_SPAWN_EGG")); - } - catch(IllegalArgumentException ex41) - { - } - try - { - this.list.put("383:20", Material.valueOf("MOOSHROOM_SPAWN_EGG")); - } - catch(IllegalArgumentException ex42) - { - } - try - { - this.list.put("383:21", Material.valueOf("MULE_SPAWN_EGG")); - } - catch(IllegalArgumentException ex43) - { - } - try - { - this.list.put("383:22", Material.valueOf("OCELOT_SPAWN_EGG")); - } - catch(IllegalArgumentException ex44) - { - } - try - { - this.list.put("383:23", Material.valueOf("PARROT_SPAWN_EGG")); - } - catch(IllegalArgumentException ex45) - { - } - try - { - this.list.put("383:24", Material.valueOf("PHANTOM_SPAWN_EGG")); - } - catch(IllegalArgumentException ex46) - { - } - try - { - this.list.put("383:25", Material.valueOf("PIG_SPAWN_EGG")); - } - catch(IllegalArgumentException ex47) - { - } - try - { - this.list.put("383:26", Material.valueOf("POLAR_BEAR_SPAWN_EGG")); - } - catch(IllegalArgumentException ex48) - { - } - try - { - this.list.put("383:27", Material.valueOf("PUFFERFISH_SPAWN_EGG")); - } - catch(IllegalArgumentException ex49) - { - } - try - { - this.list.put("383:28", Material.valueOf("RABBIT_SPAWN_EGG")); - } - catch(IllegalArgumentException ex50) - { - } - try - { - this.list.put("383:29", Material.valueOf("SALMON_SPAWN_EGG")); - } - catch(IllegalArgumentException ex51) - { - } - try - { - this.list.put("383:30", Material.valueOf("SHEEP_SPAWN_EGG")); - } - catch(IllegalArgumentException ex52) - { - } - try - { - this.list.put("383:31", Material.valueOf("SHULKER_SPAWN_EGG")); - } - catch(IllegalArgumentException ex53) - { - } - try - { - this.list.put("383:32", Material.valueOf("SILVERFISH_SPAWN_EGG")); - } - catch(IllegalArgumentException ex54) - { - } - try - { - this.list.put("383:33", Material.valueOf("SKELETON_HORSE_SPAWN_EGG")); - } - catch(IllegalArgumentException ex55) - { - } - try - { - this.list.put("383:34", Material.valueOf("SKELETON_SPAWN_EGG")); - } - catch(IllegalArgumentException ex56) - { - } - try - { - this.list.put("383:35", Material.valueOf("SLIME_SPAWN_EGG")); - } - catch(IllegalArgumentException ex57) - { - } - try - { - this.list.put("383:36", Material.valueOf("SPIDER_SPAWN_EGG")); - } - catch(IllegalArgumentException ex58) - { - } - try - { - this.list.put("383:37", Material.valueOf("SQUID_SPAWN_EGG")); - } - catch(IllegalArgumentException ex59) - { - } - try - { - this.list.put("383:38", Material.valueOf("STRAY_SPAWN_EGG")); - } - catch(IllegalArgumentException ex60) - { - } - try - { - this.list.put("383:39", Material.valueOf("TROPICAL_FISH_SPAWN_EGG")); - } - catch(IllegalArgumentException ex61) - { - } - try - { - this.list.put("383:40", Material.valueOf("TURTLE_SPAWN_EGG")); - } - catch(IllegalArgumentException ex62) - { - } - try - { - this.list.put("383:41", Material.valueOf("VEX_SPAWN_EGG")); - } - catch(IllegalArgumentException ex63) - { - } - try - { - this.list.put("383:42", Material.valueOf("VILLAGER_SPAWN_EGG")); - } - catch(IllegalArgumentException ex64) - { - } - try - { - this.list.put("383:43", Material.valueOf("VINDICATOR_SPAWN_EGG")); - } - catch(IllegalArgumentException ex65) - { - } - try - { - this.list.put("383:44", Material.valueOf("WITCH_SPAWN_EGG")); - } - catch(IllegalArgumentException ex66) - { - } - try - { - this.list.put("383:45", Material.valueOf("WITHER_SKELETON_SPAWN_EGG")); - } - catch(IllegalArgumentException ex67) - { - } - try - { - this.list.put("383:46", Material.valueOf("WOLF_SPAWN_EGG")); - } - catch(IllegalArgumentException ex68) - { - } - try - { - this.list.put("383:47", Material.valueOf("ZOMBIE_HORSE_SPAWN_EGG")); - } - catch(IllegalArgumentException ex69) - { - } - try - { - this.list.put("383:48", Material.valueOf("ZOMBIE_PIGMAN_SPAWN_EGG")); - } - catch(IllegalArgumentException ex70) - { - } - try - { - this.list.put("383:49", Material.valueOf("ZOMBIE_SPAWN_EGG")); - } - catch(IllegalArgumentException ex71) - { - } - try - { - this.list.put("383:50", Material.valueOf("ZOMBIE_VILLAGER_SPAWN_EGG")); - } - catch(IllegalArgumentException ex72) - { - } - try - { - this.list.put("397:6", Material.valueOf("SKELETON_WALL_SKULL")); - } - catch(IllegalArgumentException ex73) - { - } - try - { - this.list.put("397:7", Material.valueOf("WITHER_SKELETON_WALL_SKULL")); - } - catch(IllegalArgumentException ex74) - { - } - try - { - this.list.put("397:8", Material.valueOf("ZOMBIE_WALL_HEAD")); - } - catch(IllegalArgumentException ex75) - { - } - try - { - this.list.put("397:9", Material.valueOf("PLAYER_WALL_HEAD")); - } - catch(IllegalArgumentException ex76) - { - } - try - { - this.list.put("397:10", Material.valueOf("CREEPER_WALL_HEAD")); - } - catch(IllegalArgumentException ex77) - { - } - try - { - this.list.put("397:11", Material.valueOf("DRAGON_WALL_HEAD")); - } - catch(IllegalArgumentException ex78) - { - } - try - { - this.list.put("425:15", Material.valueOf("WHITE_BANNER")); - } - catch(IllegalArgumentException ex79) - { - } - try - { - this.list.put("454:0", Material.valueOf("PUMPKIN")); - } - catch(IllegalArgumentException ex80) - { - } - try - { - this.list.put("455:0", Material.valueOf("SHULKER_BOX")); - } - catch(IllegalArgumentException ex81) - { - } - try - { - this.list.put("456:0", Material.valueOf("BLUE_ICE")); - } - catch(IllegalArgumentException ex82) - { - } - try - { - this.list.put("457:0", Material.valueOf("STRIPPED_OAK_LOG")); - } - catch(IllegalArgumentException ex83) - { - } - try - { - this.list.put("457:1", Material.valueOf("STRIPPED_SPRUCE_LOG")); - } - catch(IllegalArgumentException ex84) - { - } - try - { - this.list.put("457:2", Material.valueOf("STRIPPED_BIRCH_LOG")); - } - catch(IllegalArgumentException ex85) - { - } - try - { - this.list.put("457:3", Material.valueOf("STRIPPED_JUNGLE_LOG")); - } - catch(IllegalArgumentException ex86) - { - } - try - { - this.list.put("457:4", Material.valueOf("STRIPPED_ACACIA_LOG")); - } - catch(IllegalArgumentException ex87) - { - } - try - { - this.list.put("457:5", Material.valueOf("STRIPPED_DARK_OAK_LOG")); - } - catch(IllegalArgumentException ex88) - { - } - try - { - this.list.put("458:0", Material.valueOf("OAK_WOOD")); - } - catch(IllegalArgumentException ex89) - { - } - try - { - this.list.put("458:1", Material.valueOf("SPRUCE_WOOD")); - } - catch(IllegalArgumentException ex90) - { - } - try - { - this.list.put("458:2", Material.valueOf("BIRCH_WOOD")); - } - catch(IllegalArgumentException ex91) - { - } - try - { - this.list.put("458:3", Material.valueOf("JUNGLE_WOOD")); - } - catch(IllegalArgumentException ex92) - { - } - try - { - this.list.put("458:4", Material.valueOf("ACACIA_WOOD")); - } - catch(IllegalArgumentException ex93) - { - } - try - { - this.list.put("458:5", Material.valueOf("DARK_OAK_WOOD")); - } - catch(IllegalArgumentException ex94) - { - } - try - { - this.list.put("459:0", Material.valueOf("STRIPPED_OAK_WOOD")); - } - catch(IllegalArgumentException ex95) - { - } - try - { - this.list.put("459:1", Material.valueOf("STRIPPED_SPRUCE_WOOD")); - } - catch(IllegalArgumentException ex96) - { - } - try - { - this.list.put("459:2", Material.valueOf("STRIPPED_BIRCH_WOOD")); - } - catch(IllegalArgumentException ex97) - { - } - try - { - this.list.put("459:3", Material.valueOf("STRIPPED_JUNGLE_WOOD")); - } - catch(IllegalArgumentException ex98) - { - } - try - { - this.list.put("459:4", Material.valueOf("STRIPPED_ACACIA_WOOD")); - } - catch(IllegalArgumentException ex99) - { - } - try - { - this.list.put("459:5", Material.valueOf("STRIPPED_DARK_OAK_WOOD")); - } - catch(IllegalArgumentException ex100) - { - } - try - { - this.list.put("460:0", Material.valueOf("BUBBLE_COLUMN")); - } - catch(IllegalArgumentException ex101) - { - } - try - { - this.list.put("461:0", Material.valueOf("BRAIN_CORAL")); - } - catch(IllegalArgumentException ex102) - { - } - try - { - this.list.put("461:1", Material.valueOf("BUBBLE_CORAL")); - } - catch(IllegalArgumentException ex103) - { - } - try - { - this.list.put("461:2", Material.valueOf("FIRE_CORAL")); - } - catch(IllegalArgumentException ex104) - { - } - try - { - this.list.put("461:3", Material.valueOf("HORN_CORAL")); - } - catch(IllegalArgumentException ex105) - { - } - try - { - this.list.put("461:4", Material.valueOf("TUBE_CORAL")); - } - catch(IllegalArgumentException ex106) - { - } - try - { - this.list.put("462:0", Material.valueOf("DEAD_BRAIN_CORAL")); - } - catch(IllegalArgumentException ex107) - { - } - try - { - this.list.put("462:1", Material.valueOf("DEAD_BUBBLE_CORAL")); - } - catch(IllegalArgumentException ex108) - { - } - try - { - this.list.put("462:2", Material.valueOf("DEAD_FIRE_CORAL")); - } - catch(IllegalArgumentException ex109) - { - } - try - { - this.list.put("462:3", Material.valueOf("DEAD_HORN_CORAL")); - } - catch(IllegalArgumentException ex110) - { - } - try - { - this.list.put("462:4", Material.valueOf("DEAD_TUBE_CORAL")); - } - catch(IllegalArgumentException ex111) - { - } - try - { - this.list.put("463:0", Material.valueOf("BRAIN_CORAL_BLOCK")); - } - catch(IllegalArgumentException ex112) - { - } - try - { - this.list.put("463:1", Material.valueOf("BUBBLE_CORAL_BLOCK")); - } - catch(IllegalArgumentException ex113) - { - } - try - { - this.list.put("463:2", Material.valueOf("FIRE_CORAL_BLOCK")); - } - catch(IllegalArgumentException ex114) - { - } - try - { - this.list.put("463:3", Material.valueOf("HORN_CORAL_BLOCK")); - } - catch(IllegalArgumentException ex115) - { - } - try - { - this.list.put("463:4", Material.valueOf("TUBE_CORAL_BLOCK")); - } - catch(IllegalArgumentException ex116) - { - } - try - { - this.list.put("464:0", Material.valueOf("DEAD_BRAIN_CORAL_BLOCK")); - } - catch(IllegalArgumentException ex117) - { - } - try - { - this.list.put("464:1", Material.valueOf("DEAD_BUBBLE_CORAL_BLOCK")); - } - catch(IllegalArgumentException ex118) - { - } - try - { - this.list.put("464:2", Material.valueOf("DEAD_FIRE_CORAL_BLOCK")); - } - catch(IllegalArgumentException ex119) - { - } - try - { - this.list.put("464:3", Material.valueOf("DEAD_HORN_CORAL_BLOCK")); - } - catch(IllegalArgumentException ex120) - { - } - try - { - this.list.put("464:4", Material.valueOf("DEAD_TUBE_CORAL_BLOCK")); - } - catch(IllegalArgumentException ex121) - { - } - try - { - this.list.put("465:0", Material.valueOf("BRAIN_CORAL_FAN")); - } - catch(IllegalArgumentException ex122) - { - } - try - { - this.list.put("465:1", Material.valueOf("BUBBLE_CORAL_FAN")); - } - catch(IllegalArgumentException ex123) - { - } - try - { - this.list.put("465:2", Material.valueOf("FIRE_CORAL_FAN")); - } - catch(IllegalArgumentException ex124) - { - } - try - { - this.list.put("465:3", Material.valueOf("HORN_CORAL_FAN")); - } - catch(IllegalArgumentException ex125) - { - } - try - { - this.list.put("465:4", Material.valueOf("TUBE_CORAL_FAN")); - } - catch(IllegalArgumentException ex126) - { - } - try - { - this.list.put("466:0", Material.valueOf("DEAD_BRAIN_CORAL_FAN")); - } - catch(IllegalArgumentException ex127) - { - } - try - { - this.list.put("466:1", Material.valueOf("DEAD_BUBBLE_CORAL_FAN")); - } - catch(IllegalArgumentException ex128) - { - } - try - { - this.list.put("466:2", Material.valueOf("DEAD_FIRE_CORAL_FAN")); - } - catch(IllegalArgumentException ex129) - { - } - try - { - this.list.put("466:3", Material.valueOf("DEAD_HORN_CORAL_FAN")); - } - catch(IllegalArgumentException ex130) - { - } - try - { - this.list.put("466:4", Material.valueOf("DEAD_TUBE_CORAL_FAN")); - } - catch(IllegalArgumentException ex131) - { - } - try - { - this.list.put("467:0", Material.valueOf("BRAIN_CORAL_WALL_FAN")); - } - catch(IllegalArgumentException ex132) - { - } - try - { - this.list.put("467:1", Material.valueOf("BUBBLE_CORAL_WALL_FAN")); - } - catch(IllegalArgumentException ex133) - { - } - try - { - this.list.put("467:2", Material.valueOf("FIRE_CORAL_WALL_FAN")); - } - catch(IllegalArgumentException ex134) - { - } - try - { - this.list.put("467:3", Material.valueOf("HORN_CORAL_WALL_FAN")); - } - catch(IllegalArgumentException ex135) - { - } - try - { - this.list.put("467:4", Material.valueOf("TUBE_CORAL_WALL_FAN")); - } - catch(IllegalArgumentException ex136) - { - } - try - { - this.list.put("468:0", Material.valueOf("DEAD_BRAIN_CORAL_WALL_FAN")); - } - catch(IllegalArgumentException ex137) - { - } - try - { - this.list.put("468:1", Material.valueOf("DEAD_BUBBLE_CORAL_WALL_FAN")); - } - catch(IllegalArgumentException ex138) - { - } - try - { - this.list.put("468:2", Material.valueOf("DEAD_FIRE_CORAL_WALL_FAN")); - } - catch(IllegalArgumentException ex139) - { - } - try - { - this.list.put("468:3", Material.valueOf("DEAD_HORN_CORAL_WALL_FAN")); - } - catch(IllegalArgumentException ex140) - { - } - try - { - this.list.put("468:4", Material.valueOf("DEAD_TUBE_CORAL_WALL_FAN")); - } - catch(IllegalArgumentException ex141) - { - } - try - { - this.list.put("469:0", Material.valueOf("TROPICAL_FISH_BUCKET")); - } - catch(IllegalArgumentException ex142) - { - } - try - { - this.list.put("469:1", Material.valueOf("COD_BUCKET")); - } - catch(IllegalArgumentException ex143) - { - } - try - { - this.list.put("469:2", Material.valueOf("PUFFERFISH_BUCKET")); - } - catch(IllegalArgumentException ex144) - { - } - try - { - this.list.put("469:3", Material.valueOf("SALMON_BUCKET")); - } - catch(IllegalArgumentException ex145) - { - } - try - { - this.list.put("470:0", Material.valueOf("CONDUIT")); - } - catch(IllegalArgumentException ex146) - { - } - try - { - this.list.put("471:0", Material.valueOf("PRISMARINE_SLAB")); - } - catch(IllegalArgumentException ex147) - { - } - try - { - this.list.put("471:1", Material.valueOf("PRISMARINE_BRICK_SLAB")); - } - catch(IllegalArgumentException ex148) - { - } - try - { - this.list.put("471:2", Material.valueOf("DARK_PRISMARINE_SLAB")); - } - catch(IllegalArgumentException ex149) - { - } - try - { - this.list.put("472:0", Material.valueOf("PRISMARINE_STAIRS")); - } - catch(IllegalArgumentException ex150) - { - } - try - { - this.list.put("472:1", Material.valueOf("PRISMARINE_BRICK_STAIRS")); - } - catch(IllegalArgumentException ex151) - { - } - try - { - this.list.put("472:2", Material.valueOf("DARK_PRISMARINE_STAIRS")); - } - catch(IllegalArgumentException ex152) - { - } - try - { - this.list.put("473:0", Material.valueOf("SEA_PICKLE")); - } - catch(IllegalArgumentException ex153) - { - } - try - { - this.list.put("474:0", Material.valueOf("SEAGRASS")); - } - catch(IllegalArgumentException ex154) - { - } - try - { - this.list.put("474:1", Material.valueOf("TALL_SEAGRASS")); - } - catch(IllegalArgumentException ex155) - { - } - try - { - this.list.put("475:0", Material.valueOf("KELP")); - } - catch(IllegalArgumentException ex156) - { - } - try - { - this.list.put("476:0", Material.valueOf("DRIED_KELP")); - } - catch(IllegalArgumentException ex157) - { - } - try - { - this.list.put("477:0", Material.valueOf("DRIED_KELP_BLOCK")); - } - catch(IllegalArgumentException ex158) - { - } - try - { - this.list.put("478:0", Material.valueOf("HEART_OF_THE_SEA")); - } - catch(IllegalArgumentException ex159) - { - } - try - { - this.list.put("479:0", Material.valueOf("NAUTILUS_SHELL")); - } - catch(IllegalArgumentException ex160) - { - } - try - { - this.list.put("480:0", Material.valueOf("PHANTOM_MEMBRANE")); - } - catch(IllegalArgumentException ex161) - { - } - try - { - this.list.put("481:0", Material.valueOf("SCUTE")); - } - catch(IllegalArgumentException ex162) - { - } - try - { - this.list.put("482:0", Material.valueOf("TURTLE_HELMET")); - } - catch(IllegalArgumentException ex163) - { - } - try - { - this.list.put("483:0", Material.valueOf("TRIDENT")); - } - catch(IllegalArgumentException ex164) - { - } - try - { - this.list.put("484:0", Material.valueOf("TURTLE_EGG")); - } - catch(IllegalArgumentException ex165) - { - } - try - { - this.list.put("485:0", Material.valueOf("VOID_AIR")); - } - catch(IllegalArgumentException ex166) - { - } - try - { - this.list.put("486:0", Material.valueOf("CAVE_AIR")); - } - catch(IllegalArgumentException ex167) - { - } - try - { - this.list.put("487:0", Material.valueOf("DEBUG_STICK")); - } - catch(IllegalArgumentException ex168) - { - } - try - { - this.list.put("488:0", Material.valueOf("BLACK_WALL_BANNER")); - } - catch(IllegalArgumentException ex169) - { - } - try - { - this.list.put("488:1", Material.valueOf("RED_WALL_BANNER")); - } - catch(IllegalArgumentException ex170) - { - } - try - { - this.list.put("488:2", Material.valueOf("GREEN_WALL_BANNER")); - } - catch(IllegalArgumentException ex171) - { - } - try - { - this.list.put("488:3", Material.valueOf("BROWN_WALL_BANNER")); - } - catch(IllegalArgumentException ex172) - { - } - try - { - this.list.put("488:4", Material.valueOf("BLUE_WALL_BANNER")); - } - catch(IllegalArgumentException ex173) - { - } - try - { - this.list.put("488:5", Material.valueOf("PURPLE_WALL_BANNER")); - } - catch(IllegalArgumentException ex174) - { - } - try - { - this.list.put("488:6", Material.valueOf("CYAN_WALL_BANNER")); - } - catch(IllegalArgumentException ex175) - { - } - try - { - this.list.put("488:7", Material.valueOf("LIGHT_GRAY_WALL_BANNER")); - } - catch(IllegalArgumentException ex176) - { - } - try - { - this.list.put("488:8", Material.valueOf("GRAY_WALL_BANNER")); - } - catch(IllegalArgumentException ex177) - { - } - try - { - this.list.put("488:9", Material.valueOf("PINK_WALL_BANNER")); - } - catch(IllegalArgumentException ex178) - { - } - try - { - this.list.put("488:10", Material.valueOf("LIME_WALL_BANNER")); - } - catch(IllegalArgumentException ex179) - { - } - try - { - this.list.put("488:11", Material.valueOf("YELLOW_WALL_BANNER")); - } - catch(IllegalArgumentException ex180) - { - } - try - { - this.list.put("488:12", Material.valueOf("LIGHT_BLUE_WALL_BANNER")); - } - catch(IllegalArgumentException ex181) - { - } - try - { - this.list.put("488:13", Material.valueOf("MAGENTA_WALL_BANNER")); - } - catch(IllegalArgumentException ex182) - { - } - try - { - this.list.put("488:14", Material.valueOf("ORANGE_WALL_BANNER")); - } - catch(IllegalArgumentException ex183) - { - } - try - { - this.list.put("488:15", Material.valueOf("WHITE_WALL_BANNER")); - } - catch(IllegalArgumentException ex184) - { - } - try - { - this.list.put("489:0", Material.valueOf("POTTED_ACACIA_SAPLING")); - } - catch(IllegalArgumentException ex185) - { - } - try - { - this.list.put("489:1", Material.valueOf("POTTED_ALLIUM")); - } - catch(IllegalArgumentException ex186) - { - } - try - { - this.list.put("489:2", Material.valueOf("POTTED_AZURE_BLUET")); - } - catch(IllegalArgumentException ex187) - { - } - try - { - this.list.put("489:3", Material.valueOf("POTTED_BIRCH_SAPLING")); - } - catch(IllegalArgumentException ex188) - { - } - try - { - this.list.put("489:4", Material.valueOf("POTTED_BLUE_ORCHID")); - } - catch(IllegalArgumentException ex189) - { - } - try - { - this.list.put("489:5", Material.valueOf("POTTED_BROWN_MUSHROOM")); - } - catch(IllegalArgumentException ex190) - { - } - try - { - this.list.put("489:6", Material.valueOf("POTTED_CACTUS")); - } - catch(IllegalArgumentException ex191) - { - } - try - { - this.list.put("489:7", Material.valueOf("POTTED_DANDELION")); - } - catch(IllegalArgumentException ex192) - { - } - try - { - this.list.put("489:8", Material.valueOf("POTTED_DARK_OAK_SAPLING")); - } - catch(IllegalArgumentException ex193) - { - } - try - { - this.list.put("489:9", Material.valueOf("POTTED_DEAD_BUSH")); - } - catch(IllegalArgumentException ex194) - { - } - try - { - this.list.put("489:10", Material.valueOf("POTTED_FERN")); - } - catch(IllegalArgumentException ex195) - { - } - try - { - this.list.put("489:11", Material.valueOf("POTTED_JUNGLE_SAPLING")); - } - catch(IllegalArgumentException ex196) - { - } - try - { - this.list.put("489:12", Material.valueOf("POTTED_OAK_SAPLING")); - } - catch(IllegalArgumentException ex197) - { - } - try - { - this.list.put("489:13", Material.valueOf("POTTED_ORANGE_TULIP")); - } - catch(IllegalArgumentException ex198) - { - } - try - { - this.list.put("489:14", Material.valueOf("POTTED_OXEYE_DAISY")); - } - catch(IllegalArgumentException ex199) - { - } - try - { - this.list.put("489:15", Material.valueOf("POTTED_PINK_TULIP")); - } - catch(IllegalArgumentException ex200) - { - } - try - { - this.list.put("489:16", Material.valueOf("POTTED_POPPY")); - } - catch(IllegalArgumentException ex201) - { - } - try - { - this.list.put("489:17", Material.valueOf("POTTED_RED_MUSHROOM")); - } - catch(IllegalArgumentException ex202) - { - } - try - { - this.list.put("489:18", Material.valueOf("POTTED_RED_TULIP")); - } - catch(IllegalArgumentException ex203) - { - } - try - { - this.list.put("489:19", Material.valueOf("POTTED_SPRUCE_SAPLING")); - } - catch(IllegalArgumentException ex204) - { - } - try - { - this.list.put("489:20", Material.valueOf("POTTED_WHITE_TULIP")); - } - catch(IllegalArgumentException ex205) - { - } - try - { - this.list.put("383:51", Material.valueOf("CAT_SPAWN_EGG")); - } - catch(IllegalArgumentException ex206) - { - } - try - { - this.list.put("383:52", Material.valueOf("FOX_SPAWN_EGG")); - } - catch(IllegalArgumentException ex207) - { - } - try - { - this.list.put("383:53", Material.valueOf("PANDA_SPAWN_EGG")); - } - catch(IllegalArgumentException ex208) - { - } - try - { - this.list.put("383:54", Material.valueOf("PILLAGER_SPAWN_EGG")); - } - catch(IllegalArgumentException ex209) - { - } - try - { - this.list.put("383:55", Material.valueOf("RAVAGER_SPAWN_EGG")); - } - catch(IllegalArgumentException ex210) - { - } - try - { - this.list.put("383:56", Material.valueOf("TRADER_LLAMA_SPAWN_EGG")); - } - catch(IllegalArgumentException ex211) - { - } - try - { - this.list.put("383:57", Material.valueOf("WANDERING_TRADER_SPAWN_EGG")); - } - catch(IllegalArgumentException ex212) - { - } - try - { - this.list.put("489:21", Material.valueOf("POTTED_CORNFLOWER")); - } - catch(IllegalArgumentException ex213) - { - } - try - { - this.list.put("489:22", Material.valueOf("POTTED_LILY_OF_THE_VALLEY")); - } - catch(IllegalArgumentException ex214) - { - } - try - { - this.list.put("489:23", Material.valueOf("POTTED_WITHER_ROSE")); - } - catch(IllegalArgumentException ex215) - { - } - try - { - this.list.put("490:0", Material.valueOf("ACACIA_SIGN")); - } - catch(IllegalArgumentException ex216) - { - } - try - { - this.list.put("490:1", Material.valueOf("BIRCH_SIGN")); - } - catch(IllegalArgumentException ex217) - { - } - try - { - this.list.put("490:2", Material.valueOf("DARK_OAK_SIGN")); - } - catch(IllegalArgumentException ex218) - { - } - try - { - this.list.put("490:3", Material.valueOf("JUNGLE_SIGN")); - } - catch(IllegalArgumentException ex219) - { - } - try - { - this.list.put("490:4", Material.valueOf("OAK_SIGN")); - } - catch(IllegalArgumentException ex220) - { - } - try - { - this.list.put("490:5", Material.valueOf("SPRUCE_SIGN")); - } - catch(IllegalArgumentException ex221) - { - } - try - { - this.list.put("491:0", Material.valueOf("ACACIA_WALL_SIGN")); - } - catch(IllegalArgumentException ex222) - { - } - try - { - this.list.put("491:1", Material.valueOf("BIRCH_WALL_SIGN")); - } - catch(IllegalArgumentException ex223) - { - } - try - { - this.list.put("491:2", Material.valueOf("DARK_OAK_WALL_SIGN")); - } - catch(IllegalArgumentException ex224) - { - } - try - { - this.list.put("491:3", Material.valueOf("JUNGLE_WALL_SIGN")); - } - catch(IllegalArgumentException ex225) - { - } - try - { - this.list.put("491:4", Material.valueOf("OAK_WALL_SIGN")); - } - catch(IllegalArgumentException ex226) - { - } - try - { - this.list.put("491:5", Material.valueOf("SPRUCE_WALL_SIGN")); - } - catch(IllegalArgumentException ex227) - { - } - try - { - this.list.put("492:0", Material.valueOf("ANDESITE_SLAB")); - } - catch(IllegalArgumentException ex228) - { - } - try - { - this.list.put("492:1", Material.valueOf("CUT_RED_SANDSTONE_SLAB")); - } - catch(IllegalArgumentException ex229) - { - } - try - { - this.list.put("492:2", Material.valueOf("CUT_SANDSTONE_SLAB")); - } - catch(IllegalArgumentException ex230) - { - } - try - { - this.list.put("492:3", Material.valueOf("DIORITE_SLAB")); - } - catch(IllegalArgumentException ex231) - { - } - try - { - this.list.put("492:4", Material.valueOf("END_STONE_BRICK_SLAB")); - } - catch(IllegalArgumentException ex232) - { - } - try - { - this.list.put("492:5", Material.valueOf("GRANITE_SLAB")); - } - catch(IllegalArgumentException ex233) - { - } - try - { - this.list.put("492:6", Material.valueOf("MOSSY_COBBLESTONE_SLAB")); - } - catch(IllegalArgumentException ex234) - { - } - try - { - this.list.put("492:7", Material.valueOf("MOSSY_STONE_BRICK_SLAB")); - } - catch(IllegalArgumentException ex235) - { - } - try - { - this.list.put("492:8", Material.valueOf("POLISHED_ANDESITE_SLAB")); - } - catch(IllegalArgumentException ex236) - { - } - try - { - this.list.put("492:9", Material.valueOf("POLISHED_DIORITE_SLAB")); - } - catch(IllegalArgumentException ex237) - { - } - try - { - this.list.put("492:10", Material.valueOf("POLISHED_GRANITE_SLAB")); - } - catch(IllegalArgumentException ex238) - { - } - try - { - this.list.put("492:11", Material.valueOf("RED_NETHER_BRICK_SLAB")); - } - catch(IllegalArgumentException ex239) - { - } - try - { - this.list.put("492:12", Material.valueOf("SMOOTH_QUARTZ_SLAB")); - } - catch(IllegalArgumentException ex240) - { - } - try - { - this.list.put("492:13", Material.valueOf("SMOOTH_RED_SANDSTONE_SLAB")); - } - catch(IllegalArgumentException ex241) - { - } - try - { - this.list.put("492:14", Material.valueOf("SMOOTH_SANDSTONE_SLAB")); - } - catch(IllegalArgumentException ex242) - { - } - try - { - this.list.put("493:0", Material.valueOf("ANDESITE_STAIRS")); - } - catch(IllegalArgumentException ex243) - { - } - try - { - this.list.put("493:1", Material.valueOf("DIORITE_STAIRS")); - } - catch(IllegalArgumentException ex244) - { - } - try - { - this.list.put("493:2", Material.valueOf("END_STONE_BRICK_STAIRS")); - } - catch(IllegalArgumentException ex245) - { - } - try - { - this.list.put("493:3", Material.valueOf("GRANITE_STAIRS")); - } - catch(IllegalArgumentException ex246) - { - } - try - { - this.list.put("493:4", Material.valueOf("MOSSY_COBBLESTONE_STAIRS")); - } - catch(IllegalArgumentException ex247) - { - } - try - { - this.list.put("493:5", Material.valueOf("MOSSY_STONE_BRICK_STAIRS")); - } - catch(IllegalArgumentException ex248) - { - } - try - { - this.list.put("493:6", Material.valueOf("POLISHED_ANDESITE_STAIRS")); - } - catch(IllegalArgumentException ex249) - { - } - try - { - this.list.put("493:7", Material.valueOf("POLISHED_DIORITE_STAIRS")); - } - catch(IllegalArgumentException ex250) - { - } - try - { - this.list.put("493:8", Material.valueOf("POLISHED_GRANITE_STAIRS")); - } - catch(IllegalArgumentException ex251) - { - } - try - { - this.list.put("493:9", Material.valueOf("RED_NETHER_BRICK_STAIRS")); - } - catch(IllegalArgumentException ex252) - { - } - try - { - this.list.put("493:10", Material.valueOf("SMOOTH_QUARTZ_STAIRS")); - } - catch(IllegalArgumentException ex253) - { - } - try - { - this.list.put("493:11", Material.valueOf("SMOOTH_RED_SANDSTONE_STAIRS")); - } - catch(IllegalArgumentException ex254) - { - } - try - { - this.list.put("493:12", Material.valueOf("SMOOTH_SANDSTONE_STAIRS")); - } - catch(IllegalArgumentException ex255) - { - } - try - { - this.list.put("493:13", Material.valueOf("STONE_STAIRS")); - } - catch(IllegalArgumentException ex256) - { - } - try - { - this.list.put("494:0", Material.valueOf("ANDESITE_WALL")); - } - catch(IllegalArgumentException ex257) - { - } - try - { - this.list.put("494:1", Material.valueOf("BRICK_WALL")); - } - catch(IllegalArgumentException ex258) - { - } - try - { - this.list.put("494:2", Material.valueOf("DIORITE_WALL")); - } - catch(IllegalArgumentException ex259) - { - } - try - { - this.list.put("494:3", Material.valueOf("END_STONE_BRICK_WALL")); - } - catch(IllegalArgumentException ex260) - { - } - try - { - this.list.put("494:4", Material.valueOf("GRANITE_WALL")); - } - catch(IllegalArgumentException ex261) - { - } - try - { - this.list.put("494:5", Material.valueOf("MOSSY_STONE_BRICK_WALL")); - } - catch(IllegalArgumentException ex262) - { - } - try - { - this.list.put("494:6", Material.valueOf("NETHER_BRICK_WALL")); - } - catch(IllegalArgumentException ex263) - { - } - try - { - this.list.put("494:7", Material.valueOf("PRISMARINE_WALL")); - } - catch(IllegalArgumentException ex264) - { - } - try - { - this.list.put("494:8", Material.valueOf("RED_NETHER_BRICK_WALL")); - } - catch(IllegalArgumentException ex265) - { - } - try - { - this.list.put("494:9", Material.valueOf("RED_SANDSTONE_WALL")); - } - catch(IllegalArgumentException ex266) - { - } - try - { - this.list.put("494:10", Material.valueOf("SANDSTONE_WALL")); - } - catch(IllegalArgumentException ex267) - { - } - try - { - this.list.put("494:11", Material.valueOf("STONE_BRICK_WALL")); - } - catch(IllegalArgumentException ex268) - { - } - try - { - this.list.put("495:0", Material.valueOf("BAMBOO")); - } - catch(IllegalArgumentException ex269) - { - } - try - { - this.list.put("496:0", Material.valueOf("BAMBOO_SAPLING")); - } - catch(IllegalArgumentException ex270) - { - } - try - { - this.list.put("497:0", Material.valueOf("COCOA_BEANS")); - } - catch(IllegalArgumentException ex271) - { - } - try - { - this.list.put("498:0", Material.valueOf("CORNFLOWER")); - } - catch(IllegalArgumentException ex272) - { - } - try - { - this.list.put("499:0", Material.valueOf("LILY_OF_THE_VALLEY")); - } - catch(IllegalArgumentException ex273) - { - } - try - { - this.list.put("500:0", Material.valueOf("SWEET_BERRY_BUSH")); - } - catch(IllegalArgumentException ex274) - { - } - try - { - this.list.put("501:0", Material.valueOf("WITHER_ROSE")); - } - catch(IllegalArgumentException ex275) - { - } - try - { - this.list.put("502:0", Material.valueOf("BARREL")); - } - catch(IllegalArgumentException ex276) - { - } - try - { - this.list.put("503:0", Material.valueOf("BELL")); - } - catch(IllegalArgumentException ex277) - { - } - try - { - this.list.put("504:0", Material.valueOf("BLAST_FURNACE")); - } - catch(IllegalArgumentException ex278) - { - } - try - { - this.list.put("505:0", Material.valueOf("CAMPFIRE")); - } - catch(IllegalArgumentException ex279) - { - } - try - { - this.list.put("506:0", Material.valueOf("CARTOGRAPHY_TABLE")); - } - catch(IllegalArgumentException ex280) - { - } - try - { - this.list.put("507:0", Material.valueOf("COMPOSTER")); - } - catch(IllegalArgumentException ex281) - { - } - try - { - this.list.put("508:0", Material.valueOf("FLETCHING_TABLE")); - } - catch(IllegalArgumentException ex282) - { - } - try - { - this.list.put("509:0", Material.valueOf("GRINDSTONE")); - } - catch(IllegalArgumentException ex283) - { - } - try - { - this.list.put("510:0", Material.valueOf("JIGSAW")); - } - catch(IllegalArgumentException ex284) - { - } - try - { - this.list.put("511:0", Material.valueOf("LANTERN")); - } - catch(IllegalArgumentException ex285) - { - } - try - { - this.list.put("512:0", Material.valueOf("LECTERN")); - } - catch(IllegalArgumentException ex286) - { - } - try - { - this.list.put("513:0", Material.valueOf("LOOM")); - } - catch(IllegalArgumentException ex287) - { - } - try - { - this.list.put("514:0", Material.valueOf("SCAFFOLDING")); - } - catch(IllegalArgumentException ex288) - { - } - try - { - this.list.put("515:0", Material.valueOf("SMITHING_TABLE")); - } - catch(IllegalArgumentException ex289) - { - } - try - { - this.list.put("516:0", Material.valueOf("SMOKER")); - } - catch(IllegalArgumentException ex290) - { - } - try - { - this.list.put("517:0", Material.valueOf("STONECUTTER")); - } - catch(IllegalArgumentException ex291) - { - } - try - { - this.list.put("518:0", Material.valueOf("CREEPER_BANNER_PATTERN")); - } - catch(IllegalArgumentException ex292) - { - } - try - { - this.list.put("518:1", Material.valueOf("FLOWER_BANNER_PATTERN")); - } - catch(IllegalArgumentException ex293) - { - } - try - { - this.list.put("518:2", Material.valueOf("GLOBE_BANNER_PATTERN")); - } - catch(IllegalArgumentException ex294) - { - } - try - { - this.list.put("518:3", Material.valueOf("MOJANG_BANNER_PATTERN")); - } - catch(IllegalArgumentException ex295) - { - } - try - { - this.list.put("518:4", Material.valueOf("SKULL_BANNER_PATTERN")); - } - catch(IllegalArgumentException ex296) - { - } - try - { - this.list.put("519:0", Material.valueOf("BLACK_DYE")); - } - catch(IllegalArgumentException ex297) - { - } - try - { - this.list.put("519:1", Material.valueOf("BLUE_DYE")); - } - catch(IllegalArgumentException ex298) - { - } - try - { - this.list.put("519:2", Material.valueOf("BROWN_DYE")); - } - catch(IllegalArgumentException ex299) - { - } - try - { - this.list.put("519:3", Material.valueOf("WHITE_DYE")); - } - catch(IllegalArgumentException ex300) - { - } - try - { - this.list.put("520:0", Material.valueOf("CROSSBOW")); - } - catch(IllegalArgumentException ex301) - { - } - try - { - this.list.put("521:0", Material.valueOf("LEATHER_HORSE_ARMOR")); - } - catch(IllegalArgumentException ex302) - { - } - try - { - this.list.put("522:0", Material.valueOf("SUSPICIOUS_STEW")); - } - catch(IllegalArgumentException ex303) - { - } - try - { - this.list.put("523:0", Material.valueOf("SWEET_BERRIES")); - } - catch(IllegalArgumentException ex304) - { - } - try - { - this.list.put("383:58", Material.valueOf("BEE_SPAWN_EGG")); - } - catch(IllegalArgumentException ex305) - { - } - try - { - this.list.put("524:0", Material.valueOf("BEEHIVE")); - } - catch(IllegalArgumentException ex306) - { - } - try - { - this.list.put("525:0", Material.valueOf("BEE_NEST")); - } - catch(IllegalArgumentException ex307) - { - } - try - { - this.list.put("526:0", Material.valueOf("HONEY_BLOCK")); - } - catch(IllegalArgumentException ex308) - { - } - try - { - this.list.put("527:0", Material.valueOf("HONEYCOMB_BLOCK")); - } - catch(IllegalArgumentException ex309) - { - } - try - { - this.list.put("528:0", Material.valueOf("HONEYCOMB")); - } - catch(IllegalArgumentException ex310) - { - } - try - { - this.list.put("529:0", Material.valueOf("HONEY_BOTTLE")); - } - catch(IllegalArgumentException ex311) - { - } - try - { - this.list.put("5:6", Material.valueOf("CRIMSON_PLANKS")); - } - catch(IllegalArgumentException ex312) - { - } - try - { - this.list.put("5:7", Material.valueOf("WARPED_PLANKS")); - } - catch(IllegalArgumentException ex313) - { - } - try - { - this.list.put("72:6", Material.valueOf("CRIMSON_PRESSURE_PLATE")); - } - catch(IllegalArgumentException ex314) - { - } - try - { - this.list.put("72:7", Material.valueOf("WARPED_PRESSURE_PLATE")); - } - catch(IllegalArgumentException ex315) - { - } - try - { - this.list.put("96:6", Material.valueOf("CRIMSON_TRAPDOOR")); - } - catch(IllegalArgumentException ex316) - { - } - try - { - this.list.put("96:7", Material.valueOf("WARPED_TRAPDOOR")); - } - catch(IllegalArgumentException ex317) - { - } - try - { - this.list.put("143:6", Material.valueOf("CRIMSON_BUTTON")); - } - catch(IllegalArgumentException ex318) - { - } - try - { - this.list.put("143:7", Material.valueOf("WARPED_BUTTON")); - } - catch(IllegalArgumentException ex319) - { - } - try - { - this.list.put("383:59", Material.valueOf("HOGLIN_SPAWN_EGG")); - } - catch(IllegalArgumentException ex320) - { - } - try - { - this.list.put("383:60", Material.valueOf("PIGLIN_SPAWN_EGG")); - } - catch(IllegalArgumentException ex321) - { - } - try - { - this.list.put("383:61", Material.valueOf("STRIDER_SPAWN_EGG")); - } - catch(IllegalArgumentException ex322) - { - } - try - { - this.list.put("383:62", Material.valueOf("ZOGLIN_SPAWN_EGG")); - } - catch(IllegalArgumentException ex323) - { - } - try - { - this.list.put("383:63", Material.valueOf("ZOMBIFIED_PIGLIN_SPAWN_EGG")); - } - catch(IllegalArgumentException ex324) - { - } - try - { - this.list.put("457:6", Material.valueOf("STRIPPED_CRIMSON_STEM")); - } - catch(IllegalArgumentException ex325) - { - } - try - { - this.list.put("457:7", Material.valueOf("STRIPPED_WARPED_STEM")); - } - catch(IllegalArgumentException ex326) - { - } - try - { - this.list.put("459:6", Material.valueOf("STRIPPED_CRIMSON_HYPHAE")); - } - catch(IllegalArgumentException ex327) - { - } - try - { - this.list.put("459:7", Material.valueOf("STRIPPED_WARPED_HYPHAE")); - } - catch(IllegalArgumentException ex328) - { - } - try - { - this.list.put("489:21", Material.valueOf("POTTED_BAMBOO")); - } - catch(IllegalArgumentException ex329) - { - } - try - { - this.list.put("489:22", Material.valueOf("POTTED_CORNFLOWER")); - } - catch(IllegalArgumentException ex330) - { - } - try - { - this.list.put("489:23", Material.valueOf("POTTED_LILY_OF_THE_VALLEY")); - } - catch(IllegalArgumentException ex331) - { - } - try - { - this.list.put("489:24", Material.valueOf("POTTED_WITHER_ROSE")); - } - catch(IllegalArgumentException ex332) - { - } - try - { - this.list.put("489:25", Material.valueOf("POTTED_CRIMSON_FUNGUS")); - } - catch(IllegalArgumentException ex333) - { - } - try - { - this.list.put("489:26", Material.valueOf("POTTED_CRIMSON_ROOTS")); - } - catch(IllegalArgumentException ex334) - { - } - try - { - this.list.put("489:27", Material.valueOf("POTTED_WARPED_FUNGUS")); - } - catch(IllegalArgumentException ex335) - { - } - try - { - this.list.put("489:28", Material.valueOf("POTTED_WARPED_ROOTS")); - } - catch(IllegalArgumentException ex336) - { - } - try - { - this.list.put("490:6", Material.valueOf("CRIMSON_SIGN")); - } - catch(IllegalArgumentException ex337) - { - } - try - { - this.list.put("490:7", Material.valueOf("WARPED_SIGN")); - } - catch(IllegalArgumentException ex338) - { - } - try - { - this.list.put("491:6", Material.valueOf("CRIMSON_WALL_SIGN")); - } - catch(IllegalArgumentException ex339) - { - } - try - { - this.list.put("491:7", Material.valueOf("WARPED_WALL_SIGN")); - } - catch(IllegalArgumentException ex340) - { - } - try - { - this.list.put("492:15", Material.valueOf("STONE_SLAB")); - } - catch(IllegalArgumentException ex341) - { - } - try - { - this.list.put("492:16", Material.valueOf("CRIMSON_SLAB")); - } - catch(IllegalArgumentException ex342) - { - } - try - { - this.list.put("492:17", Material.valueOf("WARPED_SLAB")); - } - catch(IllegalArgumentException ex343) - { - } - try - { - this.list.put("492:18", Material.valueOf("BLACKSTONE_SLAB")); - } - catch(IllegalArgumentException ex344) - { - } - try - { - this.list.put("492:19", Material.valueOf("POLISHED_BLACKSTONE_SLAB")); - } - catch(IllegalArgumentException ex345) - { - } - try - { - this.list.put("492:20", Material.valueOf("POLISHED_BLACKSTONE_BRICK_SLAB")); - } - catch(IllegalArgumentException ex346) - { - } - try - { - this.list.put("493:14", Material.valueOf("CRIMSON_STAIRS")); - } - catch(IllegalArgumentException ex347) - { - } - try - { - this.list.put("493:15", Material.valueOf("WARPED_STAIRS")); - } - catch(IllegalArgumentException ex348) - { - } - try - { - this.list.put("493:16", Material.valueOf("BLACKSTONE_STAIRS")); - } - catch(IllegalArgumentException ex349) - { - } - try - { - this.list.put("493:17", Material.valueOf("POLISHED_BLACKSTONE_STAIRS")); - } - catch(IllegalArgumentException ex350) - { - } - try - { - this.list.put("493:18", Material.valueOf("POLISHED_BLACKSTONE_BRICK_STAIRS")); - } - catch(IllegalArgumentException ex351) - { - } - try - { - this.list.put("494:12", Material.valueOf("BLACKSTONE_WALL")); - } - catch(IllegalArgumentException ex352) - { - } - try - { - this.list.put("494:13", Material.valueOf("POLISHED_BLACKSTONE_WALL")); - } - catch(IllegalArgumentException ex353) - { - } - try - { - this.list.put("494:14", Material.valueOf("POLISHED_BLACKSTONE_BRICK_WALL")); - } - catch(IllegalArgumentException ex354) - { - } - try - { - this.list.put("518:5", Material.valueOf("PIGLIN_BANNER_PATTERN")); - } - catch(IllegalArgumentException ex355) - { - } - try - { - this.list.put("2268:0", Material.valueOf("MUSIC_DISC_PIGSTEP")); - } - catch(IllegalArgumentException ex356) - { - } - try - { - this.list.put("530:0", Material.valueOf("NETHERITE_INGOT")); - } - catch(IllegalArgumentException ex357) - { - } - try - { - this.list.put("531:0", Material.valueOf("NETHERITE_SCRAP")); - } - catch(IllegalArgumentException ex358) - { - } - try - { - this.list.put("532:0", Material.valueOf("NETHERITE_SWORD")); - } - catch(IllegalArgumentException ex359) - { - } - try - { - this.list.put("533:0", Material.valueOf("NETHERITE_SHOVEL")); - } - catch(IllegalArgumentException ex360) - { - } - try - { - this.list.put("534:0", Material.valueOf("NETHERITE_PICKAXE")); - } - catch(IllegalArgumentException ex361) - { - } - try - { - this.list.put("535:0", Material.valueOf("NETHERITE_AXE")); - } - catch(IllegalArgumentException ex362) - { - } - try - { - this.list.put("536:0", Material.valueOf("NETHERITE_HOE")); - } - catch(IllegalArgumentException ex363) - { - } - try - { - this.list.put("537:0", Material.valueOf("NETHERITE_HELMET")); - } - catch(IllegalArgumentException ex364) - { - } - try - { - this.list.put("538:0", Material.valueOf("NETHERITE_CHESTPLATE")); - } - catch(IllegalArgumentException ex365) - { - } - try - { - this.list.put("539:0", Material.valueOf("NETHERITE_LEGGINGS")); - } - catch(IllegalArgumentException ex366) - { - } - try - { - this.list.put("540:0", Material.valueOf("NETHERITE_BOOTS")); - } - catch(IllegalArgumentException ex367) - { - } - try - { - this.list.put("541:0", Material.valueOf("WARPED_FUNGUS_ON_A_STICK")); - } - catch(IllegalArgumentException ex368) - { - } - try - { - this.list.put("542:0", Material.valueOf("TARGET")); - } - catch(IllegalArgumentException ex369) - { - } - try - { - this.list.put("543:0", Material.valueOf("ANCIENT_DEBRIS")); - } - catch(IllegalArgumentException ex370) - { - } - try - { - this.list.put("544:0", Material.valueOf("BASALT")); - } - catch(IllegalArgumentException ex371) - { - } - try - { - this.list.put("545:0", Material.valueOf("POLISHED_BASALT")); - } - catch(IllegalArgumentException ex372) - { - } - try - { - this.list.put("546:0", Material.valueOf("NETHERITE_BLOCK")); - } - catch(IllegalArgumentException ex373) - { - } - try - { - this.list.put("547:0", Material.valueOf("BLACKSTONE")); - } - catch(IllegalArgumentException ex374) - { - } - try - { - this.list.put("548:0", Material.valueOf("GILDED_BLACKSTONE")); - } - catch(IllegalArgumentException ex375) - { - } - try - { - this.list.put("549:0", Material.valueOf("POLISHED_BLACKSTONE")); - } - catch(IllegalArgumentException ex376) - { - } - try - { - this.list.put("550:0", Material.valueOf("POLISHED_BLACKSTONE_BRICKS")); - } - catch(IllegalArgumentException ex377) - { - } - try - { - this.list.put("551:0", Material.valueOf("CHISELED_POLISHED_BLACKSTONE")); - } - catch(IllegalArgumentException ex378) - { - } - try - { - this.list.put("552:0", Material.valueOf("CRACKED_POLISHED_BLACKSTONE_BRICKS")); - } - catch(IllegalArgumentException ex379) - { - } - try - { - this.list.put("553:0", Material.valueOf("POLISHED_BLACKSTONE_BUTTON")); - } - catch(IllegalArgumentException ex380) - { - } - try - { - this.list.put("554:0", Material.valueOf("POLISHED_BLACKSTONE_PRESSURE_PLATE")); - } - catch(IllegalArgumentException ex381) - { - } - try - { - this.list.put("555:0", Material.valueOf("CHAIN")); - } - catch(IllegalArgumentException ex382) - { - } - try - { - this.list.put("556:0", Material.valueOf("SHROOMLIGHT")); - } - catch(IllegalArgumentException ex383) - { - } - try - { - this.list.put("557:0", Material.valueOf("LODESTONE")); - } - catch(IllegalArgumentException ex384) - { - } - try - { - this.list.put("558:0", Material.valueOf("RESPAWN_ANCHOR")); - } - catch(IllegalArgumentException ex385) - { - } - try - { - this.list.put("559:0", Material.valueOf("SOUL_CAMPFIRE")); - } - catch(IllegalArgumentException ex386) - { - } - try - { - this.list.put("560:0", Material.valueOf("SOUL_FIRE")); - } - catch(IllegalArgumentException ex387) - { - } - try - { - this.list.put("561:0", Material.valueOf("SOUL_LANTERN")); - } - catch(IllegalArgumentException ex388) - { - } - try - { - this.list.put("562:0", Material.valueOf("SOUL_SOIL")); - } - catch(IllegalArgumentException ex389) - { - } - try - { - this.list.put("563:0", Material.valueOf("SOUL_TORCH")); - } - catch(IllegalArgumentException ex390) - { - } - try - { - this.list.put("564:0", Material.valueOf("SOUL_WALL_TORCH")); - } - catch(IllegalArgumentException ex391) - { - } - try - { - this.list.put("565:0", Material.valueOf("CHISELED_NETHER_BRICKS")); - } - catch(IllegalArgumentException ex392) - { - } - try - { - this.list.put("566:0", Material.valueOf("CRACKED_NETHER_BRICKS")); - } - catch(IllegalArgumentException ex393) - { - } - try - { - this.list.put("567:0", Material.valueOf("CRIMSON_DOOR")); - } - catch(IllegalArgumentException ex394) - { - } - try - { - this.list.put("568:0", Material.valueOf("CRIMSON_FENCE")); - } - catch(IllegalArgumentException ex395) - { - } - try - { - this.list.put("569:0", Material.valueOf("CRIMSON_FENCE_GATE")); - } - catch(IllegalArgumentException ex396) - { - } - try - { - this.list.put("570:0", Material.valueOf("CRIMSON_ROOTS")); - } - catch(IllegalArgumentException ex397) - { - } - try - { - this.list.put("571:0", Material.valueOf("CRIMSON_FUNGUS")); - } - catch(IllegalArgumentException ex398) - { - } - try - { - this.list.put("572:0", Material.valueOf("CRIMSON_HYPHAE")); - } - catch(IllegalArgumentException ex399) - { - } - try - { - this.list.put("573:0", Material.valueOf("CRIMSON_NYLIUM")); - } - catch(IllegalArgumentException ex400) - { - } - try - { - this.list.put("574:0", Material.valueOf("CRIMSON_STEM")); - } - catch(IllegalArgumentException ex401) - { - } - try - { - this.list.put("575:0", Material.valueOf("WARPED_DOOR")); - } - catch(IllegalArgumentException ex402) - { - } - try - { - this.list.put("576:0", Material.valueOf("WARPED_FENCE")); - } - catch(IllegalArgumentException ex403) - { - } - try - { - this.list.put("577:0", Material.valueOf("WARPED_FENCE_GATE")); - } - catch(IllegalArgumentException ex404) - { - } - try - { - this.list.put("578:0", Material.valueOf("WARPED_ROOTS")); - } - catch(IllegalArgumentException ex405) - { - } - try - { - this.list.put("579:0", Material.valueOf("WARPED_FUNGUS")); - } - catch(IllegalArgumentException ex406) - { - } - try - { - this.list.put("580:0", Material.valueOf("WARPED_HYPHAE")); - } - catch(IllegalArgumentException ex407) - { - } - try - { - this.list.put("581:0", Material.valueOf("WARPED_NYLIUM")); - } - catch(IllegalArgumentException ex408) - { - } - try - { - this.list.put("582:0", Material.valueOf("WARPED_STEM")); - } - catch(IllegalArgumentException ex409) - { - } - try - { - this.list.put("583:0", Material.valueOf("WARPED_WART_BLOCK")); - } - catch(IllegalArgumentException ex410) - { - } - try - { - this.list.put("584:0", Material.valueOf("CRYING_OBSIDIAN")); - } - catch(IllegalArgumentException ex411) - { - } - try - { - this.list.put("585:0", Material.valueOf("WEEPING_VINES")); - } - catch(IllegalArgumentException ex412) - { - } - try - { - this.list.put("586:0", Material.valueOf("WEEPING_VINES_PLANT")); - } - catch(IllegalArgumentException ex413) - { - } - try - { - this.list.put("587:0", Material.valueOf("TWISTING_VINES")); - } - catch(IllegalArgumentException ex414) - { - } - try - { - this.list.put("588:0", Material.valueOf("TWISTING_VINES_PLANT")); - } - catch(IllegalArgumentException ex415) - { - } - try - { - this.list.put("589:0", Material.valueOf("NETHER_GOLD_ORE")); - } - catch(IllegalArgumentException ex416) - { - } - try - { - this.list.put("590:0", Material.valueOf("NETHER_SPROUTS")); - } - catch(IllegalArgumentException ex417) - { - } - try - { - this.list.put("591:0", Material.valueOf("QUARTZ_BRICKS")); - } - catch(IllegalArgumentException ex418) - { - } - try - { - this.list.put("592:0", Material.valueOf("PURPLE_SHULKER_BOX")); - } - catch(IllegalArgumentException ex419) - { - } - try - { - this.list.put("593:0", Material.valueOf("KELP_PLANT")); - } - catch(IllegalArgumentException ex420) - { - } - } - - public Material getMaterial(final String ID) - { - return this.list.get(ID); - } - - public String getIDData(final Material M) - { - for(final Map.Entry m : this.list.entrySet()) - { - if(m.getValue().equals((Object) M)) - { - return m.getKey(); - } - } - return null; - } - - public int getID(final Material M) - { - for(final Map.Entry m : this.list.entrySet()) - { - if(m.getValue().equals((Object) M)) - { - final String s = m.getKey(); - return Integer.parseInt(s.split(":")[0]); - } - } - return -1; - } - - public byte getData(final Material M) - { - for(final Map.Entry m : this.list.entrySet()) - { - if(m.getValue().equals((Object) M)) - { - final String s = m.getKey(); - return Byte.parseByte(s.split(":")[1]); - } - } - return -1; - } -} diff --git a/src/main/java/ninja/bytecode/iris/legacy/MB.java b/src/main/java/ninja/bytecode/iris/legacy/MB.java deleted file mode 100644 index c09172b1e..000000000 --- a/src/main/java/ninja/bytecode/iris/legacy/MB.java +++ /dev/null @@ -1,103 +0,0 @@ -package ninja.bytecode.iris.legacy; - -import org.bukkit.Bukkit; -import org.bukkit.Material; - -public class MB -{ - public final Material material; - public final byte data; - - @SuppressWarnings("deprecation") - public static MB of(String dat) - { - String material = dat; - byte data = 0; - - if(dat.contains(":")) - { - material = dat.split("\\Q:\\E")[0]; - data = Integer.valueOf(dat.split("\\Q:\\E")[1]).byteValue(); - } - - try - { - return new MB(Material.getMaterial("LEGACY_" + Integer.valueOf(material)), data); - } - - catch(Throwable e) - { - - } - - try - { - return new MB(Material.getMaterial(material), data); - } - - catch(Throwable e) - { - - } - - return MB.of(Material.AIR); - } - - public String toString() - { - if(data == 0) - { - return material.name(); - } - - return material.name() + ":" + data; - } - - public MB(Material material, int data) - { - this.material = material; - this.data = (byte) data; - } - - public MB(Material material) - { - this(material, 0); - } - - public static MB of(Material f) - { - return new MB(f); - } - - public static MB of(Material f, int a) - { - return new MB(f, a); - } - - @Override - public int hashCode() - { - final int prime = 31; - int result = 1; - result = prime * result + data; - result = prime * result + ((material == null) ? 0 : material.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) - { - if(this == obj) - return true; - if(obj == null) - return false; - if(getClass() != obj.getClass()) - return false; - MB other = (MB) obj; - if(data != other.data) - return false; - if(material != other.material) - return false; - return true; - } -} \ No newline at end of file diff --git a/src/main/java/ninja/bytecode/iris/legacy/SBlockVector.java b/src/main/java/ninja/bytecode/iris/legacy/SBlockVector.java deleted file mode 100644 index 9db5da567..000000000 --- a/src/main/java/ninja/bytecode/iris/legacy/SBlockVector.java +++ /dev/null @@ -1,169 +0,0 @@ -package ninja.bytecode.iris.legacy; - -import org.bukkit.configuration.serialization.SerializableAs; -import org.bukkit.util.BlockVector; -import org.bukkit.util.Vector; - -/** - * A vector with a hash function that floors the X, Y, Z components, a la - * BlockVector in WorldEdit. BlockVectors can be used in hash sets and hash - * maps. Be aware that BlockVectors are mutable, but it is important that - * BlockVectors are never changed once put into a hash set or hash map. - */ -@SerializableAs("BlockVector") -public class SBlockVector -{ - private short x; - private short y; - private short z; - - /** - * Construct the vector with all components as 0. - */ - public SBlockVector() - { - this.x = 0; - this.y = 0; - this.z = 0; - } - - /** - * Construct the vector with another vector. - * - * @param vec - * The other vector. - */ - public SBlockVector(Vector vec) - { - this.x = (short) vec.getX(); - this.y = (short) vec.getY(); - this.z = (short) vec.getZ(); - } - - /** - * Construct the vector with provided integer components. - * - * @param x - * X component - * @param y - * Y component - * @param z - * Z component - */ - public SBlockVector(int x, int y, int z) - { - this.x = (short) x; - this.y = (short) y; - this.z = (short) z; - } - - /** - * Construct the vector with provided double components. - * - * @param x - * X component - * @param y - * Y component - * @param z - * Z component - */ - public SBlockVector(double x, double y, double z) - { - this.x = (short) x; - this.y = (short) y; - this.z = (short) z; - } - - /** - * Construct the vector with provided float components. - * - * @param x - * X component - * @param y - * Y component - * @param z - * Z component - */ - public SBlockVector(float x, float y, float z) - { - this.x = (short) x; - this.y = (short) y; - this.z = (short) z; - } - - /** - * Get a new block vector. - * - * @return vector - */ - @Override - public SBlockVector clone() - { - return new SBlockVector(x, y, z); - } - - public double getX() - { - return x; - } - - public void setX(double x) - { - this.x = (short) x; - } - - public double getY() - { - return y; - } - - public void setY(double y) - { - this.y = (short) y; - } - - public double getZ() - { - return z; - } - - public void setZ(double z) - { - this.z = (short) z; - } - - @Override - public int hashCode() - { - final int prime = 31; - int result = 1; - result = prime * result + x; - result = prime * result + y; - result = prime * result + z; - return result; - } - - @Override - public boolean equals(Object obj) - { - if(this == obj) - return true; - if(obj == null) - return false; - if(getClass() != obj.getClass()) - return false; - SBlockVector other = (SBlockVector) obj; - if(x != other.x) - return false; - if(y != other.y) - return false; - if(z != other.z) - return false; - return true; - } - - public BlockVector toBlockVector() - { - return new BlockVector(x, y, z); - } -} diff --git a/src/main/java/ninja/bytecode/iris/legacy/SChunkVector.java b/src/main/java/ninja/bytecode/iris/legacy/SChunkVector.java deleted file mode 100644 index 79dd8bbb0..000000000 --- a/src/main/java/ninja/bytecode/iris/legacy/SChunkVector.java +++ /dev/null @@ -1,76 +0,0 @@ -package ninja.bytecode.iris.legacy; - -public class SChunkVector -{ - private byte x; - private byte z; - - public SChunkVector(int x, int z) - { - this.x = (byte) (x); - this.z = (byte) (z); - } - - public SChunkVector(byte x, byte z) - { - this.x = x; - this.z = z; - } - - public SChunkVector(double x, double z) - { - this((int) Math.round(x), (int) Math.round(z)); - } - - public SChunkVector() - { - this((byte) 0, (byte) 0); - } - - public int getX() - { - return x; - } - - public void setX(int x) - { - this.x = (byte) x; - } - - public int getZ() - { - return z; - } - - public void setZ(int z) - { - this.z = (byte) z; - } - - @Override - public int hashCode() - { - final int prime = 31; - int result = 1; - result = prime * result + x; - result = prime * result + z; - return result; - } - - @Override - public boolean equals(Object obj) - { - if(this == obj) - return true; - if(obj == null) - return false; - if(getClass() != obj.getClass()) - return false; - SChunkVector other = (SChunkVector) obj; - if(x != other.x) - return false; - if(z != other.z) - return false; - return true; - } -} diff --git a/src/main/java/ninja/bytecode/iris/legacy/SChunkVectorShort.java b/src/main/java/ninja/bytecode/iris/legacy/SChunkVectorShort.java deleted file mode 100644 index db6f33f49..000000000 --- a/src/main/java/ninja/bytecode/iris/legacy/SChunkVectorShort.java +++ /dev/null @@ -1,72 +0,0 @@ -package ninja.bytecode.iris.legacy; - -import java.util.Objects; - -public class SChunkVectorShort -{ - private short x; - private short z; - - public SChunkVectorShort(int x, int z) - { - this.x = (short) (x); - this.z = (short) (z); - } - - public SChunkVectorShort(short x, short z) - { - this.x = x; - this.z = z; - } - - public SChunkVectorShort(double x, double z) - { - this((int) Math.round(x), (int) Math.round(z)); - } - - public SChunkVectorShort() - { - this((short) 0, (short) 0); - } - - public int getX() - { - return x; - } - - public void setX(int x) - { - this.x = (short) x; - } - - public int getZ() - { - return z; - } - - public void setZ(int z) - { - this.z = (short) z; - } - - @Override - public int hashCode() - { - return Objects.hash(x, z); - } - - @Override - public boolean equals(Object obj) - { - if(this == obj) - { - return true; - } - if(!(obj instanceof SChunkVectorShort)) - { - return false; - } - SChunkVectorShort other = (SChunkVectorShort) obj; - return x == other.x && z == other.z; - } -} diff --git a/src/main/java/ninja/bytecode/iris/legacy/SMCAVector.java b/src/main/java/ninja/bytecode/iris/legacy/SMCAVector.java deleted file mode 100644 index 3f795eb6c..000000000 --- a/src/main/java/ninja/bytecode/iris/legacy/SMCAVector.java +++ /dev/null @@ -1,61 +0,0 @@ -package ninja.bytecode.iris.legacy; - -import java.util.Objects; - -public class SMCAVector -{ - private int x; - private int z; - - public SMCAVector(int x, int z) - { - this.x = x; - this.z = z; - } - - public SMCAVector() - { - this(0, 0); - } - - public int getX() - { - return x; - } - - public void setX(int x) - { - this.x = x; - } - - public int getZ() - { - return z; - } - - public void setZ(int z) - { - this.z = z; - } - - @Override - public int hashCode() - { - return Objects.hash(x, z); - } - - @Override - public boolean equals(Object obj) - { - if(this == obj) - { - return true; - } - if(!(obj instanceof SMCAVector)) - { - return false; - } - SMCAVector other = (SMCAVector) obj; - return x == other.x && z == other.z; - } -} diff --git a/src/main/java/ninja/bytecode/iris/legacy/SuperUnsafe.java b/src/main/java/ninja/bytecode/iris/legacy/SuperUnsafe.java deleted file mode 100644 index b15f22429..000000000 --- a/src/main/java/ninja/bytecode/iris/legacy/SuperUnsafe.java +++ /dev/null @@ -1,19 +0,0 @@ -package ninja.bytecode.iris.legacy; - -import org.bukkit.Bukkit; -import org.bukkit.Material; -import org.bukkit.block.data.BlockData; - -@SuppressWarnings("deprecation") -public class SuperUnsafe -{ - public static Material getMaterial(String material, byte d) - { - return Bukkit.getUnsafe().getMaterial(material, d); - } - - public static BlockData getBlockData(String material, byte d) - { - return Bukkit.getUnsafe().fromLegacy(Bukkit.getUnsafe().toLegacy(getMaterial(material, d)), d); - } -} diff --git a/src/main/java/ninja/bytecode/iris/object/Envelope.java b/src/main/java/ninja/bytecode/iris/object/Envelope.java new file mode 100644 index 000000000..76a122d39 --- /dev/null +++ b/src/main/java/ninja/bytecode/iris/object/Envelope.java @@ -0,0 +1,8 @@ +package ninja.bytecode.iris.object; + +public enum Envelope +{ + EVERYWHERE, + CELLS, + VEINS, +} diff --git a/src/main/java/ninja/bytecode/iris/object/IrisBiome.java b/src/main/java/ninja/bytecode/iris/object/IrisBiome.java index fc708fda7..02e2ba4bc 100644 --- a/src/main/java/ninja/bytecode/iris/object/IrisBiome.java +++ b/src/main/java/ninja/bytecode/iris/object/IrisBiome.java @@ -58,6 +58,9 @@ public class IrisBiome extends IrisRegistrant @Desc("Generators for this biome. Multiple generators with different interpolation sizes will mix with other biomes how you would expect. This defines your biome height relative to the fluid height. Use negative for oceans.") private KList generators = new KList().qadd(new IrisBiomeGeneratorLink()); + @Desc("Define biome deposit generators that add onto the existing regional and global deposit generators") + private KList deposits = new KList<>(); + private transient ReentrantLock lock = new ReentrantLock(); private transient CellGenerator childrenCell; private transient InferredType inferredType; diff --git a/src/main/java/ninja/bytecode/iris/object/IrisBiomePaletteLayer.java b/src/main/java/ninja/bytecode/iris/object/IrisBiomePaletteLayer.java index 10f039153..6e0a1cacd 100644 --- a/src/main/java/ninja/bytecode/iris/object/IrisBiomePaletteLayer.java +++ b/src/main/java/ninja/bytecode/iris/object/IrisBiomePaletteLayer.java @@ -31,9 +31,9 @@ public class IrisBiomePaletteLayer private KList palette = new KList().qadd("GRASS_BLOCK"); private transient ReentrantLock lock = new ReentrantLock(); + private transient KList blockData; private transient CNG layerGenerator; private transient CNG heightGenerator; - private transient KList blockData; public CNG getHeightGenerator(RNG rng) { diff --git a/src/main/java/ninja/bytecode/iris/object/IrisDepositGenerator.java b/src/main/java/ninja/bytecode/iris/object/IrisDepositGenerator.java new file mode 100644 index 000000000..5cd12068d --- /dev/null +++ b/src/main/java/ninja/bytecode/iris/object/IrisDepositGenerator.java @@ -0,0 +1,152 @@ +package ninja.bytecode.iris.object; + +import java.util.concurrent.locks.ReentrantLock; + +import org.bukkit.block.data.BlockData; +import org.bukkit.util.BlockVector; + +import lombok.Data; +import ninja.bytecode.iris.Iris; +import ninja.bytecode.iris.generator.ParallaxChunkGenerator; +import ninja.bytecode.iris.util.BlockDataTools; +import ninja.bytecode.iris.util.Desc; +import ninja.bytecode.iris.util.RNG; +import ninja.bytecode.shuriken.collections.KList; + +@Data +public class IrisDepositGenerator +{ + @Desc("The minimum height this deposit can generate at") + private int minHeight = 7; + + @Desc("The maximum height this deposit can generate at") + private int maxHeight = 55; + + @Desc("The minimum amount of deposit blocks per clump") + private int minSize = 3; + + @Desc("The maximum amount of deposit blocks per clump") + private int maxSize = 5; + + @Desc("The maximum amount of clumps per chunk") + private int maxPerChunk = 3; + + @Desc("The minimum amount of clumps per chunk") + private int minPerChunk = 1; + + @Desc("The palette of blocks to be used in this deposit generator") + private KList palette = new KList(); + + @Desc("Ore varience is how many different objects clumps iris will create") + private int varience = 8; + + private transient IrisObjectPlacement config = createDepositConfig(); + private transient ReentrantLock lock = new ReentrantLock(); + private transient KList objects; + private transient KList blockData; + + public IrisObject getClump(RNG rng) + { + lock.lock(); + + if(objects == null) + { + RNG rngv = rng.nextParallelRNG(3957778); + objects = new KList<>(); + + for(int i = 0; i < varience; i++) + { + objects.add(generateClumpObject(rngv.nextParallelRNG(2349 * i + 3598))); + Iris.info("Generated Object: " + "plugins\\Iris\\virtual-pack\\deposit-" + rng.i(10000, 50000) + "-" + (i + 1)); + } + } + + lock.unlock(); + return objects.get(rng.i(0, objects.size() - 1)); + } + + private IrisObjectPlacement createDepositConfig() + { + IrisObjectPlacement p = new IrisObjectPlacement(); + IrisObjectRotation rot = new IrisObjectRotation(); + rot.setEnabled(true); + IrisAxisRotationClamp xc = new IrisAxisRotationClamp(); + IrisAxisRotationClamp yc = new IrisAxisRotationClamp(); + IrisAxisRotationClamp zc = new IrisAxisRotationClamp(); + xc.setEnabled(true); + xc.setInterval(45); + yc.setEnabled(true); + yc.setInterval(45); + zc.setEnabled(true); + zc.setInterval(45); + rot.setXAxis(xc); + rot.setYAxis(yc); + rot.setZAxis(zc); + p.setRotation(rot); + + return p; + } + + private IrisObject generateClumpObject(RNG rngv) + { + int s = rngv.i(minSize, maxSize); + int dim = (int) Math.round(Math.pow(s, 1D / 3D)); + int w = dim / 2; + IrisObject o = new IrisObject(dim, dim, dim); + + if(s == 1) + { + o.getBlocks().put(o.getCenter(), nextBlock(rngv)); + } + + else + { + while(s > 0) + { + s--; + BlockVector ang = new BlockVector(rngv.i(-w, w), rngv.i(-w, w), rngv.i(-w, w)); + BlockVector pos = o.getCenter().clone().add(ang).toBlockVector(); + o.getBlocks().put(pos, nextBlock(rngv)); + } + } + + return o; + } + + private BlockData nextBlock(RNG rngv) + { + return getBlockData().get(rngv.i(0, getBlockData().size() - 1)); + } + + public KList getBlockData() + { + lock.lock(); + + if(blockData == null) + { + blockData = new KList<>(); + + for(String ix : palette) + { + BlockData bx = BlockDataTools.getBlockData(ix); + + if(bx != null) + { + blockData.add(bx); + } + } + } + + lock.unlock(); + + return blockData; + } + + public void generate(int x, int z, RNG rng, ParallaxChunkGenerator g) + { + IrisObject clump = getClump(rng); + int height = (int) (g.getHighestGround(x, z) - (clump.getH() * 1.5)); + int h = rng.i(Math.max(0, minHeight), Math.min(height, Math.min(256, maxHeight))); + clump.place(x, h, z, g, config, rng); + } +} diff --git a/src/main/java/ninja/bytecode/iris/object/IrisDimension.java b/src/main/java/ninja/bytecode/iris/object/IrisDimension.java index b51da1891..db118c24a 100644 --- a/src/main/java/ninja/bytecode/iris/object/IrisDimension.java +++ b/src/main/java/ninja/bytecode/iris/object/IrisDimension.java @@ -1,9 +1,13 @@ package ninja.bytecode.iris.object; +import java.util.concurrent.locks.ReentrantLock; + import org.bukkit.World.Environment; +import org.bukkit.block.data.BlockData; import lombok.Data; import lombok.EqualsAndHashCode; +import ninja.bytecode.iris.util.BlockDataTools; import ninja.bytecode.iris.util.CNG; import ninja.bytecode.iris.util.Desc; import ninja.bytecode.iris.util.RNG; @@ -23,11 +27,24 @@ public class IrisDimension extends IrisRegistrant @Desc("The interpolation distance scale. Increase = more smooth, less detail") private double interpolationScale = 63; + @Desc("The Thickness scale of cave veins") private double caveThickness = 1D; + + @Desc("The cave web scale. Smaller values means scaled up vein networks.") private double caveScale = 1D; + + @Desc("Shift the Y value of the cave networks up or down.") private double caveShift = 0D; + + @Desc("Generate caves or not.") private boolean caves = true; + @Desc("The ceiling dimension. Leave blank for normal sky.") + private String ceiling = ""; + + @Desc("Mirrors the generator floor into the ceiling. Think nether but worse...") + private boolean mirrorCeiling = false; + @Desc("The world environment") private Environment environment = Environment.NORMAL; @@ -79,10 +96,35 @@ public class IrisDimension extends IrisRegistrant @Desc("Disable this to stop placing schematics in biomes") private boolean placeObjects = true; + @Desc("Prevent Leaf decay as if placed in creative mode") + private boolean preventLeafDecay = false; + + @Desc("Define global deposit generators") + private KList deposits = new KList<>(); + + @Desc("The dispersion of materials for the rock palette") + private Dispersion dispersion = Dispersion.SCATTER; + + @Desc("The rock zoom mostly for zooming in on a wispy palette") + private double rockZoom = 5; + + @Desc("The palette of blocks for 'stone'") + private KList rockPalette = new KList().qadd("STONE"); + + @Desc("The palette of blocks for 'water'") + private KList fluidPalette = new KList().qadd("WATER"); + + private transient ReentrantLock rockLock = new ReentrantLock(); + private transient ReentrantLock fluidLock = new ReentrantLock(); + private transient KList rockData; + private transient KList fluidData; + private transient CNG rockLayerGenerator; + private transient CNG fluidLayerGenerator; private transient CNG coordFracture; private transient Double sinr; private transient Double cosr; private transient Double rad; + private transient boolean inverted; public CNG getCoordFracture(RNG rng, int signature) { @@ -95,6 +137,126 @@ public class IrisDimension extends IrisRegistrant return coordFracture; } + public BlockData getRock(RNG rng, double x, double y, double z) + { + if(rockLayerGenerator == null) + { + cacheRockGenerator(rng); + } + + if(rockLayerGenerator != null) + { + if(dispersion.equals(Dispersion.SCATTER)) + { + return getRockData().get(rockLayerGenerator.fit(0, 30000000, x, y, z) % getRockData().size()); + } + + else + { + return getRockData().get(rockLayerGenerator.fit(0, getRockData().size() - 1, x, y, z)); + } + } + + return getRockData().get(0); + } + + public void cacheRockGenerator(RNG rng) + { + RNG rngx = rng.nextParallelRNG(getRockData().size() * hashCode()); + + switch(dispersion) + { + case SCATTER: + rockLayerGenerator = CNG.signature(rngx).freq(1000000); + break; + case WISPY: + rockLayerGenerator = CNG.signature(rngx); + break; + } + } + + public KList getRockData() + { + rockLock.lock(); + + if(rockData == null) + { + rockData = new KList<>(); + for(String ix : rockPalette) + { + BlockData bx = BlockDataTools.getBlockData(ix); + if(bx != null) + { + rockData.add(bx); + } + } + } + + rockLock.unlock(); + + return rockData; + } + + public BlockData getFluid(RNG rng, double x, double y, double z) + { + if(fluidLayerGenerator == null) + { + cacheFluidGenerator(rng); + } + + if(fluidLayerGenerator != null) + { + if(dispersion.equals(Dispersion.SCATTER)) + { + return getFluidData().get(fluidLayerGenerator.fit(0, 30000000, x, y, z) % getFluidData().size()); + } + + else + { + return getFluidData().get(fluidLayerGenerator.fit(0, getFluidData().size() - 1, x, y, z)); + } + } + + return getFluidData().get(0); + } + + public void cacheFluidGenerator(RNG rng) + { + RNG rngx = rng.nextParallelRNG(getFluidData().size() * hashCode()); + + switch(dispersion) + { + case SCATTER: + fluidLayerGenerator = CNG.signature(rngx).freq(1000000); + break; + case WISPY: + fluidLayerGenerator = CNG.signature(rngx); + break; + } + } + + public KList getFluidData() + { + fluidLock.lock(); + + if(fluidData == null) + { + fluidData = new KList<>(); + for(String ix : fluidPalette) + { + BlockData bx = BlockDataTools.getBlockData(ix); + if(bx != null) + { + fluidData.add(bx); + } + } + } + + fluidLock.unlock(); + + return fluidData; + } + public double getDimensionAngle() { if(rad == null) diff --git a/src/main/java/ninja/bytecode/iris/object/IrisObject.java b/src/main/java/ninja/bytecode/iris/object/IrisObject.java index ffaed4e47..d9f04dfb5 100644 --- a/src/main/java/ninja/bytecode/iris/object/IrisObject.java +++ b/src/main/java/ninja/bytecode/iris/object/IrisObject.java @@ -10,12 +10,15 @@ import java.io.InputStream; import java.io.OutputStream; import org.bukkit.Location; +import org.bukkit.Material; import org.bukkit.block.data.BlockData; +import org.bukkit.block.data.type.Leaves; import org.bukkit.util.BlockVector; import lombok.Data; import lombok.EqualsAndHashCode; import ninja.bytecode.iris.util.BlockDataTools; +import ninja.bytecode.iris.util.ChunkPosition; import ninja.bytecode.iris.util.IObjectPlacer; import ninja.bytecode.iris.util.RNG; import ninja.bytecode.shuriken.collections.KMap; @@ -24,6 +27,8 @@ import ninja.bytecode.shuriken.collections.KMap; @EqualsAndHashCode(callSuper = false) public class IrisObject extends IrisRegistrant { + private static final Material SNOW = Material.SNOW; + private static final BlockData[] SNOW_LAYERS = new BlockData[] {BlockDataTools.getBlockData("minecraft:snow[layers=1]"), BlockDataTools.getBlockData("minecraft:snow[layers=2]"), BlockDataTools.getBlockData("minecraft:snow[layers=3]"), BlockDataTools.getBlockData("minecraft:snow[layers=4]"), BlockDataTools.getBlockData("minecraft:snow[layers=5]"), BlockDataTools.getBlockData("minecraft:snow[layers=6]"), BlockDataTools.getBlockData("minecraft:snow[layers=7]"), BlockDataTools.getBlockData("minecraft:snow[layers=8]")}; private KMap blocks; private int w; private int d; @@ -115,20 +120,84 @@ public class IrisObject extends IrisRegistrant } public void place(int x, int z, IObjectPlacer placer, IrisObjectPlacement config, RNG rng) + { + place(x, -1, z, placer, config, rng); + } + + public void place(int x, int yv, int z, IObjectPlacer placer, IrisObjectPlacement config, RNG rng) { boolean yf = rng.nextBoolean(); boolean xf = rng.nextBoolean(); int spinx = rng.imax() / 1000; int spiny = rng.imax() / 1000; int spinz = rng.imax() / 1000; - int y = placer.getHighest(x, z) + config.getRotation().rotate(new BlockVector(0, getCenter().getBlockY(), 0), yf, xf, spinx, spiny, spinz).getBlockY(); - + int y = yv < 0 ? placer.getHighest(x, z) + config.getRotation().rotate(new BlockVector(0, getCenter().getBlockY(), 0), yf, xf, spinx, spiny, spinz).getBlockY() : yv; + KMap heightmap = config.getSnow() > 0 ? new KMap<>() : null; + for(BlockVector g : blocks.k()) { BlockVector i = g.clone(); i = config.getRotation().rotate(i.clone(), yf, xf, spinx, spiny, spinz).clone(); i = config.getTranslate().translate(i.clone()).clone(); - placer.set(x + i.getBlockX(), y + i.getBlockY(), z + i.getBlockZ(), blocks.get(g)); + BlockData data = blocks.get(g); + + if(placer.isPreventingDecay() && data instanceof Leaves && !((Leaves) data).isPersistent()) + { + ((Leaves) data).setPersistent(true); + } + + for(IrisObjectReplace j : config.getEdit()) + { + if(j.getFind().matches(data)) + { + data = j.getReplace(); + } + } + + int xx = x + (int) Math.round(i.getX()); + int yy = y + (int) Math.round(i.getY()); + int zz = z + (int) Math.round(i.getZ()); + + if(heightmap != null) + { + ChunkPosition pos = new ChunkPosition(xx, zz); + + if(!heightmap.containsKey(pos)) + { + heightmap.put(pos, yy); + } + + if(heightmap.get(pos) < yy) + { + heightmap.put(pos, yy); + } + } + + placer.set(xx, yy, zz, data); + } + + if(heightmap != null) + { + RNG rngx = rng.nextParallelRNG(3468854); + + for(ChunkPosition i : heightmap.k()) + { + int vx = i.getX(); + int vy = heightmap.get(i); + int vz = i.getZ(); + + if(config.getSnow() > 0) + { + BlockData bd = placer.get(vx, vy, vz); + if(bd != null && bd.getMaterial().equals(SNOW)) + { + continue; + } + + int height = rngx.i(0, (int) (config.getSnow() * 7)); + placer.set(vx, vy + 1, vz, SNOW_LAYERS[Math.max(Math.min(height, 7), 0)]); + } + } } } diff --git a/src/main/java/ninja/bytecode/iris/object/IrisObjectPlacement.java b/src/main/java/ninja/bytecode/iris/object/IrisObjectPlacement.java index c49350615..8327e3fcd 100644 --- a/src/main/java/ninja/bytecode/iris/object/IrisObjectPlacement.java +++ b/src/main/java/ninja/bytecode/iris/object/IrisObjectPlacement.java @@ -11,12 +11,22 @@ public class IrisObjectPlacement { @Desc("List of objects to place") private KList place = new KList<>(); + + @Desc("Find and replace blocks") + private KList edit = new KList<>(); + @Desc("Translate this object's placement") private IrisObjectTranslate translate = new IrisObjectTranslate(); + @Desc("Rotate this objects placement") private IrisObjectRotation rotation = new IrisObjectRotation(); + + @Desc("The maximum layer level of a snow filter overtop of this placement. Set to 0 to disable. Max of 1.") + private double snow = 0; + @Desc("The chance for this to place in a chunk. If you need multiple per chunk, set this to 1 and use density.") private double chance = 1; + @Desc("If the chance check passes, place this many in a single chunk") private int density = 1; diff --git a/src/main/java/ninja/bytecode/iris/object/IrisObjectReplace.java b/src/main/java/ninja/bytecode/iris/object/IrisObjectReplace.java new file mode 100644 index 000000000..5d1e8fd68 --- /dev/null +++ b/src/main/java/ninja/bytecode/iris/object/IrisObjectReplace.java @@ -0,0 +1,46 @@ +package ninja.bytecode.iris.object; + +import java.util.concurrent.locks.ReentrantLock; + +import org.bukkit.block.data.BlockData; + +import lombok.Data; +import ninja.bytecode.iris.util.BlockDataTools; +import ninja.bytecode.iris.util.Desc; + +@Desc("Find and replace object materials") +@Data +public class IrisObjectReplace +{ + private String find; + private String replace; + + private transient ReentrantLock lock = new ReentrantLock(); + private transient BlockData findData; + private transient BlockData replaceData; + + public IrisObjectReplace() + { + + } + + public BlockData getFind() + { + if(findData == null) + { + findData = BlockDataTools.getBlockData(find); + } + + return findData; + } + + public BlockData getReplace() + { + if(replaceData == null) + { + replaceData = BlockDataTools.getBlockData(replace); + } + + return replaceData; + } +} diff --git a/src/main/java/ninja/bytecode/iris/object/IrisRegion.java b/src/main/java/ninja/bytecode/iris/object/IrisRegion.java index 94014b3dd..e8bd56994 100644 --- a/src/main/java/ninja/bytecode/iris/object/IrisRegion.java +++ b/src/main/java/ninja/bytecode/iris/object/IrisRegion.java @@ -46,6 +46,9 @@ public class IrisRegion extends IrisRegistrant @Desc("Spot biomes splotch themselves across this region like lakes") private KList spotBiomes = new KList<>(); + @Desc("Define regional deposit generators that add onto the global deposit generators") + private KList deposits = new KList<>(); + private transient CNG shoreHeightGenerator; private transient ReentrantLock lock = new ReentrantLock(); diff --git a/src/main/java/ninja/bytecode/iris/object/atomics/AtomicSliver.java b/src/main/java/ninja/bytecode/iris/object/atomics/AtomicSliver.java index 8e7e1eb58..d915e7425 100644 --- a/src/main/java/ninja/bytecode/iris/object/atomics/AtomicSliver.java +++ b/src/main/java/ninja/bytecode/iris/object/atomics/AtomicSliver.java @@ -4,6 +4,7 @@ import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; +import org.bukkit.Material; import org.bukkit.block.Biome; import org.bukkit.block.data.BlockData; import org.bukkit.generator.ChunkGenerator.BiomeGrid; @@ -21,6 +22,7 @@ public class AtomicSliver private KMap block; private KMap biome; private int highestBlock = 0; + private int highestGround = 0; private int highestBiome = 0; private int x; private int z; @@ -42,6 +44,11 @@ public class AtomicSliver block.put(h, d); highestBlock = h > highestBlock ? h : highestBlock; + + if(!d.getMaterial().equals(Material.WATER) && !d.getMaterial().equals(Material.LAVA)) + { + highestGround = h > highestGround ? h : highestGround; + } } public void setSilently(int h, BlockData d) @@ -96,6 +103,9 @@ public class AtomicSliver { this.block = new KMap(); int h = din.readByte() - Byte.MIN_VALUE; + highestBlock = h; + highestGround = din.readByte() - Byte.MIN_VALUE; + for(int i = 0; i <= h; i++) { block.put(i, BlockDataTools.getBlockData(din.readUTF())); @@ -105,6 +115,7 @@ public class AtomicSliver public void write(DataOutputStream dos) throws IOException { dos.writeByte(highestBlock + Byte.MIN_VALUE); + dos.writeByte(highestGround + Byte.MIN_VALUE); for(int i = 0; i <= highestBlock; i++) { @@ -132,7 +143,7 @@ public class AtomicSliver public void inject(ChunkData currentData) { - for(int i = 0; i < getHighestBlock(); i++) + for(int i = 0; i < 256; i++) { if(block.get(i) != null && !block.get(i).equals(AIR)) { diff --git a/src/main/java/ninja/bytecode/iris/object/atomics/AtomicWorldData.java b/src/main/java/ninja/bytecode/iris/object/atomics/AtomicWorldData.java index a64315a30..86ea1f7f9 100644 --- a/src/main/java/ninja/bytecode/iris/object/atomics/AtomicWorldData.java +++ b/src/main/java/ninja/bytecode/iris/object/atomics/AtomicWorldData.java @@ -17,13 +17,15 @@ public class AtomicWorldData private KMap loadedChunks; private KMap loadedSections; private KMap lastRegion; + private String prefix; - public AtomicWorldData(World world) + public AtomicWorldData(World world, String prefix) { this.world = world; loadedSections = new KMap<>(); loadedChunks = new KMap<>(); lastRegion = new KMap<>(); + this.prefix = prefix; getSubregionFolder().mkdirs(); } @@ -226,7 +228,7 @@ public class AtomicWorldData public File getSubregionFolder() { - return new File(world.getWorldFolder(), "subregion"); + return new File(world.getWorldFolder(), "subregion-" + prefix); } public KMap getLoadedChunks() diff --git a/src/main/java/ninja/bytecode/iris/util/IObjectPlacer.java b/src/main/java/ninja/bytecode/iris/util/IObjectPlacer.java index 2229cfc1b..4c2aa21c8 100644 --- a/src/main/java/ninja/bytecode/iris/util/IObjectPlacer.java +++ b/src/main/java/ninja/bytecode/iris/util/IObjectPlacer.java @@ -9,4 +9,6 @@ public interface IObjectPlacer public void set(int x, int y, int z, BlockData d); public BlockData get(int x, int y, int z); + + public boolean isPreventingDecay(); } diff --git a/src/main/java/ninja/bytecode/iris/util/InvertedBiomeGrid.java b/src/main/java/ninja/bytecode/iris/util/InvertedBiomeGrid.java new file mode 100644 index 000000000..79bc75815 --- /dev/null +++ b/src/main/java/ninja/bytecode/iris/util/InvertedBiomeGrid.java @@ -0,0 +1,40 @@ +package ninja.bytecode.iris.util; + +import org.bukkit.block.Biome; +import org.bukkit.generator.ChunkGenerator.BiomeGrid; + +public class InvertedBiomeGrid implements BiomeGrid +{ + private BiomeGrid grid; + + public InvertedBiomeGrid(BiomeGrid real) + { + this.grid = real; + } + + @SuppressWarnings("deprecation") + @Override + public Biome getBiome(int arg0, int arg1) + { + return grid.getBiome(arg0, arg1); + } + + @Override + public Biome getBiome(int arg0, int arg1, int arg2) + { + return grid.getBiome(arg0, 255 - arg1, arg2); + } + + @SuppressWarnings("deprecation") + @Override + public void setBiome(int arg0, int arg1, Biome arg2) + { + grid.setBiome(arg0, arg1, arg2); + } + + @Override + public void setBiome(int arg0, int arg1, int arg2, Biome arg3) + { + grid.setBiome(arg0, 255 - arg1, arg2, arg3); + } +} diff --git a/src/main/java/ninja/bytecode/iris/util/ObjectResourceLoader.java b/src/main/java/ninja/bytecode/iris/util/ObjectResourceLoader.java index e04d5cf49..4cf6fce64 100644 --- a/src/main/java/ninja/bytecode/iris/util/ObjectResourceLoader.java +++ b/src/main/java/ninja/bytecode/iris/util/ObjectResourceLoader.java @@ -50,7 +50,6 @@ public class ObjectResourceLoader extends ResourceLoader x = x % 2 == 0 ? x + 1 : x; z = z % 2 == 0 ? z + 1 : z; parallaxSize = new ChunkPosition(x, z); - Iris.info("Parallax View Distance: " + x + "x" + z); } lock.unlock(); @@ -68,6 +67,7 @@ public class ObjectResourceLoader extends ResourceLoader Iris.hotloader.track(j); Iris.info("Loading " + resourceTypeName + ": " + j.getPath()); t.setLoadKey(name); + parallaxSize = null; lock.unlock(); return t; } diff --git a/src/main/java/ninja/bytecode/iris/util/PhasicBiomeStorage.java b/src/main/java/ninja/bytecode/iris/util/PhasicBiomeStorage.java new file mode 100644 index 000000000..5c1e1aa32 --- /dev/null +++ b/src/main/java/ninja/bytecode/iris/util/PhasicBiomeStorage.java @@ -0,0 +1,58 @@ +package ninja.bytecode.iris.util; + +import org.bukkit.block.Biome; + +public class PhasicBiomeStorage +{ + private static final int e = (int) Math.round(Math.log(16.0D) / Math.log(2.0D)) - 2; + private static final int f = (int) Math.round(Math.log(256.0D) / Math.log(2.0D)) - 2; + public static final int a; + public static final int b; + public static final int c; + private final Biome[] g; + + static + { + a = 1 << e + e + f; + b = (1 << e) - 1; + c = (1 << f) - 1; + } + + public PhasicBiomeStorage(Biome[] abiomebase) + { + this.g = abiomebase; + } + + public PhasicBiomeStorage() + { + this(new Biome[a]); + } + + public static int clamp(int var0, int var1, int var2) + { + if(var0 < var1) + { + return var1; + } + else + { + return var0 > var2 ? var2 : var0; + } + } + + public Biome getBiome(int i, int j, int k) + { + int l = i & b; + int i1 = clamp(j, 0, c); + int j1 = k & b; + return this.g[i1 << e + e | j1 << e | l]; + } + + public void setBiome(int i, int j, int k, Biome biome) + { + int l = i & b; + int i1 = clamp(j, 0, c); + int j1 = k & b; + this.g[i1 << e + e | j1 << e | l] = biome; + } +}