mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-23 00:59:16 +00:00
Forceblock now properly works.
This commit is contained in:
@@ -387,8 +387,6 @@ public class Iris extends VolmitPlugin implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void enable() {
|
private void enable() {
|
||||||
IrisToolbelt.retainMantleDataForSlice(String.class.getCanonicalName());
|
|
||||||
IrisToolbelt.retainMantleDataForSlice(BlockData.class.getCanonicalName());
|
|
||||||
instance = this;
|
instance = this;
|
||||||
services = new KMap<>();
|
services = new KMap<>();
|
||||||
initialize("com.volmit.iris.core.service").forEach((i) -> services.put((Class<? extends IrisService>) i.getClass(), (IrisService) i));
|
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();
|
splash();
|
||||||
autoStartStudio();
|
autoStartStudio();
|
||||||
checkForBukkitWorlds();
|
checkForBukkitWorlds();
|
||||||
|
IrisToolbelt.retainMantleDataForSlice(String.class.getCanonicalName());
|
||||||
|
IrisToolbelt.retainMantleDataForSlice(BlockData.class.getCanonicalName());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,11 +57,14 @@ public class IrisSurfaceDecorator extends IrisEngineDecorator {
|
|||||||
bd = decorator.getBlockData100(biome, getRng(), realX, height, realZ, getData());
|
bd = decorator.getBlockData100(biome, getRng(), realX, height, realZ, getData());
|
||||||
|
|
||||||
if(!underwater) {
|
if(!underwater) {
|
||||||
if(!canGoOn(bd, bdx) && !decorator.isForcePlace()) {
|
if(!canGoOn(bd, bdx) && (!decorator.isForcePlace() && decorator.getForceBlock() == null) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(decorator.getForceBlock() != null)
|
||||||
|
data.set(x, height, z, fixFaces(decorator.getForceBlock().getBlockData(getData()), x, height, z));
|
||||||
|
|
||||||
if(bd instanceof Bisected) {
|
if(bd instanceof Bisected) {
|
||||||
bd = bd.clone();
|
bd = bd.clone();
|
||||||
((Bisected) bd).setHalf(Bisected.Half.TOP);
|
((Bisected) bd).setHalf(Bisected.Half.TOP);
|
||||||
@@ -74,9 +77,8 @@ public class IrisSurfaceDecorator extends IrisEngineDecorator {
|
|||||||
((Bisected) bd).setHalf(Bisected.Half.BOTTOM);
|
((Bisected) bd).setHalf(Bisected.Half.BOTTOM);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(decorator.getForceBlock() != null)
|
data.set(x, height + 1, z, fixFaces(bd, x, height + 1, z));
|
||||||
data.set(x, height, z, fixFaces(decorator.getForceBlock().getBlockData(getData()), x, height, z));
|
|
||||||
data.set(x, height + 1, z, fixFaces(bd, x, height, z));
|
|
||||||
} else {
|
} else {
|
||||||
if(height < getDimension().getFluidHeight()) {
|
if(height < getDimension().getFluidHeight()) {
|
||||||
max = getDimension().getFluidHeight();
|
max = getDimension().getFluidHeight();
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ public class IrisPostModifier extends EngineAssignedModifier<BlockData> {
|
|||||||
if(B.isFoliage(b) || b.getMaterial().equals(Material.DEAD_BUSH)) {
|
if(B.isFoliage(b) || b.getMaterial().equals(Material.DEAD_BUSH)) {
|
||||||
Material onto = getPostBlock(x, h, z, currentPostX, currentPostZ, currentData).getMaterial();
|
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);
|
setPostBlock(x, h + 1, z, AIR, currentPostX, currentPostZ, currentData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user