Fix icon of SpriteSlot
This commit is contained in:
parent
2a78196939
commit
a700d80e0f
1 changed files with 13 additions and 3 deletions
|
@ -1,18 +1,21 @@
|
|||
package techreborn.client.container.builder.slot;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
public class SpriteSlot extends FilteredSlot {
|
||||
|
||||
private final String sprite;
|
||||
int stacksize;
|
||||
|
||||
public SpriteSlot(final IInventory inventory, final int index, final int xPosition, final int yPosition, final String sprite, final int stacksize) {
|
||||
super(inventory, index, xPosition, yPosition);
|
||||
this.setBackgroundLocation(
|
||||
new ResourceLocation(ModInfo.MOD_ID + ":textures/gui/slot_sprites/" + sprite + ".png"));
|
||||
this.sprite = ModInfo.MOD_ID + ":textures/gui/slot_sprites/" + sprite;
|
||||
this.stacksize = stacksize;
|
||||
}
|
||||
|
||||
|
@ -24,4 +27,11 @@ public class SpriteSlot extends FilteredSlot {
|
|||
public int getSlotStackLimit() {
|
||||
return this.stacksize;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getSlotTexture() {
|
||||
return this.sprite;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue