38 lines
1.2 KiB
Kotlin
38 lines
1.2 KiB
Kotlin
package net.shadowfacts.extrahoppers.block.gold
|
|
|
|
import net.minecraft.container.Slot
|
|
import net.minecraft.entity.player.PlayerEntity
|
|
import net.minecraft.entity.player.PlayerInventory
|
|
import net.minecraft.inventory.Inventory
|
|
import net.minecraft.util.Identifier
|
|
import net.minecraft.util.PacketByteBuf
|
|
import net.shadowfacts.extrahoppers.block.base.BaseHopperContainer
|
|
import net.shadowfacts.extrahoppers.init.EHBlocks
|
|
|
|
/**
|
|
* @author shadowfacts
|
|
*/
|
|
class GoldHopperContainer(
|
|
syncId: Int,
|
|
playerInv: PlayerInventory,
|
|
hopperInv: Inventory
|
|
): BaseHopperContainer(syncId, playerInv, hopperInv) {
|
|
|
|
companion object {
|
|
val ID = Identifier("extrahoppers", "gold_hopper")
|
|
|
|
fun create(syncId: Int, identifier: Identifier, player: PlayerEntity, buf: PacketByteBuf): GoldHopperContainer {
|
|
val pos = buf.readBlockPos()
|
|
val blockEntity = EHBlocks.GOLD_HOPPER.getBlockEntity(player.world, pos)!!
|
|
return GoldHopperContainer(syncId, player.inventory, blockEntity)
|
|
}
|
|
}
|
|
|
|
override fun addHopperSlots() {
|
|
for (i in 0 until 5) {
|
|
addSlot(Slot(hopperInv, i, 44 + i * 18, 20))
|
|
}
|
|
}
|
|
|
|
}
|