Most of the 1.8 Port.
This commit is contained in:
@@ -26,12 +26,10 @@ import java.util.List;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
import cpw.mods.fml.client.event.ConfigChangedEvent;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.ModContainer;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
import net.minecraftforge.fml.client.event.ConfigChangedEvent;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.ModContainer;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import appeng.api.config.CondenserOutput;
|
||||
import appeng.api.config.PowerMultiplier;
|
||||
import appeng.api.config.PowerUnits;
|
||||
@@ -184,7 +182,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
}
|
||||
}
|
||||
|
||||
ModContainer imb = cpw.mods.fml.common.Loader.instance().getIndexedModList().get( "ImmibisCore" );
|
||||
ModContainer imb = net.minecraftforge.fml.common.Loader.instance().getIndexedModList().get( "ImmibisCore" );
|
||||
if( imb != null )
|
||||
{
|
||||
List<String> version = Arrays.asList( "59.0.0", "59.0.1", "59.0.2" );
|
||||
|
||||
@@ -19,9 +19,10 @@
|
||||
package appeng.core;
|
||||
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraftforge.fml.relauncher.FMLRelaunchLog;
|
||||
|
||||
import cpw.mods.fml.relauncher.FMLRelaunchLog;
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.tile.AEBaseTile;
|
||||
@@ -80,11 +81,11 @@ public final class AELog
|
||||
log( Level.ERROR, format, data );
|
||||
}
|
||||
|
||||
public static void blockUpdate( int xCoord, int yCoord, int zCoord, AEBaseTile aeBaseTile )
|
||||
public static void blockUpdate( BlockPos pos, AEBaseTile aeBaseTile )
|
||||
{
|
||||
if( AEConfig.instance.isFeatureEnabled( AEFeature.UpdateLogging ) )
|
||||
{
|
||||
info( aeBaseTile.getClass().getName() + " @ " + xCoord + ", " + yCoord + ", " + zCoord );
|
||||
info( aeBaseTile.getClass().getName() + " @ " + pos );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
package appeng.core;
|
||||
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.IAppEngApi;
|
||||
import appeng.api.definitions.Blocks;
|
||||
import appeng.api.definitions.Items;
|
||||
@@ -32,6 +30,7 @@ import appeng.api.networking.IGridBlock;
|
||||
import appeng.api.networking.IGridConnection;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.storage.IStorageHelper;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.core.api.ApiPart;
|
||||
import appeng.core.api.ApiStorage;
|
||||
import appeng.core.features.registries.RegistryContainer;
|
||||
@@ -129,6 +128,6 @@ public final class Api implements IAppEngApi
|
||||
@Override
|
||||
public IGridConnection createGridConnection( IGridNode a, IGridNode b ) throws FailedConnection
|
||||
{
|
||||
return new GridConnection( a, b, ForgeDirection.UNKNOWN );
|
||||
return new GridConnection( a, b, AEPartLocation.INTERNAL );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,23 +21,21 @@ package appeng.core;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerAboutToStartEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppingEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.Mod.EventHandler;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerAboutToStartEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStoppingEvent;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import appeng.core.crash.CrashInfo;
|
||||
import appeng.core.crash.IntegrationCrashEnhancement;
|
||||
import appeng.core.crash.ModCrashEnhancement;
|
||||
@@ -51,8 +49,10 @@ import appeng.services.VersionChecker;
|
||||
import appeng.services.version.VersionCheckerConfig;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
|
||||
@Mod( modid = AppEng.MOD_ID, acceptedMinecraftVersions = "[1.7.10]", name = AppEng.MOD_NAME, version = AEConfig.VERSION, dependencies = AppEng.MOD_DEPENDENCIES, guiFactory = "appeng.client.gui.config.AEConfigGuiFactory" )
|
||||
|
||||
@Mod( modid = AppEng.MOD_ID, acceptedMinecraftVersions = "[1.8]", name = AppEng.MOD_NAME, version = AEConfig.VERSION, dependencies = AppEng.MOD_DEPENDENCIES, guiFactory = "appeng.client.gui.config.AEConfigGuiFactory" )
|
||||
public final class AppEng
|
||||
{
|
||||
public static final String MOD_ID = "appliedenergistics2";
|
||||
@@ -124,7 +124,7 @@ public final class AppEng
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
CommonHelper.proxy.init();
|
||||
CommonHelper.proxy.preinit();
|
||||
}
|
||||
|
||||
Registration.INSTANCE.preInitialize( event );
|
||||
|
||||
@@ -25,10 +25,9 @@ import java.util.Random;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
import appeng.api.parts.CableRenderMode;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.EffectType;
|
||||
@@ -41,7 +40,7 @@ public abstract class CommonHelper
|
||||
@SidedProxy( clientSide = "appeng.client.ClientHelper", serverSide = "appeng.server.ServerHelper" )
|
||||
public static CommonHelper proxy;
|
||||
|
||||
public abstract void init();
|
||||
public abstract void preinit();
|
||||
|
||||
public abstract World getWorld();
|
||||
|
||||
@@ -68,4 +67,9 @@ public abstract class CommonHelper
|
||||
public abstract void updateRenderMode( EntityPlayer player );
|
||||
|
||||
public abstract void missingCoreMod();
|
||||
|
||||
public abstract void configureIcon(Object item, String name );
|
||||
|
||||
public abstract ResourceLocation addIcon(
|
||||
String string );
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IBlocks;
|
||||
import appeng.api.definitions.IDefinitions;
|
||||
|
||||
@@ -19,16 +19,15 @@
|
||||
package appeng.core;
|
||||
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.items.parts.ItemFacade;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
|
||||
public final class CreativeTabFacade extends CreativeTabs
|
||||
{
|
||||
|
||||
@@ -26,9 +26,8 @@ import java.util.regex.Pattern;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry.UniqueIdentifier;
|
||||
|
||||
|
||||
public class FacadeConfig extends Configuration
|
||||
|
||||
@@ -22,8 +22,7 @@ package appeng.core;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import appeng.api.config.TunnelType;
|
||||
import appeng.core.api.IIMCProcessor;
|
||||
import appeng.core.api.imc.IMCBlackListSpatial;
|
||||
|
||||
@@ -22,11 +22,10 @@ package appeng.core;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraftforge.common.config.ConfigCategory;
|
||||
import net.minecraftforge.fml.relauncher.FMLRelaunchLog;
|
||||
|
||||
import cpw.mods.fml.relauncher.FMLRelaunchLog;
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,9 +25,7 @@ import java.util.UUID;
|
||||
|
||||
import net.minecraftforge.common.config.ConfigCategory;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
import cpw.mods.fml.relauncher.FMLRelaunchLog;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.FMLRelaunchLog;
|
||||
import appeng.util.UUIDMatcher;
|
||||
|
||||
|
||||
|
||||
@@ -22,9 +22,8 @@ package appeng.core;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
@@ -33,6 +32,8 @@ import appeng.recipes.loader.ConfigLoader;
|
||||
import appeng.recipes.loader.JarLoader;
|
||||
import appeng.recipes.loader.RecipeResourceCopier;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
|
||||
/**
|
||||
* handles the decision if recipes should be loaded from jar, loaded from file system or force copied from jar
|
||||
|
||||
@@ -27,16 +27,13 @@ import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.common.ChestGenHooks;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.RecipeSorter.Category;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.VillagerRegistry;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.IAppEngApi;
|
||||
import appeng.api.config.Upgrades;
|
||||
@@ -74,7 +71,6 @@ import appeng.core.features.registries.entries.CreativeCellHandler;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.localization.PlayerMessages;
|
||||
import appeng.core.stats.PlayerStatsRegistration;
|
||||
import appeng.hooks.AETrading;
|
||||
import appeng.hooks.TickHandler;
|
||||
import appeng.integration.IntegrationRegistry;
|
||||
import appeng.integration.IntegrationType;
|
||||
@@ -165,7 +161,7 @@ public final class Registration
|
||||
// Register all detected handlers and features (items, blocks) in pre-init
|
||||
for( IFeatureHandler handler : definitions.getFeatureHandlerRegistry().getRegisteredFeatureHandlers() )
|
||||
{
|
||||
handler.register();
|
||||
handler.register(event.getSide() );
|
||||
}
|
||||
|
||||
for( IAEFeature feature : definitions.getFeatureRegistry().getRegisteredFeatures() )
|
||||
@@ -698,7 +694,8 @@ public final class Registration
|
||||
// add villager trading to black smiths for a few basic materials
|
||||
if( AEConfig.instance.isFeatureEnabled( AEFeature.VillagerTrading ) )
|
||||
{
|
||||
VillagerRegistry.instance().registerVillageTradeHandler( 3, new AETrading() );
|
||||
// TODO: VILLAGER TRADING
|
||||
// VillagerRegistry.instance().getRegisteredVillagers()..registerVillageTradeHandler( 3, new AETrading() );
|
||||
}
|
||||
|
||||
if( AEConfig.instance.isFeatureEnabled( AEFeature.CertusQuartzWorldGen ) )
|
||||
|
||||
@@ -32,9 +32,6 @@ import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -43,7 +40,6 @@ import net.minecraftforge.common.DimensionManager;
|
||||
import net.minecraftforge.common.config.ConfigCategory;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
import appeng.api.util.WorldCoord;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketNewStorageDimension;
|
||||
@@ -53,6 +49,9 @@ import appeng.me.GridStorage;
|
||||
import appeng.me.GridStorageSearch;
|
||||
import appeng.services.CompassService;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
|
||||
public class WorldSettings extends Configuration
|
||||
{
|
||||
@@ -343,7 +342,7 @@ public class WorldSettings extends Configuration
|
||||
{
|
||||
for( int newDim : this.get( "DimensionManager", "StorageCells", new int[0] ).getIntList() )
|
||||
{
|
||||
manager.scheduleOutboundPacket( ( new PacketNewStorageDimension( newDim ) ).getProxy() );
|
||||
manager.sendPacket( ( new PacketNewStorageDimension( newDim ) ).getProxy() );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -28,7 +28,13 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.objectweb.asm.ClassReader;
|
||||
import org.objectweb.asm.ClassWriter;
|
||||
@@ -39,18 +45,10 @@ import org.objectweb.asm.tree.ClassNode;
|
||||
import org.objectweb.asm.tree.MethodInsnNode;
|
||||
import org.objectweb.asm.tree.MethodNode;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
import appeng.api.parts.CableRenderMode;
|
||||
import appeng.api.parts.IPartHelper;
|
||||
import appeng.api.parts.IPartItem;
|
||||
import appeng.api.parts.LayerBase;
|
||||
import appeng.client.render.BusRenderer;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.integration.IntegrationRegistry;
|
||||
@@ -60,6 +58,8 @@ import appeng.parts.PartPlacement;
|
||||
import appeng.tile.networking.TileCableBus;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.google.common.base.Joiner;
|
||||
|
||||
|
||||
public class ApiPart implements IPartHelper
|
||||
{
|
||||
@@ -333,14 +333,15 @@ public class ApiPart implements IPartHelper
|
||||
{
|
||||
if( Platform.isClient() && i instanceof Item )
|
||||
{
|
||||
MinecraftForgeClient.registerItemRenderer( (Item) i, BusRenderer.INSTANCE );
|
||||
CommonHelper.proxy.configureIcon( i, null );
|
||||
// MinecraftForgeClient.registerItemRenderer( (Item) i, BusRenderer.INSTANCE );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean placeBus( ItemStack is, int x, int y, int z, int side, EntityPlayer player, World w )
|
||||
public boolean placeBus( ItemStack is, BlockPos pos, EnumFacing side, EntityPlayer player, World w )
|
||||
{
|
||||
return PartPlacement.place( is, x, y, z, side, player, w, PartPlacement.PlaceType.PLACE_ITEM, 0 );
|
||||
return PartPlacement.place( is, pos, side, player, w, PartPlacement.PlaceType.PLACE_ITEM, 0 );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,14 +19,13 @@
|
||||
package appeng.core.api;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import appeng.api.networking.crafting.ICraftingLink;
|
||||
import appeng.api.networking.crafting.ICraftingRequester;
|
||||
import appeng.api.networking.energy.IEnergySource;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package appeng.core.api;
|
||||
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
|
||||
|
||||
public interface IIMCProcessor
|
||||
|
||||
@@ -19,19 +19,13 @@
|
||||
package appeng.core.api.definitions;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.api.definitions.IBlocks;
|
||||
import appeng.api.definitions.ITileDefinition;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
import appeng.block.AEBaseSlabBlock;
|
||||
import appeng.block.crafting.BlockCraftingMonitor;
|
||||
import appeng.block.crafting.BlockCraftingStorage;
|
||||
import appeng.block.crafting.BlockCraftingUnit;
|
||||
import appeng.block.crafting.BlockCraftingUnit.CraftingUnitType;
|
||||
import appeng.block.crafting.BlockMolecularAssembler;
|
||||
import appeng.block.grindstone.BlockCrank;
|
||||
import appeng.block.grindstone.BlockGrinder;
|
||||
@@ -64,25 +58,18 @@ import appeng.block.solids.BlockQuartzGlass;
|
||||
import appeng.block.solids.BlockQuartzLamp;
|
||||
import appeng.block.solids.BlockQuartzPillar;
|
||||
import appeng.block.solids.BlockSkyStone;
|
||||
import appeng.block.solids.BlockSkyStone.SkystoneType;
|
||||
import appeng.block.solids.OreQuartz;
|
||||
import appeng.block.solids.OreQuartzCharged;
|
||||
import appeng.block.spatial.BlockMatrixFrame;
|
||||
import appeng.block.spatial.BlockSpatialIOPort;
|
||||
import appeng.block.spatial.BlockSpatialPylon;
|
||||
import appeng.block.stair.ChiseledQuartzStairBlock;
|
||||
import appeng.block.stair.FluixStairBlock;
|
||||
import appeng.block.stair.QuartzPillarStairBlock;
|
||||
import appeng.block.stair.QuartzStairBlock;
|
||||
import appeng.block.stair.SkyStoneBlockStairBlock;
|
||||
import appeng.block.stair.SkyStoneBrickStairBlock;
|
||||
import appeng.block.stair.SkyStoneSmallBrickStairBlock;
|
||||
import appeng.block.stair.SkyStoneStairBlock;
|
||||
import appeng.block.stair.BlockStairCommon;
|
||||
import appeng.block.storage.BlockChest;
|
||||
import appeng.block.storage.BlockDrive;
|
||||
import appeng.block.storage.BlockIOPort;
|
||||
import appeng.block.storage.BlockSkyChest;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.WrappedDamageItemDefinition;
|
||||
import appeng.block.storage.BlockSkyChest.SkyChestType;
|
||||
import appeng.debug.BlockChunkloader;
|
||||
import appeng.debug.BlockCubeGenerator;
|
||||
import appeng.debug.BlockItemGen;
|
||||
@@ -104,8 +91,12 @@ public final class ApiBlocks implements IBlocks
|
||||
private final IBlockDefinition quartzVibrantGlass;
|
||||
private final IBlockDefinition quartzTorch;
|
||||
private final IBlockDefinition fluix;
|
||||
private final IBlockDefinition skyStone;
|
||||
private final IBlockDefinition skyStone_stone;
|
||||
private final IBlockDefinition skyStone_block;
|
||||
private final IBlockDefinition skyStone_brick;
|
||||
private final IBlockDefinition skyStone_smallbrick;
|
||||
private final IBlockDefinition skyChest;
|
||||
private final IBlockDefinition skyChestBlock;
|
||||
private final IBlockDefinition skyCompass;
|
||||
private final ITileDefinition grindStone;
|
||||
private final ITileDefinition crankHandle;
|
||||
@@ -150,6 +141,7 @@ public final class ApiBlocks implements IBlocks
|
||||
private final IBlockDefinition quartzStair;
|
||||
private final IBlockDefinition chiseledQuartzStair;
|
||||
private final IBlockDefinition quartzPillarStair;
|
||||
/*
|
||||
private final IBlockDefinition skyStoneSlab;
|
||||
private final IBlockDefinition skyStoneBlockSlab;
|
||||
private final IBlockDefinition skyStoneBrickSlab;
|
||||
@@ -158,39 +150,31 @@ public final class ApiBlocks implements IBlocks
|
||||
private final IBlockDefinition quartzSlab;
|
||||
private final IBlockDefinition chiseledQuartzSlab;
|
||||
private final IBlockDefinition quartzPillarSlab;
|
||||
*/
|
||||
|
||||
private final IBlockDefinition itemGen;
|
||||
private final IBlockDefinition chunkLoader;
|
||||
private final IBlockDefinition phantomNode;
|
||||
private final IBlockDefinition cubeGenerator;
|
||||
|
||||
private final Set<IOrientableBlock> orientables;
|
||||
|
||||
public ApiBlocks( DefinitionConstructor constructor )
|
||||
{
|
||||
final BlockLightDetector lightDetector = new BlockLightDetector();
|
||||
final BlockQuartzPillar quartzPillar = new BlockQuartzPillar();
|
||||
final BlockSkyStone skyStone = new BlockSkyStone();
|
||||
final BlockFluix fluixBlock = new BlockFluix();
|
||||
final BlockQuartzGrowthAccelerator cga = new BlockQuartzGrowthAccelerator();
|
||||
final BlockQuartzTorch quartzTorch = new BlockQuartzTorch();
|
||||
final BlockQuartz quartzBlock = new BlockQuartz();
|
||||
final BlockQuartzChiseled chiseledQuartz = new BlockQuartzChiseled();
|
||||
|
||||
this.orientables = ImmutableSet.<IOrientableBlock>of( lightDetector, quartzPillar, skyStone, cga, quartzTorch );
|
||||
|
||||
this.quartzOre = constructor.registerBlockDefinition( new OreQuartz() );
|
||||
this.quartzOreCharged = constructor.registerBlockDefinition( new OreQuartzCharged() );
|
||||
this.matrixFrame = constructor.registerBlockDefinition( new BlockMatrixFrame() );
|
||||
this.quartz = constructor.registerBlockDefinition( quartzBlock );
|
||||
this.quartzPillar = constructor.registerBlockDefinition( quartzPillar );
|
||||
this.quartzChiseled = constructor.registerBlockDefinition( chiseledQuartz );
|
||||
this.quartz = constructor.registerBlockDefinition( new BlockQuartz() );
|
||||
this.quartzPillar = constructor.registerBlockDefinition( new BlockQuartzPillar() );
|
||||
this.quartzChiseled = constructor.registerBlockDefinition( new BlockQuartzChiseled() );
|
||||
this.quartzGlass = constructor.registerBlockDefinition( new BlockQuartzGlass() );
|
||||
this.quartzVibrantGlass = constructor.registerBlockDefinition( new BlockQuartzLamp() );
|
||||
this.quartzTorch = constructor.registerBlockDefinition( quartzTorch );
|
||||
this.fluix = constructor.registerBlockDefinition( fluixBlock );
|
||||
this.skyStone = constructor.registerBlockDefinition( skyStone );
|
||||
this.skyChest = constructor.registerBlockDefinition( new BlockSkyChest() );
|
||||
this.quartzTorch = constructor.registerBlockDefinition( new BlockQuartzTorch() );
|
||||
this.fluix = constructor.registerBlockDefinition( new BlockFluix() );
|
||||
this.skyStone_stone = constructor.registerBlockDefinition( new BlockSkyStone( SkystoneType.stone ) );
|
||||
this.skyStone_block = constructor.registerBlockDefinition( new BlockSkyStone( SkystoneType.block ) );
|
||||
this.skyStone_brick = constructor.registerBlockDefinition( new BlockSkyStone( SkystoneType.brick ) );
|
||||
this.skyStone_smallbrick = constructor.registerBlockDefinition( new BlockSkyStone( SkystoneType.smallbrick ) );
|
||||
this.skyChest = constructor.registerBlockDefinition( new BlockSkyChest(SkyChestType.STONE) );
|
||||
this.skyChestBlock = constructor.registerBlockDefinition( new BlockSkyChest(SkyChestType.BLOCK) );
|
||||
this.skyCompass = constructor.registerBlockDefinition( new BlockSkyCompass() );
|
||||
this.grindStone = constructor.registerTileDefinition( new BlockGrinder() );
|
||||
this.crankHandle = constructor.registerTileDefinition( new BlockCrank() );
|
||||
@@ -213,49 +197,56 @@ public final class ApiBlocks implements IBlocks
|
||||
this.condenser = constructor.registerTileDefinition( new BlockCondenser() );
|
||||
this.energyAcceptor = constructor.registerTileDefinition( new BlockEnergyAcceptor() );
|
||||
this.vibrationChamber = constructor.registerTileDefinition( new BlockVibrationChamber() );
|
||||
this.quartzGrowthAccelerator = constructor.registerTileDefinition( cga );
|
||||
this.quartzGrowthAccelerator = constructor.registerTileDefinition( new BlockQuartzGrowthAccelerator() );
|
||||
this.energyCell = constructor.registerTileDefinition( new BlockEnergyCell() );
|
||||
this.energyCellDense = constructor.registerTileDefinition( new BlockDenseEnergyCell() );
|
||||
this.energyCellCreative = constructor.registerTileDefinition( new BlockCreativeEnergyCell() );
|
||||
this.craftingUnit = constructor.registerTileDefinition( new BlockCraftingUnit() );
|
||||
this.craftingAccelerator = new WrappedDamageItemDefinition( this.craftingUnit, 1 );
|
||||
this.craftingStorage1k = constructor.registerTileDefinition( new BlockCraftingStorage() );
|
||||
this.craftingStorage4k = new WrappedDamageItemDefinition( this.craftingStorage1k, 1 );
|
||||
this.craftingStorage16k = new WrappedDamageItemDefinition( this.craftingStorage1k, 2 );
|
||||
this.craftingStorage64k = new WrappedDamageItemDefinition( this.craftingStorage1k, 3 );
|
||||
this.craftingUnit = constructor.registerTileDefinition( new BlockCraftingUnit(CraftingUnitType.UNIT) );
|
||||
this.craftingAccelerator = constructor.registerTileDefinition( new BlockCraftingUnit(CraftingUnitType.ACCELERATOR) );
|
||||
this.craftingStorage1k = constructor.registerTileDefinition( new BlockCraftingStorage(CraftingUnitType.STORAGE_1K) );
|
||||
this.craftingStorage4k = constructor.registerTileDefinition( new BlockCraftingStorage(CraftingUnitType.STORAGE_4K) );
|
||||
this.craftingStorage16k = constructor.registerTileDefinition( new BlockCraftingStorage(CraftingUnitType.STORAGE_16K) );
|
||||
this.craftingStorage64k = constructor.registerTileDefinition( new BlockCraftingStorage(CraftingUnitType.STORAGE_64K) );
|
||||
this.craftingMonitor = constructor.registerTileDefinition( new BlockCraftingMonitor() );
|
||||
this.molecularAssembler = constructor.registerTileDefinition( new BlockMolecularAssembler() );
|
||||
this.lightDetector = constructor.registerTileDefinition( lightDetector );
|
||||
this.lightDetector = constructor.registerTileDefinition( new BlockLightDetector() );
|
||||
this.paint = constructor.registerTileDefinition( new BlockPaint() );
|
||||
|
||||
this.skyStoneStair = constructor.registerBlockDefinition( new SkyStoneStairBlock( skyStone, 0 ) );
|
||||
this.skyStoneBlockStair = constructor.registerBlockDefinition( new SkyStoneBlockStairBlock( skyStone, 1 ) );
|
||||
this.skyStoneBrickStair = constructor.registerBlockDefinition( new SkyStoneBrickStairBlock( skyStone, 2 ) );
|
||||
this.skyStoneSmallBrickStair = constructor.registerBlockDefinition( new SkyStoneSmallBrickStairBlock( skyStone, 3 ) );
|
||||
|
||||
this.fluixStair = constructor.registerBlockDefinition( new FluixStairBlock( fluixBlock ) );
|
||||
|
||||
this.quartzStair = constructor.registerBlockDefinition( new QuartzStairBlock( quartzBlock ) );
|
||||
|
||||
this.chiseledQuartzStair = constructor.registerBlockDefinition( new ChiseledQuartzStairBlock( chiseledQuartz ) );
|
||||
|
||||
this.quartzPillarStair = constructor.registerBlockDefinition( new QuartzPillarStairBlock( quartzPillar ) );
|
||||
|
||||
this.skyStoneSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneSlabBlock" ) );
|
||||
this.skyStoneBlockSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 1, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneBlockSlabBlock" ) );
|
||||
this.skyStoneBrickSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 2, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneBrickSlabBlock" ) );
|
||||
this.skyStoneSmallBrickSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone, 3, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneSmallBrickSlabBlock" ) );
|
||||
this.fluixSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( fluixBlock, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "FluixSlabBlock" ) );
|
||||
this.quartzSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( quartzBlock, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "QuartzSlabBlock" ) );
|
||||
this.chiseledQuartzSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( chiseledQuartz, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "ChiseledQuartzSlabBlock" ) );;
|
||||
this.quartzPillarSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( quartzPillar, 0, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "QuartzPillarSlabBlock" ) );
|
||||
this.skyStoneStair = makeStairs( constructor,skyStone_stone, "skystone_stone" ) ;
|
||||
this.skyStoneBlockStair = makeStairs( constructor,skyStone_block, "skystone_block" ) ;
|
||||
this.skyStoneBrickStair = makeStairs( constructor,skyStone_brick, "skystone_brick" ) ;
|
||||
this.skyStoneSmallBrickStair = makeStairs( constructor, skyStone_smallbrick, "skystone_smallbrick" ) ;
|
||||
this.fluixStair = makeStairs( constructor, fluix, "fluix" ) ;
|
||||
this.quartzStair = makeStairs( constructor,quartz, "quartz" ) ;
|
||||
this.chiseledQuartzStair = makeStairs( constructor, quartzChiseled, "quartz_chiseled" ) ;
|
||||
this.quartzPillarStair = makeStairs( constructor, quartzPillar, "quartz_pillar" ) ;
|
||||
|
||||
// TODO Re-Add Slabs...
|
||||
/*
|
||||
this.skyStoneSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone_stone, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneSlabBlock" ) );
|
||||
this.skyStoneBlockSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone_block, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneBlockSlabBlock" ) );
|
||||
this.skyStoneBrickSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone_brick, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneBrickSlabBlock" ) );
|
||||
this.skyStoneSmallBrickSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( skyStone_smallbrick, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "SkyStoneSmallBrickSlabBlock" ) );
|
||||
this.fluixSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( fluixBlock, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "FluixSlabBlock" ) );
|
||||
this.quartzSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( quartzBlock, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "QuartzSlabBlock" ) );
|
||||
this.chiseledQuartzSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( chiseledQuartz, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "ChiseledQuartzSlabBlock" ) );;
|
||||
this.quartzPillarSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( quartzPillar, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "QuartzPillarSlabBlock" ) )
|
||||
*/
|
||||
|
||||
this.itemGen = constructor.registerBlockDefinition( new BlockItemGen() );
|
||||
this.chunkLoader = constructor.registerBlockDefinition( new BlockChunkloader() );
|
||||
this.phantomNode = constructor.registerBlockDefinition( new BlockPhantomNode() );
|
||||
this.cubeGenerator = constructor.registerBlockDefinition( new BlockCubeGenerator() );
|
||||
}
|
||||
|
||||
private IBlockDefinition makeStairs(DefinitionConstructor constructor,
|
||||
IBlockDefinition block, String name )
|
||||
{
|
||||
if ( block.maybeBlock().isPresent() )
|
||||
return constructor.registerBlockDefinition( new BlockStairCommon( block.maybeBlock().get(), name ));
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockDefinition quartzOre()
|
||||
{
|
||||
@@ -319,7 +310,25 @@ public final class ApiBlocks implements IBlocks
|
||||
@Override
|
||||
public IBlockDefinition skyStone()
|
||||
{
|
||||
return this.skyStone;
|
||||
return this.skyStone_stone;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockDefinition skyStoneBlock()
|
||||
{
|
||||
return this.skyStone_block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockDefinition skyStoneBrick()
|
||||
{
|
||||
return this.skyStone_brick;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockDefinition skyStoneSmallBrick()
|
||||
{
|
||||
return this.skyStone_smallbrick;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -328,6 +337,12 @@ public final class ApiBlocks implements IBlocks
|
||||
return this.skyChest;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockDefinition skyChestBlock()
|
||||
{
|
||||
return this.skyChestBlock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockDefinition skyCompass()
|
||||
{
|
||||
@@ -382,6 +397,7 @@ public final class ApiBlocks implements IBlocks
|
||||
return this.quartzPillarStair;
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public IBlockDefinition skyStoneSlab()
|
||||
{
|
||||
@@ -429,7 +445,8 @@ public final class ApiBlocks implements IBlocks
|
||||
{
|
||||
return this.quartzPillarSlab;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
@Override
|
||||
public ITileDefinition grindStone()
|
||||
{
|
||||
@@ -660,8 +677,4 @@ public final class ApiBlocks implements IBlocks
|
||||
return this.cubeGenerator;
|
||||
}
|
||||
|
||||
public Set<IOrientableBlock> orientables()
|
||||
{
|
||||
return this.orientables;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,10 +57,10 @@ public final class ApiParts implements IParts
|
||||
private final IItemDefinition p2PTunnelRedstone;
|
||||
private final IItemDefinition p2PTunnelItems;
|
||||
private final IItemDefinition p2PTunnelLiquids;
|
||||
private final IItemDefinition p2PTunnelEU;
|
||||
private final IItemDefinition p2PTunnelRF;
|
||||
//private final IItemDefinition p2PTunnelEU;
|
||||
//private final IItemDefinition p2PTunnelRF;
|
||||
private final IItemDefinition p2PTunnelLight;
|
||||
private final IItemDefinition p2PTunnelOpenComputers;
|
||||
//private final IItemDefinition p2PTunnelOpenComputers;
|
||||
private final IItemDefinition cableAnchor;
|
||||
private final IItemDefinition monitor;
|
||||
private final IItemDefinition semiDarkMonitor;
|
||||
@@ -100,10 +100,10 @@ public final class ApiParts implements IParts
|
||||
this.p2PTunnelRedstone = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelRedstone ) );
|
||||
this.p2PTunnelItems = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelItems ) );
|
||||
this.p2PTunnelLiquids = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelLiquids ) );
|
||||
this.p2PTunnelEU = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelEU ) );
|
||||
this.p2PTunnelRF = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelRF ) );
|
||||
//this.p2PTunnelEU = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelEU ) );
|
||||
//this.p2PTunnelRF = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelRF ) );
|
||||
this.p2PTunnelLight = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelLight ) );
|
||||
this.p2PTunnelOpenComputers = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelOpenComputers ) );
|
||||
//this.p2PTunnelOpenComputers = new DamagedItemDefinition( itemMultiPart.createPart( PartType.P2PTunnelOpenComputers ) );
|
||||
this.cableAnchor = new DamagedItemDefinition( itemMultiPart.createPart( PartType.CableAnchor ) );
|
||||
this.monitor = new DamagedItemDefinition( itemMultiPart.createPart( PartType.Monitor ) );
|
||||
this.semiDarkMonitor = new DamagedItemDefinition( itemMultiPart.createPart( PartType.SemiDarkMonitor ) );
|
||||
@@ -257,7 +257,8 @@ public final class ApiParts implements IParts
|
||||
{
|
||||
return this.p2PTunnelLiquids;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@Override
|
||||
public IItemDefinition p2PTunnelEU()
|
||||
{
|
||||
@@ -269,19 +270,22 @@ public final class ApiParts implements IParts
|
||||
{
|
||||
return this.p2PTunnelRF;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
@Override
|
||||
public IItemDefinition p2PTunnelLight()
|
||||
{
|
||||
return this.p2PTunnelLight;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@Override
|
||||
public IItemDefinition p2PTunnelOpenComputers()
|
||||
{
|
||||
return this.p2PTunnelOpenComputers;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
@Override
|
||||
public IItemDefinition cableAnchor()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,6 @@ package appeng.core.api.definitions;
|
||||
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import appeng.api.definitions.ITileDefinition;
|
||||
|
||||
@@ -21,9 +21,7 @@ package appeng.core.api.imc;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.api.IIMCProcessor;
|
||||
|
||||
@@ -55,9 +55,7 @@ package appeng.core.api.imc;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.core.api.IIMCProcessor;
|
||||
|
||||
|
||||
@@ -34,9 +34,7 @@ package appeng.core.api.imc;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.core.api.IIMCProcessor;
|
||||
|
||||
|
||||
@@ -33,9 +33,7 @@ package appeng.core.api.imc;
|
||||
import java.util.Arrays;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.TunnelType;
|
||||
import appeng.core.api.IIMCProcessor;
|
||||
|
||||
@@ -25,8 +25,7 @@ FMLInterModComms.sendMessage( "appliedenergistics2", "whitelist-spatial", "mymod
|
||||
package appeng.core.api.imc;
|
||||
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.api.IIMCProcessor;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
package appeng.core.crash;
|
||||
|
||||
|
||||
import cpw.mods.fml.common.ICrashCallable;
|
||||
import net.minecraftforge.fml.common.ICrashCallable;
|
||||
|
||||
|
||||
abstract class BaseCrashEnhancement implements ICrashCallable
|
||||
|
||||
@@ -21,15 +21,15 @@ package appeng.core.features;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.GameData;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.CreativeTab;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
|
||||
public final class AEBlockFeatureHandler implements IFeatureHandler
|
||||
@@ -62,20 +62,27 @@ public final class AEBlockFeatureHandler implements IFeatureHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register()
|
||||
public void register(Side side)
|
||||
{
|
||||
if( this.enabled )
|
||||
{
|
||||
String name = this.extractor.get();
|
||||
this.featured.setCreativeTab( CreativeTab.instance );
|
||||
this.featured.setBlockName( /* "tile." */"appliedenergistics2." + name );
|
||||
this.featured.setBlockTextureName( "appliedenergistics2:" + name );
|
||||
this.featured.setUnlocalizedName( /* "tile." */"appliedenergistics2." + name );
|
||||
this.featured.setBlockTextureName( name );
|
||||
|
||||
final String registryName = "tile." + name;
|
||||
|
||||
// Bypass the forge magic with null to register our own itemblock later.
|
||||
GameRegistry.registerBlock( this.featured, null, registryName );
|
||||
GameRegistry.registerItem( this.definition.maybeItem().get(), registryName );
|
||||
|
||||
// register the block/item conversion...
|
||||
if ( this.featured != null && this.definition.maybeItem().isPresent() )
|
||||
GameData.getBlockItemMap().put( this.featured, this.definition.maybeItem().get() );
|
||||
|
||||
if ( side == Side.CLIENT)
|
||||
CommonHelper.proxy.configureIcon( this.featured, name );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,12 +21,10 @@ package appeng.core.features;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.GameData;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import appeng.api.definitions.ITileDefinition;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.block.networking.BlockCableBus;
|
||||
@@ -34,6 +32,8 @@ import appeng.core.CommonHelper;
|
||||
import appeng.core.CreativeTab;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
|
||||
public final class AECableBusFeatureHandler implements IFeatureHandler
|
||||
{
|
||||
@@ -68,14 +68,14 @@ public final class AECableBusFeatureHandler implements IFeatureHandler
|
||||
* Registration of the {@link TileEntity} will actually be handled by {@link BlockCableBus#setupTile()}.
|
||||
*/
|
||||
@Override
|
||||
public void register()
|
||||
public void register(Side side)
|
||||
{
|
||||
if( this.enabled )
|
||||
{
|
||||
String name = this.extractor.get();
|
||||
this.featured.setCreativeTab( CreativeTab.instance );
|
||||
this.featured.setBlockName( /* "tile." */"appliedenergistics2." + name );
|
||||
this.featured.setBlockTextureName( "appliedenergistics2:" + name );
|
||||
this.featured.setUnlocalizedName( /* "tile." */"appliedenergistics2." + name );
|
||||
this.featured.setBlockTextureName( name );
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
@@ -87,6 +87,13 @@ public final class AECableBusFeatureHandler implements IFeatureHandler
|
||||
// Bypass the forge magic with null to register our own itemblock later.
|
||||
GameRegistry.registerBlock( this.featured, null, registryName );
|
||||
GameRegistry.registerItem( this.definition.maybeItem().get(), registryName );
|
||||
|
||||
// register the block/item conversion...
|
||||
if ( this.featured != null && this.definition.maybeItem().isPresent() )
|
||||
GameData.getBlockItemMap().put( this.featured, this.definition.maybeItem().get() );
|
||||
|
||||
if ( side == Side.CLIENT)
|
||||
CommonHelper.proxy.configureIcon( this.featured, name );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,16 +21,17 @@ package appeng.core.features;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.GameData;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import appeng.api.definitions.ITileDefinition;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.CreativeTab;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
|
||||
public final class AETileBlockFeatureHandler implements IFeatureHandler
|
||||
{
|
||||
@@ -62,14 +63,14 @@ public final class AETileBlockFeatureHandler implements IFeatureHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register()
|
||||
public void register(Side side)
|
||||
{
|
||||
if( this.enabled )
|
||||
{
|
||||
String name = this.extractor.get();
|
||||
this.featured.setCreativeTab( CreativeTab.instance );
|
||||
this.featured.setBlockName( /* "tile." */"appliedenergistics2." + name );
|
||||
this.featured.setBlockTextureName( "appliedenergistics2:" + name );
|
||||
this.featured.setUnlocalizedName( /* "tile." */"appliedenergistics2." + name );
|
||||
this.featured.setBlockTextureName( name );
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
@@ -81,7 +82,15 @@ public final class AETileBlockFeatureHandler implements IFeatureHandler
|
||||
// Bypass the forge magic with null to register our own itemblock later.
|
||||
GameRegistry.registerBlock( this.featured, null, registryName );
|
||||
GameRegistry.registerItem( this.definition.maybeItem().get(), registryName );
|
||||
|
||||
// register the block/item conversion...
|
||||
if ( this.featured != null && this.definition.maybeItem().isPresent() )
|
||||
GameData.getBlockItemMap().put( this.featured, this.definition.maybeItem().get() );
|
||||
|
||||
GameRegistry.registerTileEntity( this.featured.getTileEntityClass(), this.featured.toString() );
|
||||
|
||||
if ( side == Side.CLIENT)
|
||||
CommonHelper.proxy.configureIcon( this.featured, name );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,19 +21,19 @@ package appeng.core.features;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ObjectArrays;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.block.AEBaseBlock;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ObjectArrays;
|
||||
|
||||
|
||||
public class BlockDefinition extends ItemDefinition implements IBlockDefinition
|
||||
{
|
||||
@@ -151,8 +151,8 @@ public class BlockDefinition extends ItemDefinition implements IBlockDefinition
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isSameAs( IBlockAccess world, int x, int y, int z )
|
||||
public final boolean isSameAs( IBlockAccess world, BlockPos pos )
|
||||
{
|
||||
return this.enabled && world.getBlock( x, y, z ) == this.block;
|
||||
return this.enabled && world.getBlockState( pos ).getBlock() == this.block;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.api.util.AEColoredItemDefinition;
|
||||
|
||||
|
||||
@@ -21,15 +21,15 @@ package appeng.core.features;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
|
||||
public final class DamagedItemDefinition implements IItemDefinition
|
||||
{
|
||||
@@ -68,7 +68,7 @@ public final class DamagedItemDefinition implements IItemDefinition
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameAs( IBlockAccess world, int x, int y, int z )
|
||||
public boolean isSameAs( IBlockAccess world, BlockPos pos )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.api.definitions.IComparableDefinition;
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
@@ -86,7 +86,7 @@ public final class DefinitionConverter
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sameAsBlock( IBlockAccess world, int x, int y, int z )
|
||||
public boolean sameAsBlock( IBlockAccess world, BlockPos pos )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -139,9 +139,9 @@ public final class DefinitionConverter
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sameAsBlock( IBlockAccess world, int x, int y, int z )
|
||||
public boolean sameAsBlock( IBlockAccess world, BlockPos pos )
|
||||
{
|
||||
return this.definition.isSameAs( world, x, y, z );
|
||||
return this.definition.isSameAs( world, pos );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package appeng.core.features;
|
||||
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
|
||||
|
||||
@@ -28,5 +29,5 @@ public interface IFeatureHandler
|
||||
|
||||
IItemDefinition getDefinition();
|
||||
|
||||
void register();
|
||||
void register(Side side );
|
||||
}
|
||||
|
||||
@@ -19,16 +19,16 @@
|
||||
package appeng.core.features;
|
||||
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
|
||||
public class ItemDefinition implements IItemDefinition
|
||||
{
|
||||
@@ -70,7 +70,7 @@ public class ItemDefinition implements IItemDefinition
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameAs( IBlockAccess world, int x, int y, int z )
|
||||
public boolean isSameAs( IBlockAccess world, BlockPos pos )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -21,17 +21,17 @@ package appeng.core.features;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.CreativeTab;
|
||||
import appeng.core.CreativeTabFacade;
|
||||
import appeng.items.parts.ItemFacade;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
|
||||
public final class ItemFeatureHandler implements IFeatureHandler
|
||||
{
|
||||
@@ -63,12 +63,14 @@ public final class ItemFeatureHandler implements IFeatureHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register()
|
||||
public void register(Side side)
|
||||
{
|
||||
if( this.enabled )
|
||||
{
|
||||
String name = this.extractor.get();
|
||||
this.item.setTextureName( "appliedenergistics2:" + name );
|
||||
String itemPhysicalName = name;
|
||||
|
||||
//this.item.setTextureName( "appliedenergistics2:" + name );
|
||||
this.item.setUnlocalizedName( /* "item." */"appliedenergistics2." + name );
|
||||
|
||||
if( this.item instanceof ItemFacade )
|
||||
@@ -90,6 +92,20 @@ public final class ItemFeatureHandler implements IFeatureHandler
|
||||
}
|
||||
|
||||
GameRegistry.registerItem( this.item, "item." + name );
|
||||
|
||||
if ( side == Side.CLIENT )
|
||||
{
|
||||
CommonHelper.proxy.configureIcon( item, itemPhysicalName );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void configureIcon(
|
||||
Item item,
|
||||
int meta,
|
||||
String name )
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ package appeng.core.features;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.items.materials.MaterialType;
|
||||
|
||||
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.core.features;
|
||||
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.block.AEBaseItemBlockSlab;
|
||||
import appeng.block.AEBaseSlabBlock;
|
||||
import appeng.core.CreativeTab;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
|
||||
public class SlabBlockFeatureHandler implements IFeatureHandler
|
||||
{
|
||||
private final AEBaseSlabBlock slabs;
|
||||
private final FeatureNameExtractor extractor;
|
||||
private final boolean enabled;
|
||||
private final BlockDefinition definition;
|
||||
|
||||
public SlabBlockFeatureHandler( EnumSet<AEFeature> features, AEBaseSlabBlock slabs )
|
||||
{
|
||||
final ActivityState state = new FeaturedActiveChecker( features ).getActivityState();
|
||||
this.slabs = slabs;
|
||||
this.extractor = new FeatureNameExtractor( slabs.getClass(), Optional.<String>absent());
|
||||
this.enabled = state == ActivityState.Enabled;
|
||||
this.definition = new BlockDefinition( slabs, state );
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isFeatureAvailable()
|
||||
{
|
||||
return this.enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final IBlockDefinition getDefinition()
|
||||
{
|
||||
return this.definition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void register()
|
||||
{
|
||||
if( this.enabled )
|
||||
{
|
||||
this.slabs.setCreativeTab( CreativeTab.instance );
|
||||
GameRegistry.registerBlock( slabs, AEBaseItemBlockSlab.class, "tile." + slabs.name(), slabs, slabs.doubleSlabs(), false);
|
||||
GameRegistry.registerBlock( slabs.doubleSlabs(), AEBaseItemBlockSlab.class, "tile." + slabs.name() + ".double", slabs, slabs.doubleSlabs(), true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,15 +21,14 @@ package appeng.core.features;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.block.BlockStairs;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.core.CreativeTab;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
|
||||
public class StairBlockFeatureHandler implements IFeatureHandler
|
||||
{
|
||||
@@ -61,14 +60,14 @@ public class StairBlockFeatureHandler implements IFeatureHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void register()
|
||||
public final void register(Side side)
|
||||
{
|
||||
if( this.enabled )
|
||||
{
|
||||
String name = this.extractor.get();
|
||||
this.stairs.setCreativeTab( CreativeTab.instance );
|
||||
this.stairs.setBlockName( "appliedenergistics2." + name );
|
||||
this.stairs.setBlockTextureName( "appliedenergistics2:" + name );
|
||||
this.stairs.setUnlocalizedName( "appliedenergistics2." + name );
|
||||
//this.stairs.setBlockTextureName( "appliedenergistics2:" + name );
|
||||
|
||||
GameRegistry.registerBlock( this.stairs, "tile." + name );
|
||||
}
|
||||
|
||||
@@ -19,14 +19,13 @@
|
||||
package appeng.core.features;
|
||||
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.api.definitions.ITileDefinition;
|
||||
import appeng.block.AEBaseTileBlock;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
|
||||
public final class TileDefinition extends BlockDefinition implements ITileDefinition
|
||||
{
|
||||
|
||||
@@ -1,122 +0,0 @@
|
||||
/*
|
||||
* 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 <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.core.features;
|
||||
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import appeng.api.definitions.ITileDefinition;
|
||||
|
||||
|
||||
public final class WrappedDamageItemDefinition implements ITileDefinition
|
||||
{
|
||||
private final ITileDefinition definition;
|
||||
private final int damage;
|
||||
|
||||
public WrappedDamageItemDefinition( ITileDefinition definition, int damage )
|
||||
{
|
||||
Preconditions.checkNotNull( definition );
|
||||
Preconditions.checkArgument( damage >= 0 );
|
||||
|
||||
this.definition = definition;
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<? extends Class<? extends TileEntity>> maybeEntity()
|
||||
{
|
||||
return this.definition.maybeEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Block> maybeBlock()
|
||||
{
|
||||
return this.definition.maybeBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<ItemBlock> maybeItemBlock()
|
||||
{
|
||||
return this.definition.maybeItemBlock();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Item> maybeItem()
|
||||
{
|
||||
return this.definition.maybeItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<ItemStack> maybeStack( final int stackSize )
|
||||
{
|
||||
return this.definition.maybeBlock().transform( new BlockTransformFunction( stackSize, this.damage ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameAs( ItemStack comparableStack )
|
||||
{
|
||||
if( comparableStack == null )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final boolean sameItem = this.definition.isSameAs( new ItemStack( comparableStack.getItem() ) );
|
||||
final boolean sameDamage = comparableStack.getItemDamage() == this.damage;
|
||||
|
||||
return sameItem && sameDamage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSameAs( IBlockAccess world, int x, int y, int z )
|
||||
{
|
||||
return this.definition.isSameAs( world, x, y, z ) && world.getBlockMetadata( x, y, z ) == this.damage;
|
||||
}
|
||||
|
||||
private static final class BlockTransformFunction implements Function<Block, ItemStack>
|
||||
{
|
||||
private final int stackSize;
|
||||
private final int damage;
|
||||
|
||||
public BlockTransformFunction( int stackSize, int damage )
|
||||
{
|
||||
Preconditions.checkArgument( stackSize > 0 );
|
||||
Preconditions.checkArgument( damage >= 0 );
|
||||
|
||||
this.stackSize = stackSize;
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack apply( Block input )
|
||||
{
|
||||
Preconditions.checkNotNull( input );
|
||||
|
||||
return new ItemStack( input, this.stackSize, this.damage );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.storage.ICellHandler;
|
||||
import appeng.api.storage.ICellRegistry;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
|
||||
@@ -23,8 +23,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.storage.IExternalStorageHandler;
|
||||
import appeng.api.storage.IExternalStorageRegistry;
|
||||
@@ -50,7 +49,7 @@ public class ExternalStorageRegistry implements IExternalStorageRegistry
|
||||
}
|
||||
|
||||
@Override
|
||||
public IExternalStorageHandler getHandler( TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource mySrc )
|
||||
public IExternalStorageHandler getHandler( TileEntity te, EnumFacing d, StorageChannel chan, BaseActionSource mySrc )
|
||||
{
|
||||
for( IExternalStorageHandler x : this.Handlers )
|
||||
{
|
||||
|
||||
@@ -28,7 +28,6 @@ import java.util.Map.Entry;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.features.IGrinderEntry;
|
||||
import appeng.api.features.IGrinderRegistry;
|
||||
import appeng.core.AEConfig;
|
||||
|
||||
@@ -11,7 +11,6 @@ import java.util.Set;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.features.IInscriberRecipe;
|
||||
import appeng.api.features.IInscriberRecipeBuilder;
|
||||
import appeng.api.features.IInscriberRegistry;
|
||||
|
||||
@@ -23,9 +23,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import appeng.api.events.LocatableEventAnnounce;
|
||||
import appeng.api.events.LocatableEventAnnounce.LocatableEvent;
|
||||
import appeng.api.features.ILocatable;
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.util.HashMap;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.features.IMatterCannonAmmoRegistry;
|
||||
import appeng.recipes.ores.IOreListener;
|
||||
import appeng.recipes.ores.OreDictionaryHandler;
|
||||
|
||||
@@ -25,7 +25,6 @@ import java.util.LinkedList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.api.exceptions.AppEngException;
|
||||
import appeng.api.movable.IMovableHandler;
|
||||
import appeng.api.movable.IMovableRegistry;
|
||||
|
||||
@@ -21,16 +21,16 @@ package appeng.core.features.registries;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.TunnelType;
|
||||
import appeng.api.definitions.IBlocks;
|
||||
@@ -158,14 +158,14 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry
|
||||
@Nullable
|
||||
private ItemStack getModItem( String modID, String name, int meta )
|
||||
{
|
||||
ItemStack myItemStack = GameRegistry.findItemStack( modID, name, 1 );
|
||||
Item item = GameRegistry.findItem( modID, name );
|
||||
|
||||
if( myItemStack == null )
|
||||
if( item == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
myItemStack.setItemDamage( meta );
|
||||
|
||||
ItemStack myItemStack = new ItemStack( item, 1, meta );
|
||||
return myItemStack;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,13 +19,12 @@
|
||||
package appeng.core.features.registries;
|
||||
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import appeng.api.features.IPlayerRegistry;
|
||||
import appeng.core.WorldSettings;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
|
||||
public class PlayerRegistry implements IPlayerRegistry
|
||||
{
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.features.IItemComparison;
|
||||
import appeng.api.features.IItemComparisonProvider;
|
||||
import appeng.api.features.ISpecialComparisonRegistry;
|
||||
|
||||
@@ -25,7 +25,6 @@ import java.util.List;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.features.ILocatable;
|
||||
import appeng.api.features.IWirelessTermHandler;
|
||||
|
||||
@@ -23,7 +23,6 @@ import java.util.HashSet;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldProvider;
|
||||
|
||||
import appeng.api.features.IWorldGen;
|
||||
|
||||
|
||||
@@ -96,8 +95,8 @@ public final class WorldGenRegistry implements IWorldGen
|
||||
}
|
||||
|
||||
boolean isBadProvider = this.types[type.ordinal()].badProviders.contains( w.provider.getClass() );
|
||||
boolean isBadDimension = this.types[type.ordinal()].badDimensions.contains( w.provider.dimensionId );
|
||||
boolean isGoodDimension = this.types[type.ordinal()].enabledDimensions.contains( w.provider.dimensionId );
|
||||
boolean isBadDimension = this.types[type.ordinal()].badDimensions.contains( w.provider.getDimensionId() );
|
||||
boolean isGoodDimension = this.types[type.ordinal()].enabledDimensions.contains( w.provider.getDimensionId() );
|
||||
|
||||
if( isBadProvider || isBadDimension )
|
||||
{
|
||||
|
||||
@@ -20,7 +20,6 @@ package appeng.core.features.registries.entries;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.features.IGrinderEntry;
|
||||
|
||||
|
||||
|
||||
@@ -22,8 +22,6 @@ package appeng.core.features.registries.entries;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import appeng.api.implementations.tiles.IChestOrDrive;
|
||||
import appeng.api.storage.ICellHandler;
|
||||
import appeng.api.storage.ICellInventory;
|
||||
@@ -32,7 +30,9 @@ import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
import appeng.api.storage.ISaveProvider;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.client.texture.ExtraBlockTextures;
|
||||
import appeng.client.texture.IAESprite;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.me.storage.CellInventory;
|
||||
import appeng.me.storage.CellInventoryHandler;
|
||||
@@ -59,19 +59,19 @@ public class BasicCellHandler implements ICellHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTopTexture_Light()
|
||||
public IAESprite getTopTexture_Light()
|
||||
{
|
||||
return ExtraBlockTextures.BlockMEChestItems_Light.getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTopTexture_Medium()
|
||||
public IAESprite getTopTexture_Medium()
|
||||
{
|
||||
return ExtraBlockTextures.BlockMEChestItems_Medium.getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTopTexture_Dark()
|
||||
public IAESprite getTopTexture_Dark()
|
||||
{
|
||||
return ExtraBlockTextures.BlockMEChestItems_Dark.getIcon();
|
||||
}
|
||||
@@ -79,7 +79,7 @@ public class BasicCellHandler implements ICellHandler
|
||||
@Override
|
||||
public void openChestGui( EntityPlayer player, IChestOrDrive chest, ICellHandler cellHandler, IMEInventoryHandler inv, ItemStack is, StorageChannel chan )
|
||||
{
|
||||
Platform.openGUI( player, (TileEntity) chest, chest.getUp(), GuiBridge.GUI_ME );
|
||||
Platform.openGUI( player, (TileEntity) chest, AEPartLocation.fromFacing( chest.getUp() ), GuiBridge.GUI_ME );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -22,15 +22,15 @@ package appeng.core.features.registries.entries;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import appeng.api.implementations.tiles.IChestOrDrive;
|
||||
import appeng.api.storage.ICellHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
import appeng.api.storage.ISaveProvider;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.client.texture.ExtraBlockTextures;
|
||||
import appeng.client.texture.IAESprite;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.items.storage.ItemCreativeStorageCell;
|
||||
import appeng.me.storage.CreativeCellInventory;
|
||||
@@ -57,19 +57,19 @@ public class CreativeCellHandler implements ICellHandler
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTopTexture_Light()
|
||||
public IAESprite getTopTexture_Light()
|
||||
{
|
||||
return ExtraBlockTextures.BlockMEChestItems_Light.getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTopTexture_Medium()
|
||||
public IAESprite getTopTexture_Medium()
|
||||
{
|
||||
return ExtraBlockTextures.BlockMEChestItems_Medium.getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTopTexture_Dark()
|
||||
public IAESprite getTopTexture_Dark()
|
||||
{
|
||||
return ExtraBlockTextures.BlockMEChestItems_Dark.getIcon();
|
||||
}
|
||||
@@ -77,7 +77,7 @@ public class CreativeCellHandler implements ICellHandler
|
||||
@Override
|
||||
public void openChestGui( EntityPlayer player, IChestOrDrive chest, ICellHandler cellHandler, IMEInventoryHandler inv, ItemStack is, StorageChannel chan )
|
||||
{
|
||||
Platform.openGUI( player, (TileEntity) chest, chest.getUp(), GuiBridge.GUI_ME );
|
||||
Platform.openGUI( player, (TileEntity) chest, AEPartLocation.fromFacing( chest.getUp() ), GuiBridge.GUI_ME );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,8 +21,7 @@ package appeng.core.features.registries.entries;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.storage.IExternalStorageHandler;
|
||||
import appeng.api.storage.IMEInventory;
|
||||
@@ -35,13 +34,13 @@ public class ExternalIInv implements IExternalStorageHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean canHandle( TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource mySrc )
|
||||
public boolean canHandle( TileEntity te, EnumFacing d, StorageChannel channel, BaseActionSource mySrc )
|
||||
{
|
||||
return channel == StorageChannel.ITEMS && te instanceof IInventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMEInventory getInventory( TileEntity te, ForgeDirection d, StorageChannel channel, BaseActionSource src )
|
||||
public IMEInventory getInventory( TileEntity te, EnumFacing d, StorageChannel channel, BaseActionSource src )
|
||||
{
|
||||
InventoryAdaptor ad = InventoryAdaptor.getAdaptor( te, d );
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.features.InscriberProcessType;
|
||||
|
||||
|
||||
|
||||
@@ -8,13 +8,12 @@ import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.features.IInscriberRecipe;
|
||||
import appeng.api.features.InscriberProcessType;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
|
||||
/**
|
||||
* Basic inscriber recipe
|
||||
|
||||
@@ -19,9 +19,8 @@
|
||||
package appeng.core.stats;
|
||||
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
|
||||
@@ -20,10 +20,8 @@ package appeng.core.stats;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.PlayerEvent;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ package appeng.core.stats;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import appeng.api.util.AEColor;
|
||||
|
||||
@@ -23,9 +23,7 @@ import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraftforge.common.AchievementPage;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.EventBus;
|
||||
|
||||
import net.minecraftforge.fml.common.eventhandler.EventBus;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
@@ -38,7 +36,7 @@ import appeng.core.features.AEFeature;
|
||||
public class PlayerStatsRegistration
|
||||
{
|
||||
/**
|
||||
* {@link cpw.mods.fml.common.eventhandler.EventBus} to which the handlers might get posted to depending if the feature is enabled
|
||||
* {@link net.minecraftforge.fml.common.eventhandler.EventBus} to which the handlers might get posted to depending if the feature is enabled
|
||||
*/
|
||||
private final EventBus bus;
|
||||
|
||||
@@ -48,7 +46,7 @@ public class PlayerStatsRegistration
|
||||
private final boolean isAchievementFeatureEnabled;
|
||||
|
||||
/**
|
||||
* Constructs this with an {@link cpw.mods.fml.common.eventhandler.EventBus} and {@link appeng.core.AEConfig}.
|
||||
* Constructs this with an {@link net.minecraftforge.fml.common.eventhandler.EventBus} and {@link appeng.core.AEConfig}.
|
||||
*
|
||||
* @param bus {@see #bus}
|
||||
* @param config {@link appeng.core.AEConfig} which is used to determine if the {@link appeng.core.features.AEFeature#Achievements} is enabled
|
||||
|
||||
@@ -21,10 +21,13 @@ package appeng.core.sync;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
|
||||
|
||||
import net.minecraft.network.INetHandler;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.features.AEFeature;
|
||||
@@ -32,11 +35,11 @@ import appeng.core.sync.network.INetworkInfo;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
|
||||
|
||||
public abstract class AppEngPacket
|
||||
public abstract class AppEngPacket implements Packet
|
||||
{
|
||||
|
||||
AppEngPacketHandlerBase.PacketTypes id;
|
||||
private ByteBuf p;
|
||||
private PacketBuffer p;
|
||||
|
||||
public void serverPacketData( INetworkInfo manager, AppEngPacket packet, EntityPlayer player )
|
||||
{
|
||||
@@ -56,7 +59,7 @@ public abstract class AppEngPacket
|
||||
protected void configureWrite( ByteBuf data )
|
||||
{
|
||||
data.capacity( data.readableBytes() );
|
||||
this.p = data;
|
||||
this.p = new PacketBuffer(data);
|
||||
}
|
||||
|
||||
public FMLProxyPacket getProxy()
|
||||
@@ -75,4 +78,27 @@ public abstract class AppEngPacket
|
||||
|
||||
return pp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readPacketData(PacketBuffer buf) throws IOException
|
||||
{
|
||||
throw new RuntimeException( "Not Implemented" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writePacketData(PacketBuffer buf) throws IOException
|
||||
{
|
||||
throw new RuntimeException( "Not Implemented" );
|
||||
}
|
||||
|
||||
PacketCallState caller;
|
||||
|
||||
public void setCallParam( PacketCallState call ){caller = call;}
|
||||
|
||||
@Override
|
||||
public void processPacket(INetHandler handler)
|
||||
{
|
||||
caller.call(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
package appeng.core.sync;
|
||||
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import appeng.core.sync.packets.PacketAssemblerAnimation;
|
||||
import appeng.core.sync.packets.PacketClick;
|
||||
import appeng.core.sync.packets.PacketCompassRequest;
|
||||
|
||||
@@ -22,19 +22,15 @@ package appeng.core.sync;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
import net.minecraftforge.fml.common.network.IGuiHandler;
|
||||
import net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
import appeng.api.definitions.IComparableDefinition;
|
||||
@@ -53,6 +49,7 @@ import appeng.api.networking.security.ISecurityGrid;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.client.gui.GuiNull;
|
||||
import appeng.container.AEBaseContainer;
|
||||
@@ -119,6 +116,8 @@ import appeng.tile.storage.TileIOPort;
|
||||
import appeng.tile.storage.TileSkyChest;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
|
||||
public enum GuiBridge implements IGuiHandler
|
||||
{
|
||||
@@ -247,7 +246,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
@Override
|
||||
public Object getServerGuiElement( int ordinal, EntityPlayer player, World w, int x, int y, int z )
|
||||
{
|
||||
ForgeDirection side = ForgeDirection.getOrientation( ordinal & 0x07 );
|
||||
AEPartLocation side = AEPartLocation.fromOrdinal( ordinal & 0x07 );
|
||||
GuiBridge ID = values()[ordinal >> 4];
|
||||
boolean stem = ( ( ordinal >> 3 ) & 1 ) == 1;
|
||||
if( ID.type.isItem() )
|
||||
@@ -269,7 +268,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
}
|
||||
if( ID.type.isTile() )
|
||||
{
|
||||
TileEntity TE = w.getTileEntity( x, y, z );
|
||||
TileEntity TE = w.getTileEntity( new BlockPos(x,y,z) );
|
||||
if( TE instanceof IPartHost )
|
||||
{
|
||||
( (IPartHost) TE ).getPart( side );
|
||||
@@ -296,7 +295,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
{
|
||||
if( it.getItem() instanceof IGuiItem )
|
||||
{
|
||||
return ( (IGuiItem) it.getItem() ).getGuiObject( it, w, x, y, z );
|
||||
return ( (IGuiItem) it.getItem() ).getGuiObject( it, w, new BlockPos(x,y,z) );
|
||||
}
|
||||
|
||||
IWirelessTermHandler wh = AEApi.instance().registries().wireless().getWirelessTerminalHandler( it );
|
||||
@@ -319,7 +318,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
return this.tileClass.isInstance( tE );
|
||||
}
|
||||
|
||||
private Object updateGui( Object newContainer, World w, int x, int y, int z, ForgeDirection side, Object myItem )
|
||||
private Object updateGui( Object newContainer, World w, int x, int y, int z, AEPartLocation side, Object myItem )
|
||||
{
|
||||
if( newContainer instanceof AEBaseContainer )
|
||||
{
|
||||
@@ -335,7 +334,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
return newContainer;
|
||||
}
|
||||
|
||||
public Object ConstructContainer( InventoryPlayer inventory, ForgeDirection side, Object tE )
|
||||
public Object ConstructContainer( InventoryPlayer inventory, AEPartLocation side, Object tE )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -429,7 +428,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
@Override
|
||||
public Object getClientGuiElement( int ordinal, EntityPlayer player, World w, int x, int y, int z )
|
||||
{
|
||||
ForgeDirection side = ForgeDirection.getOrientation( ordinal & 0x07 );
|
||||
AEPartLocation side = AEPartLocation.fromOrdinal( ordinal & 0x07 );
|
||||
GuiBridge ID = values()[ordinal >> 4];
|
||||
boolean stem = ( ( ordinal >> 3 ) & 1 ) == 1;
|
||||
if( ID.type.isItem() )
|
||||
@@ -451,7 +450,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
}
|
||||
if( ID.type.isTile() )
|
||||
{
|
||||
TileEntity TE = w.getTileEntity( x, y, z );
|
||||
TileEntity TE = w.getTileEntity( new BlockPos(x,y,z) );
|
||||
if( TE instanceof IPartHost )
|
||||
{
|
||||
( (IPartHost) TE ).getPart( side );
|
||||
@@ -472,7 +471,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
return new GuiNull( new ContainerNull() );
|
||||
}
|
||||
|
||||
public Object ConstructGui( InventoryPlayer inventory, ForgeDirection side, Object tE )
|
||||
public Object ConstructGui( InventoryPlayer inventory, AEPartLocation side, Object tE )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -497,18 +496,19 @@ public enum GuiBridge implements IGuiHandler
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasPermissions( TileEntity te, int x, int y, int z, ForgeDirection side, EntityPlayer player )
|
||||
public boolean hasPermissions( TileEntity te, int x, int y, int z, AEPartLocation side, EntityPlayer player )
|
||||
{
|
||||
World w = player.getEntityWorld();
|
||||
BlockPos pos = new BlockPos(x,y,z);
|
||||
|
||||
if( Platform.hasPermissions( te != null ? new DimensionalCoord( te ) : new DimensionalCoord( player.worldObj, x, y, z ), player ) )
|
||||
if( Platform.hasPermissions( te != null ? new DimensionalCoord( te ) : new DimensionalCoord( player.worldObj, pos ), player ) )
|
||||
{
|
||||
if( this.type.isItem() )
|
||||
{
|
||||
ItemStack it = player.inventory.getCurrentItem();
|
||||
if( it != null && it.getItem() instanceof IGuiItem )
|
||||
{
|
||||
Object myItem = ( (IGuiItem) it.getItem() ).getGuiObject( it, w, x, y, z );
|
||||
Object myItem = ( (IGuiItem) it.getItem() ).getGuiObject( it, w, pos );
|
||||
if( this.CorrectTileOrPart( myItem ) )
|
||||
{
|
||||
return true;
|
||||
@@ -518,7 +518,7 @@ public enum GuiBridge implements IGuiHandler
|
||||
|
||||
if( this.type.isTile() )
|
||||
{
|
||||
TileEntity TE = w.getTileEntity( x, y, z );
|
||||
TileEntity TE = w.getTileEntity( pos );
|
||||
if( TE instanceof IPartHost )
|
||||
{
|
||||
( (IPartHost) TE ).getPart( side );
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package appeng.core.sync;
|
||||
|
||||
abstract public class PacketCallState
|
||||
{
|
||||
|
||||
public abstract void call( AppEngPacket appEngPacket );
|
||||
|
||||
|
||||
}
|
||||
@@ -19,36 +19,53 @@
|
||||
package appeng.core.sync.network;
|
||||
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
|
||||
|
||||
import net.minecraft.network.INetHandler;
|
||||
import net.minecraft.network.PacketThreadUtil;
|
||||
import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.AppEngPacketHandlerBase;
|
||||
import appeng.core.sync.PacketCallState;
|
||||
|
||||
|
||||
public class AppEngClientPacketHandler extends AppEngPacketHandlerBase implements IPacketHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public void onPacketData( INetworkInfo network, FMLProxyPacket packet, EntityPlayer player )
|
||||
public void onPacketData(
|
||||
final INetworkInfo manager,
|
||||
INetHandler handler,
|
||||
FMLProxyPacket packet,
|
||||
final EntityPlayer player )
|
||||
{
|
||||
ByteBuf stream = packet.payload();
|
||||
int packetType = -1;
|
||||
|
||||
player = Minecraft.getMinecraft().thePlayer;
|
||||
|
||||
try
|
||||
{
|
||||
packetType = stream.readInt();
|
||||
AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream );
|
||||
pack.clientPacketData( network, pack, player );
|
||||
|
||||
PacketCallState callState =
|
||||
new PacketCallState(){
|
||||
|
||||
@Override
|
||||
public void call(
|
||||
AppEngPacket appEngPacket )
|
||||
{
|
||||
appEngPacket.clientPacketData( manager, appEngPacket, Minecraft.getMinecraft().thePlayer );
|
||||
}
|
||||
};
|
||||
|
||||
pack.setCallParam(callState);
|
||||
PacketThreadUtil.checkThreadAndEnqueue( pack, handler, Minecraft.getMinecraft() );
|
||||
callState.call( pack );
|
||||
}
|
||||
catch( InstantiationException e )
|
||||
{
|
||||
|
||||
@@ -19,24 +19,26 @@
|
||||
package appeng.core.sync.network;
|
||||
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.INetHandler;
|
||||
import net.minecraft.network.PacketThreadUtil;
|
||||
import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
|
||||
import appeng.core.AELog;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.AppEngPacketHandlerBase;
|
||||
import appeng.core.sync.PacketCallState;
|
||||
|
||||
|
||||
public final class AppEngServerPacketHandler extends AppEngPacketHandlerBase implements IPacketHandler
|
||||
{
|
||||
|
||||
@Override
|
||||
public void onPacketData( INetworkInfo manager, FMLProxyPacket packet, EntityPlayer player )
|
||||
public void onPacketData( final INetworkInfo manager, INetHandler handler, FMLProxyPacket packet, final EntityPlayer player )
|
||||
{
|
||||
ByteBuf stream = packet.payload();
|
||||
int packetType = -1;
|
||||
@@ -45,7 +47,21 @@ public final class AppEngServerPacketHandler extends AppEngPacketHandlerBase imp
|
||||
{
|
||||
packetType = stream.readInt();
|
||||
AppEngPacket pack = PacketTypes.getPacket( packetType ).parsePacket( stream );
|
||||
pack.serverPacketData( manager, pack, player );
|
||||
|
||||
PacketCallState callState =
|
||||
new PacketCallState(){
|
||||
|
||||
@Override
|
||||
public void call(
|
||||
AppEngPacket appEngPacket )
|
||||
{
|
||||
appEngPacket.serverPacketData( manager, appEngPacket, player);
|
||||
}
|
||||
};
|
||||
|
||||
pack.setCallParam(callState);
|
||||
PacketThreadUtil.checkThreadAndEnqueue( pack, handler, ((EntityPlayerMP)player).getServerForPlayer() );
|
||||
callState.call( pack );
|
||||
}
|
||||
catch( InstantiationException e )
|
||||
{
|
||||
|
||||
@@ -20,12 +20,13 @@ package appeng.core.sync.network;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
|
||||
import net.minecraft.network.INetHandler;
|
||||
import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
|
||||
|
||||
|
||||
public interface IPacketHandler
|
||||
{
|
||||
|
||||
void onPacketData( INetworkInfo manager, FMLProxyPacket packet, EntityPlayer player );
|
||||
void onPacketData( INetworkInfo manager, INetHandler handler, FMLProxyPacket packet, EntityPlayer player );
|
||||
|
||||
}
|
||||
|
||||
@@ -21,16 +21,15 @@ package appeng.core.sync.network;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.NetHandlerPlayServer;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
|
||||
import cpw.mods.fml.common.network.FMLEventChannel;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent.ClientCustomPacketEvent;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent.ServerConnectionFromClientEvent;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
|
||||
import net.minecraft.network.ThreadQuickExitException;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
|
||||
import net.minecraftforge.fml.common.network.FMLEventChannel;
|
||||
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientCustomPacketEvent;
|
||||
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ServerConnectionFromClientEvent;
|
||||
import net.minecraftforge.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import appeng.core.WorldSettings;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
|
||||
@@ -101,7 +100,14 @@ public class NetworkHandler
|
||||
NetHandlerPlayServer srv = (NetHandlerPlayServer) ev.packet.handler();
|
||||
if( this.serveHandler != null )
|
||||
{
|
||||
this.serveHandler.onPacketData( null, ev.packet, srv.playerEntity );
|
||||
try
|
||||
{
|
||||
this.serveHandler.onPacketData( null, ev.handler, ev.packet, srv.playerEntity );
|
||||
}
|
||||
catch ( final ThreadQuickExitException ext )
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +116,14 @@ public class NetworkHandler
|
||||
{
|
||||
if( this.clientHandler != null )
|
||||
{
|
||||
this.clientHandler.onPacketData( null, ev.packet, null );
|
||||
try
|
||||
{
|
||||
this.clientHandler.onPacketData( null, ev.handler, ev.packet, null );
|
||||
}
|
||||
catch ( final ThreadQuickExitException ext )
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,16 +19,15 @@
|
||||
package appeng.core.sync.packets;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.EffectType;
|
||||
import appeng.core.CommonHelper;
|
||||
@@ -57,15 +56,15 @@ public class PacketAssemblerAnimation extends AppEngPacket
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketAssemblerAnimation( int x, int y, int z, byte rate, IAEItemStack is ) throws IOException
|
||||
public PacketAssemblerAnimation( BlockPos pos, byte rate, IAEItemStack is ) throws IOException
|
||||
{
|
||||
|
||||
ByteBuf data = Unpooled.buffer();
|
||||
|
||||
data.writeInt( this.getPacketID() );
|
||||
data.writeInt( this.x = x );
|
||||
data.writeInt( this.y = y );
|
||||
data.writeInt( this.z = z );
|
||||
data.writeInt( this.x = pos.getX() );
|
||||
data.writeInt( this.y = pos.getY() );
|
||||
data.writeInt( this.z = pos.getZ() );
|
||||
data.writeByte( this.rate = rate );
|
||||
is.writeToPacket( data );
|
||||
this.is = is;
|
||||
|
||||
@@ -21,10 +21,10 @@ package appeng.core.sync.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IComparableDefinition;
|
||||
import appeng.api.definitions.IItems;
|
||||
@@ -60,16 +60,16 @@ public class PacketClick extends AppEngPacket
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketClick( int x, int y, int z, int side, float hitX, float hitY, float hitZ )
|
||||
public PacketClick( BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
|
||||
ByteBuf data = Unpooled.buffer();
|
||||
|
||||
data.writeInt( this.getPacketID() );
|
||||
data.writeInt( this.x = x );
|
||||
data.writeInt( this.y = y );
|
||||
data.writeInt( this.z = z );
|
||||
data.writeInt( this.side = side );
|
||||
data.writeInt( this.x = pos.getX() );
|
||||
data.writeInt( this.y = pos.getY() );
|
||||
data.writeInt( this.z = pos.getZ() );
|
||||
data.writeInt( this.side = side.ordinal() );
|
||||
data.writeFloat( this.hitX = hitX );
|
||||
data.writeFloat( this.hitY = hitY );
|
||||
data.writeFloat( this.hitZ = hitZ );
|
||||
@@ -90,7 +90,7 @@ public class PacketClick extends AppEngPacket
|
||||
if( is.getItem() instanceof ToolNetworkTool )
|
||||
{
|
||||
ToolNetworkTool tnt = (ToolNetworkTool) is.getItem();
|
||||
tnt.serverSideToolLogic( is, player, player.worldObj, this.x, this.y, this.z, this.side, this.hitX, this.hitY, this.hitZ );
|
||||
tnt.serverSideToolLogic( is, player, player.worldObj, new BlockPos( this.x, this.y, this.z), EnumFacing.VALUES[ this.side ], this.hitX, this.hitY, this.hitZ );
|
||||
}
|
||||
|
||||
else if( maybeMemoryCard.isSameAs( is ) )
|
||||
|
||||
@@ -21,10 +21,8 @@ package appeng.core.sync.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.core.WorldSettings;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
|
||||
@@ -21,9 +21,7 @@ package appeng.core.sync.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
import appeng.hooks.CompassManager;
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
package appeng.core.sync.packets;
|
||||
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
@@ -27,18 +30,13 @@ import java.io.OutputStream;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import appeng.client.gui.implementations.GuiInterfaceTerminal;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
|
||||
@@ -21,10 +21,8 @@ package appeng.core.sync.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.util.IConfigManager;
|
||||
import appeng.api.util.IConfigurableObject;
|
||||
|
||||
@@ -19,20 +19,19 @@
|
||||
package appeng.core.sync.packets;
|
||||
|
||||
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridHost;
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.crafting.ICraftingGrid;
|
||||
import appeng.api.networking.crafting.ICraftingJob;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.container.ContainerOpenContext;
|
||||
import appeng.container.implementations.ContainerCraftAmount;
|
||||
import appeng.container.implementations.ContainerCraftConfirm;
|
||||
@@ -80,7 +79,7 @@ public class PacketCraftRequest extends AppEngPacket
|
||||
if( target instanceof IGridHost )
|
||||
{
|
||||
IGridHost gh = (IGridHost) target;
|
||||
IGridNode gn = gh.getGridNode( ForgeDirection.UNKNOWN );
|
||||
IGridNode gn = gh.getGridNode( AEPartLocation.INTERNAL );
|
||||
if( gn == null )
|
||||
{
|
||||
return;
|
||||
|
||||
@@ -19,15 +19,14 @@
|
||||
package appeng.core.sync.packets;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.ClientHelper;
|
||||
import appeng.container.AEBaseContainer;
|
||||
|
||||
@@ -21,13 +21,10 @@ package appeng.core.sync.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import appeng.client.ClientHelper;
|
||||
import appeng.client.render.effects.LightningFX;
|
||||
import appeng.core.AEConfig;
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
package appeng.core.sync.packets;
|
||||
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
@@ -30,17 +33,12 @@ import java.util.zip.GZIPOutputStream;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraftforge.fml.common.network.internal.FMLProxyPacket;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.client.gui.implementations.GuiCraftConfirm;
|
||||
import appeng.client.gui.implementations.GuiCraftingCPU;
|
||||
|
||||
@@ -21,16 +21,13 @@ package appeng.core.sync.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraftforge.fml.client.FMLClientHandler;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import appeng.client.render.effects.MatterCannonFX;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
|
||||
@@ -21,13 +21,11 @@ package appeng.core.sync.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
@@ -70,6 +68,6 @@ public class PacketMockExplosion extends AppEngPacket
|
||||
public void clientPacketData( INetworkInfo network, AppEngPacket packet, EntityPlayer player )
|
||||
{
|
||||
World world = CommonHelper.proxy.getWorld();
|
||||
world.spawnParticle( "largeexplode", this.x, this.y, this.z, 1.0D, 0.0D, 0.0D );
|
||||
world.spawnParticle( EnumParticleTypes.EXPLOSION_LARGE, this.x, this.y, this.z, 1.0D, 0.0D, 0.0D, new int[0] );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,11 +21,9 @@ package appeng.core.sync.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
import appeng.integration.IntegrationRegistry;
|
||||
|
||||
@@ -19,14 +19,14 @@
|
||||
package appeng.core.sync.packets;
|
||||
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
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.Container;
|
||||
@@ -37,9 +37,8 @@ import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.SecurityPermissions;
|
||||
@@ -243,7 +242,7 @@ public class PacketNEIRecipe extends AppEngPacket
|
||||
*/
|
||||
private ItemStack extractItemFromPlayerInventory( EntityPlayer player, Actionable mode, ItemStack patternItem )
|
||||
{
|
||||
final InventoryAdaptor ia = InventoryAdaptor.getAdaptor( player, ForgeDirection.UNKNOWN );
|
||||
final InventoryAdaptor ia = InventoryAdaptor.getAdaptor( player, EnumFacing.UP );
|
||||
final AEItemStack request = AEItemStack.create( patternItem );
|
||||
final boolean isSimulated = mode == Actionable.SIMULATE;
|
||||
final boolean checkFuzzy = request.isOre() || patternItem.getItemDamage() == OreDictionary.WILDCARD_VALUE || patternItem.hasTagCompound() || patternItem.isItemStackDamageable();
|
||||
|
||||
@@ -21,13 +21,10 @@ package appeng.core.sync.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
|
||||
@@ -21,9 +21,7 @@ package appeng.core.sync.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
|
||||
@@ -21,10 +21,10 @@ package appeng.core.sync.packets;
|
||||
|
||||
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.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
@@ -51,15 +51,15 @@ public class PacketPartPlacement extends AppEngPacket
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketPartPlacement( int x, int y, int z, int face, float eyeHeight )
|
||||
public PacketPartPlacement( BlockPos pos, EnumFacing face, float eyeHeight )
|
||||
{
|
||||
ByteBuf data = Unpooled.buffer();
|
||||
|
||||
data.writeInt( this.getPacketID() );
|
||||
data.writeInt( x );
|
||||
data.writeInt( y );
|
||||
data.writeInt( z );
|
||||
data.writeByte( face );
|
||||
data.writeInt( pos.getX() );
|
||||
data.writeInt( pos.getY() );
|
||||
data.writeInt( pos.getZ() );
|
||||
data.writeByte( face.ordinal() );
|
||||
data.writeFloat( eyeHeight );
|
||||
|
||||
this.configureWrite( data );
|
||||
@@ -71,7 +71,7 @@ public class PacketPartPlacement extends AppEngPacket
|
||||
EntityPlayerMP sender = (EntityPlayerMP) player;
|
||||
CommonHelper.proxy.updateRenderMode( sender );
|
||||
PartPlacement.eyeHeight = this.eyeHeight;
|
||||
PartPlacement.place( sender.getHeldItem(), this.x, this.y, this.z, this.face, sender, sender.worldObj, PartPlacement.PlaceType.INTERACT_FIRST_PASS, 0 );
|
||||
PartPlacement.place( sender.getHeldItem(), new BlockPos( this.x, this.y, this.z ), EnumFacing.VALUES[ this.face ], sender, sender.worldObj, PartPlacement.PlaceType.INTERACT_FIRST_PASS, 0 );
|
||||
CommonHelper.proxy.updateRenderMode( null );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,9 +21,7 @@ package appeng.core.sync.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
|
||||
@@ -19,15 +19,14 @@
|
||||
package appeng.core.sync.packets;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.container.implementations.ContainerPatternTerm;
|
||||
|
||||
@@ -21,10 +21,8 @@ package appeng.core.sync.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
|
||||
@@ -21,9 +21,7 @@ package appeng.core.sync.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
import appeng.core.sync.network.INetworkInfo;
|
||||
|
||||
@@ -21,11 +21,9 @@ package appeng.core.sync.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.ContainerOpenContext;
|
||||
|
||||
@@ -21,19 +21,17 @@ package appeng.core.sync.packets;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.client.ClientHelper;
|
||||
import appeng.client.render.effects.EnergyFx;
|
||||
import appeng.core.CommonHelper;
|
||||
@@ -49,7 +47,7 @@ public class PacketTransitionEffect extends AppEngPacket
|
||||
final double x;
|
||||
final double y;
|
||||
final double z;
|
||||
final ForgeDirection d;
|
||||
final AEPartLocation d;
|
||||
|
||||
// automatic.
|
||||
public PacketTransitionEffect( ByteBuf stream )
|
||||
@@ -57,12 +55,12 @@ public class PacketTransitionEffect extends AppEngPacket
|
||||
this.x = stream.readFloat();
|
||||
this.y = stream.readFloat();
|
||||
this.z = stream.readFloat();
|
||||
this.d = ForgeDirection.getOrientation( stream.readByte() );
|
||||
this.d = AEPartLocation.fromOrdinal( stream.readByte() );
|
||||
this.mode = stream.readBoolean();
|
||||
}
|
||||
|
||||
// api
|
||||
public PacketTransitionEffect( double x, double y, double z, ForgeDirection dir, boolean wasBlock )
|
||||
public PacketTransitionEffect( double x, double y, double z, AEPartLocation dir, boolean wasBlock )
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
@@ -99,9 +97,9 @@ public class PacketTransitionEffect extends AppEngPacket
|
||||
fx.fromItem( this.d );
|
||||
}
|
||||
|
||||
fx.motionX = -0.1 * this.d.offsetX;
|
||||
fx.motionY = -0.1 * this.d.offsetY;
|
||||
fx.motionZ = -0.1 * this.d.offsetZ;
|
||||
fx.motionX = -0.1 * this.d.xOffset;
|
||||
fx.motionY = -0.1 * this.d.yOffset;
|
||||
fx.motionZ = -0.1 * this.d.zOffset;
|
||||
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
|
||||
}
|
||||
@@ -109,9 +107,9 @@ public class PacketTransitionEffect extends AppEngPacket
|
||||
|
||||
if( this.mode )
|
||||
{
|
||||
Block block = world.getBlock( (int) this.x, (int) this.y, (int) this.z );
|
||||
Block block = world.getBlockState( new BlockPos( (int) this.x, (int) this.y, (int) this.z ) ).getBlock();
|
||||
|
||||
Minecraft.getMinecraft().getSoundHandler().playSound( new PositionedSoundRecord( new ResourceLocation( block.stepSound.getBreakSound() ), ( block.stepSound.getVolume() + 1.0F ) / 2.0F, block.stepSound.getPitch() * 0.8F, (float) this.x + 0.5F, (float) this.y + 0.5F, (float) this.z + 0.5F ) );
|
||||
Minecraft.getMinecraft().getSoundHandler().playSound( new PositionedSoundRecord( new ResourceLocation( block.stepSound.getBreakSound() ), ( block.stepSound.getVolume() + 1.0F ) / 2.0F, block.stepSound.getFrequency() * 0.8F, (float) this.x + 0.5F, (float) this.y + 0.5F, (float) this.z + 0.5F ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,21 +19,20 @@
|
||||
package appeng.core.sync.packets;
|
||||
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.util.IConfigManager;
|
||||
|
||||
Reference in New Issue
Block a user