-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #406 from ValkyrienSkies/1.18.x/fuel-compat
resolved fuel compatibility issue
- Loading branch information
Showing
8 changed files
with
55 additions
and
9 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
common/src/main/java/org/valkyrienskies/eureka/registry/FuelRegistry.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,9 @@ | ||
package org.valkyrienskies.eureka.registry; | ||
|
||
import net.minecraft.world.item.ItemStack; | ||
|
||
public abstract class FuelRegistry { | ||
public static FuelRegistry INSTANCE = null; | ||
|
||
public abstract int get(ItemStack stack); | ||
} |
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
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
16 changes: 16 additions & 0 deletions
16
fabric/src/main/java/org/valkyrienskies/eureka/fabric/registry/FuelRegistryImpl.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,16 @@ | ||
package org.valkyrienskies.eureka.fabric.registry; | ||
|
||
import net.fabricmc.fabric.api.registry.FuelRegistry; | ||
import net.minecraft.world.item.ItemStack; | ||
|
||
public class FuelRegistryImpl extends org.valkyrienskies.eureka.registry.FuelRegistry { | ||
public FuelRegistryImpl() { | ||
INSTANCE = this; | ||
} | ||
|
||
@Override | ||
public int get(ItemStack stack) { | ||
Integer time = FuelRegistry.INSTANCE.get(stack.getItem()); | ||
return time == null ? 0 : time; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
forge/src/main/java/org/valkyrienskies/eureka/forge/registry/FuelRegistryImpl.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,16 @@ | ||
package org.valkyrienskies.eureka.forge.registry; | ||
|
||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraftforge.common.ForgeHooks; | ||
|
||
public class FuelRegistryImpl extends org.valkyrienskies.eureka.registry.FuelRegistry { | ||
|
||
public FuelRegistryImpl() { | ||
INSTANCE = this; | ||
} | ||
|
||
@Override | ||
public int get(ItemStack stack) { | ||
return ForgeHooks.getBurnTime(stack, null); | ||
} | ||
} |
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