This repository has been archived by the owner on Feb 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
74302fc
commit 1091d75
Showing
7 changed files
with
98 additions
and
8 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/com/MO/MatterOverdrive/container/slot/SlotShielding.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.MO.MatterOverdrive.container.slot; | ||
|
||
import com.MO.MatterOverdrive.init.MatterOverdriveItems; | ||
import net.minecraft.inventory.IInventory; | ||
import net.minecraft.inventory.Slot; | ||
import net.minecraft.item.ItemStack; | ||
|
||
/** | ||
* Created by Simeon on 4/6/2015. | ||
*/ | ||
public class SlotShielding extends Slot | ||
{ | ||
public SlotShielding(IInventory inventory, int index, int x, int y) { | ||
|
||
super(inventory, index, x, y); | ||
} | ||
|
||
@Override | ||
public boolean isItemValid(ItemStack stack) | ||
{ | ||
return stack.getItem() == MatterOverdriveItems.tritanium_plate; | ||
} | ||
|
||
@Override | ||
public int getSlotStackLimit() | ||
{ | ||
return 5; | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
src/main/java/com/MO/MatterOverdrive/data/inventory/ShieldingSlot.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.MO.MatterOverdrive.data.inventory; | ||
|
||
import com.MO.MatterOverdrive.Reference; | ||
import com.MO.MatterOverdrive.container.slot.SlotShielding; | ||
import com.MO.MatterOverdrive.init.MatterOverdriveItems; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.ResourceLocation; | ||
|
||
/** | ||
* Created by Simeon on 4/6/2015. | ||
*/ | ||
public class ShieldingSlot extends Slot | ||
{ | ||
protected static final ResourceLocation Icon = new ResourceLocation(Reference.PATH_GUI + "items/shielding.png"); | ||
|
||
@Override | ||
public boolean isValidForSlot(ItemStack itemStack) | ||
{ | ||
if(this.getItem() != null && this.getItem().stackSize < 4) { | ||
|
||
if (itemStack != null && itemStack.getItem() != null) { | ||
return itemStack.getItem() == MatterOverdriveItems.tritanium_plate; | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
@Override | ||
public ResourceLocation getTexture() | ||
{ | ||
return Icon; | ||
} | ||
|
||
@Override | ||
boolean isEqual(net.minecraft.inventory.Slot slot) | ||
{ | ||
return slot instanceof SlotShielding; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters