Added skystone, skystone block, skystone brick, skystone small brick, certus quartz, certus quartz pillar, chiseled certus quartz and fluix stars
To integrate these into the current system, some changes to the background had to be done, especially to the feature handler. It now uses an interface to work against which you can implement to get your own feature handler instead modifying the base one and add several special cases code
This commit is contained in:
@@ -22,54 +22,47 @@ package appeng.items;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.AEFeatureHandler;
|
||||
import appeng.core.features.FeatureNameExtractor;
|
||||
import appeng.core.features.IAEFeature;
|
||||
import appeng.core.features.IFeatureHandler;
|
||||
import appeng.core.features.ItemFeatureHandler;
|
||||
|
||||
|
||||
public class AEBaseItem extends Item implements IAEFeature
|
||||
{
|
||||
final String featureFullName;
|
||||
final String featureSubName;
|
||||
AEFeatureHandler feature;
|
||||
private final String fullName;
|
||||
private final Optional<String> subName;
|
||||
private IFeatureHandler feature;
|
||||
|
||||
public AEBaseItem( Class c )
|
||||
{
|
||||
this( c, Optional.<String> absent() );
|
||||
canRepair = false;
|
||||
}
|
||||
|
||||
public AEBaseItem( Class<?> c, Optional<String> subName )
|
||||
{
|
||||
this.subName = subName;
|
||||
this.fullName = new FeatureNameExtractor( c, subName ).get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return featureFullName;
|
||||
return this.fullName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AEFeatureHandler feature()
|
||||
public IFeatureHandler handler()
|
||||
{
|
||||
return feature;
|
||||
}
|
||||
|
||||
public void setFeature( EnumSet<AEFeature> f )
|
||||
{
|
||||
feature = new AEFeatureHandler( f, this, featureSubName );
|
||||
}
|
||||
|
||||
public AEBaseItem( Class c )
|
||||
{
|
||||
this( c, null );
|
||||
canRepair = false;
|
||||
}
|
||||
|
||||
public AEBaseItem( Class c, String subName )
|
||||
{
|
||||
featureSubName = subName;
|
||||
featureFullName = AEFeatureHandler.getName( c, subName );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable( ItemStack itemstack1, ItemStack itemstack2 )
|
||||
{
|
||||
return false;
|
||||
return this.feature;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -78,6 +71,11 @@ public class AEBaseItem extends Item implements IAEFeature
|
||||
// override!
|
||||
}
|
||||
|
||||
public void setFeature( EnumSet<AEFeature> f )
|
||||
{
|
||||
this.feature = new ItemFeatureHandler( f, this, this, this.subName );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings( "unchecked" )
|
||||
public final void addInformation( ItemStack stack, EntityPlayer player, List lines, boolean displayAdditionalInformation )
|
||||
@@ -85,6 +83,12 @@ public class AEBaseItem extends Item implements IAEFeature
|
||||
this.addCheckedInformation( stack, player, lines, displayAdditionalInformation );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable( ItemStack itemstack1, ItemStack itemstack2 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public void addCheckedInformation( ItemStack stack, EntityPlayer player, List<String> lines, boolean displayAdditionalInformation )
|
||||
{
|
||||
super.addInformation( stack, player, lines, displayAdditionalInformation );
|
||||
|
||||
Reference in New Issue
Block a user