Implemented item models for cables.

This commit is contained in:
Sebastian Hartte 2016-08-26 19:07:15 +02:00
parent a5398240a0
commit 71a88aa668
79 changed files with 695 additions and 83 deletions

View File

@ -152,14 +152,10 @@ public class BlockCableBus extends AEBaseTileBlock
@Override
public int getLightValue( final IBlockState state, final IBlockAccess world, final BlockPos pos )
{
if( state != null && state.getBlock() != this )
if( state.getBlock() != this )
{
return state.getBlock().getLightValue( state, world, pos );
}
if( state == null )
{
return 0;
}
return this.cb( world, pos ).getLightValue();
}

View File

@ -0,0 +1,52 @@
package appeng.block.networking;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import appeng.api.client.BakingPipeline;
import appeng.bootstrap.BlockRenderingCustomizer;
import appeng.bootstrap.IBlockRendering;
import appeng.bootstrap.IItemRendering;
import appeng.client.render.model.pipeline.BakingPipelineBakedModel;
import appeng.client.render.model.pipeline.FacingQuadRotator;
import appeng.client.render.model.pipeline.Merge;
import appeng.client.render.model.pipeline.TintIndexModifier;
import appeng.client.render.model.pipeline.TypeTransformer;
import appeng.client.render.model.pipeline.cable.CableAndConnections;
import appeng.client.render.model.pipeline.cable.Facades;
import appeng.client.render.model.pipeline.cable.Parts;
/**
* Customizes the rendering behavior for cable busses, which are the biggest multipart of AE2.
*/
public class CableBusRendering extends BlockRenderingCustomizer
{
private final BakingPipeline<BakedQuad, BakedQuad> rotatingPipeline = new BakingPipeline<>( TypeTransformer.quads2vecs, new FacingQuadRotator(), TypeTransformer.vecs2quads );
private final TintIndexModifier tintIndexModifier = new TintIndexModifier( tint -> tint );
private final BakingPipeline<BakedQuad, BakedQuad> tintIndexFixPipeline = new BakingPipeline<>( TypeTransformer.quads2vecs, tintIndexModifier, TypeTransformer.vecs2quads );
@Override
@SideOnly( Side.CLIENT )
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
{
rendering.modelCustomizer( this::customizeModel );
rendering.blockColor( new CableBusColor() );
}
private IBakedModel customizeModel( ResourceLocation location, IBakedModel model )
{
return new BakingPipelineBakedModel( model,
new Merge<>(
new CableAndConnections( rotatingPipeline, tintIndexModifier, tintIndexFixPipeline ),
new Facades( rotatingPipeline, tintIndexModifier, tintIndexFixPipeline ),
new Parts( rotatingPipeline, tintIndexModifier, tintIndexFixPipeline )
)
);
}
}

View File

@ -1,29 +0,0 @@
package appeng.block.networking;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import appeng.api.client.BakingPipeline;
import appeng.client.render.model.pipeline.BakingPipelineBakedModel;
import appeng.client.render.model.pipeline.FacingQuadRotator;
import appeng.client.render.model.pipeline.Merge;
import appeng.client.render.model.pipeline.TintIndexModifier;
import appeng.client.render.model.pipeline.TypeTransformer;
import appeng.client.render.model.pipeline.cable.CableAndConnections;
import appeng.client.render.model.pipeline.cable.Facades;
import appeng.client.render.model.pipeline.cable.Parts;
public class CableModelCustomizer
{
private final BakingPipeline rotatingPipeline = new BakingPipeline( TypeTransformer.quads2vecs, new FacingQuadRotator(), TypeTransformer.vecs2quads );
private final TintIndexModifier tintIndexModifier = new TintIndexModifier( tint -> tint );
private final BakingPipeline tintIndexFixPipeline = new BakingPipeline( TypeTransformer.quads2vecs, tintIndexModifier, TypeTransformer.vecs2quads );
public IBakedModel customizeModel( ModelResourceLocation location, IBakedModel model )
{
return new BakingPipelineBakedModel( model, new Merge( new CableAndConnections( rotatingPipeline, tintIndexModifier, tintIndexFixPipeline ), new Facades( rotatingPipeline, tintIndexModifier, tintIndexFixPipeline ), new Parts( rotatingPipeline, tintIndexModifier, tintIndexFixPipeline ) ) );
}
}

View File

