-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed all compiler warnings except for deprecations
- Loading branch information
Showing
9 changed files
with
70 additions
and
129 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,25 @@ | ||
package ch.haslo.bluegrass; | ||
|
||
import ch.haslo.bluegrass.models.BakedBlueGrassModel; | ||
import ch.haslo.bluegrass.models.UnbakedBlueGrassModel; | ||
import net.fabricmc.api.ClientModInitializer; | ||
import net.fabricmc.fabric.api.client.model.loading.v1.ModelLoadingPlugin; | ||
import net.fabricmc.fabric.api.client.model.loading.v1.ModelModifier; | ||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.render.model.BakedModel; | ||
import net.minecraft.client.texture.Sprite; | ||
import net.minecraft.client.util.ModelIdentifier; | ||
import net.minecraft.util.Identifier; | ||
|
||
import java.util.function.Function; | ||
|
||
public class BlueGrassClient implements ClientModInitializer { | ||
@Override | ||
public void onInitializeClient() { | ||
// Register your ModelLoadingPlugin | ||
ModelLoadingPlugin.register(pluginCtx -> { | ||
pluginCtx.modifyModelOnLoad().register(ModelModifier.WRAP_PHASE, (model, context) -> { | ||
if (context.id() instanceof ModelIdentifier modelId) { | ||
System.out.println("Model ID: " + modelId); // Debug print | ||
@Override | ||
public void onInitializeClient() { | ||
// Register your ModelLoadingPlugin | ||
ModelLoadingPlugin.register(pluginCtx -> pluginCtx.modifyModelOnLoad().register(ModelModifier.WRAP_PHASE, (model, context) -> { | ||
if (context.id() instanceof ModelIdentifier modelId) { | ||
System.out.println("Model ID: " + modelId); // Debug print | ||
|
||
if (modelId.getNamespace().equals("minecraft") && modelId.getPath().equals("grass_block") && modelId.getVariant().equals("snowy=false")) { | ||
System.out.println("Inside non-snowy grass block logic"); | ||
return new UnbakedBlueGrassModel(modelId); | ||
} | ||
} | ||
return model; | ||
}); | ||
}); | ||
} | ||
if (modelId.getNamespace().equals("minecraft") && modelId.getPath().equals("grass_block") && modelId.getVariant().equals("snowy=false")) { | ||
System.out.println("Inside non-snowy grass block logic"); | ||
return new UnbakedBlueGrassModel(); | ||
} | ||
} | ||
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
9 changes: 0 additions & 9 deletions
9
src/client/java/ch/haslo/bluegrass/models/BakedBlueGrassModel.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
22 changes: 0 additions & 22 deletions
22
src/client/resources/assets/bluegrass/models/block/grass_block.json
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-685 Bytes
src/client/resources/assets/bluegrass/textures/block/grass_block_side.png
Binary file not shown.
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"required": true, | ||
"package": "ch.haslo.bluegrass.mixin.client", | ||
"compatibilityLevel": "JAVA_17", | ||
"client": [ | ||
"ExampleClientMixin" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} | ||
"required": true, | ||
"package": "ch.haslo.bluegrass.mixin.client", | ||
"compatibilityLevel": "JAVA_17", | ||
"client": [ | ||
"ExampleClientMixin" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,44 +1,43 @@ | ||
{ | ||
"schemaVersion": 1, | ||
"id": "bluegrass", | ||
"version": "${version}", | ||
"name": "BlueGrass", | ||
"description": "This is an example description! Tell everyone what your mod is about!", | ||
"authors": [ | ||
"Me!" | ||
], | ||
"contact": { | ||
"homepage": "https://fabricmc.net/", | ||
"sources": "https://github.com/FabricMC/fabric-example-mod" | ||
}, | ||
"license": "CC0-1.0", | ||
"icon": "assets/bluegrass/icon.png", | ||
"environment": "*", | ||
"entrypoints": { | ||
"main": [ | ||
"ch.haslo.bluegrass.BlueGrass" | ||
], | ||
"client": [ | ||
"ch.haslo.bluegrass.BlueGrassClient" | ||
] | ||
}, | ||
"mixins": [ | ||
"bluegrass.mixins.json", | ||
{ | ||
"config": "bluegrass.client.mixins.json", | ||
"environment": "client" | ||
} | ||
], | ||
"depends": { | ||
"fabricloader": ">=0.14.22", | ||
"minecraft": "~1.20.2", | ||
"java": ">=17", | ||
"fabric-api": "*" | ||
}, | ||
"suggests": { | ||
"another-mod": "*" | ||
}, | ||
"resources": [ | ||
"assets/bluegrass" | ||
] | ||
} | ||
"schemaVersion": 1, | ||
"id": "bluegrass", | ||
"version": "${version}", | ||
"name": "BlueGrass", | ||
"description": "This is an example description! Tell everyone what your mod is about!", | ||
"authors": [ | ||
"Me!" | ||
], | ||
"contact": { | ||
"homepage": "https://fabricmc.net/", | ||
"sources": "https://github.com/FabricMC/fabric-example-mod" | ||
}, | ||
"license": "CC0-1.0", | ||
"icon": "assets/bluegrass/icon.png", | ||
"environment": "*", | ||
"entrypoints": { | ||
"main": [ | ||
"ch.haslo.bluegrass.BlueGrass" | ||
], | ||
"client": [ | ||
"ch.haslo.bluegrass.BlueGrassClient" | ||
] | ||
}, | ||
"mixins": [ | ||
{ | ||
"config": "bluegrass.client.mixins.json", | ||
"environment": "client" | ||
} | ||
], | ||
"depends": { | ||
"fabricloader": ">=0.14.22", | ||
"minecraft": "~1.20.2", | ||
"java": ">=17", | ||
"fabric-api": "*" | ||
}, | ||
"suggests": { | ||
"another-mod": "*" | ||
}, | ||
"resources": [ | ||
"assets/bluegrass" | ||
] | ||
} |