mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-02-26 09:21:54 +01:00
Fix doors not adapting the correct data from their other half
This commit is contained in:
parent
705f97dabf
commit
9b59483cbe
@ -50,7 +50,9 @@ public class DoorExtension implements BlockStateExtension {
|
||||
public BlockState extend(MCAWorld world, Vector3i pos, BlockState state) {
|
||||
BlockState otherDoor;
|
||||
|
||||
if (state.getProperties().get("half").equals("lower")) {
|
||||
boolean isLower = state.getProperties().get("half").equals("lower");
|
||||
|
||||
if (isLower) {
|
||||
otherDoor = world.getBlockState(pos.add(Direction.UP.toVector()));
|
||||
} else {
|
||||
otherDoor = world.getBlockState(pos.add(Direction.DOWN.toVector()));
|
||||
@ -58,7 +60,13 @@ public BlockState extend(MCAWorld world, Vector3i pos, BlockState state) {
|
||||
|
||||
//copy all properties from the other door
|
||||
for (Entry<String, String> prop : otherDoor.getProperties().entrySet()) {
|
||||
if (!state.getProperties().containsKey(prop.getKey())) {
|
||||
if (
|
||||
!state.getProperties().containsKey(prop.getKey()) ||
|
||||
(isLower && prop.getKey().equals("hinge")) ||
|
||||
(isLower && prop.getKey().equals("powered")) ||
|
||||
(!isLower && prop.getKey().equals("open")) ||
|
||||
(!isLower && prop.getKey().equals("facing"))
|
||||
) {
|
||||
state = state.with(prop.getKey(), prop.getValue());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user