Skip to content

Commit

Permalink
added unculled machine flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Dec 13, 2023
1 parent 1a900ae commit 898c316
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import tesseract.FluidPlatformUtils;
Expand Down Expand Up @@ -92,6 +94,12 @@ public BlockMachine(Machine<?> type, Tier tier, Properties properties) {
this.registerDefaultState(this.stateContainer.any());
}

@Override
public VoxelShape getOcclusionShape(BlockState state, BlockGetter level, BlockPos pos) {
if (type.has(MachineFlag.UNCULLED)) return Shapes.empty();
return super.getOcclusionShape(state, level, pos);
}

@Override
protected void createBlockStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
if (type == null) return; // means this is the first run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public enum MachineFlag {
GUI,
GENERATOR, //Has a recipe map and converts applicable recipes to power.
COVERABLE,
PARTIAL_AMPS;
PARTIAL_AMPS,
UNCULLED;

public static final MachineFlag[] VALUES;

Expand Down

0 comments on commit 898c316

Please sign in to comment.