Err too much.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user