public class MerchantScreenHandler extends ScreenHandler
Modifier and Type | Field and Description |
---|---|
private boolean |
canRefreshTrades |
private boolean |
leveled |
private int |
levelProgress |
private Merchant |
merchant |
private MerchantInventory |
merchantInventory |
slots, syncId
Constructor and Description |
---|
MerchantScreenHandler(int syncId,
PlayerInventory playerInventory) |
MerchantScreenHandler(int syncId,
PlayerInventory playerInventory,
Merchant merchant) |
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() |
int |
getMerchantRewardedExperience() |
TradeOfferList |
getRecipes() |
boolean |
isLeveled() |
void |
onContentChanged(Inventory inventory) |
private void |
playYesSound() |
void |
setCanLevel(boolean canLevel) |
void |
setExperienceFromServer(int experience) |
void |
setLevelProgress(int progress) |
void |
setOffers(TradeOfferList 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 Merchant merchant
private final MerchantInventory merchantInventory
@Environment(value=CLIENT) private int levelProgress
@Environment(value=CLIENT) private boolean leveled
@Environment(value=CLIENT) private boolean canRefreshTrades
public MerchantScreenHandler(int syncId, PlayerInventory playerInventory)
public MerchantScreenHandler(int syncId, PlayerInventory playerInventory, Merchant merchant)
@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 getMerchantRewardedExperience()
@Environment(value=CLIENT) public void setExperienceFromServer(int experience)
@Environment(value=CLIENT) public int getLevelProgress()
@Environment(value=CLIENT) public void setLevelProgress(int progress)
@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(TradeOfferList offers)
public TradeOfferList getRecipes()
@Environment(value=CLIENT) public boolean isLeveled()