Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wireless Crafting Terminal #5656

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
save crafting grid
  • Loading branch information
Mari023 committed Nov 16, 2021
commit 1c4316ed9130d86874972bdc1e277346a7598c32
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
package appeng.helpers;

import org.jetbrains.annotations.Nullable;

import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;

import appeng.api.features.IWirelessTerminalHandler;
import appeng.api.inventories.ISegmentedInventory;
import appeng.api.inventories.InternalInventory;
import appeng.parts.reporting.CraftingTerminalPart;
import appeng.util.inv.AppEngInternalInventory;
import appeng.util.inv.InternalInventoryHost;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import org.jetbrains.annotations.Nullable;

public class WirelessCraftingTerminalGuiObject extends WirelessTerminalGuiObject
implements ISegmentedInventory, InternalInventoryHost {// TODO maybe implement InternalInventoryHost elsewhere?
implements ISegmentedInventory, InternalInventoryHost {
private final AppEngInternalInventory craftingGrid = new AppEngInternalInventory(this, 9);
private final Player player;

public WirelessCraftingTerminalGuiObject(IWirelessTerminalHandler wh, ItemStack is, Player ep, int inventorySlot) {
super(wh, is, ep, inventorySlot);
player = ep;
craftingGrid.readFromNBT(getItemStack().getOrCreateTag(), "craftingGrid");
}

@Nullable
Expand All @@ -34,8 +33,8 @@ public InternalInventory getSubInventory(ResourceLocation id) {
}

@Override
public void saveChanges() {// TODO save the content of the crafting grid

public void saveChanges() {
craftingGrid.writeToNBT(getItemStack().getOrCreateTag(), "craftingGrid");
}

@Override
Expand Down