@ -62,8 +62,7 @@ import appeng.block.networking.BlockEnergyAcceptor;
import appeng.block.networking.BlockEnergyCell;
import appeng.block.networking.BlockEnergyCellRendering;
import appeng.block.networking.BlockWireless;
import appeng.block.networking.CableBusColor;
import appeng.block.networking.CableModelCustomizer;
import appeng.block.networking.CableBusRendering;
import appeng.block.networking.ControllerRendering;
import appeng.block.qnb.BlockQuantumLinkChamber;
import appeng.block.qnb.BlockQuantumRing;
@ -338,16 +337,7 @@ public final class ApiBlocks implements IBlocks
this.quartzPillarStairs = makeStairs( "quartz_pillar_stairs", registry, this.quartzPillar() );
this.multiPart = registry.block( "multipart_block", BlockCableBus::new )
.rendering( new BlockRenderingCustomizer()
{
@Override
@SideOnly( Side.CLIENT )
public void customize( IBlockRendering rendering, IItemRendering itemRendering )
{
rendering.modelCustomizer( new CableModelCustomizer()::customizeModel )
.blockColor( new CableBusColor() );
}
} )
.rendering( new CableBusRendering() )
.build();
// TODO Re-Add Slabs...

View File

@ -1,6 +1,9 @@
package appeng.items.parts;
import java.util.Arrays;
import java.util.stream.Collectors;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.ItemStack;
@ -21,13 +24,19 @@ public class ItemMultipartRendering extends ItemRenderingCustomizer
@Override
public void customize( IItemRendering rendering )
{
rendering.meshDefinition( this::getItemMeshDefinition );
// Register all item models as variants so they get loaded
rendering.variants( Arrays.stream( PartType.values() )
.flatMap( part -> part.getItemModels().stream() )
.collect( Collectors.toList() ) );
}
private ModelResourceLocation getItemMeshDefinition( ItemStack is )
{
// TODO: Avoid object creation here. This happens every frame
return new ModelResourceLocation( item.getTypeByStack( is ).getModel(), null );
PartType partType = item.getTypeByStack( is );
int variant = item.variantOf( is.getItemDamage() );
return partType.getItemModels().get( variant );
}
}

View File

