mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-03 00:17:15 +00:00
sdf
This commit is contained in:
parent
fc2abb0f3c
commit
4199824275
@ -1,5 +1,6 @@
|
|||||||
package ninja.bytecode.iris;
|
package ninja.bytecode.iris;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
@ -69,8 +70,6 @@ public class Iris extends JavaPlugin implements Listener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, () -> {
|
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, () -> {
|
||||||
for(World i : Bukkit.getWorlds())
|
for(World i : Bukkit.getWorlds())
|
||||||
{
|
{
|
||||||
@ -86,6 +85,24 @@ public class Iris extends JavaPlugin implements Listener
|
|||||||
}, 0, 15);
|
}, 0, 15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void convert(File folder)
|
||||||
|
{
|
||||||
|
if(!folder.exists())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(folder.isFile())
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
for(File i : folder.listFiles())
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private int getTC()
|
private int getTC()
|
||||||
{
|
{
|
||||||
switch(settings.performance.performanceMode)
|
switch(settings.performance.performanceMode)
|
||||||
|
@ -12,7 +12,7 @@ public class Settings
|
|||||||
public PerformanceMode performanceMode = PerformanceMode.UNLIMITED;
|
public PerformanceMode performanceMode = PerformanceMode.UNLIMITED;
|
||||||
public int threadCount = 12;
|
public int threadCount = 12;
|
||||||
public int threadPriority = Thread.MAX_PRIORITY;
|
public int threadPriority = Thread.MAX_PRIORITY;
|
||||||
public boolean loadonstart = false;
|
public boolean loadonstart = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class GeneratorSettings
|
public static class GeneratorSettings
|
||||||
@ -26,7 +26,7 @@ public class Settings
|
|||||||
public double superHeightScale = 0.95;
|
public double superHeightScale = 0.95;
|
||||||
public double baseHeight = 0.165;
|
public double baseHeight = 0.165;
|
||||||
public int seaLevel = 63;
|
public int seaLevel = 63;
|
||||||
public double caveDensity = 0;
|
public double caveDensity = 1;
|
||||||
public double biomeScale = 2.46;
|
public double biomeScale = 2.46;
|
||||||
public boolean flatBedrock = false;
|
public boolean flatBedrock = false;
|
||||||
public boolean doSchematics = true;
|
public boolean doSchematics = true;
|
||||||
|
@ -146,7 +146,7 @@ public class WandManager implements Listener
|
|||||||
if(e.getMessage().startsWith("/iload "))
|
if(e.getMessage().startsWith("/iload "))
|
||||||
{
|
{
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
Schematic s = new Schematic(1, 1, 1, 1, 1, 1);
|
Schematic s = new Schematic(1, 1, 1);
|
||||||
File f = new File(Iris.instance.getDataFolder(), "schematics/" + e.getMessage().split("\\Q \\E")[1] + ".ish");
|
File f = new File(Iris.instance.getDataFolder(), "schematics/" + e.getMessage().split("\\Q \\E")[1] + ".ish");
|
||||||
if(!f.exists())
|
if(!f.exists())
|
||||||
{
|
{
|
||||||
|
@ -103,6 +103,7 @@ public class IrisBiome
|
|||||||
public static final IrisBiome SWAMP = new IrisBiome("Swamp", Biome.SWAMPLAND)
|
public static final IrisBiome SWAMP = new IrisBiome("Swamp", Biome.SWAMPLAND)
|
||||||
.scatter(MB.of(Material.LONG_GRASS, 1), 0.04)
|
.scatter(MB.of(Material.LONG_GRASS, 1), 0.04)
|
||||||
.schematic("tree/willow", 2.5)
|
.schematic("tree/willow", 2.5)
|
||||||
|
.schematic("tree/god/willow", 0.01)
|
||||||
.schematic("boulder", 0.02)
|
.schematic("boulder", 0.02)
|
||||||
.scatter(MB.of(Material.LONG_GRASS, 2), 0.03);
|
.scatter(MB.of(Material.LONG_GRASS, 2), 0.03);
|
||||||
public static final IrisBiome PLAINS = new IrisBiome("Plains", Biome.PLAINS)
|
public static final IrisBiome PLAINS = new IrisBiome("Plains", Biome.PLAINS)
|
||||||
@ -151,6 +152,7 @@ public class IrisBiome
|
|||||||
.scatter(MB.of(Material.LONG_GRASS, 1), 0.13)
|
.scatter(MB.of(Material.LONG_GRASS, 1), 0.13)
|
||||||
.scatter(MB.of(Material.LONG_GRASS, 2), 0.13)
|
.scatter(MB.of(Material.LONG_GRASS, 2), 0.13)
|
||||||
.schematic("tree/willow", 1.21)
|
.schematic("tree/willow", 1.21)
|
||||||
|
.schematic("tree/god/willow", 0.04)
|
||||||
.schematic("tree/oak", 0.71)
|
.schematic("tree/oak", 0.71)
|
||||||
.schematic("boulder", 0.01)
|
.schematic("boulder", 0.01)
|
||||||
.schematic("boulder/smooth", 0.02)
|
.schematic("boulder/smooth", 0.02)
|
||||||
|
@ -26,19 +26,13 @@ public class Schematic
|
|||||||
private int w;
|
private int w;
|
||||||
private int h;
|
private int h;
|
||||||
private int d;
|
private int d;
|
||||||
private int x;
|
|
||||||
private int y;
|
|
||||||
private int z;
|
|
||||||
private final GMap<BlockVector, MB> s;
|
private final GMap<BlockVector, MB> s;
|
||||||
|
|
||||||
public Schematic(int w, int h, int d, int x, int y, int z)
|
public Schematic(int w, int h, int d)
|
||||||
{
|
{
|
||||||
this.w = w;
|
this.w = w;
|
||||||
this.h = h;
|
this.h = h;
|
||||||
this.d = d;
|
this.d = d;
|
||||||
this.x = x;
|
|
||||||
this.y = y;
|
|
||||||
this.z = z;
|
|
||||||
s = new GMap<>();
|
s = new GMap<>();
|
||||||
centeredHeight = false;
|
centeredHeight = false;
|
||||||
}
|
}
|
||||||
@ -63,21 +57,6 @@ public class Schematic
|
|||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getX()
|
|
||||||
{
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getY()
|
|
||||||
{
|
|
||||||
return y;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getZ()
|
|
||||||
{
|
|
||||||
return z;
|
|
||||||
}
|
|
||||||
|
|
||||||
public GMap<BlockVector, MB> getSchematic()
|
public GMap<BlockVector, MB> getSchematic()
|
||||||
{
|
{
|
||||||
return s;
|
return s;
|
||||||
@ -91,9 +70,9 @@ public class Schematic
|
|||||||
w = din.readInt();
|
w = din.readInt();
|
||||||
h = din.readInt();
|
h = din.readInt();
|
||||||
d = din.readInt();
|
d = din.readInt();
|
||||||
x = din.readInt();
|
din.readInt();
|
||||||
y = din.readInt();
|
din.readInt();
|
||||||
z = din.readInt();
|
din.readInt();
|
||||||
int l = din.readInt();
|
int l = din.readInt();
|
||||||
clear();
|
clear();
|
||||||
|
|
||||||
@ -113,9 +92,6 @@ public class Schematic
|
|||||||
dos.writeInt(w);
|
dos.writeInt(w);
|
||||||
dos.writeInt(h);
|
dos.writeInt(h);
|
||||||
dos.writeInt(d);
|
dos.writeInt(d);
|
||||||
dos.writeInt(x);
|
|
||||||
dos.writeInt(y);
|
|
||||||
dos.writeInt(z);
|
|
||||||
dos.writeInt(s.size());
|
dos.writeInt(s.size());
|
||||||
|
|
||||||
for(BlockVector i : s.keySet())
|
for(BlockVector i : s.keySet())
|
||||||
@ -130,11 +106,6 @@ public class Schematic
|
|||||||
dos.close();
|
dos.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlockVector getOffset()
|
|
||||||
{
|
|
||||||
return new BlockVector(x, y, z);
|
|
||||||
}
|
|
||||||
|
|
||||||
public MB get(int x, int y, int z)
|
public MB get(int x, int y, int z)
|
||||||
{
|
{
|
||||||
return s.get(new BlockVector(x, y, z));
|
return s.get(new BlockVector(x, y, z));
|
||||||
@ -152,7 +123,7 @@ public class Schematic
|
|||||||
|
|
||||||
public Schematic copy()
|
public Schematic copy()
|
||||||
{
|
{
|
||||||
Schematic s = new Schematic(w, h, d, x, y, z);
|
Schematic s = new Schematic(w, h, d);
|
||||||
s.fill(this.s);
|
s.fill(this.s);
|
||||||
s.centeredHeight = centeredHeight;
|
s.centeredHeight = centeredHeight;
|
||||||
return s;
|
return s;
|
||||||
@ -171,7 +142,7 @@ public class Schematic
|
|||||||
|
|
||||||
public void place(World source, int wx, int wy, int wz)
|
public void place(World source, int wx, int wy, int wz)
|
||||||
{
|
{
|
||||||
Location start = new Location(source, wx, wy, wz).clone().subtract(0, centeredHeight ? h / 2 : 0, 0);
|
Location start = new Location(source, wx, wy, wz).clone().add(w / 2, centeredHeight ? 0 : -(h / 2), d / 2);
|
||||||
|
|
||||||
for(BlockVector i : getSchematic().k())
|
for(BlockVector i : getSchematic().k())
|
||||||
{
|
{
|
||||||
@ -197,7 +168,7 @@ public class Schematic
|
|||||||
|
|
||||||
public static Schematic load(File f) throws IOException
|
public static Schematic load(File f) throws IOException
|
||||||
{
|
{
|
||||||
Schematic s = new Schematic(1, 1, 1, 1, 1, 1);
|
Schematic s = new Schematic(1, 1, 1);
|
||||||
FileInputStream fin = new FileInputStream(f);
|
FileInputStream fin = new FileInputStream(f);
|
||||||
s.read(fin);
|
s.read(fin);
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@ import org.bukkit.inventory.ItemFlag;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
import org.bukkit.util.BlockVector;
|
import org.bukkit.util.BlockVector;
|
||||||
import org.bukkit.util.Vector;
|
|
||||||
|
|
||||||
import ninja.bytecode.iris.schematic.Schematic;
|
import ninja.bytecode.iris.schematic.Schematic;
|
||||||
import ninja.bytecode.shuriken.collections.GList;
|
import ninja.bytecode.shuriken.collections.GList;
|
||||||
@ -36,8 +35,7 @@ public class WandUtil
|
|||||||
{
|
{
|
||||||
Location[] f = getCuboid(wand);
|
Location[] f = getCuboid(wand);
|
||||||
Cuboid c = new Cuboid(f[0], f[1]);
|
Cuboid c = new Cuboid(f[0], f[1]);
|
||||||
Vector v = at.clone().subtract(c.getLowerNE()).toVector();
|
Schematic s = new Schematic(c.getSizeX(), c.getSizeY(), c.getSizeZ());
|
||||||
Schematic s = new Schematic(c.getSizeX(), c.getSizeY(), c.getSizeZ(), v.getBlockX(), v.getBlockY(), v.getBlockZ());
|
|
||||||
Iterator<Block> bb = c.iterator();
|
Iterator<Block> bb = c.iterator();
|
||||||
while(bb.hasNext())
|
while(bb.hasNext())
|
||||||
{
|
{
|
||||||
@ -50,9 +48,13 @@ public class WandUtil
|
|||||||
|
|
||||||
byte data = b.getData();
|
byte data = b.getData();
|
||||||
|
|
||||||
BlockVector bv = b.getLocation().toVector().toBlockVector().subtract(c.getLowerNE().toVector().toBlockVector()).toBlockVector();
|
BlockVector bv = b.getLocation().subtract(c.getCenter()).toVector().toBlockVector();
|
||||||
System.out.println("Load " + bv + " " + b.getType());
|
System.out.println("Load " + bv + " " + b.getType());
|
||||||
s.put(bv.getBlockX(), bv.getBlockY(), bv.getBlockZ(), new MB(b.getType(), data));
|
s.put(bv.getBlockX(),
|
||||||
|
bv.getBlockY(),
|
||||||
|
bv.getBlockZ(),
|
||||||
|
|
||||||
|
new MB(b.getType(), data));
|
||||||
}
|
}
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user