Merge pull request #1176 from yueh/fix-1174

Added missing Block.damageDropped() to OreQuartzCharged
This commit is contained in:
yueh 2015-04-03 11:40:17 +02:00
commit dc6a325392
2 changed files with 57 additions and 37 deletions

View file

@ -18,6 +18,7 @@
package appeng.block.solids;
import java.util.EnumSet;
import java.util.Random;
@ -38,13 +39,15 @@ import appeng.client.render.BaseBlockRender;
import appeng.client.render.blocks.RenderQuartzOre;
import appeng.core.features.AEFeature;
public class OreQuartz extends AEBaseBlock
{
private int boostBrightnessLow;
private int boostBrightnessHigh;
private boolean enhanceBrightness;
public OreQuartz(Class<? extends OreQuartz> self) {
public OreQuartz( Class<? extends OreQuartz> self )
{
super( self, Material.rock );
this.setFeature( EnumSet.of( AEFeature.Core ) );
this.setHardness( 3.0F );
@ -90,7 +93,8 @@ public class OreQuartz extends AEBaseBlock
return j1;
}
public OreQuartz() {
public OreQuartz()
{
this( OreQuartz.class );
}

View file

@ -18,11 +18,14 @@
package appeng.block.solids;
import java.util.Random;
import javax.annotation.Nullable;
import net.minecraft.client.Minecraft;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
@ -34,10 +37,12 @@ import appeng.client.render.effects.ChargedOreFX;
import appeng.core.AEConfig;
import appeng.core.CommonHelper;
public class OreQuartzCharged extends OreQuartz
{
public OreQuartzCharged() {
public OreQuartzCharged()
{
super( OreQuartzCharged.class );
this.setBoostBrightnessLow( 2 );
this.setBoostBrightnessHigh( 5 );
@ -55,6 +60,17 @@ public class OreQuartzCharged extends OreQuartz
throw new MissingDefinition( "Tried to access charged certus quartz crystal, even though they are disabled" );
}
@Override
public int damageDropped( int id )
{
for ( 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" );
}
@Override
@SideOnly( Side.CLIENT )
public void randomDisplayTick( World w, int x, int y, int z, Random r )