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
@@ -21,15 +21,16 @@ package appeng.block;
import java.util.EnumSet; import java.util.EnumSet;
import com.google.common.base.Optional;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockStairs; import net.minecraft.block.BlockStairs;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
import appeng.core.features.IAEFeature; import appeng.core.features.IAEFeature;
import appeng.core.features.IFeatureHandler; import appeng.core.features.IFeatureHandler;
import appeng.core.features.StairBlockFeatureHandler; import appeng.core.features.StairBlockFeatureHandler;
import com.google.common.base.Optional;
public abstract class AEBaseStairBlock extends BlockStairs implements IAEFeature public abstract class AEBaseStairBlock extends BlockStairs implements IAEFeature
{ {
@@ -22,11 +22,12 @@ package appeng.block.stair;
import java.util.EnumSet; import java.util.EnumSet;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import appeng.block.AEBaseStairBlock; import appeng.block.AEBaseStairBlock;
import appeng.core.features.AEFeature; import appeng.core.features.AEFeature;
public class BlockStairCommon extends AEBaseStairBlock public final class BlockStairCommon extends AEBaseStairBlock
{ {
public BlockStairCommon( Block material, String type ) public BlockStairCommon( Block material, String type )
{ {
@@ -123,8 +123,8 @@ public class ClientHelper extends ServerHelper
@Override @Override
public void init() public void init()
{ {
Item fluixItem = GameRegistry.findItem( "appliedenergistics2", "BlockFluix" ); Item fluixItem = GameRegistry.findItem( "appliedenergistics2", "fluix" );
ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation( "appliedenergistics2:BlockFluix", "inventory" ); ModelResourceLocation itemModelResourceLocation = new ModelResourceLocation( "appliedenergistics2:fluix", "inventory" );
final int DEFAULT_ITEM_SUBTYPE = 0; final int DEFAULT_ITEM_SUBTYPE = 0;
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( fluixItem, DEFAULT_ITEM_SUBTYPE, itemModelResourceLocation ); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( fluixItem, DEFAULT_ITEM_SUBTYPE, itemModelResourceLocation );
} }
@@ -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();
}
}
@@ -19,6 +19,8 @@
package appeng.core.api.definitions; package appeng.core.api.definitions;
import net.minecraft.block.Block;
import appeng.api.definitions.IBlockDefinition; import appeng.api.definitions.IBlockDefinition;
import appeng.api.definitions.IBlocks; import appeng.api.definitions.IBlocks;
import appeng.api.definitions.ITileDefinition; import appeng.api.definitions.ITileDefinition;
@@ -239,10 +241,13 @@ public final class ApiBlocks implements IBlocks
this.cubeGenerator = constructor.registerBlockDefinition( new BlockCubeGenerator() ); 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() ) for( Block block : definition.maybeBlock().asSet() )
return constructor.registerBlockDefinition( new BlockStairCommon( block.maybeBlock().get(), name )); {
return constructor.registerBlockDefinition( new BlockStairCommon( block, name ) );
}
return null; return null;
} }
@@ -675,5 +680,4 @@ public final class ApiBlocks implements IBlocks
{ {
return this.cubeGenerator; return this.cubeGenerator;
} }
} }
@@ -1,44 +1,44 @@
{ {
"variants": { "variants": {
"facing=east,half=bottom,shape=straight": { "model": "stair.fluix" }, "facing=east,half=bottom,shape=straight": { "model": "appliedenergistics2:stair.fluix" },
"facing=west,half=bottom,shape=straight": { "model": "stair.fluix", "y": 180, "uvlock": true }, "facing=west,half=bottom,shape=straight": { "model": "appliedenergistics2:stair.fluix", "y": 180, "uvlock": true },
"facing=south,half=bottom,shape=straight": { "model": "stair.fluix", "y": 90, "uvlock": true }, "facing=south,half=bottom,shape=straight": { "model": "appliedenergistics2:stair.fluix", "y": 90, "uvlock": true },
"facing=north,half=bottom,shape=straight": { "model": "stair.fluix", "y": 270, "uvlock": true }, "facing=north,half=bottom,shape=straight": { "model": "appliedenergistics2:stair.fluix", "y": 270, "uvlock": true },
"facing=east,half=bottom,shape=outer_right": { "model": "stair.fluix.outer" }, "facing=east,half=bottom,shape=outer_right": { "model": "appliedenergistics2:stair.fluix.outer" },
"facing=west,half=bottom,shape=outer_right": { "model": "stair.fluix.outer", "y": 180, "uvlock": true }, "facing=west,half=bottom,shape=outer_right": { "model": "appliedenergistics2:stair.fluix.outer", "y": 180, "uvlock": true },
"facing=south,half=bottom,shape=outer_right": { "model": "stair.fluix.outer", "y": 90, "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": "stair.fluix.outer", "y": 270, "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": "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": "stair.fluix.outer", "y": 90, "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": "stair.fluix.outer" }, "facing=south,half=bottom,shape=outer_left": { "model": "appliedenergistics2:stair.fluix.outer" },
"facing=north,half=bottom,shape=outer_left": { "model": "stair.fluix.outer", "y": 180, "uvlock": true }, "facing=north,half=bottom,shape=outer_left": { "model": "appliedenergistics2:stair.fluix.outer", "y": 180, "uvlock": true },
"facing=east,half=bottom,shape=inner_right": { "model": "stair.fluix.inner" }, "facing=east,half=bottom,shape=inner_right": { "model": "appliedenergistics2:stair.fluix.inner" },
"facing=west,half=bottom,shape=inner_right": { "model": "stair.fluix.inner", "y": 180, "uvlock": true }, "facing=west,half=bottom,shape=inner_right": { "model": "appliedenergistics2:stair.fluix.inner", "y": 180, "uvlock": true },
"facing=south,half=bottom,shape=inner_right": { "model": "stair.fluix.inner", "y": 90, "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": "stair.fluix.inner", "y": 270, "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": "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": "stair.fluix.inner", "y": 90, "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": "stair.fluix.inner" }, "facing=south,half=bottom,shape=inner_left": { "model": "appliedenergistics2:stair.fluix.inner" },
"facing=north,half=bottom,shape=inner_left": { "model": "stair.fluix.inner", "y": 180, "uvlock": true }, "facing=north,half=bottom,shape=inner_left": { "model": "appliedenergistics2:stair.fluix.inner", "y": 180, "uvlock": true },
"facing=east,half=top,shape=straight": { "model": "stair.fluix", "x": 180, "uvlock": true }, "facing=east,half=top,shape=straight": { "model": "appliedenergistics2:stair.fluix", "x": 180, "uvlock": true },
"facing=west,half=top,shape=straight": { "model": "stair.fluix", "x": 180, "y": 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": "stair.fluix", "x": 180, "y": 90, "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": "stair.fluix", "x": 180, "y": 270, "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": "stair.fluix.outer", "x": 180, "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": "stair.fluix.outer", "x": 180, "y": 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": "stair.fluix.outer", "x": 180, "y": 90, "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": "stair.fluix.outer", "x": 180, "y": 270, "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": "stair.fluix.outer", "x": 180, "y": 90, "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": "stair.fluix.outer", "x": 180, "y": 270, "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": "stair.fluix.outer", "x": 180, "y": 180, "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": "stair.fluix.outer", "x": 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": "stair.fluix.inner", "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": "stair.fluix.inner", "x": 180, "y": 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": "stair.fluix.inner", "x": 180, "y": 90, "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": "stair.fluix.inner", "x": 180, "y": 270, "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": "stair.fluix.inner", "x": 180, "y": 90, "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": "stair.fluix.inner", "x": 180, "y": 270, "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": "stair.fluix.inner", "x": 180, "y": 180, "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": "stair.fluix.inner", "x": 180, "uvlock": true } "facing=north,half=top,shape=inner_left": { "model": "appliedenergistics2:stair.fluix.inner", "x": 180, "uvlock": true }
} }
} }
@@ -1,8 +1,8 @@
{ {
"parent": "block/inner_stairs", "parent": "block/inner_stairs",
"textures": { "textures": {
"bottom": "appliedenergistics2:blocks/BlockFluix", "bottom": "appliedenergistics2:blocks/fluix",
"top": "appliedenergistics2:blocks/BlockFluix", "top": "appliedenergistics2:blocks/fluix",
"side": "appliedenergistics2:blocks/BlockFluix" "side": "appliedenergistics2:blocks/fluix"
} }
} }
@@ -1,8 +1,8 @@
{ {
"parent": "block/stairs", "parent": "block/stairs",
"textures": { "textures": {
"bottom": "appliedenergistics2:blocks/BlockFluix", "bottom": "appliedenergistics2:blocks/fluix",
"top": "appliedenergistics2:blocks/BlockFluix", "top": "appliedenergistics2:blocks/fluix",
"side": "appliedenergistics2:blocks/BlockFluix" "side": "appliedenergistics2:blocks/fluix"
} }
} }
@@ -1,8 +1,8 @@
{ {
"parent": "block/outer_stairs", "parent": "block/outer_stairs",
"textures": { "textures": {
"bottom": "appliedenergistics2:blocks/BlockFluix", "bottom": "appliedenergistics2:blocks/fluix",
"top": "appliedenergistics2:blocks/BlockFluix", "top": "appliedenergistics2:blocks/fluix",
"side": "appliedenergistics2:blocks/BlockFluix" "side": "appliedenergistics2:blocks/fluix"
} }
} }
@@ -1,5 +1,5 @@
{ {
"parent": "block/stair.fluix", "parent": "appliedenergistics2:block/stair.fluix",
"display": { "display": {
"thirdperson": { "thirdperson": {
"rotation": [ 10, -45, 170 ], "rotation": [ 10, -45, 170 ],