Skip to content

Commit

Permalink
feat: Add setBurnTime hook
Browse files Browse the repository at this point in the history
  • Loading branch information
BlayTheNinth committed Feb 28, 2024
1 parent 9cdc516 commit 1d7cf6a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ public int getBurnTime(ItemStack itemStack) {
}

@Override
public void setBurnTime(ItemStack itemStack, int burnTime) {
FuelRegistry.INSTANCE.add(itemStack.getItem(), burnTime);
public void setBurnTime(Item item, int burnTime) {
FuelRegistry.INSTANCE.add(item, burnTime);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.ForgeMod;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.ToolActions;
import net.minecraftforge.common.util.FakePlayer;
Expand Down Expand Up @@ -117,8 +116,8 @@ public int getBurnTime(ItemStack itemStack) {
}

@Override
public void setBurnTime(ItemStack itemStack, int burnTime) {
burnTimes.put(itemStack.getItem(), burnTime);
public void setBurnTime(Item item, int burnTime) {
burnTimes.put(item, burnTime);
}

@Override
Expand Down
3 changes: 2 additions & 1 deletion shared/src/main/java/net/blay09/mods/balm/api/BalmHooks.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import net.minecraft.world.entity.Pose;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.DyeColor;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
Expand Down Expand Up @@ -56,7 +57,7 @@ default CompoundTag getPersistentData(Player player) {

int getBurnTime(ItemStack itemStack);

void setBurnTime(ItemStack itemStack, int burnTime);
void setBurnTime(Item item, int burnTime);

void firePlayerCraftingEvent(Player player, ItemStack crafted, Container craftMatrix);

Expand Down

0 comments on commit 1d7cf6a

Please sign in to comment.