Skip to content

Commit 7ce6ce5

Browse files
committed
block state flags: don't set full outline/collision if shape is offset
1 parent 411360c commit 7ce6ce5

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/main/java/de/bixilon/minosoft/data/registries/blocks/state/BlockState.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ class BlockState(
5050
// if (BlockStateFlags.FULL_COLLISION !in flags && BlockStateFlags.COLLISIONS in flags && block is CollidableBlock && block.getCollisionShape(this) == null) flags -= BlockStateFlags.COLLISIONS
5151
// if (BlockStateFlags.FULL_OUTLINE !in flags && BlockStateFlags.OUTLINE in flags && block is OutlinedBlock && block.getOutlineShape(this) == null) flags -= BlockStateFlags.OUTLINE
5252

53-
if (BlockStateFlags.COLLISIONS in flags && BlockStateFlags.FULL_COLLISION !in flags && block is CollidableBlock && block.getCollisionShape(this) == AABB.BLOCK) flags += BlockStateFlags.FULL_COLLISION
54-
if (BlockStateFlags.OUTLINE in flags && BlockStateFlags.FULL_OUTLINE !in flags && block is OutlinedBlock && block.getOutlineShape(this) == AABB.BLOCK) flags += BlockStateFlags.FULL_OUTLINE
53+
if (BlockStateFlags.OFFSET !in flags) {
54+
if (BlockStateFlags.COLLISIONS in flags && BlockStateFlags.FULL_COLLISION !in flags && block is CollidableBlock && block.getCollisionShape(this) == AABB.BLOCK) flags += BlockStateFlags.FULL_COLLISION
55+
if (BlockStateFlags.OUTLINE in flags && BlockStateFlags.FULL_OUTLINE !in flags && block is OutlinedBlock && block.getOutlineShape(this) == AABB.BLOCK) flags += BlockStateFlags.FULL_OUTLINE
56+
}
5557

5658
if (block is PixLyzerBlock) {
5759
if (block.getCollisionShape(this) == null) {

src/main/java/de/bixilon/minosoft/data/registries/blocks/state/BlockStateFlags.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Minosoft
3-
* Copyright (C) 2020-2025 Moritz Zwerger
3+
* Copyright (C) 2020-2026 Moritz Zwerger
44
*
55
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
66
*
@@ -70,13 +70,13 @@ object BlockStateFlags {
7070

7171
if (block is CollidableBlock) {
7272
flags += COLLISIONS
73-
if (block.collisionShape == AABB.BLOCK) {
73+
if (block.collisionShape == AABB.BLOCK && OFFSET !in flags) {
7474
flags += FULL_COLLISION
7575
}
7676
}
7777
if (block is OutlinedBlock) {
7878
flags += OUTLINE
79-
if (block.outlineShape == AABB.BLOCK) {
79+
if (block.outlineShape == AABB.BLOCK && OFFSET !in flags) {
8080
flags += FULL_OUTLINE
8181
}
8282
}

0 commit comments

Comments
 (0)