修复重铸台问题
This commit is contained in:
parent
8d4b272cef
commit
4e1eb576da
2 changed files with 10 additions and 2 deletions
|
@ -445,9 +445,15 @@ public class ReforgingTableMenu extends AbstractContainerMenu {
|
|||
}
|
||||
|
||||
public boolean mayPlace(ItemStack pStack) {
|
||||
var slot = switch (type) {
|
||||
case AMMO -> AMMO_PERK_SLOT;
|
||||
case FUNCTIONAL -> FUNC_PERK_SLOT;
|
||||
case DAMAGE -> DAMAGE_PERK_SLOT;
|
||||
};
|
||||
|
||||
return pStack.getItem() instanceof PerkItem perkItem && perkItem.getPerk().type == type
|
||||
&& !container.getItem(INPUT_SLOT).isEmpty() && container.getItem(INPUT_SLOT).getItem() instanceof GunItem gunItem
|
||||
&& gunItem.canApplyPerk(perkItem.getPerk());
|
||||
&& gunItem.canApplyPerk(perkItem.getPerk()) && container.getItem(slot).isEmpty();
|
||||
}
|
||||
|
||||
public int getMaxStackSize() {
|
||||
|
|
|
@ -40,7 +40,7 @@ public class ReforgingTableScreen extends AbstractContainerScreen<ReforgingTable
|
|||
public void render(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick) {
|
||||
this.renderBackground(pGuiGraphics);
|
||||
super.render(pGuiGraphics, pMouseX, pMouseY, pPartialTick);
|
||||
this.renderTooltip(pGuiGraphics, pMouseX, pMouseY);
|
||||
|
||||
var ammoPerkLevel = ReforgingTableScreen.this.menu.ammoPerkLevel.get();
|
||||
var funcPerkLevel = ReforgingTableScreen.this.menu.funcPerkLevel.get();
|
||||
var damagePerkLevel = ReforgingTableScreen.this.menu.damagePerkLevel.get();
|
||||
|
@ -62,6 +62,8 @@ public class ReforgingTableScreen extends AbstractContainerScreen<ReforgingTable
|
|||
int pointS = upgradePoint % 10;
|
||||
pGuiGraphics.blit(TEXTURE, this.leftPos + 43, this.topPos + 20, 51 + 5 * pointG, 178, 5, 5, 200, 200);
|
||||
pGuiGraphics.blit(TEXTURE, this.leftPos + 47, this.topPos + 20, 51 + 5 * pointS, 178, 5, 5, 200, 200);
|
||||
|
||||
this.renderTooltip(pGuiGraphics, pMouseX, pMouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue