aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/slots/SlotNoInputLogging.java
blob: 762714ac94a6bd9d4634d4380fbcca14a387c0d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package gtPlusPlus.core.slots;

import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.minecraft.ItemUtils;
import net.minecraft.block.Block;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;

public class SlotNoInputLogging extends SlotNoInput {

	private final int aSlotIndex;
	
	public SlotNoInputLogging(final IInventory inventory, final int index, final int x, final int y) {
		super(inventory, index, x, y);
		aSlotIndex = index;
		Logger.INFO("Slot "+index+" is doing logging");
	}

	@Override
	public boolean isItemValid(final ItemStack itemstack) {
		if (ItemUtils.checkForInvalidItems(itemstack)) {
			Logger.INFO("Tried Inserting "+ItemUtils.getItemName(itemstack)+" into slot "+aSlotIndex);
			Block b = Block.getBlockFromItem(itemstack.getItem());
			Logger.INFO(""+itemstack.getUnlocalizedName());
			if (b != null) {
				Logger.INFO(""+b.getLocalizedName());
				Logger.INFO(""+b.getUnlocalizedName());
			}
		}	
		else {
			Logger.INFO("Bad Itemstack");
		}
		return false;
	}

}