Replaced all instances of Guava's Optional type with Java 8's Optional type, as discussed in #81. (#90)
This commit is contained in:
committed by
Sebastian Hartte
parent
c2a239a12f
commit
e276aa682f
@@ -153,12 +153,12 @@ public final class EntityChargedQuartz extends AEBaseEntityItem
|
||||
netherQuartz.setDead();
|
||||
}
|
||||
|
||||
for( final ItemStack fluixCrystalStack : materials.fluixCrystal().maybeStack( 2 ).asSet() )
|
||||
materials.fluixCrystal().maybeStack( 2 ).ifPresent( is ->
|
||||
{
|
||||
final EntityItem entity = new EntityItem( this.worldObj, this.posX, this.posY, this.posZ, fluixCrystalStack );
|
||||
final EntityItem entity = new EntityItem( this.worldObj, this.posX, this.posY, this.posZ, is );
|
||||
|
||||
this.worldObj.spawnEntityInWorld( entity );
|
||||
}
|
||||
} );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public final class EntitySingularity extends AEBaseEntityItem
|
||||
e.setDead();
|
||||
}
|
||||
|
||||
for( final ItemStack singularityStack : materials.qESingularity().maybeStack( 2 ).asSet() )
|
||||
materials.qESingularity().maybeStack( 2 ).ifPresent( singularityStack ->
|
||||
{
|
||||
final NBTTagCompound cmp = Platform.openNbtData( singularityStack );
|
||||
cmp.setLong( "freq", ( new Date() ).getTime() * 100 + ( randTickSeed ) % 100 );
|
||||
@@ -137,7 +137,7 @@ public final class EntitySingularity extends AEBaseEntityItem
|
||||
|
||||
final EntitySingularity entity = new EntitySingularity( this.worldObj, this.posX, this.posY, this.posZ, singularityStack );
|
||||
this.worldObj.spawnEntityInWorld( entity );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
if( item.stackSize <= 0 )
|
||||
|
||||
@@ -29,7 +29,6 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.item.EntityTNTPrimed;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
@@ -90,7 +89,7 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
|
||||
|
||||
if( this.isInWater() && Platform.isServer() ) // put out the fuse.
|
||||
{
|
||||
for( final ItemStack tntStack : AEApi.instance().definitions().blocks().tinyTNT().maybeStack( 1 ).asSet() )
|
||||
AEApi.instance().definitions().blocks().tinyTNT().maybeStack( 1 ).ifPresent( tntStack ->
|
||||
{
|
||||
final EntityItem item = new EntityItem( this.worldObj, this.posX, this.posY, this.posZ, tntStack );
|
||||
|
||||
@@ -103,7 +102,7 @@ public final class EntityTinyTNTPrimed extends EntityTNTPrimed implements IEntit
|
||||
|
||||
this.worldObj.spawnEntityInWorld( item );
|
||||
this.setDead();
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
if( this.getFuse() <= 0 )
|
||||
|
||||
Reference in New Issue
Block a user