Skip to content

Commit

Permalink
Only allow anomalies to render as default block states (some mods suc…
Browse files Browse the repository at this point in the history
…h as Better End do bad things that prevent us from using all possible states)
  • Loading branch information
Adubbz committed Jan 21, 2024
1 parent bfb69a6 commit 7853c86
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import biomesoplenty.api.block.BOPBlockEntities;
import biomesoplenty.block.AnomalyBlock;
import com.google.common.collect.ImmutableList;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.Registries;
Expand Down Expand Up @@ -62,8 +61,7 @@ public BlockState getRenderState()
while (renderState.getRenderShape() != RenderShape.MODEL)
{
Block renderBlock = blockRegistry.entrySet().stream().skip(index).map(Map.Entry::getValue).findFirst().orElseThrow();
ImmutableList<BlockState> possibleStates = renderBlock.getStateDefinition().getPossibleStates();
renderState = possibleStates.get(random.nextInt(possibleStates.size()));
renderState = renderBlock.defaultBlockState();
index = (index + 1) % blockRegistry.size();
}

Expand Down

0 comments on commit 7853c86

Please sign in to comment.