mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 02:36:59 +00:00
Bugfixes
This commit is contained in:
parent
6bbe1c8518
commit
aa7a1ddd4e
@ -24,6 +24,8 @@ public class CommandIrisStudioGoto extends MortarCommand
|
||||
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(args.length < 1)
|
||||
{
|
||||
@ -124,6 +126,14 @@ public class CommandIrisStudioGoto extends MortarCommand
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
@ -139,6 +139,11 @@ public abstract class ContextualTerrainProvider implements TerrainProvider, List
|
||||
|
||||
public IrisBiome loadBiome(String i)
|
||||
{
|
||||
if(getData() == null)
|
||||
{
|
||||
return Iris.globaldata.getBiomeLoader().load(i);
|
||||
}
|
||||
|
||||
return getData().getBiomeLoader().load(i);
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,18 @@ public class GenLayerUpdate extends BlockPopulator
|
||||
@Override
|
||||
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());
|
||||
|
||||
if(gen.getDimension().isVanillaCaves())
|
||||
|
@ -2,11 +2,11 @@ package com.volmit.iris.object;
|
||||
|
||||
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.data.BlockData;
|
||||
import org.bukkit.block.data.Directional;
|
||||
import org.bukkit.block.data.MultipleFacing;
|
||||
import org.bukkit.block.data.Rotatable;
|
||||
import org.bukkit.block.data.*;
|
||||
import org.bukkit.util.BlockVector;
|
||||
|
||||
import com.volmit.iris.util.Desc;
|
||||
@ -111,6 +111,56 @@ public class IrisObjectRotation
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
Rotatable g = ((Rotatable) d);
|
||||
|
Loading…
x
Reference in New Issue
Block a user