Merge branch 'master' into future
# Conflicts: # src/main/java/carpet/mixins/PlayerManager_fakePlayersMixin.java
This commit is contained in:
commit
fc4c721510
6 files changed
+48
-15
No files matched your search
@@ -23,7 +23,7 @@ public class AbstractCauldronBlock_stackableSBoxesMixin
|
||||
private ActionResult wrapInteractor(CauldronBehavior cauldronBehavior, BlockState blockState, World world, BlockPos blockPos, PlayerEntity playerEntity, Hand hand, ItemStack itemStack)
|
||||
{
|
||||
int count = -1;
|
||||
if (CarpetSettings.stackableShulkerBoxes && itemStack.getItem() instanceof BlockItem && ((BlockItem)itemStack.getItem()).getBlock() instanceof ShulkerBoxBlock)
|
||||
if (CarpetSettings.shulkerBoxStackSize > 1 && itemStack.getItem() instanceof BlockItem && ((BlockItem)itemStack.getItem()).getBlock() instanceof ShulkerBoxBlock)
|
||||
count = itemStack.getCount();
|
||||
ActionResult result = cauldronBehavior.interact(blockState, world, blockPos, playerEntity, hand, itemStack);
|
||||
if (count > 0 && result.isAccepted())
|
||||
|
||||
@@ -50,7 +50,7 @@ public abstract class ItemEntityMixin extends Entity implements ItemEntityInterf
|
||||
@Inject(method="<init>(Lnet/minecraft/world/World;DDDLnet/minecraft/item/ItemStack;)V", at = @At("RETURN"))
|
||||
private void removeEmptyShulkerBoxTags(World worldIn, double x, double y, double z, ItemStack stack, CallbackInfo ci)
|
||||
{
|
||||
if (CarpetSettings.stackableShulkerBoxes
|
||||
if (CarpetSettings.shulkerBoxStackSize > 1
|
||||
&& stack.getItem() instanceof BlockItem
|
||||
&& ((BlockItem)stack.getItem()).getBlock() instanceof ShulkerBoxBlock)
|
||||
{
|
||||
@@ -68,8 +68,8 @@ public abstract class ItemEntityMixin extends Entity implements ItemEntityInterf
|
||||
)
|
||||
)
|
||||
private int getItemStackMaxAmount(ItemStack stack) {
|
||||
if (CarpetSettings.stackableShulkerBoxes && stack.getItem() instanceof BlockItem && ((BlockItem)stack.getItem()).getBlock() instanceof ShulkerBoxBlock)
|
||||
return SHULKERBOX_MAX_STACK_AMOUNT;
|
||||
if (CarpetSettings.shulkerBoxStackSize > 1 && stack.getItem() instanceof BlockItem && ((BlockItem)stack.getItem()).getBlock() instanceof ShulkerBoxBlock)
|
||||
return CarpetSettings.shulkerBoxStackSize;
|
||||
|
||||
return stack.getMaxCount();
|
||||
}
|
||||
@@ -83,7 +83,7 @@ public abstract class ItemEntityMixin extends Entity implements ItemEntityInterf
|
||||
{
|
||||
ItemEntity self = (ItemEntity)(Object)this;
|
||||
ItemStack selfStack = self.getStack();
|
||||
if (!CarpetSettings.stackableShulkerBoxes || !(selfStack.getItem() instanceof BlockItem) || !(((BlockItem)selfStack.getItem()).getBlock() instanceof ShulkerBoxBlock)) {
|
||||
if (CarpetSettings.shulkerBoxStackSize == 1 || !(selfStack.getItem() instanceof BlockItem) || !(((BlockItem)selfStack.getItem()).getBlock() instanceof ShulkerBoxBlock)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -92,9 +92,9 @@ public abstract class ItemEntityMixin extends Entity implements ItemEntityInterf
|
||||
&& !InventoryHelper.shulkerBoxHasItems(selfStack)
|
||||
&& !InventoryHelper.shulkerBoxHasItems(otherStack)
|
||||
&& selfStack.hasNbt() == otherStack.hasNbt()
|
||||
&& selfStack.getCount() + otherStack.getCount() <= SHULKERBOX_MAX_STACK_AMOUNT)
|
||||
&& selfStack.getCount() + otherStack.getCount() <= CarpetSettings.shulkerBoxStackSize)
|
||||
{
|
||||
int amount = Math.min(otherStack.getCount(), SHULKERBOX_MAX_STACK_AMOUNT - selfStack.getCount());
|
||||
int amount = Math.min(otherStack.getCount(), CarpetSettings.shulkerBoxStackSize - selfStack.getCount());
|
||||
|
||||
selfStack.increment(amount);
|
||||
self.setStack(selfStack);
|
||||
|
||||
@@ -62,7 +62,7 @@ public abstract class PlayerManager_fakePlayersMixin
|
||||
@Inject(method = "createPlayer", at = @At(value = "INVOKE", shift = At.Shift.BEFORE,
|
||||
target = "Ljava/util/Iterator;hasNext()Z"), locals = LocalCapture.CAPTURE_FAILHARD)
|
||||
private void newWhileLoop(GameProfile gameProfile_1, CallbackInfoReturnable<ServerPlayerEntity> cir, UUID uUID_1,
|
||||
List list_1, ServerPlayerEntity player, Iterator var5)
|
||||
List list_1, ServerPlayerEntity serverPlayerEntity, Iterator var5)
|
||||
{
|
||||
while (var5.hasNext())
|
||||
{
|
||||
|
||||
@@ -20,13 +20,13 @@ public class ScreenHandler_stackableSBoxesMixin
|
||||
))
|
||||
private int getMaxCountForSboxesInScreenHander(Slot slot, ItemStack stack)
|
||||
{
|
||||
if (CarpetSettings.stackableShulkerBoxes &&
|
||||
if (CarpetSettings.shulkerBoxStackSize > 1 &&
|
||||
stack.getItem() instanceof BlockItem &&
|
||||
((BlockItem)stack.getItem()).getBlock() instanceof ShulkerBoxBlock &&
|
||||
!InventoryHelper.shulkerBoxHasItems(stack)
|
||||
)
|
||||
{
|
||||
return CarpetSettings.SHULKER_STACK_SIZE;
|
||||
return CarpetSettings.shulkerBoxStackSize;
|
||||
}
|
||||
return slot.getMaxItemCount(stack);
|
||||
}
|
||||
|
||||
@@ -18,13 +18,13 @@ public class Slot_stackableSBoxesMixin {
|
||||
))
|
||||
private int getMaxCountForSboxesInSlot(Slot slot, ItemStack stack)
|
||||
{
|
||||
if (CarpetSettings.stackableShulkerBoxes &&
|
||||
if (CarpetSettings.shulkerBoxStackSize > 1 &&
|
||||
stack.getItem() instanceof BlockItem &&
|
||||
((BlockItem)stack.getItem()).getBlock() instanceof ShulkerBoxBlock &&
|
||||
!InventoryHelper.shulkerBoxHasItems(stack)
|
||||
)
|
||||
{
|
||||
return CarpetSettings.SHULKER_STACK_SIZE;
|
||||
return CarpetSettings.shulkerBoxStackSize;
|
||||
}
|
||||
return slot.getMaxItemCount(stack);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user