Err too much.
This commit is contained in:
@@ -22,6 +22,8 @@ public class Configuration extends net.minecraftforge.common.Configuration imple
|
||||
|
||||
public static Configuration instance;
|
||||
|
||||
public static float TunnelPowerLoss = 0.05f;
|
||||
|
||||
public String latestVersion = VERSION;
|
||||
public long latestTimeStamp = 0;
|
||||
|
||||
|
||||
+62
-7
@@ -13,6 +13,7 @@ import net.minecraftforge.common.ChestGenHooks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.definitions.Blocks;
|
||||
import appeng.api.definitions.Items;
|
||||
import appeng.api.definitions.Materials;
|
||||
@@ -30,12 +31,12 @@ import appeng.block.mac.BlockContainmentWall;
|
||||
import appeng.block.mac.BlockCraftingAccelerator;
|
||||
import appeng.block.mac.BlockHeatVent;
|
||||
import appeng.block.mac.BlockPatternProvider;
|
||||
import appeng.block.misc.BlockCellWorkbench;
|
||||
import appeng.block.misc.BlockCharger;
|
||||
import appeng.block.misc.BlockCondenser;
|
||||
import appeng.block.misc.BlockInscriber;
|
||||
import appeng.block.misc.BlockInterface;
|
||||
import appeng.block.misc.BlockNetworkEmitter;
|
||||
import appeng.block.misc.BlockCellWorkbench;
|
||||
import appeng.block.misc.BlockQuartzCrystalizer;
|
||||
import appeng.block.misc.BlockQuartzTorch;
|
||||
import appeng.block.misc.BlockTinyTNT;
|
||||
@@ -49,6 +50,7 @@ import appeng.block.networking.BlockEnergyCell;
|
||||
import appeng.block.networking.BlockWireless;
|
||||
import appeng.block.qnb.BlockQuantumLinkChamber;
|
||||
import appeng.block.qnb.BlockQuantumRing;
|
||||
import appeng.block.solids.BlockFluix;
|
||||
import appeng.block.solids.BlockMatrixFrame;
|
||||
import appeng.block.solids.BlockQuartz;
|
||||
import appeng.block.solids.BlockQuartzChiseled;
|
||||
@@ -71,6 +73,8 @@ import appeng.core.features.registries.entries.CreativeCellHandler;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.core.localization.PlayerMessages;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.debug.BlockChunkloader;
|
||||
import appeng.debug.BlockItemGen;
|
||||
import appeng.debug.ToolDebugCard;
|
||||
import appeng.debug.ToolReplicatorCard;
|
||||
import appeng.helpers.AETrading;
|
||||
@@ -90,6 +94,8 @@ import appeng.items.tools.ToolMemoryCard;
|
||||
import appeng.items.tools.powered.ToolChargedStaff;
|
||||
import appeng.items.tools.powered.ToolEntropyManipulator;
|
||||
import appeng.items.tools.powered.ToolMassCannon;
|
||||
import appeng.items.tools.powered.ToolNetworkTool;
|
||||
import appeng.items.tools.powered.ToolPortableCell;
|
||||
import appeng.items.tools.powered.ToolWirelessTerminal;
|
||||
import appeng.items.tools.quartz.ToolQuartzAxe;
|
||||
import appeng.items.tools.quartz.ToolQuartzCuttingKnife;
|
||||
@@ -137,10 +143,10 @@ public class Registration
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register( OreDictionaryHandler.instance );
|
||||
|
||||
Items items = AEApi.instance().items();
|
||||
Materials materials = AEApi.instance().materials();
|
||||
Parts parts = AEApi.instance().parts();
|
||||
Blocks blocks = AEApi.instance().blocks();
|
||||
Items items = appeng.core.Api.instance.items();
|
||||
Materials materials = appeng.core.Api.instance.materials();
|
||||
Parts parts = appeng.core.Api.instance.parts();
|
||||
Blocks blocks = appeng.core.Api.instance.blocks();
|
||||
|
||||
AEItemDefinition materialItem = (AEFeatureHandler) addFeature( ItemMaterial.class );
|
||||
|
||||
@@ -197,6 +203,8 @@ public class Registration
|
||||
blocks.blockQuartzOreCharged = addFeature( OreQuartzCharged.class );
|
||||
blocks.blockMatrixFrame = addFeature( BlockMatrixFrame.class );
|
||||
blocks.blockQuartz = addFeature( BlockQuartz.class );
|
||||
blocks.blockFluix = addFeature( BlockFluix.class );
|
||||
|
||||
blocks.blockQuartzGlass = addFeature( BlockQuartzGlass.class );
|
||||
blocks.blockQuartzVibrantGlass = addFeature( BlockQuartzLamp.class );
|
||||
blocks.blockQuartzPiller = addFeature( BlockQuartzPillar.class );
|
||||
@@ -228,7 +236,7 @@ public class Registration
|
||||
blocks.blockDrive = addFeature( BlockDrive.class );
|
||||
blocks.blockChest = addFeature( BlockChest.class );
|
||||
blocks.blockInterface = addFeature( BlockInterface.class );
|
||||
blocks.blockPartitioner = addFeature( BlockCellWorkbench.class );
|
||||
blocks.blockCellWorkbench = addFeature( BlockCellWorkbench.class );
|
||||
blocks.blockIOPort = addFeature( BlockIOPort.class );
|
||||
blocks.blockCondenser = addFeature( BlockCondenser.class );
|
||||
blocks.blockEnergyAcceptor = addFeature( BlockEnergyAcceptor.class );
|
||||
@@ -272,11 +280,15 @@ public class Registration
|
||||
items.itemChargedStaff = addFeature( ToolChargedStaff.class );
|
||||
items.itemEntropyManipulator = addFeature( ToolEntropyManipulator.class );
|
||||
items.itemWirelessTerminal = addFeature( ToolWirelessTerminal.class );
|
||||
items.itemNetworkTool = addFeature( ToolNetworkTool.class );
|
||||
items.itemPortableCell = addFeature( ToolPortableCell.class );
|
||||
|
||||
items.itemFacade = addFeature( ItemFacade.class );
|
||||
|
||||
addFeature( ToolDebugCard.class );
|
||||
addFeature( ToolReplicatorCard.class );
|
||||
addFeature( BlockItemGen.class );
|
||||
addFeature( BlockChunkloader.class );
|
||||
}
|
||||
|
||||
private AEItemDefinition addFeature(Class c, Object... Args)
|
||||
@@ -394,8 +406,9 @@ public class Registration
|
||||
AEApi.instance().registries().cell().addCellHandler( new BasicCellHandler() );
|
||||
AEApi.instance().registries().cell().addCellHandler( new CreativeCellHandler() );
|
||||
|
||||
NetworkRegistry.instance().registerGuiHandler( AppEng.instance, GuiBridge.GUI_Handler );
|
||||
AEApi.instance().registries().matterCannon().registerAmmo( AEApi.instance().materials().materialMatterBall.stack( 1 ), 32.0 );
|
||||
|
||||
NetworkRegistry.instance().registerGuiHandler( AppEng.instance, GuiBridge.GUI_Handler );
|
||||
}
|
||||
|
||||
public void PostInit(FMLPostInitializationEvent event)
|
||||
@@ -407,6 +420,48 @@ public class Registration
|
||||
Api.instance.partHelper.initFMPSupport();
|
||||
((BlockCableBus) AEApi.instance().blocks().blockMultiPart.block()).setupTile();
|
||||
|
||||
// IO PORT!
|
||||
Upgrades.SPEED.registerItem( AEApi.instance().blocks().blockIOPort.stack( 1 ), 3 );
|
||||
Upgrades.REDSTONE.registerItem( AEApi.instance().blocks().blockIOPort.stack( 1 ), 1 );
|
||||
|
||||
// partLevelEmitter
|
||||
Upgrades.FUZZY.registerItem( AEApi.instance().parts().partLevelEmitter.stack( 1 ), 1 );
|
||||
|
||||
// partImportBus
|
||||
Upgrades.FUZZY.registerItem( AEApi.instance().parts().partImportBus.stack( 1 ), 1 );
|
||||
Upgrades.REDSTONE.registerItem( AEApi.instance().parts().partImportBus.stack( 1 ), 1 );
|
||||
Upgrades.CAPACITY.registerItem( AEApi.instance().parts().partImportBus.stack( 1 ), 2 );
|
||||
Upgrades.SPEED.registerItem( AEApi.instance().parts().partImportBus.stack( 1 ), 4 );
|
||||
|
||||
// partExportBus
|
||||
Upgrades.FUZZY.registerItem( AEApi.instance().parts().partExportBus.stack( 1 ), 1 );
|
||||
Upgrades.REDSTONE.registerItem( AEApi.instance().parts().partExportBus.stack( 1 ), 1 );
|
||||
Upgrades.CAPACITY.registerItem( AEApi.instance().parts().partExportBus.stack( 1 ), 2 );
|
||||
Upgrades.SPEED.registerItem( AEApi.instance().parts().partExportBus.stack( 1 ), 4 );
|
||||
|
||||
// blockCellWorkbench
|
||||
Upgrades.FUZZY.registerItem( AEApi.instance().items().itemCell1k.stack( 1 ), 1 );
|
||||
Upgrades.INVERTER.registerItem( AEApi.instance().items().itemCell1k.stack( 1 ), 1 );
|
||||
|
||||
Upgrades.FUZZY.registerItem( AEApi.instance().items().itemCell4k.stack( 1 ), 1 );
|
||||
Upgrades.INVERTER.registerItem( AEApi.instance().items().itemCell4k.stack( 1 ), 1 );
|
||||
|
||||
Upgrades.FUZZY.registerItem( AEApi.instance().items().itemCell16k.stack( 1 ), 1 );
|
||||
Upgrades.INVERTER.registerItem( AEApi.instance().items().itemCell16k.stack( 1 ), 1 );
|
||||
|
||||
Upgrades.FUZZY.registerItem( AEApi.instance().items().itemCell64k.stack( 1 ), 1 );
|
||||
Upgrades.INVERTER.registerItem( AEApi.instance().items().itemCell64k.stack( 1 ), 1 );
|
||||
|
||||
// partStorageBus
|
||||
Upgrades.FUZZY.registerItem( AEApi.instance().parts().partStorageBus.stack( 1 ), 1 );
|
||||
Upgrades.INVERTER.registerItem( AEApi.instance().parts().partStorageBus.stack( 1 ), 1 );
|
||||
Upgrades.CAPACITY.registerItem( AEApi.instance().parts().partStorageBus.stack( 1 ), 3 );
|
||||
|
||||
// matter cannon
|
||||
Upgrades.FUZZY.registerItem( AEApi.instance().items().itemMassCannon.stack( 1 ), 1 );
|
||||
Upgrades.INVERTER.registerItem( AEApi.instance().items().itemMassCannon.stack( 1 ), 1 );
|
||||
Upgrades.SPEED.registerItem( AEApi.instance().items().itemMassCannon.stack( 1 ), 4 );
|
||||
|
||||
if ( Configuration.instance.isFeatureEnabled( AEFeature.ChestLoot ) )
|
||||
{
|
||||
ChestGenHooks d = ChestGenHooks.getInfo( ChestGenHooks.MINESHAFT_CORRIDOR );
|
||||
|
||||
@@ -22,8 +22,8 @@ import org.objectweb.asm.tree.ClassNode;
|
||||
import org.objectweb.asm.tree.MethodInsnNode;
|
||||
import org.objectweb.asm.tree.MethodNode;
|
||||
|
||||
import appeng.api.parts.IPartItem;
|
||||
import appeng.api.parts.IPartHelper;
|
||||
import appeng.api.parts.IPartItem;
|
||||
import appeng.api.parts.LayerBase;
|
||||
import appeng.client.render.BusRenderer;
|
||||
import appeng.core.AELog;
|
||||
|
||||
@@ -33,15 +33,18 @@ public enum AEFeature
|
||||
LevelEmiter("NetworkBuses"), CraftingTerminal("NetworkBuses"), StorageMonitor("NetworkBuses"), P2PTunnel("NetworkBuses"), FormationPlane("NetworkBuses"), AnnihilationPlane(
|
||||
"NetworkBuses"), ImportBus("NetworkBuses"), ExportBus("NetworkBuses"), StorageBus("NetworkBuses"), PartConversionMonitor("NetworkBuses"),
|
||||
|
||||
StorageCells("Storage"), MEChest("Storage"), MEDrive("Storage"), IOPort("Storage"),
|
||||
StorageCells("Storage"), PortableCell("PortableCell"), MEChest("Storage"), MEDrive("Storage"), IOPort("Storage"),
|
||||
|
||||
NetworkTool("NetworkTool"),
|
||||
|
||||
DenseEnergyCells("HigherCapacity"), DenseCables("HigherCapacity"),
|
||||
|
||||
P2PTunnelME("P2PTunnels"), P2PTunnelItems("P2PTunnels"), P2PTunnelRedstone("P2PTunnels"), P2PTunnelEU("P2PTunnels"), P2PTunnelMJ("P2PTunnels"), P2PTunnelLiquids("P2PTunnels"),
|
||||
P2PTunnelME("P2PTunnels"), P2PTunnelItems("P2PTunnels"), P2PTunnelRedstone("P2PTunnels"), P2PTunnelEU("P2PTunnels"), P2PTunnelMJ("P2PTunnels"), P2PTunnelLiquids(
|
||||
"P2PTunnels"),
|
||||
|
||||
MassCannonBlockDamage("BlockFeatures"), TinyTNTBlockDamage("BlockFeatures"), Facades("Facades"),
|
||||
|
||||
DuplicateItems("Misc", false), Profiler("Services"), VersionChecker("Services"), Debug("Misc"), Creative("Misc");
|
||||
DuplicateItems("Misc", false), Profiler("Services"), VersionChecker("Services"), Debug("Misc", false), Creative("Misc");
|
||||
|
||||
String Category;
|
||||
boolean visible = true;
|
||||
|
||||
@@ -53,6 +53,9 @@ public class AEFeatureHandler implements AEItemDefinition
|
||||
{
|
||||
// simple hack to allow me to do get nice names for these without
|
||||
// mode code outside of AEBaseItem
|
||||
if ( subname.startsWith( "P2PTunnel" ) )
|
||||
return "ItemPart.P2PTunnel";
|
||||
|
||||
if ( subname.equals( "CertusQuartzTools" ) )
|
||||
return name.replace( "Quartz", "CertusQuartz" );
|
||||
if ( subname.equals( "NetherQuartzTools" ) )
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import appeng.api.util.AEItemDefinition;
|
||||
import appeng.core.AELog;
|
||||
|
||||
public class DamagedItemDefinition implements AEItemDefinition
|
||||
{
|
||||
@@ -22,6 +23,7 @@ public class DamagedItemDefinition implements AEItemDefinition
|
||||
{
|
||||
baseItem = is.getItem();
|
||||
damage = is.getItemDamage();
|
||||
AELog.localization( "item", is.getUnlocalizedName() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +51,7 @@ public class DamagedItemDefinition implements AEItemDefinition
|
||||
if ( baseItem == null )
|
||||
return null;
|
||||
|
||||
return new ItemStack( baseItem, 1, damage );
|
||||
return new ItemStack( baseItem, stackSize, damage );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,6 +2,7 @@ package appeng.core.features.registries;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import appeng.api.events.LocatableEventAnnounce;
|
||||
import appeng.api.events.LocatableEventAnnounce.LocatableEvent;
|
||||
@@ -23,7 +24,8 @@ public class LocateableRegistry implements ILocateableRegistry
|
||||
if ( e.change == LocatableEvent.Register )
|
||||
{
|
||||
set.put( e.target.getLocatableSerial(), e.target );
|
||||
} else if ( e.change == LocatableEvent.Unregister )
|
||||
}
|
||||
else if ( e.change == LocatableEvent.Unregister )
|
||||
{
|
||||
set.remove( e.target.getLocatableSerial() );
|
||||
}
|
||||
@@ -31,6 +33,7 @@ public class LocateableRegistry implements ILocateableRegistry
|
||||
|
||||
public LocateableRegistry() {
|
||||
set = new HashMap();
|
||||
MinecraftForge.EVENT_BUS.register( this );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
package appeng.core.features.registries;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import appeng.api.features.IMatterCannonAmmoRegistry;
|
||||
import appeng.recipes.ores.IOreListener;
|
||||
import appeng.recipes.ores.OreDictionaryHandler;
|
||||
import appeng.util.Platform;
|
||||
|
||||
public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmoRegistry
|
||||
{
|
||||
|
||||
private HashMap<ItemStack, Double> DamageModifiers = new HashMap<ItemStack, Double>();
|
||||
|
||||
@Override
|
||||
public void registerAmmo(ItemStack ammo, double weight)
|
||||
{
|
||||
DamageModifiers.put( ammo, weight );
|
||||
}
|
||||
|
||||
private void considerItem(String ore, ItemStack item, String Name, double weight)
|
||||
{
|
||||
if ( ore.equals( "berry" + Name ) || ore.equals( "nugget" + Name ) )
|
||||
{
|
||||
registerAmmo( item, weight );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void oreRegistered(String Name, ItemStack item)
|
||||
{
|
||||
if ( !(Name.startsWith( "berry" ) || Name.startsWith( "nugget" )) )
|
||||
return;
|
||||
|
||||
// addNugget( "Cobble", 18 ); // ?
|
||||
considerItem( Name, item, "MeatRaw", 32 );
|
||||
considerItem( Name, item, "MeatCooked", 32 );
|
||||
considerItem( Name, item, "Meat", 32 );
|
||||
considerItem( Name, item, "Chicken", 32 );
|
||||
considerItem( Name, item, "Beef", 32 );
|
||||
considerItem( Name, item, "Sheep", 32 );
|
||||
considerItem( Name, item, "Fish", 32 );
|
||||
|
||||
// real world...
|
||||
considerItem( Name, item, "Lithium", 6.941 );
|
||||
considerItem( Name, item, "Beryllium", 9.0122 );
|
||||
considerItem( Name, item, "Boron", 10.811 );
|
||||
considerItem( Name, item, "Carbon", 12.0107 );
|
||||
considerItem( Name, item, "Coal", 12.0107 );
|
||||
considerItem( Name, item, "Charcoal", 12.0107 );
|
||||
considerItem( Name, item, "Sodium", 22.9897 );
|
||||
considerItem( Name, item, "Magnesium", 24.305 );
|
||||
considerItem( Name, item, "Aluminum", 26.9815 );
|
||||
considerItem( Name, item, "Silicon", 28.0855 );
|
||||
considerItem( Name, item, "Phosphorus", 30.9738 );
|
||||
considerItem( Name, item, "Sulfur", 32.065 );
|
||||
considerItem( Name, item, "Potassium", 39.0983 );
|
||||
considerItem( Name, item, "Calcium", 40.078 );
|
||||
considerItem( Name, item, "Scandium", 44.9559 );
|
||||
considerItem( Name, item, "Titanium", 47.867 );
|
||||
considerItem( Name, item, "Vanadium", 50.9415 );
|
||||
considerItem( Name, item, "Manganese", 54.938 );
|
||||
considerItem( Name, item, "Iron", 55.845 );
|
||||
considerItem( Name, item, "Nickel", 58.6934 );
|
||||
considerItem( Name, item, "Cobalt", 58.9332 );
|
||||
considerItem( Name, item, "Copper", 63.546 );
|
||||
considerItem( Name, item, "Zinc", 65.39 );
|
||||
considerItem( Name, item, "Gallium", 69.723 );
|
||||
considerItem( Name, item, "Germanium", 72.64 );
|
||||
considerItem( Name, item, "Bromine", 79.904 );
|
||||
considerItem( Name, item, "Krypton", 83.8 );
|
||||
considerItem( Name, item, "Rubidium", 85.4678 );
|
||||
considerItem( Name, item, "Strontium", 87.62 );
|
||||
considerItem( Name, item, "Yttrium", 88.9059 );
|
||||
considerItem( Name, item, "Zirconiumm", 91.224 );
|
||||
considerItem( Name, item, "Niobiumm", 92.9064 );
|
||||
considerItem( Name, item, "Technetium", 98 );
|
||||
considerItem( Name, item, "Ruthenium", 101.07 );
|
||||
considerItem( Name, item, "Rhodium", 102.9055 );
|
||||
considerItem( Name, item, "Palladium", 106.42 );
|
||||
considerItem( Name, item, "Silver", 107.8682 );
|
||||
considerItem( Name, item, "Cadmium", 112.411 );
|
||||
considerItem( Name, item, "Indium", 114.818 );
|
||||
considerItem( Name, item, "Tin", 118.71 );
|
||||
considerItem( Name, item, "Antimony", 121.76 );
|
||||
considerItem( Name, item, "Iodine", 126.9045 );
|
||||
considerItem( Name, item, "Tellurium", 127.6 );
|
||||
considerItem( Name, item, "Xenon", 131.293 );
|
||||
considerItem( Name, item, "Cesium", 132.9055 );
|
||||
considerItem( Name, item, "Barium", 137.327 );
|
||||
considerItem( Name, item, "Lanthanum", 138.9055 );
|
||||
considerItem( Name, item, "Cerium", 140.116 );
|
||||
considerItem( Name, item, "Tantalum", 180.9479 );
|
||||
considerItem( Name, item, "Tungsten", 183.84 );
|
||||
considerItem( Name, item, "Osmium", 190.23 );
|
||||
considerItem( Name, item, "Iridium", 192.217 );
|
||||
considerItem( Name, item, "Platinum", 195.078 );
|
||||
considerItem( Name, item, "Lead", 207.2 );
|
||||
considerItem( Name, item, "Bismuth", 208.9804 );
|
||||
considerItem( Name, item, "Uranium", 238.0289 );
|
||||
considerItem( Name, item, "Plutonium", 244 );
|
||||
|
||||
// TE stuff...
|
||||
considerItem( Name, item, "Invar", (58.6934 + 55.845 + 55.845) / 3.0 );
|
||||
considerItem( Name, item, "Electrum", (107.8682 + 196.96655) / 2.0 );
|
||||
}
|
||||
|
||||
public MatterCannonAmmoRegistry() {
|
||||
OreDictionaryHandler.instance.observe( this );
|
||||
registerAmmo( new ItemStack( Item.goldNugget ), 196.96655 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getPenetration(ItemStack is)
|
||||
{
|
||||
for (ItemStack o : DamageModifiers.keySet())
|
||||
{
|
||||
if ( Platform.isSameItem( o, is ) )
|
||||
return DamageModifiers.get( o ).floatValue();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package appeng.core.features.registries;
|
||||
|
||||
import appeng.api.features.IGrinderRegistry;
|
||||
import appeng.api.features.ILocateableRegistry;
|
||||
import appeng.api.features.IMatterCannonAmmoRegistry;
|
||||
import appeng.api.features.IP2PTunnelRegistry;
|
||||
import appeng.api.features.IRegistryContainer;
|
||||
import appeng.api.features.ISpecialComparisonRegistry;
|
||||
@@ -23,6 +24,7 @@ public class RegistryContainer implements IRegistryContainer
|
||||
private GridCacheRegistry GridCacheRegistry = new GridCacheRegistry();
|
||||
private P2PTunnelRegistry P2PRegistry = new P2PTunnelRegistry();
|
||||
private MovableTileRegistry MoveableReg = new MovableTileRegistry();
|
||||
private MatterCannonAmmoRegistry matterCannonReg = new MatterCannonAmmoRegistry();
|
||||
|
||||
@Override
|
||||
public IWirelessTermRegistery wireless()
|
||||
@@ -78,4 +80,10 @@ public class RegistryContainer implements IRegistryContainer
|
||||
return P2PRegistry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMatterCannonAmmoRegistry matterCannon()
|
||||
{
|
||||
return matterCannonReg;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import appeng.api.storage.StorageChannel;
|
||||
import appeng.client.texture.ExtraTextures;
|
||||
import appeng.core.sync.GuiBridge;
|
||||
import appeng.me.storage.CellInventory;
|
||||
import appeng.me.storage.CellInventoryHandler;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.util.Platform;
|
||||
|
||||
@@ -46,7 +47,12 @@ public class BasicCellHandler implements ICellHandler
|
||||
@Override
|
||||
public int getStatusForCell(ItemStack is, IMEInventory handler)
|
||||
{
|
||||
return 1;
|
||||
if ( handler instanceof CellInventoryHandler )
|
||||
{
|
||||
CellInventoryHandler ci = (CellInventoryHandler) handler;
|
||||
return ci.getCellInv().getStatusForCell();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,27 +7,27 @@ public enum GuiText
|
||||
{
|
||||
inventory("container"), // mc's default Inventory localization.
|
||||
|
||||
Chest, StoredEnergy, Of, Condenser, Drive, GrindStone, VibrationChamber, SpatialIOPort, NetworkStatus, LevelEmitter, Terminal, Interface, Config, StoredItems, Patterns, ImportBus, ExportBus, CellWorkbench;
|
||||
Chest, StoredEnergy, Of, Condenser, Drive, GrindStone, VibrationChamber, SpatialIOPort, LevelEmitter, Terminal, Interface, Config, StoredItems, Patterns, ImportBus, ExportBus, CellWorkbench, NetworkDetails, StorageCells, IOBuses, IOPort, BytesUsed, Types, QuantumLinkChamber, PortableCell;
|
||||
|
||||
String root;
|
||||
|
||||
GuiText() {
|
||||
root = "gui.appliedenergistics2";
|
||||
AELog.localization( "gui", getName() );
|
||||
AELog.localization( "gui", getUnlocalized() );
|
||||
}
|
||||
|
||||
GuiText(String r) {
|
||||
root = r;
|
||||
}
|
||||
|
||||
private String getName()
|
||||
public String getUnlocalized()
|
||||
{
|
||||
return root + "." + toString();
|
||||
}
|
||||
|
||||
public String getLocal()
|
||||
{
|
||||
return StatCollector.translateToLocal( getName() );
|
||||
return StatCollector.translateToLocal( getUnlocalized() );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import appeng.core.AELog;
|
||||
|
||||
public enum PlayerMessages
|
||||
{
|
||||
ChestCannotReadStorageCell, InvalidMachine, LoadedSettings, SavedSettings, MachineNotPowered;
|
||||
ChestCannotReadStorageCell, InvalidMachine, LoadedSettings, SavedSettings, MachineNotPowered, isNowLocked, isNowUnlocked, AmmoDepleted;
|
||||
|
||||
private PlayerMessages() {
|
||||
AELog.localization( "chat", getName() );
|
||||
|
||||
+77
-31
@@ -4,6 +4,7 @@ import java.lang.reflect.Constructor;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
@@ -14,24 +15,31 @@ import appeng.api.parts.IPartHost;
|
||||
import appeng.api.storage.IStorageMonitorable;
|
||||
import appeng.client.gui.GuiNull;
|
||||
import appeng.container.ContainerNull;
|
||||
import appeng.container.implementations.ContainerBus;
|
||||
import appeng.container.implementations.ContainerCellWorkBench;
|
||||
import appeng.container.implementations.ContainerCellWorkbench;
|
||||
import appeng.container.implementations.ContainerChest;
|
||||
import appeng.container.implementations.ContainerCondenser;
|
||||
import appeng.container.implementations.ContainerDrive;
|
||||
import appeng.container.implementations.ContainerGrinder;
|
||||
import appeng.container.implementations.ContainerIOPort;
|
||||
import appeng.container.implementations.ContainerInterface;
|
||||
import appeng.container.implementations.ContainerLevelEmitter;
|
||||
import appeng.container.implementations.ContainerMEMonitorable;
|
||||
import appeng.container.implementations.ContainerMEPortableCell;
|
||||
import appeng.container.implementations.ContainerQNB;
|
||||
import appeng.container.implementations.ContainerUpgradeable;
|
||||
import appeng.container.implementations.ContainerVibrationChamber;
|
||||
import appeng.helpers.ICellItemViewer;
|
||||
import appeng.helpers.IGuiItem;
|
||||
import appeng.helpers.IInterfaceHost;
|
||||
import appeng.parts.automation.PartLevelEmitter;
|
||||
import appeng.tile.grindstone.TileGrinder;
|
||||
import appeng.tile.misc.TileCellWorkbench;
|
||||
import appeng.tile.misc.TileCondenser;
|
||||
import appeng.tile.misc.TileVibrationChamber;
|
||||
import appeng.tile.qnb.TileQuantumBridge;
|
||||
import appeng.tile.storage.TileChest;
|
||||
import appeng.tile.storage.TileDrive;
|
||||
import appeng.tile.storage.TileIOPort;
|
||||
import appeng.util.Platform;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
@@ -40,30 +48,37 @@ public enum GuiBridge implements IGuiHandler
|
||||
{
|
||||
GUI_Handler(),
|
||||
|
||||
GUI_GRINDER(ContainerGrinder.class, TileGrinder.class),
|
||||
GUI_GRINDER(ContainerGrinder.class, TileGrinder.class, false),
|
||||
|
||||
GUI_CHEST(ContainerChest.class, TileChest.class),
|
||||
GUI_QNB(ContainerQNB.class, TileQuantumBridge.class, false),
|
||||
|
||||
GUI_ME(ContainerMEMonitorable.class, IStorageMonitorable.class),
|
||||
GUI_CHEST(ContainerChest.class, TileChest.class, false),
|
||||
|
||||
GUI_DRIVE(ContainerDrive.class, TileDrive.class),
|
||||
GUI_ME(ContainerMEMonitorable.class, IStorageMonitorable.class, false),
|
||||
|
||||
GUI_VIBRATIONCHAMBER(ContainerVibrationChamber.class, TileVibrationChamber.class),
|
||||
GUI_PORTABLE_CELL(ContainerMEPortableCell.class, ICellItemViewer.class, true),
|
||||
|
||||
GUI_CONDENSER(ContainerCondenser.class, TileCondenser.class),
|
||||
GUI_DRIVE(ContainerDrive.class, TileDrive.class, false),
|
||||
|
||||
GUI_INTERFACE(ContainerInterface.class, IInterfaceHost.class),
|
||||
GUI_VIBRATIONCHAMBER(ContainerVibrationChamber.class, TileVibrationChamber.class, false),
|
||||
|
||||
GUI_BUS(ContainerBus.class, IBusCommon.class),
|
||||
GUI_CONDENSER(ContainerCondenser.class, TileCondenser.class, false),
|
||||
|
||||
GUI_INTERFACE(ContainerInterface.class, IInterfaceHost.class, false),
|
||||
|
||||
GUI_BUS(ContainerUpgradeable.class, IBusCommon.class, false),
|
||||
|
||||
GUI_IOPORT(ContainerIOPort.class, TileIOPort.class, false),
|
||||
|
||||
// extends (Container/Gui) + Bus
|
||||
GUI_LEVELEMITTER(ContainerLevelEmitter.class, PartLevelEmitter.class),
|
||||
GUI_LEVELEMITTER(ContainerLevelEmitter.class, PartLevelEmitter.class, false),
|
||||
|
||||
GUI_CELLWORKBENCH(ContainerCellWorkBench.class, TileCellWorkbench.class);
|
||||
GUI_CELLWORKBENCH(ContainerCellWorkbench.class, TileCellWorkbench.class, false);
|
||||
|
||||
private Class Tile;
|
||||
private Class Gui;
|
||||
private Class Container;
|
||||
private boolean isItem;
|
||||
|
||||
private GuiBridge() {
|
||||
Tile = null;
|
||||
@@ -95,8 +110,9 @@ public enum GuiBridge implements IGuiHandler
|
||||
getGui();
|
||||
}
|
||||
|
||||
private GuiBridge(Class _Container, Class _Tile) {
|
||||
private GuiBridge(Class _Container, Class _Tile, boolean isItem) {
|
||||
Container = _Container;
|
||||
this.isItem = isItem;
|
||||
Tile = _Tile;
|
||||
getGui();
|
||||
}
|
||||
@@ -145,43 +161,73 @@ public enum GuiBridge implements IGuiHandler
|
||||
ForgeDirection side = ForgeDirection.getOrientation( ID_ORDINAL & 0x07 );
|
||||
GuiBridge ID = values()[ID_ORDINAL >> 3];
|
||||
|
||||
TileEntity TE = w.getBlockTileEntity( x, y, z );
|
||||
|
||||
if ( TE instanceof IPartHost )
|
||||
if ( ID.isItem() )
|
||||
{
|
||||
((IPartHost) TE).getPart( side );
|
||||
IPart part = ((IPartHost) TE).getPart( side );
|
||||
if ( ID.CorrectTileOrPart( part ) )
|
||||
return ID.ConstructContainer( player.inventory, side, part );
|
||||
ItemStack it = player.inventory.getCurrentItem();
|
||||
if ( it != null && it.getItem() instanceof IGuiItem )
|
||||
{
|
||||
Object myItem = ((IGuiItem) it.getItem()).getGuiObject( it );
|
||||
if ( ID.CorrectTileOrPart( myItem ) )
|
||||
return ID.ConstructContainer( player.inventory, side, myItem );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ID.CorrectTileOrPart( TE ) )
|
||||
return ID.ConstructContainer( player.inventory, side, TE );
|
||||
TileEntity TE = w.getBlockTileEntity( x, y, z );
|
||||
if ( TE instanceof IPartHost )
|
||||
{
|
||||
((IPartHost) TE).getPart( side );
|
||||
IPart part = ((IPartHost) TE).getPart( side );
|
||||
if ( ID.CorrectTileOrPart( part ) )
|
||||
return ID.ConstructContainer( player.inventory, side, part );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ID.CorrectTileOrPart( TE ) )
|
||||
return ID.ConstructContainer( player.inventory, side, TE );
|
||||
}
|
||||
}
|
||||
|
||||
return new ContainerNull();
|
||||
}
|
||||
|
||||
private boolean isItem()
|
||||
{
|
||||
return isItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement(int ID_ORDINAL, EntityPlayer player, World w, int x, int y, int z)
|
||||
{
|
||||
ForgeDirection side = ForgeDirection.getOrientation( ID_ORDINAL & 0x07 );
|
||||
GuiBridge ID = values()[ID_ORDINAL >> 3];
|
||||
|
||||
TileEntity TE = w.getBlockTileEntity( x, y, z );
|
||||
|
||||
if ( TE instanceof IPartHost )
|
||||
if ( ID.isItem() )
|
||||
{
|
||||
((IPartHost) TE).getPart( side );
|
||||
IPart part = ((IPartHost) TE).getPart( side );
|
||||
if ( ID.CorrectTileOrPart( part ) )
|
||||
return ID.ConstructGui( player.inventory, side, part );
|
||||
ItemStack it = player.inventory.getCurrentItem();
|
||||
if ( it != null && it.getItem() instanceof IGuiItem )
|
||||
{
|
||||
Object myItem = ((IGuiItem) it.getItem()).getGuiObject( it );
|
||||
if ( ID.CorrectTileOrPart( myItem ) )
|
||||
return ID.ConstructGui( player.inventory, side, myItem );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ID.CorrectTileOrPart( TE ) )
|
||||
return ID.ConstructGui( player.inventory, side, TE );
|
||||
TileEntity TE = w.getBlockTileEntity( x, y, z );
|
||||
|
||||
if ( TE instanceof IPartHost )
|
||||
{
|
||||
((IPartHost) TE).getPart( side );
|
||||
IPart part = ((IPartHost) TE).getPart( side );
|
||||
if ( ID.CorrectTileOrPart( part ) )
|
||||
return ID.ConstructGui( player.inventory, side, part );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ID.CorrectTileOrPart( TE ) )
|
||||
return ID.ConstructGui( player.inventory, side, TE );
|
||||
}
|
||||
}
|
||||
|
||||
return new GuiNull( new ContainerNull() );
|
||||
|
||||
@@ -8,6 +8,8 @@ import java.io.IOException;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.container.implementations.ContainerCellWorkbench;
|
||||
import appeng.container.implementations.ContainerLevelEmitter;
|
||||
import appeng.core.sync.AppEngPacket;
|
||||
|
||||
@@ -34,6 +36,25 @@ public class PacketValueConfig extends AppEngPacket
|
||||
lvc.setLevel( Integer.parseInt( Value ), player );
|
||||
return;
|
||||
}
|
||||
else if ( Name.startsWith( "CellWorkbench." ) && c instanceof ContainerCellWorkbench )
|
||||
{
|
||||
ContainerCellWorkbench ccw = (ContainerCellWorkbench) c;
|
||||
if ( Name.equals( "CellWorkbench.Action" ) )
|
||||
{
|
||||
if ( Value.equals( "Partition" ) )
|
||||
{
|
||||
ccw.partition();
|
||||
}
|
||||
else if ( Value.equals( "Clear" ) )
|
||||
{
|
||||
ccw.clear();
|
||||
}
|
||||
}
|
||||
else if ( Name.equals( "CellWorkbench.Fuzzy" ) )
|
||||
{
|
||||
ccw.setFuzzy( FuzzyMode.valueOf( Value ) );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user