Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register burnables properly on fabric #81

Open
wants to merge 1 commit into
base: 1.19
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Common/src/main/java/lilypuree/decorative_blocks/core/DBTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

public class DBTags {
public static class Blocks {
public static TagKey<Block> PALISADES_THAT_BURN;
public static TagKey<Block> SUPPORTS_THAT_BURN;
public static TagKey<Block> SEATS_THAT_BURN;
public static TagKey<Block> BEAMS_THAT_BURN;
public static TagKey<Block> PALISADES;
public static TagKey<Block> SUPPORTS;
public static TagKey<Block> SEATS;
Expand All @@ -19,28 +23,44 @@ public static class Blocks {
public static TagKey<Block> BONFIRES;

public static void init() {
PALISADES_THAT_BURN = TagKey.create(Registry.BLOCK_REGISTRY, id("palisades_that_burn"));
SUPPORTS_THAT_BURN = TagKey.create(Registry.BLOCK_REGISTRY, id("supports_that_burn"));
SEATS_THAT_BURN = TagKey.create(Registry.BLOCK_REGISTRY, id("seats_that_burn"));
BEAMS_THAT_BURN = TagKey.create(Registry.BLOCK_REGISTRY, id("beams_that_burn"));

PALISADES = TagKey.create(Registry.BLOCK_REGISTRY, id("palisades"));
SUPPORTS = TagKey.create(Registry.BLOCK_REGISTRY, id("supports"));
SEATS = TagKey.create(Registry.BLOCK_REGISTRY, id("seats"));
BEAMS = TagKey.create(Registry.BLOCK_REGISTRY, id("beams"));

CHANDELIERS = TagKey.create(Registry.BLOCK_REGISTRY, id("chandeliers"));
BRAZIERS = TagKey.create(Registry.BLOCK_REGISTRY, id("braziers"));
BONFIRES = TagKey.create(Registry.BLOCK_REGISTRY, id("bonfires"));
}
}

public static class Items {
public static TagKey<Item> PALISADES_THAT_BURN;
public static TagKey<Item> SUPPORTS_THAT_BURN;
public static TagKey<Item> SEATS_THAT_BURN;
public static TagKey<Item> BEAMS_THAT_BURN;
public static TagKey<Item> PALISADES;
public static TagKey<Item> SUPPORTS;
public static TagKey<Item> SEATS;
public static TagKey<Item> BEAMS;
public static TagKey<Item> CHANDELIERS;

public static void init() {
PALISADES_THAT_BURN = TagKey.create(Registry.ITEM_REGISTRY, id("palisades_that_burn"));
SUPPORTS_THAT_BURN = TagKey.create(Registry.ITEM_REGISTRY, id("supports_that_burn"));
SEATS_THAT_BURN = TagKey.create(Registry.ITEM_REGISTRY, id("seats_that_burn"));
BEAMS_THAT_BURN = TagKey.create(Registry.ITEM_REGISTRY, id("beams_that_burn"));

PALISADES = TagKey.create(Registry.ITEM_REGISTRY, id("palisades"));
SUPPORTS = TagKey.create(Registry.ITEM_REGISTRY, id("supports"));
SEATS = TagKey.create(Registry.ITEM_REGISTRY, id("seats"));
BEAMS = TagKey.create(Registry.ITEM_REGISTRY, id("beams"));

CHANDELIERS = TagKey.create(Registry.ITEM_REGISTRY, id("chandeliers"));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ private static void add(Map<Item, Integer> map, ItemLike itemProvider, int burnT

@Inject(method = "getFuel", at = @At("RETURN"), locals = LocalCapture.CAPTURE_FAILSOFT)
private static void onGetBurnTime(CallbackInfoReturnable<Map<Item, Integer>> cir, Map<Item, Integer> map) {
add(map, DBTags.Items.BEAMS, 300);
add(map, DBTags.Items.PALISADES, 300);
add(map, DBTags.Items.SEATS, 300);
add(map, DBTags.Items.SUPPORTS, 300);
add(map, DBTags.Items.BEAMS_THAT_BURN, 300);
add(map, DBTags.Items.PALISADES_THAT_BURN, 300);
add(map, DBTags.Items.SEATS_THAT_BURN, 300);
add(map, DBTags.Items.SUPPORTS_THAT_BURN, 300);
add(map, DBTags.Items.CHANDELIERS, 1600);
add(map, DBBlocks.LATTICE, 100);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
"values": [
"decorative_blocks:oak_beam",
"decorative_blocks:birch_beam",
"decorative_blocks:spruce_beam",
"decorative_blocks:acacia_beam",
"decorative_blocks:jungle_beam",
"decorative_blocks:dark_oak_beam",
"decorative_blocks:mangrove_beam",
"#decorative_blocks:beams_that_burn",
"decorative_blocks:crimson_beam",
"decorative_blocks:warped_beam"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"values": [
"decorative_blocks:oak_beam",
"decorative_blocks:birch_beam",
"decorative_blocks:spruce_beam",
"decorative_blocks:acacia_beam",
"decorative_blocks:jungle_beam",
"decorative_blocks:dark_oak_beam",
"decorative_blocks:mangrove_beam"
]
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
"values": [
"decorative_blocks:oak_palisade",
"decorative_blocks:birch_palisade",
"decorative_blocks:spruce_palisade",
"decorative_blocks:acacia_palisade",
"decorative_blocks:jungle_palisade",
"decorative_blocks:dark_oak_palisade",
"decorative_blocks:mangrove_palisade",
"#decorative_blocks:palisades_that_burn",
"decorative_blocks:crimson_palisade",
"decorative_blocks:warped_palisade"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"values": [
"decorative_blocks:oak_palisade",
"decorative_blocks:birch_palisade",
"decorative_blocks:spruce_palisade",
"decorative_blocks:acacia_palisade",
"decorative_blocks:jungle_palisade",
"decorative_blocks:dark_oak_palisade",
"decorative_blocks:mangrove_palisade"
]
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
"values": [
"decorative_blocks:oak_seat",
"decorative_blocks:birch_seat",
"decorative_blocks:spruce_seat",
"decorative_blocks:acacia_seat",
"decorative_blocks:jungle_seat",
"decorative_blocks:dark_oak_seat",
"decorative_blocks:mangrove_seat",
"#decorative_blocks:seats_that_burn",
"decorative_blocks:crimson_seat",
"decorative_blocks:warped_seat"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"values": [
"decorative_blocks:oak_seat",
"decorative_blocks:birch_seat",
"decorative_blocks:spruce_seat",
"decorative_blocks:acacia_seat",
"decorative_blocks:jungle_seat",
"decorative_blocks:dark_oak_seat",
"decorative_blocks:mangrove_seat"
]
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
"values": [
"decorative_blocks:oak_support",
"decorative_blocks:birch_support",
"decorative_blocks:spruce_support",
"decorative_blocks:acacia_support",
"decorative_blocks:jungle_support",
"decorative_blocks:dark_oak_support",
"decorative_blocks:mangrove_support",
"#decorative_blocks:supports_that_burn",
"decorative_blocks:crimson_support",
"decorative_blocks:warped_support"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"values": [
"decorative_blocks:oak_support",
"decorative_blocks:birch_support",
"decorative_blocks:spruce_support",
"decorative_blocks:acacia_support",
"decorative_blocks:jungle_support",
"decorative_blocks:dark_oak_support",
"decorative_blocks:mangrove_support"
]
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
"values": [
"decorative_blocks:oak_beam",
"decorative_blocks:birch_beam",
"decorative_blocks:spruce_beam",
"decorative_blocks:acacia_beam",
"decorative_blocks:jungle_beam",
"decorative_blocks:dark_oak_beam",
"decorative_blocks:mangrove_beam",
"#decorative_blocks:beams_that_burn",
"decorative_blocks:crimson_beam",
"decorative_blocks:warped_beam"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"values": [
"decorative_blocks:oak_beam",
"decorative_blocks:birch_beam",
"decorative_blocks:spruce_beam",
"decorative_blocks:acacia_beam",
"decorative_blocks:jungle_beam",
"decorative_blocks:dark_oak_beam",
"decorative_blocks:mangrove_beam"
]
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
"values": [
"decorative_blocks:oak_palisade",
"decorative_blocks:birch_palisade",
"decorative_blocks:spruce_palisade",
"decorative_blocks:acacia_palisade",
"decorative_blocks:jungle_palisade",
"decorative_blocks:dark_oak_palisade",
"decorative_blocks:mangrove_palisade",
"#decorative_blocks:palisades_that_burn",
"decorative_blocks:crimson_palisade",
"decorative_blocks:warped_palisade"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"values": [
"decorative_blocks:oak_palisade",
"decorative_blocks:birch_palisade",
"decorative_blocks:spruce_palisade",
"decorative_blocks:acacia_palisade",
"decorative_blocks:jungle_palisade",
"decorative_blocks:dark_oak_palisade",
"decorative_blocks:mangrove_palisade"
]
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
"values": [
"decorative_blocks:oak_seat",
"decorative_blocks:birch_seat",
"decorative_blocks:spruce_seat",
"decorative_blocks:acacia_seat",
"decorative_blocks:jungle_seat",
"decorative_blocks:dark_oak_seat",
"decorative_blocks:mangrove_seat",
"#decorative_blocks:seats_that_burn",
"decorative_blocks:crimson_seat",
"decorative_blocks:warped_seat"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"values": [
"decorative_blocks:oak_seat",
"decorative_blocks:birch_seat",
"decorative_blocks:spruce_seat",
"decorative_blocks:acacia_seat",
"decorative_blocks:jungle_seat",
"decorative_blocks:dark_oak_seat",
"decorative_blocks:mangrove_seat"
]
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
"values": [
"decorative_blocks:oak_support",
"decorative_blocks:birch_support",
"decorative_blocks:spruce_support",
"decorative_blocks:acacia_support",
"decorative_blocks:jungle_support",
"decorative_blocks:dark_oak_support",
"decorative_blocks:mangrove_support",
"#decorative_blocks:supports_that_burn",
"decorative_blocks:crimson_support",
"decorative_blocks:warped_support"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"values": [
"decorative_blocks:oak_support",
"decorative_blocks:birch_support",
"decorative_blocks:spruce_support",
"decorative_blocks:acacia_support",
"decorative_blocks:jungle_support",
"decorative_blocks:dark_oak_support",
"decorative_blocks:mangrove_support"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public void onInitialize() {
Registration.init();
DBBlocks.init();
DBItems.init();
FuelRegistration.init();
ModSetup.init();
Callbacks.initCallbacks();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package lilypuree.decorative_blocks;

import lilypuree.decorative_blocks.core.DBBlocks;
import lilypuree.decorative_blocks.core.DBTags;
import net.fabricmc.fabric.api.registry.FuelRegistry;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.ItemLike;

public class FuelRegistration {
public static void init() {
register(DBTags.Items.BEAMS_THAT_BURN, 300);
register(DBTags.Items.PALISADES_THAT_BURN, 300);
register(DBTags.Items.SEATS_THAT_BURN, 300);
register(DBTags.Items.SUPPORTS_THAT_BURN, 300);
register(DBTags.Items.CHANDELIERS, 1600);
register(DBBlocks.LATTICE, 100);
}

private static void register(ItemLike item, int time) {
FuelRegistry.INSTANCE.add(item, time);
}

private static void register(TagKey<Item> tag, int time) {
FuelRegistry.INSTANCE.add(tag, time);
}
}
1 change: 0 additions & 1 deletion Fabric/src/main/resources/decorative_blocks.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"package": "lilypuree.decorative_blocks.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
"AbstractFurnaceTileEntityMixin",
"FireBlockInvoker",
"ItemEntityMixin",
"WalkNodeEvaluatorMixin",
Expand Down
Empty file modified gradlew
100644 → 100755
Empty file.