From 1a75097e84b8d53a863fa213df3d9a19e102a8eb Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Sun, 23 Feb 2014 16:50:53 -0600 Subject: [PATCH] Removed Block Definitions for MAC Parts. Removed Options For MAC and Crafting. Added Options for Crafting with Quartz Growth and Fluix Reaction. EU Tunnels Re-Added ( Limit 1 per block. ) Adjusted naming/categorization of various features. Added "sparkle" effect to seeds that are "growing" --- api | 2 +- block/mac/BlockContainmentWall.java | 19 -------- block/mac/BlockCraftingAccelerator.java | 19 -------- block/mac/BlockHeatVent.java | 19 -------- block/mac/BlockPatternProvider.java | 19 -------- block/networking/BlockCableBus.java | 2 +- block/qnb/BlockQuantumLinkChamber.java | 3 +- client/ClientHelper.java | 40 +++++++++++++++-- client/EffectType.java | 6 +++ core/CommonHelper.java | 5 +-- core/Registration.java | 1 + core/features/AEFeature.java | 16 ++++--- entity/EntityChargedQuartz.java | 9 +++- entity/EntityGrowingCrystal.java | 58 ++++++++++++++++++++++--- entity/EntitySingularity.java | 5 +++ fmp/CableBusPart.java | 8 ++++ integration/modules/IC2.java | 15 +++++++ items/ItemEncodedPattern.java | 25 ----------- items/parts/PartType.java | 6 +-- me/cache/helpers/TunnelCollection.java | 2 +- parts/CableBusContainer.java | 9 ++++ parts/p2p/PartP2PIC2Power.java | 5 ++- parts/p2p/PartP2PTunnel.java | 4 +- server/ServerHelper.java | 9 +--- tile/networking/TileCableBus.java | 8 ++++ util/Platform.java | 6 +-- 26 files changed, 179 insertions(+), 141 deletions(-) delete mode 100644 block/mac/BlockContainmentWall.java delete mode 100644 block/mac/BlockCraftingAccelerator.java delete mode 100644 block/mac/BlockHeatVent.java delete mode 100644 block/mac/BlockPatternProvider.java create mode 100644 client/EffectType.java delete mode 100644 items/ItemEncodedPattern.java diff --git a/api b/api index 6e7ac06d7..2c9d87df8 160000 --- a/api +++ b/api @@ -1 +1 @@ -Subproject commit 6e7ac06d7c52a4d3a1d88269fea3767a52f1cbab +Subproject commit 2c9d87df822a15136c7446db0d8d3b72b7feb4e5 diff --git a/block/mac/BlockContainmentWall.java b/block/mac/BlockContainmentWall.java deleted file mode 100644 index ea9063592..000000000 --- a/block/mac/BlockContainmentWall.java +++ /dev/null @@ -1,19 +0,0 @@ -package appeng.block.mac; - -import java.util.EnumSet; - -import net.minecraft.block.material.Material; -import appeng.block.AEBaseBlock; -import appeng.core.features.AEFeature; -import appeng.tile.mac.TileMolecularAssembler; - -public class BlockContainmentWall extends AEBaseBlock -{ - - public BlockContainmentWall() { - super( BlockContainmentWall.class, Material.iron ); - setfeature( EnumSet.of( AEFeature.MolecularAssembler ) ); - setTileEntiy( TileMolecularAssembler.class ); - } - -} diff --git a/block/mac/BlockCraftingAccelerator.java b/block/mac/BlockCraftingAccelerator.java deleted file mode 100644 index 17f97624d..000000000 --- a/block/mac/BlockCraftingAccelerator.java +++ /dev/null @@ -1,19 +0,0 @@ -package appeng.block.mac; - -import java.util.EnumSet; - -import net.minecraft.block.material.Material; -import appeng.block.AEBaseBlock; -import appeng.core.features.AEFeature; -import appeng.tile.mac.TileMolecularAssembler; - -public class BlockCraftingAccelerator extends AEBaseBlock -{ - - public BlockCraftingAccelerator() { - super( BlockCraftingAccelerator.class, Material.iron ); - setfeature( EnumSet.of( AEFeature.MolecularAssembler ) ); - setTileEntiy( TileMolecularAssembler.class ); - } - -} diff --git a/block/mac/BlockHeatVent.java b/block/mac/BlockHeatVent.java deleted file mode 100644 index 8501b9605..000000000 --- a/block/mac/BlockHeatVent.java +++ /dev/null @@ -1,19 +0,0 @@ -package appeng.block.mac; - -import java.util.EnumSet; - -import net.minecraft.block.material.Material; -import appeng.block.AEBaseBlock; -import appeng.core.features.AEFeature; -import appeng.tile.mac.TileMolecularAssembler; - -public class BlockHeatVent extends AEBaseBlock -{ - - public BlockHeatVent() { - super( BlockHeatVent.class, Material.iron ); - setfeature( EnumSet.of( AEFeature.MolecularAssembler ) ); - setTileEntiy( TileMolecularAssembler.class ); - } - -} diff --git a/block/mac/BlockPatternProvider.java b/block/mac/BlockPatternProvider.java deleted file mode 100644 index fca0dcf0d..000000000 --- a/block/mac/BlockPatternProvider.java +++ /dev/null @@ -1,19 +0,0 @@ -package appeng.block.mac; - -import java.util.EnumSet; - -import net.minecraft.block.material.Material; -import appeng.block.AEBaseBlock; -import appeng.core.features.AEFeature; -import appeng.tile.mac.TilePatternProvider; - -public class BlockPatternProvider extends AEBaseBlock -{ - - public BlockPatternProvider() { - super( BlockPatternProvider.class, Material.iron ); - setfeature( EnumSet.of( AEFeature.MolecularAssembler ) ); - setTileEntiy( TilePatternProvider.class ); - } - -} diff --git a/block/networking/BlockCableBus.java b/block/networking/BlockCableBus.java index 7d4455b33..d5ec3ddcc 100644 --- a/block/networking/BlockCableBus.java +++ b/block/networking/BlockCableBus.java @@ -94,7 +94,7 @@ public class BlockCableBus extends AEBaseBlock SelectedPart sp = cb( world, x, y, z ).selectPart( v3 ); if ( sp.part != null ) - return sp.part.getItemStack( PartItemStack.Break ); + return sp.part.getItemStack( PartItemStack.Pick ); else if ( sp.facade != null ) return sp.facade.getItemStack(); diff --git a/block/qnb/BlockQuantumLinkChamber.java b/block/qnb/BlockQuantumLinkChamber.java index 7ace4994e..f94a28d97 100644 --- a/block/qnb/BlockQuantumLinkChamber.java +++ b/block/qnb/BlockQuantumLinkChamber.java @@ -9,6 +9,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import appeng.block.AEBaseBlock; +import appeng.client.EffectType; import appeng.client.render.BaseBlockRender; import appeng.client.render.blocks.RenderQNB; import appeng.core.CommonHelper; @@ -42,7 +43,7 @@ public class BlockQuantumLinkChamber extends AEBaseBlock if ( bridge.hasQES() ) { if ( CommonHelper.proxy.shouldAddParticles( r ) ) - CommonHelper.proxy.spawnEnergy( w, bx + 0.5, by + 0.5, bz + 0.5 ); + CommonHelper.proxy.spawnEffect( EffectType.Energy, w, bx + 0.5, by + 0.5, bz + 0.5 ); } } } diff --git a/client/ClientHelper.java b/client/ClientHelper.java index d42b70c68..e3c10dd4d 100644 --- a/client/ClientHelper.java +++ b/client/ClientHelper.java @@ -36,8 +36,11 @@ import appeng.client.render.TESRWrapper; import appeng.client.render.WorldRender; import appeng.client.render.effects.EnergyFx; import appeng.client.render.effects.LightningEffect; +import appeng.client.render.effects.VibrantEffect; import appeng.client.texture.CableBusTextures; import appeng.client.texture.ExtraTextures; +import appeng.core.AEConfig; +import appeng.core.CommonHelper; import appeng.entity.EntityTinyTNTPrimed; import appeng.entity.RenderTinyTNTPrimed; import appeng.server.ServerHelper; @@ -185,14 +188,45 @@ public class ClientHelper extends ServerHelper } @Override - public void spawnLightning(World worldObj, double posX, double posY, double posZ) + public void spawnEffect(EffectType effect, World worldObj, double posX, double posY, double posZ) + { + if ( AEConfig.instance.enableEffects ) + { + switch (effect) + { + case Vibrant: + spawnVibrant( worldObj, posX, posY, posZ ); + return; + case Energy: + spawnEnergy( worldObj, posX, posY, posZ ); + return; + case Lightning: + spawnLightning( worldObj, posX, posY, posZ ); + return; + } + } + } + + private void spawnVibrant(World w, double x, double y, double z) + { + if ( CommonHelper.proxy.shouldAddParticles( Platform.getRandom() ) ) + { + double d0 = (double) (Platform.getRandomFloat() - 0.5F) * 0.26D; + double d1 = (double) (Platform.getRandomFloat() - 0.5F) * 0.26D; + double d2 = (double) (Platform.getRandomFloat() - 0.5F) * 0.26D; + + VibrantEffect fx = new VibrantEffect( w, x + d0, y + d1, z + d2, 0.0D, 0.0D, 0.0D ); + Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); + } + } + + private void spawnLightning(World worldObj, double posX, double posY, double posZ) { LightningEffect fx = new LightningEffect( worldObj, posX, posY + 0.3f, posZ, 0.0f, 0.0f, 0.0f ); Minecraft.getMinecraft().effectRenderer.addEffect( (EntityFX) fx ); } - @Override - public void spawnEnergy(World w, double posX, double posY, double posZ) + private void spawnEnergy(World w, double posX, double posY, double posZ) { float x = (float) (((Platform.getRandomInt() % 100) * 0.01) - 0.5) * 0.7f; float y = (float) (((Platform.getRandomInt() % 100) * 0.01) - 0.5) * 0.7f; diff --git a/client/EffectType.java b/client/EffectType.java new file mode 100644 index 000000000..9476b5b76 --- /dev/null +++ b/client/EffectType.java @@ -0,0 +1,6 @@ +package appeng.client; + +public enum EffectType +{ + Energy, Lightning, Vibrant +} diff --git a/core/CommonHelper.java b/core/CommonHelper.java index 60d58a3c9..344c320bc 100644 --- a/core/CommonHelper.java +++ b/core/CommonHelper.java @@ -9,6 +9,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import appeng.block.AEBaseBlock; +import appeng.client.EffectType; import appeng.core.sync.AppEngPacket; import cpw.mods.fml.common.SidedProxy; @@ -28,9 +29,7 @@ public abstract class CommonHelper public abstract void sendToAllNearExcept(EntityPlayer p, double x, double y, double z, double dist, World w, AppEngPacket packet); - public abstract void spawnLightning(World worldObj, double posX, double posY, double posZ); - - public abstract void spawnEnergy(World w, double posX, double posY, double posZ); + public abstract void spawnEffect(EffectType effect, World worldObj, double posX, double posY, double posZ); public abstract boolean shouldAddParticles(Random r); diff --git a/core/Registration.java b/core/Registration.java index 064cbaed8..621f2d42e 100644 --- a/core/Registration.java +++ b/core/Registration.java @@ -440,6 +440,7 @@ public class Registration IPartHelper ph = AEApi.instance().partHelper(); ph.registerNewLayer( "appeng.api.parts.layers.LayerIEnergySink", "ic2.api.energy.tile.IEnergySink" ); + ph.registerNewLayer( "appeng.api.parts.layers.LayerIEnergySource", "ic2.api.energy.tile.IEnergySource" ); ph.registerNewLayer( "appeng.api.parts.layers.LayerISidedInventory", "net.minecraft.inventory.ISidedInventory" ); ph.registerNewLayer( "appeng.api.parts.layers.LayerIPowerEmitter", "buildcraft.api.power.IPowerEmitter" ); ph.registerNewLayer( "appeng.api.parts.layers.LayerIPowerReceptor", "buildcraft.api.power.IPowerReceptor" ); diff --git a/core/features/AEFeature.java b/core/features/AEFeature.java index 925be8804..ef69ab8fc 100644 --- a/core/features/AEFeature.java +++ b/core/features/AEFeature.java @@ -8,7 +8,7 @@ public enum AEFeature CertusQuartzWorldGen("World"), - DecorativeLights("DecorativeLights"), DecorativeQuartzBlocks("World"), + DecorativeLights("World"), DecorativeQuartzBlocks("World"), GrindStone("World"), Flour("World"), Inscriber("World"), @@ -26,9 +26,11 @@ public enum AEFeature ChargedStaff("Tools"), EntropyManipulator("Tools"), MatterCannon("Tools"), WirelessAccessTerminal("Tools"), - PowerGen("NetworkFeatures"), + PowerGen("NetworkFeatures"), Security("NetworkFeatures"), - Crafting("NetworkFeatures"), MolecularAssembler("NetworkFeatures"), SpatialIO("NetworkFeatures"), QuantumNetworkBridge("NetworkFeatures"), + // Crafting("NetworkFeatures"), MolecularAssembler("NetworkFeatures"), + + SpatialIO("NetworkFeatures"), QuantumNetworkBridge("NetworkFeatures"), LevelEmiter("NetworkBuses"), CraftingTerminal("NetworkBuses"), StorageMonitor("NetworkBuses"), P2PTunnel("NetworkBuses"), FormationPlane("NetworkBuses"), AnnihilationPlane( "NetworkBuses"), ImportBus("NetworkBuses"), ExportBus("NetworkBuses"), StorageBus("NetworkBuses"), PartConversionMonitor("NetworkBuses"), @@ -40,13 +42,15 @@ public enum AEFeature DenseEnergyCells("HigherCapacity"), DenseCables("HigherCapacity"), P2PTunnelME("P2PTunnels"), P2PTunnelItems("P2PTunnels"), P2PTunnelRedstone("P2PTunnels"), P2PTunnelEU("P2PTunnels"), P2PTunnelMJ("P2PTunnels"), P2PTunnelLiquids( - "P2PTunnels"), Security("Security"), + "P2PTunnels"), MassCannonBlockDamage("BlockFeatures"), TinyTNTBlockDamage("BlockFeatures"), Facades("Facades"), - DuplicateItems("Misc", false), Profiler("Services"), VersionChecker("Services"), Debug("Misc", false), Creative("Misc"), + DuplicateItems("Misc", false), Profiler("Services", false), VersionChecker("Services"), Debug("Misc", false), Creative("Misc"), - Logging("Misc"), IntegrationLogging("Misc", false), CustomRecipes("Misc", false); + Logging("Misc"), IntegrationLogging("Misc", false), CustomRecipes("Crafting", false), + + inWorldSingularity("Crafting"), inWorldFluix("Crafting"), inWorldPurification("Crafting"); String Category; boolean visible = true; diff --git a/entity/EntityChargedQuartz.java b/entity/EntityChargedQuartz.java index 7138ee61a..421f3a3e1 100644 --- a/entity/EntityChargedQuartz.java +++ b/entity/EntityChargedQuartz.java @@ -12,8 +12,10 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import appeng.api.AEApi; -import appeng.core.CommonHelper; +import appeng.client.EffectType; import appeng.core.AEConfig; +import appeng.core.CommonHelper; +import appeng.core.features.AEFeature; import appeng.util.Platform; final public class EntityChargedQuartz extends EntityItem @@ -35,9 +37,12 @@ final public class EntityChargedQuartz extends EntityItem { super.onUpdate(); + if ( !AEConfig.instance.isFeatureEnabled( AEFeature.inWorldFluix ) ) + return; + if ( Platform.isClient() && delay++ > 30 && AEConfig.instance.enableEffects ) { - CommonHelper.proxy.spawnLightning( worldObj, posX, posY, posZ ); + CommonHelper.proxy.spawnEffect( EffectType.Lightning, worldObj, posX, posY, posZ ); delay = 0; } diff --git a/entity/EntityGrowingCrystal.java b/entity/EntityGrowingCrystal.java index 631f218b7..5a80d5149 100644 --- a/entity/EntityGrowingCrystal.java +++ b/entity/EntityGrowingCrystal.java @@ -9,6 +9,10 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import appeng.api.implementations.items.IGrowableCrystal; +import appeng.client.EffectType; +import appeng.core.AEConfig; +import appeng.core.CommonHelper; +import appeng.core.features.AEFeature; import appeng.tile.misc.TileQuartzGrowthAccelerator; import appeng.util.Platform; @@ -34,11 +38,12 @@ final public class EntityGrowingCrystal extends EntityItem public void onUpdate() { super.onUpdate(); - age = 0; - if ( Platform.isClient() ) + if ( !AEConfig.instance.isFeatureEnabled( AEFeature.inWorldPurification ) ) return; + age = 0; + ItemStack is = this.getEntityItem(); Item gc = is.getItem(); @@ -53,17 +58,58 @@ final public class EntityGrowingCrystal extends EntityItem IGrowableCrystal cry = (IGrowableCrystal) is.getItem(); float multiplier = cry.getMultiplier( blk, mat ); - if ( Platform.isServer() && mat.isLiquid() ) + int speed = (int) Math.max( 1, getSpeed( j, i, k ) * multiplier ); + + boolean isClient = Platform.isClient(); + + if ( mat.isLiquid() ) + { + if ( isClient ) + progress_1000++; + else + progress_1000 += speed; + + } + else + progress_1000 = 0; + + if ( isClient ) + { + int len = 40; + + if ( speed > 2 ) + len = 20; + + if ( speed > 90 ) + len = 15; + + if ( speed > 150 ) + len = 10; + + if ( speed > 240 ) + len = 7; + + if ( speed > 360 ) + len = 3; + + if ( speed > 500 ) + len = 1; + + if ( progress_1000 >= len ) + { + progress_1000 = 0; + CommonHelper.proxy.spawnEffect( EffectType.Vibrant, worldObj, posX, posY + 0.2, posZ ); + } + return; + } + else { - progress_1000 += Math.max( 1, getSpeed( j, i, k ) * multiplier ); if ( progress_1000 > 1000 ) { progress_1000 -= 1000; setEntityItemStack( cry.triggerGrowth( is ) ); } } - else - progress_1000 = 0; } } diff --git a/entity/EntitySingularity.java b/entity/EntitySingularity.java index 4842062f7..ac27dbb66 100644 --- a/entity/EntitySingularity.java +++ b/entity/EntitySingularity.java @@ -12,6 +12,8 @@ import net.minecraft.util.DamageSource; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; import appeng.api.AEApi; +import appeng.core.AEConfig; +import appeng.core.features.AEFeature; import appeng.util.Platform; final public class EntitySingularity extends EntityItem @@ -44,6 +46,9 @@ final public class EntitySingularity extends EntityItem if ( Platform.isClient() ) return; + if ( !AEConfig.instance.isFeatureEnabled( AEFeature.inWorldSingularity ) ) + return; + ItemStack item = getEntityItem(); if ( AEApi.instance().materials().materialSingularity.sameAs( item ) ) { diff --git a/fmp/CableBusPart.java b/fmp/CableBusPart.java index 5429b7d02..cafa78575 100644 --- a/fmp/CableBusPart.java +++ b/fmp/CableBusPart.java @@ -9,6 +9,7 @@ import java.util.ArrayList; import java.util.EnumSet; import java.util.LinkedList; import java.util.List; +import java.util.Set; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -27,6 +28,7 @@ import appeng.api.parts.IPart; import appeng.api.parts.IPartCollsionHelper; import appeng.api.parts.IPartHost; import appeng.api.parts.IPartItem; +import appeng.api.parts.LayerFlags; import appeng.api.parts.PartItemStack; import appeng.api.parts.SelectedPart; import appeng.api.util.AECableType; @@ -426,6 +428,12 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds // nothing! } + @Override + public Set getLayerFlags() + { + return cb.getLayerFlags(); + } + @Override public void markForSave() { diff --git a/integration/modules/IC2.java b/integration/modules/IC2.java index 10d77f816..0c51398d3 100644 --- a/integration/modules/IC2.java +++ b/integration/modules/IC2.java @@ -6,6 +6,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.MinecraftForge; import appeng.api.AEApi; +import appeng.api.config.TunnelType; +import appeng.api.features.IP2PTunnelRegistry; import appeng.integration.IIntegrationModule; import appeng.integration.abstraction.IIC2; @@ -23,6 +25,19 @@ public class IC2 implements IIntegrationModule, IIC2 @Override public void PostInit() { + IP2PTunnelRegistry reg = AEApi.instance().registries().p2pTunnel(); + reg.addNewAttunement( getItem( "copperCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( getItem( "insulatedCopperCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( getItem( "goldCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( getItem( "insulatedGoldCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( getItem( "ironCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( getItem( "insulatedIronCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( getItem( "insulatedTinCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( getItem( "glassFiberCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( getItem( "tinCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( getItem( "detectorCableItem" ), TunnelType.IC2_POWER ); + reg.addNewAttunement( getItem( "splitterCableItem" ), TunnelType.IC2_POWER ); + AEApi.instance().registries().matterCannon().registerAmmo( getItem( "uraniumDrop" ), 238.0289 ); } diff --git a/items/ItemEncodedPattern.java b/items/ItemEncodedPattern.java deleted file mode 100644 index 832b0947d..000000000 --- a/items/ItemEncodedPattern.java +++ /dev/null @@ -1,25 +0,0 @@ -package appeng.items; - -import java.util.EnumSet; - -import net.minecraft.item.ItemStack; -import appeng.api.crafting.ICraftingPatternMAC; -import appeng.api.implementations.ICraftingPatternItem; -import appeng.core.features.AEFeature; - -public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternItem -{ - - public ItemEncodedPattern() { - super( ItemEncodedPattern.class ); - setfeature( EnumSet.of( AEFeature.Crafting ) ); - } - - @Override - public ICraftingPatternMAC getPatternForItem(ItemStack is) - { - // TODO Auto-generated method stub - return null; - } - -} diff --git a/items/parts/PartType.java b/items/parts/PartType.java index bd94ce391..1e3f56ab8 100644 --- a/items/parts/PartType.java +++ b/items/parts/PartType.java @@ -22,12 +22,12 @@ import appeng.parts.networking.PartCableSmart; import appeng.parts.networking.PartDenseCable; import appeng.parts.networking.PartQuartzFiber; import appeng.parts.p2p.PartP2PBCPower; +import appeng.parts.p2p.PartP2PIC2Power; import appeng.parts.p2p.PartP2PItems; import appeng.parts.p2p.PartP2PLiquids; import appeng.parts.p2p.PartP2PRedstone; import appeng.parts.p2p.PartP2PTunnelME; import appeng.parts.reporting.PartConversionMonitor; -import appeng.parts.reporting.PartCraftingMonitor; import appeng.parts.reporting.PartCraftingTerminal; import appeng.parts.reporting.PartDarkMonitor; import appeng.parts.reporting.PartMonitor; @@ -78,9 +78,9 @@ public enum PartType P2PTunnelMJ(AEFeature.P2PTunnelMJ, PartP2PBCPower.class, GuiText.MJTunnel), - // P2PTunnelEU(AEFeature.P2PTunnelEU, PartP2PIC2Power.class, GuiText.EUTunnel), + P2PTunnelEU(AEFeature.P2PTunnelEU, PartP2PIC2Power.class, GuiText.EUTunnel), - CraftingMonitor(AEFeature.Crafting, PartCraftingMonitor.class), + // CraftingMonitor(AEFeature.Crafting, PartCraftingMonitor.class), PatternTerminal(AEFeature.CraftingTerminal, PartPatternTerminal.class), diff --git a/me/cache/helpers/TunnelCollection.java b/me/cache/helpers/TunnelCollection.java index e1e125fcf..87a04517a 100644 --- a/me/cache/helpers/TunnelCollection.java +++ b/me/cache/helpers/TunnelCollection.java @@ -32,6 +32,6 @@ public class TunnelCollection implements Iterable public boolean isEmpty() { - return iterator().hasNext(); + return !iterator().hasNext(); } } diff --git a/parts/CableBusContainer.java b/parts/CableBusContainer.java index 93caa5365..f1597aefd 100644 --- a/parts/CableBusContainer.java +++ b/parts/CableBusContainer.java @@ -7,6 +7,7 @@ import java.util.EnumSet; import java.util.LinkedList; import java.util.List; import java.util.Random; +import java.util.Set; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -31,6 +32,7 @@ import appeng.api.parts.IPart; import appeng.api.parts.IPartCollsionHelper; import appeng.api.parts.IPartHost; import appeng.api.parts.IPartItem; +import appeng.api.parts.LayerFlags; import appeng.api.parts.PartItemStack; import appeng.api.parts.SelectedPart; import appeng.api.util.AECableType; @@ -51,6 +53,7 @@ public class CableBusContainer implements AEMultiTile, ICableBusContainer private IPartCable center; private IPart sides[] = new IPart[6]; private FacadeContainer fc = new FacadeContainer(); + private EnumSet myLayerFlags = EnumSet.noneOf( LayerFlags.class ); public boolean hasRedstone = false; public IPartHost tcb; @@ -959,4 +962,10 @@ public class CableBusContainer implements AEMultiTile, ICableBusContainer } } + @Override + public Set getLayerFlags() + { + return myLayerFlags; + } + } diff --git a/parts/p2p/PartP2PIC2Power.java b/parts/p2p/PartP2PIC2Power.java index 6ab471543..568731751 100644 --- a/parts/p2p/PartP2PIC2Power.java +++ b/parts/p2p/PartP2PIC2Power.java @@ -9,6 +9,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraftforge.common.util.ForgeDirection; import appeng.api.config.TunnelType; +import appeng.core.AELog; import appeng.me.GridAccessException; import appeng.me.cache.helpers.TunnelCollection; import appeng.util.Platform; @@ -107,7 +108,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i @Override public double injectEnergyUnits(ForgeDirection directionFrom, double amount) { - + AELog.info( "INJECT: " + amount ); TunnelCollection outs; try { @@ -147,6 +148,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i @Override public double getOfferedEnergy() { + AELog.info( "getOfferedEnergy: " + OutputPacket ); if ( output ) return OutputPacket; return 0; @@ -155,6 +157,7 @@ public class PartP2PIC2Power extends PartP2PTunnel implements i @Override public void drawEnergy(double amount) { + AELog.info( "drawEnergy: " + amount ); OutputPacket -= amount; } diff --git a/parts/p2p/PartP2PTunnel.java b/parts/p2p/PartP2PTunnel.java index d51ebab55..e7784b740 100644 --- a/parts/p2p/PartP2PTunnel.java +++ b/parts/p2p/PartP2PTunnel.java @@ -46,7 +46,7 @@ public class PartP2PTunnel extends PartBasicState { return false; } - + @Override public void writeToNBT(NBTTagCompound data) { @@ -225,7 +225,7 @@ public class PartP2PTunnel extends PartBasicState public ItemStack getItemStack(PartItemStack type) { - if ( type == PartItemStack.World || type == PartItemStack.Network || type == PartItemStack.Wrench ) + if ( type == PartItemStack.World || type == PartItemStack.Network || type == PartItemStack.Wrench || type == PartItemStack.Pick ) return super.getItemStack( type ); return AEApi.instance().parts().partP2PTunnelME.stack( 1 ); diff --git a/server/ServerHelper.java b/server/ServerHelper.java index 9149f56fc..144fd4304 100644 --- a/server/ServerHelper.java +++ b/server/ServerHelper.java @@ -12,6 +12,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import appeng.block.AEBaseBlock; +import appeng.client.EffectType; import appeng.core.CommonHelper; import appeng.core.sync.AppEngPacket; import appeng.core.sync.network.NetworkHandler; @@ -84,13 +85,7 @@ public class ServerHelper extends CommonHelper } @Override - public void spawnLightning(World worldObj, double posX, double posY, double posZ) - { - // :P - } - - @Override - public void spawnEnergy(World w, double posX, double posY, double posZ) + public void spawnEffect(EffectType type, World worldObj, double posX, double posY, double posZ) { // :P } diff --git a/tile/networking/TileCableBus.java b/tile/networking/TileCableBus.java index 3e3b1809f..ec5507cde 100644 --- a/tile/networking/TileCableBus.java +++ b/tile/networking/TileCableBus.java @@ -6,6 +6,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.EnumSet; import java.util.List; +import java.util.Set; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; @@ -20,6 +21,7 @@ import powercrystals.minefactoryreloaded.api.rednet.RedNetConnectionType; import appeng.api.networking.IGridNode; import appeng.api.parts.IFacadeContainer; import appeng.api.parts.IPart; +import appeng.api.parts.LayerFlags; import appeng.api.parts.SelectedPart; import appeng.api.util.AECableType; import appeng.api.util.AEColor; @@ -310,4 +312,10 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl return cb.requiresDynamicRender; } + @Override + public Set getLayerFlags() + { + return cb.getLayerFlags(); + } + } diff --git a/util/Platform.java b/util/Platform.java index 6f506693c..7165961eb 100644 --- a/util/Platform.java +++ b/util/Platform.java @@ -884,7 +884,7 @@ public class Platform { int index = rdnSrc.nextInt( outs.size() ); Iterator i = outs.iterator(); - while (i.hasNext() && index > 0) + while (i.hasNext() && index-- > 0) i.next(); if ( i.hasNext() ) return i.next(); @@ -1331,7 +1331,7 @@ public class Platform if ( myItems != null ) { - for (IAEItemStack is : myItems.getAvailableItems( new ItemList(IAEItemStack.class) )) + for (IAEItemStack is : myItems.getAvailableItems( new ItemList( IAEItemStack.class ) )) { gs.postAlterationOfStoredItems( StorageChannel.ITEMS, is, src ); } @@ -1341,7 +1341,7 @@ public class Platform if ( myFluids != null ) { - for (IAEFluidStack is : myFluids.getAvailableItems( new ItemList(IAEFluidStack.class) )) + for (IAEFluidStack is : myFluids.getAvailableItems( new ItemList( IAEFluidStack.class ) )) { gs.postAlterationOfStoredItems( StorageChannel.FLUIDS, is, src ); }