@ -20,13 +20,20 @@ package appeng.items.parts;
import java.lang.reflect.Constructor;
import java.util.Arrays;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import com.google.common.collect.ImmutableList;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.util.ResourceLocation;
import appeng.api.parts.IPart;
import appeng.api.util.AEColor;
import appeng.core.AppEng;
import appeng.core.features.AEFeature;
import appeng.core.localization.GuiText;
@ -65,91 +72,123 @@ import appeng.parts.reporting.PartTerminal;
public enum PartType
{
InvalidType( -1, new ResourceLocation( AppEng.MOD_ID, "invalid" ), EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), null ),
InvalidType( -1, "invalid" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), null ),
CableGlass( 0, new ResourceLocation( AppEng.MOD_ID, "cable_glass" ), EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartCableGlass.class )
CableGlass( 0, "cable_glass" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartCableGlass.class )
{
@Override
public boolean isCable()
{
return true;
}
@Override
protected List<ModelResourceLocation> createItemModels( String baseName )
{
return Arrays.stream( AEColor.values() )
.map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) )
.collect( Collectors.toList());
}
},
CableCovered( 20, new ResourceLocation( AppEng.MOD_ID, "cable_covered" ), EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartCableCovered.class )
CableCovered( 20, "cable_covered" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartCableCovered.class )
{
@Override
public boolean isCable()
{
return true;
}
@Override
protected List<ModelResourceLocation> createItemModels( String baseName )
{
return Arrays.stream( AEColor.values() )
.map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) )
.collect( Collectors.toList());
}
},
CableSmart( 40, new ResourceLocation( AppEng.MOD_ID, "cable_smart" ), EnumSet.of( AEFeature.Channels ), EnumSet.noneOf( IntegrationType.class ), PartCableSmart.class )
CableSmart( 40, "cable_smart" , EnumSet.of( AEFeature.Channels ), EnumSet.noneOf( IntegrationType.class ), PartCableSmart.class )
{
@Override
public boolean isCable()
{
return true;
}
@Override
protected List<ModelResourceLocation> createItemModels( String baseName )
{
return Arrays.stream( AEColor.values() )
.map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) )
.collect( Collectors.toList());
}
},
CableDense( 60, new ResourceLocation( AppEng.MOD_ID, "cable_dense" ), EnumSet.of( AEFeature.Channels ), EnumSet.noneOf( IntegrationType.class ), PartDenseCable.class )
CableDense( 60, "cable_dense" , EnumSet.of( AEFeature.Channels ), EnumSet.noneOf( IntegrationType.class ), PartDenseCable.class )
{
@Override
public boolean isCable()
{
return true;
}
@Override
protected List<ModelResourceLocation> createItemModels( String baseName )
{
return Arrays.stream( AEColor.values() )
.map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) )
.collect( Collectors.toList());
}
},
ToggleBus( 80, new ResourceLocation( AppEng.MOD_ID, "toggle_bus" ), EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartToggleBus.class ),
ToggleBus( 80, "toggle_bus" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartToggleBus.class ),
InvertedToggleBus( 100, new ResourceLocation( AppEng.MOD_ID, "inverted_toggle_bus" ), EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartInvertedToggleBus.class ),
InvertedToggleBus( 100, "inverted_toggle_bus" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartInvertedToggleBus.class ),
CableAnchor( 120, new ResourceLocation( AppEng.MOD_ID, "cable_anchor" ), EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartCableAnchor.class ),
CableAnchor( 120, "cable_anchor" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartCableAnchor.class ),
QuartzFiber( 140, new ResourceLocation( AppEng.MOD_ID, "quartz_fiber" ), EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartQuartzFiber.class ),
QuartzFiber( 140, "quartz_fiber" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartQuartzFiber.class ),
Monitor( 160, new ResourceLocation( AppEng.MOD_ID, "monitor" ), EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartPanel.class ),
Monitor( 160, "monitor" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartPanel.class ),
SemiDarkMonitor( 180, new ResourceLocation( AppEng.MOD_ID, "semi_dark_monitor" ), EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartSemiDarkPanel.class ),
SemiDarkMonitor( 180, "semi_dark_monitor" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartSemiDarkPanel.class ),
DarkMonitor( 200, new ResourceLocation( AppEng.MOD_ID, "dark_monitor" ), EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartDarkPanel.class ),
DarkMonitor( 200, "dark_monitor" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartDarkPanel.class ),
StorageBus( 220, new ResourceLocation( AppEng.MOD_ID, "storage_bus" ), EnumSet.of( AEFeature.StorageBus ), EnumSet.noneOf( IntegrationType.class ), PartStorageBus.class ),
StorageBus( 220, "storage_bus" , EnumSet.of( AEFeature.StorageBus ), EnumSet.noneOf( IntegrationType.class ), PartStorageBus.class ),
ImportBus( 240, new ResourceLocation( AppEng.MOD_ID, "import_bus" ), EnumSet.of( AEFeature.ImportBus ), EnumSet.noneOf( IntegrationType.class ), PartImportBus.class ),
ImportBus( 240, "import_bus" , EnumSet.of( AEFeature.ImportBus ), EnumSet.noneOf( IntegrationType.class ), PartImportBus.class ),
ExportBus( 260, new ResourceLocation( AppEng.MOD_ID, "export_bus" ), EnumSet.of( AEFeature.ExportBus ), EnumSet.noneOf( IntegrationType.class ), PartExportBus.class ),
ExportBus( 260, "export_bus" , EnumSet.of( AEFeature.ExportBus ), EnumSet.noneOf( IntegrationType.class ), PartExportBus.class ),
LevelEmitter( 280, new ResourceLocation( AppEng.MOD_ID, "level_emitter" ), EnumSet.of( AEFeature.LevelEmitter ), EnumSet.noneOf( IntegrationType.class ), PartLevelEmitter.class ),
LevelEmitter( 280, "level_emitter" , EnumSet.of( AEFeature.LevelEmitter ), EnumSet.noneOf( IntegrationType.class ), PartLevelEmitter.class ),
AnnihilationPlane( 300, new ResourceLocation( AppEng.MOD_ID, "annihilation_plane" ), EnumSet.of( AEFeature.AnnihilationPlane ), EnumSet.noneOf( IntegrationType.class ), PartAnnihilationPlane.class ),
AnnihilationPlane( 300, "annihilation_plane" , EnumSet.of( AEFeature.AnnihilationPlane ), EnumSet.noneOf( IntegrationType.class ), PartAnnihilationPlane.class ),
IdentityAnnihilationPlane( 301, new ResourceLocation( AppEng.MOD_ID, "identity_annihilation_plane" ), EnumSet.of( AEFeature.AnnihilationPlane, AEFeature.IdentityAnnihilationPlane ), EnumSet.noneOf( IntegrationType.class ), PartIdentityAnnihilationPlane.class ),
IdentityAnnihilationPlane( 301, "identity_annihilation_plane" , EnumSet.of( AEFeature.AnnihilationPlane, AEFeature.IdentityAnnihilationPlane ), EnumSet.noneOf( IntegrationType.class ), PartIdentityAnnihilationPlane.class ),
FormationPlane( 320, new ResourceLocation( AppEng.MOD_ID, "formation_plane" ), EnumSet.of( AEFeature.FormationPlane ), EnumSet.noneOf( IntegrationType.class ), PartFormationPlane.class ),
FormationPlane( 320, "formation_plane" , EnumSet.of( AEFeature.FormationPlane ), EnumSet.noneOf( IntegrationType.class ), PartFormationPlane.class ),
PatternTerminal( 340, new ResourceLocation( AppEng.MOD_ID, "pattern_terminal" ), EnumSet.of( AEFeature.Patterns ), EnumSet.noneOf( IntegrationType.class ), PartPatternTerminal.class ),
PatternTerminal( 340, "pattern_terminal" , EnumSet.of( AEFeature.Patterns ), EnumSet.noneOf( IntegrationType.class ), PartPatternTerminal.class ),
CraftingTerminal( 360, new ResourceLocation( AppEng.MOD_ID, "crafting_terminal" ), EnumSet.of( AEFeature.CraftingTerminal ), EnumSet.noneOf( IntegrationType.class ), PartCraftingTerminal.class ),
CraftingTerminal( 360, "crafting_terminal" , EnumSet.of( AEFeature.CraftingTerminal ), EnumSet.noneOf( IntegrationType.class ), PartCraftingTerminal.class ),
Terminal( 380, new ResourceLocation( AppEng.MOD_ID, "terminal" ), EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartTerminal.class ),
Terminal( 380, "terminal" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartTerminal.class ),
StorageMonitor( 400, new ResourceLocation( AppEng.MOD_ID, "storage_monitor" ), EnumSet.of( AEFeature.StorageMonitor ), EnumSet.noneOf( IntegrationType.class ), PartStorageMonitor.class ),
StorageMonitor( 400, "storage_monitor" , EnumSet.of( AEFeature.StorageMonitor ), EnumSet.noneOf( IntegrationType.class ), PartStorageMonitor.class ),
ConversionMonitor( 420, new ResourceLocation( AppEng.MOD_ID, "conversion_monitor" ), EnumSet.of( AEFeature.PartConversionMonitor ), EnumSet.noneOf( IntegrationType.class ), PartConversionMonitor.class ),
ConversionMonitor( 420, "conversion_monitor" , EnumSet.of( AEFeature.PartConversionMonitor ), EnumSet.noneOf( IntegrationType.class ), PartConversionMonitor.class ),
Interface( 440, new ResourceLocation( AppEng.MOD_ID, "interface" ), EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartInterface.class ),
Interface( 440, "interface" , EnumSet.of( AEFeature.Core ), EnumSet.noneOf( IntegrationType.class ), PartInterface.class ),
P2PTunnelME( 460, new ResourceLocation( AppEng.MOD_ID, "p2p_tunnel_me" ), EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelME ), EnumSet.noneOf( IntegrationType.class ), PartP2PTunnelME.class, GuiText.METunnel ),
P2PTunnelME( 460, "p2p_tunnel_me" , EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelME ), EnumSet.noneOf( IntegrationType.class ), PartP2PTunnelME.class, GuiText.METunnel ),
P2PTunnelRedstone( 461, new ResourceLocation( AppEng.MOD_ID, "p2p_tunnel_redstone" ), EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelRedstone ), EnumSet.noneOf( IntegrationType.class ), PartP2PRedstone.class, GuiText.RedstoneTunnel ),
P2PTunnelRedstone( 461, "p2p_tunnel_redstone" , EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelRedstone ), EnumSet.noneOf( IntegrationType.class ), PartP2PRedstone.class, GuiText.RedstoneTunnel ),
P2PTunnelItems( 462, new ResourceLocation( AppEng.MOD_ID, "p2p_tunnel_items" ), EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelItems ), EnumSet.noneOf( IntegrationType.class ), PartP2PItems.class, GuiText.ItemTunnel ),
P2PTunnelItems( 462, "p2p_tunnel_items" , EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelItems ), EnumSet.noneOf( IntegrationType.class ), PartP2PItems.class, GuiText.ItemTunnel ),
P2PTunnelLiquids( 463, new ResourceLocation( AppEng.MOD_ID, "p2p_tunnel_liquids" ), EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelLiquids ), EnumSet.noneOf( IntegrationType.class ), PartP2PLiquids.class, GuiText.FluidTunnel ),
P2PTunnelLiquids( 463, "p2p_tunnel_liquids" , EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelLiquids ), EnumSet.noneOf( IntegrationType.class ), PartP2PLiquids.class, GuiText.FluidTunnel ),
// P2PTunnelEU( 465, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelEU ), EnumSet.of( IntegrationType.IC2 ),
// PartP2PIC2Power.class, GuiText.EUTunnel ),
@ -157,7 +196,7 @@ public enum PartType
// P2PTunnelRF( 466, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelRF ), EnumSet.of( IntegrationType.RF ),
// PartP2PRFPower.class, GuiText.RFTunnel ),
P2PTunnelLight( 467, new ResourceLocation( AppEng.MOD_ID, "p2p_tunnel_light" ), EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelLight ), EnumSet.noneOf( IntegrationType.class ), PartP2PLight.class, GuiText.LightTunnel ),
P2PTunnelLight( 467, "p2p_tunnel_light" , EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelLight ), EnumSet.noneOf( IntegrationType.class ), PartP2PLight.class, GuiText.LightTunnel ),
// P2PTunnelOpenComputers( 468, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelOpenComputers ), EnumSet.of(
// IntegrationType.OpenComputers ), PartP2POpenComputers.class, GuiText.OCTunnel ),
@ -165,7 +204,7 @@ public enum PartType
// P2PTunnelPressure( 469, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelPressure ), EnumSet.of(
// IntegrationType.PneumaticCraft ), PartP2PPressure.class, GuiText.PressureTunnel ),
InterfaceTerminal( 480, new ResourceLocation( AppEng.MOD_ID, "interface_terminal" ), EnumSet.of( AEFeature.InterfaceTerminal ), EnumSet.noneOf( IntegrationType.class ), PartInterfaceTerminal.class );
InterfaceTerminal( 480, "interface_terminal" , EnumSet.of( AEFeature.InterfaceTerminal ), EnumSet.noneOf( IntegrationType.class ), PartInterfaceTerminal.class );
private final int baseDamage;
private final ResourceLocation name;
@ -173,21 +212,33 @@ public enum PartType
private final Set<IntegrationType> integrations;
private final Class<? extends IPart> myPart;
private final GuiText extraName;
private final List<ModelResourceLocation> itemModels;
private Constructor<? extends IPart> constructor;
PartType( final int baseMetaValue, final ResourceLocation name, final Set<AEFeature> features, final Set<IntegrationType> integrations, final Class<? extends IPart> c )
PartType( final int baseMetaValue, final String name, final Set<AEFeature> features, final Set<IntegrationType> integrations, final Class<? extends IPart> c )
{
this( baseMetaValue, name, features, integrations, c, null );
}
PartType( final int baseMetaValue, final ResourceLocation name, final Set<AEFeature> features, final Set<IntegrationType> integrations, final Class<? extends IPart> c, final GuiText en )
PartType( final int baseMetaValue, final String name, final Set<AEFeature> features, final Set<IntegrationType> integrations, final Class<? extends IPart> c, final GuiText en )
{
this.baseDamage = baseMetaValue;
this.name = name;
this.name = new ResourceLocation( AppEng.MOD_ID, name );
this.features = Collections.unmodifiableSet( features );
this.integrations = Collections.unmodifiableSet( integrations );
this.myPart = c;
this.extraName = en;
this.itemModels = createItemModels( name );
}
protected List<ModelResourceLocation> createItemModels( String baseName )
{
return ImmutableList.of( modelFromBaseName( baseName ) );
}
private static ModelResourceLocation modelFromBaseName( String baseName )
{
return new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, "part/" + baseName ), "inventory" );
}
int getBaseDamage()
@ -240,4 +291,9 @@ public enum PartType
this.constructor = constructor;
}
public List<ModelResourceLocation> getItemModels()
{
return itemModels;
}
}

