mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-26 05:50:39 +00:00
Fix object block replacements on Paper 26.1.2
Paper 26.1.2 caches block data that names every state without the parsed states BlockData#merge needs, so replacing blocks inside objects threw on every placement. Such block data replaces the base completely, so B.merge returns it directly. Model used: Claude Opus 5.5
This commit is contained in:
1 parent
b12b1ee304
commit
bc7a530486
2 files changed
+10
-1
No files matched your search
@@ -966,7 +966,7 @@ public class IrisObject extends IrisRegistrant {
|
|||||||
BlockData newData = j.getReplace(rng, i.getX() + x, i.getY() + y, i.getZ() + z, rdata).clone();
|
BlockData newData = j.getReplace(rng, i.getX() + x, i.getY() + y, i.getZ() + z, rdata).clone();
|
||||||
|
|
||||||
if (newData.getMaterial() == data.getMaterial() && !(newData instanceof IrisCustomData || data instanceof IrisCustomData))
|
if (newData.getMaterial() == data.getMaterial() && !(newData instanceof IrisCustomData || data instanceof IrisCustomData))
|
||||||
data = data.merge(newData);
|
data = B.merge(data, newData);
|
||||||
else
|
else
|
||||||
data = newData;
|
data = newData;
|
||||||
|
|
||||||
|
|||||||
@@ -358,6 +358,15 @@ public class B {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static BlockData merge(BlockData base, BlockData overlay) {
|
||||||
|
// Paper 26.1 caches block data that names every state without the parsed states merge needs. Merging it would
|
||||||
|
// replace every state of the base anyway.
|
||||||
|
if (overlay.getAsString(true).equals(overlay.getAsString())) {
|
||||||
|
return overlay;
|
||||||
|
}
|
||||||
|
return base.merge(overlay);
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isFoliagePlantable(BlockData d) {
|
public static boolean isFoliagePlantable(BlockData d) {
|
||||||
return d.getMaterial().equals(Material.GRASS_BLOCK)
|
return d.getMaterial().equals(Material.GRASS_BLOCK)
|
||||||
|| d.getMaterial().equals(Material.MOSS_BLOCK)
|
|| d.getMaterial().equals(Material.MOSS_BLOCK)
|
||||||
|
|||||||
Reference in new issue
Block a user