Fixes #413 Adding removed reflection called constructor

This commit is contained in:
thatsIch 2014-11-10 22:10:01 +01:00
parent c7bae7f448
commit e446158559
2 changed files with 39 additions and 13 deletions

View file

@ -14,10 +14,10 @@ forge_version=10.13.2.1230
# APIs used for development #
#########################################################
cb_minecraft_version=1.7.10
fmp_version=1.1.0.308
code_chicken_lib_version=1.1.1.104
code_chicken_core_version=1.0.3.26
nei_version=1.0.3.56
fmp_version=1.1.0.311
code_chicken_lib_version=1.1.1.105
code_chicken_core_version=1.0.4.29
nei_version=1.0.3.66
waila_version=1.5.5_1.7.10
#########################################################

View file

@ -1,5 +1,24 @@
/*
* This file is part of Applied Energistics 2.
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
*
* Applied Energistics 2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Applied Energistics 2 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
*/
package appeng.entity;
import java.util.Date;
import java.util.List;
@ -11,22 +30,30 @@ import net.minecraft.util.AxisAlignedBB;
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 AEBaseEntityItem
{
static private int randTickSeed = 0;
public EntitySingularity(World w, double x, double y, double z, ItemStack is) {
public EntitySingularity( World w )
{
super( w );
}
public EntitySingularity( World w, double x, double y, double z, ItemStack is )
{
super( w, x, y, z, is );
}
@Override
public boolean attackEntityFrom(DamageSource src, float dmg)
public boolean attackEntityFrom( DamageSource src, float dmg )
{
if ( src.isExplosion() )
{
@ -51,15 +78,15 @@ final public class EntitySingularity extends AEBaseEntityItem
AxisAlignedBB region = AxisAlignedBB.getBoundingBox( posX - 4, posY - 4, posZ - 4, posX + 4, posY + 4, posZ + 4 );
List<Entity> l = this.getCheckedEntitiesWithinAABBExcludingEntity( region );
for (Entity e : l)
for ( Entity e : l )
{
if ( e instanceof EntityItem )
{
ItemStack other = ((EntityItem) e).getEntityItem();
ItemStack other = ( ( EntityItem ) e ).getEntityItem();
if ( other != null )
{
boolean matches = false;
for (ItemStack is : OreDictionary.getOres( "dustEnder" ))
for ( ItemStack is : OreDictionary.getOres( "dustEnder" ) )
{
if ( OreDictionary.itemMatches( other, is, false ) )
{
@ -71,7 +98,7 @@ final public class EntitySingularity extends AEBaseEntityItem
// check... other name.
if ( !matches )
{
for (ItemStack is : OreDictionary.getOres( "dustEnderPearl" ))
for ( ItemStack is : OreDictionary.getOres( "dustEnderPearl" ) )
{
if ( OreDictionary.itemMatches( other, is, false ) )
{
@ -83,7 +110,7 @@ final public class EntitySingularity extends AEBaseEntityItem
if ( matches )
{
while (item.stackSize > 0 && other.stackSize > 0)
while ( item.stackSize > 0 && other.stackSize > 0 )
{
other.stackSize--;
if ( other.stackSize == 0 )
@ -91,7 +118,7 @@ final public class EntitySingularity extends AEBaseEntityItem
ItemStack Output = AEApi.instance().materials().materialQESingularity.stack( 2 );
NBTTagCompound cmp = Platform.openNbtData( Output );
cmp.setLong( "freq", (new Date()).getTime() * 100 + (randTickSeed++) % 100 );
cmp.setLong( "freq", ( new Date() ).getTime() * 100 + ( randTickSeed++ ) % 100 );
item.stackSize--;
worldObj.spawnEntityInWorld( new EntitySingularity( worldObj, posX, posY, posZ, Output ) );
@ -105,5 +132,4 @@ final public class EntitySingularity extends AEBaseEntityItem
}
}
}
}