-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add item rarities into all storage overlay pages
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package util.mc | ||
|
||
import net.minecraft.entity.player.PlayerEntity | ||
import net.minecraft.inventory.Inventory | ||
import net.minecraft.item.ItemStack | ||
|
||
class FakeInventory(val stack: ItemStack) : Inventory { | ||
override fun clear() { | ||
} | ||
|
||
override fun size(): Int { | ||
return 1 | ||
} | ||
|
||
override fun isEmpty(): Boolean { | ||
return stack.isEmpty | ||
} | ||
|
||
override fun getStack(slot: Int): ItemStack { | ||
require(slot == 0) | ||
return stack | ||
} | ||
|
||
override fun removeStack(slot: Int, amount: Int): ItemStack { | ||
return ItemStack.EMPTY | ||
} | ||
|
||
override fun removeStack(slot: Int): ItemStack { | ||
return ItemStack.EMPTY | ||
} | ||
|
||
override fun setStack(slot: Int, stack: ItemStack?) { | ||
} | ||
|
||
override fun markDirty() { | ||
} | ||
|
||
override fun canPlayerUse(player: PlayerEntity?): Boolean { | ||
return true | ||
} | ||
} |
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,15 @@ | ||
package moe.nea.firmament.util.mc | ||
|
||
import util.mc.FakeInventory | ||
import net.minecraft.item.ItemStack | ||
import net.minecraft.screen.slot.Slot | ||
|
||
class FakeSlot( | ||
stack: ItemStack, | ||
x: Int, | ||
y: Int | ||
) : Slot(FakeInventory(stack), 0, x, y) { | ||
init { | ||
id = 0 | ||
} | ||
} |