Skip to content

Commit

Permalink
things - need to fix gui ClassCastException
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfieboy09 committed Oct 25, 2024
1 parent 9a4916c commit 4cf1b42
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ neoForge {

server {
server()
programArgument '--nogui'
// programArgument '--nogui'
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,12 @@ public ExtendedEnergyStorage getEnergyStorage() {
return this.energyStorage;
}

@Override
public int getEnergyStored() {
return this.energyStorage.getEnergyStored();
}

@Override
public int getMaxEnergyStored() {
return this.energyStorage.getMaxEnergyStored();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package dev.wolfieboy09.qstorage.block;

import net.minecraft.world.Container;
import net.minecraft.world.inventory.Slot;
import net.minecraft.world.item.ItemStack;
import net.neoforged.neoforge.items.IItemHandler;
import net.neoforged.neoforge.items.SlotItemHandler;

public class ItemResultSlot extends SlotItemHandler {
public ItemResultSlot(IItemHandler itemHandler, int index, int xPosition, int yPosition) {
super(itemHandler, index, xPosition, yPosition);
public class ItemResultSlot extends Slot {
public ItemResultSlot(Container container, int slot, int x, int y) {
super(container, slot, x, y);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import dev.wolfieboy09.qstorage.api.energy.ExtendedEnergyStorage;
import dev.wolfieboy09.qstorage.block.AbstractEnergyContainerMenu;
import dev.wolfieboy09.qstorage.block.ItemResultSlot;
import dev.wolfieboy09.qstorage.registries.QSMenuTypes;
import net.minecraft.core.BlockPos;
import net.minecraft.world.Container;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.*;
Expand Down Expand Up @@ -61,6 +63,17 @@ public DiskAssemblerMenu(int id, BlockPos pos, Inventory playerInventory, Player
addSlot(new SlotItemHandler(playerInvWrapper, slotNumber, xpos, ypos));
}
}

addSlot(new Slot((Container) containerData, 37, 17, 27));
addSlot(new Slot((Container) containerData, 38, 17, 45));
addSlot(new Slot((Container) containerData, 39, 35, 36));

addSlot(new Slot((Container) containerData, 40, 116, 27));
addSlot(new Slot((Container) containerData, 41, 134, 27));
addSlot(new Slot((Container) containerData, 42, 116, 45));
addSlot(new Slot((Container) containerData, 43, 134, 45));

addSlot(new ItemResultSlot((Container) containerData, 44, 80, 36));
}

@Override
Expand Down

0 comments on commit 4cf1b42

Please sign in to comment.