generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add campfire with cauldron functionality
- Loading branch information
1 parent
0eb4c6e
commit 716b82c
Showing
27 changed files
with
664 additions
and
102 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
src/main/generated/.cache/c189bb4c92920ea572e0709157481155fe15e5dc
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
46 changes: 38 additions & 8 deletions
46
src/main/generated/assets/caffeinated/blockstates/cauldron_campfire.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 |
---|---|---|
@@ -1,34 +1,64 @@ | ||
{ | ||
"variants": { | ||
"facing=east,lit=false": { | ||
"facing=east,filled=false,lit=false": { | ||
"model": "caffeinated:block/cauldron_campfire_off", | ||
"y": 270 | ||
}, | ||
"facing=east,lit=true": { | ||
"facing=east,filled=false,lit=true": { | ||
"model": "caffeinated:block/cauldron_campfire", | ||
"y": 270 | ||
}, | ||
"facing=north,lit=false": { | ||
"facing=east,filled=true,lit=false": { | ||
"model": "caffeinated:block/cauldron_campfire_off_filled", | ||
"y": 270 | ||
}, | ||
"facing=east,filled=true,lit=true": { | ||
"model": "caffeinated:block/cauldron_campfire_filled", | ||
"y": 270 | ||
}, | ||
"facing=north,filled=false,lit=false": { | ||
"model": "caffeinated:block/cauldron_campfire_off", | ||
"y": 180 | ||
}, | ||
"facing=north,lit=true": { | ||
"facing=north,filled=false,lit=true": { | ||
"model": "caffeinated:block/cauldron_campfire", | ||
"y": 180 | ||
}, | ||
"facing=south,lit=false": { | ||
"facing=north,filled=true,lit=false": { | ||
"model": "caffeinated:block/cauldron_campfire_off_filled", | ||
"y": 180 | ||
}, | ||
"facing=north,filled=true,lit=true": { | ||
"model": "caffeinated:block/cauldron_campfire_filled", | ||
"y": 180 | ||
}, | ||
"facing=south,filled=false,lit=false": { | ||
"model": "caffeinated:block/cauldron_campfire_off" | ||
}, | ||
"facing=south,lit=true": { | ||
"facing=south,filled=false,lit=true": { | ||
"model": "caffeinated:block/cauldron_campfire" | ||
}, | ||
"facing=west,lit=false": { | ||
"facing=south,filled=true,lit=false": { | ||
"model": "caffeinated:block/cauldron_campfire_off_filled" | ||
}, | ||
"facing=south,filled=true,lit=true": { | ||
"model": "caffeinated:block/cauldron_campfire_filled" | ||
}, | ||
"facing=west,filled=false,lit=false": { | ||
"model": "caffeinated:block/cauldron_campfire_off", | ||
"y": 90 | ||
}, | ||
"facing=west,lit=true": { | ||
"facing=west,filled=false,lit=true": { | ||
"model": "caffeinated:block/cauldron_campfire", | ||
"y": 90 | ||
}, | ||
"facing=west,filled=true,lit=false": { | ||
"model": "caffeinated:block/cauldron_campfire_off_filled", | ||
"y": 90 | ||
}, | ||
"facing=west,filled=true,lit=true": { | ||
"model": "caffeinated:block/cauldron_campfire_filled", | ||
"y": 90 | ||
} | ||
} | ||
} |
46 changes: 38 additions & 8 deletions
46
src/main/generated/assets/caffeinated/blockstates/soul_cauldron_campfire.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 |
---|---|---|
@@ -1,34 +1,64 @@ | ||
{ | ||
"variants": { | ||
"facing=east,lit=false": { | ||
"facing=east,filled=false,lit=false": { | ||
"model": "caffeinated:block/cauldron_campfire_off", | ||
"y": 270 | ||
}, | ||
"facing=east,lit=true": { | ||
"facing=east,filled=false,lit=true": { | ||
"model": "caffeinated:block/soul_cauldron_campfire", | ||
"y": 270 | ||
}, | ||
"facing=north,lit=false": { | ||
"facing=east,filled=true,lit=false": { | ||
"model": "caffeinated:block/cauldron_campfire_off_filled", | ||
"y": 270 | ||
}, | ||
"facing=east,filled=true,lit=true": { | ||
"model": "caffeinated:block/soul_cauldron_campfire_filled", | ||
"y": 270 | ||
}, | ||
"facing=north,filled=false,lit=false": { | ||
"model": "caffeinated:block/cauldron_campfire_off", | ||
"y": 180 | ||
}, | ||
"facing=north,lit=true": { | ||
"facing=north,filled=false,lit=true": { | ||
"model": "caffeinated:block/soul_cauldron_campfire", | ||
"y": 180 | ||
}, | ||
"facing=south,lit=false": { | ||
"facing=north,filled=true,lit=false": { | ||
"model": "caffeinated:block/cauldron_campfire_off_filled", | ||
"y": 180 | ||
}, | ||
"facing=north,filled=true,lit=true": { | ||
"model": "caffeinated:block/soul_cauldron_campfire_filled", | ||
"y": 180 | ||
}, | ||
"facing=south,filled=false,lit=false": { | ||
"model": "caffeinated:block/cauldron_campfire_off" | ||
}, | ||
"facing=south,lit=true": { | ||
"facing=south,filled=false,lit=true": { | ||
"model": "caffeinated:block/soul_cauldron_campfire" | ||
}, | ||
"facing=west,lit=false": { | ||
"facing=south,filled=true,lit=false": { | ||
"model": "caffeinated:block/cauldron_campfire_off_filled" | ||
}, | ||
"facing=south,filled=true,lit=true": { | ||
"model": "caffeinated:block/soul_cauldron_campfire_filled" | ||
}, | ||
"facing=west,filled=false,lit=false": { | ||
"model": "caffeinated:block/cauldron_campfire_off", | ||
"y": 90 | ||
}, | ||
"facing=west,lit=true": { | ||
"facing=west,filled=false,lit=true": { | ||
"model": "caffeinated:block/soul_cauldron_campfire", | ||
"y": 90 | ||
}, | ||
"facing=west,filled=true,lit=false": { | ||
"model": "caffeinated:block/cauldron_campfire_off_filled", | ||
"y": 90 | ||
}, | ||
"facing=west,filled=true,lit=true": { | ||
"model": "caffeinated:block/soul_cauldron_campfire_filled", | ||
"y": 90 | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/generated/assets/caffeinated/models/block/cauldron_campfire_filled.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": "caffeinated:block/template_cauldron_campfire_filled", | ||
"textures": { | ||
"fire": "minecraft:block/campfire_fire", | ||
"lit_log": "minecraft:block/campfire_log_lit" | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/generated/assets/caffeinated/models/block/soul_cauldron_campfire_filled.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": "caffeinated:block/template_cauldron_campfire_filled", | ||
"textures": { | ||
"fire": "minecraft:block/soul_campfire_fire", | ||
"lit_log": "minecraft:block/soul_campfire_log_lit" | ||
} | ||
} |
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
52 changes: 52 additions & 0 deletions
52
src/main/java/com/chikoritalover/caffeinated/advancement/BrewCoffeeCriterion.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,52 @@ | ||
package com.chikoritalover.caffeinated.advancement; | ||
|
||
import com.chikoritalover.caffeinated.Caffeinated; | ||
import com.google.gson.JsonObject; | ||
import net.minecraft.advancement.criterion.AbstractCriterion; | ||
import net.minecraft.advancement.criterion.AbstractCriterionConditions; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.predicate.entity.AdvancementEntityPredicateDeserializer; | ||
import net.minecraft.predicate.entity.AdvancementEntityPredicateSerializer; | ||
import net.minecraft.predicate.entity.LootContextPredicate; | ||
import net.minecraft.predicate.item.ItemPredicate; | ||
import net.minecraft.server.network.ServerPlayerEntity; | ||
import net.minecraft.util.Identifier; | ||
|
||
public class BrewCoffeeCriterion extends AbstractCriterion<BrewCoffeeCriterion.Conditions> { | ||
static final Identifier ID = new Identifier(Caffeinated.MODID, "brew_coffee"); | ||
|
||
@Override | ||
protected Conditions conditionsFromJson(JsonObject obj, LootContextPredicate playerPredicate, AdvancementEntityPredicateDeserializer predicateDeserializer) { | ||
ItemPredicate itemPredicate = ItemPredicate.fromJson(obj.get("item")); | ||
return new Conditions(playerPredicate, itemPredicate); | ||
} | ||
|
||
@Override | ||
public Identifier getId() { | ||
return ID; | ||
} | ||
|
||
public void trigger(ServerPlayerEntity player, ItemStack stack) { | ||
this.trigger(player, conditions -> conditions.matches(stack)); | ||
} | ||
|
||
public static class Conditions extends AbstractCriterionConditions { | ||
private final ItemPredicate itemPredicate; | ||
|
||
public Conditions(LootContextPredicate player, ItemPredicate item) { | ||
super(ID, player); | ||
this.itemPredicate = item; | ||
} | ||
|
||
public boolean matches(ItemStack stack) { | ||
return this.itemPredicate.test(stack); | ||
} | ||
|
||
@Override | ||
public JsonObject toJson(AdvancementEntityPredicateSerializer predicateSerializer) { | ||
JsonObject jsonObject = super.toJson(predicateSerializer); | ||
jsonObject.add("item", this.itemPredicate.toJson()); | ||
return jsonObject; | ||
} | ||
} | ||
} |
Oops, something went wrong.