Removed old rendering system
Removed old rendering system. Some parts may be left over, but they won't affect testing. 1.10-R todo tag marks things to do with rendering.
This commit is contained in:
@@ -32,7 +32,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.api.util.IAESprite;
|
||||
import appeng.client.ClientHelper;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.FeatureNameExtractor;
|
||||
@@ -108,24 +107,7 @@ public abstract class AEBaseItem extends Item implements IAEFeature
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
protected IAESprite myIcon = null;
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void registerIcons( final ClientHelper proxy, final String name )
|
||||
{
|
||||
proxy.setIcon( this, 0, name );
|
||||
}
|
||||
|
||||
public IAESprite getIcon( final ItemStack is )
|
||||
{
|
||||
return this.myIcon;
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void registerCustomIcon( final TextureMap map )
|
||||
{
|
||||
|
||||
}
|
||||
public void registerCustomIcon( final TextureMap map ){}
|
||||
|
||||
protected void getCheckedSubItems( final Item sameItem, final CreativeTabs creativeTab, final List<ItemStack> itemStacks )
|
||||
{
|
||||
|
||||
@@ -141,19 +141,6 @@ public final class MultiItem extends AEBaseItem implements IStorageComponent, IU
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void registerIcons( final ClientHelper proxy, final String name )
|
||||
{
|
||||
for( final MaterialType type : MaterialType.values() )
|
||||
{
|
||||
if( type != MaterialType.InvalidType )
|
||||
{
|
||||
proxy.setIcon( this, type.getDamageValue(), name + "." + type.name() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public MaterialType getTypeByStack( final ItemStack is )
|
||||
{
|
||||
if( this.dmgToMaterial.containsKey( is.getItemDamage() ) )
|
||||
|
||||
@@ -66,10 +66,6 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
public static final int FLUIX = SINGLE_OFFSET * 2;
|
||||
public static final int FINAL_STAGE = SINGLE_OFFSET * 3;
|
||||
|
||||
private final ModelResourceLocation[] certus = new ModelResourceLocation[3];
|
||||
private final ModelResourceLocation[] fluix = new ModelResourceLocation[3];
|
||||
private final ModelResourceLocation[] nether = new ModelResourceLocation[3];
|
||||
|
||||
public ItemCrystalSeed()
|
||||
{
|
||||
this.setHasSubtypes( true );
|
||||
@@ -78,70 +74,6 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
|
||||
EntityRegistry.registerModEntity( EntityGrowingCrystal.class, EntityGrowingCrystal.class.getSimpleName(), EntityIds.get( EntityGrowingCrystal.class ), AppEng.instance(), 16, 4, true );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void registerIcons( final ClientHelper ir, final String name )
|
||||
{
|
||||
final String preFix = name + ".";
|
||||
|
||||
this.certus[0] = ir.setIcon( this, preFix + "Certus" );
|
||||
this.certus[1] = ir.setIcon( this, preFix + "Certus2" );
|
||||
this.certus[2] = ir.setIcon( this, preFix + "Certus3" );
|
||||
|
||||
this.nether[0] = ir.setIcon( this, preFix + "Nether" );
|
||||
this.nether[1] = ir.setIcon( this, preFix + "Nether2" );
|
||||
this.nether[2] = ir.setIcon( this, preFix + "Nether3" );
|
||||
|
||||
this.fluix[0] = ir.setIcon( this, preFix + "Fluix" );
|
||||
this.fluix[1] = ir.setIcon( this, preFix + "Fluix2" );
|
||||
this.fluix[2] = ir.setIcon( this, preFix + "Fluix3" );
|
||||
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( this, new ItemMeshDefinition(){
|
||||
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation( final ItemStack stack )
|
||||
{
|
||||
ModelResourceLocation[] list = null;
|
||||
|
||||
int damage = ItemCrystalSeed.this.getProgress( stack );
|
||||
|
||||
if( damage < CERTUS + SINGLE_OFFSET )
|
||||
{
|
||||
list = ItemCrystalSeed.this.certus;
|
||||
}
|
||||
else if( damage < NETHER + SINGLE_OFFSET )
|
||||
{
|
||||
damage -= NETHER;
|
||||
list = ItemCrystalSeed.this.nether;
|
||||
}
|
||||
|
||||
else if( damage < FLUIX + SINGLE_OFFSET )
|
||||
{
|
||||
damage -= FLUIX;
|
||||
list = ItemCrystalSeed.this.fluix;
|
||||
}
|
||||
|
||||
if( list == null )
|
||||
{
|
||||
return new ModelResourceLocation( "diamond" );
|
||||
}
|
||||
|
||||
if( damage < LEVEL_OFFSET )
|
||||
{
|
||||
return list[0];
|
||||
}
|
||||
else if( damage < LEVEL_OFFSET * 2 )
|
||||
{
|
||||
return list[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
return list[2];
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static ResolverResult getResolver( final int certus2 )
|
||||
{
|
||||
|
||||
@@ -58,51 +58,12 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
|
||||
// rather simple client side caching.
|
||||
private static final Map<ItemStack, ItemStack> SIMPLE_CACHE = new WeakHashMap<ItemStack, ItemStack>();
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
private ModelResourceLocation res;
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
private ModelResourceLocation encodedPatternModel; // TODO: make encoded pattern model!
|
||||
|
||||
public ItemEncodedPattern()
|
||||
{
|
||||
this.setFeature( EnumSet.of( AEFeature.Patterns ) );
|
||||
this.setMaxStackSize( 1 );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons( final ClientHelper proxy, final String name )
|
||||
{
|
||||
this.encodedPatternModel = this.res = proxy.setIcon( this, name );
|
||||
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( this, new ItemMeshDefinition(){
|
||||
|
||||
boolean recursive = false;
|
||||
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation( final ItemStack stack )
|
||||
{
|
||||
if( this.recursive == false )
|
||||
{
|
||||
this.recursive = true;
|
||||
|
||||
final ItemEncodedPattern iep = (ItemEncodedPattern) stack.getItem();
|
||||
|
||||
final ItemStack is = iep.getOutput( stack );
|
||||
if( Minecraft.getMinecraft().thePlayer.isSneaking() )
|
||||
{
|
||||
return ItemEncodedPattern.this.encodedPatternModel;
|
||||
}
|
||||
|
||||
this.recursive = false;
|
||||
}
|
||||
|
||||
return ItemEncodedPattern.this.res;
|
||||
}
|
||||
} );
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick( final ItemStack stack, final World w, final EntityPlayer player, final EnumHand hand )
|
||||
{
|
||||
|
||||
@@ -55,28 +55,6 @@ public class ItemPaintBall extends AEBaseItem
|
||||
this.setHasSubtypes( true );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void registerIcons( final ClientHelper ir, final String name )
|
||||
{
|
||||
final ModelResourceLocation sloc = ir.setIcon( this, name + "Shimmer" );
|
||||
final ModelResourceLocation loc = ir.setIcon( this, name );
|
||||
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( this, new ItemMeshDefinition(){
|
||||
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation( final ItemStack stack )
|
||||
{
|
||||
if( ItemPaintBall.this.isLumen( stack ) )
|
||||
{
|
||||
return sloc;
|
||||
}
|
||||
|
||||
return loc;
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName( final ItemStack is )
|
||||
{
|
||||
|
||||
@@ -26,7 +26,6 @@ import java.util.List;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockGlass;
|
||||
import net.minecraft.block.BlockStainedGlass;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -47,8 +46,6 @@ import appeng.api.AEApi;
|
||||
import appeng.api.exceptions.MissingDefinition;
|
||||
import appeng.api.parts.IAlphaPassItem;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.client.texture.BaseIcon;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.FacadeConfig;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.decorative.solid.QuartzOreBlock;
|
||||
@@ -290,10 +287,4 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCustomIcon( final TextureMap map )
|
||||
{
|
||||
this.myIcon = new BaseIcon( map.registerSprite( new ResourceLocation( AppEng.MOD_ID, "blocks/ItemFacade" ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -43,11 +42,8 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.implementations.items.IItemGroup;
|
||||
@@ -55,11 +51,7 @@ import appeng.api.parts.IPart;
|
||||
import appeng.api.parts.IPartHelper;
|
||||
import appeng.api.parts.IPartItem;
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.api.util.IAESprite;
|
||||
import appeng.client.texture.BaseIcon;
|
||||
import appeng.client.texture.MissingIcon;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.core.AppEng;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.ActivityState;
|
||||
import appeng.core.features.ItemStackSrc;
|
||||
@@ -84,7 +76,6 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
this.registered = new HashMap<Integer, PartTypeWithVariant>( INITIAL_REGISTERED_CAPACITY );
|
||||
|
||||
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
partHelper.setItemBusRenderer( this );
|
||||
this.setHasSubtypes( true );
|
||||
|
||||
instance = this;
|
||||
@@ -195,29 +186,6 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
return "item.appliedenergistics2." + this.getName( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void registerCustomIcon( final TextureMap map )
|
||||
{
|
||||
for( final Entry<Integer, PartTypeWithVariant> part : this.registered.entrySet() )
|
||||
{
|
||||
part.getValue().texture = new BaseIcon( map.registerSprite( new ResourceLocation( AppEng.MOD_ID, "blocks/" + this.getName( new ItemStack( this, 1, part.getKey() ) ) ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAESprite getIcon( final ItemStack is )
|
||||
{
|
||||
final int dmg = is.getMetadata();
|
||||
final PartTypeWithVariant registeredType = this.registered.get( dmg );
|
||||
if( registeredType != null )
|
||||
{
|
||||
return registeredType.texture;
|
||||
}
|
||||
|
||||
return new MissingIcon( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName( final ItemStack is )
|
||||
{
|
||||
@@ -377,9 +345,6 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
||||
private final PartType part;
|
||||
private final int variant;
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
public IAESprite texture = null;
|
||||
|
||||
private PartTypeWithVariant( final PartType part, final int variant )
|
||||
{
|
||||
assert part != null;
|
||||
|
||||
Reference in New Issue
Block a user