moved rest of the stuff. mixins needed still

This commit is contained in:
gnembon committed 2019-05-13 01:48:00 -03:00
1 parent 394891ab5f
commit 5251bff2c7
10 files changed
+1075 -3

No files matched your search

@@ -0,0 +1,48 @@
package carpet.helpers;
import net.minecraft.entity.LivingEntity LivingEntity;
import net.minecraft.entity.player.PlayerEntity PlayerEntity;
import net.minecraft.inventory. EntityEquipmentSlot;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import java.util.List;
public class CtrlQCrafting {
public static ItemStack dropAllCrafting(PlayerEntity playerIn, int index, List<Slot> invSlotParam)
{
ItemStack itemstack = ItemStack.EMPTY;
Slot slot = invSlotParam.get(index);
if (slot != null && slot.getHasStack())
{
ItemStack itemstack1 = slot.getStack();
itemstack = itemstack1.copy();
EntityEquipmentSlot entityequipmentslot = LivingEntity.getSlotForItemStack(itemstack);
if (index == 0)
{
playerIn.dropItem(itemstack, true);
itemstack1.setCount(0);
slot.onSlotChange(itemstack1, itemstack);
}
if (itemstack.getCount() == itemstack1.getCount())
{
return ItemStack.EMPTY;
}
ItemStack itemstack2 = slot.onTake(playerIn, itemstack1);
if (index == 0)
{
playerIn.dropItem(itemstack2, false);
}
}
return itemstack;
}
}