This commit is contained in:
AlgorithmX2 2014-07-02 11:40:19 -05:00
commit 40e71566ea
6 changed files with 88 additions and 16 deletions

View file

@ -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();

View file

@ -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()
{
}
}

View file

@ -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 );
}
}

View file

@ -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
{

View file

@ -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;
}
}

View file

@ -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" );