9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-23 17:19:16 +00:00

Forceblock now properly works.

This commit is contained in:
Vatuu
2022-08-26 19:05:33 +02:00
parent 0f66aa47c9
commit 14ae5809b0
3 changed files with 9 additions and 7 deletions

View File

@@ -387,8 +387,6 @@ public class Iris extends VolmitPlugin implements Listener {
}
private void enable() {
IrisToolbelt.retainMantleDataForSlice(String.class.getCanonicalName());
IrisToolbelt.retainMantleDataForSlice(BlockData.class.getCanonicalName());
instance = this;
services = new KMap<>();
initialize("com.volmit.iris.core.service").forEach((i) -> services.put((Class<? extends IrisService>) i.getClass(), (IrisService) i));
@@ -416,6 +414,8 @@ public class Iris extends VolmitPlugin implements Listener {
splash();
autoStartStudio();
checkForBukkitWorlds();
IrisToolbelt.retainMantleDataForSlice(String.class.getCanonicalName());
IrisToolbelt.retainMantleDataForSlice(BlockData.class.getCanonicalName());
});
}

View File

@@ -57,11 +57,14 @@ public class IrisSurfaceDecorator extends IrisEngineDecorator {
bd = decorator.getBlockData100(biome, getRng(), realX, height, realZ, getData());
if(!underwater) {
if(!canGoOn(bd, bdx) && !decorator.isForcePlace()) {
if(!canGoOn(bd, bdx) && (!decorator.isForcePlace() && decorator.getForceBlock() == null) ) {
return;
}
}
if(decorator.getForceBlock() != null)
data.set(x, height, z, fixFaces(decorator.getForceBlock().getBlockData(getData()), x, height, z));
if(bd instanceof Bisected) {
bd = bd.clone();
((Bisected) bd).setHalf(Bisected.Half.TOP);
@@ -74,9 +77,8 @@ public class IrisSurfaceDecorator extends IrisEngineDecorator {
((Bisected) bd).setHalf(Bisected.Half.BOTTOM);
}
if(decorator.getForceBlock() != null)
data.set(x, height, z, fixFaces(decorator.getForceBlock().getBlockData(getData()), x, height, z));
data.set(x, height + 1, z, fixFaces(bd, x, height, z));
data.set(x, height + 1, z, fixFaces(bd, x, height + 1, z));
} else {
if(height < getDimension().getFluidHeight()) {
max = getDimension().getFluidHeight();

View File

@@ -224,7 +224,7 @@ public class IrisPostModifier extends EngineAssignedModifier<BlockData> {
if(B.isFoliage(b) || b.getMaterial().equals(Material.DEAD_BUSH)) {
Material onto = getPostBlock(x, h, z, currentPostX, currentPostZ, currentData).getMaterial();
if(!B.canPlaceOnto(b.getMaterial(), onto)) {
if(!B.canPlaceOnto(b.getMaterial(), onto) && !B.isDecorant(b)) {
setPostBlock(x, h + 1, z, AIR, currentPostX, currentPostZ, currentData);
}
}