From a44c74b0d78a6c1eb5611579fbc719d31186ec22 Mon Sep 17 00:00:00 2001 From: PrototypeTrousers Date: Tue, 9 Aug 2022 03:41:31 -0300 Subject: [PATCH 1/4] wip --- .../GuiConfiguringTerminal.java | 590 ++++++++++++++++++ .../ContainerConfiguringTerminal.java | 471 ++++++++++++++ .../appeng/core/api/definitions/ApiParts.java | 2 + src/main/java/appeng/core/sync/GuiBridge.java | 13 +- .../java/appeng/items/parts/PartType.java | 3 +- .../reporting/PartConfiguringTerminal.java | 77 +++ 6 files changed, 1148 insertions(+), 8 deletions(-) create mode 100644 src/main/java/appeng/client/gui/implementations/GuiConfiguringTerminal.java create mode 100644 src/main/java/appeng/container/implementations/ContainerConfiguringTerminal.java create mode 100644 src/main/java/appeng/parts/reporting/PartConfiguringTerminal.java diff --git a/src/main/java/appeng/client/gui/implementations/GuiConfiguringTerminal.java b/src/main/java/appeng/client/gui/implementations/GuiConfiguringTerminal.java new file mode 100644 index 000000000..d8971bb67 --- /dev/null +++ b/src/main/java/appeng/client/gui/implementations/GuiConfiguringTerminal.java @@ -0,0 +1,590 @@ +/* + * This file is part of Applied Energistics 2. + * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. + * + * Applied Energistics 2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Applied Energistics 2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Applied Energistics 2. If not, see . + */ + +package appeng.client.gui.implementations; + + +import java.io.IOException; +import java.util.*; + +import appeng.api.config.ActionItems; +import appeng.api.config.Settings; +import appeng.api.config.Upgrades; +import appeng.client.gui.widgets.GuiImgButton; +import appeng.container.implementations.ContainerConfiguringTerminal; +import appeng.core.worlddata.IWorldPlayerMapping; +import appeng.helpers.DualityInterface; +import appeng.parts.misc.PartInterface; +import appeng.parts.reporting.PartConfiguringTerminal; +import appeng.tile.inventory.AppEngInternalInventory; +import appeng.tile.misc.TileInterface; +import appeng.util.BlockPosUtils; +import com.google.common.collect.HashMultimap; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + +import appeng.api.AEApi; +import appeng.api.storage.channels.IItemStorageChannel; +import appeng.client.gui.AEBaseGui; +import appeng.client.gui.widgets.GuiScrollbar; +import appeng.client.gui.widgets.MEGuiTextField; +import appeng.client.me.ClientDCInternalInv; +import appeng.client.me.SlotDisconnected; +import appeng.container.implementations.ContainerInterfaceTerminal; +import appeng.core.localization.GuiText; +import appeng.parts.reporting.PartInterfaceTerminal; +import appeng.util.Platform; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.TextComponentString; +import net.minecraftforge.common.DimensionManager; +import org.lwjgl.input.Mouse; + + +import static appeng.client.render.BlockPosHighlighter.hilightBlock; + + +public class GuiConfiguringTerminal extends AEBaseGui +{ + + private static final int LINES_ON_PAGE = 6; + + // TODO: copied from GuiMEMonitorable. It looks not changed, maybe unneeded? + private final int offsetX = 21; + + private final HashMap byId = new HashMap<>(); + private final HashMultimap byName = HashMultimap.create(); + private final HashMap blockPosHashMap = new HashMap<>(); + private final HashMap guiButtonHashMap = new HashMap<>(); + private final Map numUpgradesMap = new HashMap<>(); + private final ArrayList names = new ArrayList<>(); + private final ArrayList lines = new ArrayList<>(); + private final Set matchedStacks = new HashSet<>(); + + private final Map> cachedSearches = new WeakHashMap<>(); + + private boolean refreshList = false; + private MEGuiTextField searchFieldOutputs; + private MEGuiTextField searchFieldInputs; + private PartConfiguringTerminal partInterfaceTerminal; + private GuiButton guiButtonHide; + private GuiButton guiButtonNextAssembler; + private HashMap dimHashMap = new HashMap<>(); + + public GuiConfiguringTerminal( final InventoryPlayer inventoryPlayer, final PartConfiguringTerminal te ) + { + super( new ContainerConfiguringTerminal( inventoryPlayer, te ) ); + + this.partInterfaceTerminal = te; + final GuiScrollbar scrollbar = new GuiScrollbar(); + this.setScrollBar( scrollbar ); + this.xSize = 208; + this.ySize = 255; + } + + @Override + public void initGui() + { + super.initGui(); + + this.getScrollBar().setLeft( 189 ); + this.getScrollBar().setHeight( 106 ); + this.getScrollBar().setTop( 51 ); + + this.searchFieldInputs = new MEGuiTextField( this.fontRenderer, this.guiLeft + Math.max( 32, this.offsetX ), this.guiTop + 25, 65, 12 ); + this.searchFieldInputs.setEnableBackgroundDrawing( false ); + this.searchFieldInputs.setMaxStringLength( 25 ); + this.searchFieldInputs.setTextColor( 0xFFFFFF ); + this.searchFieldInputs.setVisible( true ); + this.searchFieldInputs.setFocused( false ); + + this.searchFieldOutputs = new MEGuiTextField( this.fontRenderer, this.guiLeft + Math.max( 32, this.offsetX ), this.guiTop + 38, 65, 12 ); + this.searchFieldOutputs.setEnableBackgroundDrawing( false ); + this.searchFieldOutputs.setMaxStringLength( 25 ); + this.searchFieldOutputs.setTextColor( 0xFFFFFF ); + this.searchFieldOutputs.setVisible( true ); + this.searchFieldOutputs.setFocused( true ); + + this.searchFieldInputs.setText( partInterfaceTerminal.in ); + } + + @Override + public void onGuiClosed() + { + partInterfaceTerminal.saveSearchStrings( this.searchFieldInputs.getText().toLowerCase() ); + super.onGuiClosed(); + } + + @Override + public void drawFG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) + { + this.buttonList.clear(); + + this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.InterfaceTerminal.getLocal() ), 8, 6, 4210752 ); + this.fontRenderer.drawString( GuiText.inventory.getLocal(), this.offsetX + 2, this.ySize - 96 + 3, 4210752 ); + + final int currentScroll = this.getScrollBar().getCurrentScroll(); + + this.inventorySlots.inventorySlots.removeIf( slot -> slot instanceof SlotDisconnected ); + + int offset = 52; + int linesDraw = 0; + for( int x = 0; x < LINES_ON_PAGE && linesDraw < LINES_ON_PAGE && currentScroll + x < this.lines.size(); x++ ) + { + final Object lineObj = this.lines.get( currentScroll + x ); + if( lineObj instanceof ClientDCInternalInv ) + { + final ClientDCInternalInv inv = (ClientDCInternalInv) lineObj; + + GuiButton guiButton = new GuiImgButton( guiLeft + 4, guiTop + offset, Settings.ACTIONS, ActionItems.HIGHLIGHT_INTERFACE ); + guiButtonHashMap.put( guiButton, inv ); + this.buttonList.add( guiButton ); + int extraLines = numUpgradesMap.get( inv ); + + for( int row = 0; row < 1 + extraLines && linesDraw < LINES_ON_PAGE; ++row ) + { + for( int z = 0; z < 9; z++ ) + { + this.inventorySlots.inventorySlots.add( new SlotDisconnected( inv, z + ( row * 9 ), ( z * 18 + 22 ), offset ) ); + if( this.matchedStacks.contains( inv.getInventory().getStackInSlot( z + ( row * 9 ) ) ) ) + { + drawRect( z * 18 + 22, offset, z * 18 + 22 + 16, offset + 16, 0x2A00FF00 ); + } + } + linesDraw++; + offset += 18; + } + } + else if( lineObj instanceof String ) + { + String name = (String) lineObj; + final int rows = this.byName.get( name ).size(); + if( rows > 1 ) + { + name = name + " (" + rows + ')'; + } + + while ( name.length() > 2 && this.fontRenderer.getStringWidth( name ) > 155 ) + { + name = name.substring( 0, name.length() - 1 ); + } + this.fontRenderer.drawString( name, this.offsetX + 2, 5 + offset, 4210752 ); + linesDraw++; + offset += 18; + } + } + + if( searchFieldInputs.isMouseIn( mouseX, mouseY ) ) + { + drawTooltip( Mouse.getEventX() * this.width / this.mc.displayWidth - offsetX, mouseY - guiTop, "Inputs OR names" ); + } + else if( searchFieldOutputs.isMouseIn( mouseX, mouseY ) ) + { + drawTooltip( Mouse.getEventX() * this.width / this.mc.displayWidth - offsetX, mouseY - guiTop, "Outputs OR names" ); + } + + } + + @Override + protected void mouseClicked( final int xCoord, final int yCoord, final int btn ) throws IOException + { + this.searchFieldInputs.mouseClicked( xCoord, yCoord, btn ); + + if( btn == 1 && this.searchFieldInputs.isMouseIn( xCoord, yCoord ) ) + { + this.searchFieldInputs.setText( "" ); + this.refreshList(); + } + + this.searchFieldOutputs.mouseClicked( xCoord, yCoord, btn ); + + if( btn == 1 && this.searchFieldOutputs.isMouseIn( xCoord, yCoord ) ) + { + this.searchFieldOutputs.setText( "" ); + this.refreshList(); + } + + super.mouseClicked( xCoord, yCoord, btn ); + } + + @Override + protected void actionPerformed( final GuiButton btn ) throws IOException + { + if( guiButtonHashMap.containsKey( btn ) ) + { + BlockPos blockPos = blockPosHashMap.get( guiButtonHashMap.get( this.selectedButton ) ); + BlockPos blockPos2 = mc.player.getPosition(); + int playerDim = mc.world.provider.getDimension(); + int interfaceDim = dimHashMap.get( guiButtonHashMap.get( this.selectedButton ) ); + if( playerDim != interfaceDim ) + { + try + { + mc.player.sendStatusMessage( new TextComponentString( "Interface located at dimension: " + interfaceDim + " [" + DimensionManager.getWorld( interfaceDim ).provider.getDimensionType().getName() + "] and cant be highlighted" ), false ); + } + catch( Exception e ) + { + mc.player.sendStatusMessage( new TextComponentString( "Interface is located in another dimension and cannot be highlighted" ), false ); + } + } + else + { + hilightBlock( blockPos, System.currentTimeMillis() + 500 * BlockPosUtils.getDistance( blockPos, blockPos2 ), playerDim ); + mc.player.sendStatusMessage( new TextComponentString( "The interface is now highlighted at " + "X: " + blockPos.getX() + " Y: " + blockPos.getY() + " Z: " + blockPos.getZ() ), false ); + } + mc.player.closeScreen(); + } + } + + @Override + public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) + { + this.bindTexture( "guis/newinterfaceterminal.png" ); + this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); + + int offset = 51; + final int ex = this.getScrollBar().getCurrentScroll(); + int linesDraw = 0; + for( int x = 0; x < LINES_ON_PAGE && linesDraw < LINES_ON_PAGE && ex + x < this.lines.size(); x++ ) + { + final Object lineObj = this.lines.get( ex + x ); + if( lineObj instanceof ClientDCInternalInv ) + { + GlStateManager.color( 1, 1, 1, 1 ); + final int width = 9 * 18; + + int extraLines = numUpgradesMap.get( lineObj ); + + for( int row = 0; row < 1 + extraLines && linesDraw < LINES_ON_PAGE; ++row ) + { + this.drawTexturedModalRect( offsetX + 20, offsetY + offset, 20, 173, width, 18 ); + offset += 18; + linesDraw++; + } + } + else + { + offset += 18; + linesDraw++; + } + } + + if( this.searchFieldInputs != null ) + { + this.searchFieldInputs.drawTextBox(); + } + + if( this.searchFieldOutputs != null ) + { + this.searchFieldOutputs.drawTextBox(); + } + } + + @Override + protected void keyTyped( final char character, final int key ) throws IOException + { + if( !this.checkHotbarKeys( key ) ) + { + if( character == ' ' && this.searchFieldInputs.getText().isEmpty() && this.searchFieldInputs.isFocused() ) + { + return; + } + + if( character == ' ' && this.searchFieldOutputs.getText().isEmpty() && this.searchFieldOutputs.isFocused() ) + { + return; + } + + if( this.searchFieldInputs.textboxKeyTyped( character, key ) || this.searchFieldOutputs.textboxKeyTyped( character, key ) ) + { + this.refreshList(); + } + + else + { + super.keyTyped( character, key ); + } + } + } + + public void postUpdate( final NBTTagCompound in ) + { + if( in.getBoolean( "clear" ) ) + { + this.byId.clear(); + this.refreshList = true; + } + + for( final Object oKey : in.getKeySet() ) + { + final String key = (String) oKey; + if( key.startsWith( "=" ) ) + { + try + { + final long id = Long.parseLong( key.substring( 1 ), Character.MAX_RADIX ); + final NBTTagCompound invData = in.getCompoundTag( key ); + final ClientDCInternalInv current = this.getById( id, invData.getLong( "sortBy" ), invData.getString( "un" ) ); + blockPosHashMap.put( current, NBTUtil.getPosFromTag( invData.getCompoundTag( "pos" ) ) ); + dimHashMap.put( current, invData.getInteger( "dim" ) ); + numUpgradesMap.put( current, invData.getInteger( "numUpgrades" ) ); + + for( int x = 0; x < current.getInventory().getSlots(); x++ ) + { + final String which = Integer.toString( x ); + if( invData.hasKey( which ) ) + { + current.getInventory().setStackInSlot( x, new ItemStack( invData.getCompoundTag( which ) ) ); + } + } + } + catch( final NumberFormatException ignored ) + { + } + } + } + + if( this.refreshList ) + { + this.refreshList = false; + // invalid caches on refresh + this.cachedSearches.clear(); + this.refreshList(); + } + } + + /** + * Rebuilds the list of interfaces. + *

+ * Respects a search term if present (ignores case) and adding only matching patterns. + */ + private void refreshList() + { + this.byName.clear(); + this.buttonList.clear(); + this.matchedStacks.clear(); + + final String searchFieldInputs = this.searchFieldInputs.getText().toLowerCase(); + final String searchFieldOutputs = this.searchFieldOutputs.getText().toLowerCase(); + + final Set cachedSearch = this.getCacheForSearchTerm( searchFieldInputs ); + final boolean rebuild = cachedSearch.isEmpty(); + + for( final ClientDCInternalInv entry : this.byId.values() ) + { + // ignore inventory if not doing a full rebuild and cache already marks it as miss. + if( !rebuild && !cachedSearch.contains( entry ) ) + { + continue; + } + + // Shortcut to skip any filter if search term is ""/empty + + boolean found = ( searchFieldInputs.isEmpty() && searchFieldOutputs.isEmpty() ); + boolean interfaceHasFreeSlots = false; + + // Search if the current inventory holds a pattern containing the search term. + if( !found ) + { + int slot = 0; + for( final ItemStack itemStack : entry.getInventory() ) + { + if( slot > 8 + numUpgradesMap.get( entry ) * 9 ) + { + break; + } + if( !searchFieldInputs.isEmpty() && !searchFieldOutputs.isEmpty() ) + { + if( this.itemStackMatchesSearchTerm( itemStack, searchFieldInputs, 0 ) || this.itemStackMatchesSearchTerm( itemStack, searchFieldOutputs, 1 ) ) + { + found = true; + matchedStacks.add( itemStack ); + } + } + else if( !searchFieldInputs.isEmpty() ) + { + if( this.itemStackMatchesSearchTerm( itemStack, searchFieldInputs, 0 ) ) + { + found = true; + matchedStacks.add( itemStack ); + } + } + else if( !searchFieldOutputs.isEmpty() ) + { + if( this.itemStackMatchesSearchTerm( itemStack, searchFieldOutputs, 1 ) ) + { + found = true; + matchedStacks.add( itemStack ); + } + } + // If only Interfaces with empty slots should be shown, check that here + if( itemStack.isEmpty() ) + { + interfaceHasFreeSlots = true; + } + slot++; + } + } + // if found, filter skipped or machine name matching the search term, add it + if( found || ( entry.getName().toLowerCase().contains( searchFieldInputs ) && entry.getName().toLowerCase().contains( searchFieldOutputs ) ) ) + { + if( interfaceHasFreeSlots ) + { + this.byName.put( entry.getName(), entry ); + cachedSearch.add( entry ); + } + } + else + { + cachedSearch.remove( entry ); + } + } + + this.names.clear(); + this.names.addAll( this.byName.keySet() ); + + Collections.sort( this.names ); + + this.lines.clear(); + this.lines.ensureCapacity( this.getMaxRows() ); + + for( final String n : this.names ) + { + this.lines.add( n ); + + final ArrayList clientInventories = new ArrayList<>(); + clientInventories.addAll( this.byName.get( n ) ); + + Collections.sort( clientInventories ); + this.lines.addAll( clientInventories ); + } + + this.getScrollBar().setRange( 0, this.lines.size() - 1, 1 ); + } + + private boolean itemStackMatchesSearchTerm( final ItemStack itemStack, final String searchTerm, int pass ) + { + if( itemStack.isEmpty() ) + { + return false; + } + + final NBTTagCompound encodedValue = itemStack.getTagCompound(); + + if( encodedValue == null ) + { + return false; + } + + NBTTagList tag = new NBTTagList(); + + if( pass == 0 ) + { + tag = encodedValue.getTagList( "in", 10 ); + } + else + { + tag = encodedValue.getTagList( "out", 10 ); + } + + boolean foundMatchingItemStack = false; + + for( int i = 0; i < tag.tagCount(); i++ ) + { + final ItemStack parsedItemStack = new ItemStack( tag.getCompoundTagAt( i ) ); + if( !parsedItemStack.isEmpty() ) + { + final String displayName = Platform + .getItemDisplayName( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createStack( parsedItemStack ) ) + .toLowerCase(); + + for( String term : searchTerm.split( " " ) ) + { + if( term.length() > 1 && ( term.startsWith( "-" ) || term.startsWith( "!" ) ) ) + { + term = term.substring( 1 ); + if( displayName.contains( term ) ) + { + return false; + } + } + else if( displayName.contains( term ) ) + { + foundMatchingItemStack = true; + } + } + } + } + return foundMatchingItemStack; + } + + /** + * Tries to retrieve a cache for a with search term as keyword. + *

+ * If this cache should be empty, it will populate it with an earlier cache if available or at least the cache for + * the empty string. + * + * @param searchTerm the corresponding search + * @return a Set matching a superset of the search term + */ + private Set getCacheForSearchTerm( final String searchTerm ) + { + if( !this.cachedSearches.containsKey( searchTerm ) ) + { + this.cachedSearches.put( searchTerm, new HashSet<>() ); + } + + final Set cache = this.cachedSearches.get( searchTerm ); + + if( cache.isEmpty() && searchTerm.length() > 1 ) + { + cache.addAll( this.getCacheForSearchTerm( searchTerm.substring( 0, searchTerm.length() - 1 ) ) ); + return cache; + } + + return cache; + } + + /** + * The max amount of unique names and each inv row. Not affected by the filtering. + * + * @return max amount of unique names and each inv row + */ + private int getMaxRows() + { + return this.names.size() + this.byId.size(); + } + + private ClientDCInternalInv getById( final long id, final long sortBy, final String string ) + { + ClientDCInternalInv o = this.byId.get( id ); + + if( o == null ) + { + this.byId.put( id, o = new ClientDCInternalInv( DualityInterface.NUMBER_OF_PATTERN_SLOTS, id, sortBy, string ) ); + this.refreshList = true; + } + + return o; + } +} diff --git a/src/main/java/appeng/container/implementations/ContainerConfiguringTerminal.java b/src/main/java/appeng/container/implementations/ContainerConfiguringTerminal.java new file mode 100644 index 000000000..159f7d7eb --- /dev/null +++ b/src/main/java/appeng/container/implementations/ContainerConfiguringTerminal.java @@ -0,0 +1,471 @@ +/* + * This file is part of Applied Energistics 2. + * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. + * + * Applied Energistics 2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Applied Energistics 2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Applied Energistics 2. If not, see . + */ + +package appeng.container.implementations; + + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +import appeng.api.config.Upgrades; +import appeng.parts.reporting.PartConfiguringTerminal; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.items.IItemHandler; + +import appeng.api.config.Settings; +import appeng.api.config.YesNo; +import appeng.api.networking.IGrid; +import appeng.api.networking.IGridNode; +import appeng.api.networking.security.IActionHost; +import appeng.container.AEBaseContainer; +import appeng.core.sync.network.NetworkHandler; +import appeng.core.sync.packets.PacketCompressedNBT; +import appeng.helpers.DualityInterface; +import appeng.helpers.IInterfaceHost; +import appeng.helpers.InventoryAction; +import appeng.items.misc.ItemEncodedPattern; +import appeng.parts.misc.PartInterface; +import appeng.parts.reporting.PartInterfaceTerminal; +import appeng.tile.inventory.AppEngInternalInventory; +import appeng.tile.misc.TileInterface; +import appeng.util.InventoryAdaptor; +import appeng.util.Platform; +import appeng.util.helpers.ItemHandlerUtil; +import appeng.util.inv.AdaptorItemHandler; +import appeng.util.inv.WrapperCursorItemHandler; +import appeng.util.inv.WrapperFilteredItemHandler; +import appeng.util.inv.WrapperRangeItemHandler; +import appeng.util.inv.filter.IAEItemFilter; + + +public final class ContainerConfiguringTerminal extends AEBaseContainer +{ + + /** + * this stuff is all server side.. + */ + + private static long autoBase = Long.MIN_VALUE; + private final Map diList = new HashMap<>(); + private final Map byId = new HashMap<>(); + private IGrid grid; + private NBTTagCompound data = new NBTTagCompound(); + + public ContainerConfiguringTerminal( final InventoryPlayer ip, final PartConfiguringTerminal anchor ) + { + super( ip, anchor ); + + if( Platform.isServer() ) + { + this.grid = anchor.getActionableNode().getGrid(); + } + + this.bindPlayerInventory( ip, 14, 256 - /* height of player inventory */82 ); + } + + @Override + public void detectAndSendChanges() + { + if( Platform.isClient() ) + { + return; + } + + super.detectAndSendChanges(); + + if( this.grid == null ) + { + return; + } + + int total = 0; + boolean missing = false; + + final IActionHost host = this.getActionHost(); + if( host != null ) + { + final IGridNode agn = host.getActionableNode(); + if( agn != null && agn.isActive() ) + { + for( final IGridNode gn : this.grid.getMachines( TileInterface.class ) ) + { + if( gn.isActive() ) + { + final IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); + if( ih.getInterfaceDuality().getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.NO ) + { + continue; + } + + final ConfigTracker t = this.diList.get( ih ); + + if( t == null ) + { + missing = true; + } + else + { + final DualityInterface dual = ih.getInterfaceDuality(); + if( !t.unlocalizedName.equals( dual.getTermName() ) ) + { + missing = true; + } + } + + total++; + } + } + + for( final IGridNode gn : this.grid.getMachines( PartInterface.class ) ) + { + if( gn.isActive() ) + { + final IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); + if( ih.getInterfaceDuality().getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.NO ) + { + continue; + } + + final ConfigTracker t = this.diList.get( ih ); + + if( t == null ) + { + missing = true; + } + else + { + final DualityInterface dual = ih.getInterfaceDuality(); + if( !t.unlocalizedName.equals( dual.getTermName() ) ) + { + missing = true; + } + } + + total++; + } + } + } + } + + if( total != this.diList.size() || missing ) + { + this.regenList( this.data ); + } + else + { + for( final Entry en : this.diList.entrySet() ) + { + final ConfigTracker inv = en.getValue(); + for( int x = 0; x < inv.server.getSlots(); x++ ) + { + if( this.isDifferent( inv.server.getStackInSlot( x ), inv.client.getStackInSlot( x ) ) ) + { + this.addItems( this.data, inv, x, 1 ); + } + } + } + } + + if( !this.data.hasNoTags() ) + { + try + { + NetworkHandler.instance().sendTo( new PacketCompressedNBT( this.data ), (EntityPlayerMP) this.getPlayerInv().player ); + } + catch( final IOException e ) + { + // :P + } + + this.data = new NBTTagCompound(); + } + } + + @Override + public void doAction( final EntityPlayerMP player, final InventoryAction action, final int slot, final long id ) + { + final ConfigTracker inv = this.byId.get( id ); + if( inv != null ) + { + final ItemStack is = inv.server.getStackInSlot( slot ); + final boolean hasItemInHand = !player.inventory.getItemStack().isEmpty(); + + final InventoryAdaptor playerHand = new AdaptorItemHandler( new WrapperCursorItemHandler( player.inventory ) ); + + final IItemHandler theSlot = new WrapperFilteredItemHandler( new WrapperRangeItemHandler( inv.server, slot, slot + 1 ), new PatternSlotFilter() ); + final InventoryAdaptor interfaceSlot = new AdaptorItemHandler( theSlot ); + + IItemHandler interfaceHandler = inv.server; + boolean canInsert = true; + + switch ( action ) + { + case PICKUP_OR_SET_DOWN: + if( hasItemInHand ) + { + for( int s = 0; s < interfaceHandler.getSlots(); s++ ) + { + if( Platform.itemComparisons().isSameItem( interfaceHandler.getStackInSlot( s ), player.inventory.getItemStack() ) ) + { + canInsert = false; + break; + } + } + if( canInsert ) + { + ItemStack inSlot = theSlot.getStackInSlot( 0 ); + if( inSlot.isEmpty() ) + { + player.inventory.setItemStack( interfaceSlot.addItems( player.inventory.getItemStack() ) ); + } + else + { + inSlot = inSlot.copy(); + final ItemStack inHand = player.inventory.getItemStack().copy(); + + ItemHandlerUtil.setStackInSlot( theSlot, 0, ItemStack.EMPTY ); + player.inventory.setItemStack( ItemStack.EMPTY ); + + player.inventory.setItemStack( interfaceSlot.addItems( inHand.copy() ) ); + + if( player.inventory.getItemStack().isEmpty() ) + { + player.inventory.setItemStack( inSlot ); + } + else + { + player.inventory.setItemStack( inHand ); + ItemHandlerUtil.setStackInSlot( theSlot, 0, inSlot ); + } + } + } + } + else + { + ItemHandlerUtil.setStackInSlot( theSlot, 0, playerHand.addItems( theSlot.getStackInSlot( 0 ) ) ); + } + + break; + case SPLIT_OR_PLACE_SINGLE: + if( hasItemInHand ) + { + for( int s = 0; s < interfaceHandler.getSlots(); s++ ) + { + if( Platform.itemComparisons().isSameItem( interfaceHandler.getStackInSlot( s ), player.inventory.getItemStack() ) ) + { + canInsert = false; + break; + } + } + if( canInsert ) + { + ItemStack extra = playerHand.removeItems( 1, ItemStack.EMPTY, null ); + if( !extra.isEmpty() && !interfaceSlot.containsItems() ) + { + extra = interfaceSlot.addItems( extra ); + } + if( !extra.isEmpty() ) + { + playerHand.addItems( extra ); + } + } + } + else if( !is.isEmpty() ) + { + ItemStack extra = interfaceSlot.removeItems( ( is.getCount() + 1 ) / 2, ItemStack.EMPTY, null ); + if( !extra.isEmpty() ) + { + extra = playerHand.addItems( extra ); + } + if( !extra.isEmpty() ) + { + interfaceSlot.addItems( extra ); + } + } + + break; + case SHIFT_CLICK: + + final InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( player ); + + ItemHandlerUtil.setStackInSlot( theSlot, 0, playerInv.addItems( theSlot.getStackInSlot( 0 ) ) ); + + break; + case MOVE_REGION: + + final InventoryAdaptor playerInvAd = InventoryAdaptor.getAdaptor( player ); + for( int x = 0; x < inv.server.getSlots(); x++ ) + { + ItemHandlerUtil.setStackInSlot( inv.server, x, playerInvAd.addItems( inv.server.getStackInSlot( x ) ) ); + } + + break; + case CREATIVE_DUPLICATE: + + if( player.capabilities.isCreativeMode && !hasItemInHand ) + { + player.inventory.setItemStack( is.isEmpty() ? ItemStack.EMPTY : is.copy() ); + } + + break; + default: + return; + } + + this.updateHeld( player ); + } + } + + private void regenList( final NBTTagCompound data ) + { + this.byId.clear(); + this.diList.clear(); + + final IActionHost host = this.getActionHost(); + if( host != null ) + { + final IGridNode agn = host.getActionableNode(); + if( agn != null && agn.isActive() ) + { + for( final IGridNode gn : this.grid.getMachines( TileInterface.class ) ) + { + final IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); + final DualityInterface dual = ih.getInterfaceDuality(); + if( gn.isActive() && dual.getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.YES ) + { + this.diList.put( ih, new ConfigTracker( dual, dual.getPatterns(), dual.getTermName() ) ); + } + } + + for( final IGridNode gn : this.grid.getMachines( PartInterface.class ) ) + { + final IInterfaceHost ih = (IInterfaceHost) gn.getMachine(); + final DualityInterface dual = ih.getInterfaceDuality(); + if( gn.isActive() && dual.getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.YES ) + { + this.diList.put( ih, new ConfigTracker( dual, dual.getPatterns(), dual.getTermName() ) ); + } + } + } + } + + data.setBoolean( "clear", true ); + + for( final Entry en : this.diList.entrySet() ) + { + final ConfigTracker inv = en.getValue(); + this.byId.put( inv.which, inv ); + this.addItems( data, inv, 0, inv.server.getSlots() ); + } + } + + private boolean isDifferent( final ItemStack a, final ItemStack b ) + { + if( a.isEmpty() && b.isEmpty() ) + { + return false; + } + + if( a.isEmpty() || b.isEmpty() ) + { + return true; + } + + return !ItemStack.areItemStacksEqual( a, b ); + } + + private void addItems( final NBTTagCompound data, final ConfigTracker inv, final int offset, final int length ) + { + final String name = '=' + Long.toString( inv.which, Character.MAX_RADIX ); + final NBTTagCompound tag = data.getCompoundTag( name ); + + if( tag.hasNoTags() ) + { + tag.setLong( "sortBy", inv.sortBy ); + tag.setString( "un", inv.unlocalizedName ); + tag.setTag( "pos", NBTUtil.createPosTag( inv.pos ) ); + tag.setInteger( "dim", inv.dim ); + tag.setInteger( "numUpgrades", inv.numUpgrades ); + } + + for( int x = 0; x < length; x++ ) + { + final NBTTagCompound itemNBT = new NBTTagCompound(); + + final ItemStack is = inv.server.getStackInSlot( x + offset ); + + // "update" client side. + ItemHandlerUtil.setStackInSlot( inv.client, x + offset, is.isEmpty() ? ItemStack.EMPTY : is.copy() ); + + if( !is.isEmpty() ) + { + is.writeToNBT( itemNBT ); + } + + tag.setTag( Integer.toString( x + offset ), itemNBT ); + } + + data.setTag( name, tag ); + } + + private static class ConfigTracker + { + + private final long sortBy; + private final long which = autoBase++; + private final String unlocalizedName; + private final IItemHandler client; + private final IItemHandler server; + private final BlockPos pos; + private final int dim; + private final int numUpgrades; + + public ConfigTracker( final DualityInterface dual, final IItemHandler patterns, final String unlocalizedName ) + { + this.server = patterns; + this.client = new AppEngInternalInventory( null, this.server.getSlots() ); + this.unlocalizedName = unlocalizedName; + this.sortBy = dual.getSortValue(); + this.pos = dual.getLocation().getPos(); + this.dim = dual.getLocation().getWorld().provider.getDimension(); + this.numUpgrades = dual.getInstalledUpgrades( Upgrades.PATTERN_EXPANSION ); + } + } + + private static class PatternSlotFilter implements IAEItemFilter + { + @Override + public boolean allowExtract( IItemHandler inv, int slot, int amount ) + { + return true; + } + + @Override + public boolean allowInsert( IItemHandler inv, int slot, ItemStack stack ) + { + return !stack.isEmpty() && stack.getItem() instanceof ItemEncodedPattern; + } + } +} diff --git a/src/main/java/appeng/core/api/definitions/ApiParts.java b/src/main/java/appeng/core/api/definitions/ApiParts.java index f29205605..bd80fc901 100644 --- a/src/main/java/appeng/core/api/definitions/ApiParts.java +++ b/src/main/java/appeng/core/api/definitions/ApiParts.java @@ -80,6 +80,7 @@ public final class ApiParts implements IParts private final IItemDefinition interfaceTerminal; private final IItemDefinition patternTerminal; private final IItemDefinition expandedProcessingPatternTerminal; + private final IItemDefinition configuringInterfaceTerminal; private final IItemDefinition craftingTerminal; private final IItemDefinition terminal; private final IItemDefinition storageMonitor; @@ -142,6 +143,7 @@ public final class ApiParts implements IParts this.interfaceTerminal = new DamagedItemDefinition( "part.terminal.interface", itemPart.createPart( PartType.INTERFACE_TERMINAL ) ); this.patternTerminal = new DamagedItemDefinition( "part.terminal.pattern", itemPart.createPart( PartType.PATTERN_TERMINAL ) ); this.expandedProcessingPatternTerminal = new DamagedItemDefinition( "part.terminal.expanded_processing_pattern", itemPart.createPart( PartType.EXPANDED_PROCESSING_PATTERN_TERMINAL ) ); + this.configuringInterfaceTerminal = new DamagedItemDefinition( "part.terminal.configuring_interface_terminal", itemPart.createPart( PartType.CONFIGURING_INTERFACE_TERMINAL ) ); this.craftingTerminal = new DamagedItemDefinition( "part.terminal.crafting", itemPart.createPart( PartType.CRAFTING_TERMINAL ) ); this.terminal = new DamagedItemDefinition( "part.terminal", itemPart.createPart( PartType.TERMINAL ) ); this.storageMonitor = new DamagedItemDefinition( "part.monitor.storage", itemPart.createPart( PartType.STORAGE_MONITOR ) ); diff --git a/src/main/java/appeng/core/sync/GuiBridge.java b/src/main/java/appeng/core/sync/GuiBridge.java index a16b26bd6..d27da3d48 100644 --- a/src/main/java/appeng/core/sync/GuiBridge.java +++ b/src/main/java/appeng/core/sync/GuiBridge.java @@ -23,7 +23,7 @@ import java.lang.reflect.Constructor; import appeng.container.implementations.*; import appeng.parts.misc.PartOreDicStorageBus; -import appeng.parts.reporting.PartExpandedProcessingPatternTerminal; +import appeng.parts.reporting.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -74,9 +74,6 @@ import appeng.items.contents.QuartzKnifeObj; import appeng.parts.automation.PartFormationPlane; import appeng.parts.automation.PartLevelEmitter; import appeng.parts.misc.PartStorageBus; -import appeng.parts.reporting.PartCraftingTerminal; -import appeng.parts.reporting.PartInterfaceTerminal; -import appeng.parts.reporting.PartPatternTerminal; import appeng.tile.crafting.TileCraftingTile; import appeng.tile.crafting.TileMolecularAssembler; import appeng.tile.grindstone.TileGrinder; @@ -180,7 +177,9 @@ public enum GuiBridge implements IGuiHandler GUI_INTERFACE_TERMINAL( ContainerInterfaceTerminal.class, PartInterfaceTerminal.class, GuiHostType.WORLD, SecurityPermissions.BUILD ), - GUI_CRAFTING_STATUS( ContainerCraftingStatus.class, ITerminalHost.class, GuiHostType.ITEM_OR_WORLD, SecurityPermissions.CRAFT ); + GUI_CRAFTING_STATUS( ContainerCraftingStatus.class, ITerminalHost.class, GuiHostType.ITEM_OR_WORLD, SecurityPermissions.CRAFT ), + + GUI_CONFIG_INTERFACE_TERMINAL( ContainerConfiguringTerminal.class, PartConfiguringTerminal.class, GuiHostType.WORLD, SecurityPermissions.BUILD ); private final Class tileClass; private final Class containerClass; @@ -343,7 +342,7 @@ public enum GuiBridge implements IGuiHandler if( target == null ) { throw new IllegalStateException( "Cannot find " + this.containerClass.getName() + "( " + this.typeName( inventory ) + ", " + this - .typeName( tE ) + " )" ); + .typeName( tE ) + " )" ); } return target.newInstance( inventory, tE ); @@ -441,7 +440,7 @@ public enum GuiBridge implements IGuiHandler if( target == null ) { throw new IllegalStateException( "Cannot find " + this.containerClass.getName() + "( " + this.typeName( inventory ) + ", " + this - .typeName( tE ) + " )" ); + .typeName( tE ) + " )" ); } return target.newInstance( inventory, tE ); diff --git a/src/main/java/appeng/items/parts/PartType.java b/src/main/java/appeng/items/parts/PartType.java index 295668606..1bb8400c7 100644 --- a/src/main/java/appeng/items/parts/PartType.java +++ b/src/main/java/appeng/items/parts/PartType.java @@ -284,7 +284,8 @@ public enum PartType INTERFACE_TERMINAL( 480, "interface_terminal", EnumSet.of( AEFeature.INTERFACE_TERMINAL ), EnumSet.noneOf( IntegrationType.class ), PartInterfaceTerminal.class ), - FLUID_TERMINAL( 520, "fluid_terminal", EnumSet.of( AEFeature.FLUID_TERMINAL ), EnumSet.noneOf( IntegrationType.class ), PartFluidTerminal.class ); + FLUID_TERMINAL( 520, "fluid_terminal", EnumSet.of( AEFeature.FLUID_TERMINAL ), EnumSet.noneOf( IntegrationType.class ), PartFluidTerminal.class ), + CONFIGURING_INTERFACE_TERMINAL( 521, "configuring_interface_terminal", EnumSet.of( AEFeature.INTERFACE_TERMINAL ), EnumSet.noneOf( IntegrationType.class ), PartConfiguringTerminal.class ); private final int baseDamage; private final Set features; diff --git a/src/main/java/appeng/parts/reporting/PartConfiguringTerminal.java b/src/main/java/appeng/parts/reporting/PartConfiguringTerminal.java new file mode 100644 index 000000000..15d156fc2 --- /dev/null +++ b/src/main/java/appeng/parts/reporting/PartConfiguringTerminal.java @@ -0,0 +1,77 @@ +/* + * This file is part of Applied Energistics 2. + * Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved. + * + * Applied Energistics 2 is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Applied Energistics 2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Applied Energistics 2. If not, see . + */ + +package appeng.parts.reporting; + + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumHand; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.Vec3d; + +import appeng.api.parts.IPartModel; +import appeng.core.AppEng; +import appeng.core.sync.GuiBridge; +import appeng.items.parts.PartModels; +import appeng.parts.PartModel; +import appeng.util.Platform; + + +public class PartConfiguringTerminal extends AbstractPartDisplay +{ + + @PartModels + public static final ResourceLocation MODEL_OFF = new ResourceLocation( AppEng.MOD_ID, "part/interface_terminal_off" ); + @PartModels + public static final ResourceLocation MODEL_ON = new ResourceLocation( AppEng.MOD_ID, "part/interface_terminal_on" ); + + public static final IPartModel MODELS_OFF = new PartModel( MODEL_BASE, MODEL_OFF, MODEL_STATUS_OFF ); + public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_ON ); + public static final IPartModel MODELS_HAS_CHANNEL = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL ); + public String in = ""; + + public PartConfiguringTerminal( final ItemStack is ) + { + super( is ); + } + + @Override + public boolean onPartActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos ) + { + if( !super.onPartActivate( player, hand, pos ) ) + { + if( Platform.isServer() ) + { + Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_CONFIG_INTERFACE_TERMINAL ); + } + } + return true; + } + + @Override + public IPartModel getStaticModels() + { + return this.selectModel( MODELS_OFF, MODELS_ON, MODELS_HAS_CHANNEL ); + } + + public void saveSearchStrings( String in ) + { + this.in = in; + } +} From 119cdbc2c0e4a44309e1547ab230effe4bdb5ed2 Mon Sep 17 00:00:00 2001 From: PrototypeTrousers Date: Thu, 11 Aug 2022 03:19:13 -0300 Subject: [PATCH 2/4] missing JEI ghost support --- .../java/appeng/client/gui/AEBaseGui.java | 17 ++- .../GuiConfiguringTerminal.java | 123 +++++---------- .../appeng/client/me/ClientDCInternalInv.java | 8 + .../ContainerConfiguringTerminal.java | 140 +++++------------- .../appeng/core/localization/GuiText.java | 1 + .../sync/packets/PacketCompressedNBT.java | 5 + .../appliedenergistics2/lang/en_us.lang | 1 + 7 files changed, 100 insertions(+), 195 deletions(-) diff --git a/src/main/java/appeng/client/gui/AEBaseGui.java b/src/main/java/appeng/client/gui/AEBaseGui.java index c58a7caa9..5d0fc7141 100644 --- a/src/main/java/appeng/client/gui/AEBaseGui.java +++ b/src/main/java/appeng/client/gui/AEBaseGui.java @@ -474,7 +474,15 @@ public abstract class AEBaseGui extends GuiContainer implements IMTModGuiContain { if( slot.getStack().isEmpty() ) { - InventoryAction action = InventoryAction.SPLIT_OR_PLACE_SINGLE; + InventoryAction action; + if( slot.getSlotStackLimit() == 1 ) + { + action = InventoryAction.SPLIT_OR_PLACE_SINGLE; + } + else + { + action = InventoryAction.PICKUP_OR_SET_DOWN; + } final PacketInventoryAction p = new PacketInventoryAction( action, slot.getSlotIndex(), ( (SlotDisconnected) slot ).getSlot().getId() ); NetworkHandler.instance().sendToServer( p ); } @@ -640,14 +648,13 @@ public abstract class AEBaseGui extends GuiContainer implements IMTModGuiContain switch ( clickType ) { case PICKUP: // pickup / set-down. - if( slot.getStack().isEmpty() && !player.inventory.getItemStack().isEmpty() ) + if( mouseButton == 1 ) { action = InventoryAction.SPLIT_OR_PLACE_SINGLE; } - if( !slot.getStack().isEmpty() && player.inventory.getItemStack().getCount() <= 1 ) + else { action = InventoryAction.PICKUP_OR_SET_DOWN; - this.haltDragging = true; } break; case QUICK_MOVE: @@ -861,7 +868,7 @@ public abstract class AEBaseGui extends GuiContainer implements IMTModGuiContain } } - private void mouseWheelEvent( final int x, final int y, final int wheel ) + protected void mouseWheelEvent( final int x, final int y, final int wheel ) { final Slot slot = this.getSlot( x, y ); if( slot instanceof SlotME ) diff --git a/src/main/java/appeng/client/gui/implementations/GuiConfiguringTerminal.java b/src/main/java/appeng/client/gui/implementations/GuiConfiguringTerminal.java index d8971bb67..0159237a3 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiConfiguringTerminal.java +++ b/src/main/java/appeng/client/gui/implementations/GuiConfiguringTerminal.java @@ -25,10 +25,17 @@ import java.util.*; import appeng.api.config.ActionItems; import appeng.api.config.Settings; import appeng.api.config.Upgrades; +import appeng.api.storage.data.IAEItemStack; import appeng.client.gui.widgets.GuiImgButton; +import appeng.client.me.SlotME; +import appeng.container.AEBaseContainer; import appeng.container.implementations.ContainerConfiguringTerminal; +import appeng.container.slot.SlotFake; +import appeng.core.sync.network.NetworkHandler; +import appeng.core.sync.packets.PacketInventoryAction; import appeng.core.worlddata.IWorldPlayerMapping; import appeng.helpers.DualityInterface; +import appeng.helpers.InventoryAction; import appeng.parts.misc.PartInterface; import appeng.parts.reporting.PartConfiguringTerminal; import appeng.tile.inventory.AppEngInternalInventory; @@ -39,6 +46,7 @@ import com.google.common.collect.HashMultimap; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; @@ -84,11 +92,8 @@ public class GuiConfiguringTerminal extends AEBaseGui private final Map> cachedSearches = new WeakHashMap<>(); private boolean refreshList = false; - private MEGuiTextField searchFieldOutputs; private MEGuiTextField searchFieldInputs; private PartConfiguringTerminal partInterfaceTerminal; - private GuiButton guiButtonHide; - private GuiButton guiButtonNextAssembler; private HashMap dimHashMap = new HashMap<>(); public GuiConfiguringTerminal( final InventoryPlayer inventoryPlayer, final PartConfiguringTerminal te ) @@ -118,13 +123,6 @@ public class GuiConfiguringTerminal extends AEBaseGui this.searchFieldInputs.setVisible( true ); this.searchFieldInputs.setFocused( false ); - this.searchFieldOutputs = new MEGuiTextField( this.fontRenderer, this.guiLeft + Math.max( 32, this.offsetX ), this.guiTop + 38, 65, 12 ); - this.searchFieldOutputs.setEnableBackgroundDrawing( false ); - this.searchFieldOutputs.setMaxStringLength( 25 ); - this.searchFieldOutputs.setTextColor( 0xFFFFFF ); - this.searchFieldOutputs.setVisible( true ); - this.searchFieldOutputs.setFocused( true ); - this.searchFieldInputs.setText( partInterfaceTerminal.in ); } @@ -140,7 +138,7 @@ public class GuiConfiguringTerminal extends AEBaseGui { this.buttonList.clear(); - this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.InterfaceTerminal.getLocal() ), 8, 6, 4210752 ); + this.fontRenderer.drawString( this.getGuiDisplayName( GuiText.InterfaceConfigurationTerminal.getLocal() ), 8, 6, 4210752 ); this.fontRenderer.drawString( GuiText.inventory.getLocal(), this.offsetX + 2, this.ySize - 96 + 3, 4210752 ); final int currentScroll = this.getScrollBar().getCurrentScroll(); @@ -198,11 +196,6 @@ public class GuiConfiguringTerminal extends AEBaseGui { drawTooltip( Mouse.getEventX() * this.width / this.mc.displayWidth - offsetX, mouseY - guiTop, "Inputs OR names" ); } - else if( searchFieldOutputs.isMouseIn( mouseX, mouseY ) ) - { - drawTooltip( Mouse.getEventX() * this.width / this.mc.displayWidth - offsetX, mouseY - guiTop, "Outputs OR names" ); - } - } @Override @@ -216,14 +209,6 @@ public class GuiConfiguringTerminal extends AEBaseGui this.refreshList(); } - this.searchFieldOutputs.mouseClicked( xCoord, yCoord, btn ); - - if( btn == 1 && this.searchFieldOutputs.isMouseIn( xCoord, yCoord ) ) - { - this.searchFieldOutputs.setText( "" ); - this.refreshList(); - } - super.mouseClicked( xCoord, yCoord, btn ); } @@ -256,6 +241,26 @@ public class GuiConfiguringTerminal extends AEBaseGui } } + @Override + protected void mouseWheelEvent( final int x, final int y, final int wheel ) + { + final Slot slot = this.getSlot( x, y ); + if( slot instanceof SlotDisconnected ) + { + final ItemStack stack = slot.getStack(); + if( stack != ItemStack.EMPTY ) + { + InventoryAction direction = wheel > 0 ? InventoryAction.PLACE_SINGLE : InventoryAction.PICKUP_SINGLE; + final PacketInventoryAction p = new PacketInventoryAction( direction, slot.getSlotIndex(), ( (SlotDisconnected) slot ).getSlot().getId() ); + NetworkHandler.instance().sendToServer( p ); + } + } + else + { + super.mouseWheelEvent( x, y, wheel ); + } + } + @Override public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { @@ -293,11 +298,6 @@ public class GuiConfiguringTerminal extends AEBaseGui { this.searchFieldInputs.drawTextBox(); } - - if( this.searchFieldOutputs != null ) - { - this.searchFieldOutputs.drawTextBox(); - } } @Override @@ -310,12 +310,7 @@ public class GuiConfiguringTerminal extends AEBaseGui return; } - if( character == ' ' && this.searchFieldOutputs.getText().isEmpty() && this.searchFieldOutputs.isFocused() ) - { - return; - } - - if( this.searchFieldInputs.textboxKeyTyped( character, key ) || this.searchFieldOutputs.textboxKeyTyped( character, key ) ) + if( this.searchFieldInputs.textboxKeyTyped( character, key ) ) { this.refreshList(); } @@ -385,7 +380,6 @@ public class GuiConfiguringTerminal extends AEBaseGui this.matchedStacks.clear(); final String searchFieldInputs = this.searchFieldInputs.getText().toLowerCase(); - final String searchFieldOutputs = this.searchFieldOutputs.getText().toLowerCase(); final Set cachedSearch = this.getCacheForSearchTerm( searchFieldInputs ); final boolean rebuild = cachedSearch.isEmpty(); @@ -400,8 +394,7 @@ public class GuiConfiguringTerminal extends AEBaseGui // Shortcut to skip any filter if search term is ""/empty - boolean found = ( searchFieldInputs.isEmpty() && searchFieldOutputs.isEmpty() ); - boolean interfaceHasFreeSlots = false; + boolean found = searchFieldInputs.isEmpty(); // Search if the current inventory holds a pattern containing the search term. if( !found ) @@ -413,46 +406,19 @@ public class GuiConfiguringTerminal extends AEBaseGui { break; } - if( !searchFieldInputs.isEmpty() && !searchFieldOutputs.isEmpty() ) + if( this.itemStackMatchesSearchTerm( itemStack, searchFieldInputs ) ) { - if( this.itemStackMatchesSearchTerm( itemStack, searchFieldInputs, 0 ) || this.itemStackMatchesSearchTerm( itemStack, searchFieldOutputs, 1 ) ) - { - found = true; - matchedStacks.add( itemStack ); - } - } - else if( !searchFieldInputs.isEmpty() ) - { - if( this.itemStackMatchesSearchTerm( itemStack, searchFieldInputs, 0 ) ) - { - found = true; - matchedStacks.add( itemStack ); - } - } - else if( !searchFieldOutputs.isEmpty() ) - { - if( this.itemStackMatchesSearchTerm( itemStack, searchFieldOutputs, 1 ) ) - { - found = true; - matchedStacks.add( itemStack ); - } - } - // If only Interfaces with empty slots should be shown, check that here - if( itemStack.isEmpty() ) - { - interfaceHasFreeSlots = true; + found = true; + matchedStacks.add( itemStack ); } slot++; } } // if found, filter skipped or machine name matching the search term, add it - if( found || ( entry.getName().toLowerCase().contains( searchFieldInputs ) && entry.getName().toLowerCase().contains( searchFieldOutputs ) ) ) + if( found || entry.getName().toLowerCase().contains( searchFieldInputs ) ) { - if( interfaceHasFreeSlots ) - { - this.byName.put( entry.getName(), entry ); - cachedSearch.add( entry ); - } + this.byName.put( entry.getName(), entry ); + cachedSearch.add( entry ); } else { @@ -482,7 +448,7 @@ public class GuiConfiguringTerminal extends AEBaseGui this.getScrollBar().setRange( 0, this.lines.size() - 1, 1 ); } - private boolean itemStackMatchesSearchTerm( final ItemStack itemStack, final String searchTerm, int pass ) + private boolean itemStackMatchesSearchTerm( final ItemStack itemStack, final String searchTerm ) { if( itemStack.isEmpty() ) { @@ -496,16 +462,7 @@ public class GuiConfiguringTerminal extends AEBaseGui return false; } - NBTTagList tag = new NBTTagList(); - - if( pass == 0 ) - { - tag = encodedValue.getTagList( "in", 10 ); - } - else - { - tag = encodedValue.getTagList( "out", 10 ); - } + NBTTagList tag = encodedValue.getTagList( "in", 10 ); boolean foundMatchingItemStack = false; @@ -581,7 +538,7 @@ public class GuiConfiguringTerminal extends AEBaseGui if( o == null ) { - this.byId.put( id, o = new ClientDCInternalInv( DualityInterface.NUMBER_OF_PATTERN_SLOTS, id, sortBy, string ) ); + this.byId.put( id, o = new ClientDCInternalInv( DualityInterface.NUMBER_OF_CONFIG_SLOTS, id, sortBy, string, 64 ) ); this.refreshList = true; } diff --git a/src/main/java/appeng/client/me/ClientDCInternalInv.java b/src/main/java/appeng/client/me/ClientDCInternalInv.java index d3d3e2344..61aab235b 100644 --- a/src/main/java/appeng/client/me/ClientDCInternalInv.java +++ b/src/main/java/appeng/client/me/ClientDCInternalInv.java @@ -43,6 +43,14 @@ public class ClientDCInternalInv implements Comparable this.sortBy = sortBy; } + public ClientDCInternalInv( final int size, final long id, final long sortBy, final String unlocalizedName, int stackSize ) + { + this.inventory = new AppEngInternalInventory( null, size, stackSize ); + this.unlocalizedName = unlocalizedName; + this.id = id; + this.sortBy = sortBy; + } + public String getName() { final String s = I18n.translateToLocal( this.unlocalizedName + ".name" ); diff --git a/src/main/java/appeng/container/implementations/ContainerConfiguringTerminal.java b/src/main/java/appeng/container/implementations/ContainerConfiguringTerminal.java index 159f7d7eb..102cd6dee 100644 --- a/src/main/java/appeng/container/implementations/ContainerConfiguringTerminal.java +++ b/src/main/java/appeng/container/implementations/ContainerConfiguringTerminal.java @@ -24,7 +24,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; -import appeng.api.config.Upgrades; import appeng.parts.reporting.PartConfiguringTerminal; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; @@ -45,9 +44,7 @@ import appeng.core.sync.packets.PacketCompressedNBT; import appeng.helpers.DualityInterface; import appeng.helpers.IInterfaceHost; import appeng.helpers.InventoryAction; -import appeng.items.misc.ItemEncodedPattern; import appeng.parts.misc.PartInterface; -import appeng.parts.reporting.PartInterfaceTerminal; import appeng.tile.inventory.AppEngInternalInventory; import appeng.tile.misc.TileInterface; import appeng.util.InventoryAdaptor; @@ -55,7 +52,6 @@ import appeng.util.Platform; import appeng.util.helpers.ItemHandlerUtil; import appeng.util.inv.AdaptorItemHandler; import appeng.util.inv.WrapperCursorItemHandler; -import appeng.util.inv.WrapperFilteredItemHandler; import appeng.util.inv.WrapperRangeItemHandler; import appeng.util.inv.filter.IAEItemFilter; @@ -214,119 +210,67 @@ public final class ContainerConfiguringTerminal extends AEBaseContainer final InventoryAdaptor playerHand = new AdaptorItemHandler( new WrapperCursorItemHandler( player.inventory ) ); - final IItemHandler theSlot = new WrapperFilteredItemHandler( new WrapperRangeItemHandler( inv.server, slot, slot + 1 ), new PatternSlotFilter() ); + final IItemHandler theSlot = new WrapperRangeItemHandler( inv.server, slot, slot + 1 ); final InventoryAdaptor interfaceSlot = new AdaptorItemHandler( theSlot ); - IItemHandler interfaceHandler = inv.server; - boolean canInsert = true; + ItemStack inSlot = theSlot.getStackInSlot( 0 ); switch ( action ) { case PICKUP_OR_SET_DOWN: if( hasItemInHand ) { - for( int s = 0; s < interfaceHandler.getSlots(); s++ ) - { - if( Platform.itemComparisons().isSameItem( interfaceHandler.getStackInSlot( s ), player.inventory.getItemStack() ) ) - { - canInsert = false; - break; - } - } - if( canInsert ) - { - ItemStack inSlot = theSlot.getStackInSlot( 0 ); - if( inSlot.isEmpty() ) - { - player.inventory.setItemStack( interfaceSlot.addItems( player.inventory.getItemStack() ) ); - } - else - { - inSlot = inSlot.copy(); - final ItemStack inHand = player.inventory.getItemStack().copy(); - - ItemHandlerUtil.setStackInSlot( theSlot, 0, ItemStack.EMPTY ); - player.inventory.setItemStack( ItemStack.EMPTY ); - - player.inventory.setItemStack( interfaceSlot.addItems( inHand.copy() ) ); - - if( player.inventory.getItemStack().isEmpty() ) - { - player.inventory.setItemStack( inSlot ); - } - else - { - player.inventory.setItemStack( inHand ); - ItemHandlerUtil.setStackInSlot( theSlot, 0, inSlot ); - } - } - } + ItemHandlerUtil.setStackInSlot( theSlot, 0, player.inventory.getItemStack().copy() ); } else { - ItemHandlerUtil.setStackInSlot( theSlot, 0, playerHand.addItems( theSlot.getStackInSlot( 0 ) ) ); + ItemHandlerUtil.setStackInSlot( theSlot, 0, ItemStack.EMPTY ); + } + break; + case PLACE_SINGLE: + if( inSlot.getMaxStackSize() > inSlot.getCount() ) + { + inSlot.grow( 1 ); + ItemHandlerUtil.setStackInSlot( theSlot, 0, inSlot ); + } + break; + case PICKUP_SINGLE: + if( theSlot.getStackInSlot( 0 ).getCount() > 1 ) + { + inSlot.shrink( 1 ); + ItemHandlerUtil.setStackInSlot( theSlot, 0, inSlot ); } - break; case SPLIT_OR_PLACE_SINGLE: if( hasItemInHand ) { - for( int s = 0; s < interfaceHandler.getSlots(); s++ ) + if( ItemStack.areItemsEqual( inSlot, player.inventory.getItemStack() ) && ItemStack.areItemStackTagsEqual( inSlot, player.inventory.getItemStack() ) ) { - if( Platform.itemComparisons().isSameItem( interfaceHandler.getStackInSlot( s ), player.inventory.getItemStack() ) ) - { - canInsert = false; - break; - } + inSlot.grow( 1 ); + ItemHandlerUtil.setStackInSlot( theSlot, 0, inSlot.copy() ); } - if( canInsert ) + else { - ItemStack extra = playerHand.removeItems( 1, ItemStack.EMPTY, null ); - if( !extra.isEmpty() && !interfaceSlot.containsItems() ) - { - extra = interfaceSlot.addItems( extra ); - } - if( !extra.isEmpty() ) - { - playerHand.addItems( extra ); - } + ItemHandlerUtil.setStackInSlot( theSlot, 0, player.inventory.getItemStack().copy() ); } + } else if( !is.isEmpty() ) { - ItemStack extra = interfaceSlot.removeItems( ( is.getCount() + 1 ) / 2, ItemStack.EMPTY, null ); - if( !extra.isEmpty() ) - { - extra = playerHand.addItems( extra ); - } - if( !extra.isEmpty() ) - { - interfaceSlot.addItems( extra ); - } + inSlot.shrink( 1 ); + ItemHandlerUtil.setStackInSlot( theSlot, 0, inSlot.copy() ); } break; case SHIFT_CLICK: - - final InventoryAdaptor playerInv = InventoryAdaptor.getAdaptor( player ); - - ItemHandlerUtil.setStackInSlot( theSlot, 0, playerInv.addItems( theSlot.getStackInSlot( 0 ) ) ); - + ItemHandlerUtil.setStackInSlot( theSlot, 0, ItemStack.EMPTY ); break; - case MOVE_REGION: - final InventoryAdaptor playerInvAd = InventoryAdaptor.getAdaptor( player ); - for( int x = 0; x < inv.server.getSlots(); x++ ) - { - ItemHandlerUtil.setStackInSlot( inv.server, x, playerInvAd.addItems( inv.server.getStackInSlot( x ) ) ); - } - - break; case CREATIVE_DUPLICATE: - if( player.capabilities.isCreativeMode && !hasItemInHand ) + if( player.capabilities.isCreativeMode && hasItemInHand ) { - player.inventory.setItemStack( is.isEmpty() ? ItemStack.EMPTY : is.copy() ); + ItemHandlerUtil.setStackInSlot( theSlot, 0, player.inventory.getItemStack().copy() ); } break; @@ -355,7 +299,7 @@ public final class ContainerConfiguringTerminal extends AEBaseContainer final DualityInterface dual = ih.getInterfaceDuality(); if( gn.isActive() && dual.getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.YES ) { - this.diList.put( ih, new ConfigTracker( dual, dual.getPatterns(), dual.getTermName() ) ); + this.diList.put( ih, new ConfigTracker( dual, dual.getConfig(), dual.getTermName() ) ); } } @@ -365,7 +309,7 @@ public final class ContainerConfiguringTerminal extends AEBaseContainer final DualityInterface dual = ih.getInterfaceDuality(); if( gn.isActive() && dual.getConfigManager().getSetting( Settings.INTERFACE_TERMINAL ) == YesNo.YES ) { - this.diList.put( ih, new ConfigTracker( dual, dual.getPatterns(), dual.getTermName() ) ); + this.diList.put( ih, new ConfigTracker( dual, dual.getConfig(), dual.getTermName() ) ); } } } @@ -407,7 +351,6 @@ public final class ContainerConfiguringTerminal extends AEBaseContainer tag.setString( "un", inv.unlocalizedName ); tag.setTag( "pos", NBTUtil.createPosTag( inv.pos ) ); tag.setInteger( "dim", inv.dim ); - tag.setInteger( "numUpgrades", inv.numUpgrades ); } for( int x = 0; x < length; x++ ) @@ -440,32 +383,15 @@ public final class ContainerConfiguringTerminal extends AEBaseContainer private final IItemHandler server; private final BlockPos pos; private final int dim; - private final int numUpgrades; - public ConfigTracker( final DualityInterface dual, final IItemHandler patterns, final String unlocalizedName ) + public ConfigTracker( final DualityInterface dual, final IItemHandler configSlots, final String unlocalizedName ) { - this.server = patterns; + this.server = configSlots; this.client = new AppEngInternalInventory( null, this.server.getSlots() ); this.unlocalizedName = unlocalizedName; this.sortBy = dual.getSortValue(); this.pos = dual.getLocation().getPos(); this.dim = dual.getLocation().getWorld().provider.getDimension(); - this.numUpgrades = dual.getInstalledUpgrades( Upgrades.PATTERN_EXPANSION ); - } - } - - private static class PatternSlotFilter implements IAEItemFilter - { - @Override - public boolean allowExtract( IItemHandler inv, int slot, int amount ) - { - return true; - } - - @Override - public boolean allowInsert( IItemHandler inv, int slot, ItemStack stack ) - { - return !stack.isEmpty() && stack.getItem() instanceof ItemEncodedPattern; } } } diff --git a/src/main/java/appeng/core/localization/GuiText.java b/src/main/java/appeng/core/localization/GuiText.java index 5c62f4063..db0b7b830 100644 --- a/src/main/java/appeng/core/localization/GuiText.java +++ b/src/main/java/appeng/core/localization/GuiText.java @@ -172,6 +172,7 @@ public enum GuiText Missing, InterfaceTerminal, + InterfaceConfigurationTerminal, NoCraftingCPUs, Clean, InvalidPattern, diff --git a/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java b/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java index 5a547555b..c89c6433d 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java +++ b/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java @@ -27,6 +27,7 @@ import java.io.OutputStream; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; +import appeng.client.gui.implementations.GuiConfiguringTerminal; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; @@ -113,5 +114,9 @@ public class PacketCompressedNBT extends AppEngPacket { ( (GuiInterfaceTerminal) gs ).postUpdate( this.in ); } + else if( gs instanceof GuiConfiguringTerminal ) + { + ( (GuiConfiguringTerminal) gs ).postUpdate( this.in ); + } } } diff --git a/src/main/resources/assets/appliedenergistics2/lang/en_us.lang b/src/main/resources/assets/appliedenergistics2/lang/en_us.lang index 1431f66a5..64732d60f 100644 --- a/src/main/resources/assets/appliedenergistics2/lang/en_us.lang +++ b/src/main/resources/assets/appliedenergistics2/lang/en_us.lang @@ -168,6 +168,7 @@ gui.appliedenergistics2.StoredFluids=Stored Fluids gui.appliedenergistics2.Terminal=Terminal gui.appliedenergistics2.InterfaceTerminal=Interface Terminal gui.appliedenergistics2.InterfaceTerminalHint=Show Or Hide on Interface Terminal. +gui.appliedenergistics2.InterfaceConfigurationTerminal=Interface Configuration Terminal gui.appliedenergistics2.FormationPlane=Formation Plane gui.appliedenergistics2.FluidFormationPlane=Fluid Formation Plane gui.appliedenergistics2.VibrationChamber=Vibration Chamber From 40caeec92f1c123e65ebd142ae0653740947d267 Mon Sep 17 00:00:00 2001 From: PrototypeTrousers Date: Thu, 11 Aug 2022 04:05:45 -0300 Subject: [PATCH 3/4] JEI Ghost items work, missing some click interactions and GUI work --- .../GuiConfiguringTerminal.java | 58 +++++++++++++- .../appeng/client/me/SlotDisconnected.java | 3 +- .../ContainerConfiguringTerminal.java | 20 +++-- .../sync/packets/PacketInventoryAction.java | 77 +++++++++++++------ 4 files changed, 126 insertions(+), 32 deletions(-) diff --git a/src/main/java/appeng/client/gui/implementations/GuiConfiguringTerminal.java b/src/main/java/appeng/client/gui/implementations/GuiConfiguringTerminal.java index 0159237a3..9bfc99b2d 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiConfiguringTerminal.java +++ b/src/main/java/appeng/client/gui/implementations/GuiConfiguringTerminal.java @@ -19,8 +19,10 @@ package appeng.client.gui.implementations; +import java.awt.*; import java.io.IOException; import java.util.*; +import java.util.List; import appeng.api.config.ActionItems; import appeng.api.config.Settings; @@ -30,6 +32,7 @@ import appeng.client.gui.widgets.GuiImgButton; import appeng.client.me.SlotME; import appeng.container.AEBaseContainer; import appeng.container.implementations.ContainerConfiguringTerminal; +import appeng.container.interfaces.IJEIGhostIngredients; import appeng.container.slot.SlotFake; import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.packets.PacketInventoryAction; @@ -41,8 +44,10 @@ import appeng.parts.reporting.PartConfiguringTerminal; import appeng.tile.inventory.AppEngInternalInventory; import appeng.tile.misc.TileInterface; import appeng.util.BlockPosUtils; +import appeng.util.item.AEItemStack; import com.google.common.collect.HashMultimap; +import mezz.jei.api.gui.IGhostIngredientHandler; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.InventoryPlayer; @@ -72,7 +77,7 @@ import org.lwjgl.input.Mouse; import static appeng.client.render.BlockPosHighlighter.hilightBlock; -public class GuiConfiguringTerminal extends AEBaseGui +public class GuiConfiguringTerminal extends AEBaseGui implements IJEIGhostIngredients { private static final int LINES_ON_PAGE = 6; @@ -95,6 +100,7 @@ public class GuiConfiguringTerminal extends AEBaseGui private MEGuiTextField searchFieldInputs; private PartConfiguringTerminal partInterfaceTerminal; private HashMap dimHashMap = new HashMap<>(); + public Map, Object> mapTargetSlot = new HashMap<>(); public GuiConfiguringTerminal( final InventoryPlayer inventoryPlayer, final PartConfiguringTerminal te ) { @@ -544,4 +550,54 @@ public class GuiConfiguringTerminal extends AEBaseGui return o; } + + @Override + public List> getPhantomTargets( Object ingredient ) + { + if( !( ingredient instanceof ItemStack ) ) + { + return Collections.emptyList(); + } + List> targets = new ArrayList<>(); + for( Slot slot : this.inventorySlots.inventorySlots ) + { + if( slot instanceof SlotDisconnected ) + { + ItemStack itemStack = (ItemStack) ingredient; + IGhostIngredientHandler.Target target = new IGhostIngredientHandler.Target() + { + @Override + public Rectangle getArea() + { + return new Rectangle( getGuiLeft() + slot.xPos, getGuiTop() + slot.yPos, 16, 16 ); + } + + @Override + public void accept( Object ingredient ) + { + final PacketInventoryAction p; + try + { + p = new PacketInventoryAction( InventoryAction.PLACE_JEI_GHOST_ITEM, (SlotDisconnected) slot, AEItemStack.fromItemStack( itemStack ) ); + NetworkHandler.instance().sendToServer( p ); + + } + catch( IOException e ) + { + e.printStackTrace(); + } + } + }; + targets.add( target ); + mapTargetSlot.putIfAbsent( target, slot ); + } + } + return targets; + } + + @Override + public Map, Object> getFakeSlotTargetMap() + { + return IJEIGhostIngredients.super.getFakeSlotTargetMap(); + } } diff --git a/src/main/java/appeng/client/me/SlotDisconnected.java b/src/main/java/appeng/client/me/SlotDisconnected.java index fdc283d45..a2e7b1020 100644 --- a/src/main/java/appeng/client/me/SlotDisconnected.java +++ b/src/main/java/appeng/client/me/SlotDisconnected.java @@ -19,6 +19,7 @@ package appeng.client.me; +import appeng.container.slot.IJEITargetSlot; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -28,7 +29,7 @@ import appeng.items.misc.ItemEncodedPattern; import appeng.util.Platform; -public class SlotDisconnected extends AppEngSlot +public class SlotDisconnected extends AppEngSlot implements IJEITargetSlot { private final ClientDCInternalInv mySlot; diff --git a/src/main/java/appeng/container/implementations/ContainerConfiguringTerminal.java b/src/main/java/appeng/container/implementations/ContainerConfiguringTerminal.java index 102cd6dee..06b07eecc 100644 --- a/src/main/java/appeng/container/implementations/ContainerConfiguringTerminal.java +++ b/src/main/java/appeng/container/implementations/ContainerConfiguringTerminal.java @@ -53,7 +53,6 @@ import appeng.util.helpers.ItemHandlerUtil; import appeng.util.inv.AdaptorItemHandler; import appeng.util.inv.WrapperCursorItemHandler; import appeng.util.inv.WrapperRangeItemHandler; -import appeng.util.inv.filter.IAEItemFilter; public final class ContainerConfiguringTerminal extends AEBaseContainer @@ -199,19 +198,19 @@ public final class ContainerConfiguringTerminal extends AEBaseContainer } } + public ConfigTracker getSlotByID( long id ) + { + return this.byId.get( id ); + } + @Override public void doAction( final EntityPlayerMP player, final InventoryAction action, final int slot, final long id ) { final ConfigTracker inv = this.byId.get( id ); if( inv != null ) { - final ItemStack is = inv.server.getStackInSlot( slot ); final boolean hasItemInHand = !player.inventory.getItemStack().isEmpty(); - - final InventoryAdaptor playerHand = new AdaptorItemHandler( new WrapperCursorItemHandler( player.inventory ) ); - final IItemHandler theSlot = new WrapperRangeItemHandler( inv.server, slot, slot + 1 ); - final InventoryAdaptor interfaceSlot = new AdaptorItemHandler( theSlot ); ItemStack inSlot = theSlot.getStackInSlot( 0 ); @@ -255,7 +254,7 @@ public final class ContainerConfiguringTerminal extends AEBaseContainer } } - else if( !is.isEmpty() ) + else if( !inSlot.isEmpty() ) { inSlot.shrink( 1 ); ItemHandlerUtil.setStackInSlot( theSlot, 0, inSlot.copy() ); @@ -373,7 +372,7 @@ public final class ContainerConfiguringTerminal extends AEBaseContainer data.setTag( name, tag ); } - private static class ConfigTracker + public static class ConfigTracker { private final long sortBy; @@ -393,5 +392,10 @@ public final class ContainerConfiguringTerminal extends AEBaseContainer this.pos = dual.getLocation().getPos(); this.dim = dual.getLocation().getWorld().provider.getDimension(); } + + public IItemHandler getServer() + { + return server; + } } } diff --git a/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java b/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java index 32d369245..150717f48 100644 --- a/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java +++ b/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java @@ -23,6 +23,9 @@ import java.io.IOException; import java.util.Collections; import appeng.api.storage.data.IAEFluidStack; +import appeng.client.me.SlotDisconnected; +import appeng.container.implementations.ContainerConfiguringTerminal; +import appeng.container.implementations.ContainerConfiguringTerminal.ConfigTracker; import appeng.container.slot.IJEITargetSlot; import appeng.container.slot.SlotFake; import appeng.core.AELog; @@ -30,11 +33,14 @@ import appeng.core.sync.network.NetworkHandler; import appeng.fluids.client.gui.widgets.GuiFluidSlot; import appeng.fluids.container.ContainerFluidConfigurable; import appeng.fluids.util.AEFluidStack; +import appeng.util.helpers.ItemHandlerUtil; +import appeng.util.inv.WrapperRangeItemHandler; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; @@ -50,6 +56,7 @@ import appeng.helpers.InventoryAction; import appeng.util.Platform; import appeng.util.item.AEItemStack; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.items.IItemHandler; public class PacketInventoryAction extends AppEngPacket @@ -111,14 +118,25 @@ public class PacketInventoryAction extends AppEngPacket this.configureWrite( data ); } - public PacketInventoryAction(final InventoryAction action, final IJEITargetSlot slot, final IAEItemStack slotItem ) throws IOException + public PacketInventoryAction( final InventoryAction action, final IJEITargetSlot slot, final IAEItemStack slotItem ) throws IOException { this.action = action; - if (slot instanceof SlotFake) - this.slot = ((SlotFake) slot).slotNumber; - else this.slot = ((GuiFluidSlot) slot).getId(); - this.id = 0; + if( slot instanceof SlotFake ) + { + this.slot = ( (SlotFake) slot ).slotNumber; + this.id = 0; + } + else if( slot instanceof SlotDisconnected ) + { + this.slot = ( (SlotDisconnected) slot ).getSlotIndex(); + this.id = ( (SlotDisconnected) slot ).getSlot().getId(); + } + else + { + this.slot = ( (GuiFluidSlot) slot ).getId(); + this.id = 0; + } this.slotItem = slotItem; final ByteBuf data = Unpooled.buffer(); @@ -205,29 +223,44 @@ public class PacketInventoryAction extends AppEngPacket } } } - else if( this.slot < sender.openContainer.inventorySlots.size() && sender.openContainer.inventorySlots.get( this.slot ) instanceof SlotFake ) + else if( sender.openContainer instanceof ContainerConfiguringTerminal ) { - if( this.slotItem != null ) + ConfigTracker inv = ( (ContainerConfiguringTerminal) sender.openContainer ).getSlotByID( this.id ); + final IItemHandler theSlot = new WrapperRangeItemHandler( inv.getServer(), 0, slot + 1 ); + + ItemHandlerUtil.setStackInSlot( theSlot, this.slot, this.slotItem.createItemStack() ); + + } + else if( this.slot < sender.openContainer.inventorySlots.size() ) + { + Slot senderSlot = sender.openContainer.inventorySlots.get( this.slot ); + if( senderSlot instanceof SlotFake ) { - sender.openContainer.inventorySlots.get( this.slot ).putStack( this.slotItem.createItemStack() ); - if( sender.openContainer.inventorySlots.get( this.slot ).getStack().isEmpty() ) + if( this.slotItem != null ) { - IAEFluidStack aefs = AEFluidStack.fromNBT( this.slotItem.getDefinition().getTagCompound() ); - if( aefs != null ) + senderSlot.putStack( this.slotItem.createItemStack() ); + if( senderSlot.getStack().isEmpty() ) { - FluidStack fluid = aefs.getFluidStack(); - sender.openContainer.inventorySlots.get( this.slot ).putStack( AEFluidStack.fromFluidStack( fluid ).asItemStackRepresentation() ); + IAEFluidStack aefs = AEFluidStack.fromNBT( this.slotItem.getDefinition().getTagCompound() ); + if( aefs != null ) + { + FluidStack fluid = aefs.getFluidStack(); + senderSlot.putStack( AEFluidStack.fromFluidStack( fluid ).asItemStackRepresentation() ); + } } } - } - else sender.openContainer.inventorySlots.get( this.slot ).putStack( ItemStack.EMPTY ); - try - { - NetworkHandler.instance().sendTo( new PacketInventoryAction( InventoryAction.UPDATE_HAND, 0, AEItemStack.fromItemStack( ItemStack.EMPTY ) ), sender ); - } - catch( final IOException e ) - { - AELog.debug( e ); + else + { + senderSlot.putStack( ItemStack.EMPTY ); + } + try + { + NetworkHandler.instance().sendTo( new PacketInventoryAction( InventoryAction.UPDATE_HAND, 0, AEItemStack.fromItemStack( ItemStack.EMPTY ) ), sender ); + } + catch( final IOException e ) + { + AELog.debug( e ); + } } } } From 104d6fc34d1018211d90d3876d4c15e8f34e833d Mon Sep 17 00:00:00 2001 From: PrototypeTrousers Date: Fri, 12 Aug 2022 23:01:35 -0300 Subject: [PATCH 4/4] Implement Interface Configuration Terminal --- ...=> GuiInterfaceConfigurationTerminal.java} | 82 ++++++------------ ...tainerInterfaceConfigurationTerminal.java} | 15 ++-- .../appeng/core/api/definitions/ApiParts.java | 4 +- src/main/java/appeng/core/sync/GuiBridge.java | 2 +- .../sync/packets/PacketCompressedNBT.java | 6 +- .../sync/packets/PacketInventoryAction.java | 8 +- .../java/appeng/items/parts/PartType.java | 2 +- ...> PartInterfaceConfigurationTerminal.java} | 10 +-- .../appliedenergistics2/lang/en_us.lang | 1 + .../interface_configuration_terminal.json | 9 ++ .../interface_configuration_terminal_off.json | 8 ++ .../interface_configuration_terminal_on.json | 76 ++++++++++++++++ .../terminals_interface_configuration.json | 19 ++++ ...minals_interface_configuration_revert.json | 19 ++++ .../guis/interfaceconfigurationterminal.png | Bin 0 -> 11891 bytes ...nterface_configuration_terminal_bright.png | Bin 0 -> 5123 bytes .../interface_configuration_terminal_dark.png | Bin 0 -> 205 bytes ...nterface_configuration_terminal_medium.png | Bin 0 -> 5092 bytes 18 files changed, 182 insertions(+), 79 deletions(-) rename src/main/java/appeng/client/gui/implementations/{GuiConfiguringTerminal.java => GuiInterfaceConfigurationTerminal.java} (88%) rename src/main/java/appeng/container/implementations/{ContainerConfiguringTerminal.java => ContainerInterfaceConfigurationTerminal.java} (95%) rename src/main/java/appeng/parts/reporting/{PartConfiguringTerminal.java => PartInterfaceConfigurationTerminal.java} (87%) create mode 100644 src/main/resources/assets/appliedenergistics2/models/item/part/interface_configuration_terminal.json create mode 100644 src/main/resources/assets/appliedenergistics2/models/part/interface_configuration_terminal_off.json create mode 100644 src/main/resources/assets/appliedenergistics2/models/part/interface_configuration_terminal_on.json create mode 100644 src/main/resources/assets/appliedenergistics2/recipes/network/parts/terminals_interface_configuration.json create mode 100644 src/main/resources/assets/appliedenergistics2/recipes/network/parts/terminals_interface_configuration_revert.json create mode 100644 src/main/resources/assets/appliedenergistics2/textures/guis/interfaceconfigurationterminal.png create mode 100644 src/main/resources/assets/appliedenergistics2/textures/parts/interface_configuration_terminal_bright.png create mode 100644 src/main/resources/assets/appliedenergistics2/textures/parts/interface_configuration_terminal_dark.png create mode 100644 src/main/resources/assets/appliedenergistics2/textures/parts/interface_configuration_terminal_medium.png diff --git a/src/main/java/appeng/client/gui/implementations/GuiConfiguringTerminal.java b/src/main/java/appeng/client/gui/implementations/GuiInterfaceConfigurationTerminal.java similarity index 88% rename from src/main/java/appeng/client/gui/implementations/GuiConfiguringTerminal.java rename to src/main/java/appeng/client/gui/implementations/GuiInterfaceConfigurationTerminal.java index 9bfc99b2d..11386a198 100644 --- a/src/main/java/appeng/client/gui/implementations/GuiConfiguringTerminal.java +++ b/src/main/java/appeng/client/gui/implementations/GuiInterfaceConfigurationTerminal.java @@ -26,23 +26,14 @@ import java.util.List; import appeng.api.config.ActionItems; import appeng.api.config.Settings; -import appeng.api.config.Upgrades; -import appeng.api.storage.data.IAEItemStack; import appeng.client.gui.widgets.GuiImgButton; -import appeng.client.me.SlotME; -import appeng.container.AEBaseContainer; -import appeng.container.implementations.ContainerConfiguringTerminal; +import appeng.container.implementations.ContainerInterfaceConfigurationTerminal; import appeng.container.interfaces.IJEIGhostIngredients; -import appeng.container.slot.SlotFake; import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.packets.PacketInventoryAction; -import appeng.core.worlddata.IWorldPlayerMapping; import appeng.helpers.DualityInterface; import appeng.helpers.InventoryAction; -import appeng.parts.misc.PartInterface; -import appeng.parts.reporting.PartConfiguringTerminal; -import appeng.tile.inventory.AppEngInternalInventory; -import appeng.tile.misc.TileInterface; +import appeng.parts.reporting.PartInterfaceConfigurationTerminal; import appeng.util.BlockPosUtils; import appeng.util.item.AEItemStack; import com.google.common.collect.HashMultimap; @@ -54,7 +45,6 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; import appeng.api.AEApi; import appeng.api.storage.channels.IItemStorageChannel; @@ -63,9 +53,7 @@ import appeng.client.gui.widgets.GuiScrollbar; import appeng.client.gui.widgets.MEGuiTextField; import appeng.client.me.ClientDCInternalInv; import appeng.client.me.SlotDisconnected; -import appeng.container.implementations.ContainerInterfaceTerminal; import appeng.core.localization.GuiText; -import appeng.parts.reporting.PartInterfaceTerminal; import appeng.util.Platform; import net.minecraft.nbt.NBTUtil; import net.minecraft.util.math.BlockPos; @@ -77,7 +65,7 @@ import org.lwjgl.input.Mouse; import static appeng.client.render.BlockPosHighlighter.hilightBlock; -public class GuiConfiguringTerminal extends AEBaseGui implements IJEIGhostIngredients +public class GuiInterfaceConfigurationTerminal extends AEBaseGui implements IJEIGhostIngredients { private static final int LINES_ON_PAGE = 6; @@ -98,19 +86,19 @@ public class GuiConfiguringTerminal extends AEBaseGui implements IJEIGhostIngred private boolean refreshList = false; private MEGuiTextField searchFieldInputs; - private PartConfiguringTerminal partInterfaceTerminal; + private PartInterfaceConfigurationTerminal partInterfaceTerminal; private HashMap dimHashMap = new HashMap<>(); public Map, Object> mapTargetSlot = new HashMap<>(); - public GuiConfiguringTerminal( final InventoryPlayer inventoryPlayer, final PartConfiguringTerminal te ) + public GuiInterfaceConfigurationTerminal( final InventoryPlayer inventoryPlayer, final PartInterfaceConfigurationTerminal te ) { - super( new ContainerConfiguringTerminal( inventoryPlayer, te ) ); + super( new ContainerInterfaceConfigurationTerminal( inventoryPlayer, te ) ); this.partInterfaceTerminal = te; final GuiScrollbar scrollbar = new GuiScrollbar(); this.setScrollBar( scrollbar ); this.xSize = 208; - this.ySize = 255; + this.ySize = 235; } @Override @@ -120,9 +108,9 @@ public class GuiConfiguringTerminal extends AEBaseGui implements IJEIGhostIngred this.getScrollBar().setLeft( 189 ); this.getScrollBar().setHeight( 106 ); - this.getScrollBar().setTop( 51 ); + this.getScrollBar().setTop( 31 ); - this.searchFieldInputs = new MEGuiTextField( this.fontRenderer, this.guiLeft + Math.max( 32, this.offsetX ), this.guiTop + 25, 65, 12 ); + this.searchFieldInputs = new MEGuiTextField( this.fontRenderer, this.guiLeft + Math.max( 32, this.offsetX ), this.guiTop + 17, 65, 12 ); this.searchFieldInputs.setEnableBackgroundDrawing( false ); this.searchFieldInputs.setMaxStringLength( 25 ); this.searchFieldInputs.setTextColor( 0xFFFFFF ); @@ -151,7 +139,7 @@ public class GuiConfiguringTerminal extends AEBaseGui implements IJEIGhostIngred this.inventorySlots.inventorySlots.removeIf( slot -> slot instanceof SlotDisconnected ); - int offset = 52; + int offset = 30; int linesDraw = 0; for( int x = 0; x < LINES_ON_PAGE && linesDraw < LINES_ON_PAGE && currentScroll + x < this.lines.size(); x++ ) { @@ -270,10 +258,10 @@ public class GuiConfiguringTerminal extends AEBaseGui implements IJEIGhostIngred @Override public void drawBG( final int offsetX, final int offsetY, final int mouseX, final int mouseY ) { - this.bindTexture( "guis/newinterfaceterminal.png" ); + this.bindTexture( "guis/interfaceconfigurationterminal.png" ); this.drawTexturedModalRect( offsetX, offsetY, 0, 0, this.xSize, this.ySize ); - int offset = 51; + int offset = 29; final int ex = this.getScrollBar().getCurrentScroll(); int linesDraw = 0; for( int x = 0; x < LINES_ON_PAGE && linesDraw < LINES_ON_PAGE && ex + x < this.lines.size(); x++ ) @@ -288,7 +276,7 @@ public class GuiConfiguringTerminal extends AEBaseGui implements IJEIGhostIngred for( int row = 0; row < 1 + extraLines && linesDraw < LINES_ON_PAGE; ++row ) { - this.drawTexturedModalRect( offsetX + 20, offsetY + offset, 20, 173, width, 18 ); + this.drawTexturedModalRect( offsetX + 20, offsetY + offset, 20, 170, width, 18 ); offset += 18; linesDraw++; } @@ -461,42 +449,26 @@ public class GuiConfiguringTerminal extends AEBaseGui implements IJEIGhostIngred return false; } - final NBTTagCompound encodedValue = itemStack.getTagCompound(); - - if( encodedValue == null ) - { - return false; - } - - NBTTagList tag = encodedValue.getTagList( "in", 10 ); - boolean foundMatchingItemStack = false; - for( int i = 0; i < tag.tagCount(); i++ ) - { - final ItemStack parsedItemStack = new ItemStack( tag.getCompoundTagAt( i ) ); - if( !parsedItemStack.isEmpty() ) - { - final String displayName = Platform - .getItemDisplayName( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createStack( parsedItemStack ) ) - .toLowerCase(); + final String displayName = Platform + .getItemDisplayName( AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ).createStack( itemStack ) ) + .toLowerCase(); - for( String term : searchTerm.split( " " ) ) + for( String term : searchTerm.split( " " ) ) + { + if( term.length() > 1 && ( term.startsWith( "-" ) || term.startsWith( "!" ) ) ) + { + term = term.substring( 1 ); + if( displayName.contains( term ) ) { - if( term.length() > 1 && ( term.startsWith( "-" ) || term.startsWith( "!" ) ) ) - { - term = term.substring( 1 ); - if( displayName.contains( term ) ) - { - return false; - } - } - else if( displayName.contains( term ) ) - { - foundMatchingItemStack = true; - } + return false; } } + else if( displayName.contains( term ) ) + { + foundMatchingItemStack = true; + } } return foundMatchingItemStack; } diff --git a/src/main/java/appeng/container/implementations/ContainerConfiguringTerminal.java b/src/main/java/appeng/container/implementations/ContainerInterfaceConfigurationTerminal.java similarity index 95% rename from src/main/java/appeng/container/implementations/ContainerConfiguringTerminal.java rename to src/main/java/appeng/container/implementations/ContainerInterfaceConfigurationTerminal.java index 06b07eecc..3d58757ad 100644 --- a/src/main/java/appeng/container/implementations/ContainerConfiguringTerminal.java +++ b/src/main/java/appeng/container/implementations/ContainerInterfaceConfigurationTerminal.java @@ -24,7 +24,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; -import appeng.parts.reporting.PartConfiguringTerminal; +import appeng.parts.reporting.PartInterfaceConfigurationTerminal; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; @@ -47,15 +47,12 @@ import appeng.helpers.InventoryAction; import appeng.parts.misc.PartInterface; import appeng.tile.inventory.AppEngInternalInventory; import appeng.tile.misc.TileInterface; -import appeng.util.InventoryAdaptor; import appeng.util.Platform; import appeng.util.helpers.ItemHandlerUtil; -import appeng.util.inv.AdaptorItemHandler; -import appeng.util.inv.WrapperCursorItemHandler; import appeng.util.inv.WrapperRangeItemHandler; -public final class ContainerConfiguringTerminal extends AEBaseContainer +public final class ContainerInterfaceConfigurationTerminal extends AEBaseContainer { /** @@ -68,7 +65,7 @@ public final class ContainerConfiguringTerminal extends AEBaseContainer private IGrid grid; private NBTTagCompound data = new NBTTagCompound(); - public ContainerConfiguringTerminal( final InventoryPlayer ip, final PartConfiguringTerminal anchor ) + public ContainerInterfaceConfigurationTerminal( final InventoryPlayer ip, final PartInterfaceConfigurationTerminal anchor ) { super( ip, anchor ); @@ -77,7 +74,7 @@ public final class ContainerConfiguringTerminal extends AEBaseContainer this.grid = anchor.getActionableNode().getGrid(); } - this.bindPlayerInventory( ip, 14, 256 - /* height of player inventory */82 ); + this.bindPlayerInventory( ip, 14, 235 - /* height of player inventory */82 ); } @Override @@ -250,7 +247,9 @@ public final class ContainerConfiguringTerminal extends AEBaseContainer } else { - ItemHandlerUtil.setStackInSlot( theSlot, 0, player.inventory.getItemStack().copy() ); + ItemStack configuredStack = player.inventory.getItemStack().copy(); + configuredStack.setCount( 1 ); + ItemHandlerUtil.setStackInSlot( theSlot, 0, configuredStack ); } } diff --git a/src/main/java/appeng/core/api/definitions/ApiParts.java b/src/main/java/appeng/core/api/definitions/ApiParts.java index bd80fc901..3a1f984c7 100644 --- a/src/main/java/appeng/core/api/definitions/ApiParts.java +++ b/src/main/java/appeng/core/api/definitions/ApiParts.java @@ -80,7 +80,7 @@ public final class ApiParts implements IParts private final IItemDefinition interfaceTerminal; private final IItemDefinition patternTerminal; private final IItemDefinition expandedProcessingPatternTerminal; - private final IItemDefinition configuringInterfaceTerminal; + private final IItemDefinition interfaceConfigurationTerminal; private final IItemDefinition craftingTerminal; private final IItemDefinition terminal; private final IItemDefinition storageMonitor; @@ -143,7 +143,7 @@ public final class ApiParts implements IParts this.interfaceTerminal = new DamagedItemDefinition( "part.terminal.interface", itemPart.createPart( PartType.INTERFACE_TERMINAL ) ); this.patternTerminal = new DamagedItemDefinition( "part.terminal.pattern", itemPart.createPart( PartType.PATTERN_TERMINAL ) ); this.expandedProcessingPatternTerminal = new DamagedItemDefinition( "part.terminal.expanded_processing_pattern", itemPart.createPart( PartType.EXPANDED_PROCESSING_PATTERN_TERMINAL ) ); - this.configuringInterfaceTerminal = new DamagedItemDefinition( "part.terminal.configuring_interface_terminal", itemPart.createPart( PartType.CONFIGURING_INTERFACE_TERMINAL ) ); + this.interfaceConfigurationTerminal = new DamagedItemDefinition( "part.terminal.interface_configuration_terminal", itemPart.createPart( PartType.INTERFACE_CONFIGURATION_TERMINAL ) ); this.craftingTerminal = new DamagedItemDefinition( "part.terminal.crafting", itemPart.createPart( PartType.CRAFTING_TERMINAL ) ); this.terminal = new DamagedItemDefinition( "part.terminal", itemPart.createPart( PartType.TERMINAL ) ); this.storageMonitor = new DamagedItemDefinition( "part.monitor.storage", itemPart.createPart( PartType.STORAGE_MONITOR ) ); diff --git a/src/main/java/appeng/core/sync/GuiBridge.java b/src/main/java/appeng/core/sync/GuiBridge.java index d27da3d48..37d935d18 100644 --- a/src/main/java/appeng/core/sync/GuiBridge.java +++ b/src/main/java/appeng/core/sync/GuiBridge.java @@ -179,7 +179,7 @@ public enum GuiBridge implements IGuiHandler GUI_CRAFTING_STATUS( ContainerCraftingStatus.class, ITerminalHost.class, GuiHostType.ITEM_OR_WORLD, SecurityPermissions.CRAFT ), - GUI_CONFIG_INTERFACE_TERMINAL( ContainerConfiguringTerminal.class, PartConfiguringTerminal.class, GuiHostType.WORLD, SecurityPermissions.BUILD ); + GUI_INTERFACE_CONFIGURATION_TERMINAL( ContainerInterfaceConfigurationTerminal.class, PartInterfaceConfigurationTerminal.class, GuiHostType.WORLD, SecurityPermissions.BUILD ); private final Class tileClass; private final Class containerClass; diff --git a/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java b/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java index c89c6433d..c661f5b1c 100644 --- a/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java +++ b/src/main/java/appeng/core/sync/packets/PacketCompressedNBT.java @@ -27,7 +27,7 @@ import java.io.OutputStream; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; -import appeng.client.gui.implementations.GuiConfiguringTerminal; +import appeng.client.gui.implementations.GuiInterfaceConfigurationTerminal; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; @@ -114,9 +114,9 @@ public class PacketCompressedNBT extends AppEngPacket { ( (GuiInterfaceTerminal) gs ).postUpdate( this.in ); } - else if( gs instanceof GuiConfiguringTerminal ) + else if( gs instanceof GuiInterfaceConfigurationTerminal ) { - ( (GuiConfiguringTerminal) gs ).postUpdate( this.in ); + ( (GuiInterfaceConfigurationTerminal) gs ).postUpdate( this.in ); } } } diff --git a/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java b/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java index 150717f48..e273df7c4 100644 --- a/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java +++ b/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java @@ -24,8 +24,8 @@ import java.util.Collections; import appeng.api.storage.data.IAEFluidStack; import appeng.client.me.SlotDisconnected; -import appeng.container.implementations.ContainerConfiguringTerminal; -import appeng.container.implementations.ContainerConfiguringTerminal.ConfigTracker; +import appeng.container.implementations.ContainerInterfaceConfigurationTerminal; +import appeng.container.implementations.ContainerInterfaceConfigurationTerminal.ConfigTracker; import appeng.container.slot.IJEITargetSlot; import appeng.container.slot.SlotFake; import appeng.core.AELog; @@ -223,9 +223,9 @@ public class PacketInventoryAction extends AppEngPacket } } } - else if( sender.openContainer instanceof ContainerConfiguringTerminal ) + else if( sender.openContainer instanceof ContainerInterfaceConfigurationTerminal ) { - ConfigTracker inv = ( (ContainerConfiguringTerminal) sender.openContainer ).getSlotByID( this.id ); + ConfigTracker inv = ( (ContainerInterfaceConfigurationTerminal) sender.openContainer ).getSlotByID( this.id ); final IItemHandler theSlot = new WrapperRangeItemHandler( inv.getServer(), 0, slot + 1 ); ItemHandlerUtil.setStackInSlot( theSlot, this.slot, this.slotItem.createItemStack() ); diff --git a/src/main/java/appeng/items/parts/PartType.java b/src/main/java/appeng/items/parts/PartType.java index 1bb8400c7..b4fe37eb3 100644 --- a/src/main/java/appeng/items/parts/PartType.java +++ b/src/main/java/appeng/items/parts/PartType.java @@ -285,7 +285,7 @@ public enum PartType INTERFACE_TERMINAL( 480, "interface_terminal", EnumSet.of( AEFeature.INTERFACE_TERMINAL ), EnumSet.noneOf( IntegrationType.class ), PartInterfaceTerminal.class ), FLUID_TERMINAL( 520, "fluid_terminal", EnumSet.of( AEFeature.FLUID_TERMINAL ), EnumSet.noneOf( IntegrationType.class ), PartFluidTerminal.class ), - CONFIGURING_INTERFACE_TERMINAL( 521, "configuring_interface_terminal", EnumSet.of( AEFeature.INTERFACE_TERMINAL ), EnumSet.noneOf( IntegrationType.class ), PartConfiguringTerminal.class ); + INTERFACE_CONFIGURATION_TERMINAL( 521, "interface_configuration_terminal", EnumSet.of( AEFeature.INTERFACE_TERMINAL ), EnumSet.noneOf( IntegrationType.class ), PartInterfaceConfigurationTerminal.class ); private final int baseDamage; private final Set features; diff --git a/src/main/java/appeng/parts/reporting/PartConfiguringTerminal.java b/src/main/java/appeng/parts/reporting/PartInterfaceConfigurationTerminal.java similarity index 87% rename from src/main/java/appeng/parts/reporting/PartConfiguringTerminal.java rename to src/main/java/appeng/parts/reporting/PartInterfaceConfigurationTerminal.java index 15d156fc2..44c73f0f3 100644 --- a/src/main/java/appeng/parts/reporting/PartConfiguringTerminal.java +++ b/src/main/java/appeng/parts/reporting/PartInterfaceConfigurationTerminal.java @@ -33,20 +33,20 @@ import appeng.parts.PartModel; import appeng.util.Platform; -public class PartConfiguringTerminal extends AbstractPartDisplay +public class PartInterfaceConfigurationTerminal extends AbstractPartDisplay { @PartModels - public static final ResourceLocation MODEL_OFF = new ResourceLocation( AppEng.MOD_ID, "part/interface_terminal_off" ); + public static final ResourceLocation MODEL_OFF = new ResourceLocation( AppEng.MOD_ID, "part/interface_configuration_terminal_off" ); @PartModels - public static final ResourceLocation MODEL_ON = new ResourceLocation( AppEng.MOD_ID, "part/interface_terminal_on" ); + public static final ResourceLocation MODEL_ON = new ResourceLocation( AppEng.MOD_ID, "part/interface_configuration_terminal_on" ); public static final IPartModel MODELS_OFF = new PartModel( MODEL_BASE, MODEL_OFF, MODEL_STATUS_OFF ); public static final IPartModel MODELS_ON = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_ON ); public static final IPartModel MODELS_HAS_CHANNEL = new PartModel( MODEL_BASE, MODEL_ON, MODEL_STATUS_HAS_CHANNEL ); public String in = ""; - public PartConfiguringTerminal( final ItemStack is ) + public PartInterfaceConfigurationTerminal( final ItemStack is ) { super( is ); } @@ -58,7 +58,7 @@ public class PartConfiguringTerminal extends AbstractPartDisplay { if( Platform.isServer() ) { - Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_CONFIG_INTERFACE_TERMINAL ); + Platform.openGUI( player, this.getHost().getTile(), this.getSide(), GuiBridge.GUI_INTERFACE_CONFIGURATION_TERMINAL ); } } return true; diff --git a/src/main/resources/assets/appliedenergistics2/lang/en_us.lang b/src/main/resources/assets/appliedenergistics2/lang/en_us.lang index 64732d60f..b19d5d619 100644 --- a/src/main/resources/assets/appliedenergistics2/lang/en_us.lang +++ b/src/main/resources/assets/appliedenergistics2/lang/en_us.lang @@ -549,6 +549,7 @@ item.appliedenergistics2.multi_part.inverted_toggle_bus.name=ME Inverted Toggle item.appliedenergistics2.multi_part.toggle_bus.name=ME Toggle Bus item.appliedenergistics2.multi_part.crafting_monitor.name=ME Crafting Monitor item.appliedenergistics2.multi_part.interface_terminal.name=ME Interface Terminal +item.appliedenergistics2.multi_part.interface_configuration_terminal.name=ME Configuration Interface Terminal item.appliedenergistics2.multi_part.fluid_terminal.name=ME Fluid Terminal item.appliedenergistics2.multi_part.invalid_type.name=Disabled Item diff --git a/src/main/resources/assets/appliedenergistics2/models/item/part/interface_configuration_terminal.json b/src/main/resources/assets/appliedenergistics2/models/item/part/interface_configuration_terminal.json new file mode 100644 index 000000000..19fd32603 --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/models/item/part/interface_configuration_terminal.json @@ -0,0 +1,9 @@ +{ + "parent": "appliedenergistics2:item/part/display", + "textures": { + "front": "appliedenergistics2:items/part/interface_terminal", + "front_bright": "appliedenergistics2:parts/interface_configuration_terminal_bright", + "front_medium": "appliedenergistics2:parts/interface_configuration_terminal_medium", + "front_dark": "appliedenergistics2:parts/interface_configuration_terminal_dark" + } +} diff --git a/src/main/resources/assets/appliedenergistics2/models/part/interface_configuration_terminal_off.json b/src/main/resources/assets/appliedenergistics2/models/part/interface_configuration_terminal_off.json new file mode 100644 index 000000000..eb01e4de3 --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/models/part/interface_configuration_terminal_off.json @@ -0,0 +1,8 @@ +{ + "parent": "appliedenergistics2:part/display_off", + "textures": { + "lightsBright": "appliedenergistics2:parts/interface_configuration_terminal_bright", + "lightsMedium": "appliedenergistics2:parts/interface_configuration_terminal_medium", + "lightsDark": "appliedenergistics2:parts/interface_configuration_terminal_dark" + } +} diff --git a/src/main/resources/assets/appliedenergistics2/models/part/interface_configuration_terminal_on.json b/src/main/resources/assets/appliedenergistics2/models/part/interface_configuration_terminal_on.json new file mode 100644 index 000000000..5ca04a281 --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/models/part/interface_configuration_terminal_on.json @@ -0,0 +1,76 @@ +{ + "ae2_uvl_marker": true, + "textures": { + "lightsBright": "appliedenergistics2:parts/interface_configuration_terminal_bright", + "lightsMedium": "appliedenergistics2:parts/interface_configuration_terminal_medium", + "lightsDark": "appliedenergistics2:parts/interface_configuration_terminal_dark" + }, + "elements": [ + { + "from": [ + 2, + 2, + 0 + ], + "to": [ + 14, + 14, + 2 + ], + "faces": { + "north": { + "texture": "#lightsBright", + "tintindex": 3, + "uvlightmap": { + "sky": 0.007, + "block": 0.007 + } + } + } + }, + { + "from": [ + 2, + 2, + 0 + ], + "to": [ + 14, + 14, + 2 + ], + "faces": { + "north": { + "texture": "#lightsMedium", + "tintindex": 2, + "uvlightmap": { + "sky": 0.007, + "block": 0.007 + } + } + } + }, + { + "from": [ + 2, + 2, + 0 + ], + "to": [ + 14, + 14, + 2 + ], + "faces": { + "north": { + "texture": "#lightsDark", + "tintindex": 1, + "uvlightmap": { + "sky": 0.007, + "block": 0.007 + } + } + } + } + ] +} diff --git a/src/main/resources/assets/appliedenergistics2/recipes/network/parts/terminals_interface_configuration.json b/src/main/resources/assets/appliedenergistics2/recipes/network/parts/terminals_interface_configuration.json new file mode 100644 index 000000000..ea7635284 --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/recipes/network/parts/terminals_interface_configuration.json @@ -0,0 +1,19 @@ +{ + "conditions": [ + { + "type": "minecraft:item_exists", + "item": "appliedenergistics2:interface" + } + ], + "result": { + "type": "appliedenergistics2:part", + "part": "part.interface_terminal" + }, + "type": "appliedenergistics2:part_shapeless", + "ingredients": [ + { + "type": "appliedenergistics2:part", + "part": "part.interface_configuration_terminal" + } + ] +} diff --git a/src/main/resources/assets/appliedenergistics2/recipes/network/parts/terminals_interface_configuration_revert.json b/src/main/resources/assets/appliedenergistics2/recipes/network/parts/terminals_interface_configuration_revert.json new file mode 100644 index 000000000..86d943ca7 --- /dev/null +++ b/src/main/resources/assets/appliedenergistics2/recipes/network/parts/terminals_interface_configuration_revert.json @@ -0,0 +1,19 @@ +{ + "conditions": [ + { + "type": "minecraft:item_exists", + "item": "appliedenergistics2:interface" + } + ], + "result": { + "type": "appliedenergistics2:part", + "part": "part.interface_configuration_terminal" + }, + "type": "appliedenergistics2:part_shapeless", + "ingredients": [ + { + "type": "appliedenergistics2:part", + "part": "part.interface_terminal" + } + ] +} diff --git a/src/main/resources/assets/appliedenergistics2/textures/guis/interfaceconfigurationterminal.png b/src/main/resources/assets/appliedenergistics2/textures/guis/interfaceconfigurationterminal.png new file mode 100644 index 0000000000000000000000000000000000000000..5245ad09d8bdeb3a648bdf0196750c198909f476 GIT binary patch literal 11891 zcmeAS@N?(olHy`uVBq!ia0y~yU}OMc4rT@hhU_&FAq)&stW_ZqB|(Yh3I#>^X_+~x z3MG{VsS2qTnQ06R6}Q&T$t+T~oUrEqW0B&PBYZOKt8dI6X&Q39B5>XB<#XMuTR;E!v$6lU|NGh7 zr}w3w-@IRc%9kHkKG*)voN?ML?kGR=)Q>wZ*vGGUSXcJ+v_pUA9+jd!Gx{4}B`dst z$NkOFVfXaXrBR=bt9~i9KmXk6^xyL@6t5r8?dPxmYn`&iT={dw^J&}vJ-S$3&i&x) zdCB_~ffZZslGjQ%S*KlvQ}Q#T^#0oP}#@aN?>vSgp#GP{vE`)=9X=Z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git a/src/main/resources/assets/appliedenergistics2/textures/parts/interface_configuration_terminal_dark.png b/src/main/resources/assets/appliedenergistics2/textures/parts/interface_configuration_terminal_dark.png new file mode 100644 index 0000000000000000000000000000000000000000..8affc2651889fe6e1c426dad9276ee29dd4fd495 GIT binary patch literal 205 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s7SkfJR9T^xl_H+M9WMyDr zP)PO&@?~JCQe$9fXklRZ#lXPO@PdJ%)PRBERRRNp)eHs(@q#(K0&N%=7&r?&B8wRq z_?Ce%WBZ+z`3wvUQYEetCBgY=CFO}lsSE*$nRz98ey$-3WyX4@dWMGXpPkGZ7#L(d zT^vI!{F5cp9@q;w%(P%M%yK)(!LDqiXlTH|kXpe1QQ@(?1p@;EgQu&X%Q~loCIFG` BGHd_< literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/appliedenergistics2/textures/parts/interface_configuration_terminal_medium.png b/src/main/resources/assets/appliedenergistics2/textures/parts/interface_configuration_terminal_medium.png new file mode 100644 index 0000000000000000000000000000000000000000..822abb253add77d7fe6b03737fba12bdfbba5aba GIT binary patch literal 5092 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!tojjKW;N`ey06$*;-(=u~X z6-p`#QWa7wGSe6sDsH`lp+ZKe34s8gDiOC~r!Yij#xJ2i9?|7x4KKWjfGl&2pr(O!{S zzqO=i|IL&36^oj}{yaEw>tdk1b&3>^^5)$E=bx_q@-kL%uiQtiGqWdDOi|jyJ>lnu$xUqwRd}M7r3y}Q{1VXA zu&3+tOe2wAP18LxUmTw1T+H5Gy-f6ngp$9bU;5um?==PWV?)vt zzKJp}LN_GNul(3~N$S+Z#Ig;KjhH(%JVkOgi5%ckO!}W;@MfWqYMVrImz3_ah)GK( zBzbvW-Xqf8#kM?f@~T;Bx@uxNQAVblb5x7PVrCgGUvsnQ+|q<|Oy^nS#d$QA7EP7P zDlrXR8&<5#dwY4SSajB{HBZB=%3toVuX=TB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