mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Fix crash issues
This commit is contained in:
parent
e72ea21b6b
commit
ac2dcee6c3
@ -48,7 +48,12 @@ public class AtomicSliver
|
|||||||
|
|
||||||
public Material getType(int h)
|
public Material getType(int h)
|
||||||
{
|
{
|
||||||
return get(h).getMaterial();
|
return getTypeSafe(h);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Material getTypeSafe(int h)
|
||||||
|
{
|
||||||
|
return get(h > 255 ? 255 : h < 0 ? 0 : h).getMaterial();
|
||||||
}
|
}
|
||||||
|
|
||||||
public KList<Byte> getUpdatables()
|
public KList<Byte> getUpdatables()
|
||||||
|
@ -164,11 +164,11 @@ public class GenLayerCave extends GenLayer
|
|||||||
|
|
||||||
public boolean dig(int x, int y, int z, AtomicSliver data, Function<Integer, BlockData> caveFluid)
|
public boolean dig(int x, int y, int z, AtomicSliver data, Function<Integer, BlockData> caveFluid)
|
||||||
{
|
{
|
||||||
Material a = data.getType(y);
|
Material a = data.getTypeSafe(y);
|
||||||
Material c = data.getType(y + 1);
|
Material c = data.getTypeSafe(y + 1);
|
||||||
Material d = data.getType(y + 2);
|
Material d = data.getTypeSafe(y + 2);
|
||||||
Material e = data.getType(y + 3);
|
Material e = data.getTypeSafe(y + 3);
|
||||||
Material f = data.getType(y - 1);
|
Material f = data.getTypeSafe(y - 1);
|
||||||
BlockData b = caveFluid.apply(y);
|
BlockData b = caveFluid.apply(y);
|
||||||
BlockData b2 = caveFluid.apply(y + 1);
|
BlockData b2 = caveFluid.apply(y + 1);
|
||||||
|
|
||||||
|
@ -87,7 +87,15 @@ public class EditManager implements Listener
|
|||||||
|
|
||||||
if(Bukkit.getPluginManager().isPluginEnabled("WorldEdit"))
|
if(Bukkit.getPluginManager().isPluginEnabled("WorldEdit"))
|
||||||
{
|
{
|
||||||
e = new WEBlockEditor(world);
|
try
|
||||||
|
{
|
||||||
|
e = new WEBlockEditor(world);
|
||||||
|
}
|
||||||
|
|
||||||
|
catch(Throwable ex)
|
||||||
|
{
|
||||||
|
e = new BukkitBlockEditor(world);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user