public class MerchantScreenHandler extends ScreenHandler
Modifier and Type | Field and Description |
---|---|
private boolean |
canRefreshTrades |
private boolean |
levelled |
private int |
levelProgress |
private Trader |
trader |
private TraderInventory |
traderInventory |
slots, syncId
Constructor and Description |
---|
MerchantScreenHandler(int syncId,
PlayerInventory playerInventory) |
MerchantScreenHandler(int syncId,
PlayerInventory playerInventory,
Trader trader) |
Modifier and Type | Method and Description |
---|---|
private void |
autofill(int slot,
ItemStack stack) |
boolean |
canInsertIntoSlot(ItemStack stack,
Slot slot) |
boolean |
canRefreshTrades() |
boolean |
canUse(PlayerEntity player) |
void |
close(PlayerEntity player) |
private boolean |
equals(ItemStack itemStack,
ItemStack otherItemStack) |
int |
getExperience() |
int |
getLevelProgress() |
TraderOfferList |
getRecipes() |
int |
getTraderRewardedExperience() |
boolean |
isLevelled() |
void |
onContentChanged(Inventory inventory) |
private void |
playYesSound() |
void |
setCanLevel(boolean canLevel) |
void |
setExperienceFromServer(int experience) |
void |
setLevelProgress(int porgress) |
void |
setOffers(TraderOfferList offers) |
void |
setRecipeIndex(int index) |
void |
setRefreshTrades(boolean refreshable) |
void |
switchTo(int recipeIndex) |
ItemStack |
transferSlot(PlayerEntity player,
int index) |
addListener, addProperties, addProperty, addSlot, calculateComparatorOutput, calculateComparatorOutput, calculateStackSize, canInsertIntoSlot, canInsertItemIntoSlot, canStacksCombine, canUse, checkDataCount, checkSize, dropInventory, endQuickCraft, getNextActionId, getSlot, getStacks, getType, insertItem, isNotRestricted, onButtonClick, onSlotClick, packQuickCraftData, removeListener, sendContentUpdates, setPlayerRestriction, setProperty, setStackInSlot, shouldQuickCraftContinue, unpackQuickCraftButton, unpackQuickCraftStage, updateSlotStacks
private final Trader trader
private final TraderInventory traderInventory
@Environment(value=CLIENT) private int levelProgress
@Environment(value=CLIENT) private boolean levelled
@Environment(value=CLIENT) private boolean canRefreshTrades
public MerchantScreenHandler(int syncId, PlayerInventory playerInventory)
public MerchantScreenHandler(int syncId, PlayerInventory playerInventory, Trader trader)
@Environment(value=CLIENT) public void setCanLevel(boolean canLevel)
public void onContentChanged(Inventory inventory)
onContentChanged
in class ScreenHandler
public void setRecipeIndex(int index)
public boolean canUse(PlayerEntity player)
canUse
in class ScreenHandler
@Environment(value=CLIENT) public int getExperience()
@Environment(value=CLIENT) public int getTraderRewardedExperience()
@Environment(value=CLIENT) public void setExperienceFromServer(int experience)
@Environment(value=CLIENT) public int getLevelProgress()
@Environment(value=CLIENT) public void setLevelProgress(int porgress)
@Environment(value=CLIENT) public void setRefreshTrades(boolean refreshable)
@Environment(value=CLIENT) public boolean canRefreshTrades()
public boolean canInsertIntoSlot(ItemStack stack, Slot slot)
canInsertIntoSlot
in class ScreenHandler
public ItemStack transferSlot(PlayerEntity player, int index)
transferSlot
in class ScreenHandler
private void playYesSound()
public void close(PlayerEntity player)
close
in class ScreenHandler
public void switchTo(int recipeIndex)
private void autofill(int slot, ItemStack stack)
@Environment(value=CLIENT) public void setOffers(TraderOfferList offers)
public TraderOfferList getRecipes()
@Environment(value=CLIENT) public boolean isLevelled()