-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
100 additions
and
33 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
7 changes: 7 additions & 0 deletions
7
common/src/generated/resources/assets/biomesoplenty/blockstates/flowering_oak_leaves.json
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,7 @@ | ||
{ | ||
"variants": { | ||
"": { | ||
"model": "biomesoplenty:block/flowering_oak_leaves" | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
common/src/generated/resources/assets/biomesoplenty/models/block/flowering_oak_leaves.json
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,7 @@ | ||
{ | ||
"parent": "biomesoplenty:block/leaves_overlay", | ||
"textures": { | ||
"layer0": "biomesoplenty:block/flowering_oak_leaves", | ||
"layer1": "biomesoplenty:block/flowering_oak_leaves_overlay" | ||
} | ||
} |
5 changes: 0 additions & 5 deletions
5
common/src/main/resources/assets/biomesoplenty/blockstates/flowering_oak_leaves.json
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
common/src/main/resources/assets/biomesoplenty/models/block/flowering_oak_leaves.json
This file was deleted.
Oops, something went wrong.
26 changes: 13 additions & 13 deletions
26
common/src/main/resources/assets/biomesoplenty/models/block/leaves_overlay.json
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
3 changes: 0 additions & 3 deletions
3
common/src/main/resources/assets/biomesoplenty/models/item/flowering_oak_leaves.json
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
37 changes: 37 additions & 0 deletions
37
neoforge/src/main/java/biomesoplenty/neoforge/datagen/model/BOPModelTemplates.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,37 @@ | ||
/******************************************************************************* | ||
* Copyright 2024, the Glitchfiend Team. | ||
* All rights reserved. | ||
******************************************************************************/ | ||
package biomesoplenty.neoforge.datagen.model; | ||
|
||
import biomesoplenty.core.BiomesOPlenty; | ||
import net.minecraft.client.data.models.model.ModelTemplate; | ||
import net.minecraft.client.data.models.model.TextureSlot; | ||
import net.minecraft.resources.ResourceLocation; | ||
|
||
import java.util.Optional; | ||
|
||
public class BOPModelTemplates | ||
{ | ||
public static final ModelTemplate LEAVES_OVERLAY = create("leaves_overlay", TextureSlot.LAYER0, TextureSlot.LAYER1); | ||
|
||
private static ModelTemplate create(TextureSlot... p_386690_) { | ||
return new ModelTemplate(Optional.empty(), Optional.empty(), p_386690_); | ||
} | ||
|
||
private static ModelTemplate create(String name, TextureSlot... p_388561_) { | ||
return new ModelTemplate(Optional.of(ResourceLocation.fromNamespaceAndPath(BiomesOPlenty.MOD_ID, "block/" + name)), Optional.empty(), p_388561_); | ||
} | ||
|
||
private static ModelTemplate createItem(String p_388248_, TextureSlot... p_386756_) { | ||
return new ModelTemplate(Optional.of(ResourceLocation.fromNamespaceAndPath(BiomesOPlenty.MOD_ID, "item/" + p_388248_)), Optional.empty(), p_386756_); | ||
} | ||
|
||
private static ModelTemplate createItem(String p_386727_, String p_387707_, TextureSlot... p_387856_) { | ||
return new ModelTemplate(Optional.of(ResourceLocation.fromNamespaceAndPath(BiomesOPlenty.MOD_ID, "item/" + p_386727_)), Optional.of(p_387707_), p_387856_); | ||
} | ||
|
||
private static ModelTemplate create(String p_386833_, String p_386662_, TextureSlot... p_387086_) { | ||
return new ModelTemplate(Optional.of(ResourceLocation.fromNamespaceAndPath(BiomesOPlenty.MOD_ID, "block/" + p_386833_)), Optional.of(p_386662_), p_387086_); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
neoforge/src/main/java/biomesoplenty/neoforge/datagen/model/BOPTextureMapping.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,23 @@ | ||
/******************************************************************************* | ||
* Copyright 2024, the Glitchfiend Team. | ||
* All rights reserved. | ||
******************************************************************************/ | ||
package biomesoplenty.neoforge.datagen.model; | ||
|
||
import net.minecraft.client.data.models.model.TextureMapping; | ||
import net.minecraft.client.data.models.model.TextureSlot; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.Blocks; | ||
|
||
import static net.minecraft.client.data.models.model.TextureMapping.getBlockTexture; | ||
|
||
public class BOPTextureMapping | ||
{ | ||
public static TextureMapping leavesOverlay(Block block) | ||
{ | ||
return new TextureMapping() | ||
.put(TextureSlot.LAYER1, getBlockTexture(block, "_overlay")) | ||
.put(TextureSlot.LAYER0, getBlockTexture(block)); | ||
} | ||
} |