From 9191d8d29e700ba8d6bb048bd31ca55e48ce3505 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Sat, 28 Jun 2014 00:25:54 -0500 Subject: [PATCH 1/5] Split RF into RF Tiles and RF Items, should fix some crashes. --- integration/modules/RFItem.java | 27 +++++++++++++++++++ .../tools/powered/powersink/RedstoneFlux.java | 2 +- transformer/asm/ASMIntegration.java | 5 +++- 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 integration/modules/RFItem.java diff --git a/integration/modules/RFItem.java b/integration/modules/RFItem.java new file mode 100644 index 00000000..2cb3a475 --- /dev/null +++ b/integration/modules/RFItem.java @@ -0,0 +1,27 @@ +package appeng.integration.modules; + +import appeng.integration.BaseModule; +import appeng.integration.IIntegrationModule; + +public class RFItem extends BaseModule implements IIntegrationModule +{ + + public static RFItem instance; + + public RFItem() { + TestClass( cofh.api.energy.IEnergyContainerItem.class ); + } + + @Override + public void Init() + { + + } + + @Override + public void PostInit() + { + + } + +} diff --git a/items/tools/powered/powersink/RedstoneFlux.java b/items/tools/powered/powersink/RedstoneFlux.java index d2f0f843..b371c258 100644 --- a/items/tools/powered/powersink/RedstoneFlux.java +++ b/items/tools/powered/powersink/RedstoneFlux.java @@ -5,7 +5,7 @@ import appeng.api.config.PowerUnits; import appeng.transformer.annotations.integration.Interface; import cofh.api.energy.IEnergyContainerItem; -@Interface(iface = "cofh.api.energy.IEnergyContainerItem", iname = "RF") +@Interface(iface = "cofh.api.energy.IEnergyContainerItem", iname = "RFItem") public class RedstoneFlux extends IC2 implements IEnergyContainerItem { diff --git a/transformer/asm/ASMIntegration.java b/transformer/asm/ASMIntegration.java index 64215be4..d8941ab0 100644 --- a/transformer/asm/ASMIntegration.java +++ b/transformer/asm/ASMIntegration.java @@ -37,7 +37,10 @@ public class ASMIntegration implements IClassTransformer integrationModules.add( IntegrationSide.BOTH, "BuildCraft", "BuildCraft|Silicon", "BC" ); integrationModules.add( IntegrationSide.BOTH, "BuildCraft5 Power", null, "MJ5" ); integrationModules.add( IntegrationSide.BOTH, "BuildCraft6 Power", null, "MJ6" ); - integrationModules.add( IntegrationSide.BOTH, "RedstoneFlux Power", null, "RF" ); + + integrationModules.add( IntegrationSide.BOTH, "RedstoneFlux Power - Tiles", null, "RF" ); + integrationModules.add( IntegrationSide.BOTH, "RedstoneFlux Power - Items", null, "RFItem" ); + // integrationModules.add( IntegrationSide.BOTH, "Greg Tech", "gregtech_addon", "GT" ); // integrationModules.add( IntegrationSide.BOTH, "Universal Electricity", null, "UE" ); // integrationModules.add( IntegrationSide.BOTH, "Logistics Pipes", "LogisticsPipes|Main", "LP" ); From 297c957787aa5b168a234f89af25a4d685a40e11 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Sat, 28 Jun 2014 20:32:07 -0500 Subject: [PATCH 2/5] Master requires 1.7.2 --- core/AppEng.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/AppEng.java b/core/AppEng.java index 248cc503..a0e3027c 100644 --- a/core/AppEng.java +++ b/core/AppEng.java @@ -37,7 +37,7 @@ import cpw.mods.fml.common.event.FMLServerStartingEvent; import cpw.mods.fml.common.event.FMLServerStoppingEvent; import cpw.mods.fml.common.network.NetworkRegistry; -@Mod(modid = AppEng.modid, name = AppEng.name, version = AEConfig.VERSION, dependencies = AppEng.dependencies) +@Mod(modid = AppEng.modid, acceptedMinecraftVersions = "[1.7.2]", name = AppEng.name, version = AEConfig.VERSION, dependencies = AppEng.dependencies) public class AppEng { @@ -111,7 +111,7 @@ public class AppEng AELog.info( "Starting ( PreInit )" ); - CreativeTab.init(); + CreativeTab.init(); if ( AEConfig.instance.isFeatureEnabled( AEFeature.Facades ) ) CreativeTabFacade.init(); From 2c7724266798e3ba2ff92cdf843d903c536dae9f Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Sun, 29 Jun 2014 12:43:09 -0500 Subject: [PATCH 3/5] Disassemble Storages Cells regardless of where your looking. --- items/storage/ItemBasicStorageCell.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/items/storage/ItemBasicStorageCell.java b/items/storage/ItemBasicStorageCell.java index ca54beec..2268fbc7 100644 --- a/items/storage/ItemBasicStorageCell.java +++ b/items/storage/ItemBasicStorageCell.java @@ -178,8 +178,7 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II return true; } - @Override - public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) + private boolean dissassembleDrive(ItemStack stack, World world, EntityPlayer player) { if ( player.isSneaking() ) { @@ -213,4 +212,17 @@ public class ItemBasicStorageCell extends AEBaseItem implements IStorageCell, II } return false; } + + @Override + public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) + { + dissassembleDrive( stack, world, player ); + return stack; + } + + @Override + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) + { + return dissassembleDrive( stack, world, player ); + } } From a5a92af74a41f68bc433e18b7a35b573e292a25c Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Sun, 29 Jun 2014 21:03:00 -0500 Subject: [PATCH 4/5] Fixes for formation plane, also enabled fireworks to be shot using it. --- parts/automation/PartFormationPlane.java | 49 +++++++++++++++++++----- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/parts/automation/PartFormationPlane.java b/parts/automation/PartFormationPlane.java index c2099880..a3a511aa 100644 --- a/parts/automation/PartFormationPlane.java +++ b/parts/automation/PartFormationPlane.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; @@ -390,6 +391,16 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine EntityPlayer player = Platform.getPlayer( (WorldServer) w ); Platform.configurePlayer( player, side, tile ); + if ( i instanceof ItemFirework ) + { + Chunk c = w.getChunkFromBlockCoords( x, z ); + int sum = 0; + for (List Z : c.entityLists) + sum += Z.size(); + if ( sum > 32 ) + return input; + } + maxStorage = is.stackSize; worked = true; if ( type == Actionable.MODULATE ) @@ -435,21 +446,39 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine { if ( type == Actionable.MODULATE ) { + is.stackSize = (int) maxStorage; - if ( type == Actionable.MODULATE ) + EntityItem ei = new EntityItem( w, // w + ((side.offsetX != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) + 0.5 + side.offsetX * -0.3 + (double) x, // spawn + ((side.offsetY != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) + 0.5 + side.offsetY * -0.3 + (double) y, // spawn + ((side.offsetZ != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) + 0.5 + side.offsetZ * -0.3 + (double) z, // spawn + is.copy() ); + + Entity result = ei; + + ei.motionX = side.offsetX * 0.2; + ei.motionY = side.offsetY * 0.2; + ei.motionZ = side.offsetZ * 0.2; + + if ( is.getItem().hasCustomEntity( is ) ) { - EntityItem ei = new EntityItem( w, // w - ((side.offsetX != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) + 0.5 + side.offsetX * -0.3 + (double) x, // spawn - ((side.offsetY != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) + 0.5 + side.offsetY * -0.3 + (double) y, // spawn - ((side.offsetZ != 0 ? 0.0 : 0.7) * (Platform.getRandomFloat() - 0.5f)) + 0.5 + side.offsetZ * -0.3 + (double) z, // spawn - is.copy() ); - ei.motionX = side.offsetX * 0.2; - ei.motionY = side.offsetY * 0.2; - ei.motionZ = side.offsetZ * 0.2; - w.spawnEntityInWorld( ei ); + result = is.getItem().createEntity( w, ei, is ); + if ( result != null ) + ei.setDead(); + else + result = ei; } + + if ( !w.spawnEntityInWorld( result ) ) + { + result.setDead(); + worked = false; + } + } } + else + worked = false; } } From c74c18f81bfd834296ff10a0bb3776ccfdce3197 Mon Sep 17 00:00:00 2001 From: AlgorithmX2 Date: Sun, 29 Jun 2014 21:48:27 -0500 Subject: [PATCH 5/5] missing import. --- parts/automation/PartFormationPlane.java | 1 + 1 file changed, 1 insertion(+) diff --git a/parts/automation/PartFormationPlane.java b/parts/automation/PartFormationPlane.java index a3a511aa..e875e5d6 100644 --- a/parts/automation/PartFormationPlane.java +++ b/parts/automation/PartFormationPlane.java @@ -10,6 +10,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemFirework; import net.minecraft.item.ItemSkull; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound;