Skip to content

Commit

Permalink
Fix avm_staff:cake crash on servers
Browse files Browse the repository at this point in the history
  • Loading branch information
opekope2 committed Nov 18, 2024
1 parent bb73cf4 commit 29a23af
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class CakeEntity(entityType: EntityType<CakeEntity>, world: World) : Entity(enti
val particlePerSide = particlePerSide - 1
val width = type.dimensions.width
val height = type.dimensions.height
val particleManager = MinecraftClient.getInstance().particleManager

for (i in 0..particlePerSide) {
for (j in 0..particlePerSide) {
Expand Down Expand Up @@ -206,11 +207,9 @@ class CakeEntity(entityType: EntityType<CakeEntity>, world: World) : Entity(enti
private val BLOCK_POS = DataTracker.registerData(
CakeEntity::class.java, TrackedDataHandlerRegistry.BLOCK_POS
)
private val particleManager by lazy { MinecraftClient.getInstance().particleManager }
private val graphicsModeOption by lazy { MinecraftClient.getInstance().options.graphicsMode }
private val particlePerSide: Int
@Environment(EnvType.CLIENT)
get() = when (graphicsModeOption.value!!) {
get() = when (MinecraftClient.getInstance().options.graphicsMode.value!!) {
GraphicsMode.FAST -> 4
GraphicsMode.FANCY -> 5
GraphicsMode.FABULOUS -> 6
Expand Down

0 comments on commit 29a23af

Please sign in to comment.