Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
made infinite slot tracked handler not require a mass storage tile
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Nov 26, 2023
1 parent 6f6c55a commit 09a948d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
import io.github.gregtechintergalactical.gtcore.data.SlotTypes;
import io.github.gregtechintergalactical.gtcore.item.ItemTape;
import io.github.gregtechintergalactical.gtcore.machine.MassStorageMachine;
import io.github.gregtechintergalactical.gtcore.machine.MassStoragelItemHandler;
import io.github.gregtechintergalactical.gtcore.machine.MassStorageItemHandler;
import io.github.gregtechintergalactical.gtcore.network.MessageInventorySync;
import io.github.gregtechintergalactical.gtcore.network.MessageTriggerInventorySync;
import muramasa.antimatter.Antimatter;
import muramasa.antimatter.AntimatterAPI;
import muramasa.antimatter.data.AntimatterDefaultTools;
import muramasa.antimatter.gui.SlotType;
import muramasa.antimatter.machine.MachineState;
Expand All @@ -18,7 +16,6 @@
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.InteractionHand;
Expand All @@ -37,16 +34,13 @@

import java.util.List;

import static io.github.gregtechintergalactical.gtcore.data.GTCoreItems.Lighter;
import static io.github.gregtechintergalactical.gtcore.data.GTCoreItems.LighterEmpty;

public class BlockEntityMassStorage extends BlockEntityMaterial<BlockEntityMassStorage> {
boolean output = false;
boolean outputOverflow = false;
boolean syncSlots;
public BlockEntityMassStorage(MassStorageMachine type, BlockPos pos, BlockState state) {
super(type, pos, state);
this.itemHandler.set(() -> new MassStoragelItemHandler(this));
this.itemHandler.set(() -> new MassStorageItemHandler(this));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.github.gregtechintergalactical.gtcore.machine;

import io.github.gregtechintergalactical.gtcore.blockentity.BlockEntityMassStorage;
import muramasa.antimatter.blockentity.BlockEntityMachine;
import muramasa.antimatter.capability.IGuiHandler;
import muramasa.antimatter.capability.item.TrackedItemHandler;
import muramasa.antimatter.gui.SlotType;
Expand All @@ -16,10 +17,10 @@
import javax.annotation.Nonnull;
import java.util.function.BiPredicate;

public class InfiniteSlotTrackedHandler extends TrackedItemHandler<BlockEntityMassStorage> {
public class InfiniteSlotTrackedHandler extends TrackedItemHandler<BlockEntityMachine<?>> {
BlockEntity barrel;

public InfiniteSlotTrackedHandler(BlockEntityMassStorage tile, SlotType<?> type, int size, boolean output, boolean input, BiPredicate<IGuiHandler, ItemStack> validator, int limit) {
public InfiniteSlotTrackedHandler(BlockEntityMachine<?> tile, SlotType<?> type, int size, boolean output, boolean input, BiPredicate<IGuiHandler, ItemStack> validator, int limit) {
super(tile, type, size, output, input, validator, limit);
this.barrel = tile;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

import java.util.Optional;

public class MassStoragelItemHandler extends MachineItemHandler<BlockEntityMassStorage> {
public class MassStorageItemHandler extends MachineItemHandler<BlockEntityMassStorage> {

public MassStoragelItemHandler(BlockEntityMassStorage tile) {
public MassStorageItemHandler(BlockEntityMassStorage tile) {
super(tile);
inventories.put(SlotType.DISPLAY, new FakeTrackedItemHandler<>(tile, SlotType.DISPLAY, 1, SlotType.DISPLAY.output, SlotType.DISPLAY.input, SlotType.DISPLAY.tester));
inventories.put(SlotTypes.UNLIMITED, new InfiniteSlotTrackedHandler(tile, SlotTypes.UNLIMITED, 1, SlotTypes.UNLIMITED.output, SlotTypes.UNLIMITED.input, SlotTypes.UNLIMITED.tester, ((MassStorageMachine)tile.getMachineType()).getCapacity()));
Expand Down

0 comments on commit 09a948d

Please sign in to comment.