Fixed a flower dupe with the Flower Pouch. Closes #1348

This commit is contained in:
Vasco Lavos committed 2015-09-06 01:21:34 +01:00
1 parent d27cf3f056
commit 0ecc4872ff
2 files changed
+40 -2

No files matched your search

@@ -38,8 +38,12 @@ public class ContainerFlowerBag extends Container {
for(j = 0; j < 9; ++j)
addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
for(i = 0; i < 9; ++i)
addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 142));
for(i = 0; i < 9; ++i) {
if(player.inventory.currentItem == i)
addSlotToContainer(new SlotLocked(playerInv, i, 8 + i * 18, 142));
else addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 142));
}
}
@Override
@@ -0,0 +1,34 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
* File Created @ [Sep 6, 2015, 1:11:25 AM (GMT)]
*/
package vazkii.botania.client.gui.bag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class SlotLocked extends Slot {
public SlotLocked(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) {
super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_);
}
@Override
public boolean canTakeStack(EntityPlayer p_82869_1_) {
return false;
}
@Override
public boolean isItemValid(ItemStack p_75214_1_) {
return false;
}
}