forked from JayemCeekay/ArdaGrass
-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* port to 1.21.2 * update some deps * fix typos * some code formatting
- Loading branch information
UltimatChamp
committed
Oct 17, 2024
1 parent
7e67c9a
commit 2c25282
Showing
25 changed files
with
188 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/dev/ultimatchamp/bettergrass/loaders/forge/BetterGrassifyForge.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/dev/ultimatchamp/bettergrass/loaders/neo/BetterGrassifyNeo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
src/main/java/dev/ultimatchamp/bettergrass/mixin/ReferencedModelsCollectorMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
//? if >1.21.1 { | ||
/*package dev.ultimatchamp.bettergrass.mixin; | ||
import dev.ultimatchamp.bettergrass.config.BetterGrassifyConfig; | ||
import dev.ultimatchamp.bettergrass.model.BetterGrassifyUnbakedModel; | ||
import net.minecraft.client.render.model.ReferencedModelsCollector; | ||
import net.minecraft.client.render.model.UnbakedModel; | ||
import net.minecraft.client.util.ModelIdentifier; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.ModifyVariable; | ||
@Mixin(ReferencedModelsCollector.class) | ||
public class ReferencedModelsCollectorMixin { | ||
@ModifyVariable(method = "addTopLevelModel", at = @At("HEAD"), argsOnly = true) | ||
private UnbakedModel onAddTopLevelModel(UnbakedModel model, ModelIdentifier modelId) { | ||
if (!modelId.getVariant().equals("inventory")) { | ||
for (String path : BetterGrassifyConfig.instance().moreBlocks) { | ||
if (BetterGrassifyConfig.instance().snowy) { | ||
if (modelId.toString().startsWith(path) && modelId.toString().contains("snowy=true")) { | ||
return new BetterGrassifyUnbakedModel(model); | ||
} | ||
} else if (modelId.toString().startsWith(path) && !modelId.toString().contains("snowy=true")) { | ||
return new BetterGrassifyUnbakedModel(model); | ||
} | ||
} | ||
if (BetterGrassifyConfig.instance().grassBlocks) { | ||
if (modelId.toString().startsWith("minecraft:grass_block") && !modelId.toString().contains("snowy=true")) { | ||
return new BetterGrassifyUnbakedModel(model); | ||
} else if (modelId.toString().startsWith("minecraft:grass_block") && modelId.toString().contains("snowy=true") && BetterGrassifyConfig.instance().snowy) { | ||
return new BetterGrassifyUnbakedModel(model); | ||
} | ||
} | ||
if (BetterGrassifyConfig.instance().dirtPaths) { | ||
if (modelId.toString().startsWith("minecraft:dirt_path")) { | ||
return new BetterGrassifyUnbakedModel(model); | ||
} | ||
} | ||
if (BetterGrassifyConfig.instance().farmLands) { | ||
if (modelId.toString().startsWith("minecraft:farmland")) { | ||
return new BetterGrassifyUnbakedModel(model); | ||
} | ||
} | ||
if (BetterGrassifyConfig.instance().podzol) { | ||
if (modelId.toString().startsWith("minecraft:podzol") && !modelId.toString().contains("snowy=true")) { | ||
return new BetterGrassifyUnbakedModel(model); | ||
} else if (modelId.toString().startsWith("minecraft:podzol") && modelId.toString().contains("snowy=true") && BetterGrassifyConfig.instance().snowy) { | ||
return new BetterGrassifyUnbakedModel(model); | ||
} | ||
} | ||
if (BetterGrassifyConfig.instance().mycelium) { | ||
if (modelId.toString().startsWith("minecraft:mycelium") && !modelId.toString().contains("snowy=true")) { | ||
return new BetterGrassifyUnbakedModel(model); | ||
} else if (modelId.toString().startsWith("minecraft:mycelium") && modelId.toString().contains("snowy=true") && BetterGrassifyConfig.instance().snowy) { | ||
return new BetterGrassifyUnbakedModel(model); | ||
} | ||
} | ||
if (BetterGrassifyConfig.instance().crimsonNylium) { | ||
if (modelId.toString().startsWith("minecraft:crimson_nylium")) { | ||
return new BetterGrassifyUnbakedModel(model); | ||
} | ||
} | ||
if (BetterGrassifyConfig.instance().warpedNylium) { | ||
if (modelId.toString().startsWith("minecraft:warped_nylium")) { | ||
return new BetterGrassifyUnbakedModel(model); | ||
} | ||
} | ||
} | ||
return model; | ||
} | ||
} | ||
*///?} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.