1.14.3 pre 1

This commit is contained in:
gnembon committed 2019-06-03 22:37:12 -03:00
1 parent b5454a8285
commit 5faa8754fb
12 files changed
+19 -39

No files matched your search

@@ -38,7 +38,7 @@ public class ContainerMixin
if(int_1 == 0 && int_2 == 1)
{
ItemStack itemStackDropAll = dropAllCrafting(playerEntity_1, int_1, slotList);
while (!itemStackDropAll.isEmpty() && ItemStack.areEqual(slot_4.getStack(), itemStackDropAll))
while (!itemStackDropAll.isEmpty() && ItemStack.areItemsEqual(slot_4.getStack(), itemStackDropAll))
{
itemStack_1 = itemStackDropAll.copy();
itemStackDropAll = dropAllCrafting(playerEntity_1, int_1, slotList);
@@ -61,10 +61,10 @@ public class ContainerMixin
if (index == 0)
{
playerIn.dropItem(itemstack, true);
itemstack1.setAmount(0);
itemstack1.setCount(0);
slot.onStackChanged(itemstack1, itemstack);
}
if (itemstack.getAmount() == itemstack1.getAmount())
if (itemstack.getCount() == itemstack1.getCount())
{
return ItemStack.EMPTY;
}
@@ -55,14 +55,14 @@ public abstract class ItemEntityMixin extends Entity implements IItemEntity {
method = "method_20397",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/item/ItemStack;getMaxAmount()I"
target = "Lnet/minecraft/item/ItemStack;getMaxCount()I"
)
)
private int getItemStackMaxAmount(ItemStack stack) {
if (CarpetSettings.b_stackableShulkerBoxes && stack.getItem() instanceof BlockItem && ((BlockItem)stack.getItem()).getBlock() instanceof ShulkerBoxBlock)
return SHULKERBOX_MAX_STACK_AMOUNT;
return stack.getMaxAmount();
return stack.getMaxCount();
}
@Inject(
@@ -82,17 +82,17 @@ public abstract class ItemEntityMixin extends Entity implements IItemEntity {
if (selfStack.getItem() == otherStack.getItem()
&& !InventoryHelper.shulkerBoxHasItems(selfStack)
&& selfStack.hasTag() == otherStack.hasTag()
&& selfStack.getAmount() + otherStack.getAmount() <= SHULKERBOX_MAX_STACK_AMOUNT)
&& selfStack.getCount() + otherStack.getCount() <= SHULKERBOX_MAX_STACK_AMOUNT)
{
int amount = Math.min(otherStack.getAmount(), SHULKERBOX_MAX_STACK_AMOUNT - selfStack.getAmount());
int amount = Math.min(otherStack.getCount(), SHULKERBOX_MAX_STACK_AMOUNT - selfStack.getCount());
selfStack.addAmount(amount);
selfStack.increment(amount);
self.setStack(selfStack);
this.pickupDelay = Math.max(((IItemEntity)other).getPickupDelay(), this.pickupDelay);
this.age = Math.min(((IItemEntity)other).getAge(), this.age);
otherStack.subtractAmount(amount);
otherStack.decrement(amount);
if (otherStack.isEmpty())
{
other.remove();
@@ -1,6 +1,5 @@
package carpet.mixins;
import carpet.fakes.WorldInterface;
import carpet.utils.SpawnReporter;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import net.minecraft.entity.EntityCategory;
@@ -1,18 +0,0 @@
package carpet.mixins;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.SpawnRestriction;
import net.minecraft.world.Heightmap;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(SpawnRestriction.class)
public abstract class SpawnRestrictionMixin
{
@Shadow
private static void register(EntityType<?> a, SpawnRestriction.Location b, Heightmap.Type c) { }
static {
register(EntityType.SHULKER, SpawnRestriction.Location.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES);
}
}