Removed old renamer
This commit is contained in:
parent
0e378d8ad4
commit
4e863e7d90
|
@ -22,11 +22,10 @@ package appeng.block;
|
|||
import net.minecraft.block.material.Material;
|
||||
|
||||
|
||||
public class AEDecorativeBlock extends AEBaseBlock
|
||||
public abstract class AEDecorativeBlock extends AEBaseBlock
|
||||
{
|
||||
public AEDecorativeBlock( Material mat )
|
||||
{
|
||||
super( mat );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,15 +22,17 @@ package appeng.block.solids;
|
|||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import appeng.block.AEDecorativeBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
|
||||
public class BlockFluix extends AEDecorativeBlock
|
||||
public final class BlockFluix extends AEDecorativeBlock
|
||||
{
|
||||
public BlockFluix()
|
||||
{
|
||||
super( Material.rock );
|
||||
|
||||
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,16 +22,17 @@ package appeng.block.solids;
|
|||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import appeng.block.AEDecorativeBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
|
||||
public class BlockQuartz extends AEDecorativeBlock
|
||||
public final class BlockQuartz extends AEDecorativeBlock
|
||||
{
|
||||
|
||||
public BlockQuartz()
|
||||
{
|
||||
super( Material.rock );
|
||||
|
||||
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,16 +22,17 @@ package appeng.block.solids;
|
|||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import appeng.block.AEDecorativeBlock;
|
||||
import appeng.core.features.AEFeature;
|
||||
|
||||
|
||||
public class BlockQuartzChiseled extends AEDecorativeBlock
|
||||
public final class BlockQuartzChiseled extends AEDecorativeBlock
|
||||
{
|
||||
|
||||
public BlockQuartzChiseled()
|
||||
{
|
||||
super( Material.rock );
|
||||
|
||||
this.setFeature( EnumSet.of( AEFeature.DecorativeQuartzBlocks ) );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,8 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
|
@ -55,8 +57,6 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
|||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry.UniqueIdentifier;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import appeng.api.parts.CableRenderMode;
|
||||
import appeng.api.parts.IPartItem;
|
||||
import appeng.api.util.AEColor;
|
||||
|
@ -101,104 +101,34 @@ public class ClientHelper extends ServerHelper
|
|||
|
||||
private static final RenderItem ITEM_RENDERER = Minecraft.getMinecraft().getRenderItem();
|
||||
private static final ModelGenerator BLOCK_RENDERER = new ModelGenerator();
|
||||
final ModelResourceLocation partRenderer = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, "DynamicPartRenderer" ), "inventory" );
|
||||
|
||||
private static class IconReg
|
||||
{
|
||||
public IconReg(
|
||||
Object item2,
|
||||
int meta2,
|
||||
String name2 )
|
||||
{
|
||||
meta = meta2;
|
||||
name = name2;
|
||||
item = item2;
|
||||
loc = null;
|
||||
}
|
||||
|
||||
public IconReg(
|
||||
Item item2,
|
||||
int meta2,
|
||||
String name2,
|
||||
ModelResourceLocation res )
|
||||
{
|
||||
meta = meta2;
|
||||
name = name2;
|
||||
item = item2;
|
||||
loc = res;
|
||||
}
|
||||
|
||||
public final String name;
|
||||
public final Object item;
|
||||
public final int meta;
|
||||
public final ModelResourceLocation loc;
|
||||
};
|
||||
|
||||
public Map<Object,List<IconReg>> iconRegistrations = new HashMap();
|
||||
;
|
||||
public Map<Object, List<IconReg>> iconRegistrations = new HashMap();
|
||||
public List<IconReg> iconTmp = new ArrayList<>();
|
||||
public List<ResourceLocation> extraIcons = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public ResourceLocation addIcon( String string )
|
||||
{
|
||||
ModelResourceLocation n = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, string ), "inventory" );
|
||||
extraIcons.add( n );
|
||||
return n;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureIcon(Object item, String name )
|
||||
public void configureIcon( Object item, String name )
|
||||
{
|
||||
iconTmp.add( new IconReg( item, 0, name ) );
|
||||
}
|
||||
|
||||
public ModelResourceLocation setIcon(
|
||||
Item item,
|
||||
String name )
|
||||
{
|
||||
List<IconReg> reg = iconRegistrations.get( item );
|
||||
if ( reg == null)
|
||||
iconRegistrations.put( item , reg = new LinkedList<IconReg>() );
|
||||
|
||||
ModelResourceLocation res = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, name ), "inventory" );
|
||||
reg.add( new IconReg(item,-1,name,res) );
|
||||
return res;
|
||||
}
|
||||
|
||||
public ModelResourceLocation setIcon(
|
||||
Item item,
|
||||
int meta,
|
||||
String name )
|
||||
{
|
||||
List<IconReg> reg = iconRegistrations.get( item );
|
||||
if ( reg == null)
|
||||
iconRegistrations.put( item , reg = new LinkedList<IconReg>() );
|
||||
|
||||
ModelResourceLocation res = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, name ), "inventory" );
|
||||
reg.add( new IconReg(item,meta,name,res) );
|
||||
return res;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void postPlayerRender( RenderLivingEvent.Pre p )
|
||||
{
|
||||
PlayerColor player = TickHandler.INSTANCE.getPlayerColors().get( p.entity.getEntityId() );
|
||||
if( player != null )
|
||||
{
|
||||
AEColor col = player.myColor;
|
||||
|
||||
float r = 0xff & ( col.mediumVariant >> 16 );
|
||||
float g = 0xff & ( col.mediumVariant >> 8 );
|
||||
float b = 0xff & ( col.mediumVariant );
|
||||
GL11.glColor3f( r / 255.0f, g / 255.0f, b / 255.0f );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preinit()
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.register( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init()
|
||||
{
|
||||
Item fluixItem = GameRegistry.findItem( "appliedenergistics2", "BlockFluix" );
|
||||
ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation( "appliedenergistics2:BlockFluix", "inventory" );
|
||||
final int DEFAULT_ITEM_SUBTYPE = 0;
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( fluixItem, DEFAULT_ITEM_SUBTYPE, itemModelResourceLocation );
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld()
|
||||
{
|
||||
|
@ -267,6 +197,230 @@ public class ClientHelper extends ServerHelper
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldAddParticles( Random r )
|
||||
{
|
||||
int setting = Minecraft.getMinecraft().gameSettings.particleSetting;
|
||||
if( setting == 2 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if( setting == 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return r.nextInt( 2 * ( setting + 1 ) ) == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MovingObjectPosition getMOP()
|
||||
{
|
||||
return Minecraft.getMinecraft().objectMouseOver;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRenderItem( ItemStack itemstack, World w )
|
||||
{
|
||||
if( itemstack != null )
|
||||
{
|
||||
EntityItem entityitem = new EntityItem( w, 0.0D, 0.0D, 0.0D, itemstack );
|
||||
entityitem.getEntityItem().stackSize = 1;
|
||||
|
||||
// set all this stuff and then do shit? meh?
|
||||
entityitem.hoverStart = 0;
|
||||
entityitem.setNoDespawn();
|
||||
entityitem.rotationYaw = 0;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef( 0, -0.04F, 0 );
|
||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
// GL11.glDisable( GL11.GL_CULL_FACE );
|
||||
|
||||
// TODO RENDER ITEM FOR STORAGE MONITOR!
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit()
|
||||
{
|
||||
//RenderingRegistry.registerBlockHandler( WorldRender.INSTANCE );
|
||||
RenderManager inst = Minecraft.getMinecraft().getRenderManager();
|
||||
|
||||
inst.entityRenderMap.put( EntityTinyTNTPrimed.class, new RenderTinyTNTPrimed( inst ) );
|
||||
inst.entityRenderMap.put( EntityFloatingItem.class, new RenderFloatingItem( inst ) );
|
||||
|
||||
String MODID = AppEng.MOD_ID + ":";
|
||||
|
||||
final ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher();
|
||||
ItemMeshDefinition imd = new ItemMeshDefinition()
|
||||
{
|
||||
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation( ItemStack stack )
|
||||
{
|
||||
return partRenderer;
|
||||
}
|
||||
};
|
||||
|
||||
for( IconReg reg : iconTmp )
|
||||
{
|
||||
if( reg.item instanceof IPartItem || reg.item instanceof IFacadeItem )
|
||||
{
|
||||
mesher.register( reg.item instanceof Item ? (Item) reg.item : Item.getItemFromBlock( (Block) reg.item ), imd );
|
||||
continue;
|
||||
}
|
||||
|
||||
if( reg.item instanceof AEBaseBlock )
|
||||
{
|
||||
final BlockRenderInfo renderer = ( (AEBaseBlock) reg.item ).getRendererInstance();
|
||||
if( renderer == null )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
addIcon( reg.name );
|
||||
|
||||
mesher.register( reg.item instanceof Item ? (Item) reg.item : Item.getItemFromBlock( (Block) reg.item ), new ItemMeshDefinition()
|
||||
{
|
||||
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation( ItemStack stack )
|
||||
{
|
||||
return renderer.rendererInstance.getResourcePath();
|
||||
}
|
||||
} );
|
||||
continue;
|
||||
}
|
||||
|
||||
if( reg.name == null )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if( reg.item instanceof AEBaseItem )
|
||||
{
|
||||
( (AEBaseItem) reg.item ).registerIcons( this, reg.name );
|
||||
}
|
||||
else if( reg.item instanceof Item )
|
||||
{
|
||||
this.setIcon( (Item) reg.item, 0, reg.name );
|
||||
}
|
||||
}
|
||||
|
||||
for( List<IconReg> reg : iconRegistrations.values() )
|
||||
{
|
||||
String[] names = new String[reg.size()];
|
||||
|
||||
Item it = null;
|
||||
|
||||
int offset = 0;
|
||||
for( IconReg r : reg )
|
||||
{
|
||||
it = (Item) r.item;
|
||||
|
||||
if( r.meta >= 0 )
|
||||
{
|
||||
mesher.register( (Item) r.item, r.meta, r.loc );
|
||||
}
|
||||
|
||||
names[offset++] = MODID + r.name;
|
||||
}
|
||||
|
||||
ModelBakery.addVariantName( it, names );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CableRenderMode getRenderMode()
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
return super.getRenderMode();
|
||||
}
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
|
||||
return this.renderModeForPlayer( player );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void triggerUpdates()
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if( mc == null || mc.thePlayer == null || mc.theWorld == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
|
||||
int x = (int) player.posX;
|
||||
int y = (int) player.posY;
|
||||
int z = (int) player.posZ;
|
||||
|
||||
int range = 16 * 16;
|
||||
|
||||
mc.theWorld.markBlockRangeForRenderUpdate( x - range, y - range, z - range, x + range, y + range, z + range );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void missingCoreMod()
|
||||
{
|
||||
throw new MissingCoreMod();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation addIcon( String string )
|
||||
{
|
||||
ModelResourceLocation n = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, string ), "inventory" );
|
||||
extraIcons.add( n );
|
||||
return n;
|
||||
}
|
||||
|
||||
public ModelResourceLocation setIcon( Item item, String name )
|
||||
{
|
||||
List<IconReg> reg = iconRegistrations.get( item );
|
||||
if( reg == null )
|
||||
{
|
||||
iconRegistrations.put( item, reg = new LinkedList<IconReg>() );
|
||||
}
|
||||
|
||||
ModelResourceLocation res = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, name ), "inventory" );
|
||||
reg.add( new IconReg( item, -1, name, res ) );
|
||||
return res;
|
||||
}
|
||||
|
||||
public ModelResourceLocation setIcon( Item item, int meta, String name )
|
||||
{
|
||||
List<IconReg> reg = iconRegistrations.get( item );
|
||||
if( reg == null )
|
||||
{
|
||||
iconRegistrations.put( item, reg = new LinkedList<IconReg>() );
|
||||
}
|
||||
|
||||
ModelResourceLocation res = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, name ), "inventory" );
|
||||
reg.add( new IconReg( item, meta, name, res ) );
|
||||
return res;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void postPlayerRender( RenderLivingEvent.Pre p )
|
||||
{
|
||||
PlayerColor player = TickHandler.INSTANCE.getPlayerColors().get( p.entity.getEntityId() );
|
||||
if( player != null )
|
||||
{
|
||||
AEColor col = player.myColor;
|
||||
|
||||
float r = 0xff & ( col.mediumVariant >> 16 );
|
||||
float g = 0xff & ( col.mediumVariant >> 8 );
|
||||
float b = 0xff & ( col.mediumVariant );
|
||||
GL11.glColor3f( r / 255.0f, g / 255.0f, b / 255.0f );
|
||||
}
|
||||
}
|
||||
|
||||
private void spawnAssembler( World worldObj, double posX, double posY, double posZ, Object o )
|
||||
{
|
||||
PacketAssemblerAnimation paa = (PacketAssemblerAnimation) o;
|
||||
|
@ -330,207 +484,42 @@ public class ClientHelper extends ServerHelper
|
|||
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldAddParticles( Random r )
|
||||
@SubscribeEvent
|
||||
public void onModelBakeEvent( ModelBakeEvent event )
|
||||
{
|
||||
int setting = Minecraft.getMinecraft().gameSettings.particleSetting;
|
||||
if( setting == 2 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if( setting == 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return r.nextInt( 2 * ( setting + 1 ) ) == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MovingObjectPosition getMOP()
|
||||
{
|
||||
return Minecraft.getMinecraft().objectMouseOver;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRenderItem( ItemStack itemstack, World w )
|
||||
{
|
||||
if( itemstack != null )
|
||||
{
|
||||
EntityItem entityitem = new EntityItem( w, 0.0D, 0.0D, 0.0D, itemstack );
|
||||
entityitem.getEntityItem().stackSize = 1;
|
||||
|
||||
// set all this stuff and then do shit? meh?
|
||||
entityitem.hoverStart = 0;
|
||||
entityitem.setNoDespawn();
|
||||
entityitem.rotationYaw = 0;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef( 0, -0.04F, 0 );
|
||||
GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
|
||||
// GL11.glDisable( GL11.GL_CULL_FACE );
|
||||
|
||||
// TODO RENDER ITEM FOR STORAGE MONITOR!
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
final ModelResourceLocation partRenderer = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, "DynamicPartRenderer" ), "inventory" );
|
||||
|
||||
@Override
|
||||
public void postInit()
|
||||
{
|
||||
//RenderingRegistry.registerBlockHandler( WorldRender.INSTANCE );
|
||||
RenderManager inst = Minecraft.getMinecraft().getRenderManager();
|
||||
|
||||
inst.entityRenderMap.put( EntityTinyTNTPrimed.class, new RenderTinyTNTPrimed(inst) );
|
||||
inst.entityRenderMap.put( EntityFloatingItem.class, new RenderFloatingItem(inst) );
|
||||
|
||||
String MODID = AppEng.MOD_ID+":";
|
||||
|
||||
final ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher();
|
||||
ItemMeshDefinition imd = new ItemMeshDefinition(){
|
||||
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(
|
||||
ItemStack stack )
|
||||
{
|
||||
return partRenderer;
|
||||
}
|
||||
};
|
||||
|
||||
for ( IconReg reg: iconTmp )
|
||||
{
|
||||
if ( reg.item instanceof IPartItem || reg.item instanceof IFacadeItem )
|
||||
{
|
||||
mesher.register( reg.item instanceof Item ? (Item)reg.item : Item.getItemFromBlock( (Block)reg.item ), imd );
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( reg.item instanceof AEBaseBlock )
|
||||
{
|
||||
final BlockRenderInfo renderer = ((AEBaseBlock)reg.item).getRendererInstance();
|
||||
if ( renderer == null )
|
||||
continue;
|
||||
|
||||
addIcon( reg.name );
|
||||
|
||||
mesher.register( reg.item instanceof Item ? (Item)reg.item : Item.getItemFromBlock( (Block)reg.item ), new ItemMeshDefinition(){
|
||||
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(
|
||||
ItemStack stack )
|
||||
{
|
||||
return renderer.rendererInstance.getResourcePath();
|
||||
}
|
||||
} );
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( reg.name == null ) continue;
|
||||
|
||||
if ( reg.item instanceof AEBaseItem )
|
||||
( (AEBaseItem) reg.item).registerIcons( this, reg.name );
|
||||
else if ( reg.item instanceof Item )
|
||||
this.setIcon( (Item)reg.item, 0, reg.name );
|
||||
}
|
||||
|
||||
for ( List<IconReg> reg : iconRegistrations.values() )
|
||||
{
|
||||
String[] names = new String[reg.size()];
|
||||
|
||||
Item it = null;
|
||||
|
||||
int offset=0;
|
||||
for ( IconReg r : reg )
|
||||
{
|
||||
it = ( Item ) r.item;
|
||||
|
||||
if ( r.meta >= 0 )
|
||||
mesher.register( (Item)r.item, r.meta, r.loc );
|
||||
|
||||
names[offset++] = MODID + r.name;
|
||||
}
|
||||
|
||||
ModelBakery.addVariantName( it, names );
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onModelBakeEvent(
|
||||
ModelBakeEvent event )
|
||||
{
|
||||
// inventory renderer
|
||||
SmartModel buses = new SmartModel( new BlockRenderInfo( ( new RendererCableBus() ) ) );
|
||||
SmartModel buses = new SmartModel( new BlockRenderInfo( ( new RendererCableBus() ) ) );
|
||||
event.modelRegistry.putObject( partRenderer, buses );
|
||||
|
||||
for ( IconReg reg: iconTmp )
|
||||
for( IconReg reg : iconTmp )
|
||||
{
|
||||
if ( reg.item instanceof IPartItem || reg.item instanceof IFacadeItem)
|
||||
if( reg.item instanceof IPartItem || reg.item instanceof IFacadeItem )
|
||||
{
|
||||
UniqueIdentifier i = GameRegistry.findUniqueIdentifierFor( (Item)reg.item );
|
||||
event.modelRegistry.putObject( new ModelResourceLocation( new ResourceLocation(i.modId ,i.name),"inventory"), buses );
|
||||
UniqueIdentifier i = GameRegistry.findUniqueIdentifierFor( (Item) reg.item );
|
||||
event.modelRegistry.putObject( new ModelResourceLocation( new ResourceLocation( i.modId, i.name ), "inventory" ), buses );
|
||||
}
|
||||
|
||||
if ( reg.item instanceof AEBaseBlock )
|
||||
if( reg.item instanceof AEBaseBlock )
|
||||
{
|
||||
BlockRenderInfo renderer = ((AEBaseBlock)reg.item).getRendererInstance();
|
||||
if ( renderer == null )
|
||||
BlockRenderInfo renderer = ( (AEBaseBlock) reg.item ).getRendererInstance();
|
||||
if( renderer == null )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
SmartModel sm = new SmartModel( renderer );
|
||||
event.modelRegistry.putObject( renderer.rendererInstance.getResourcePath(), sm );
|
||||
event.modelRegistry.putObject( renderer.rendererInstance.getResourcePath(), sm );
|
||||
|
||||
Map data = new DefaultStateMapper().putStateModelLocations( (Block)reg.item );
|
||||
for ( Object Loc : data.values() )
|
||||
Map data = new DefaultStateMapper().putStateModelLocations( (Block) reg.item );
|
||||
for( Object Loc : data.values() )
|
||||
{
|
||||
ModelResourceLocation res = (ModelResourceLocation)Loc;
|
||||
ModelResourceLocation res = (ModelResourceLocation) Loc;
|
||||
event.modelRegistry.putObject( res, sm );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CableRenderMode getRenderMode()
|
||||
{
|
||||
if( Platform.isServer() )
|
||||
{
|
||||
return super.getRenderMode();
|
||||
}
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
|
||||
return this.renderModeForPlayer( player );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void triggerUpdates()
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if( mc == null || mc.thePlayer == null || mc.theWorld == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
|
||||
int x = (int) player.posX;
|
||||
int y = (int) player.posY;
|
||||
int z = (int) player.posZ;
|
||||
|
||||
int range = 16 * 16;
|
||||
|
||||
mc.theWorld.markBlockRangeForRenderUpdate( x - range, y - range, z - range, x + range, y + range, z + range );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void missingCoreMod()
|
||||
{
|
||||
throw new MissingCoreMod();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void wheelEvent( MouseEvent me )
|
||||
{
|
||||
|
@ -560,24 +549,28 @@ public class ClientHelper extends ServerHelper
|
|||
@SubscribeEvent
|
||||
public void updateTextureSheet( TextureStitchEvent.Pre ev )
|
||||
{
|
||||
for ( IconReg reg: iconTmp )
|
||||
for( IconReg reg : iconTmp )
|
||||
{
|
||||
if ( reg.item instanceof AEBaseItem )
|
||||
if( reg.item instanceof AEBaseItem )
|
||||
{
|
||||
((AEBaseItem)reg.item).registerCustomIcon( ev.map );
|
||||
( (AEBaseItem) reg.item ).registerCustomIcon( ev.map );
|
||||
}
|
||||
else if ( reg.item instanceof AEBaseBlock )
|
||||
else if( reg.item instanceof AEBaseBlock )
|
||||
{
|
||||
BlockRenderInfo renderer = ((AEBaseBlock)reg.item).getRendererInstance();
|
||||
if ( renderer == null )
|
||||
BlockRenderInfo renderer = ( (AEBaseBlock) reg.item ).getRendererInstance();
|
||||
if( renderer == null )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
( (AEBaseBlock) reg.item).registerBlockIcons( ev.map, reg.name );
|
||||
( (AEBaseBlock) reg.item ).registerBlockIcons( ev.map, reg.name );
|
||||
}
|
||||
}
|
||||
|
||||
for ( ResourceLocation res : extraIcons )
|
||||
for( ResourceLocation res : extraIcons )
|
||||
{
|
||||
ev.map.registerSprite( res );
|
||||
}
|
||||
|
||||
//if( ev.map.getTextureType() == ITEM_RENDERER )
|
||||
{
|
||||
|
@ -601,5 +594,27 @@ public class ClientHelper extends ServerHelper
|
|||
}
|
||||
}
|
||||
|
||||
private static class IconReg
|
||||
{
|
||||
public final String name;
|
||||
public final Object item;
|
||||
public final int meta;
|
||||
public final ModelResourceLocation loc;
|
||||
|
||||
public IconReg( Object item2, int meta2, String name2 )
|
||||
{
|
||||
meta = meta2;
|
||||
name = name2;
|
||||
item = item2;
|
||||
loc = null;
|
||||
}
|
||||
|
||||
public IconReg( Item item2, int meta2, String name2, ModelResourceLocation res )
|
||||
{
|
||||
meta = meta2;
|
||||
name = name2;
|
||||
item = item2;
|
||||
loc = res;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -74,17 +74,6 @@ public final class AppEng
|
|||
+ net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion
|
||||
+ net.minecraftforge.common.ForgeVersion.buildVersion + ",)"; // buildVersion
|
||||
|
||||
// public static final String nameCustomWall = "custom_wall";
|
||||
// public static final BlockWall blockCustomWall = new BlockWall( Blocks.cobblestone);
|
||||
// public static final ItemMultiTexture itemCustomWall = new ItemMultiTexture(blockCustomWall, blockCustomWall, new Function<ItemStack, String>()
|
||||
// {
|
||||
// @Override
|
||||
// public String apply(ItemStack stack)
|
||||
// {
|
||||
// return BlockWall.EnumType.byMetadata(stack.getMetadata()).getUnlocalizedName();
|
||||
// }
|
||||
// });
|
||||
|
||||
@Nonnull
|
||||
private static final AppEng INSTANCE = new AppEng();
|
||||
|
||||
|
@ -153,45 +142,9 @@ public final class AppEng
|
|||
this.startService( "AE2 VersionChecker", versionCheckerThread );
|
||||
}
|
||||
|
||||
// blockCustomWall.setUnlocalizedName(MODID + ".customWall");
|
||||
// GameRegistry.registerBlock( blockCustomWall, null, nameCustomWall );
|
||||
// GameRegistry.registerItem(itemCustomWall, nameCustomWall);
|
||||
// GameData.getBlockItemMap().put( blockCustomWall, itemCustomWall );
|
||||
//
|
||||
// if (event.getSide() == Side.CLIENT)
|
||||
// preInitClient(event);
|
||||
|
||||
AELog.info( "Pre Initialization ( ended after " + watch.elapsed( TimeUnit.MILLISECONDS ) + "ms )" );
|
||||
}
|
||||
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void preInitClient(FMLPreInitializationEvent event)
|
||||
// {
|
||||
// ModelLoader.setCustomStateMapper( blockCustomWall, new IStateMapper()
|
||||
// {
|
||||
// StateMap stateMap = new StateMap.Builder().setProperty( BlockWall.VARIANT ).setBuilderSuffix( "_wall" ).build();
|
||||
//
|
||||
// @Override
|
||||
// public Map<IBlockState, ModelResourceLocation> putStateModelLocations( Block block )
|
||||
// {
|
||||
// Map<IBlockState, ModelResourceLocation> map = (Map<IBlockState, ModelResourceLocation>) stateMap.putStateModelLocations( block );
|
||||
// Map<IBlockState, ModelResourceLocation> newMap = Maps.newHashMap();
|
||||
//
|
||||
// for( Map.Entry<IBlockState, ModelResourceLocation> e : map.entrySet() )
|
||||
// {
|
||||
// ModelResourceLocation loc = e.getValue();
|
||||
// newMap.put( e.getKey(), new ModelResourceLocation( ASSETS + loc.getResourcePath(), loc.getVariant() ) );
|
||||
// }
|
||||
//
|
||||
// return newMap;
|
||||
// }
|
||||
// } );
|
||||
// Item customWallItem = Item.getItemFromBlock(blockCustomWall);
|
||||
// ModelLoader.setCustomModelResourceLocation(customWallItem, 0, new ModelResourceLocation(ASSETS + "cobblestone_wall", "inventory"));
|
||||
// ModelLoader.setCustomModelResourceLocation(customWallItem, 1, new ModelResourceLocation(ASSETS + "mossy_cobblestone_wall", "inventory"));
|
||||
// ModelBakery.addVariantName( customWallItem, ASSETS + "cobblestone_wall", ASSETS + "mossy_cobblestone_wall" );
|
||||
// }
|
||||
|
||||
private void startService( String serviceName, Thread thread )
|
||||
{
|
||||
thread.setName( serviceName );
|
||||
|
|
|
@ -28,6 +28,7 @@ import net.minecraft.util.MovingObjectPosition;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
|
||||
import appeng.api.parts.CableRenderMode;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.EffectType;
|
||||
|
@ -42,6 +43,8 @@ public abstract class CommonHelper
|
|||
|
||||
public abstract void preinit();
|
||||
|
||||
public abstract void init();
|
||||
|
||||
public abstract World getWorld();
|
||||
|
||||
public abstract void bindTileEntitySpecialRenderer( Class tile, AEBaseBlock blk );
|
||||
|
|
|
@ -21,16 +21,17 @@ package appeng.core.features;
|
|||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.GameData;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.CreativeTab;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
|
||||
public final class AEBlockFeatureHandler implements IFeatureHandler
|
||||
{
|
||||
|
@ -69,16 +70,14 @@ public final class AEBlockFeatureHandler implements IFeatureHandler
|
|||
String name = this.extractor.get();
|
||||
this.featured.setCreativeTab( CreativeTab.instance );
|
||||
this.featured.setUnlocalizedName( /* "tile." */"appliedenergistics2." + name );
|
||||
this.featured.setBlockTextureName( name );
|
||||
|
||||
final String registryName = "tile." + name;
|
||||
this.featured.setBlockTextureName( name );
|
||||
|
||||
// Bypass the forge magic with null to register our own itemblock later.
|
||||
GameRegistry.registerBlock( this.featured, null, registryName );
|
||||
GameRegistry.registerItem( this.definition.maybeItem().get(), registryName );
|
||||
GameRegistry.registerBlock( this.featured, null, name );
|
||||
GameRegistry.registerItem( this.definition.maybeItem().get(), name );
|
||||
|
||||
// register the block/item conversion...
|
||||
if ( this.featured != null && this.definition.maybeItem().isPresent() )
|
||||
if ( this.definition.maybeItem().isPresent() )
|
||||
GameData.getBlockItemMap().put( this.featured, this.definition.maybeItem().get() );
|
||||
|
||||
if ( side == Side.CLIENT)
|
||||
|
|
|
@ -55,6 +55,10 @@ public class FeatureNameExtractor
|
|||
{
|
||||
name = "stair";
|
||||
}
|
||||
else if ( name.startsWith( "BlockFluix" ) )
|
||||
{
|
||||
name = "fluix";
|
||||
}
|
||||
|
||||
if( this.subName.isPresent() )
|
||||
{
|
||||
|
|
|
@ -21,17 +21,18 @@ package appeng.core.features;
|
|||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import appeng.core.CommonHelper;
|
||||
import appeng.core.CreativeTab;
|
||||
import appeng.core.CreativeTabFacade;
|
||||
import appeng.items.parts.ItemFacade;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
|
||||
public final class ItemFeatureHandler implements IFeatureHandler
|
||||
{
|
||||
|
@ -63,7 +64,7 @@ public final class ItemFeatureHandler implements IFeatureHandler
|
|||
}
|
||||
|
||||
@Override
|
||||
public void register(Side side)
|
||||
public void register( Side side )
|
||||
{
|
||||
if( this.enabled )
|
||||
{
|
||||
|
@ -91,21 +92,17 @@ public final class ItemFeatureHandler implements IFeatureHandler
|
|||
name = "ItemMultiPart";
|
||||
}
|
||||
|
||||
GameRegistry.registerItem( this.item, "item." + name );
|
||||
// "item." +
|
||||
GameRegistry.registerItem( this.item, name );
|
||||
|
||||
if ( side == Side.CLIENT )
|
||||
if( side == Side.CLIENT )
|
||||
{
|
||||
CommonHelper.proxy.configureIcon( item, itemPhysicalName );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void configureIcon(
|
||||
Item item,
|
||||
int meta,
|
||||
String name )
|
||||
private void configureIcon( Item item, int meta, String name )
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,85 +0,0 @@
|
|||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.core.features;
|
||||
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import appeng.items.AEBaseItem;
|
||||
|
||||
|
||||
/**
|
||||
* This class is used to rename items to match the persistent stored items.
|
||||
*
|
||||
* This can be removed, when a new iteration of minecraft arrives or a new world is used.
|
||||
* Remember to differentiate the currently renamed items later on correctly.
|
||||
*
|
||||
* @deprecated only a temporary solution for a rename
|
||||
*/
|
||||
@Deprecated
|
||||
public final class NameResolver
|
||||
{
|
||||
private static final Pattern ITEM_MULTI_PART = Pattern.compile( "ItemMultiPart", Pattern.LITERAL );
|
||||
private static final Pattern ITEM_MULTI_MATERIAL = Pattern.compile( "ItemMultiMaterial", Pattern.LITERAL );
|
||||
private static final Pattern QUARTZ = Pattern.compile( "Quartz", Pattern.LITERAL );
|
||||
|
||||
private final Class<? extends AEBaseItem> withOriginalName;
|
||||
|
||||
public NameResolver( Class<? extends AEBaseItem> withOriginalName )
|
||||
{
|
||||
this.withOriginalName = withOriginalName;
|
||||
}
|
||||
|
||||
public String getName( String subName )
|
||||
{
|
||||
String name = this.withOriginalName.getSimpleName();
|
||||
|
||||
if( name.startsWith( "ItemMultiPart" ) )
|
||||
{
|
||||
name = ITEM_MULTI_PART.matcher( name ).replaceAll( "ItemPart" );
|
||||
}
|
||||
else if( name.startsWith( "ItemMultiMaterial" ) )
|
||||
{
|
||||
name = ITEM_MULTI_MATERIAL.matcher( name ).replaceAll( "ItemMaterial" );
|
||||
}
|
||||
|
||||
if( subName != null )
|
||||
{
|
||||
// simple hack to allow me to do get nice names for these without
|
||||
// mode code outside of AEBaseItem
|
||||
if( subName.startsWith( "P2PTunnel" ) )
|
||||
{
|
||||
return "ItemPart.P2PTunnel";
|
||||
}
|
||||
|
||||
if( subName.equals( "CertusQuartzTools" ) )
|
||||
{
|
||||
return QUARTZ.matcher( name ).replaceAll( "CertusQuartz" );
|
||||
}
|
||||
if( subName.equals( "NetherQuartzTools" ) )
|
||||
{
|
||||
return QUARTZ.matcher( name ).replaceAll( "NetherQuartz" );
|
||||
}
|
||||
|
||||
name += '.' + subName;
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
}
|
|
@ -31,6 +31,9 @@ import java.util.Map.Entry;
|
|||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
|
@ -47,6 +50,7 @@ import net.minecraft.world.World;
|
|||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.implementations.IUpgradeableHost;
|
||||
import appeng.api.implementations.items.IItemGroup;
|
||||
|
@ -60,14 +64,10 @@ import appeng.core.AEConfig;
|
|||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.IStackSrc;
|
||||
import appeng.core.features.MaterialStackSrc;
|
||||
import appeng.core.features.NameResolver;
|
||||
import appeng.items.AEBaseItem;
|
||||
import appeng.util.InventoryAdaptor;
|
||||
import appeng.util.Platform;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
|
||||
public final class ItemMultiMaterial extends AEBaseItem implements IStorageComponent, IUpgradeModule
|
||||
{
|
||||
|
@ -75,11 +75,9 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
|||
public static ItemMultiMaterial instance;
|
||||
|
||||
private final Map<Integer, MaterialType> dmgToMaterial = new HashMap<Integer, MaterialType>();
|
||||
private final NameResolver nameResolver;
|
||||
|
||||
public ItemMultiMaterial()
|
||||
{
|
||||
this.nameResolver = new NameResolver( this.getClass() );
|
||||
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
this.setHasSubtypes( true );
|
||||
instance = this;
|
||||
|
@ -140,6 +138,19 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public void registerIcons( ClientHelper proxy, String name )
|
||||
{
|
||||
for( MaterialType type : MaterialType.values() )
|
||||
{
|
||||
if( type != MaterialType.InvalidType )
|
||||
{
|
||||
proxy.setIcon( this, type.damageValue, name + "." + type.name() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public MaterialType getTypeByStack( ItemStack is )
|
||||
{
|
||||
if( this.dmgToMaterial.containsKey( is.getItemDamage() ) )
|
||||
|
@ -190,7 +201,6 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
|||
mat.markReady();
|
||||
int newMaterialNum = mat.damageValue;
|
||||
|
||||
|
||||
if( this.dmgToMaterial.get( newMaterialNum ) == null )
|
||||
{
|
||||
this.dmgToMaterial.put( newMaterialNum, mat );
|
||||
|
@ -264,35 +274,6 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
|||
return "item.appliedenergistics2." + this.nameOf( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(
|
||||
ClientHelper proxy,
|
||||
String name )
|
||||
{
|
||||
for ( MaterialType type : MaterialType.values() )
|
||||
{
|
||||
if ( type != MaterialType.InvalidType )
|
||||
proxy.setIcon( this, type.damageValue, name +"."+ type.name() );
|
||||
}
|
||||
}
|
||||
|
||||
private String nameOf( ItemStack is )
|
||||
{
|
||||
if( is == null )
|
||||
{
|
||||
return "null";
|
||||
}
|
||||
|
||||
MaterialType mt = this.getTypeByStack( is );
|
||||
if( mt == null )
|
||||
{
|
||||
return "null";
|
||||
}
|
||||
|
||||
return this.nameResolver.getName( mt.name() );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems( Item par1, CreativeTabs par2CreativeTabs, List cList )
|
||||
{
|
||||
|
@ -317,15 +298,7 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUseFirst(
|
||||
ItemStack is,
|
||||
EntityPlayer player,
|
||||
World world,
|
||||
BlockPos pos,
|
||||
EnumFacing side,
|
||||
float hitX,
|
||||
float hitY,
|
||||
float hitZ )
|
||||
public boolean onItemUseFirst( ItemStack is, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if( player.isSneaking() )
|
||||
{
|
||||
|
@ -405,6 +378,22 @@ public final class ItemMultiMaterial extends AEBaseItem implements IStorageCompo
|
|||
return eqi;
|
||||
}
|
||||
|
||||
private String nameOf( ItemStack is )
|
||||
{
|
||||
if( is == null )
|
||||
{
|
||||
return "null";
|
||||
}
|
||||
|
||||
MaterialType mt = this.getTypeByStack( is );
|
||||
if( mt == null )
|
||||
{
|
||||
return "null";
|
||||
}
|
||||
|
||||
return mt.name();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBytes( ItemStack is )
|
||||
{
|
||||
|
|
|
@ -29,10 +29,11 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
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;
|
||||
|
@ -44,6 +45,7 @@ import net.minecraft.util.ResourceLocation;
|
|||
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;
|
||||
import appeng.api.parts.IPart;
|
||||
|
@ -57,21 +59,17 @@ import appeng.core.AEConfig;
|
|||
import appeng.core.AppEng;
|
||||
import appeng.core.features.AEFeature;
|
||||
import appeng.core.features.ItemStackSrc;
|
||||
import appeng.core.features.NameResolver;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.integration.IntegrationRegistry;
|
||||
import appeng.integration.IntegrationType;
|
||||
import appeng.items.AEBaseItem;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
|
||||
|
||||
public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemGroup
|
||||
{
|
||||
private static final Comparator<Entry<Integer, PartTypeWithVariant>> REGISTERED_COMPARATOR = new RegisteredComparator();
|
||||
|
||||
public static ItemMultiPart instance;
|
||||
private final NameResolver nameResolver;
|
||||
private final Map<Integer, PartTypeWithVariant> registered;
|
||||
private final Map<Integer, PartTypeWithVariant> unregistered;
|
||||
|
||||
|
@ -82,7 +80,6 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
|||
this.registered = new HashMap<Integer, PartTypeWithVariant>();
|
||||
this.unregistered = new HashMap<Integer, PartTypeWithVariant>();
|
||||
|
||||
this.nameResolver = new NameResolver( this.getClass() );
|
||||
this.setFeature( EnumSet.of( AEFeature.Core ) );
|
||||
partHelper.setItemBusRenderer( this );
|
||||
this.setHasSubtypes( true );
|
||||
|
@ -258,7 +255,7 @@ public final class ItemMultiPart extends AEBaseItem implements IPartItem, IItemG
|
|||
final PartType stackType = this.getTypeByStack( is );
|
||||
final String typeName = stackType.name();
|
||||
|
||||
return this.nameResolver.getName( typeName );
|
||||
return typeName;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
|
|
|
@ -33,6 +33,7 @@ import net.minecraft.util.MovingObjectPosition;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
|
||||
import appeng.api.parts.CableRenderMode;
|
||||
import appeng.block.AEBaseBlock;
|
||||
import appeng.client.EffectType;
|
||||
|
@ -49,13 +50,13 @@ public class ServerHelper extends CommonHelper
|
|||
private EntityPlayer renderModeBased;
|
||||
|
||||
@Override
|
||||
public void configureIcon(Object item, String name )
|
||||
public void preinit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preinit()
|
||||
public void init()
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -155,6 +156,37 @@ public class ServerHelper extends CommonHelper
|
|||
return this.renderModeForPlayer( this.renderModeBased );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void triggerUpdates()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRenderMode( EntityPlayer player )
|
||||
{
|
||||
this.renderModeBased = player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void missingCoreMod()
|
||||
{
|
||||
throw new IllegalStateException( "Unable to Load Core Mod, please verify that AE2 is properly install in the mods folder, with a .jar extension." );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureIcon( Object item, String name )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation addIcon( String string )
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
protected CableRenderMode renderModeForPlayer( EntityPlayer player )
|
||||
{
|
||||
if( player != null )
|
||||
|
@ -176,30 +208,4 @@ public class ServerHelper extends CommonHelper
|
|||
|
||||
return CableRenderMode.Standard;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void triggerUpdates()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRenderMode( EntityPlayer player )
|
||||
{
|
||||
this.renderModeBased = player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void missingCoreMod()
|
||||
{
|
||||
throw new IllegalStateException( "Unable to Load Core Mod, please verify that AE2 is properly install in the mods folder, with a .jar extension." );
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation addIcon(
|
||||
String string )
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"variants": {
|
||||
"normal": { "model": "appliedenergistics2:fluix" }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "block/cube_all",
|
||||
"textures": {
|
||||
"all": "appliedenergistics2:blocks/fluix"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"parent": "appliedenergistics2:block/fluix",
|
||||
"display": {
|
||||
"thirdperson": {
|
||||
"rotation": [ 10, -45, 170 ],
|
||||
"translation": [ 0, 1.5, -2.75 ],
|
||||
"scale": [ 0.375, 0.375, 0.375 ]
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 787 B |
Loading…
Reference in a new issue