Mantle deletes

This commit is contained in:
cyberpwn 2022-04-14 23:47:25 -04:00
parent 51b0693c99
commit 4a2f42437f

View File

@ -229,6 +229,13 @@ public class IrisToolbelt {
return e.getEngine().getMantle().getMantle().get(x, y - world.getMinHeight(), z, of);
}
public static <T> void deleteMantleData(World world, int x, int y, int z, Class<T> of)
{
PlatformChunkGenerator e = access(world);
if(e == null) {return;}
e.getEngine().getMantle().getMantle().remove(x, y - world.getMinHeight(), z, of);
}
/////////////////// REFLECTIVE METHODS //////////////////////////
// Copy this stuff to your project, it's safe to use with a
// bukkit api only.
@ -244,6 +251,13 @@ public class IrisToolbelt {
return getMantleIdentity(world, x, y, z) != -1;
}
public static void deleteMantleBlock(World world, int x, int y, int z) {
try {
Method m = Class.forName("com.volmit.iris.core.tools.IrisToolbelt").getDeclaredMethod("deleteMantleData", World.class, int.class, int.class, int.class, Class.class);
m.invoke(null, world, x, y, z, BlockData.class);
} catch(Throwable ignored) {}
}
public static BlockData getMantleBlock(World world, int x, int y, int z) {
try {
Method m = Class.forName("com.volmit.iris.core.tools.IrisToolbelt").getDeclaredMethod("getMantleData", World.class, int.class, int.class, int.class, Class.class);