public class EnchantmentScreenHandler extends ScreenHandler
Modifier and Type | Field and Description |
---|---|
private ScreenHandlerContext |
context |
int[] |
enchantmentId |
int[] |
enchantmentLevel |
int[] |
enchantmentPower |
private Inventory |
inventory |
private Random |
random |
private Property |
seed |
slots, syncId
Constructor and Description |
---|
EnchantmentScreenHandler(int syncId,
PlayerInventory playerInventory) |
EnchantmentScreenHandler(int syncId,
PlayerInventory playerInventory,
ScreenHandlerContext context) |
Modifier and Type | Method and Description |
---|---|
boolean |
canUse(PlayerEntity player) |
void |
close(PlayerEntity player) |
private List<EnchantmentLevelEntry> |
generateEnchantments(ItemStack stack,
int slot,
int level) |
int |
getLapisCount() |
int |
getSeed() |
boolean |
onButtonClick(PlayerEntity player,
int id) |
void |
onContentChanged(Inventory inventory) |
ItemStack |
transferSlot(PlayerEntity player,
int index) |
addListener, addProperties, addProperty, addSlot, calculateComparatorOutput, calculateComparatorOutput, calculateStackSize, canInsertIntoSlot, canInsertIntoSlot, canInsertItemIntoSlot, canStacksCombine, canUse, checkDataCount, checkSize, dropInventory, endQuickCraft, getNextActionId, getSlot, getStacks, getType, insertItem, isNotRestricted, onSlotClick, packQuickCraftData, removeListener, sendContentUpdates, setPlayerRestriction, setProperty, setStackInSlot, shouldQuickCraftContinue, unpackQuickCraftButton, unpackQuickCraftStage, updateSlotStacks
private final Inventory inventory
private final ScreenHandlerContext context
private final Random random
private final Property seed
public final int[] enchantmentPower
public final int[] enchantmentId
public final int[] enchantmentLevel
public EnchantmentScreenHandler(int syncId, PlayerInventory playerInventory)
public EnchantmentScreenHandler(int syncId, PlayerInventory playerInventory, ScreenHandlerContext context)
public void onContentChanged(Inventory inventory)
onContentChanged
in class ScreenHandler
public boolean onButtonClick(PlayerEntity player, int id)
onButtonClick
in class ScreenHandler
private List<EnchantmentLevelEntry> generateEnchantments(ItemStack stack, int slot, int level)
@Environment(value=CLIENT) public int getLapisCount()
@Environment(value=CLIENT) public int getSeed()
public void close(PlayerEntity player)
close
in class ScreenHandler
public boolean canUse(PlayerEntity player)
canUse
in class ScreenHandler
public ItemStack transferSlot(PlayerEntity player, int index)
transferSlot
in class ScreenHandler