Fixed stair rendering, still missing textures and itemblock for some reason

This commit is contained in:
thatsIch 2015-06-26 22:44:47 +02:00
parent 4e863e7d90
commit e21dab14e5
10 changed files with 83 additions and 147 deletions

View File

@ -21,15 +21,16 @@ package appeng.block;
import java.util.EnumSet;
import com.google.common.base.Optional;
import net.minecraft.block.Block;
import net.minecraft.block.BlockStairs;
import appeng.core.features.AEFeature;
import appeng.core.features.IAEFeature;
import appeng.core.features.IFeatureHandler;
import appeng.core.features.StairBlockFeatureHandler;
import com.google.common.base.Optional;
public abstract class AEBaseStairBlock extends BlockStairs implements IAEFeature
{

View File

@ -22,11 +22,12 @@ package appeng.block.stair;
import java.util.EnumSet;
import net.minecraft.block.Block;
import appeng.block.AEBaseStairBlock;
import appeng.core.features.AEFeature;
public class BlockStairCommon extends AEBaseStairBlock
public final class BlockStairCommon extends AEBaseStairBlock
{
public BlockStairCommon( Block material, String type )
{

View File

@ -123,8 +123,8 @@ public class ClientHelper extends ServerHelper
@Override
public void init()
{
Item fluixItem = GameRegistry.findItem( "appliedenergistics2", "BlockFluix" );
ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation( "appliedenergistics2:BlockFluix", "inventory" );
Item fluixItem = GameRegistry.findItem( "appliedenergistics2", "fluix" );
ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation( "appliedenergistics2:fluix", "inventory" );
final int DEFAULT_ITEM_SUBTYPE = 0;
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( fluixItem, DEFAULT_ITEM_SUBTYPE, itemModelResourceLocation );
}

View File

@ -1,70 +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.client.render;
import net.minecraft.item.ItemStack;
import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
public class ItemRenderer implements IItemRenderer
{
public static final ItemRenderer INSTANCE = new ItemRenderer();
@Override
public boolean handleRenderType( ItemStack item, ItemRenderType type )
{
return true;
}
@Override
public boolean shouldUseRenderHelper( ItemRenderType type, ItemStack item, ItemRendererHelper helper )
{
return true;
}
@Override
public void renderItem( ItemRenderType type, ItemStack item, Object... data )
{
GL11.glPushMatrix();
GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS );
GL11.glEnable( GL11.GL_ALPHA_TEST );
GL11.glEnable( GL11.GL_DEPTH_TEST );
GL11.glEnable( GL11.GL_BLEND );
GL11.glBlendFunc( GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA );
GL11.glColor4f( 1.0f, 1.0f, 1.0f, 1.0f );
if( type == ItemRenderType.ENTITY )
{
GL11.glTranslatef( -0.5f, -0.5f, -0.5f );
}
if( type == ItemRenderType.INVENTORY )
{
GL11.glTranslatef( 0.0f, -0.1f, 0.0f );
}
WorldRender.INSTANCE.renderItemBlock( item, type, data );
GL11.glPopAttrib();
GL11.glPopMatrix();
}
}

View File

@ -19,6 +19,8 @@
package appeng.core.api.definitions;
import net.minecraft.block.Block;
import appeng.api.definitions.IBlockDefinition;
import appeng.api.definitions.IBlocks;
import appeng.api.definitions.ITileDefinition;
@ -173,8 +175,8 @@ public final class ApiBlocks implements IBlocks
this.skyStone_block = constructor.registerBlockDefinition( new BlockSkyStone( SkystoneType.block ) );
this.skyStone_brick = constructor.registerBlockDefinition( new BlockSkyStone( SkystoneType.brick ) );
this.skyStone_smallbrick = constructor.registerBlockDefinition( new BlockSkyStone( SkystoneType.smallbrick ) );
this.skyChest = constructor.registerBlockDefinition( new BlockSkyChest(SkyChestType.STONE) );
this.skyChestBlock = constructor.registerBlockDefinition( new BlockSkyChest(SkyChestType.BLOCK) );
this.skyChest = constructor.registerBlockDefinition( new BlockSkyChest( SkyChestType.STONE ) );
this.skyChestBlock = constructor.registerBlockDefinition( new BlockSkyChest( SkyChestType.BLOCK ) );
this.skyCompass = constructor.registerBlockDefinition( new BlockSkyCompass() );
this.grindStone = constructor.registerTileDefinition( new BlockGrinder() );
this.crankHandle = constructor.registerTileDefinition( new BlockCrank() );
@ -201,25 +203,25 @@ public final class ApiBlocks implements IBlocks
this.energyCell = constructor.registerTileDefinition( new BlockEnergyCell() );
this.energyCellDense = constructor.registerTileDefinition( new BlockDenseEnergyCell() );
this.energyCellCreative = constructor.registerTileDefinition( new BlockCreativeEnergyCell() );
this.craftingUnit = constructor.registerTileDefinition( new BlockCraftingUnit(CraftingUnitType.UNIT) );
this.craftingAccelerator = constructor.registerTileDefinition( new BlockCraftingUnit(CraftingUnitType.ACCELERATOR) );
this.craftingStorage1k = constructor.registerTileDefinition( new BlockCraftingStorage(CraftingUnitType.STORAGE_1K) );
this.craftingStorage4k = constructor.registerTileDefinition( new BlockCraftingStorage(CraftingUnitType.STORAGE_4K) );
this.craftingStorage16k = constructor.registerTileDefinition( new BlockCraftingStorage(CraftingUnitType.STORAGE_16K) );
this.craftingStorage64k = constructor.registerTileDefinition( new BlockCraftingStorage(CraftingUnitType.STORAGE_64K) );
this.craftingUnit = constructor.registerTileDefinition( new BlockCraftingUnit( CraftingUnitType.UNIT ) );
this.craftingAccelerator = constructor.registerTileDefinition( new BlockCraftingUnit( CraftingUnitType.ACCELERATOR ) );
this.craftingStorage1k = constructor.registerTileDefinition( new BlockCraftingStorage( CraftingUnitType.STORAGE_1K ) );
this.craftingStorage4k = constructor.registerTileDefinition( new BlockCraftingStorage( CraftingUnitType.STORAGE_4K ) );
this.craftingStorage16k = constructor.registerTileDefinition( new BlockCraftingStorage( CraftingUnitType.STORAGE_16K ) );
this.craftingStorage64k = constructor.registerTileDefinition( new BlockCraftingStorage( CraftingUnitType.STORAGE_64K ) );
this.craftingMonitor = constructor.registerTileDefinition( new BlockCraftingMonitor() );
this.molecularAssembler = constructor.registerTileDefinition( new BlockMolecularAssembler() );
this.lightDetector = constructor.registerTileDefinition( new BlockLightDetector() );
this.paint = constructor.registerTileDefinition( new BlockPaint() );
this.skyStoneStair = makeStairs( constructor,skyStone_stone, "skystone" ) ;
this.skyStoneBlockStair = makeStairs( constructor,skyStone_block, "skystone.block" ) ;
this.skyStoneBrickStair = makeStairs( constructor,skyStone_brick, "skystone.brick" ) ;
this.skyStoneSmallBrickStair = makeStairs( constructor, skyStone_smallbrick, "skystone.brick.small" ) ;
this.fluixStair = makeStairs( constructor, fluix, "fluix" ) ;
this.quartzStair = makeStairs( constructor,quartz, "quartz.certus" ) ;
this.chiseledQuartzStair = makeStairs( constructor, quartzChiseled, "quartz.certus.chiseled" ) ;
this.quartzPillarStair = makeStairs( constructor, quartzPillar, "quartz.certus.pillar" ) ;
this.skyStoneStair = makeStairs( constructor, skyStone_stone, "skystone" );
this.skyStoneBlockStair = makeStairs( constructor, skyStone_block, "skystone.block" );
this.skyStoneBrickStair = makeStairs( constructor, skyStone_brick, "skystone.brick" );
this.skyStoneSmallBrickStair = makeStairs( constructor, skyStone_smallbrick, "skystone.brick.small" );
this.fluixStair = makeStairs( constructor, fluix, "fluix" );
this.quartzStair = makeStairs( constructor, quartz, "quartz.certus" );
this.chiseledQuartzStair = makeStairs( constructor, quartzChiseled, "quartz.certus.chiseled" );
this.quartzPillarStair = makeStairs( constructor, quartzPillar, "quartz.certus.pillar" );
// TODO Re-Add Slabs...
/*
@ -232,17 +234,20 @@ public final class ApiBlocks implements IBlocks
this.chiseledQuartzSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( chiseledQuartz, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "ChiseledQuartzSlabBlock" ) );;
this.quartzPillarSlab = constructor.registerBlockDefinition( new AEBaseSlabBlock( quartzPillar, EnumSet.of(AEFeature.DecorativeQuartzBlocks), false, "QuartzPillarSlabBlock" ) )
*/
this.itemGen = constructor.registerBlockDefinition( new BlockItemGen() );
this.chunkLoader = constructor.registerBlockDefinition( new BlockChunkloader() );
this.phantomNode = constructor.registerBlockDefinition( new BlockPhantomNode() );
this.cubeGenerator = constructor.registerBlockDefinition( new BlockCubeGenerator() );
}
private IBlockDefinition makeStairs(DefinitionConstructor constructor, IBlockDefinition block, String name )
private IBlockDefinition makeStairs( DefinitionConstructor constructor, IBlockDefinition definition, String name )
{
if ( block.maybeBlock().isPresent() )
return constructor.registerBlockDefinition( new BlockStairCommon( block.maybeBlock().get(), name ));
for( Block block : definition.maybeBlock().asSet() )
{
return constructor.registerBlockDefinition( new BlockStairCommon( block, name ) );
}
return null;
}
@ -445,7 +450,7 @@ public final class ApiBlocks implements IBlocks
return this.quartzPillarSlab;
}
*/
@Override
public ITileDefinition grindStone()
{
@ -675,5 +680,4 @@ public final class ApiBlocks implements IBlocks
{
return this.cubeGenerator;
}
}

