GUI Rendering and various fixes
This commit is contained in:
@@ -23,6 +23,7 @@ import javax.annotation.Nonnull;
|
||||
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.block.BlockState;
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -42,7 +43,7 @@ public final class AELog
|
||||
private static final Logger SERVER = LogManager.getFormatterLogger( LOGGER_PREFIX + SERVER_SUFFIX );
|
||||
private static final Logger CLIENT = LogManager.getFormatterLogger( LOGGER_PREFIX + CLIENT_SUFFIX );
|
||||
|
||||
private static final String BLOCK_UPDATE = "Block Update of %s @ ( %s )";
|
||||
private static final String BLOCK_UPDATE = "Block Update of %s @ ( %s ). State %s -> %s";
|
||||
|
||||
private static final String DEFAULT_EXCEPTION_MESSAGE = "Exception: ";
|
||||
|
||||
@@ -318,13 +319,15 @@ public final class AELog
|
||||
*
|
||||
* @see AELog#log(Level, String, Object...)
|
||||
* @param pos
|
||||
* @param currentState
|
||||
* @param newState
|
||||
* @param aeBaseTile
|
||||
*/
|
||||
public static void blockUpdate( @Nonnull final BlockPos pos, @Nonnull final AEBaseTile aeBaseTile )
|
||||
public static void blockUpdate(@Nonnull final BlockPos pos, @Nonnull BlockState currentState, @Nonnull BlockState newState, @Nonnull final AEBaseTile aeBaseTile)
|
||||
{
|
||||
if( AEConfig.instance().isFeatureEnabled( AEFeature.UPDATE_LOGGING ) )
|
||||
{
|
||||
info( BLOCK_UPDATE, aeBaseTile.getClass().getName(), pos );
|
||||
info( BLOCK_UPDATE, aeBaseTile.getClass().getName(), pos, currentState, newState );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ package appeng.core;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import appeng.block.paint.PaintSplotchesModel;
|
||||
@@ -27,6 +28,7 @@ import appeng.block.qnb.QnbFormedModel;
|
||||
import appeng.bootstrap.components.IClientSetupComponent;
|
||||
import appeng.bootstrap.components.IInitComponent;
|
||||
import appeng.bootstrap.components.IPostInitComponent;
|
||||
import appeng.bootstrap.components.ItemColorComponent;
|
||||
import appeng.client.ClientHelper;
|
||||
import appeng.client.render.DummyFluidItemModel;
|
||||
import appeng.client.render.SimpleModelLoader;
|
||||
@@ -34,6 +36,7 @@ import appeng.client.render.crafting.CraftingCubeModelLoader;
|
||||
import appeng.client.render.model.*;
|
||||
import appeng.client.render.spatial.SpatialPylonModel;
|
||||
import appeng.core.stats.AdvancementTriggers;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.worlddata.WorldData;
|
||||
import appeng.hooks.TickHandler;
|
||||
import appeng.parts.PartPlacement;
|
||||
@@ -41,6 +44,7 @@ import appeng.server.AECommand;
|
||||
import appeng.server.ServerHelper;
|
||||
import appeng.services.VersionChecker;
|
||||
import appeng.services.version.VersionCheckerConfig;
|
||||
import com.google.common.base.Stopwatch;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
@@ -51,6 +55,7 @@ import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.client.event.ColorHandlerEvent;
|
||||
import net.minecraftforge.client.model.ModelLoaderRegistry;
|
||||
import net.minecraftforge.client.model.geometry.IModelGeometry;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -70,6 +75,7 @@ import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStoppedEvent;
|
||||
import net.minecraftforge.fml.event.server.FMLServerStoppingEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
import net.minecraftforge.fml.network.NetworkRegistry;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@@ -137,6 +143,7 @@ public final class AppEng
|
||||
// Register client-only events
|
||||
DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> modEventBus.addListener(this::clientSetup));
|
||||
DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> modEventBus.addListener(registration::modelRegistryEvent));
|
||||
DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> modEventBus.addListener(registration::registerItemColors));
|
||||
|
||||
MinecraftForge.EVENT_BUS.addListener( TickHandler.INSTANCE::unloadWorld );
|
||||
MinecraftForge.EVENT_BUS.addListener( TickHandler.INSTANCE::onTick );
|
||||
@@ -164,10 +171,24 @@ public final class AppEng
|
||||
this.startService( "AE2 VersionChecker", versionCheckerThread );
|
||||
}
|
||||
|
||||
registerNetworkHandler();
|
||||
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
private void clientSetup(FMLClientSetupEvent event) {
|
||||
|
||||
((ClientHelper) proxy).clientInit();
|
||||
|
||||
// Do not register the Fullbright hacks if Optifine is present or if the Forge lighting is disabled
|
||||
// FIXME if( !FMLClientHandler.instance().hasOptifine() && ForgeModContainer.forgeLightPipelineEnabled )
|
||||
// FIXME {
|
||||
// FIXME ModelLoaderRegistry.registerLoader( UVLModelLoader.INSTANCE );
|
||||
// FIXME }
|
||||
|
||||
// FIXME RenderingRegistry.registerEntityRenderingHandler( EntityTinyTNTPrimed.class, manager -> new RenderTinyTNTPrimed( manager ) );
|
||||
// FIXME RenderingRegistry.registerEntityRenderingHandler( EntityFloatingItem.class, manager -> new RenderFloatingItem( manager ) );
|
||||
|
||||
final ApiDefinitions definitions = Api.INSTANCE.definitions();
|
||||
definitions.getRegistry().getBootstrapComponents( IClientSetupComponent.class ).forEachRemaining(IClientSetupComponent::setup);
|
||||
|
||||
@@ -297,26 +318,23 @@ public final class AppEng
|
||||
//
|
||||
// AELog.info( "Initialization ( ended after " + start.elapsed( TimeUnit.MILLISECONDS ) + "ms )" );
|
||||
// }
|
||||
//
|
||||
// @EventHandler
|
||||
// private void postInit( final FMLPostInitializationEvent event )
|
||||
// {
|
||||
// final Stopwatch start = Stopwatch.createStarted();
|
||||
// AELog.info( "Post Initialization ( started )" );
|
||||
//
|
||||
// this.registration.postInit( event );
|
||||
// IntegrationRegistry.INSTANCE.postInit();
|
||||
// CrashReportExtender.registerCrashCallable( new IntegrationCrashEnhancement() );
|
||||
//
|
||||
// AppEng.proxy.postInit();
|
||||
// AEConfig.instance().save();
|
||||
//
|
||||
// NetworkRegistry.INSTANCE.registerGuiHandler( this, GuiBridge.GUI_Handler );
|
||||
// NetworkHandler.init( "AE2" );
|
||||
//
|
||||
// AELog.info( "Post Initialization ( ended after " + start.elapsed( TimeUnit.MILLISECONDS ) + "ms )" );
|
||||
// }
|
||||
//
|
||||
|
||||
private void registerNetworkHandler()
|
||||
{
|
||||
final Stopwatch start = Stopwatch.createStarted();
|
||||
AELog.info( "Post Initialization ( started )" );
|
||||
|
||||
// FIXME IntegrationRegistry.INSTANCE.postInit();
|
||||
// FIXME CrashReportExtender.registerCrashCallable( new IntegrationCrashEnhancement() );
|
||||
|
||||
AppEng.proxy.postInit();
|
||||
AEConfig.instance().save();
|
||||
|
||||
NetworkHandler.init( new ResourceLocation(MOD_ID, "main") );
|
||||
|
||||
AELog.info( "Post Initialization ( ended after " + start.elapsed( TimeUnit.MILLISECONDS ) + "ms )" );
|
||||
}
|
||||
|
||||
// @EventHandler
|
||||
// private void handleIMCEvent( final FMLInterModComms.IMCEvent event )
|
||||
// {
|
||||
|
||||
@@ -40,8 +40,6 @@ import appeng.core.sync.AppEngPacket;
|
||||
public abstract class CommonHelper
|
||||
{
|
||||
|
||||
public abstract void preinit();
|
||||
|
||||
public abstract World getWorld();
|
||||
|
||||
public abstract void bindTileEntitySpecialRenderer( Class<? extends TileEntity> tile, AEBaseBlock blk );
|
||||
|
||||
@@ -104,6 +104,7 @@ import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.client.event.ColorHandlerEvent;
|
||||
import net.minecraftforge.client.event.ModelRegistryEvent;
|
||||
import net.minecraftforge.client.event.ParticleFactoryRegisterEvent;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
@@ -881,4 +882,10 @@ final class Registration
|
||||
new AECommand().register(evt.getCommandDispatcher());
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void registerItemColors(ColorHandlerEvent.Item event) {
|
||||
final ApiDefinitions definitions = Api.INSTANCE.definitions();
|
||||
definitions.getRegistry().getBootstrapComponents( IItemColorRegistrationComponent.class ).forEachRemaining(c -> c.register(event.getItemColors(), event.getBlockColors()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ public class ApiStorage implements IStorageHelper
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack readFromPacket( PacketBuffer input ) throws IOException
|
||||
public IAEItemStack readFromPacket( PacketBuffer input )
|
||||
{
|
||||
Preconditions.checkNotNull( input );
|
||||
|
||||
@@ -215,7 +215,7 @@ public class ApiStorage implements IStorageHelper
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEFluidStack readFromPacket( PacketBuffer input ) throws IOException
|
||||
public IAEFluidStack readFromPacket( PacketBuffer input )
|
||||
{
|
||||
Preconditions.checkNotNull( input );
|
||||
|
||||
|
||||
@@ -112,7 +112,6 @@ public final class ApiItems implements IItems
|
||||
private final IItemDefinition encodedPattern;
|
||||
private final IItemDefinition colorApplicator;
|
||||
|
||||
private final IItemDefinition paintBall;
|
||||
private final AEColoredItemDefinition coloredPaintBall;
|
||||
private final AEColoredItemDefinition coloredLumenPaintBall;
|
||||
|
||||
@@ -296,12 +295,13 @@ public final class ApiItems implements IItems
|
||||
.rendering( new ItemEncodedPatternRendering() )
|
||||
.build();
|
||||
|
||||
this.paintBall = registry.item( "paint_ball", ItemPaintBall::new )
|
||||
IItemDefinition paintBall = registry.item( "paint_ball", ItemPaintBall::new )
|
||||
.features( AEFeature.PAINT_BALLS )
|
||||
.rendering( new ItemPaintBallRendering() )
|
||||
.build();
|
||||
this.coloredPaintBall = registry.colored( this.paintBall, 0 );
|
||||
this.coloredLumenPaintBall = registry.colored( this.paintBall, 20 );
|
||||
// FIXME these are both wrong
|
||||
this.coloredPaintBall = registry.colored( paintBall, 0 );
|
||||
this.coloredLumenPaintBall = registry.colored( paintBall, 20 );
|
||||
|
||||
FeatureFactory debugTools = registry.features( AEFeature.UNSUPPORTED_DEVELOPER_TOOLS, AEFeature.CREATIVE );
|
||||
this.toolEraser = debugTools.item( "debug_eraser", ToolEraser::new ).build();
|
||||
@@ -567,11 +567,6 @@ public final class ApiItems implements IItems
|
||||
return this.coloredLumenPaintBall;
|
||||
}
|
||||
|
||||
public IItemDefinition paintBall()
|
||||
{
|
||||
return this.paintBall;
|
||||
}
|
||||
|
||||
public IItemDefinition toolEraser()
|
||||
{
|
||||
return this.toolEraser;
|
||||
|
||||
@@ -4,6 +4,7 @@ package appeng.core.features.registries.cell;
|
||||
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerMEMonitorable;
|
||||
import appeng.container.implementations.ContainerWireless;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -34,6 +35,6 @@ public class BasicItemCellGuiHandler implements ICellGuiHandler
|
||||
@Override
|
||||
public void openChestGui( final PlayerEntity player, final IChestOrDrive chest, final ICellHandler cellHandler, final IMEInventoryHandler inv, final ItemStack is, final IStorageChannel chan )
|
||||
{
|
||||
ContainerOpener.openContainer(ContainerWireless.TYPE, player, ContainerLocator.forTileEntitySide((TileEntity) chest, chest.getUp()));
|
||||
ContainerOpener.openContainer(ContainerMEMonitorable.TYPE, player, ContainerLocator.forTileEntitySide((TileEntity) chest, chest.getUp()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package appeng.core.sync;
|
||||
|
||||
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.network.IPacket;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
@@ -28,6 +29,7 @@ import appeng.core.AEConfig;
|
||||
import appeng.core.AELog;
|
||||
import appeng.api.features.AEFeature;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
|
||||
public abstract class AppEngPacket
|
||||
@@ -41,8 +43,7 @@ public abstract class AppEngPacket
|
||||
|
||||
public final int getPacketID()
|
||||
{
|
||||
throw new IllegalStateException();
|
||||
// FIXME return AppEngPacketHandlerBase.PacketTypes.getID( this.getClass() ).ordinal();
|
||||
return AppEngPacketHandlerBase.PacketTypes.getID( this.getClass() ).ordinal();
|
||||
}
|
||||
|
||||
public void clientPacketData( final INetworkInfo network, final PlayerEntity player )
|
||||
@@ -68,7 +69,6 @@ public abstract class AppEngPacket
|
||||
AELog.info( this.getClass().getName() + " : " + p.readableBytes() );
|
||||
}
|
||||
|
||||
// FIXME return direction.buildPacket( Pair.of( p, 0 ), NetworkHandler.instance().getChannel() ).getThis();
|
||||
return null;
|
||||
return direction.buildPacket( Pair.of( p, 0 ), NetworkHandler.instance().getChannel() ).getThis();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,70 +61,63 @@ public class AppEngPacketHandlerBase
|
||||
|
||||
public enum PacketTypes
|
||||
{
|
||||
PACKET_COMPASS_REQUEST( PacketCompassRequest::new ),
|
||||
PACKET_COMPASS_REQUEST( PacketCompassRequest.class, PacketCompassRequest::new ),
|
||||
|
||||
PACKET_COMPASS_RESPONSE( PacketCompassResponse::new ),
|
||||
PACKET_COMPASS_RESPONSE( PacketCompassResponse.class, PacketCompassResponse::new ),
|
||||
|
||||
PACKET_INVENTORY_ACTION( PacketInventoryAction::new ),
|
||||
PACKET_INVENTORY_ACTION( PacketInventoryAction.class, PacketInventoryAction::new ),
|
||||
|
||||
PACKET_ME_INVENTORY_UPDATE( PacketMEInventoryUpdate::new ),
|
||||
PACKET_ME_INVENTORY_UPDATE( PacketMEInventoryUpdate.class, PacketMEInventoryUpdate::new ),
|
||||
|
||||
PACKET_ME_FLUID_INVENTORY_UPDATE( PacketMEFluidInventoryUpdate::new ),
|
||||
PACKET_ME_FLUID_INVENTORY_UPDATE( PacketMEFluidInventoryUpdate.class, PacketMEFluidInventoryUpdate::new ),
|
||||
|
||||
PACKET_CONFIG_BUTTON( PacketConfigButton::new ),
|
||||
PACKET_CONFIG_BUTTON( PacketConfigButton.class, PacketConfigButton::new ),
|
||||
|
||||
PACKET_PART_PLACEMENT( PacketPartPlacement::new ),
|
||||
PACKET_PART_PLACEMENT( PacketPartPlacement.class, PacketPartPlacement::new ),
|
||||
|
||||
PACKET_LIGHTNING( PacketLightning::new ),
|
||||
PACKET_LIGHTNING( PacketLightning.class, PacketLightning::new ),
|
||||
|
||||
PACKET_MATTER_CANNON( PacketMatterCannon::new ),
|
||||
PACKET_MATTER_CANNON( PacketMatterCannon.class, PacketMatterCannon::new ),
|
||||
|
||||
PACKET_MOCK_EXPLOSION( PacketMockExplosion::new ),
|
||||
PACKET_MOCK_EXPLOSION( PacketMockExplosion.class, PacketMockExplosion::new ),
|
||||
|
||||
PACKET_VALUE_CONFIG( PacketValueConfig::new ),
|
||||
PACKET_VALUE_CONFIG( PacketValueConfig.class, PacketValueConfig::new ),
|
||||
|
||||
PACKET_TRANSITION_EFFECT( PacketTransitionEffect::new ),
|
||||
PACKET_TRANSITION_EFFECT( PacketTransitionEffect.class, PacketTransitionEffect::new ),
|
||||
|
||||
PACKET_PROGRESS_VALUE( PacketProgressBar::new ),
|
||||
PACKET_PROGRESS_VALUE( PacketProgressBar.class, PacketProgressBar::new ),
|
||||
|
||||
PACKET_CLICK( PacketClick::new ),
|
||||
PACKET_CLICK( PacketClick.class, PacketClick::new ),
|
||||
|
||||
PACKET_SWITCH_GUIS( PacketSwitchGuis::new ),
|
||||
PACKET_SWITCH_GUIS( PacketSwitchGuis.class, PacketSwitchGuis::new ),
|
||||
|
||||
PACKET_SWAP_SLOTS( PacketSwapSlots::new ),
|
||||
PACKET_SWAP_SLOTS( PacketSwapSlots.class, PacketSwapSlots::new ),
|
||||
|
||||
PACKET_PATTERN_SLOT( PacketPatternSlot::new ),
|
||||
PACKET_PATTERN_SLOT( PacketPatternSlot.class, PacketPatternSlot::new ),
|
||||
|
||||
PACKET_RECIPE_JEI( PacketJEIRecipe::new ),
|
||||
PACKET_RECIPE_JEI( PacketJEIRecipe.class, PacketJEIRecipe::new ),
|
||||
|
||||
PACKET_TARGET_ITEM( PacketTargetItemStack::new ),
|
||||
PACKET_TARGET_ITEM( PacketTargetItemStack.class, PacketTargetItemStack::new ),
|
||||
|
||||
PACKET_TARGET_FLUID( PacketTargetFluidStack::new ),
|
||||
PACKET_TARGET_FLUID( PacketTargetFluidStack.class, PacketTargetFluidStack::new ),
|
||||
|
||||
PACKET_CRAFTING_REQUEST( PacketCraftRequest::new ),
|
||||
PACKET_CRAFTING_REQUEST( PacketCraftRequest.class, PacketCraftRequest::new ),
|
||||
|
||||
PACKET_ASSEMBLER_ANIMATION( PacketAssemblerAnimation::new ),
|
||||
PACKET_ASSEMBLER_ANIMATION( PacketAssemblerAnimation.class, PacketAssemblerAnimation::new ),
|
||||
|
||||
PACKET_COMPRESSED_NBT( PacketCompressedNBT::new ),
|
||||
PACKET_COMPRESSED_NBT( PacketCompressedNBT.class, PacketCompressedNBT::new ),
|
||||
|
||||
PACKET_PAINTED_ENTITY( PacketPaintedEntity::new ),
|
||||
PACKET_PAINTED_ENTITY( PacketPaintedEntity.class, PacketPaintedEntity::new ),
|
||||
|
||||
PACKET_FLUID_TANK( PacketFluidSlot::new );
|
||||
PACKET_FLUID_TANK( PacketFluidSlot.class, PacketFluidSlot::new );
|
||||
|
||||
private final Class<? extends AppEngPacket> packetClass;
|
||||
private final Function<PacketBuffer, AppEngPacket> factory;
|
||||
|
||||
PacketTypes( Function<PacketBuffer, AppEngPacket> factory )
|
||||
PacketTypes( Class<? extends AppEngPacket> packetClass, Function<PacketBuffer, AppEngPacket> factory )
|
||||
{
|
||||
Type c = TypeResolver.resolveGenericType( Function.class, factory.getClass() );
|
||||
if( c == TypeResolver.Unknown.class )
|
||||
{
|
||||
throw new IllegalStateException("Failed to resolve type for AE packet type: " + factory.toString());
|
||||
}
|
||||
this.packetClass = (Class<? extends AppEngPacket>) c;
|
||||
this.factory = factory;
|
||||
|
||||
REVERSE_LOOKUP.put( this.packetClass, this );
|
||||
REVERSE_LOOKUP.put(packetClass, this );
|
||||
}
|
||||
|
||||
public static PacketTypes getPacket( final int id )
|
||||
|
||||
@@ -72,8 +72,7 @@ public class NetworkHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
// FIXME return new AppEngClientPacketHandler();
|
||||
return null;
|
||||
return new AppEngClientPacketHandler();
|
||||
}
|
||||
catch( final Throwable t )
|
||||
{
|
||||
@@ -85,8 +84,7 @@ public class NetworkHandler
|
||||
{
|
||||
try
|
||||
{
|
||||
// FIXME return new AppEngServerPacketHandler();
|
||||
return null;
|
||||
return new AppEngServerPacketHandler();
|
||||
}
|
||||
catch( final Throwable t )
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ public class PacketAssemblerAnimation extends AppEngPacket
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketAssemblerAnimation( final BlockPos pos, final byte rate, final IAEItemStack is ) throws IOException
|
||||
public PacketAssemblerAnimation( final BlockPos pos, final byte rate, final IAEItemStack is )
|
||||
{
|
||||
|
||||
final PacketBuffer data = new PacketBuffer( Unpooled.buffer() );
|
||||
|
||||
@@ -27,6 +27,7 @@ import java.io.OutputStream;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
|
||||
import appeng.client.gui.implementations.GuiInterfaceTerminal;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -61,7 +62,7 @@ public class PacketCompressedNBT extends AppEngPacket
|
||||
{
|
||||
|
||||
@Override
|
||||
public int read() throws IOException
|
||||
public int read()
|
||||
{
|
||||
if( stream.readableBytes() <= 0 )
|
||||
{
|
||||
@@ -80,6 +81,7 @@ public class PacketCompressedNBT extends AppEngPacket
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: this is pointless, PacketBuffer.writeNBT will already compress
|
||||
// api
|
||||
public PacketCompressedNBT( final CompoundNBT din ) throws IOException
|
||||
{
|
||||
@@ -93,7 +95,7 @@ public class PacketCompressedNBT extends AppEngPacket
|
||||
{
|
||||
|
||||
@Override
|
||||
public void write( final int value ) throws IOException
|
||||
public void write( final int value )
|
||||
{
|
||||
PacketCompressedNBT.this.data.writeByte( value );
|
||||
}
|
||||
@@ -111,9 +113,9 @@ public class PacketCompressedNBT extends AppEngPacket
|
||||
{
|
||||
final Screen gs = Minecraft.getInstance().currentScreen;
|
||||
|
||||
// FIXME if( gs instanceof GuiInterfaceTerminal )
|
||||
// FIXME {
|
||||
// FIXME ( (GuiInterfaceTerminal) gs ).postUpdate( this.in );
|
||||
// FIXME }
|
||||
if( gs instanceof GuiInterfaceTerminal)
|
||||
{
|
||||
( (GuiInterfaceTerminal) gs ).postUpdate( this.in );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,21 +19,10 @@
|
||||
package appeng.core.sync.packets;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerInscriber;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.ContainerLocator;
|
||||
import appeng.container.ContainerOpener;
|
||||
import appeng.container.implementations.ContainerCraftAmount;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
@@ -41,6 +30,11 @@ import appeng.core.sync.network.INetworkInfo;
|
||||
import appeng.helpers.InventoryAction;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.AEItemStack;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
|
||||
|
||||
public class PacketInventoryAction extends AppEngPacket
|
||||
@@ -68,7 +62,7 @@ public class PacketInventoryAction extends AppEngPacket
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketInventoryAction( final InventoryAction action, final int slot, final IAEItemStack slotItem ) throws IOException
|
||||
public PacketInventoryAction( final InventoryAction action, final int slot, final IAEItemStack slotItem )
|
||||
{
|
||||
|
||||
if( Platform.isClient() )
|
||||
|
||||
@@ -83,7 +83,7 @@ public class PacketJEIRecipe extends AppEngPacket
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketJEIRecipe( final CompoundNBT recipe ) throws IOException
|
||||
public PacketJEIRecipe( final CompoundNBT recipe )
|
||||
{
|
||||
final PacketBuffer data = new PacketBuffer(Unpooled.buffer());
|
||||
|
||||
|
||||
@@ -80,12 +80,10 @@ public class PacketMEFluidInventoryUpdate extends AppEngPacket
|
||||
this.list = new LinkedList<>();
|
||||
this.ref = stream.readByte();
|
||||
|
||||
// int originalBytes = stream.readableBytes();
|
||||
|
||||
try( final GZIPInputStream gzReader = new GZIPInputStream( new InputStream()
|
||||
{
|
||||
@Override
|
||||
public int read() throws IOException
|
||||
public int read()
|
||||
{
|
||||
if( stream.readableBytes() <= 0 )
|
||||
{
|
||||
@@ -140,7 +138,7 @@ public class PacketMEFluidInventoryUpdate extends AppEngPacket
|
||||
this.compressFrame = new GZIPOutputStream( new OutputStream()
|
||||
{
|
||||
@Override
|
||||
public void write( final int value ) throws IOException
|
||||
public void write( final int value )
|
||||
{
|
||||
PacketMEFluidInventoryUpdate.this.data.writeByte( value );
|
||||
}
|
||||
|
||||
@@ -29,6 +29,10 @@ import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import appeng.client.gui.implementations.GuiCraftConfirm;
|
||||
import appeng.client.gui.implementations.GuiCraftingCPU;
|
||||
import appeng.client.gui.implementations.GuiMEMonitorable;
|
||||
import appeng.client.gui.implementations.GuiNetworkStatus;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -80,7 +84,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket
|
||||
try( GZIPInputStream gzReader = new GZIPInputStream( new InputStream()
|
||||
{
|
||||
@Override
|
||||
public int read() throws IOException
|
||||
public int read()
|
||||
{
|
||||
if( stream.readableBytes() <= 0 )
|
||||
{
|
||||
@@ -134,7 +138,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket
|
||||
this.compressFrame = new GZIPOutputStream( new OutputStream()
|
||||
{
|
||||
@Override
|
||||
public void write( final int value ) throws IOException
|
||||
public void write( final int value )
|
||||
{
|
||||
PacketMEInventoryUpdate.this.data.writeByte( value );
|
||||
}
|
||||
@@ -149,25 +153,25 @@ public class PacketMEInventoryUpdate extends AppEngPacket
|
||||
{
|
||||
final Screen gs = Minecraft.getInstance().currentScreen;
|
||||
|
||||
// FIXME if( gs instanceof GuiCraftConfirm )
|
||||
// FIXME {
|
||||
// FIXME ( (GuiCraftConfirm) gs ).postUpdate( this.list, this.ref );
|
||||
// FIXME }
|
||||
// FIXME
|
||||
// FIXME if( gs instanceof GuiCraftingCPU )
|
||||
// FIXME {
|
||||
// FIXME ( (GuiCraftingCPU) gs ).postUpdate( this.list, this.ref );
|
||||
// FIXME }
|
||||
// FIXME
|
||||
// FIXME if( gs instanceof GuiMEMonitorable )
|
||||
// FIXME {
|
||||
// FIXME ( (GuiMEMonitorable) gs ).postUpdate( this.list );
|
||||
// FIXME }
|
||||
// FIXME
|
||||
// FIXME if( gs instanceof GuiNetworkStatus )
|
||||
// FIXME {
|
||||
// FIXME ( (GuiNetworkStatus) gs ).postUpdate( this.list );
|
||||
// FIXME }
|
||||
if( gs instanceof GuiCraftConfirm)
|
||||
{
|
||||
( (GuiCraftConfirm) gs ).postUpdate( this.list, this.ref );
|
||||
}
|
||||
|
||||
if( gs instanceof GuiCraftingCPU)
|
||||
{
|
||||
( (GuiCraftingCPU<?>) gs ).postUpdate( this.list, this.ref );
|
||||
}
|
||||
|
||||
if( gs instanceof GuiMEMonitorable)
|
||||
{
|
||||
( (GuiMEMonitorable<?>) gs ).postUpdate( this.list );
|
||||
}
|
||||
|
||||
if( gs instanceof GuiNetworkStatus)
|
||||
{
|
||||
( (GuiNetworkStatus) gs ).postUpdate( this.list );
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -72,7 +72,7 @@ public class PacketPatternSlot extends AppEngPacket
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketPatternSlot( final IItemHandler pat, final IAEItemStack slotItem, final boolean shift ) throws IOException
|
||||
public PacketPatternSlot( final IItemHandler pat, final IAEItemStack slotItem, final boolean shift )
|
||||
{
|
||||
|
||||
this.slotItem = slotItem;
|
||||
@@ -94,7 +94,7 @@ public class PacketPatternSlot extends AppEngPacket
|
||||
this.configureWrite( data );
|
||||
}
|
||||
|
||||
private void writeItem( final IAEItemStack slotItem, final PacketBuffer data ) throws IOException
|
||||
private void writeItem( final IAEItemStack slotItem, final PacketBuffer data )
|
||||
{
|
||||
if( slotItem == null )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user