From 1a26c7bd1629155a6134983072659ec610393a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Tue, 14 Jun 2016 09:22:12 +0200 Subject: [PATCH] Moved wood type enum to separate file --- src/java/mmm/deco/DBlockTable.java | 30 ++----------------------- src/java/mmm/deco/DecorativeBlocks.java | 12 +++++----- src/java/mmm/deco/E_DWoodType.java | 29 ++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 34 deletions(-) create mode 100644 src/java/mmm/deco/E_DWoodType.java diff --git a/src/java/mmm/deco/DBlockTable.java b/src/java/mmm/deco/DBlockTable.java index 2e3c2cb..bcdb767 100644 --- a/src/java/mmm/deco/DBlockTable.java +++ b/src/java/mmm/deco/DBlockTable.java @@ -8,9 +8,7 @@ import mmm.utils.I_URecipeRegistrar; import mmm.utils.UMaths; import mmm.utils.URegistration; import net.minecraft.block.Block; -import net.minecraft.block.BlockPlanks; import net.minecraft.block.SoundType; -import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyBool; @@ -18,7 +16,6 @@ import net.minecraft.block.state.BlockStateContainer; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; -import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockRenderLayer; @@ -43,29 +40,6 @@ public class DBlockTable public final static String ID = "deco_table_"; public final static String NAME = Mmm.PREFIX + DBlockTable.ID; - public static enum E_WoodType { - OAK( "oak" , BlockPlanks.EnumType.OAK ) , // - BIRCH( "birch" , BlockPlanks.EnumType.BIRCH ) , // - SPRUCE( "spruce" , BlockPlanks.EnumType.SPRUCE ) , // - JUNGLE( "jungle" , BlockPlanks.EnumType.JUNGLE ) , // - DARK_OAK( "dark_oak" , BlockPlanks.EnumType.DARK_OAK ) , // - ACACIA( "acacia" , BlockPlanks.EnumType.ACACIA ); - - public final String suffix; - public final int metaData; - public final MapColor mapColor; - public final Block block; - - - private E_WoodType( final String suffix , final BlockPlanks.EnumType planks ) - { - this.suffix = suffix; - this.metaData = planks.getMetadata( ); - this.mapColor = planks.getMapColor( ); - this.block = Blocks.PLANKS; - } - } - protected static final AxisAlignedBB COLLISION_TOP = UMaths.makeBlockAABB( 0 , 12 , 0 , 16 , 16 , 16 ); protected static final AxisAlignedBB COLLISION_LEGS[] = { // UMaths.makeBlockAABB( 1 , 0 , 1 , 3 , 12 , 3 ) , // @@ -87,10 +61,10 @@ public class DBlockTable DBlockTable.SW , DBlockTable.WEST , DBlockTable.NW// }; - public final E_WoodType type; + public final E_DWoodType type; - public DBlockTable( final E_WoodType type ) + public DBlockTable( final E_DWoodType type ) { super( Material.WOOD , type.mapColor ); this.type = type; diff --git a/src/java/mmm/deco/DecorativeBlocks.java b/src/java/mmm/deco/DecorativeBlocks.java index c9bcd3a..137eb0e 100644 --- a/src/java/mmm/deco/DecorativeBlocks.java +++ b/src/java/mmm/deco/DecorativeBlocks.java @@ -12,12 +12,12 @@ public class DecorativeBlocks public static final DBlockTable TABLE_ACACIA; static { - TABLE_OAK = new DBlockTable( DBlockTable.E_WoodType.OAK ); - TABLE_BIRCH = new DBlockTable( DBlockTable.E_WoodType.BIRCH ); - TABLE_SPRUCE = new DBlockTable( DBlockTable.E_WoodType.SPRUCE ); - TABLE_JUNGLE = new DBlockTable( DBlockTable.E_WoodType.JUNGLE ); - TABLE_DARK_OAK = new DBlockTable( DBlockTable.E_WoodType.DARK_OAK ); - TABLE_ACACIA = new DBlockTable( DBlockTable.E_WoodType.ACACIA ); + TABLE_OAK = new DBlockTable( E_DWoodType.OAK ); + TABLE_BIRCH = new DBlockTable( E_DWoodType.BIRCH ); + TABLE_SPRUCE = new DBlockTable( E_DWoodType.SPRUCE ); + TABLE_JUNGLE = new DBlockTable( E_DWoodType.JUNGLE ); + TABLE_DARK_OAK = new DBlockTable( E_DWoodType.DARK_OAK ); + TABLE_ACACIA = new DBlockTable( E_DWoodType.ACACIA ); } diff --git a/src/java/mmm/deco/E_DWoodType.java b/src/java/mmm/deco/E_DWoodType.java new file mode 100644 index 0000000..35206ea --- /dev/null +++ b/src/java/mmm/deco/E_DWoodType.java @@ -0,0 +1,29 @@ +package mmm.deco; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockPlanks; +import net.minecraft.block.material.MapColor; +import net.minecraft.init.Blocks; + +public enum E_DWoodType { + OAK( "oak" , BlockPlanks.EnumType.OAK ) , // + BIRCH( "birch" , BlockPlanks.EnumType.BIRCH ) , // + SPRUCE( "spruce" , BlockPlanks.EnumType.SPRUCE ) , // + JUNGLE( "jungle" , BlockPlanks.EnumType.JUNGLE ) , // + DARK_OAK( "dark_oak" , BlockPlanks.EnumType.DARK_OAK ) , // + ACACIA( "acacia" , BlockPlanks.EnumType.ACACIA ); + + public final String suffix; + public final MapColor mapColor; + public final Block block; + public final int metaData; + + + private E_DWoodType( final String suffix , final BlockPlanks.EnumType planks ) + { + this.suffix = suffix; + this.mapColor = planks.getMapColor( ); + this.block = Blocks.PLANKS; + this.metaData = planks.getMetadata( ); + } +} \ No newline at end of file