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(); 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/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 ); + } } 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/parts/automation/PartFormationPlane.java b/parts/automation/PartFormationPlane.java index c2099880..e875e5d6 100644 --- a/parts/automation/PartFormationPlane.java +++ b/parts/automation/PartFormationPlane.java @@ -4,11 +4,13 @@ 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; 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; @@ -390,6 +392,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 +447,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; } } 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" );