Migrate Carpet Mixin names to mojang mappings
This commit is contained in:
1 parent
2c3871b90e
commit
a547677597
154 files changed
+422
-501
No files matched your search
@@ -0,0 +1,33 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import carpet.helpers.InventoryHelper;
|
||||
import net.minecraft.world.inventory.AbstractContainerMenu;
|
||||
import net.minecraft.world.inventory.Slot;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.ShulkerBoxBlock;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(AbstractContainerMenu.class)
|
||||
public class AbstractContainerMenu_stackableSBoxesMixin
|
||||
{
|
||||
@Redirect(method = "doClick", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/inventory/Slot;getMaxStackSize(Lnet/minecraft/world/item/ItemStack;)I"
|
||||
))
|
||||
private int getMaxCountForSboxesInScreenHander(Slot slot, ItemStack stack)
|
||||
{
|
||||
if (CarpetSettings.shulkerBoxStackSize > 1 &&
|
||||
stack.getItem() instanceof BlockItem &&
|
||||
((BlockItem)stack.getItem()).getBlock() instanceof ShulkerBoxBlock &&
|
||||
!InventoryHelper.shulkerBoxHasItems(stack)
|
||||
)
|
||||
{
|
||||
return CarpetSettings.shulkerBoxStackSize;
|
||||
}
|
||||
return slot.getMaxStackSize(stack);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user