Added Shit+Mouse wheel to pick up / drop items.

Added Partial ItemStack packets to report to the server what itemstack is the target of interation.
Fixed Repairing Items in CraftingTerminal.
This commit is contained in:
AlgorithmX2
2014-05-12 23:11:19 -05:00
parent 9ba6f195fd
commit ff12aa1673
7 changed files with 291 additions and 34 deletions
+21
View File
@@ -6,6 +6,7 @@ import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.world.World;
@@ -123,7 +124,27 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj );
if ( r == null )
{
Item target = request.getItem();
if ( target.isDamageable() && target.isRepairable() )
{
boolean isBad = false;
for (int x = 0; x < ic.getSizeInventory(); x++)
{
ItemStack pis = ic.getStackInSlot( x );
if ( pis == null )
continue;
if ( pis.getItem() != target )
isBad = true;
}
if ( !isBad )
{
super.onPickupFromSlot( p, is );
return request;
}
}
return null;
}
is = r.getCraftingResult( ic );