Skip to content

Commit

Permalink
1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Starexify committed Oct 30, 2024
1 parent 4de6bca commit 61dde18
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "nmt:item/lingering_awfully_potion"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "nmt:item/lingering_lava_bottle"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"parent": "minecraft:item/generated",
"overrides": [
{
"model": "nmt:item/awfully_potion",
"model": "nmt:item/lingering_awfully_potion",
"predicate": {
"nmt:potion_type": 1.0
"nmt:potion_type": 2.0
}
},
{
"model": "nmt:item/lava_bottle",
"model": "nmt:item/lingering_lava_bottle",
"predicate": {
"nmt:potion_type": 2.0
"nmt:potion_type": 1.0
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
{
"model": "nmt:item/awfully_potion",
"predicate": {
"nmt:potion_type": 1.0
"nmt:potion_type": 2.0
}
},
{
"model": "nmt:item/lava_bottle",
"predicate": {
"nmt:potion_type": 2.0
"nmt:potion_type": 1.0
}
}
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "nmt:item/splash_awfully_potion"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "nmt:item/splash_lava_bottle"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"parent": "minecraft:item/generated",
"overrides": [
{
"model": "nmt:item/awfully_potion",
"model": "nmt:item/splash_awfully_potion",
"predicate": {
"nmt:potion_type": 1.0
"nmt:potion_type": 2.0
}
},
{
"model": "nmt:item/lava_bottle",
"model": "nmt:item/splash_lava_bottle",
"predicate": {
"nmt:potion_type": 2.0
"nmt:potion_type": 1.0
}
}
],
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/net/nova/nmt/data/NMTItemModelProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import net.minecraft.world.item.Item;
import net.minecraft.world.item.alchemy.Potion;
import net.neoforged.neoforge.client.model.generators.ItemModelProvider;
import net.neoforged.neoforge.client.model.generators.ModelBuilder;
import net.neoforged.neoforge.client.model.generators.ModelFile;
import net.neoforged.neoforge.common.data.ExistingFileHelper;
import net.nova.nmt.NoMoreThings;
Expand Down Expand Up @@ -57,21 +56,21 @@ public void potionItem(Item item) {
for (Holder<Potion> potionHolder : NMTPotions.POTIONS.getEntries().stream().toList()) {
String potion = potionHolder.getKey().location().getPath();
String potionName = switch (potion) {
case "lava" -> potion + "_bottle";
default -> potion + "_potion";
case "lava" -> prefix + potion + "_bottle";
default -> prefix + potion + "_potion";
};

float predicate = POTION_PREDICATES.getOrDefault(potion, 0.0f);

getBuilder(itemName).override()
.predicate(NMTItemProperties.potionTypePredicate, potionTypePredicate + predicate)
.model(new ModelFile.UncheckedModelFile(NoMoreThings.rl("item/" + prefix + potionName)))
.model(new ModelFile.UncheckedModelFile(NoMoreThings.rl("item/" + potionName)))
.end();

// Create the individual potion model
getBuilder("item/" + potionName)
.parent(new ModelFile.UncheckedModelFile("item/generated"))
.texture("layer0", NoMoreThings.rl("item/" + prefix + potionName));
.texture("layer0", NoMoreThings.rl("item/" + potionName));
}
}

Expand Down

0 comments on commit 61dde18

Please sign in to comment.