diff --git a/src/main/java/com/simibubi/create/AllContainerTypes.java b/src/main/java/com/simibubi/create/AllMenuTypes.java similarity index 52% rename from src/main/java/com/simibubi/create/AllContainerTypes.java rename to src/main/java/com/simibubi/create/AllMenuTypes.java index a5da0970f..bbd3278f4 100644 --- a/src/main/java/com/simibubi/create/AllContainerTypes.java +++ b/src/main/java/com/simibubi/create/AllMenuTypes.java @@ -1,20 +1,20 @@ package com.simibubi.create; -import com.simibubi.create.content.curiosities.toolbox.ToolboxContainer; +import com.simibubi.create.content.curiosities.toolbox.ToolboxMenu; import com.simibubi.create.content.curiosities.toolbox.ToolboxScreen; -import com.simibubi.create.content.curiosities.tools.BlueprintContainer; +import com.simibubi.create.content.curiosities.tools.BlueprintMenu; import com.simibubi.create.content.curiosities.tools.BlueprintScreen; -import com.simibubi.create.content.logistics.item.LinkedControllerContainer; +import com.simibubi.create.content.logistics.item.LinkedControllerMenu; import com.simibubi.create.content.logistics.item.LinkedControllerScreen; -import com.simibubi.create.content.logistics.item.filter.AttributeFilterContainer; +import com.simibubi.create.content.logistics.item.filter.AttributeFilterMenu; import com.simibubi.create.content.logistics.item.filter.AttributeFilterScreen; -import com.simibubi.create.content.logistics.item.filter.FilterContainer; +import com.simibubi.create.content.logistics.item.filter.FilterMenu; import com.simibubi.create.content.logistics.item.filter.FilterScreen; -import com.simibubi.create.content.logistics.trains.management.schedule.ScheduleContainer; +import com.simibubi.create.content.logistics.trains.management.schedule.ScheduleMenu; import com.simibubi.create.content.logistics.trains.management.schedule.ScheduleScreen; -import com.simibubi.create.content.schematics.block.SchematicTableContainer; +import com.simibubi.create.content.schematics.block.SchematicTableMenu; import com.simibubi.create.content.schematics.block.SchematicTableScreen; -import com.simibubi.create.content.schematics.block.SchematicannonContainer; +import com.simibubi.create.content.schematics.block.SchematicannonMenu; import com.simibubi.create.content.schematics.block.SchematicannonScreen; import com.tterrag.registrate.builders.MenuBuilder.ForgeMenuFactory; import com.tterrag.registrate.builders.MenuBuilder.ScreenFactory; @@ -25,31 +25,31 @@ import net.minecraft.client.gui.screens.Screen; import net.minecraft.client.gui.screens.inventory.MenuAccess; import net.minecraft.world.inventory.AbstractContainerMenu; -public class AllContainerTypes { +public class AllMenuTypes { - public static final MenuEntry SCHEMATIC_TABLE = - register("schematic_table", SchematicTableContainer::new, () -> SchematicTableScreen::new); + public static final MenuEntry SCHEMATIC_TABLE = + register("schematic_table", SchematicTableMenu::new, () -> SchematicTableScreen::new); - public static final MenuEntry SCHEMATICANNON = - register("schematicannon", SchematicannonContainer::new, () -> SchematicannonScreen::new); + public static final MenuEntry SCHEMATICANNON = + register("schematicannon", SchematicannonMenu::new, () -> SchematicannonScreen::new); - public static final MenuEntry FILTER = - register("filter", FilterContainer::new, () -> FilterScreen::new); + public static final MenuEntry FILTER = + register("filter", FilterMenu::new, () -> FilterScreen::new); - public static final MenuEntry ATTRIBUTE_FILTER = - register("attribute_filter", AttributeFilterContainer::new, () -> AttributeFilterScreen::new); + public static final MenuEntry ATTRIBUTE_FILTER = + register("attribute_filter", AttributeFilterMenu::new, () -> AttributeFilterScreen::new); - public static final MenuEntry CRAFTING_BLUEPRINT = - register("crafting_blueprint", BlueprintContainer::new, () -> BlueprintScreen::new); + public static final MenuEntry CRAFTING_BLUEPRINT = + register("crafting_blueprint", BlueprintMenu::new, () -> BlueprintScreen::new); - public static final MenuEntry LINKED_CONTROLLER = - register("linked_controller", LinkedControllerContainer::new, () -> LinkedControllerScreen::new); + public static final MenuEntry LINKED_CONTROLLER = + register("linked_controller", LinkedControllerMenu::new, () -> LinkedControllerScreen::new); - public static final MenuEntry TOOLBOX = - register("toolbox", ToolboxContainer::new, () -> ToolboxScreen::new); + public static final MenuEntry TOOLBOX = + register("toolbox", ToolboxMenu::new, () -> ToolboxScreen::new); - public static final MenuEntry SCHEDULE = - register("schedule", ScheduleContainer::new, () -> ScheduleScreen::new); + public static final MenuEntry SCHEDULE = + register("schedule", ScheduleMenu::new, () -> ScheduleScreen::new); private static > MenuEntry register( String name, ForgeMenuFactory factory, NonNullSupplier> screenFactory) { diff --git a/src/main/java/com/simibubi/create/Create.java b/src/main/java/com/simibubi/create/Create.java index 539bb1a2c..967c32e43 100644 --- a/src/main/java/com/simibubi/create/Create.java +++ b/src/main/java/com/simibubi/create/Create.java @@ -109,7 +109,7 @@ public class Create { AllItems.register(); AllFluids.register(); AllPaletteBlocks.register(); - AllContainerTypes.register(); + AllMenuTypes.register(); AllEntityTypes.register(); AllTileEntities.register(); AllEnchantments.register(); diff --git a/src/main/java/com/simibubi/create/api/connectivity/ConnectivityHandler.java b/src/main/java/com/simibubi/create/api/connectivity/ConnectivityHandler.java index a840bb8d8..cb6ed563c 100644 --- a/src/main/java/com/simibubi/create/api/connectivity/ConnectivityHandler.java +++ b/src/main/java/com/simibubi/create/api/connectivity/ConnectivityHandler.java @@ -360,10 +360,10 @@ public class ConnectivityHandler { } } - if (be instanceof IMultiTileContainer.Inventory iinv && iinv.hasInventory()) + if (be instanceof IMultiTileContainer.Inventory inv && inv.hasInventory()) be.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) .invalidate(); - if (be instanceof IMultiTileContainer.Fluid ifluid && ifluid.hasTank()) + if (be instanceof IMultiTileContainer.Fluid fluid && fluid.hasTank()) be.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) .invalidate(); diff --git a/src/main/java/com/simibubi/create/compat/jei/BlueprintTransferHandler.java b/src/main/java/com/simibubi/create/compat/jei/BlueprintTransferHandler.java index d4a25db7c..10cbea6c3 100644 --- a/src/main/java/com/simibubi/create/compat/jei/BlueprintTransferHandler.java +++ b/src/main/java/com/simibubi/create/compat/jei/BlueprintTransferHandler.java @@ -5,7 +5,7 @@ import javax.annotation.ParametersAreNonnullByDefault; import org.jetbrains.annotations.Nullable; import com.simibubi.create.content.curiosities.tools.BlueprintAssignCompleteRecipePacket; -import com.simibubi.create.content.curiosities.tools.BlueprintContainer; +import com.simibubi.create.content.curiosities.tools.BlueprintMenu; import com.simibubi.create.foundation.networking.AllPackets; import mezz.jei.api.gui.ingredient.IRecipeSlotsView; @@ -17,11 +17,11 @@ import net.minecraft.world.item.crafting.CraftingRecipe; @ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault -public class BlueprintTransferHandler implements IRecipeTransferHandler { +public class BlueprintTransferHandler implements IRecipeTransferHandler { @Override - public Class getContainerClass() { - return BlueprintContainer.class; + public Class getContainerClass() { + return BlueprintMenu.class; } @Override @@ -30,7 +30,7 @@ public class BlueprintTransferHandler implements IRecipeTransferHandler> +public class GhostIngredientHandler> implements IGhostIngredientHandler> { @Override @@ -52,7 +52,7 @@ public class GhostIngredientHandler> return true; } - private static class GhostTarget> implements Target { + private static class GhostTarget> implements Target { private final Rect2i area; private final AbstractSimiContainerScreen gui; diff --git a/src/main/java/com/simibubi/create/compat/jei/SlotMover.java b/src/main/java/com/simibubi/create/compat/jei/SlotMover.java index 0198d562c..711668054 100644 --- a/src/main/java/com/simibubi/create/compat/jei/SlotMover.java +++ b/src/main/java/com/simibubi/create/compat/jei/SlotMover.java @@ -2,7 +2,7 @@ package com.simibubi.create.compat.jei; import java.util.List; -import com.simibubi.create.foundation.gui.container.AbstractSimiContainerScreen; +import com.simibubi.create.foundation.gui.menu.AbstractSimiContainerScreen; import mezz.jei.api.gui.handlers.IGuiContainerHandler; import net.minecraft.client.renderer.Rect2i; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/dispenser/MovedDefaultDispenseItemBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/dispenser/MovedDefaultDispenseItemBehaviour.java index 45b5a89d7..954a7046f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/dispenser/MovedDefaultDispenseItemBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/dispenser/MovedDefaultDispenseItemBehaviour.java @@ -49,13 +49,13 @@ public class MovedDefaultDispenseItemBehaviour implements IMovedDispenseItemBeha facingVec.normalize(); Direction closestToFacing = getClosestFacingDirection(facingVec); - Container iinventory = HopperBlockEntity.getContainerAt(context.world, pos.relative(closestToFacing)); - if (iinventory == null) { + Container inventory = HopperBlockEntity.getContainerAt(context.world, pos.relative(closestToFacing)); + if (inventory == null) { this.playDispenseSound(context.world, pos); this.spawnDispenseParticles(context.world, pos, closestToFacing); return this.dispenseStack(itemStack, context, pos, facingVec); } else { - if (HopperBlockEntity.addItem(null, iinventory, itemStack.copy() + if (HopperBlockEntity.addItem(null, inventory, itemStack.copy() .split(1), closestToFacing.getOpposite()) .isEmpty()) itemStack.shrink(1); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerFakePlayer.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerFakePlayer.java index 15f408253..8adeeade7 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerFakePlayer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerFakePlayer.java @@ -59,7 +59,7 @@ public class DeployerFakePlayer extends FakePlayer { } @Override - public OptionalInt openMenu(MenuProvider container) { + public OptionalInt openMenu(MenuProvider menuProvider) { return OptionalInt.empty(); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerMovementBehaviour.java index e64bfce04..45e4fb15e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerMovementBehaviour.java @@ -141,16 +141,16 @@ public class DeployerMovementBehaviour implements MovementBehaviour { ItemStack contextStack = requiredItems.isEmpty() ? ItemStack.EMPTY : requiredItems.get(0).stack; if (!context.contraption.hasUniversalCreativeCrate) { - IItemHandler iItemHandler = context.contraption.getSharedInventory(); + IItemHandler itemHandler = context.contraption.getSharedInventory(); for (ItemRequirement.StackRequirement required : requiredItems) { ItemStack stack= ItemHelper - .extract(iItemHandler, required::matches, ExtractionCountMode.EXACTLY, + .extract(itemHandler, required::matches, ExtractionCountMode.EXACTLY, required.stack.getCount(), true); if (stack.isEmpty()) return; } for (ItemRequirement.StackRequirement required : requiredItems) - contextStack = ItemHelper.extract(iItemHandler, required::matches, + contextStack = ItemHelper.extract(itemHandler, required::matches, ExtractionCountMode.EXACTLY, required.stack.getCount(), false); } diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxBlock.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxBlock.java index 6257a88df..c93fc90ba 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxBlock.java +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxBlock.java @@ -163,7 +163,7 @@ public class ToolboxBlock extends HorizontalDirectionalBlock implements SimpleWa return InteractionResult.SUCCESS; withTileEntityDo(world, pos, - toolbox -> NetworkHooks.openGui((ServerPlayer) player, toolbox, toolbox::sendToContainer)); + toolbox -> NetworkHooks.openGui((ServerPlayer) player, toolbox, toolbox::sendToMenu)); return InteractionResult.SUCCESS; } diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxContainer.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxMenu.java similarity index 89% rename from src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxContainer.java rename to src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxMenu.java index c7b5ddfe6..392ec21d4 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxContainer.java +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxMenu.java @@ -2,8 +2,8 @@ package com.simibubi.create.content.curiosities.toolbox; import static com.simibubi.create.content.curiosities.toolbox.ToolboxInventory.STACKS_PER_COMPARTMENT; -import com.simibubi.create.AllContainerTypes; -import com.simibubi.create.foundation.gui.container.ContainerBase; +import com.simibubi.create.AllMenuTypes; +import com.simibubi.create.foundation.gui.menu.MenuBase; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; @@ -19,19 +19,19 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraftforge.items.SlotItemHandler; -public class ToolboxContainer extends ContainerBase { +public class ToolboxMenu extends MenuBase { - public ToolboxContainer(MenuType type, int id, Inventory inv, FriendlyByteBuf extraData) { + public ToolboxMenu(MenuType type, int id, Inventory inv, FriendlyByteBuf extraData) { super(type, id, inv, extraData); } - public ToolboxContainer(MenuType type, int id, Inventory inv, ToolboxTileEntity te) { + public ToolboxMenu(MenuType type, int id, Inventory inv, ToolboxTileEntity te) { super(type, id, inv, te); te.startOpen(player); } - public static ToolboxContainer create(int id, Inventory inv, ToolboxTileEntity te) { - return new ToolboxContainer(AllContainerTypes.TOOLBOX.get(), id, inv, te); + public static ToolboxMenu create(int id, Inventory inv, ToolboxTileEntity te) { + return new ToolboxMenu(AllMenuTypes.TOOLBOX.get(), id, inv, te); } @Override diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxScreen.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxScreen.java index 13110e32b..fbd7d4a49 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxScreen.java +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxScreen.java @@ -11,8 +11,8 @@ import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllBlocks; import com.simibubi.create.foundation.gui.AllGuiTextures; import com.simibubi.create.foundation.gui.AllIcons; -import com.simibubi.create.foundation.gui.container.AbstractSimiContainerScreen; import com.simibubi.create.foundation.gui.element.GuiGameElement; +import com.simibubi.create.foundation.gui.menu.AbstractSimiContainerScreen; import com.simibubi.create.foundation.gui.widget.IconButton; import com.simibubi.create.foundation.networking.AllPackets; import com.simibubi.create.foundation.utility.Iterate; @@ -25,7 +25,7 @@ import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.DyeColor; import net.minecraft.world.item.ItemStack; -public class ToolboxScreen extends AbstractSimiContainerScreen { +public class ToolboxScreen extends AbstractSimiContainerScreen { protected static final AllGuiTextures BG = AllGuiTextures.TOOLBOX; protected static final AllGuiTextures PLAYER = AllGuiTextures.PLAYER_INVENTORY; @@ -37,8 +37,8 @@ public class ToolboxScreen extends AbstractSimiContainerScreen private List extraAreas = Collections.emptyList(); - public ToolboxScreen(ToolboxContainer container, Inventory inv, Component title) { - super(container, inv, title); + public ToolboxScreen(ToolboxMenu menu, Inventory inv, Component title) { + super(menu, inv, title); init(); } diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxSlot.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxSlot.java index b14d0573f..e3954eb34 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxSlot.java +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxSlot.java @@ -5,11 +5,11 @@ import net.minecraftforge.items.SlotItemHandler; public class ToolboxSlot extends SlotItemHandler { - private ToolboxContainer toolboxMenu; + private ToolboxMenu toolboxMenu; - public ToolboxSlot(ToolboxContainer container, IItemHandler itemHandler, int index, int xPosition, int yPosition) { + public ToolboxSlot(ToolboxMenu menu, IItemHandler itemHandler, int index, int xPosition, int yPosition) { super(itemHandler, index, xPosition, yPosition); - this.toolboxMenu = container; + this.toolboxMenu = menu; } @Override diff --git a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxTileEntity.java b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxTileEntity.java index 489ad92b4..325004bb6 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxTileEntity.java +++ b/src/main/java/com/simibubi/create/content/curiosities/toolbox/ToolboxTileEntity.java @@ -203,8 +203,8 @@ public class ToolboxTileEntity extends SmartTileEntity implements MenuProvider, } private boolean isOpenInContainer(Player player) { - return player.containerMenu instanceof ToolboxContainer - && ((ToolboxContainer) player.containerMenu).contentHolder == this; + return player.containerMenu instanceof ToolboxMenu + && ((ToolboxMenu) player.containerMenu).contentHolder == this; } public void unequipTracked() { @@ -309,7 +309,7 @@ public class ToolboxTileEntity extends SmartTileEntity implements MenuProvider, @Override public AbstractContainerMenu createMenu(int id, Inventory inv, Player player) { - return ToolboxContainer.create(id, inv, this); + return ToolboxMenu.create(id, inv, this); } @Override @@ -330,8 +330,8 @@ public class ToolboxTileEntity extends SmartTileEntity implements MenuProvider, openCount = 0; for (Player playerentity : level.getEntitiesOfClass(Player.class, new AABB(worldPosition).inflate(8))) - if (playerentity.containerMenu instanceof ToolboxContainer - && ((ToolboxContainer) playerentity.containerMenu).contentHolder == this) + if (playerentity.containerMenu instanceof ToolboxMenu + && ((ToolboxMenu) playerentity.containerMenu).contentHolder == this) openCount++; if (prevOpenCount != openCount) diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintAssignCompleteRecipePacket.java b/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintAssignCompleteRecipePacket.java index ec87a05c6..c98cb1f32 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintAssignCompleteRecipePacket.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintAssignCompleteRecipePacket.java @@ -34,8 +34,8 @@ public class BlueprintAssignCompleteRecipePacket extends SimplePacketBase { .getSender(); if (player == null) return; - if (player.containerMenu instanceof BlueprintContainer) { - BlueprintContainer c = (BlueprintContainer) player.containerMenu; + if (player.containerMenu instanceof BlueprintMenu) { + BlueprintMenu c = (BlueprintMenu) player.containerMenu; player.getLevel() .getRecipeManager() .byKey(recipeID) diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintEntity.java b/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintEntity.java index fafa00deb..72efdeb4e 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintEntity.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintEntity.java @@ -538,7 +538,7 @@ public class BlueprintEntity extends HangingEntity @Override public AbstractContainerMenu createMenu(int id, Inventory inv, Player player) { - return BlueprintContainer.create(id, inv, this); + return BlueprintMenu.create(id, inv, this); } @Override diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintItem.java b/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintItem.java index 0b278081c..b903d891e 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintItem.java @@ -3,7 +3,7 @@ package com.simibubi.create.content.curiosities.tools; import java.util.Collection; import com.simibubi.create.AllItems; -import com.simibubi.create.content.logistics.item.filter.AttributeFilterContainer.WhitelistMode; +import com.simibubi.create.content.logistics.item.filter.AttributeFilterMenu.WhitelistMode; import com.simibubi.create.content.logistics.item.filter.FilterItem; import com.simibubi.create.content.logistics.item.filter.ItemAttribute; diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintContainer.java b/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintMenu.java similarity index 88% rename from src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintContainer.java rename to src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintMenu.java index 78c43e52c..6987c62de 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintContainer.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintMenu.java @@ -2,9 +2,9 @@ package com.simibubi.create.content.curiosities.tools; import java.util.Optional; -import com.simibubi.create.AllContainerTypes; +import com.simibubi.create.AllMenuTypes; import com.simibubi.create.content.curiosities.tools.BlueprintEntity.BlueprintSection; -import com.simibubi.create.foundation.gui.container.GhostItemContainer; +import com.simibubi.create.foundation.gui.menu.GhostItemMenu; import net.minecraft.client.Minecraft; import net.minecraft.network.FriendlyByteBuf; @@ -25,18 +25,18 @@ import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemStackHandler; import net.minecraftforge.items.SlotItemHandler; -public class BlueprintContainer extends GhostItemContainer { +public class BlueprintMenu extends GhostItemMenu { - public BlueprintContainer(MenuType type, int id, Inventory inv, FriendlyByteBuf extraData) { + public BlueprintMenu(MenuType type, int id, Inventory inv, FriendlyByteBuf extraData) { super(type, id, inv, extraData); } - public BlueprintContainer(MenuType type, int id, Inventory inv, BlueprintSection section) { + public BlueprintMenu(MenuType type, int id, Inventory inv, BlueprintSection section) { super(type, id, inv, section); } - public static BlueprintContainer create(int id, Inventory inv, BlueprintSection section) { - return new BlueprintContainer(AllContainerTypes.CRAFTING_BLUEPRINT.get(), id, inv, section); + public static BlueprintMenu create(int id, Inventory inv, BlueprintSection section) { + return new BlueprintMenu(AllMenuTypes.CRAFTING_BLUEPRINT.get(), id, inv, section); } @Override @@ -141,8 +141,8 @@ public class BlueprintContainer extends GhostItemContainer { static class BlueprintCraftingInventory extends CraftingContainer { - public BlueprintCraftingInventory(AbstractContainerMenu container, ItemStackHandler items) { - super(container, 3, 3); + public BlueprintCraftingInventory(AbstractContainerMenu menu, ItemStackHandler items) { + super(menu, 3, 3); for (int y = 0; y < 3; y++) { for (int x = 0; x < 3; x++) { ItemStack stack = items.getStackInSlot(y * 3 + x); diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintOverlayRenderer.java b/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintOverlayRenderer.java index 6889a801e..8916e118c 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintOverlayRenderer.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintOverlayRenderer.java @@ -13,7 +13,7 @@ import com.simibubi.create.AllBlocks; import com.simibubi.create.AllItems; import com.simibubi.create.content.curiosities.tools.BlueprintEntity.BlueprintCraftingInventory; import com.simibubi.create.content.curiosities.tools.BlueprintEntity.BlueprintSection; -import com.simibubi.create.content.logistics.item.filter.AttributeFilterContainer.WhitelistMode; +import com.simibubi.create.content.logistics.item.filter.AttributeFilterMenu.WhitelistMode; import com.simibubi.create.content.logistics.item.filter.FilterItem; import com.simibubi.create.content.logistics.item.filter.ItemAttribute; import com.simibubi.create.content.logistics.trains.track.TrackPlacement.PlacementInfo; diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintScreen.java b/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintScreen.java index 3999c10dc..c11580cfa 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintScreen.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintScreen.java @@ -13,8 +13,8 @@ import com.simibubi.create.content.logistics.item.filter.FilterScreenPacket; import com.simibubi.create.content.logistics.item.filter.FilterScreenPacket.Option; import com.simibubi.create.foundation.gui.AllGuiTextures; import com.simibubi.create.foundation.gui.AllIcons; -import com.simibubi.create.foundation.gui.container.AbstractSimiContainerScreen; import com.simibubi.create.foundation.gui.element.GuiGameElement; +import com.simibubi.create.foundation.gui.menu.AbstractSimiContainerScreen; import com.simibubi.create.foundation.gui.widget.IconButton; import com.simibubi.create.foundation.networking.AllPackets; import com.simibubi.create.foundation.utility.Lang; @@ -25,7 +25,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.item.ItemStack; -public class BlueprintScreen extends AbstractSimiContainerScreen { +public class BlueprintScreen extends AbstractSimiContainerScreen { protected AllGuiTextures background; private List extraAreas = Collections.emptyList(); @@ -33,8 +33,8 @@ public class BlueprintScreen extends AbstractSimiContainerScreen { +public class LinkedControllerMenu extends GhostItemMenu { - public LinkedControllerContainer(MenuType type, int id, Inventory inv, FriendlyByteBuf extraData) { + public LinkedControllerMenu(MenuType type, int id, Inventory inv, FriendlyByteBuf extraData) { super(type, id, inv, extraData); } - public LinkedControllerContainer(MenuType type, int id, Inventory inv, ItemStack filterItem) { + public LinkedControllerMenu(MenuType type, int id, Inventory inv, ItemStack filterItem) { super(type, id, inv, filterItem); } - public static LinkedControllerContainer create(int id, Inventory inv, ItemStack filterItem) { - return new LinkedControllerContainer(AllContainerTypes.LINKED_CONTROLLER.get(), id, inv, filterItem); + public static LinkedControllerMenu create(int id, Inventory inv, ItemStack filterItem) { + return new LinkedControllerMenu(AllMenuTypes.LINKED_CONTROLLER.get(), id, inv, filterItem); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/item/LinkedControllerScreen.java b/src/main/java/com/simibubi/create/content/logistics/item/LinkedControllerScreen.java index 5436e38af..8b6f721e8 100644 --- a/src/main/java/com/simibubi/create/content/logistics/item/LinkedControllerScreen.java +++ b/src/main/java/com/simibubi/create/content/logistics/item/LinkedControllerScreen.java @@ -10,8 +10,8 @@ import com.google.common.collect.ImmutableList; import com.mojang.blaze3d.vertex.PoseStack; import com.simibubi.create.foundation.gui.AllGuiTextures; import com.simibubi.create.foundation.gui.AllIcons; -import com.simibubi.create.foundation.gui.container.AbstractSimiContainerScreen; import com.simibubi.create.foundation.gui.element.GuiGameElement; +import com.simibubi.create.foundation.gui.menu.AbstractSimiContainerScreen; import com.simibubi.create.foundation.gui.widget.IconButton; import com.simibubi.create.foundation.utility.ControlsUtil; import com.simibubi.create.foundation.utility.Lang; @@ -22,7 +22,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.item.ItemStack; -public class LinkedControllerScreen extends AbstractSimiContainerScreen { +public class LinkedControllerScreen extends AbstractSimiContainerScreen { protected AllGuiTextures background; private List extraAreas = Collections.emptyList(); @@ -30,8 +30,8 @@ public class LinkedControllerScreen extends AbstractSimiContainerScreen { +public abstract class AbstractFilterMenu extends GhostItemMenu { - protected AbstractFilterContainer(MenuType type, int id, Inventory inv, FriendlyByteBuf extraData) { + protected AbstractFilterMenu(MenuType type, int id, Inventory inv, FriendlyByteBuf extraData) { super(type, id, inv, extraData); } - protected AbstractFilterContainer(MenuType type, int id, Inventory inv, ItemStack contentHolder) { + protected AbstractFilterMenu(MenuType type, int id, Inventory inv, ItemStack contentHolder) { super(type, id, inv, contentHolder); } diff --git a/src/main/java/com/simibubi/create/content/logistics/item/filter/AbstractFilterScreen.java b/src/main/java/com/simibubi/create/content/logistics/item/filter/AbstractFilterScreen.java index bd38b38b9..cf1333ce6 100644 --- a/src/main/java/com/simibubi/create/content/logistics/item/filter/AbstractFilterScreen.java +++ b/src/main/java/com/simibubi/create/content/logistics/item/filter/AbstractFilterScreen.java @@ -11,8 +11,8 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.simibubi.create.content.logistics.item.filter.FilterScreenPacket.Option; import com.simibubi.create.foundation.gui.AllGuiTextures; import com.simibubi.create.foundation.gui.AllIcons; -import com.simibubi.create.foundation.gui.container.AbstractSimiContainerScreen; import com.simibubi.create.foundation.gui.element.GuiGameElement; +import com.simibubi.create.foundation.gui.menu.AbstractSimiContainerScreen; import com.simibubi.create.foundation.gui.widget.IconButton; import com.simibubi.create.foundation.gui.widget.Indicator; import com.simibubi.create.foundation.gui.widget.Indicator.State; @@ -25,7 +25,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.world.entity.player.Inventory; -public abstract class AbstractFilterScreen extends AbstractSimiContainerScreen { +public abstract class AbstractFilterScreen extends AbstractSimiContainerScreen { protected AllGuiTextures background; private List extraAreas = Collections.emptyList(); @@ -33,8 +33,8 @@ public abstract class AbstractFilterScreen ex private IconButton resetButton; private IconButton confirmButton; - protected AbstractFilterScreen(F container, Inventory inv, Component title, AllGuiTextures background) { - super(container, inv, title); + protected AbstractFilterScreen(F menu, Inventory inv, Component title, AllGuiTextures background) { + super(menu, inv, title); this.background = background; } diff --git a/src/main/java/com/simibubi/create/content/logistics/item/filter/AttributeFilterContainer.java b/src/main/java/com/simibubi/create/content/logistics/item/filter/AttributeFilterMenu.java similarity index 89% rename from src/main/java/com/simibubi/create/content/logistics/item/filter/AttributeFilterContainer.java rename to src/main/java/com/simibubi/create/content/logistics/item/filter/AttributeFilterMenu.java index eed646d68..d9804c947 100644 --- a/src/main/java/com/simibubi/create/content/logistics/item/filter/AttributeFilterContainer.java +++ b/src/main/java/com/simibubi/create/content/logistics/item/filter/AttributeFilterMenu.java @@ -3,7 +3,7 @@ package com.simibubi.create.content.logistics.item.filter; import java.util.ArrayList; import java.util.List; -import com.simibubi.create.AllContainerTypes; +import com.simibubi.create.AllMenuTypes; import com.simibubi.create.foundation.utility.Components; import com.simibubi.create.foundation.utility.Pair; @@ -22,7 +22,7 @@ import net.minecraft.world.item.Items; import net.minecraftforge.items.ItemStackHandler; import net.minecraftforge.items.SlotItemHandler; -public class AttributeFilterContainer extends AbstractFilterContainer { +public class AttributeFilterMenu extends AbstractFilterMenu { public enum WhitelistMode { WHITELIST_DISJ, WHITELIST_CONJ, BLACKLIST; @@ -31,16 +31,16 @@ public class AttributeFilterContainer extends AbstractFilterContainer { WhitelistMode whitelistMode; List> selectedAttributes; - public AttributeFilterContainer(MenuType type, int id, Inventory inv, FriendlyByteBuf extraData) { + public AttributeFilterMenu(MenuType type, int id, Inventory inv, FriendlyByteBuf extraData) { super(type, id, inv, extraData); } - public AttributeFilterContainer(MenuType type, int id, Inventory inv, ItemStack stack) { + public AttributeFilterMenu(MenuType type, int id, Inventory inv, ItemStack stack) { super(type, id, inv, stack); } - public static AttributeFilterContainer create(int id, Inventory inv, ItemStack stack) { - return new AttributeFilterContainer(AllContainerTypes.ATTRIBUTE_FILTER.get(), id, inv, stack); + public static AttributeFilterMenu create(int id, Inventory inv, ItemStack stack) { + return new AttributeFilterMenu(AllMenuTypes.ATTRIBUTE_FILTER.get(), id, inv, stack); } public void appendSelectedAttribute(ItemAttribute itemAttribute, boolean inverted) { diff --git a/src/main/java/com/simibubi/create/content/logistics/item/filter/AttributeFilterScreen.java b/src/main/java/com/simibubi/create/content/logistics/item/filter/AttributeFilterScreen.java index 924b38941..ee90cb1c8 100644 --- a/src/main/java/com/simibubi/create/content/logistics/item/filter/AttributeFilterScreen.java +++ b/src/main/java/com/simibubi/create/content/logistics/item/filter/AttributeFilterScreen.java @@ -6,7 +6,7 @@ import java.util.List; import java.util.stream.Collectors; import com.mojang.blaze3d.vertex.PoseStack; -import com.simibubi.create.content.logistics.item.filter.AttributeFilterContainer.WhitelistMode; +import com.simibubi.create.content.logistics.item.filter.AttributeFilterMenu.WhitelistMode; import com.simibubi.create.content.logistics.item.filter.FilterScreenPacket.Option; import com.simibubi.create.foundation.gui.AllGuiTextures; import com.simibubi.create.foundation.gui.AllIcons; @@ -26,7 +26,7 @@ import net.minecraft.network.chat.MutableComponent; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.item.ItemStack; -public class AttributeFilterScreen extends AbstractFilterScreen { +public class AttributeFilterScreen extends AbstractFilterScreen { private static final String PREFIX = "gui.attribute_filter."; @@ -55,8 +55,8 @@ public class AttributeFilterScreen extends AbstractFilterScreen type, int id, Inventory inv, FriendlyByteBuf extraData) { + public FilterMenu(MenuType type, int id, Inventory inv, FriendlyByteBuf extraData) { super(type, id, inv, extraData); } - public FilterContainer(MenuType type, int id, Inventory inv, ItemStack stack) { + public FilterMenu(MenuType type, int id, Inventory inv, ItemStack stack) { super(type, id, inv, stack); } - public static FilterContainer create(int id, Inventory inv, ItemStack stack) { - return new FilterContainer(AllContainerTypes.FILTER.get(), id, inv, stack); + public static FilterMenu create(int id, Inventory inv, ItemStack stack) { + return new FilterMenu(AllMenuTypes.FILTER.get(), id, inv, stack); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/item/filter/FilterScreen.java b/src/main/java/com/simibubi/create/content/logistics/item/filter/FilterScreen.java index bdb5b0b0e..db2c99210 100644 --- a/src/main/java/com/simibubi/create/content/logistics/item/filter/FilterScreen.java +++ b/src/main/java/com/simibubi/create/content/logistics/item/filter/FilterScreen.java @@ -15,7 +15,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.world.entity.player.Inventory; -public class FilterScreen extends AbstractFilterScreen { +public class FilterScreen extends AbstractFilterScreen { private static final String PREFIX = "gui.filter."; @@ -34,8 +34,8 @@ public class FilterScreen extends AbstractFilterScreen { private Indicator whitelistIndicator, blacklistIndicator; private Indicator respectNBTIndicator, ignoreNBTIndicator; - public FilterScreen(FilterContainer container, Inventory inv, Component title) { - super(container, inv, title, AllGuiTextures.FILTER); + public FilterScreen(FilterMenu menu, Inventory inv, Component title) { + super(menu, inv, title, AllGuiTextures.FILTER); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/item/filter/FilterScreenPacket.java b/src/main/java/com/simibubi/create/content/logistics/item/filter/FilterScreenPacket.java index 8b1b5440c..a453fd667 100644 --- a/src/main/java/com/simibubi/create/content/logistics/item/filter/FilterScreenPacket.java +++ b/src/main/java/com/simibubi/create/content/logistics/item/filter/FilterScreenPacket.java @@ -2,7 +2,7 @@ package com.simibubi.create.content.logistics.item.filter; import java.util.function.Supplier; -import com.simibubi.create.content.logistics.item.filter.AttributeFilterContainer.WhitelistMode; +import com.simibubi.create.content.logistics.item.filter.AttributeFilterMenu.WhitelistMode; import com.simibubi.create.foundation.networking.SimplePacketBase; import net.minecraft.nbt.CompoundTag; @@ -46,8 +46,8 @@ public class FilterScreenPacket extends SimplePacketBase { if (player == null) return; - if (player.containerMenu instanceof FilterContainer) { - FilterContainer c = (FilterContainer) player.containerMenu; + if (player.containerMenu instanceof FilterMenu) { + FilterMenu c = (FilterMenu) player.containerMenu; if (option == Option.WHITELIST) c.blacklist = false; if (option == Option.BLACKLIST) @@ -62,8 +62,8 @@ public class FilterScreenPacket extends SimplePacketBase { net.minecraft.world.item.ItemStack.of(data.getCompound("Item"))); } - if (player.containerMenu instanceof AttributeFilterContainer) { - AttributeFilterContainer c = (AttributeFilterContainer) player.containerMenu; + if (player.containerMenu instanceof AttributeFilterMenu) { + AttributeFilterMenu c = (AttributeFilterMenu) player.containerMenu; if (option == Option.WHITELIST) c.whitelistMode = WhitelistMode.WHITELIST_DISJ; if (option == Option.WHITELIST2) diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/management/schedule/ScheduleItem.java b/src/main/java/com/simibubi/create/content/logistics/trains/management/schedule/ScheduleItem.java index c103d2768..b5499457f 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/management/schedule/ScheduleItem.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/management/schedule/ScheduleItem.java @@ -2,7 +2,7 @@ package com.simibubi.create.content.logistics.trains.management.schedule; import java.util.List; -import com.simibubi.create.AllContainerTypes; +import com.simibubi.create.AllMenuTypes; import com.simibubi.create.AllSoundEvents; import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; import com.simibubi.create.content.logistics.trains.entity.CarriageContraption; @@ -161,7 +161,7 @@ public class ScheduleItem extends Item implements MenuProvider { @Override public AbstractContainerMenu createMenu(int id, Inventory inv, Player player) { ItemStack heldItem = player.getMainHandItem(); - return new ScheduleContainer(AllContainerTypes.SCHEDULE.get(), id, inv, heldItem); + return new ScheduleMenu(AllMenuTypes.SCHEDULE.get(), id, inv, heldItem); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/management/schedule/ScheduleContainer.java b/src/main/java/com/simibubi/create/content/logistics/trains/management/schedule/ScheduleMenu.java similarity index 88% rename from src/main/java/com/simibubi/create/content/logistics/trains/management/schedule/ScheduleContainer.java rename to src/main/java/com/simibubi/create/content/logistics/trains/management/schedule/ScheduleMenu.java index 15f456bbb..a55ca4a1b 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/management/schedule/ScheduleContainer.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/management/schedule/ScheduleMenu.java @@ -1,6 +1,6 @@ package com.simibubi.create.content.logistics.trains.management.schedule; -import com.simibubi.create.foundation.gui.container.GhostItemContainer; +import com.simibubi.create.foundation.gui.menu.GhostItemMenu; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.Container; @@ -14,18 +14,18 @@ import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.ItemStackHandler; import net.minecraftforge.items.SlotItemHandler; -public class ScheduleContainer extends GhostItemContainer { +public class ScheduleMenu extends GhostItemMenu { public boolean slotsActive = true; public int targetSlotsActive = 1; static final int slots = 2; - public ScheduleContainer(MenuType type, int id, Inventory inv, FriendlyByteBuf extraData) { + public ScheduleMenu(MenuType type, int id, Inventory inv, FriendlyByteBuf extraData) { super(type, id, inv, extraData); } - public ScheduleContainer(MenuType type, int id, Inventory inv, ItemStack contentHolder) { + public ScheduleMenu(MenuType type, int id, Inventory inv, ItemStack contentHolder) { super(type, id, inv, contentHolder); } diff --git a/src/main/java/com/simibubi/create/content/logistics/trains/management/schedule/ScheduleScreen.java b/src/main/java/com/simibubi/create/content/logistics/trains/management/schedule/ScheduleScreen.java index 8f9589793..cc1503142 100644 --- a/src/main/java/com/simibubi/create/content/logistics/trains/management/schedule/ScheduleScreen.java +++ b/src/main/java/com/simibubi/create/content/logistics/trains/management/schedule/ScheduleScreen.java @@ -32,9 +32,9 @@ import com.simibubi.create.foundation.gui.AllIcons; import com.simibubi.create.foundation.gui.ModularGuiLine; import com.simibubi.create.foundation.gui.ModularGuiLineBuilder; import com.simibubi.create.foundation.gui.UIRenderHelper; -import com.simibubi.create.foundation.gui.container.AbstractSimiContainerScreen; -import com.simibubi.create.foundation.gui.container.GhostItemSubmitPacket; import com.simibubi.create.foundation.gui.element.GuiGameElement; +import com.simibubi.create.foundation.gui.menu.AbstractSimiContainerScreen; +import com.simibubi.create.foundation.gui.menu.GhostItemSubmitPacket; import com.simibubi.create.foundation.gui.widget.IconButton; import com.simibubi.create.foundation.gui.widget.Indicator; import com.simibubi.create.foundation.gui.widget.Indicator.State; @@ -64,7 +64,7 @@ import net.minecraft.world.item.Items; import net.minecraft.world.phys.Vec3; import net.minecraftforge.client.gui.GuiUtils; -public class ScheduleScreen extends AbstractSimiContainerScreen { +public class ScheduleScreen extends AbstractSimiContainerScreen { private static final int CARD_HEADER = 22; private static final int CARD_WIDTH = 195; @@ -94,14 +94,14 @@ public class ScheduleScreen extends AbstractSimiContainerScreen NetworkHooks.openGui((ServerPlayer) player, te, te::sendToContainer)); + te -> NetworkHooks.openGui((ServerPlayer) player, te, te::sendToMenu)); return InteractionResult.SUCCESS; } diff --git a/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableContainer.java b/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableMenu.java similarity index 81% rename from src/main/java/com/simibubi/create/content/schematics/block/SchematicTableContainer.java rename to src/main/java/com/simibubi/create/content/schematics/block/SchematicTableMenu.java index 36d9eb85b..a0aeac869 100644 --- a/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableContainer.java +++ b/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableMenu.java @@ -1,8 +1,8 @@ package com.simibubi.create.content.schematics.block; -import com.simibubi.create.AllContainerTypes; import com.simibubi.create.AllItems; -import com.simibubi.create.foundation.gui.container.ContainerBase; +import com.simibubi.create.AllMenuTypes; +import com.simibubi.create.foundation.gui.menu.MenuBase; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; @@ -15,21 +15,21 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraftforge.items.SlotItemHandler; -public class SchematicTableContainer extends ContainerBase { +public class SchematicTableMenu extends MenuBase { private Slot inputSlot; private Slot outputSlot; - public SchematicTableContainer(MenuType type, int id, Inventory inv, FriendlyByteBuf extraData) { + public SchematicTableMenu(MenuType type, int id, Inventory inv, FriendlyByteBuf extraData) { super(type, id, inv, extraData); } - public SchematicTableContainer(MenuType type, int id, Inventory inv, SchematicTableTileEntity te) { + public SchematicTableMenu(MenuType type, int id, Inventory inv, SchematicTableTileEntity te) { super(type, id, inv, te); } - public static SchematicTableContainer create(int id, Inventory inv, SchematicTableTileEntity te) { - return new SchematicTableContainer(AllContainerTypes.SCHEMATIC_TABLE.get(), id, inv, te); + public static SchematicTableMenu create(int id, Inventory inv, SchematicTableTileEntity te) { + return new SchematicTableMenu(AllMenuTypes.SCHEMATIC_TABLE.get(), id, inv, te); } public boolean canWrite() { diff --git a/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableScreen.java b/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableScreen.java index 055370ab1..844378f59 100644 --- a/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableScreen.java +++ b/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableScreen.java @@ -14,8 +14,8 @@ import com.simibubi.create.CreateClient; import com.simibubi.create.content.schematics.ClientSchematicLoader; import com.simibubi.create.foundation.gui.AllGuiTextures; import com.simibubi.create.foundation.gui.AllIcons; -import com.simibubi.create.foundation.gui.container.AbstractSimiContainerScreen; import com.simibubi.create.foundation.gui.element.GuiGameElement; +import com.simibubi.create.foundation.gui.menu.AbstractSimiContainerScreen; import com.simibubi.create.foundation.gui.widget.IconButton; import com.simibubi.create.foundation.gui.widget.Label; import com.simibubi.create.foundation.gui.widget.ScrollInput; @@ -30,7 +30,7 @@ import net.minecraft.util.Mth; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.item.ItemStack; -public class SchematicTableScreen extends AbstractSimiContainerScreen { +public class SchematicTableScreen extends AbstractSimiContainerScreen { private final Component uploading = Lang.translateDirect("gui.schematicTable.uploading"); private final Component finished = Lang.translateDirect("gui.schematicTable.finished"); @@ -55,9 +55,9 @@ public class SchematicTableScreen extends AbstractSimiContainerScreen extraAreas = Collections.emptyList(); - public SchematicTableScreen(SchematicTableContainer container, Inventory playerInventory, + public SchematicTableScreen(SchematicTableMenu menu, Inventory playerInventory, Component title) { - super(container, playerInventory, title); + super(menu, playerInventory, title); background = AllGuiTextures.SCHEMATIC_TABLE; } diff --git a/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableTileEntity.java b/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableTileEntity.java index bcfe54721..b690b64c8 100644 --- a/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableTileEntity.java +++ b/src/main/java/com/simibubi/create/content/schematics/block/SchematicTableTileEntity.java @@ -47,7 +47,7 @@ public class SchematicTableTileEntity extends SmartTileEntity implements MenuPro uploadingProgress = 0; } - public void sendToContainer(FriendlyByteBuf buffer) { + public void sendToMenu(FriendlyByteBuf buffer) { buffer.writeBlockPos(getBlockPos()); buffer.writeNbt(getUpdateTag()); } @@ -108,7 +108,7 @@ public class SchematicTableTileEntity extends SmartTileEntity implements MenuPro @Override public AbstractContainerMenu createMenu(int id, Inventory inv, Player player) { - return SchematicTableContainer.create(id, inv, this); + return SchematicTableMenu.create(id, inv, this); } @Override diff --git a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonBlock.java b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonBlock.java index d85de1001..0594512b9 100644 --- a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonBlock.java +++ b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonBlock.java @@ -51,7 +51,7 @@ public class SchematicannonBlock extends Block implements ITE NetworkHooks.openGui((ServerPlayer) player, te, te::sendToContainer)); + te -> NetworkHooks.openGui((ServerPlayer) player, te, te::sendToMenu)); return InteractionResult.SUCCESS; } diff --git a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonContainer.java b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonMenu.java similarity index 78% rename from src/main/java/com/simibubi/create/content/schematics/block/SchematicannonContainer.java rename to src/main/java/com/simibubi/create/content/schematics/block/SchematicannonMenu.java index 6d83bb020..e966e6169 100644 --- a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonContainer.java +++ b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonMenu.java @@ -1,7 +1,7 @@ package com.simibubi.create.content.schematics.block; -import com.simibubi.create.AllContainerTypes; -import com.simibubi.create.foundation.gui.container.ContainerBase; +import com.simibubi.create.AllMenuTypes; +import com.simibubi.create.foundation.gui.menu.MenuBase; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.ClientLevel; @@ -14,18 +14,18 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraftforge.items.SlotItemHandler; -public class SchematicannonContainer extends ContainerBase { +public class SchematicannonMenu extends MenuBase { - public SchematicannonContainer(MenuType type, int id, Inventory inv, FriendlyByteBuf buffer) { + public SchematicannonMenu(MenuType type, int id, Inventory inv, FriendlyByteBuf buffer) { super(type, id, inv, buffer); } - public SchematicannonContainer(MenuType type, int id, Inventory inv, SchematicannonTileEntity te) { + public SchematicannonMenu(MenuType type, int id, Inventory inv, SchematicannonTileEntity te) { super(type, id, inv, te); } - public static SchematicannonContainer create(int id, Inventory inv, SchematicannonTileEntity te) { - return new SchematicannonContainer(AllContainerTypes.SCHEMATICANNON.get(), id, inv, te); + public static SchematicannonMenu create(int id, Inventory inv, SchematicannonTileEntity te) { + return new SchematicannonMenu(AllMenuTypes.SCHEMATICANNON.get(), id, inv, te); } @Override diff --git a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonScreen.java b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonScreen.java index f525d405f..df2cadf9e 100644 --- a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonScreen.java +++ b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonScreen.java @@ -16,8 +16,8 @@ import com.simibubi.create.content.schematics.packet.ConfigureSchematicannonPack import com.simibubi.create.content.schematics.packet.ConfigureSchematicannonPacket.Option; import com.simibubi.create.foundation.gui.AllGuiTextures; import com.simibubi.create.foundation.gui.AllIcons; -import com.simibubi.create.foundation.gui.container.AbstractSimiContainerScreen; import com.simibubi.create.foundation.gui.element.GuiGameElement; +import com.simibubi.create.foundation.gui.menu.AbstractSimiContainerScreen; import com.simibubi.create.foundation.gui.widget.IconButton; import com.simibubi.create.foundation.gui.widget.Indicator; import com.simibubi.create.foundation.gui.widget.Indicator.State; @@ -33,7 +33,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.item.ItemStack; -public class SchematicannonScreen extends AbstractSimiContainerScreen { +public class SchematicannonScreen extends AbstractSimiContainerScreen { private static final AllGuiTextures BG_BOTTOM = AllGuiTextures.SCHEMATICANNON_BOTTOM; private static final AllGuiTextures BG_TOP = AllGuiTextures.SCHEMATICANNON_TOP; @@ -76,8 +76,8 @@ public class SchematicannonScreen extends AbstractSimiContainerScreen extraAreas = Collections.emptyList(); - public SchematicannonScreen(SchematicannonContainer container, Inventory inventory, Component title) { - super(container, inventory, title); + public SchematicannonScreen(SchematicannonMenu menu, Inventory inventory, Component title) { + super(menu, inventory, title); placementSettingWidgets = new ArrayList<>(); } diff --git a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonTileEntity.java b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonTileEntity.java index 3ff5d6b33..ff5c08a67 100644 --- a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonTileEntity.java +++ b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonTileEntity.java @@ -488,23 +488,23 @@ public class SchematicannonTileEntity extends SmartTileEntity implements MenuPro // Find and apply damage if (usage == ItemUseType.DAMAGE) { for (LazyOptional cap : attachedInventories) { - IItemHandler iItemHandler = cap.orElse(EmptyHandler.INSTANCE); - for (int slot = 0; slot < iItemHandler.getSlots(); slot++) { - ItemStack extractItem = iItemHandler.extractItem(slot, 1, true); + IItemHandler itemHandler = cap.orElse(EmptyHandler.INSTANCE); + for (int slot = 0; slot < itemHandler.getSlots(); slot++) { + ItemStack extractItem = itemHandler.extractItem(slot, 1, true); if (!required.matches(extractItem)) continue; if (!extractItem.isDamageableItem()) continue; if (!simulate) { - ItemStack stack = iItemHandler.extractItem(slot, 1, false); + ItemStack stack = itemHandler.extractItem(slot, 1, false); stack.setDamageValue(stack.getDamageValue() + 1); if (stack.getDamageValue() <= stack.getMaxDamage()) { - if (iItemHandler.getStackInSlot(slot) + if (itemHandler.getStackInSlot(slot) .isEmpty()) - iItemHandler.insertItem(slot, stack, false); + itemHandler.insertItem(slot, stack, false); else - ItemHandlerHelper.insertItem(iItemHandler, stack, false); + ItemHandlerHelper.insertItem(itemHandler, stack, false); } } @@ -519,9 +519,9 @@ public class SchematicannonTileEntity extends SmartTileEntity implements MenuPro boolean success = false; int amountFound = 0; for (LazyOptional cap : attachedInventories) { - IItemHandler iItemHandler = cap.orElse(EmptyHandler.INSTANCE); + IItemHandler itemHandler = cap.orElse(EmptyHandler.INSTANCE); amountFound += ItemHelper - .extract(iItemHandler, required::matches, ExtractionCountMode.UPTO, + .extract(itemHandler, required::matches, ExtractionCountMode.UPTO, required.stack.getCount(), true) .getCount(); @@ -535,9 +535,9 @@ public class SchematicannonTileEntity extends SmartTileEntity implements MenuPro if (!simulate && success) { amountFound = 0; for (LazyOptional cap : attachedInventories) { - IItemHandler iItemHandler = cap.orElse(EmptyHandler.INSTANCE); + IItemHandler itemHandler = cap.orElse(EmptyHandler.INSTANCE); amountFound += ItemHelper - .extract(iItemHandler, required::matches, ExtractionCountMode.UPTO, + .extract(itemHandler, required::matches, ExtractionCountMode.UPTO, required.stack.getCount(), false) .getCount(); if (amountFound < required.stack.getCount()) @@ -776,14 +776,14 @@ public class SchematicannonTileEntity extends SmartTileEntity implements MenuPro AllSoundEvents.SCHEMATICANNON_LAUNCH_BLOCK.playOnServer(level, worldPosition); } - public void sendToContainer(FriendlyByteBuf buffer) { + public void sendToMenu(FriendlyByteBuf buffer) { buffer.writeBlockPos(getBlockPos()); buffer.writeNbt(getUpdateTag()); } @Override public AbstractContainerMenu createMenu(int id, Inventory inv, Player player) { - return SchematicannonContainer.create(id, inv, this); + return SchematicannonMenu.create(id, inv, this); } @Override diff --git a/src/main/java/com/simibubi/create/content/schematics/packet/ConfigureSchematicannonPacket.java b/src/main/java/com/simibubi/create/content/schematics/packet/ConfigureSchematicannonPacket.java index ee02fb8d1..d8cdb6185 100644 --- a/src/main/java/com/simibubi/create/content/schematics/packet/ConfigureSchematicannonPacket.java +++ b/src/main/java/com/simibubi/create/content/schematics/packet/ConfigureSchematicannonPacket.java @@ -2,7 +2,7 @@ package com.simibubi.create.content.schematics.packet; import java.util.function.Supplier; -import com.simibubi.create.content.schematics.block.SchematicannonContainer; +import com.simibubi.create.content.schematics.block.SchematicannonMenu; import com.simibubi.create.content.schematics.block.SchematicannonTileEntity; import com.simibubi.create.content.schematics.block.SchematicannonTileEntity.State; import com.simibubi.create.foundation.networking.SimplePacketBase; @@ -37,10 +37,10 @@ public class ConfigureSchematicannonPacket extends SimplePacketBase { public void handle(Supplier context) { context.get().enqueueWork(() -> { ServerPlayer player = context.get().getSender(); - if (player == null || !(player.containerMenu instanceof SchematicannonContainer)) + if (player == null || !(player.containerMenu instanceof SchematicannonMenu)) return; - SchematicannonTileEntity te = ((SchematicannonContainer) player.containerMenu).contentHolder; + SchematicannonTileEntity te = ((SchematicannonMenu) player.containerMenu).contentHolder; switch (option) { case DONT_REPLACE: case REPLACE_ANY: diff --git a/src/main/java/com/simibubi/create/content/schematics/packet/SchematicUploadPacket.java b/src/main/java/com/simibubi/create/content/schematics/packet/SchematicUploadPacket.java index 7ef4c5dd7..81e81bd0e 100644 --- a/src/main/java/com/simibubi/create/content/schematics/packet/SchematicUploadPacket.java +++ b/src/main/java/com/simibubi/create/content/schematics/packet/SchematicUploadPacket.java @@ -3,7 +3,7 @@ package com.simibubi.create.content.schematics.packet; import java.util.function.Supplier; import com.simibubi.create.Create; -import com.simibubi.create.content.schematics.block.SchematicTableContainer; +import com.simibubi.create.content.schematics.block.SchematicTableMenu; import com.simibubi.create.foundation.networking.SimplePacketBase; import net.minecraft.core.BlockPos; @@ -71,7 +71,7 @@ public class SchematicUploadPacket extends SimplePacketBase { if (player == null) return; if (code == BEGIN) { - BlockPos pos = ((SchematicTableContainer) player.containerMenu).contentHolder + BlockPos pos = ((SchematicTableMenu) player.containerMenu).contentHolder .getBlockPos(); Create.SCHEMATIC_RECEIVER.handleNewUpload(player, schematic, size, pos); } diff --git a/src/main/java/com/simibubi/create/foundation/data/recipe/ProcessingRecipeGen.java b/src/main/java/com/simibubi/create/foundation/data/recipe/ProcessingRecipeGen.java index 88e7308a8..f0d788315 100644 --- a/src/main/java/com/simibubi/create/foundation/data/recipe/ProcessingRecipeGen.java +++ b/src/main/java/com/simibubi/create/foundation/data/recipe/ProcessingRecipeGen.java @@ -74,11 +74,11 @@ public abstract class ProcessingRecipeGen extends CreateRecipeProvider { Supplier singleIngredient, UnaryOperator> transform) { ProcessingRecipeSerializer serializer = getSerializer(); GeneratedRecipe generatedRecipe = c -> { - ItemLike iItemProvider = singleIngredient.get(); + ItemLike itemLike = singleIngredient.get(); transform .apply(new ProcessingRecipeBuilder<>(serializer.getFactory(), - new ResourceLocation(namespace, RegisteredObjects.getKeyOrThrow(iItemProvider.asItem()) - .getPath())).withItemIngredients(Ingredient.of(iItemProvider))) + new ResourceLocation(namespace, RegisteredObjects.getKeyOrThrow(itemLike.asItem()) + .getPath())).withItemIngredients(Ingredient.of(itemLike))) .build(c); }; all.add(generatedRecipe); diff --git a/src/main/java/com/simibubi/create/foundation/gui/container/IClearableContainer.java b/src/main/java/com/simibubi/create/foundation/gui/container/IClearableContainer.java deleted file mode 100644 index d0d0da14e..000000000 --- a/src/main/java/com/simibubi/create/foundation/gui/container/IClearableContainer.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.simibubi.create.foundation.gui.container; - -import com.simibubi.create.foundation.networking.AllPackets; - -public interface IClearableContainer { - - default void sendClearPacket() { - AllPackets.channel.sendToServer(new ClearContainerPacket()); - } - - public void clearContents(); - -} diff --git a/src/main/java/com/simibubi/create/foundation/gui/container/AbstractSimiContainerScreen.java b/src/main/java/com/simibubi/create/foundation/gui/menu/AbstractSimiContainerScreen.java similarity index 99% rename from src/main/java/com/simibubi/create/foundation/gui/container/AbstractSimiContainerScreen.java rename to src/main/java/com/simibubi/create/foundation/gui/menu/AbstractSimiContainerScreen.java index f18e1a023..5d4e08e2a 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/container/AbstractSimiContainerScreen.java +++ b/src/main/java/com/simibubi/create/foundation/gui/menu/AbstractSimiContainerScreen.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.gui.container; +package com.simibubi.create.foundation.gui.menu; import java.util.Collection; import java.util.Collections; diff --git a/src/main/java/com/simibubi/create/foundation/gui/container/ClearContainerPacket.java b/src/main/java/com/simibubi/create/foundation/gui/menu/ClearMenuPacket.java similarity index 63% rename from src/main/java/com/simibubi/create/foundation/gui/container/ClearContainerPacket.java rename to src/main/java/com/simibubi/create/foundation/gui/menu/ClearMenuPacket.java index 1fb21351c..6b8be05e3 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/container/ClearContainerPacket.java +++ b/src/main/java/com/simibubi/create/foundation/gui/menu/ClearMenuPacket.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.gui.container; +package com.simibubi.create.foundation.gui.menu; import java.util.function.Supplier; @@ -8,11 +8,11 @@ import net.minecraft.network.FriendlyByteBuf; import net.minecraft.server.level.ServerPlayer; import net.minecraftforge.network.NetworkEvent.Context; -public class ClearContainerPacket extends SimplePacketBase { +public class ClearMenuPacket extends SimplePacketBase { - public ClearContainerPacket() {} + public ClearMenuPacket() {} - public ClearContainerPacket(FriendlyByteBuf buffer) {} + public ClearMenuPacket(FriendlyByteBuf buffer) {} @Override public void write(FriendlyByteBuf buffer) {} @@ -25,9 +25,9 @@ public class ClearContainerPacket extends SimplePacketBase { .getSender(); if (player == null) return; - if (!(player.containerMenu instanceof IClearableContainer)) + if (!(player.containerMenu instanceof IClearableMenu)) return; - ((IClearableContainer) player.containerMenu).clearContents(); + ((IClearableMenu) player.containerMenu).clearContents(); }); context.get() .setPacketHandled(true); diff --git a/src/main/java/com/simibubi/create/foundation/gui/container/GhostItemContainer.java b/src/main/java/com/simibubi/create/foundation/gui/menu/GhostItemMenu.java similarity index 88% rename from src/main/java/com/simibubi/create/foundation/gui/container/GhostItemContainer.java rename to src/main/java/com/simibubi/create/foundation/gui/menu/GhostItemMenu.java index bb42dfd2a..b7d619cb8 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/container/GhostItemContainer.java +++ b/src/main/java/com/simibubi/create/foundation/gui/menu/GhostItemMenu.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.gui.container; +package com.simibubi.create.foundation.gui.menu; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.entity.player.Inventory; @@ -10,15 +10,15 @@ import net.minecraft.world.item.ItemStack; import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.ItemStackHandler; -public abstract class GhostItemContainer extends ContainerBase implements IClearableContainer { +public abstract class GhostItemMenu extends MenuBase implements IClearableMenu { public ItemStackHandler ghostInventory; - protected GhostItemContainer(MenuType type, int id, Inventory inv, FriendlyByteBuf extraData) { + protected GhostItemMenu(MenuType type, int id, Inventory inv, FriendlyByteBuf extraData) { super(type, id, inv, extraData); } - protected GhostItemContainer(MenuType type, int id, Inventory inv, T contentHolder) { + protected GhostItemMenu(MenuType type, int id, Inventory inv, T contentHolder) { super(type, id, inv, contentHolder); } diff --git a/src/main/java/com/simibubi/create/foundation/gui/container/GhostItemSubmitPacket.java b/src/main/java/com/simibubi/create/foundation/gui/menu/GhostItemSubmitPacket.java similarity index 78% rename from src/main/java/com/simibubi/create/foundation/gui/container/GhostItemSubmitPacket.java rename to src/main/java/com/simibubi/create/foundation/gui/menu/GhostItemSubmitPacket.java index eb1813703..ebc18114a 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/container/GhostItemSubmitPacket.java +++ b/src/main/java/com/simibubi/create/foundation/gui/menu/GhostItemSubmitPacket.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.gui.container; +package com.simibubi.create.foundation.gui.menu; import java.util.function.Supplier; @@ -39,10 +39,9 @@ public class GhostItemSubmitPacket extends SimplePacketBase { if (player == null) return; - if (player.containerMenu instanceof GhostItemContainer) { - GhostItemContainer c = (GhostItemContainer) player.containerMenu; - c.ghostInventory.setStackInSlot(slot, item); - c.getSlot(36 + slot).setChanged(); + if (player.containerMenu instanceof GhostItemMenu menu) { + menu.ghostInventory.setStackInSlot(slot, item); + menu.getSlot(36 + slot).setChanged(); } }); diff --git a/src/main/java/com/simibubi/create/foundation/gui/menu/IClearableMenu.java b/src/main/java/com/simibubi/create/foundation/gui/menu/IClearableMenu.java new file mode 100644 index 000000000..0ad1b6991 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/gui/menu/IClearableMenu.java @@ -0,0 +1,13 @@ +package com.simibubi.create.foundation.gui.menu; + +import com.simibubi.create.foundation.networking.AllPackets; + +public interface IClearableMenu { + + default void sendClearPacket() { + AllPackets.channel.sendToServer(new ClearMenuPacket()); + } + + public void clearContents(); + +} diff --git a/src/main/java/com/simibubi/create/foundation/gui/container/ContainerBase.java b/src/main/java/com/simibubi/create/foundation/gui/menu/MenuBase.java similarity index 85% rename from src/main/java/com/simibubi/create/foundation/gui/container/ContainerBase.java rename to src/main/java/com/simibubi/create/foundation/gui/menu/MenuBase.java index f3632f10e..9781f17d7 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/container/ContainerBase.java +++ b/src/main/java/com/simibubi/create/foundation/gui/menu/MenuBase.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.gui.container; +package com.simibubi.create.foundation.gui.menu; import com.simibubi.create.foundation.utility.IInteractionChecker; @@ -11,18 +11,18 @@ import net.minecraft.world.inventory.Slot; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -public abstract class ContainerBase extends AbstractContainerMenu { +public abstract class MenuBase extends AbstractContainerMenu { public Player player; public Inventory playerInventory; public T contentHolder; - protected ContainerBase(MenuType type, int id, Inventory inv, FriendlyByteBuf extraData) { + protected MenuBase(MenuType type, int id, Inventory inv, FriendlyByteBuf extraData) { super(type, id); init(inv, createOnClient(extraData)); } - protected ContainerBase(MenuType type, int id, Inventory inv, T contentHolder) { + protected MenuBase(MenuType type, int id, Inventory inv, T contentHolder) { super(type, id); init(inv, contentHolder); } diff --git a/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java b/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java index e30bd3873..50b49282a 100644 --- a/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java +++ b/src/main/java/com/simibubi/create/foundation/networking/AllPackets.java @@ -82,8 +82,8 @@ import com.simibubi.create.content.schematics.packet.SchematicUploadPacket; import com.simibubi.create.foundation.command.HighlightPacket; import com.simibubi.create.foundation.command.SConfigureConfigPacket; import com.simibubi.create.foundation.config.ui.CConfigureConfigPacket; -import com.simibubi.create.foundation.gui.container.ClearContainerPacket; -import com.simibubi.create.foundation.gui.container.GhostItemSubmitPacket; +import com.simibubi.create.foundation.gui.menu.ClearMenuPacket; +import com.simibubi.create.foundation.gui.menu.GhostItemSubmitPacket; import com.simibubi.create.foundation.tileEntity.RemoveTileEntityPacket; import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringCountUpdatePacket; import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueUpdatePacket; @@ -109,7 +109,7 @@ public enum AllPackets { PLAY_TO_SERVER), PLACE_SCHEMATIC(SchematicPlacePacket.class, SchematicPlacePacket::new, PLAY_TO_SERVER), UPLOAD_SCHEMATIC(SchematicUploadPacket.class, SchematicUploadPacket::new, PLAY_TO_SERVER), - CLEAR_CONTAINER(ClearContainerPacket.class, ClearContainerPacket::new, PLAY_TO_SERVER), + CLEAR_CONTAINER(ClearMenuPacket.class, ClearMenuPacket::new, PLAY_TO_SERVER), CONFIGURE_FILTER(FilterScreenPacket.class, FilterScreenPacket::new, PLAY_TO_SERVER), CONFIGURE_FILTERING_AMOUNT(FilteringCountUpdatePacket.class, FilteringCountUpdatePacket::new, PLAY_TO_SERVER), CONFIGURE_SCROLLABLE(ScrollValueUpdatePacket.class, ScrollValueUpdatePacket::new, PLAY_TO_SERVER), diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/SmartTileEntity.java b/src/main/java/com/simibubi/create/foundation/tileEntity/SmartTileEntity.java index fb5e886ec..da8b61c83 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/SmartTileEntity.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/SmartTileEntity.java @@ -221,7 +221,7 @@ public abstract class SmartTileEntity extends CachedRenderBBTileEntity implement worldPosition.getZ() + 0.5D) <= 64.0D; } - public void sendToContainer(FriendlyByteBuf buffer) { + public void sendToMenu(FriendlyByteBuf buffer) { buffer.writeBlockPos(getBlockPos()); buffer.writeNbt(getUpdateTag()); } diff --git a/src/main/java/com/simibubi/create/foundation/utility/RemapHelper.java b/src/main/java/com/simibubi/create/foundation/utility/RemapHelper.java index 77cb32db0..b9d0b7d28 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/RemapHelper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/RemapHelper.java @@ -24,9 +24,9 @@ import static com.simibubi.create.AllBlocks.SPEEDOMETER; import static com.simibubi.create.AllBlocks.STOCKPILE_SWITCH; import static com.simibubi.create.AllBlocks.STRESSOMETER; import static com.simibubi.create.AllItems.ATTRIBUTE_FILTER; -import static com.simibubi.create.AllItems.CRAFTER_SLOT_COVER; import static com.simibubi.create.AllItems.COPPER_DIVING_BOOTS; import static com.simibubi.create.AllItems.COPPER_DIVING_HELMET; +import static com.simibubi.create.AllItems.CRAFTER_SLOT_COVER; import static com.simibubi.create.AllItems.GOLDEN_SHEET; import static com.simibubi.create.AllItems.POWDERED_OBSIDIAN; import static com.simibubi.create.AllItems.SCHEMATIC;