View File

@ -0,0 +1,18 @@
{
"parent": "block/block",
"elements": [
{
"name": "Element",
"from": [ 5.0, 5.0, 0.0 ],
"to": [ 11.0, 11.0, 16.0 ],
"faces": {
"north": { "texture": "#base", "uv": [ 5.0, 5.0, 11.0, 11.0 ] },
"east": { "texture": "#base", "uv": [ 0.0, 5.0, 5.0, 11.0 ] },
"south": { "texture": "#base", "uv": [ 11.0, 5.0, 5.0, 11.0 ] },
"west": { "texture": "#base", "uv": [ 5.0, 5.0, 0.0, 11.0 ] },
"up": { "texture": "#base", "uv": [ 5.0, 0.0, 11.0, 5.0 ] },
"down": { "texture": "#base", "uv": [ 5.0, 11.0, 11.0, 16.0 ] }
}
}
]
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_covered_base",
"textures": {
"base": "appliedenergistics2:parts/cable/covered/black"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_covered_base",
"textures": {
"base": "appliedenergistics2:parts/cable/covered/blue"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_covered_base",
"textures": {
"base": "appliedenergistics2:parts/cable/covered/brown"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_covered_base",
"textures": {
"base": "appliedenergistics2:parts/cable/covered/cyan"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_covered_base",
"textures": {
"base": "appliedenergistics2:parts/cable/covered/gray"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_covered_base",
"textures": {
"base": "appliedenergistics2:parts/cable/covered/green"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_covered_base",
"textures": {
"base": "appliedenergistics2:parts/cable/covered/lightblue"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_covered_base",
"textures": {
"base": "appliedenergistics2:parts/cable/covered/lightgrey"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_covered_base",
"textures": {
"base": "appliedenergistics2:parts/cable/covered/lime"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_covered_base",
"textures": {
"base": "appliedenergistics2:parts/cable/covered/magenta"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_covered_base",
"textures": {
"base": "appliedenergistics2:parts/cable/covered/orange"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_covered_base",
"textures": {
"base": "appliedenergistics2:parts/cable/covered/pink"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_covered_base",
"textures": {
"base": "appliedenergistics2:parts/cable/covered/purple"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_covered_base",
"textures": {
"base": "appliedenergistics2:parts/cable/covered/red"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_covered_base",
"textures": {
"base": "appliedenergistics2:parts/cable/covered/transparent"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_covered_base",
"textures": {
"base": "appliedenergistics2:parts/cable/covered/white"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_covered_base",
"textures": {
"base": "appliedenergistics2:parts/cable/covered/yellow"
}
}

View File

@ -0,0 +1,34 @@
{
"parent": "block/block",
"textures": {
"channels": "appliedenergistics2:parts/cable/dense/0"
},
"elements": [
{
"name": "Base",
"from": [ 3.0, 3.0, 0.0 ],
"to": [ 13.0, 13.0, 16.0 ],
"faces": {
"north": { "texture": "#base", "uv": [ 5.0, 5.0, 11.0, 11.0 ] },
"east": { "texture": "#base", "uv": [ 0.0, 5.0, 5.0, 11.0 ] },
"south": { "texture": "#base", "uv": [ 11.0, 5.0, 5.0, 11.0 ] },
"west": { "texture": "#base", "uv": [ 5.0, 5.0, 0.0, 11.0 ] },
"up": { "texture": "#base", "uv": [ 5.0, 0.0, 11.0, 5.0 ] },
"down": { "texture": "#base", "uv": [ 5.0, 11.0, 11.0, 16.0 ] }
}
},
{
"name": "Channels",
"from": [ 3.0, 3.0, 0.0 ],
"to": [ 13.0, 13.0, 16.0 ],
"faces": {
"north": { "texture": "#channels", "uv": [ 5.0, 5.0, 11.0, 11.0 ] },
"east": { "texture": "#channels", "uv": [ 0.0, 5.0, 5.0, 11.0 ] },
"south": { "texture": "#channels", "uv": [ 11.0, 5.0, 5.0, 11.0 ] },
"west": { "texture": "#channels", "uv": [ 5.0, 5.0, 0.0, 11.0 ] },
"up": { "texture": "#channels", "uv": [ 5.0, 0.0, 11.0, 5.0 ] },
"down": { "texture": "#channels", "uv": [ 5.0, 11.0, 11.0, 16.0 ] }
}
}
]
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_dense_base",
"textures": {
"base": "appliedenergistics2:parts/cable/dense/black"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_dense_base",
"textures": {
"base": "appliedenergistics2:parts/cable/dense/blue"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_dense_base",
"textures": {
"base": "appliedenergistics2:parts/cable/dense/brown"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_dense_base",
"textures": {
"base": "appliedenergistics2:parts/cable/dense/cyan"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_dense_base",
"textures": {
"base": "appliedenergistics2:parts/cable/dense/gray"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_dense_base",
"textures": {
"base": "appliedenergistics2:parts/cable/dense/green"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_dense_base",
"textures": {
"base": "appliedenergistics2:parts/cable/dense/lightblue"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_dense_base",
"textures": {
"base": "appliedenergistics2:parts/cable/dense/lightgrey"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_dense_base",
"textures": {
"base": "appliedenergistics2:parts/cable/dense/lime"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_dense_base",
"textures": {
"base": "appliedenergistics2:parts/cable/dense/magenta"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_dense_base",
"textures": {
"base": "appliedenergistics2:parts/cable/dense/orange"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_dense_base",
"textures": {
"base": "appliedenergistics2:parts/cable/dense/pink"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_dense_base",
"textures": {
"base": "appliedenergistics2:parts/cable/dense/purple"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_dense_base",
"textures": {
"base": "appliedenergistics2:parts/cable/dense/red"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_dense_base",
"textures": {
"base": "appliedenergistics2:parts/cable/dense/transparent"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_dense_base",
"textures": {
"base": "appliedenergistics2:parts/cable/dense/white"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_dense_base",
"textures": {
"base": "appliedenergistics2:parts/cable/dense/yellow"
}
}

View File

@ -0,0 +1,44 @@
{
"parent": "block/block",
"elements": [
{
"name": "Element",
"from": [ 6.0, 6.0, 6.0 ],
"to": [ 10.0, 10.0, 10.0 ],
"faces": {
"north": { "texture": "#base", "uv": [ 6.0, 6.0, 10.0, 10.0 ] },
"east": { "texture": "#base", "uv": [ 6.0, 6.0, 10.0, 10.0 ] },
"south": { "texture": "#base", "uv": [ 10.0, 6.0, 6.0, 10.0 ] },
"west": { "texture": "#base", "uv": [ 10.0, 6.0, 6.0, 10.0 ] },
"up": { "texture": "#base", "uv": [ 6.0, 6.0, 10.0, 10.0 ] },
"down": { "texture": "#base", "uv": [ 6.0, 6.0, 10.0, 10.0 ] }
}
},
{
"name": "Element",
"from": [ 6.0, 6.0, 0.0 ],
"to": [ 10.0, 10.0, 6.0 ],
"faces": {
"north": { "texture": "#base", "uv": [ 6.0, 6.0, 10.0, 10.0 ] },
"east": { "texture": "#base", "uv": [ 10.0, 6.0, 16.0, 10.0 ] },
"south": { "texture": "#base", "uv": [ 10.0, 6.0, 6.0, 10.0 ] },
"west": { "texture": "#base", "uv": [ 16.0, 6.0, 10.0, 10.0 ] },
"up": { "texture": "#base", "uv": [ 6.0, 0.0, 10.0, 6.0 ] },
"down": { "texture": "#base", "uv": [ 6.0, 10.0, 10.0, 16.0 ] }
}
},
{
"name": "Element",
"from": [ 6.0, 6.0, 10.0 ],
"to": [ 10.0, 10.0, 16.0 ],
"faces": {
"north": { "texture": "#base", "uv": [ 6.0, 6.0, 10.0, 10.0 ] },
"east": { "texture": "#base", "uv": [ 0.0, 6.0, 6.0, 10.0 ] },
"south": { "texture": "#base", "uv": [ 10.0, 6.0, 6.0, 10.0 ] },
"west": { "texture": "#base", "uv": [ 6.0, 6.0, 0.0, 10.0 ] },
"up": { "texture": "#base", "uv": [ 6.0, 10.0, 10.0, 16.0 ] },
"down": { "texture": "#base", "uv": [ 6.0, 0.0, 10.0, 6.0 ] }
}
}
]
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_glass_base",
"textures": {
"base": "appliedenergistics2:parts/cable/glass/black"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_glass_base",
"textures": {
"base": "appliedenergistics2:parts/cable/glass/blue"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_glass_base",
"textures": {
"base": "appliedenergistics2:parts/cable/glass/brown"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_glass_base",
"textures": {
"base": "appliedenergistics2:parts/cable/glass/cyan"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_glass_base",
"textures": {
"base": "appliedenergistics2:parts/cable/glass/gray"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_glass_base",
"textures": {
"base": "appliedenergistics2:parts/cable/glass/green"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_glass_base",
"textures": {
"base": "appliedenergistics2:parts/cable/glass/lightblue"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_glass_base",
"textures": {
"base": "appliedenergistics2:parts/cable/glass/lightgrey"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_glass_base",
"textures": {
"base": "appliedenergistics2:parts/cable/glass/lime"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_glass_base",
"textures": {
"base": "appliedenergistics2:parts/cable/glass/magenta"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_glass_base",
"textures": {
"base": "appliedenergistics2:parts/cable/glass/orange"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_glass_base",
"textures": {
"base": "appliedenergistics2:parts/cable/glass/pink"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_glass_base",
"textures": {
"base": "appliedenergistics2:parts/cable/glass/purple"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_glass_base",
"textures": {
"base": "appliedenergistics2:parts/cable/glass/red"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_glass_base",
"textures": {
"base": "appliedenergistics2:parts/cable/glass/transparent"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_glass_base",
"textures": {
"base": "appliedenergistics2:parts/cable/glass/white"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_glass_base",
"textures": {
"base": "appliedenergistics2:parts/cable/glass/yellow"
}
}

View File

@ -0,0 +1,34 @@
{
"parent": "block/block",
"textures": {
"channels": "appliedenergistics2:parts/cable/smart/0"
},
"elements": [
{
"name": "Element",
"from": [ 5.0, 5.0, 0.0 ],
"to": [ 11.0, 11.0, 16.0 ],
"faces": {
"north": { "texture": "#base", "uv": [ 5.0, 5.0, 11.0, 11.0 ] },
"east": { "texture": "#base", "uv": [ 0.0, 5.0, 5.0, 11.0 ] },
"south": { "texture": "#base", "uv": [ 11.0, 5.0, 5.0, 11.0 ] },
"west": { "texture": "#base", "uv": [ 5.0, 5.0, 0.0, 11.0 ] },
"up": { "texture": "#base", "uv": [ 5.0, 0.0, 11.0, 5.0 ] },
"down": { "texture": "#base", "uv": [ 5.0, 11.0, 11.0, 16.0 ] }
}
},
{
"name": "Channels",
"from": [ 5.0, 5.0, 0.0 ],
"to": [ 11.0, 11.0, 16.0 ],
"faces": {
"north": { "texture": "#channels", "uv": [ 5.0, 5.0, 11.0, 11.0 ] },
"east": { "texture": "#channels", "uv": [ 0.0, 5.0, 5.0, 11.0 ] },
"south": { "texture": "#channels", "uv": [ 11.0, 5.0, 5.0, 11.0 ] },
"west": { "texture": "#channels", "uv": [ 5.0, 5.0, 0.0, 11.0 ] },
"up": { "texture": "#channels", "uv": [ 5.0, 0.0, 11.0, 5.0 ] },
"down": { "texture": "#channels", "uv": [ 5.0, 11.0, 11.0, 16.0 ] }
}
}
]
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_smart_base",
"textures": {
"base": "appliedenergistics2:parts/cable/smart/black"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_smart_base",
"textures": {
"base": "appliedenergistics2:parts/cable/smart/blue"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_smart_base",
"textures": {
"base": "appliedenergistics2:parts/cable/smart/brown"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_smart_base",
"textures": {
"base": "appliedenergistics2:parts/cable/smart/cyan"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_smart_base",
"textures": {
"base": "appliedenergistics2:parts/cable/smart/gray"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_smart_base",
"textures": {
"base": "appliedenergistics2:parts/cable/smart/green"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_smart_base",
"textures": {
"base": "appliedenergistics2:parts/cable/smart/lightblue"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_smart_base",
"textures": {
"base": "appliedenergistics2:parts/cable/smart/lightgrey"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_smart_base",
"textures": {
"base": "appliedenergistics2:parts/cable/smart/lime"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_smart_base",
"textures": {
"base": "appliedenergistics2:parts/cable/smart/magenta"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_smart_base",
"textures": {
"base": "appliedenergistics2:parts/cable/smart/orange"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_smart_base",
"textures": {
"base": "appliedenergistics2:parts/cable/smart/pink"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_smart_base",
"textures": {
"base": "appliedenergistics2:parts/cable/smart/purple"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_smart_base",
"textures": {
"base": "appliedenergistics2:parts/cable/smart/red"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_smart_base",
"textures": {
"base": "appliedenergistics2:parts/cable/smart/transparent"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_smart_base",
"textures": {
"base": "appliedenergistics2:parts/cable/smart/white"
}
}

View File

@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/cable_smart_base",
"textures": {
"base": "appliedenergistics2:parts/cable/smart/yellow"
}
}