-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
11 changed files
with
83 additions
and
19 deletions.
There are no files selected for viewing
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
28 changes: 28 additions & 0 deletions
28
fabric/src/main/java/de/cech12/bucketlib/mixin/AbstractFurnaceBlockEntityMixin.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,28 @@ | ||
package de.cech12.bucketlib.mixin; | ||
|
||
import de.cech12.bucketlib.api.item.UniversalBucketItem; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity; | ||
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.CallbackInfoReturnable; | ||
|
||
@Mixin({AbstractFurnaceBlockEntity.class}) | ||
public abstract class AbstractFurnaceBlockEntityMixin { | ||
|
||
@Inject(method = "getBurnDuration", at = @At("RETURN"), cancellable = true) | ||
private void getBurnDurationProxy(ItemStack itemStack, CallbackInfoReturnable<Integer> cir) { | ||
if (cir.getReturnValue() <= 0 && itemStack.getItem() instanceof UniversalBucketItem universalBucketItem) { | ||
cir.setReturnValue(universalBucketItem.getBucketBurnTime(itemStack, null)); | ||
} | ||
} | ||
|
||
@Inject(method = "isFuel", at = @At("RETURN"), cancellable = true) | ||
private static void isFuelProxy(ItemStack itemStack, CallbackInfoReturnable<Boolean> cir) { | ||
if (!cir.getReturnValue() && itemStack.getItem() instanceof UniversalBucketItem universalBucketItem) { | ||
cir.setReturnValue(universalBucketItem.getBucketBurnTime(itemStack, null) > 0); | ||
} | ||
} | ||
|
||
} |
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
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