generated from TropheusJ/quilt-template-mod
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HOW WAS THIS NOT FOUND
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/main/java/one/devos/nautical/succ/mixin/ItemStackMixin.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,29 @@ | ||
package one.devos.nautical.succ.mixin; | ||
|
||
import net.minecraft.core.Registry; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.item.ItemStack; | ||
|
||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.state.pattern.BlockInWorld; | ||
|
||
import one.devos.nautical.succ.Succ; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(ItemStack.class) | ||
public abstract class ItemStackMixin { | ||
@Shadow | ||
public abstract boolean is(Item item); | ||
|
||
@Inject(method = "hasAdventureModePlaceTagForBlock", at = @At("HEAD"), cancellable = true) | ||
private void succ$allowAdventureClimbing(Registry<Block> blockRegistry, BlockInWorld pos, CallbackInfoReturnable<Boolean> cir) { | ||
if (is(Succ.SUCTION_CUP)) { | ||
cir.setReturnValue(Boolean.TRUE); | ||
} | ||
} | ||
} |
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
f9592b8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tfw when everyone thought they tested it