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
@@ -24,7 +24,6 @@ import java.util.Random;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -49,27 +48,20 @@ public final class BlockChargedQuartzOre extends BlockQuartzOre
|
||||
@Override
|
||||
public Item getItemDropped( final IBlockState state, final Random rand, final int fortune )
|
||||
{
|
||||
for( final Item charged : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeItem().asSet() )
|
||||
{
|
||||
return charged;
|
||||
}
|
||||
|
||||
throw new MissingDefinition( "Tried to access charged certus quartz crystal, even though they are disabled" );
|
||||
return AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeItem()
|
||||
.orElseThrow( () -> new MissingDefinition( "Tried to access charged certus quartz crystal, even though they are disabled" ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped( final IBlockState state )
|
||||
{
|
||||
for( final ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
return crystalStack.getItemDamage();
|
||||
}
|
||||
|
||||
throw new MissingDefinition( "Tried to access charged certus quartz crystal, even though they are disabled" );
|
||||
return AEApi.instance().definitions().materials().certusQuartzCrystalCharged().maybeStack( 1 )
|
||||
.orElseThrow( () -> new MissingDefinition( "Tried to access charged certus quartz crystal, even though they are disabled" ) )
|
||||
.getItemDamage();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT)
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void randomDisplayTick( final IBlockState state, final World w, final BlockPos pos, final Random r )
|
||||
{
|
||||
if( !AEConfig.instance.enableEffects )
|
||||
|
||||
@@ -24,7 +24,6 @@ import java.util.Random;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
@@ -94,12 +93,8 @@ public class BlockQuartzOre extends AEBaseBlock
|
||||
public Item getItemDropped( final IBlockState state, /* is null */
|
||||
final Random rand, final int fortune )
|
||||
{
|
||||
for( final Item crystalItem : AEApi.instance().definitions().materials().certusQuartzCrystal().maybeItem().asSet() )
|
||||
{
|
||||
return crystalItem;
|
||||
}
|
||||
|
||||
throw new MissingDefinition( "Tried to access certus quartz crystal, even though they are disabled" );
|
||||
return AEApi.instance().definitions().materials().certusQuartzCrystal().maybeItem()
|
||||
.orElseThrow( () -> new MissingDefinition( "Tried to access certus quartz crystal, even though they are disabled" ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -118,12 +113,9 @@ public class BlockQuartzOre extends AEBaseBlock
|
||||
@Override
|
||||
public int damageDropped( final IBlockState state )
|
||||
{
|
||||
for( final ItemStack crystalStack : AEApi.instance().definitions().materials().certusQuartzCrystal().maybeStack( 1 ).asSet() )
|
||||
{
|
||||
return crystalStack.getItemDamage();
|
||||
}
|
||||
|
||||
throw new MissingDefinition( "Tried to access certus quartz crystal, even though they are disabled" );
|
||||
return AEApi.instance().definitions().materials().certusQuartzCrystal().maybeStack( 1 )
|
||||
.orElseThrow( () -> new MissingDefinition( "Tried to access certus quartz crystal, even though they are disabled" ) )
|
||||
.getItemDamage();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user