Fixes #675 No disabled feature should log spam or crash anymore.
Deprecates the old usage of the AEItemDefinitions via the direct method access of * blocks() * parts() * items() * materials() and thus use the new re-direct via definitions(). All definitions are now initialized, no matter what. But SubItems, Items and Blocks are not registered, if by chance are disabled.
This commit is contained in:
@@ -32,8 +32,10 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.definitions.IMaterials;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.helpers.Reflected;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
@@ -42,6 +44,7 @@ final public class EntitySingularity extends AEBaseEntityItem
|
||||
|
||||
static private int randTickSeed = 0;
|
||||
|
||||
@Reflected
|
||||
public EntitySingularity( World w )
|
||||
{
|
||||
super( w );
|
||||
@@ -73,7 +76,10 @@ final public class EntitySingularity extends AEBaseEntityItem
|
||||
return;
|
||||
|
||||
ItemStack item = this.getEntityItem();
|
||||
if ( AEApi.instance().materials().materialSingularity.sameAsStack( item ) )
|
||||
|
||||
final IMaterials materials = AEApi.instance().definitions().materials();
|
||||
|
||||
if ( materials.singularity().isSameAs( item ) )
|
||||
{
|
||||
AxisAlignedBB region = AxisAlignedBB.getBoundingBox( this.posX - 4, this.posY - 4, this.posZ - 4, this.posX + 4, this.posY + 4, this.posZ + 4 );
|
||||
List<Entity> l = this.getCheckedEntitiesWithinAABBExcludingEntity( region );
|
||||
@@ -116,13 +122,16 @@ final public class EntitySingularity extends AEBaseEntityItem
|
||||
if ( other.stackSize == 0 )
|
||||
e.setDead();
|
||||
|
||||
ItemStack Output = AEApi.instance().materials().materialQESingularity.stack( 2 );
|
||||
NBTTagCompound cmp = Platform.openNbtData( Output );
|
||||
cmp.setLong( "freq", ( new Date() ).getTime() * 100 + ( randTickSeed ) % 100 );
|
||||
randTickSeed++;
|
||||
item.stackSize--;
|
||||
for ( ItemStack singularityStack : materials.qESingularity().maybeStack( 2 ).asSet() )
|
||||
{
|
||||
NBTTagCompound cmp = Platform.openNbtData( singularityStack );
|
||||
cmp.setLong( "freq", ( new Date() ).getTime() * 100 + ( randTickSeed ) % 100 );
|
||||
randTickSeed++;
|
||||
item.stackSize--;
|
||||
|
||||
this.worldObj.spawnEntityInWorld( new EntitySingularity( this.worldObj, this.posX, this.posY, this.posZ, Output ) );
|
||||
final EntitySingularity entity = new EntitySingularity( this.worldObj, this.posX, this.posY, this.posZ, singularityStack );
|
||||
this.worldObj.spawnEntityInWorld( entity );
|
||||
}
|
||||
}
|
||||
|
||||
if ( item.stackSize <= 0 )
|
||||
|
||||
Reference in New Issue
Block a user