Skip to content

Commit

Permalink
burn items to ashes + terracotta crushing adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
MBatt1 committed Aug 21, 2023
1 parent ef4aaed commit d5fde8a
Show file tree
Hide file tree
Showing 14 changed files with 98 additions and 17 deletions.
2 changes: 2 additions & 0 deletions src/main/java/net/cr24/primeval/item/PrimevalItemTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public class PrimevalItemTags {
public static final TagKey<Item> BURNABLE_SHORT = register("burnable_short");
public static final TagKey<Item> BURNABLE_LONG = register("burnable_long");

public static final TagKey<Item> BURNS_TO_ASH = register("burns_to_ash");

public static final TagKey<Item> KNIVES = register("knives");
public static final TagKey<Item> LOGS = register("logs");
public static final TagKey<Item> ROCKS = register("rocks");
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/net/cr24/primeval/mixin/item/ItemStackMixin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package net.cr24.primeval.mixin.item;

import net.cr24.primeval.item.PrimevalItemTags;
import net.cr24.primeval.item.PrimevalItems;
import net.minecraft.entity.ItemEntity;
import net.minecraft.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(ItemStack.class)
public class ItemStackMixin {

@Inject(method = "onItemEntityDestroyed", at = @At(value = "HEAD"))
public void onItemEntityDestroyed(ItemEntity entity, CallbackInfo info) {
ItemStack stack = entity.getStack();
if (stack.isIn(PrimevalItemTags.BURNS_TO_ASH)) entity.dropStack(new ItemStack(PrimevalItems.ASHES, stack.getCount()));
}
}
11 changes: 0 additions & 11 deletions src/main/resources/data/primeval/recipes/ashes_campfire_stick.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"item": "primeval:crushed_terracotta",
"count": 1
},
"wheelDamage":2
"wheelDamage":1
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"item": "primeval:crushed_terracotta",
"count": 6
},
"wheelDamage":2
"wheelDamage": 5
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"item": "primeval:crushed_terracotta",
"count": 5
},
"wheelDamage":2
"wheelDamage":4
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"values": [
"#primeval:logs",
"#primeval:crates",
"primeval:straw_mesh"
"primeval:straw_mesh",
"primeval:wicker_basket",
"primeval:crude_crafting_bench"
]
}
15 changes: 14 additions & 1 deletion src/main/resources/data/primeval/tags/items/burnable_short.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"replace": false,
"values": [
"#primeval:saplings",
"#primeval:daub",
"#primeval:fences",
"#primeval:fence_gates",
"#primeval:doors",
"primeval:straw",
"primeval:stick",
"primeval:straw_block",
Expand All @@ -11,11 +15,20 @@
"primeval:oak_planks",
"primeval:oak_stairs",
"primeval:oak_slab",
"primeval:oak_panel",
"primeval:birch_planks",
"primeval:birch_stairs",
"primeval:birch_slab",
"primeval:birch_panel",
"primeval:spruce_planks",
"primeval:spruce_stairs",
"primeval:spruce_slab"
"primeval:spruce_slab",
"primeval:spruce_panel",
"primeval:wicker",
"primeval:wicker_stairs",
"primeval:wicker_slab",
"primeval:rope",
"primeval:rope_ladder",
"primeval:wooden_bucket"
]
}
9 changes: 9 additions & 0 deletions src/main/resources/data/primeval/tags/items/burns_to_ash.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"replace": false,
"values": [
"#primeval:burnable_long",
"#primeval:burnable_short",
"primeval:wheat",
"primeval:cabbage"
]
}
13 changes: 13 additions & 0 deletions src/main/resources/data/primeval/tags/items/daub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"replace": false,
"values": [
"primeval:daub",
"primeval:framed_daub",
"primeval:framed_pillar_daub",
"primeval:framed_cross_daub",
"primeval:framed_inverted_cross_daub",
"primeval:framed_x_daub",
"primeval:framed_plus_daub",
"primeval:framed_divided_daub"
]
}
13 changes: 13 additions & 0 deletions src/main/resources/data/primeval/tags/items/doors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"replace": false,
"values": [
"primeval:oak_door",
"primeval:oak_trapdoor",
"primeval:birch_door",
"primeval:birch_trapdoor",
"primeval:spruce_door",
"primeval:spruce_trapdoor",
"primeval:wicker_door",
"primeval:wicker_trapdoor"
]
}
8 changes: 8 additions & 0 deletions src/main/resources/data/primeval/tags/items/fence_gates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"replace": false,
"values": [
"primeval:oak_fence_gate",
"primeval:birch_fence_gate",
"primeval:spruce_fence_gate"
]
}
11 changes: 11 additions & 0 deletions src/main/resources/data/primeval/tags/items/fences.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"replace": false,
"values": [
"primeval:oak_fence",
"primeval:oak_log_fence",
"primeval:birch_fence",
"primeval:birch_log_fence",
"primeval:spruce_fence",
"primeval:spruce_log_fence"
]
}
3 changes: 2 additions & 1 deletion src/main/resources/primeval.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"world.GameRulesMixin",
"entity.mob.AbstractSkeletonEntityMixin",
"entity.mob.ZombieEntityMixin",
"entity.passive.PigEntityMixin"
"entity.passive.PigEntityMixin",
"item.ItemStackMixin"
],
"client": [
"client.color.block.BlockColorsMixin",
Expand Down

0 comments on commit d5fde8a

Please sign in to comment.