View File

@ -1,44 +1,44 @@
{
"variants": {
"facing=east,half=bottom,shape=straight": { "model": "stair.fluix" },
"facing=west,half=bottom,shape=straight": { "model": "stair.fluix", "y": 180, "uvlock": true },
"facing=south,half=bottom,shape=straight": { "model": "stair.fluix", "y": 90, "uvlock": true },
"facing=north,half=bottom,shape=straight": { "model": "stair.fluix", "y": 270, "uvlock": true },
"facing=east,half=bottom,shape=outer_right": { "model": "stair.fluix.outer" },
"facing=west,half=bottom,shape=outer_right": { "model": "stair.fluix.outer", "y": 180, "uvlock": true },
"facing=south,half=bottom,shape=outer_right": { "model": "stair.fluix.outer", "y": 90, "uvlock": true },
"facing=north,half=bottom,shape=outer_right": { "model": "stair.fluix.outer", "y": 270, "uvlock": true },
"facing=east,half=bottom,shape=outer_left": { "model": "stair.fluix.outer", "y": 270, "uvlock": true },
"facing=west,half=bottom,shape=outer_left": { "model": "stair.fluix.outer", "y": 90, "uvlock": true },
"facing=south,half=bottom,shape=outer_left": { "model": "stair.fluix.outer" },
"facing=north,half=bottom,shape=outer_left": { "model": "stair.fluix.outer", "y": 180, "uvlock": true },
"facing=east,half=bottom,shape=inner_right": { "model": "stair.fluix.inner" },
"facing=west,half=bottom,shape=inner_right": { "model": "stair.fluix.inner", "y": 180, "uvlock": true },
"facing=south,half=bottom,shape=inner_right": { "model": "stair.fluix.inner", "y": 90, "uvlock": true },
"facing=north,half=bottom,shape=inner_right": { "model": "stair.fluix.inner", "y": 270, "uvlock": true },
"facing=east,half=bottom,shape=inner_left": { "model": "stair.fluix.inner", "y": 270, "uvlock": true },
"facing=west,half=bottom,shape=inner_left": { "model": "stair.fluix.inner", "y": 90, "uvlock": true },
"facing=south,half=bottom,shape=inner_left": { "model": "stair.fluix.inner" },
"facing=north,half=bottom,shape=inner_left": { "model": "stair.fluix.inner", "y": 180, "uvlock": true },
"facing=east,half=top,shape=straight": { "model": "stair.fluix", "x": 180, "uvlock": true },
"facing=west,half=top,shape=straight": { "model": "stair.fluix", "x": 180, "y": 180, "uvlock": true },
"facing=south,half=top,shape=straight": { "model": "stair.fluix", "x": 180, "y": 90, "uvlock": true },
"facing=north,half=top,shape=straight": { "model": "stair.fluix", "x": 180, "y": 270, "uvlock": true },
"facing=east,half=top,shape=outer_right": { "model": "stair.fluix.outer", "x": 180, "uvlock": true },
"facing=west,half=top,shape=outer_right": { "model": "stair.fluix.outer", "x": 180, "y": 180, "uvlock": true },
"facing=south,half=top,shape=outer_right": { "model": "stair.fluix.outer", "x": 180, "y": 90, "uvlock": true },
"facing=north,half=top,shape=outer_right": { "model": "stair.fluix.outer", "x": 180, "y": 270, "uvlock": true },
"facing=east,half=top,shape=outer_left": { "model": "stair.fluix.outer", "x": 180, "y": 90, "uvlock": true },
"facing=west,half=top,shape=outer_left": { "model": "stair.fluix.outer", "x": 180, "y": 270, "uvlock": true },
"facing=south,half=top,shape=outer_left": { "model": "stair.fluix.outer", "x": 180, "y": 180, "uvlock": true },
"facing=north,half=top,shape=outer_left": { "model": "stair.fluix.outer", "x": 180, "uvlock": true },
"facing=east,half=top,shape=inner_right": { "model": "stair.fluix.inner", "x": 180, "uvlock": true },
"facing=west,half=top,shape=inner_right": { "model": "stair.fluix.inner", "x": 180, "y": 180, "uvlock": true },
"facing=south,half=top,shape=inner_right": { "model": "stair.fluix.inner", "x": 180, "y": 90, "uvlock": true },
"facing=north,half=top,shape=inner_right": { "model": "stair.fluix.inner", "x": 180, "y": 270, "uvlock": true },
"facing=east,half=top,shape=inner_left": { "model": "stair.fluix.inner", "x": 180, "y": 90, "uvlock": true },
"facing=west,half=top,shape=inner_left": { "model": "stair.fluix.inner", "x": 180, "y": 270, "uvlock": true },
"facing=south,half=top,shape=inner_left": { "model": "stair.fluix.inner", "x": 180, "y": 180, "uvlock": true },
"facing=north,half=top,shape=inner_left": { "model": "stair.fluix.inner", "x": 180, "uvlock": true }
"facing=east,half=bottom,shape=straight": { "model": "appliedenergistics2:stair.fluix" },
"facing=west,half=bottom,shape=straight": { "model": "appliedenergistics2:stair.fluix", "y": 180, "uvlock": true },
"facing=south,half=bottom,shape=straight": { "model": "appliedenergistics2:stair.fluix", "y": 90, "uvlock": true },
"facing=north,half=bottom,shape=straight": { "model": "appliedenergistics2:stair.fluix", "y": 270, "uvlock": true },
"facing=east,half=bottom,shape=outer_right": { "model": "appliedenergistics2:stair.fluix.outer" },
"facing=west,half=bottom,shape=outer_right": { "model": "appliedenergistics2:stair.fluix.outer", "y": 180, "uvlock": true },
"facing=south,half=bottom,shape=outer_right": { "model": "appliedenergistics2:stair.fluix.outer", "y": 90, "uvlock": true },
"facing=north,half=bottom,shape=outer_right": { "model": "appliedenergistics2:stair.fluix.outer", "y": 270, "uvlock": true },
"facing=east,half=bottom,shape=outer_left": { "model": "appliedenergistics2:stair.fluix.outer", "y": 270, "uvlock": true },
"facing=west,half=bottom,shape=outer_left": { "model": "appliedenergistics2:stair.fluix.outer", "y": 90, "uvlock": true },
"facing=south,half=bottom,shape=outer_left": { "model": "appliedenergistics2:stair.fluix.outer" },
"facing=north,half=bottom,shape=outer_left": { "model": "appliedenergistics2:stair.fluix.outer", "y": 180, "uvlock": true },
"facing=east,half=bottom,shape=inner_right": { "model": "appliedenergistics2:stair.fluix.inner" },
"facing=west,half=bottom,shape=inner_right": { "model": "appliedenergistics2:stair.fluix.inner", "y": 180, "uvlock": true },
"facing=south,half=bottom,shape=inner_right": { "model": "appliedenergistics2:stair.fluix.inner", "y": 90, "uvlock": true },
"facing=north,half=bottom,shape=inner_right": { "model": "appliedenergistics2:stair.fluix.inner", "y": 270, "uvlock": true },
"facing=east,half=bottom,shape=inner_left": { "model": "appliedenergistics2:stair.fluix.inner", "y": 270, "uvlock": true },
"facing=west,half=bottom,shape=inner_left": { "model": "appliedenergistics2:stair.fluix.inner", "y": 90, "uvlock": true },
"facing=south,half=bottom,shape=inner_left": { "model": "appliedenergistics2:stair.fluix.inner" },
"facing=north,half=bottom,shape=inner_left": { "model": "appliedenergistics2:stair.fluix.inner", "y": 180, "uvlock": true },
"facing=east,half=top,shape=straight": { "model": "appliedenergistics2:stair.fluix", "x": 180, "uvlock": true },
"facing=west,half=top,shape=straight": { "model": "appliedenergistics2:stair.fluix", "x": 180, "y": 180, "uvlock": true },
"facing=south,half=top,shape=straight": { "model": "appliedenergistics2:stair.fluix", "x": 180, "y": 90, "uvlock": true },
"facing=north,half=top,shape=straight": { "model": "appliedenergistics2:stair.fluix", "x": 180, "y": 270, "uvlock": true },
"facing=east,half=top,shape=outer_right": { "model": "appliedenergistics2:stair.fluix.outer", "x": 180, "uvlock": true },
"facing=west,half=top,shape=outer_right": { "model": "appliedenergistics2:stair.fluix.outer", "x": 180, "y": 180, "uvlock": true },
"facing=south,half=top,shape=outer_right": { "model": "appliedenergistics2:stair.fluix.outer", "x": 180, "y": 90, "uvlock": true },
"facing=north,half=top,shape=outer_right": { "model": "appliedenergistics2:stair.fluix.outer", "x": 180, "y": 270, "uvlock": true },
"facing=east,half=top,shape=outer_left": { "model": "appliedenergistics2:stair.fluix.outer", "x": 180, "y": 90, "uvlock": true },
"facing=west,half=top,shape=outer_left": { "model": "appliedenergistics2:stair.fluix.outer", "x": 180, "y": 270, "uvlock": true },
"facing=south,half=top,shape=outer_left": { "model": "appliedenergistics2:stair.fluix.outer", "x": 180, "y": 180, "uvlock": true },
"facing=north,half=top,shape=outer_left": { "model": "appliedenergistics2:stair.fluix.outer", "x": 180, "uvlock": true },
"facing=east,half=top,shape=inner_right": { "model": "appliedenergistics2:stair.fluix.inner", "x": 180, "uvlock": true },
"facing=west,half=top,shape=inner_right": { "model": "appliedenergistics2:stair.fluix.inner", "x": 180, "y": 180, "uvlock": true },
"facing=south,half=top,shape=inner_right": { "model": "appliedenergistics2:stair.fluix.inner", "x": 180, "y": 90, "uvlock": true },
"facing=north,half=top,shape=inner_right": { "model": "appliedenergistics2:stair.fluix.inner", "x": 180, "y": 270, "uvlock": true },
"facing=east,half=top,shape=inner_left": { "model": "appliedenergistics2:stair.fluix.inner", "x": 180, "y": 90, "uvlock": true },
"facing=west,half=top,shape=inner_left": { "model": "appliedenergistics2:stair.fluix.inner", "x": 180, "y": 270, "uvlock": true },
"facing=south,half=top,shape=inner_left": { "model": "appliedenergistics2:stair.fluix.inner", "x": 180, "y": 180, "uvlock": true },
"facing=north,half=top,shape=inner_left": { "model": "appliedenergistics2:stair.fluix.inner", "x": 180, "uvlock": true }
}
}

