From 294ae032ec97c5cd4aff648a465c9c26e447b545 Mon Sep 17 00:00:00 2001 From: peytonplayz595 <106421860+PeytonPlayz595@users.noreply.github.com> Date: Sat, 2 Sep 2023 08:27:54 -0500 Subject: [PATCH] Fixed BetterGrass crash --- src/main/java/net/PeytonPlayz585/shadow/BetterGrass.java | 6 +++--- .../java/net/minecraft/client/settings/GameSettings.java | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/PeytonPlayz585/shadow/BetterGrass.java b/src/main/java/net/PeytonPlayz585/shadow/BetterGrass.java index 2089154..569248d 100644 --- a/src/main/java/net/PeytonPlayz585/shadow/BetterGrass.java +++ b/src/main/java/net/PeytonPlayz585/shadow/BetterGrass.java @@ -16,9 +16,9 @@ import net.minecraft.world.IBlockAccess; public class BetterGrass { private static IBakedModel modelEmpty = new SimpleBakedModel(new ArrayList(), new ArrayList(), false, false, (EaglerTextureAtlasSprite)null, (ItemCameraTransforms)null); - private static IBakedModel modelCubeMycelium = null; - private static IBakedModel modelCubeGrassSnowy = null; - private static IBakedModel modelCubeGrass = null; + private static IBakedModel modelCubeMycelium = BlockModelUtils.makeModelCube((String)"minecraft:blocks/mycelium_top", -1); + private static IBakedModel modelCubeGrassSnowy = BlockModelUtils.makeModelCube((String)"minecraft:blocks/snow", -1); + private static IBakedModel modelCubeGrass = BlockModelUtils.makeModelCube((String)"minecraft:blocks/grass_top", 0); public static void update() { modelCubeGrass = BlockModelUtils.makeModelCube((String)"minecraft:blocks/grass_top", 0); diff --git a/src/main/java/net/minecraft/client/settings/GameSettings.java b/src/main/java/net/minecraft/client/settings/GameSettings.java index 10cebfb..677f9a1 100644 --- a/src/main/java/net/minecraft/client/settings/GameSettings.java +++ b/src/main/java/net/minecraft/client/settings/GameSettings.java @@ -39,7 +39,7 @@ import net.minecraft.entity.player.EnumPlayerModelParts; import net.minecraft.network.play.client.C15PacketClientSettings; import net.minecraft.util.MathHelper; import net.minecraft.world.EnumDifficulty; - +import net.PeytonPlayz585.shadow.BetterGrass; import net.PeytonPlayz585.shadow.ClearWater; /**+ @@ -580,6 +580,8 @@ public class GameSettings { if (this.ofBetterGrass > 3) { this.ofBetterGrass = 1; } + + BetterGrass.update(); this.mc.renderGlobal.loadRenderers(); }