Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.EmptyBlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.Fallable;
Expand Down Expand Up @@ -200,7 +199,7 @@ public boolean isBurnable() {

@Override
public boolean isOccluding() {
return this.getHandle().defaultBlockState().isRedstoneConductor(EmptyBlockGetter.INSTANCE, BlockPos.ZERO);
return this.getHandle().defaultBlockState().canOcclude();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,13 @@ public void testBlockDataClasses() throws Exception {
assertThat(actual, is(expected));
}
}

@Test
public void testOcclusionMatchesDefaultBlockData() throws Exception {
for (Field f : BlockType.class.getDeclaredFields()) {
BlockType type = (BlockType) f.get(null);

assertThat(type.isOccluding(), is(type.createBlockData().isOccluding()), type.getKey() + " should match its default BlockData occlusion");
}
}
}
Loading