Re-Enabled IC2 API.

Relocated Entity Package.
Removed Blank Patterns Item.
This commit is contained in:
AlgorithmX2 2014-02-22 19:28:52 -06:00
parent 302a41ac76
commit e94b0bbe60
8 changed files with 205 additions and 26 deletions

View file

@ -22,10 +22,10 @@ import net.minecraft.world.World;
import appeng.block.AEBaseBlock;
import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderTinyTNT;
import appeng.client.render.entity.EntityIds;
import appeng.client.texture.FullIcon;
import appeng.core.AppEng;
import appeng.core.features.AEFeature;
import appeng.entity.EntityIds;
import appeng.entity.EntityTinyTNTPrimed;
import appeng.helpers.DispenserBehaviorTinyTNT;
import appeng.helpers.ICustomCollision;

View file

@ -36,10 +36,10 @@ 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.entity.RenderTinyTNTPrimed;
import appeng.client.texture.CableBusTextures;
import appeng.client.texture.ExtraTextures;
import appeng.entity.EntityTinyTNTPrimed;
import appeng.entity.RenderTinyTNTPrimed;
import appeng.server.ServerHelper;
import appeng.util.Platform;
import cpw.mods.fml.client.registry.ClientRegistry;

View file

@ -0,0 +1,71 @@
package appeng.entity;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import appeng.api.implementations.items.IGrowableCrystal;
import appeng.util.Platform;
final public class EntityGrowingCrystal extends EntityItem
{
private int progress_1000 = 0;
public float getProgress()
{
return (float) progress_1000 / 1000.0f;
}
public EntityGrowingCrystal(World w) {
super( w );
}
public EntityGrowingCrystal(World w, double x, double y, double z, ItemStack is) {
super( w, x, y, z, is );
}
@Override
public void onUpdate()
{
super.onUpdate();
if ( Platform.isClient() )
return;
ItemStack is = this.getEntityItem();
Item gc = is.getItem();
if ( gc instanceof IGrowableCrystal ) // if it changes this just stops being an issue...
{
int j = MathHelper.floor_double( this.posX );
int i = MathHelper.floor_double( this.posY );
int k = MathHelper.floor_double( this.posZ );
Block blk = worldObj.getBlock( j, i, k );
Material mat = blk.getMaterial();
IGrowableCrystal cry = (IGrowableCrystal) is.getItem();
float multiplier = cry.getMultiplier( blk, mat );
if ( Platform.isServer() && mat.isLiquid() )
{
progress_1000 += Math.min( 1, getSpeed( j, i, k ) * multiplier );
if ( progress_1000 > 1000 )
{
setEntityItemStack( cry.triggerGrowth( is ) );
}
}
else
progress_1000 = 0;
}
}
private int getSpeed(int x, int y, int z)
{
return 10;
}
}

View file

