Skip to content

Commit

Permalink
Slot changes
Browse files Browse the repository at this point in the history
  • Loading branch information
UselessBullets committed Dec 16, 2023
1 parent 5aa3c55 commit 979ed7f
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 60 deletions.
Original file line number Diff line number Diff line change
@@ -1,33 +1,69 @@
package useless.legacyui.Gui.Slots;

import net.minecraft.core.item.ItemStack;
import net.minecraft.core.player.inventory.slot.Slot;
import useless.prismaticlibe.gui.slot.IHighlighting;
import useless.prismaticlibe.gui.slot.IResizable;

public class SlotCraftingDisplayLegacy extends SlotOldGuidebook implements IHighlighting, IResizable {
public class SlotCraftingDisplayLegacy extends Slot implements IHighlighting, IResizable {
public ItemStack item;
private final boolean highlighted;
private final int highlightColor;
private final int slotWidth;
public SlotCraftingDisplayLegacy(int id, int x, int y, ItemStack item, boolean discovered, boolean highlight, int color) {
this(id, x, y, item, discovered, highlight, color, 16);
}
public SlotCraftingDisplayLegacy(int id, int x, int y, ItemStack item, boolean discovered, boolean highlight, int color, int width) {
super(id, x, y, item, discovered);
super(null, id, x, y);
this.item = item;
this.discovered = discovered;
highlighted = highlight;
highlightColor = color;
slotWidth = width;
}
@Override
public ItemStack decrStackSize(int i) {
return null;
}

public boolean canPutStackInSlot(ItemStack itemstack) {
return false;
@Override
public boolean hasStack() {
return this.item != null;
}

@Override
public int getSlotStackLimit() {
return this.item.getMaxStackSize();
}

@Override
public ItemStack getStack() {
return this.item;
}

@Override
public void onPickupFromSlot(ItemStack itemstack) {
}

@Override
public void onSlotChanged() {
}

@Override
public void putStack(ItemStack itemstack) {
}

@Override
public boolean canPutStackInSlot(ItemStack itemstack) {
return false;
}

@Override
public boolean enableDragAndPickup() {
return false;
}

@Override
public boolean allowItemInteraction() {
return false;
}
Expand All @@ -51,4 +87,5 @@ public boolean drawStandardHighlight() {
public int getWidth() {
return slotWidth;
}

}
27 changes: 10 additions & 17 deletions src/main/java/useless/legacyui/Gui/Slots/SlotNull.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,43 @@ public ItemStack decrStackSize(int i) {
return null;
}

public int getBackgroundIconIndex() {
return -1;
}

@Override
public boolean hasStack() {
return false;
}

@Override
public int getSlotStackLimit() {
return 0;
}

@Override
public ItemStack getStack() {
return null;
}

public boolean isHere(IInventory iinventory, int i) {
return iinventory == this.inventory && i == this.slotIndex;
}

@Override
public boolean canPutStackInSlot(ItemStack itemstack) {
return false;
}

@Override
public void onPickupFromSlot(ItemStack itemstack) {
return;
}

@Override
public void onSlotChanged() {
return;
}

@Override
public IInventory getInventory() {
return null;
}

@Override
public void putStack(ItemStack itemstack) {
return;
}

@Override
public boolean enableDragAndPickup() {
return false;
}

@Override
public boolean allowItemInteraction() {
return false;
}
Expand Down
39 changes: 0 additions & 39 deletions src/main/java/useless/legacyui/Gui/Slots/SlotOldGuidebook.java

This file was deleted.

0 comments on commit 979ed7f

Please # to comment.