This commit is contained in:
Daniel Mills 2020-10-28 02:10:59 -04:00
parent 6bbe1c8518
commit aa7a1ddd4e
4 changed files with 168 additions and 81 deletions

View File

@ -24,6 +24,8 @@ public class CommandIrisStudioGoto extends MortarCommand
@Override @Override
public boolean handle(MortarSender sender, String[] args) public boolean handle(MortarSender sender, String[] args)
{
try
{ {
if(args.length < 1) if(args.length < 1)
{ {
@ -124,6 +126,14 @@ public class CommandIrisStudioGoto extends MortarCommand
{ {
sender.sendMessage("Players only."); sender.sendMessage("Players only.");
} }
}
catch(Throwable e)
{
Iris.error("Failed goto!");
e.printStackTrace();
sender.sendMessage("We cant seem to aquire a lock on the biome cache. Please report the error in the console to our github. Thanks!");
}
return true; return true;
} }

View File

@ -139,6 +139,11 @@ public abstract class ContextualTerrainProvider implements TerrainProvider, List
public IrisBiome loadBiome(String i) public IrisBiome loadBiome(String i)
{ {
if(getData() == null)
{
return Iris.globaldata.getBiomeLoader().load(i);
}
return getData().getBiomeLoader().load(i); return getData().getBiomeLoader().load(i);
} }

View File

@ -45,7 +45,18 @@ public class GenLayerUpdate extends BlockPopulator
@Override @Override
public void populate(World w, Random r, Chunk c) public void populate(World w, Random r, Chunk c)
{ {
AtomicSliverMap map = gen.getParallaxChunk(c.getX(), c.getZ()); AtomicSliverMap map = null;
try
{
map = gen.getParallaxChunk(c.getX(), c.getZ());
}
catch(Throwable e)
{
map = new AtomicSliverMap();
}
RNG rx = rng.nextParallelRNG(c.getX() + r.nextInt()).nextParallelRNG(c.getZ() + r.nextInt()); RNG rx = rng.nextParallelRNG(c.getX() + r.nextInt()).nextParallelRNG(c.getZ() + r.nextInt());
if(gen.getDimension().isVanillaCaves()) if(gen.getDimension().isVanillaCaves())

View File

@ -2,11 +2,11 @@ package com.volmit.iris.object;
import java.util.List; import java.util.List;
import com.volmit.iris.util.M;
import org.bukkit.Axis;
import org.bukkit.Material;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.block.data.BlockData; import org.bukkit.block.data.*;
import org.bukkit.block.data.Directional;
import org.bukkit.block.data.MultipleFacing;
import org.bukkit.block.data.Rotatable;
import org.bukkit.util.BlockVector; import org.bukkit.util.BlockVector;
import com.volmit.iris.util.Desc; import com.volmit.iris.util.Desc;
@ -111,6 +111,56 @@ public class IrisObjectRotation
return BlockFace.SOUTH; return BlockFace.SOUTH;
} }
public BlockFace faceForAxis(Axis axis)
{
switch(axis)
{
case X:
return BlockFace.EAST;
case Y:
return BlockFace.UP;
case Z:
return BlockFace.NORTH;
}
return BlockFace.NORTH;
}
public Axis axisFor(BlockFace f)
{
switch(f)
{
case NORTH:
case SOUTH:
return Axis.Z;
case EAST:
case WEST:
return Axis.X;
case UP:
case DOWN:
return Axis.Y;
}
return Axis.X;
}
public Axis axisFor2D(BlockFace f)
{
switch(f)
{
case NORTH:
case SOUTH:
return Axis.Z;
case EAST:
case WEST:
case UP:
case DOWN:
return Axis.X;
}
return Axis.X;
}
public BlockData rotate(BlockData dd, int spinxx, int spinyy, int spinzz) public BlockData rotate(BlockData dd, int spinxx, int spinyy, int spinzz)
{ {
BlockData d = dd; BlockData d = dd;
@ -142,6 +192,17 @@ public class IrisObjectRotation
} }
} }
else if(d instanceof Orientable)
{
Orientable g = ((Orientable) d);
BlockFace f = faceForAxis(g.getAxis());
BlockVector bv = new BlockVector(f.getModX(), f.getModY(), f.getModZ());
bv = rotate(bv.clone(), spinx, spiny, spinz);
BlockFace t = getFace(bv);
Axis a = !((Orientable) d).getAxes().contains(Axis.Y) ? axisFor(t) : axisFor2D(t);
((Orientable) d).setAxis(a);
}
else if(d instanceof Rotatable) else if(d instanceof Rotatable)
{ {
Rotatable g = ((Rotatable) d); Rotatable g = ((Rotatable) d);