@ -1,9 +1,6 @@
package appeng.client.render.entity;
package appeng.entity;
import net.minecraft.entity.Entity;
import appeng.entity.EntityChargedQuartz;
import appeng.entity.EntitySingularity;
import appeng.entity.EntityTinyTNTPrimed;
public class EntityIds
{
@ -11,6 +8,7 @@ public class EntityIds
public static final int TINY_TNT = 10;
public static final int SINGULARITY = 11;
public static final int CHARGED_QUARTZ = 12;
public static final int GROWING_CRYSTAL = 13;
public static int get(Class<? extends Entity> droppedEntity)
{
@ -20,6 +18,8 @@ public class EntityIds
return SINGULARITY;
if ( droppedEntity == EntityChargedQuartz.class )
return CHARGED_QUARTZ;
if ( droppedEntity == EntityChargedQuartz.class )
return GROWING_CRYSTAL;
throw new RuntimeException( "Missing entity id: " + droppedEntity.getName() );
}

View file

@ -1,4 +1,4 @@
package appeng.client.render.entity;
package appeng.entity;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.entity.Render;
@ -10,7 +10,6 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import appeng.entity.EntityTinyTNTPrimed;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

View file

@ -1,8 +1,7 @@
package appeng.integration.modules.dead;
package appeng.integration.modules;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.recipe.RecipeInputItemStack;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.MinecraftForge;
@ -27,22 +26,24 @@ public class IC2 implements IIntegrationModule, IIC2
{
AEApi.instance().registries().matterCannon().registerAmmo( getItem( "uraniumDrop" ), 238.0289 );
// certus quartz
maceratorRecipe( AEApi.instance().materials().materialCertusQuartzCrystal.stack( 1 ), AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
maceratorRecipe( AEApi.instance().materials().materialCertusQuartzCrystalCharged.stack( 1 ), AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
// fluix
maceratorRecipe( AEApi.instance().materials().materialFluixCrystal.stack( 1 ), AEApi.instance().materials().materialFluixDust.stack( 1 ) );
// nether quartz
maceratorRecipe( new ItemStack( Item.netherQuartz ), AEApi.instance().materials().materialNetherQuartzDust.stack( 1 ) );
/*
* // certus quartz maceratorRecipe( AEApi.instance().materials().materialCertusQuartzCrystal.stack( 1 ),
* AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
*
* maceratorRecipe( AEApi.instance().materials().materialCertusQuartzCrystalCharged.stack( 1 ),
* AEApi.instance().materials().materialCertusQuartzDust.stack( 1 ) );
*
* // fluix maceratorRecipe( AEApi.instance().materials().materialFluixCrystal.stack( 1 ),
* AEApi.instance().materials().materialFluixDust.stack( 1 ) );
*
* // nether quartz maceratorRecipe( new ItemStack( Itemq ),
* AEApi.instance().materials().materialNetherQuartzDust.stack( 1 ) );
*/
}
/*
* private void compressorRecipe(ItemStack in, ItemStack out) {
* ic2.api.recipe.Recipes.compressor.addRecipe( new RecipeInputItemStack(
* in, in.stackSize ), null, out ); }
* private void compressorRecipe(ItemStack in, ItemStack out) { ic2.api.recipe.Recipes.compressor.addRecipe( new
* RecipeInputItemStack( in, in.stackSize ), null, out ); }
*/
private void maceratorRecipe(ItemStack in, ItemStack out)
{
@ -64,7 +65,7 @@ public class IC2 implements IIntegrationModule, IIC2
@Override
public ItemStack getItem(String name)
{
return ic2.api.item.Items.getItem( name );
return ic2.api.item.IC2Items.getItem( name );
}
}

View file

@ -5,10 +5,10 @@ import java.util.EnumSet;
import net.minecraft.entity.Entity;
import net.minecraft.util.IIcon;
import net.minecraftforge.oredict.OreDictionary;
import appeng.client.render.entity.EntityIds;
import appeng.core.AppEng;
import appeng.core.features.AEFeature;
import appeng.entity.EntityChargedQuartz;
import appeng.entity.EntityIds;
import appeng.entity.EntitySingularity;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.relauncher.Side;
@ -46,7 +46,7 @@ public enum MaterialType
Wireless(AEFeature.WirelessAccessTerminal), WirelessBooster(AEFeature.WirelessAccessTerminal),
BlankPattern, FormationCore, AnnihilationCore,
FormationCore, AnnihilationCore,
EnderDust(AEFeature.QuantumNetworkBridge, "dustEnder", EntitySingularity.class), Singularity(AEFeature.QuantumNetworkBridge, EntitySingularity.class), QESingularity(
AEFeature.QuantumNetworkBridge, EntitySingularity.class);

View file

@ -0,0 +1,108 @@
package appeng.items.misc;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import appeng.api.AEApi;
import appeng.api.implementations.items.IGrowableCrystal;
import appeng.items.AEBaseItem;
public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
{
IIcon certus[] = new IIcon[3];
IIcon fluix[] = new IIcon[3];
IIcon nether[] = new IIcon[3];
public ItemCrystalSeed() {
super( ItemCrystalSeed.class );
}
@Override
public String getUnlocalizedName(ItemStack is)
{
int damage = is.getItemDamage();
if ( damage <= 600 )
return getUnlocalizedName() + ".Certus";
if ( damage <= 1200 )
return getUnlocalizedName() + ".Nether";
if ( damage <= 1800 )
return getUnlocalizedName() + ".Fluix";
return getUnlocalizedName();
}
@Override
public ItemStack triggerGrowth(ItemStack is)
{
is.setItemDamage( is.getItemDamage() + 1 );
if ( is.getItemDamage() > 1800 ) // max!
return is;
if ( is.getItemDamage() == 600 )
return AEApi.instance().materials().materialPureifiedCertusQuartzCrystal.stack( is.stackSize );
if ( is.getItemDamage() == 1200 )
return AEApi.instance().materials().materialPureifiedNetherQuartzCrystal.stack( is.stackSize );
if ( is.getItemDamage() == 1800 )
return AEApi.instance().materials().materialPureifiedFluixCrystal.stack( is.stackSize );
return is;
}
@Override
public IIcon getIconFromDamage(int damage)
{
IIcon list[] = null;
if ( damage < 600 )
list = certus;
if ( damage < 1200 )
list = nether;
if ( damage < 1800 )
list = fluix;
if ( list == null )
return Items.diamond.getIconFromDamage( 0 );
if ( damage < 200 )
return list[0];
else if ( damage < 400 )
return list[1];
else
return list[2];
}
@Override
public float getMultiplier(Block blk, Material mat)
{
return 1.0f;
}
@Override
public void registerIcons(IIconRegister ir)
{
String preFix = "appliedenergistics2:GrowthSeed.";
certus[0] = ir.registerIcon( preFix + "Certus" );
certus[1] = ir.registerIcon( preFix + "Certus1" );
certus[2] = ir.registerIcon( preFix + "Certus2" );
nether[0] = ir.registerIcon( preFix + "Nether" );
nether[1] = ir.registerIcon( preFix + "Nether1" );
nether[2] = ir.registerIcon( preFix + "Nether2" );
fluix[0] = ir.registerIcon( preFix + "Fluix" );
fluix[1] = ir.registerIcon( preFix + "Fluix1" );
fluix[2] = ir.registerIcon( preFix + "Fluix2" );
}
}