-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be31ea2
commit 2c27469
Showing
3 changed files
with
24 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
* Add compacting drawer | ||
* Add option to control whether drawer retain contents when broken | ||
* Add option to control whether drawer retain contents when broken | ||
* Fix shulker box weirdness |
20 changes: 20 additions & 0 deletions
20
src/main/java/io/github/mattidragon/extendeddrawers/mixin/ShulkerBoxBlockEntityMixin.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,20 @@ | ||
package io.github.mattidragon.extendeddrawers.mixin; | ||
|
||
import io.github.mattidragon.extendeddrawers.item.DrawerItem; | ||
import net.minecraft.block.entity.ShulkerBoxBlockEntity; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.math.Direction; | ||
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(ShulkerBoxBlockEntity.class) | ||
public class ShulkerBoxBlockEntityMixin { | ||
@Inject(method = "canInsert", at = @At("HEAD"), cancellable = true) | ||
private void extended_drawers$fixShulkerBoxInsertion(int slot, ItemStack stack, Direction dir, CallbackInfoReturnable<Boolean> cir) { | ||
if (stack.getItem() instanceof DrawerItem item && !item.canBeNested()) { | ||
cir.setReturnValue(false); | ||
} | ||
} | ||
} |
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