Hevea / bamboo fence gates
This commit is contained in:
parent
c1635ea943
commit
b9ea3aaebd
29 changed files with 344 additions and 79 deletions
2
TODO.txt
2
TODO.txt
|
@ -9,7 +9,7 @@ deco No Stone - Smooth + stairs + slabs
|
||||||
Limestone
|
Limestone
|
||||||
Slate
|
Slate
|
||||||
Basalt
|
Basalt
|
||||||
deco No Wood - Doors + fences
|
deco No Wood - Doors
|
||||||
Hevea
|
Hevea
|
||||||
Bamboo
|
Bamboo
|
||||||
-------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -8,12 +8,13 @@ import mmm.utils.URegistry;
|
||||||
public class DFence
|
public class DFence
|
||||||
{
|
{
|
||||||
public final DFenceBlock BLOCK;
|
public final DFenceBlock BLOCK;
|
||||||
|
public final DFenceGate GATE;
|
||||||
|
|
||||||
|
|
||||||
public DFence( DWoodType woodType )
|
public DFence( DWoodType woodType )
|
||||||
{
|
{
|
||||||
this.BLOCK = new DFenceBlock( woodType );
|
URegistry.addBlock( this.BLOCK = new DFenceBlock( woodType ) );
|
||||||
URegistry.addBlock( this.BLOCK );
|
URegistry.addBlock( this.GATE = new DFenceGate( woodType ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class DFenceBlock
|
||||||
@Override
|
@Override
|
||||||
public void registerRecipes( )
|
public void registerRecipes( )
|
||||||
{
|
{
|
||||||
GameRegistry.addShapedRecipe( new ItemStack( this ) , //
|
GameRegistry.addShapedRecipe( new ItemStack( this , 3 ) , //
|
||||||
"PSP" , //
|
"PSP" , //
|
||||||
"PSP" , //
|
"PSP" , //
|
||||||
'P' , this.woodType.getPlanksBlock( ) , //
|
'P' , this.woodType.getPlanksBlock( ) , //
|
||||||
|
|
64
src/java/mmm/deco/DFenceGate.java
Normal file
64
src/java/mmm/deco/DFenceGate.java
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
package mmm.deco;
|
||||||
|
|
||||||
|
|
||||||
|
import mmm.utils.I_URecipeRegistrar;
|
||||||
|
import mmm.utils.I_UStateMapperProvider;
|
||||||
|
import mmm.utils.URegistry;
|
||||||
|
import mmm.utils.UStateMapper;
|
||||||
|
import net.minecraft.block.BlockFenceGate;
|
||||||
|
import net.minecraft.block.BlockPlanks;
|
||||||
|
import net.minecraft.block.SoundType;
|
||||||
|
import net.minecraft.block.material.MapColor;
|
||||||
|
import net.minecraft.block.state.IBlockState;
|
||||||
|
import net.minecraft.client.renderer.block.statemap.IStateMapper;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public class DFenceGate
|
||||||
|
extends BlockFenceGate
|
||||||
|
implements I_URecipeRegistrar , I_UStateMapperProvider
|
||||||
|
{
|
||||||
|
|
||||||
|
private final DWoodType woodType;
|
||||||
|
|
||||||
|
|
||||||
|
public DFenceGate( DWoodType woodType )
|
||||||
|
{
|
||||||
|
super( BlockPlanks.EnumType.OAK );
|
||||||
|
this.woodType = woodType;
|
||||||
|
this.setHardness( 2.f );
|
||||||
|
this.setResistance( 5.f );
|
||||||
|
this.setSoundType( SoundType.WOOD );
|
||||||
|
this.setHarvestLevel( "axe" , 0 );
|
||||||
|
URegistry.setIdentifiers( this , "deco" , "fence" , "gate" , woodType.getSuffix( ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MapColor getMapColor( IBlockState state )
|
||||||
|
{
|
||||||
|
return this.woodType.getMapColor( );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerRecipes( )
|
||||||
|
{
|
||||||
|
GameRegistry.addShapedRecipe( new ItemStack( this ) , //
|
||||||
|
"SPS" , //
|
||||||
|
"SPS" , //
|
||||||
|
'P' , this.woodType.getPlanksBlock( ) , //
|
||||||
|
'S' , Items.STICK );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IStateMapper getStateMapper( )
|
||||||
|
{
|
||||||
|
return UStateMapper.ignoreProperties( BlockFenceGate.POWERED );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
package mmm.food;
|
package mmm.food;
|
||||||
|
|
||||||
|
|
||||||
import mmm.utils.I_UItemModelProvider;
|
import mmm.utils.I_UItemModelProviderBasic;
|
||||||
import mmm.utils.URegistry;
|
import mmm.utils.URegistry;
|
||||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
@ -12,7 +12,7 @@ import net.minecraft.item.Item;
|
||||||
|
|
||||||
public class FMilkBucket
|
public class FMilkBucket
|
||||||
extends Item
|
extends Item
|
||||||
implements I_UItemModelProvider
|
implements I_UItemModelProviderBasic
|
||||||
{
|
{
|
||||||
|
|
||||||
public final FMilkType milkType;
|
public final FMilkType milkType;
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
package mmm.utils;
|
package mmm.utils;
|
||||||
|
|
||||||
|
|
||||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public interface I_UItemModelProvider
|
public interface I_UItemModelProvider
|
||||||
|
extends I_URequiresClientPreInit
|
||||||
{
|
{
|
||||||
|
|
||||||
public ModelResourceLocation getModelResourceLocation( );
|
// EMPTY
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
17
src/java/mmm/utils/I_UItemModelProviderBasic.java
Normal file
17
src/java/mmm/utils/I_UItemModelProviderBasic.java
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
package mmm.utils;
|
||||||
|
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public interface I_UItemModelProviderBasic
|
||||||
|
extends I_UItemModelProvider
|
||||||
|
{
|
||||||
|
|
||||||
|
@SideOnly( Side.CLIENT )
|
||||||
|
public ModelResourceLocation getModelResourceLocation( );
|
||||||
|
|
||||||
|
}
|
20
src/java/mmm/utils/I_UItemWithVariants.java
Normal file
20
src/java/mmm/utils/I_UItemWithVariants.java
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
package mmm.utils;
|
||||||
|
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public interface I_UItemWithVariants
|
||||||
|
extends I_UItemModelProvider
|
||||||
|
{
|
||||||
|
|
||||||
|
public int getVariantsCount( );
|
||||||
|
|
||||||
|
|
||||||
|
@SideOnly( Side.CLIENT )
|
||||||
|
public ModelResourceLocation getModelResourceLocation( int variant );
|
||||||
|
|
||||||
|
}
|
7
src/java/mmm/utils/I_URequiresClientInit.java
Normal file
7
src/java/mmm/utils/I_URequiresClientInit.java
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
package mmm.utils;
|
||||||
|
|
||||||
|
|
||||||
|
public interface I_URequiresClientInit
|
||||||
|
{
|
||||||
|
// EMPTY
|
||||||
|
}
|
7
src/java/mmm/utils/I_URequiresClientPreInit.java
Normal file
7
src/java/mmm/utils/I_URequiresClientPreInit.java
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
package mmm.utils;
|
||||||
|
|
||||||
|
|
||||||
|
public interface I_URequiresClientPreInit
|
||||||
|
{
|
||||||
|
// EMPTY
|
||||||
|
}
|
17
src/java/mmm/utils/I_UStateMapperProvider.java
Normal file
17
src/java/mmm/utils/I_UStateMapperProvider.java
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
package mmm.utils;
|
||||||
|
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.block.statemap.IStateMapper;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public interface I_UStateMapperProvider
|
||||||
|
extends I_URequiresClientPreInit
|
||||||
|
{
|
||||||
|
|
||||||
|
@SideOnly( Side.CLIENT )
|
||||||
|
IStateMapper getStateMapper( );
|
||||||
|
|
||||||
|
}
|
|
@ -9,6 +9,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
/** For blocks that need to register a tint */
|
/** For blocks that need to register a tint */
|
||||||
public interface I_UTintedBlock
|
public interface I_UTintedBlock
|
||||||
|
extends I_URequiresClientInit
|
||||||
{
|
{
|
||||||
|
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
|
|
|
@ -12,6 +12,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
* to be tinted.
|
* to be tinted.
|
||||||
*/
|
*/
|
||||||
public interface I_UTintedItem
|
public interface I_UTintedItem
|
||||||
|
extends I_URequiresClientInit
|
||||||
{
|
{
|
||||||
|
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
|
|
|
@ -8,12 +8,12 @@ import net.minecraft.item.EnumDyeColor;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraftforge.client.model.ModelLoader;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class UBlockItemWithVariants
|
public class UBlockItemWithVariants
|
||||||
extends ItemBlock
|
extends ItemBlock
|
||||||
|
implements I_UItemWithVariants
|
||||||
{
|
{
|
||||||
private final String[] baseName;
|
private final String[] baseName;
|
||||||
private String[] variants;
|
private String[] variants;
|
||||||
|
@ -66,16 +66,8 @@ public class UBlockItemWithVariants
|
||||||
sbRegPath.append( this.baseName[ i ] );
|
sbRegPath.append( this.baseName[ i ] );
|
||||||
}
|
}
|
||||||
this.setRegistryName( Mmm.ID , sbRegPath.toString( ) );
|
this.setRegistryName( Mmm.ID , sbRegPath.toString( ) );
|
||||||
URegistry.addItem( this , false );
|
URegistry.addItem( this );
|
||||||
|
|
||||||
final int len = sbRegPath.length( );
|
|
||||||
final int nVariants = this.variants.length;
|
|
||||||
for ( int i = 0 ; i < nVariants ; i++ ) {
|
|
||||||
sbRegPath.setLength( len );
|
|
||||||
sbRegPath.append( '/' ).append( this.variants[ i ] );
|
|
||||||
ModelLoader.setCustomModelResourceLocation( this , i , new ModelResourceLocation( //
|
|
||||||
new ResourceLocation( Mmm.ID , sbRegPath.toString( ) ) , "inventory" ) );
|
|
||||||
}
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,4 +86,21 @@ public class UBlockItemWithVariants
|
||||||
+ EnumDyeColor.byMetadata( stack.getMetadata( ) ).getUnlocalizedName( );
|
+ EnumDyeColor.byMetadata( stack.getMetadata( ) ).getUnlocalizedName( );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getVariantsCount( )
|
||||||
|
{
|
||||||
|
return this.variants.length;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModelResourceLocation getModelResourceLocation( final int variant )
|
||||||
|
{
|
||||||
|
return new ModelResourceLocation( //
|
||||||
|
new ResourceLocation( Mmm.ID ,
|
||||||
|
this.getRegistryName( ).getResourcePath( ) + "/" + this.variants[ variant ] ) , //
|
||||||
|
"inventory" );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import mmm.Mmm;
|
import mmm.Mmm;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
@ -54,12 +53,12 @@ public class URegistry
|
||||||
|
|
||||||
private static final HashSet< I_URecipeRegistrar > RECIPE_REGISTRARS = new HashSet<>( );
|
private static final HashSet< I_URecipeRegistrar > RECIPE_REGISTRARS = new HashSet<>( );
|
||||||
private static final HashSet< I_UOreGenerationRegistrar > ORE_GEN_REGISTRARS = new HashSet<>( );
|
private static final HashSet< I_UOreGenerationRegistrar > ORE_GEN_REGISTRARS = new HashSet<>( );
|
||||||
private static final HashMap< Item , Boolean > ITEMS = new HashMap< Item , Boolean >( );
|
private static final HashSet< Item > ITEMS = new HashSet< Item >( );
|
||||||
private static final HashSet< Block > BLOCKS = new HashSet< Block >( );
|
private static final HashSet< Block > BLOCKS = new HashSet< Block >( );
|
||||||
|
|
||||||
private static final ArrayList< Block > TINTED_BLOCKS = new ArrayList<>( );
|
private static final ArrayList< Block > BLOCKS_CLIENT_PREINIT = new ArrayList<>( );
|
||||||
private static final ArrayList< Block > TINTED_BLOCK_ITEMS = new ArrayList<>( );
|
private static final ArrayList< Block > BLOCKS_CLIENT_INIT = new ArrayList<>( );
|
||||||
private static final ArrayList< Item > TINTED_ITEMS = new ArrayList<>( );
|
private static final ArrayList< Item > ITEMS_CLIENT_INIT = new ArrayList<>( );
|
||||||
|
|
||||||
private static final HashMap< Item , Object > FUELS = new HashMap<>( );
|
private static final HashMap< Item , Object > FUELS = new HashMap<>( );
|
||||||
private static final FuelHandler FUEL_HANDLER = new FuelHandler( );
|
private static final FuelHandler FUEL_HANDLER = new FuelHandler( );
|
||||||
|
@ -102,35 +101,17 @@ public class URegistry
|
||||||
|
|
||||||
public static void addItem( final Item item )
|
public static void addItem( final Item item )
|
||||||
{
|
{
|
||||||
URegistry.addItem( item , true );
|
if ( URegistry.ITEMS.add( item ) ) {
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void addItem( final Item item , final boolean registerModel )
|
|
||||||
{
|
|
||||||
if ( URegistry.ITEMS.put( item , registerModel ) == null ) {
|
|
||||||
GameRegistry.register( item );
|
GameRegistry.register( item );
|
||||||
if ( item instanceof I_UTintedItem ) {
|
|
||||||
URegistry.TINTED_ITEMS.add( item );
|
|
||||||
}
|
|
||||||
URegistry.addRecipeRegistrar( item );
|
URegistry.addRecipeRegistrar( item );
|
||||||
|
if ( item instanceof I_URequiresClientInit ) {
|
||||||
|
URegistry.ITEMS_CLIENT_INIT.add( item );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Item addBlock( final Block block )
|
public static Item addBlock( final Block block )
|
||||||
{
|
|
||||||
return URegistry.addBlock( block , true );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static Item addBlock( final Block block , final Item blockItem )
|
|
||||||
{
|
|
||||||
return URegistry.addBlock( block , blockItem , true );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static Item addBlock( final Block block , final boolean registerItemModel )
|
|
||||||
{
|
{
|
||||||
Item item;
|
Item item;
|
||||||
if ( block instanceof I_UColoredBlock ) {
|
if ( block instanceof I_UColoredBlock ) {
|
||||||
|
@ -139,29 +120,28 @@ public class URegistry
|
||||||
item = new ItemBlock( block );
|
item = new ItemBlock( block );
|
||||||
}
|
}
|
||||||
item.setRegistryName( block.getRegistryName( ) );
|
item.setRegistryName( block.getRegistryName( ) );
|
||||||
return URegistry.addBlock( block , item , registerItemModel );
|
return URegistry.addBlock( block , item );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static Item addBlock( final Block block , final Item blockItem , final boolean registerItemModel )
|
public static Item addBlock( final Block block , final Item blockItem )
|
||||||
{
|
{
|
||||||
if ( URegistry.BLOCKS.add( block ) ) {
|
if ( URegistry.BLOCKS.add( block ) ) {
|
||||||
GameRegistry.register( block );
|
GameRegistry.register( block );
|
||||||
if ( block instanceof I_UTintedBlock ) {
|
|
||||||
URegistry.TINTED_BLOCKS.add( block );
|
|
||||||
}
|
|
||||||
if ( block instanceof I_UTintedItem ) {
|
|
||||||
URegistry.TINTED_BLOCK_ITEMS.add( block );
|
|
||||||
}
|
|
||||||
|
|
||||||
URegistry.addRecipeRegistrar( block );
|
URegistry.addRecipeRegistrar( block );
|
||||||
URegistry.addOreGenerationRegistrar( block );
|
URegistry.addOreGenerationRegistrar( block );
|
||||||
if ( block instanceof I_UTrapBlock ) {
|
if ( block instanceof I_UTrapBlock ) {
|
||||||
UTrapBlocks.INSTANCE.register( (I_UTrapBlock) block );
|
UTrapBlocks.INSTANCE.register( (I_UTrapBlock) block );
|
||||||
}
|
}
|
||||||
|
if ( block instanceof I_URequiresClientPreInit ) {
|
||||||
|
URegistry.BLOCKS_CLIENT_PREINIT.add( block );
|
||||||
|
}
|
||||||
|
if ( block instanceof I_URequiresClientInit ) {
|
||||||
|
URegistry.BLOCKS_CLIENT_INIT.add( block );
|
||||||
|
}
|
||||||
|
|
||||||
if ( blockItem != null ) {
|
if ( blockItem != null ) {
|
||||||
URegistry.addItem( blockItem , registerItemModel );
|
URegistry.addItem( blockItem );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return blockItem;
|
return blockItem;
|
||||||
|
@ -231,19 +211,34 @@ public class URegistry
|
||||||
@SideOnly( Side.CLIENT )
|
@SideOnly( Side.CLIENT )
|
||||||
public static void preInitClient( )
|
public static void preInitClient( )
|
||||||
{
|
{
|
||||||
// Register item models
|
for ( final Item item : URegistry.ITEMS ) {
|
||||||
for ( final Map.Entry< Item , Boolean > entry : URegistry.ITEMS.entrySet( ) ) {
|
// Automatic model location unless there's a provider
|
||||||
if ( !entry.getValue( ) ) {
|
if ( ! ( item instanceof I_UItemModelProvider ) ) {
|
||||||
|
final ModelResourceLocation location = new ModelResourceLocation( item.getRegistryName( ) ,
|
||||||
|
"inventory" );
|
||||||
|
ModelLoader.setCustomModelResourceLocation( item , 0 , location );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! ( item instanceof I_URequiresClientPreInit ) ) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
final Item item = entry.getKey( );
|
|
||||||
ModelResourceLocation location;
|
// Item models
|
||||||
if ( item instanceof I_UItemModelProvider ) {
|
if ( item instanceof I_UItemModelProviderBasic ) {
|
||||||
location = ( (I_UItemModelProvider) item ).getModelResourceLocation( );
|
ModelLoader.setCustomModelResourceLocation( item , 0 ,
|
||||||
} else {
|
( (I_UItemModelProviderBasic) item ).getModelResourceLocation( ) );
|
||||||
location = new ModelResourceLocation( item.getRegistryName( ) , "inventory" );
|
} else if ( item instanceof I_UItemWithVariants ) {
|
||||||
|
final I_UItemWithVariants iwv = (I_UItemWithVariants) item;
|
||||||
|
for ( int i = 0 ; i < iwv.getVariantsCount( ) ; i++ ) {
|
||||||
|
ModelLoader.setCustomModelResourceLocation( item , i , iwv.getModelResourceLocation( i ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for ( final Block block : URegistry.BLOCKS_CLIENT_PREINIT ) {
|
||||||
|
if ( block instanceof I_UStateMapperProvider ) {
|
||||||
|
ModelLoader.setCustomStateMapper( block , ( (I_UStateMapperProvider) block ).getStateMapper( ) );
|
||||||
}
|
}
|
||||||
ModelLoader.setCustomModelResourceLocation( item , 0 , location );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,19 +249,23 @@ public class URegistry
|
||||||
final BlockColors blockColors = Minecraft.getMinecraft( ).getBlockColors( );
|
final BlockColors blockColors = Minecraft.getMinecraft( ).getBlockColors( );
|
||||||
final ItemColors itemColors = Minecraft.getMinecraft( ).getItemColors( );
|
final ItemColors itemColors = Minecraft.getMinecraft( ).getItemColors( );
|
||||||
|
|
||||||
|
for ( final Block block : URegistry.BLOCKS_CLIENT_INIT ) {
|
||||||
// Register tinted blocks
|
// Register tinted blocks
|
||||||
for ( final Block tintedBlock : URegistry.TINTED_BLOCKS ) {
|
if ( block instanceof I_UTintedBlock ) {
|
||||||
blockColors.registerBlockColorHandler( ( (I_UTintedBlock) tintedBlock ).getBlockTint( ) , tintedBlock );
|
blockColors.registerBlockColorHandler( ( (I_UTintedBlock) block ).getBlockTint( ) , block );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register tinted block items
|
// Register tinted block items
|
||||||
for ( final Block tintedBlock : URegistry.TINTED_BLOCK_ITEMS ) {
|
if ( block instanceof I_UTintedItem ) {
|
||||||
itemColors.registerItemColorHandler( ( (I_UTintedItem) tintedBlock ).getItemTint( ) , tintedBlock );
|
itemColors.registerItemColorHandler( ( (I_UTintedItem) block ).getItemTint( ) , block );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for ( final Item item : URegistry.ITEMS_CLIENT_INIT ) {
|
||||||
// Register tinted items
|
// Register tinted items
|
||||||
for ( final Item tintedItem : URegistry.TINTED_ITEMS ) {
|
if ( item instanceof I_UTintedItem ) {
|
||||||
itemColors.registerItemColorHandler( ( (I_UTintedItem) tintedItem ).getItemTint( ) , tintedItem );
|
itemColors.registerItemColorHandler( ( (I_UTintedItem) item ).getItemTint( ) , item );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
22
src/java/mmm/utils/UStateMapper.java
Normal file
22
src/java/mmm/utils/UStateMapper.java
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
package mmm.utils;
|
||||||
|
|
||||||
|
|
||||||
|
import net.minecraft.block.properties.IProperty;
|
||||||
|
import net.minecraft.client.renderer.block.statemap.IStateMapper;
|
||||||
|
import net.minecraft.client.renderer.block.statemap.StateMap;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public class UStateMapper
|
||||||
|
{
|
||||||
|
|
||||||
|
@SideOnly( Side.CLIENT )
|
||||||
|
public static IStateMapper ignoreProperties( final IProperty< ? >... properties )
|
||||||
|
{
|
||||||
|
System.err.println( "\n\nLOLWUT\n\n" );
|
||||||
|
return new StateMap.Builder( ).ignore( properties ).build( );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"facing=south,in_wall=false,open=false": { "model": "mmm:deco/fence/bamboo/gate_closed", "uvlock": true },
|
||||||
|
"facing=west,in_wall=false,open=false": { "model": "mmm:deco/fence/bamboo/gate_closed", "uvlock": true, "y": 90 },
|
||||||
|
"facing=north,in_wall=false,open=false": { "model": "mmm:deco/fence/bamboo/gate_closed", "uvlock": true, "y": 180 },
|
||||||
|
"facing=east,in_wall=false,open=false": { "model": "mmm:deco/fence/bamboo/gate_closed", "uvlock": true, "y": 270 },
|
||||||
|
"facing=south,in_wall=false,open=true": { "model": "mmm:deco/fence/bamboo/gate_open", "uvlock": true },
|
||||||
|
"facing=west,in_wall=false,open=true": { "model": "mmm:deco/fence/bamboo/gate_open", "uvlock": true, "y": 90 },
|
||||||
|
"facing=north,in_wall=false,open=true": { "model": "mmm:deco/fence/bamboo/gate_open", "uvlock": true, "y": 180 },
|
||||||
|
"facing=east,in_wall=false,open=true": { "model": "mmm:deco/fence/bamboo/gate_open", "uvlock": true, "y": 270 },
|
||||||
|
"facing=south,in_wall=true,open=false": { "model": "mmm:deco/fence/bamboo/wall_closed", "uvlock": true },
|
||||||
|
"facing=west,in_wall=true,open=false": { "model": "mmm:deco/fence/bamboo/wall_closed", "uvlock": true, "y": 90 },
|
||||||
|
"facing=north,in_wall=true,open=false": { "model": "mmm:deco/fence/bamboo/wall_closed", "uvlock": true, "y": 180 },
|
||||||
|
"facing=east,in_wall=true,open=false": { "model": "mmm:deco/fence/bamboo/wall_closed", "uvlock": true, "y": 270 },
|
||||||
|
"facing=south,in_wall=true,open=true": { "model": "mmm:deco/fence/bamboo/wall_open", "uvlock": true },
|
||||||
|
"facing=west,in_wall=true,open=true": { "model": "mmm:deco/fence/bamboo/wall_open", "uvlock": true, "y": 90 },
|
||||||
|
"facing=north,in_wall=true,open=true": { "model": "mmm:deco/fence/bamboo/wall_open", "uvlock": true, "y": 180 },
|
||||||
|
"facing=east,in_wall=true,open=true": { "model": "mmm:deco/fence/bamboo/wall_open", "uvlock": true, "y": 270 }
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"facing=south,in_wall=false,open=false": { "model": "mmm:deco/fence/hevea/gate_closed", "uvlock": true },
|
||||||
|
"facing=west,in_wall=false,open=false": { "model": "mmm:deco/fence/hevea/gate_closed", "uvlock": true, "y": 90 },
|
||||||
|
"facing=north,in_wall=false,open=false": { "model": "mmm:deco/fence/hevea/gate_closed", "uvlock": true, "y": 180 },
|
||||||
|
"facing=east,in_wall=false,open=false": { "model": "mmm:deco/fence/hevea/gate_closed", "uvlock": true, "y": 270 },
|
||||||
|
"facing=south,in_wall=false,open=true": { "model": "mmm:deco/fence/hevea/gate_open", "uvlock": true },
|
||||||
|
"facing=west,in_wall=false,open=true": { "model": "mmm:deco/fence/hevea/gate_open", "uvlock": true, "y": 90 },
|
||||||
|
"facing=north,in_wall=false,open=true": { "model": "mmm:deco/fence/hevea/gate_open", "uvlock": true, "y": 180 },
|
||||||
|
"facing=east,in_wall=false,open=true": { "model": "mmm:deco/fence/hevea/gate_open", "uvlock": true, "y": 270 },
|
||||||
|
"facing=south,in_wall=true,open=false": { "model": "mmm:deco/fence/hevea/wall_closed", "uvlock": true },
|
||||||
|
"facing=west,in_wall=true,open=false": { "model": "mmm:deco/fence/hevea/wall_closed", "uvlock": true, "y": 90 },
|
||||||
|
"facing=north,in_wall=true,open=false": { "model": "mmm:deco/fence/hevea/wall_closed", "uvlock": true, "y": 180 },
|
||||||
|
"facing=east,in_wall=true,open=false": { "model": "mmm:deco/fence/hevea/wall_closed", "uvlock": true, "y": 270 },
|
||||||
|
"facing=south,in_wall=true,open=true": { "model": "mmm:deco/fence/hevea/wall_open", "uvlock": true },
|
||||||
|
"facing=west,in_wall=true,open=true": { "model": "mmm:deco/fence/hevea/wall_open", "uvlock": true, "y": 90 },
|
||||||
|
"facing=north,in_wall=true,open=true": { "model": "mmm:deco/fence/hevea/wall_open", "uvlock": true, "y": 180 },
|
||||||
|
"facing=east,in_wall=true,open=true": { "model": "mmm:deco/fence/hevea/wall_open", "uvlock": true, "y": 270 }
|
||||||
|
}
|
||||||
|
}
|
|
@ -179,6 +179,7 @@ tile.mmm.deco.throne.oak.red.name=Oak Throne (Red)
|
||||||
tile.mmm.deco.throne.oak.silver.name=Oak Throne (Silver)
|
tile.mmm.deco.throne.oak.silver.name=Oak Throne (Silver)
|
||||||
tile.mmm.deco.throne.oak.white.name=Oak Throne (White)
|
tile.mmm.deco.throne.oak.white.name=Oak Throne (White)
|
||||||
tile.mmm.deco.throne.oak.yellow.name=Oak Throne (Yellow)
|
tile.mmm.deco.throne.oak.yellow.name=Oak Throne (Yellow)
|
||||||
|
|
||||||
tile.mmm.deco.throne.birch.black.name=Birch Throne (Black)
|
tile.mmm.deco.throne.birch.black.name=Birch Throne (Black)
|
||||||
tile.mmm.deco.throne.birch.blue.name=Birch Throne (Blue)
|
tile.mmm.deco.throne.birch.blue.name=Birch Throne (Blue)
|
||||||
tile.mmm.deco.throne.birch.brown.name=Birch Throne (Brown)
|
tile.mmm.deco.throne.birch.brown.name=Birch Throne (Brown)
|
||||||
|
@ -195,6 +196,7 @@ tile.mmm.deco.throne.birch.red.name=Birch Throne (Red)
|
||||||
tile.mmm.deco.throne.birch.silver.name=Birch Throne (Silver)
|
tile.mmm.deco.throne.birch.silver.name=Birch Throne (Silver)
|
||||||
tile.mmm.deco.throne.birch.white.name=Birch Throne (White)
|
tile.mmm.deco.throne.birch.white.name=Birch Throne (White)
|
||||||
tile.mmm.deco.throne.birch.yellow.name=Birch Throne (Yellow)
|
tile.mmm.deco.throne.birch.yellow.name=Birch Throne (Yellow)
|
||||||
|
|
||||||
tile.mmm.deco.throne.spruce.black.name=Spruce Throne (Black)
|
tile.mmm.deco.throne.spruce.black.name=Spruce Throne (Black)
|
||||||
tile.mmm.deco.throne.spruce.blue.name=Spruce Throne (Blue)
|
tile.mmm.deco.throne.spruce.blue.name=Spruce Throne (Blue)
|
||||||
tile.mmm.deco.throne.spruce.brown.name=Spruce Throne (Brown)
|
tile.mmm.deco.throne.spruce.brown.name=Spruce Throne (Brown)
|
||||||
|
@ -211,6 +213,7 @@ tile.mmm.deco.throne.spruce.red.name=Spruce Throne (Red)
|
||||||
tile.mmm.deco.throne.spruce.silver.name=Spruce Throne (Silver)
|
tile.mmm.deco.throne.spruce.silver.name=Spruce Throne (Silver)
|
||||||
tile.mmm.deco.throne.spruce.white.name=Spruce Throne (White)
|
tile.mmm.deco.throne.spruce.white.name=Spruce Throne (White)
|
||||||
tile.mmm.deco.throne.spruce.yellow.name=Spruce Throne (Yellow)
|
tile.mmm.deco.throne.spruce.yellow.name=Spruce Throne (Yellow)
|
||||||
|
|
||||||
tile.mmm.deco.throne.jungle.black.name=Jungle Wood Throne (Black)
|
tile.mmm.deco.throne.jungle.black.name=Jungle Wood Throne (Black)
|
||||||
tile.mmm.deco.throne.jungle.blue.name=Jungle Wood Throne (Blue)
|
tile.mmm.deco.throne.jungle.blue.name=Jungle Wood Throne (Blue)
|
||||||
tile.mmm.deco.throne.jungle.brown.name=Jungle Wood Throne (Brown)
|
tile.mmm.deco.throne.jungle.brown.name=Jungle Wood Throne (Brown)
|
||||||
|
@ -227,6 +230,7 @@ tile.mmm.deco.throne.jungle.red.name=Jungle Wood Throne (Red)
|
||||||
tile.mmm.deco.throne.jungle.silver.name=Jungle Wood Throne (Silver)
|
tile.mmm.deco.throne.jungle.silver.name=Jungle Wood Throne (Silver)
|
||||||
tile.mmm.deco.throne.jungle.white.name=Jungle Wood Throne (White)
|
tile.mmm.deco.throne.jungle.white.name=Jungle Wood Throne (White)
|
||||||
tile.mmm.deco.throne.jungle.yellow.name=Jungle Wood Throne (Yellow)
|
tile.mmm.deco.throne.jungle.yellow.name=Jungle Wood Throne (Yellow)
|
||||||
|
|
||||||
tile.mmm.deco.throne.dark_oak.black.name=Dark Oak Throne (Black)
|
tile.mmm.deco.throne.dark_oak.black.name=Dark Oak Throne (Black)
|
||||||
tile.mmm.deco.throne.dark_oak.blue.name=Dark Oak Throne (Blue)
|
tile.mmm.deco.throne.dark_oak.blue.name=Dark Oak Throne (Blue)
|
||||||
tile.mmm.deco.throne.dark_oak.brown.name=Dark Oak Throne (Brown)
|
tile.mmm.deco.throne.dark_oak.brown.name=Dark Oak Throne (Brown)
|
||||||
|
@ -243,6 +247,7 @@ tile.mmm.deco.throne.dark_oak.red.name=Dark Oak Throne (Red)
|
||||||
tile.mmm.deco.throne.dark_oak.silver.name=Dark Oak Throne (Silver)
|
tile.mmm.deco.throne.dark_oak.silver.name=Dark Oak Throne (Silver)
|
||||||
tile.mmm.deco.throne.dark_oak.white.name=Dark Oak Throne (White)
|
tile.mmm.deco.throne.dark_oak.white.name=Dark Oak Throne (White)
|
||||||
tile.mmm.deco.throne.dark_oak.yellow.name=Dark Oak Throne (Yellow)
|
tile.mmm.deco.throne.dark_oak.yellow.name=Dark Oak Throne (Yellow)
|
||||||
|
|
||||||
tile.mmm.deco.throne.acacia.black.name=Acacia Throne (Black)
|
tile.mmm.deco.throne.acacia.black.name=Acacia Throne (Black)
|
||||||
tile.mmm.deco.throne.acacia.blue.name=Acacia Throne (Blue)
|
tile.mmm.deco.throne.acacia.blue.name=Acacia Throne (Blue)
|
||||||
tile.mmm.deco.throne.acacia.brown.name=Acacia Throne (Brown)
|
tile.mmm.deco.throne.acacia.brown.name=Acacia Throne (Brown)
|
||||||
|
@ -259,6 +264,7 @@ tile.mmm.deco.throne.acacia.red.name=Acacia Throne (Red)
|
||||||
tile.mmm.deco.throne.acacia.silver.name=Acacia Throne (Silver)
|
tile.mmm.deco.throne.acacia.silver.name=Acacia Throne (Silver)
|
||||||
tile.mmm.deco.throne.acacia.white.name=Acacia Throne (White)
|
tile.mmm.deco.throne.acacia.white.name=Acacia Throne (White)
|
||||||
tile.mmm.deco.throne.acacia.yellow.name=Acacia Throne (Yellow)
|
tile.mmm.deco.throne.acacia.yellow.name=Acacia Throne (Yellow)
|
||||||
|
|
||||||
tile.mmm.deco.throne.bamboo.black.name=Bamboo Throne (Black)
|
tile.mmm.deco.throne.bamboo.black.name=Bamboo Throne (Black)
|
||||||
tile.mmm.deco.throne.bamboo.blue.name=Bamboo Throne (Blue)
|
tile.mmm.deco.throne.bamboo.blue.name=Bamboo Throne (Blue)
|
||||||
tile.mmm.deco.throne.bamboo.brown.name=Bamboo Throne (Brown)
|
tile.mmm.deco.throne.bamboo.brown.name=Bamboo Throne (Brown)
|
||||||
|
@ -275,6 +281,7 @@ tile.mmm.deco.throne.bamboo.red.name=Bamboo Throne (Red)
|
||||||
tile.mmm.deco.throne.bamboo.silver.name=Bamboo Throne (Silver)
|
tile.mmm.deco.throne.bamboo.silver.name=Bamboo Throne (Silver)
|
||||||
tile.mmm.deco.throne.bamboo.white.name=Bamboo Throne (White)
|
tile.mmm.deco.throne.bamboo.white.name=Bamboo Throne (White)
|
||||||
tile.mmm.deco.throne.bamboo.yellow.name=Bamboo Throne (Yellow)
|
tile.mmm.deco.throne.bamboo.yellow.name=Bamboo Throne (Yellow)
|
||||||
|
|
||||||
tile.mmm.deco.throne.hevea.black.name=Hevea Throne (Black)
|
tile.mmm.deco.throne.hevea.black.name=Hevea Throne (Black)
|
||||||
tile.mmm.deco.throne.hevea.blue.name=Hevea Throne (Blue)
|
tile.mmm.deco.throne.hevea.blue.name=Hevea Throne (Blue)
|
||||||
tile.mmm.deco.throne.hevea.brown.name=Hevea Throne (Brown)
|
tile.mmm.deco.throne.hevea.brown.name=Hevea Throne (Brown)
|
||||||
|
@ -293,4 +300,6 @@ tile.mmm.deco.throne.hevea.white.name=Hevea Throne (White)
|
||||||
tile.mmm.deco.throne.hevea.yellow.name=Hevea Throne (Yellow)
|
tile.mmm.deco.throne.hevea.yellow.name=Hevea Throne (Yellow)
|
||||||
|
|
||||||
tile.mmm.deco.fence.hevea.name=Hevea Fence
|
tile.mmm.deco.fence.hevea.name=Hevea Fence
|
||||||
|
tile.mmm.deco.fence.gate.hevea.name=Hevea Fence Gate
|
||||||
tile.mmm.deco.fence.bamboo.name=Bamboo Fence
|
tile.mmm.deco.fence.bamboo.name=Bamboo Fence
|
||||||
|
tile.mmm.deco.fence.gate.bamboo.name=Bamboo Fence Gate
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "minecraft:block/fence_gate_closed",
|
||||||
|
"textures": {
|
||||||
|
"texture": "mmm:blocks/materials/planks/bamboo"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "minecraft:block/fence_gate_open",
|
||||||
|
"textures": {
|
||||||
|
"texture": "mmm:blocks/materials/planks/bamboo"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "minecraft:block/wall_gate_closed",
|
||||||
|
"textures": {
|
||||||
|
"texture": "mmm:blocks/materials/planks/bamboo"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "minecraft:block/wall_gate_open",
|
||||||
|
"textures": {
|
||||||
|
"texture": "mmm:blocks/materials/planks/bamboo"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "minecraft:block/fence_gate_closed",
|
||||||
|
"textures": {
|
||||||
|
"texture": "mmm:blocks/materials/planks/hevea"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "minecraft:block/fence_gate_open",
|
||||||
|
"textures": {
|
||||||
|
"texture": "mmm:blocks/materials/planks/hevea"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "minecraft:block/wall_gate_closed",
|
||||||
|
"textures": {
|
||||||
|
"texture": "mmm:blocks/materials/planks/hevea"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"parent": "minecraft:block/wall_gate_open",
|
||||||
|
"textures": {
|
||||||
|
"texture": "mmm:blocks/materials/planks/hevea"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"parent": "mmm:block/deco/fence/bamboo/gate_closed"
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"parent": "mmm:block/deco/fence/hevea/gate_closed"
|
||||||
|
}
|
Reference in a new issue