View File

@ -1,8 +1,8 @@
{
"parent": "block/inner_stairs",
"textures": {
"bottom": "appliedenergistics2:blocks/BlockFluix",
"top": "appliedenergistics2:blocks/BlockFluix",
"side": "appliedenergistics2:blocks/BlockFluix"
"bottom": "appliedenergistics2:blocks/fluix",
"top": "appliedenergistics2:blocks/fluix",
"side": "appliedenergistics2:blocks/fluix"
}
}

View File

@ -1,8 +1,8 @@
{
"parent": "block/stairs",
"textures": {
"bottom": "appliedenergistics2:blocks/BlockFluix",
"top": "appliedenergistics2:blocks/BlockFluix",
"side": "appliedenergistics2:blocks/BlockFluix"
"bottom": "appliedenergistics2:blocks/fluix",
"top": "appliedenergistics2:blocks/fluix",
"side": "appliedenergistics2:blocks/fluix"
}
}

View File

@ -1,8 +1,8 @@
{
"parent": "block/outer_stairs",
"textures": {
"bottom": "appliedenergistics2:blocks/BlockFluix",
"top": "appliedenergistics2:blocks/BlockFluix",
"side": "appliedenergistics2:blocks/BlockFluix"
"bottom": "appliedenergistics2:blocks/fluix",
"top": "appliedenergistics2:blocks/fluix",
"side": "appliedenergistics2:blocks/fluix"
}
}

View File

@ -1,5 +1,5 @@
{
"parent": "block/stair.fluix",
"parent": "appliedenergistics2:block/stair.fluix",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],