diff --git a/TODO.txt b/TODO.txt index 85058af..213ea76 100644 --- a/TODO.txt +++ b/TODO.txt @@ -9,9 +9,6 @@ deco No Stone - Smooth + stairs + slabs Limestone Slate Basalt -deco No Wood - Doors - Hevea - Bamboo ------------------------------------------------------------------------------------------------------- plants No? Tomatoes plants No? Turnips diff --git a/graphics/bamboo-door.xcf b/graphics/bamboo-door.xcf new file mode 100644 index 0000000..b49fd22 Binary files /dev/null and b/graphics/bamboo-door.xcf differ diff --git a/graphics/hevea-door.xcf b/graphics/hevea-door.xcf new file mode 100644 index 0000000..3e99cf1 Binary files /dev/null and b/graphics/hevea-door.xcf differ diff --git a/src/java/mmm/MmmDeco.java b/src/java/mmm/MmmDeco.java index 34edcbb..f283423 100644 --- a/src/java/mmm/MmmDeco.java +++ b/src/java/mmm/MmmDeco.java @@ -5,6 +5,7 @@ import mmm.deco.DChairs; import mmm.deco.DSeatEntity; import mmm.deco.DStairs; import mmm.deco.DTables; +import mmm.deco.doors.DDoors; import mmm.deco.fences.DFences; import mmm.deco.slabs.DSlabs; import mmm.deco.thrones.DThrones; @@ -17,6 +18,7 @@ public class MmmDeco public static final DStairs STAIRS; public static final DSlabs SLAB; public static final DFences FENCE; + public static final DDoors DOOR; public static final DTables TABLE; public static final DChairs CHAIR; public static final DThrones THRONE; @@ -25,6 +27,7 @@ public class MmmDeco STAIRS = new DStairs( ); SLAB = new DSlabs( ); FENCE = new DFences( ); + DOOR = new DDoors( ); TABLE = new DTables( ); CHAIR = new DChairs( ); THRONE = new DThrones( ); diff --git a/src/java/mmm/deco/doors/DDoor.java b/src/java/mmm/deco/doors/DDoor.java new file mode 100644 index 0000000..3873e8b --- /dev/null +++ b/src/java/mmm/deco/doors/DDoor.java @@ -0,0 +1,25 @@ +package mmm.deco.doors; + + +import mmm.core.CRegistry; +import mmm.materials.MWood; +import net.minecraft.item.ItemDoor; + + + +public class DDoor +{ + + public final DDoorBlock BLOCK; + public final ItemDoor ITEM; + + + public DDoor( final MWood wood ) + { + this.BLOCK = new DDoorBlock( this , wood ); + this.ITEM = new ItemDoor( this.BLOCK ); + CRegistry.setIdentifiers( this.ITEM , "deco" , "door" , wood.getSuffix( ) ); + CRegistry.addBlock( this.BLOCK , this.ITEM ); + } + +} diff --git a/src/java/mmm/deco/doors/DDoorBlock.java b/src/java/mmm/deco/doors/DDoorBlock.java new file mode 100644 index 0000000..f858a6e --- /dev/null +++ b/src/java/mmm/deco/doors/DDoorBlock.java @@ -0,0 +1,78 @@ +package mmm.deco.doors; + + +import java.util.Random; + +import mmm.core.CRegistry; +import mmm.core.api.blocks.I_StateMapperProvider; +import mmm.materials.MWood; +import net.minecraft.block.BlockDoor; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.MapColor; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.renderer.block.statemap.IStateMapper; +import net.minecraft.client.renderer.block.statemap.StateMap; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.RayTraceResult; +import net.minecraft.world.World; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + + + +public class DDoorBlock + extends BlockDoor + implements I_StateMapperProvider +{ + + private final DDoor door; + private final MapColor mapColor; + + + public DDoorBlock( final DDoor door , final MWood wood ) + { + super( Material.WOOD ); + this.mapColor = wood.getMapColor( ); + this.door = door; + + this.setHardness( 3f ); + this.setSoundType( SoundType.WOOD ); + + CRegistry.setIdentifiers( this , "deco" , "door" , wood.getSuffix( ) ); + } + + + @Override + public MapColor getMapColor( final IBlockState state ) + { + return this.mapColor; + } + + + @Override + public Item getItemDropped( final IBlockState state , final Random rand , final int fortune ) + { + return state.getValue( BlockDoor.HALF ) == BlockDoor.EnumDoorHalf.UPPER ? null : this.door.ITEM; + } + + + @Override + public ItemStack getPickBlock( final IBlockState state , final RayTraceResult target , final World world , + final BlockPos pos , final EntityPlayer player ) + { + return new ItemStack( this.door.ITEM ); + } + + + @Override + @SideOnly( Side.CLIENT ) + public IStateMapper getStateMapper( ) + { + return new StateMap.Builder( ).ignore( BlockDoor.POWERED ).build( ); + } + +} diff --git a/src/java/mmm/deco/doors/DDoors.java b/src/java/mmm/deco/doors/DDoors.java new file mode 100644 index 0000000..8d6af5f --- /dev/null +++ b/src/java/mmm/deco/doors/DDoors.java @@ -0,0 +1,20 @@ +package mmm.deco.doors; + + +import mmm.MmmMaterials; + + + +public class DDoors +{ + public final DDoor BAMBOO; + public final DDoor HEVEA; + + + public DDoors( ) + { + this.BAMBOO = new DDoor( MmmMaterials.WOOD.BAMBOO ); + this.HEVEA = new DDoor( MmmMaterials.WOOD.HEVEA ); + } + +} diff --git a/src/resources/assets/mmm/blockstates/deco/door/bamboo.json b/src/resources/assets/mmm/blockstates/deco/door/bamboo.json new file mode 100644 index 0000000..32da703 --- /dev/null +++ b/src/resources/assets/mmm/blockstates/deco/door/bamboo.json @@ -0,0 +1,36 @@ +{ + "variants" : { + "facing=east,half=lower,hinge=left,open=false": { "model": "mmm:deco/door/bamboo/bottom_lh" }, + "facing=south,half=lower,hinge=left,open=false": { "model": "mmm:deco/door/bamboo/bottom_lh", "y": 90 }, + "facing=west,half=lower,hinge=left,open=false": { "model": "mmm:deco/door/bamboo/bottom_lh", "y": 180 }, + "facing=north,half=lower,hinge=left,open=false": { "model": "mmm:deco/door/bamboo/bottom_lh", "y": 270 }, + "facing=east,half=lower,hinge=right,open=false": { "model": "mmm:deco/door/bamboo/bottom_rh" }, + "facing=south,half=lower,hinge=right,open=false": { "model": "mmm:deco/door/bamboo/bottom_rh", "y": 90 }, + "facing=west,half=lower,hinge=right,open=false": { "model": "mmm:deco/door/bamboo/bottom_rh", "y": 180 }, + "facing=north,half=lower,hinge=right,open=false": { "model": "mmm:deco/door/bamboo/bottom_rh", "y": 270 }, + "facing=east,half=lower,hinge=left,open=true": { "model": "mmm:deco/door/bamboo/bottom_rh", "y": 90 }, + "facing=south,half=lower,hinge=left,open=true": { "model": "mmm:deco/door/bamboo/bottom_rh", "y": 180 }, + "facing=west,half=lower,hinge=left,open=true": { "model": "mmm:deco/door/bamboo/bottom_rh", "y": 270 }, + "facing=north,half=lower,hinge=left,open=true": { "model": "mmm:deco/door/bamboo/bottom_rh" }, + "facing=east,half=lower,hinge=right,open=true": { "model": "mmm:deco/door/bamboo/bottom_lh", "y": 270 }, + "facing=south,half=lower,hinge=right,open=true": { "model": "mmm:deco/door/bamboo/bottom_lh" }, + "facing=west,half=lower,hinge=right,open=true": { "model": "mmm:deco/door/bamboo/bottom_lh", "y": 90 }, + "facing=north,half=lower,hinge=right,open=true": { "model": "mmm:deco/door/bamboo/bottom_lh", "y": 180 }, + "facing=east,half=upper,hinge=left,open=false": { "model": "mmm:deco/door/bamboo/top_lh" }, + "facing=south,half=upper,hinge=left,open=false": { "model": "mmm:deco/door/bamboo/top_lh", "y": 90 }, + "facing=west,half=upper,hinge=left,open=false": { "model": "mmm:deco/door/bamboo/top_lh", "y": 180 }, + "facing=north,half=upper,hinge=left,open=false": { "model": "mmm:deco/door/bamboo/top_lh", "y": 270 }, + "facing=east,half=upper,hinge=right,open=false": { "model": "mmm:deco/door/bamboo/top_rh" }, + "facing=south,half=upper,hinge=right,open=false": { "model": "mmm:deco/door/bamboo/top_rh", "y": 90 }, + "facing=west,half=upper,hinge=right,open=false": { "model": "mmm:deco/door/bamboo/top_rh", "y": 180 }, + "facing=north,half=upper,hinge=right,open=false": { "model": "mmm:deco/door/bamboo/top_rh", "y": 270 }, + "facing=east,half=upper,hinge=left,open=true": { "model": "mmm:deco/door/bamboo/top_rh", "y": 90 }, + "facing=south,half=upper,hinge=left,open=true": { "model": "mmm:deco/door/bamboo/top_rh", "y": 180 }, + "facing=west,half=upper,hinge=left,open=true": { "model": "mmm:deco/door/bamboo/top_rh", "y": 270 }, + "facing=north,half=upper,hinge=left,open=true": { "model": "mmm:deco/door/bamboo/top_rh" }, + "facing=east,half=upper,hinge=right,open=true": { "model": "mmm:deco/door/bamboo/top_lh", "y": 270 }, + "facing=south,half=upper,hinge=right,open=true": { "model": "mmm:deco/door/bamboo/top_lh" }, + "facing=west,half=upper,hinge=right,open=true": { "model": "mmm:deco/door/bamboo/top_lh", "y": 90 }, + "facing=north,half=upper,hinge=right,open=true": { "model": "mmm:deco/door/bamboo/top_lh", "y": 180 } + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/blockstates/deco/door/hevea.json b/src/resources/assets/mmm/blockstates/deco/door/hevea.json new file mode 100644 index 0000000..4601b00 --- /dev/null +++ b/src/resources/assets/mmm/blockstates/deco/door/hevea.json @@ -0,0 +1,36 @@ +{ + "variants" : { + "facing=east,half=lower,hinge=left,open=false": { "model": "mmm:deco/door/hevea/bottom_lh" }, + "facing=south,half=lower,hinge=left,open=false": { "model": "mmm:deco/door/hevea/bottom_lh", "y": 90 }, + "facing=west,half=lower,hinge=left,open=false": { "model": "mmm:deco/door/hevea/bottom_lh", "y": 180 }, + "facing=north,half=lower,hinge=left,open=false": { "model": "mmm:deco/door/hevea/bottom_lh", "y": 270 }, + "facing=east,half=lower,hinge=right,open=false": { "model": "mmm:deco/door/hevea/bottom_rh" }, + "facing=south,half=lower,hinge=right,open=false": { "model": "mmm:deco/door/hevea/bottom_rh", "y": 90 }, + "facing=west,half=lower,hinge=right,open=false": { "model": "mmm:deco/door/hevea/bottom_rh", "y": 180 }, + "facing=north,half=lower,hinge=right,open=false": { "model": "mmm:deco/door/hevea/bottom_rh", "y": 270 }, + "facing=east,half=lower,hinge=left,open=true": { "model": "mmm:deco/door/hevea/bottom_rh", "y": 90 }, + "facing=south,half=lower,hinge=left,open=true": { "model": "mmm:deco/door/hevea/bottom_rh", "y": 180 }, + "facing=west,half=lower,hinge=left,open=true": { "model": "mmm:deco/door/hevea/bottom_rh", "y": 270 }, + "facing=north,half=lower,hinge=left,open=true": { "model": "mmm:deco/door/hevea/bottom_rh" }, + "facing=east,half=lower,hinge=right,open=true": { "model": "mmm:deco/door/hevea/bottom_lh", "y": 270 }, + "facing=south,half=lower,hinge=right,open=true": { "model": "mmm:deco/door/hevea/bottom_lh" }, + "facing=west,half=lower,hinge=right,open=true": { "model": "mmm:deco/door/hevea/bottom_lh", "y": 90 }, + "facing=north,half=lower,hinge=right,open=true": { "model": "mmm:deco/door/hevea/bottom_lh", "y": 180 }, + "facing=east,half=upper,hinge=left,open=false": { "model": "mmm:deco/door/hevea/top_lh" }, + "facing=south,half=upper,hinge=left,open=false": { "model": "mmm:deco/door/hevea/top_lh", "y": 90 }, + "facing=west,half=upper,hinge=left,open=false": { "model": "mmm:deco/door/hevea/top_lh", "y": 180 }, + "facing=north,half=upper,hinge=left,open=false": { "model": "mmm:deco/door/hevea/top_lh", "y": 270 }, + "facing=east,half=upper,hinge=right,open=false": { "model": "mmm:deco/door/hevea/top_rh" }, + "facing=south,half=upper,hinge=right,open=false": { "model": "mmm:deco/door/hevea/top_rh", "y": 90 }, + "facing=west,half=upper,hinge=right,open=false": { "model": "mmm:deco/door/hevea/top_rh", "y": 180 }, + "facing=north,half=upper,hinge=right,open=false": { "model": "mmm:deco/door/hevea/top_rh", "y": 270 }, + "facing=east,half=upper,hinge=left,open=true": { "model": "mmm:deco/door/hevea/top_rh", "y": 90 }, + "facing=south,half=upper,hinge=left,open=true": { "model": "mmm:deco/door/hevea/top_rh", "y": 180 }, + "facing=west,half=upper,hinge=left,open=true": { "model": "mmm:deco/door/hevea/top_rh", "y": 270 }, + "facing=north,half=upper,hinge=left,open=true": { "model": "mmm:deco/door/hevea/top_rh" }, + "facing=east,half=upper,hinge=right,open=true": { "model": "mmm:deco/door/hevea/top_lh", "y": 270 }, + "facing=south,half=upper,hinge=right,open=true": { "model": "mmm:deco/door/hevea/top_lh" }, + "facing=west,half=upper,hinge=right,open=true": { "model": "mmm:deco/door/hevea/top_lh", "y": 90 }, + "facing=north,half=upper,hinge=right,open=true": { "model": "mmm:deco/door/hevea/top_lh", "y": 180 } + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/lang/en_US.lang b/src/resources/assets/mmm/lang/en_US.lang index 63ab107..5bbee92 100644 --- a/src/resources/assets/mmm/lang/en_US.lang +++ b/src/resources/assets/mmm/lang/en_US.lang @@ -145,6 +145,14 @@ tile.mmm.deco.slabs.andesite.name=Andesite Slab tile.mmm.deco.slabs.hevea.name=Hevea Wood Slab tile.mmm.deco.slabs.bamboo.name=Bamboo Wood Slab +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.gate.bamboo.name=Bamboo Fence Gate + +tile.mmm.deco.door.hevea.name=Hevea Door +tile.mmm.deco.door.bamboo.name=Bamboo Door + tile.mmm.deco.table.oak.name=Oak Table tile.mmm.deco.table.birch.name=Birch Table tile.mmm.deco.table.spruce.name=Spruce Table @@ -298,8 +306,3 @@ tile.mmm.deco.throne.hevea.red.name=Hevea Throne (Red) tile.mmm.deco.throne.hevea.silver.name=Hevea Throne (Silver) tile.mmm.deco.throne.hevea.white.name=Hevea Throne (White) tile.mmm.deco.throne.hevea.yellow.name=Hevea Throne (Yellow) - -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.gate.bamboo.name=Bamboo Fence Gate diff --git a/src/resources/assets/mmm/models/block/deco/door/bamboo/bottom_lh.json b/src/resources/assets/mmm/models/block/deco/door/bamboo/bottom_lh.json new file mode 100644 index 0000000..fc53a01 --- /dev/null +++ b/src/resources/assets/mmm/models/block/deco/door/bamboo/bottom_lh.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/door_bottom", + "textures": + { + "bottom": "mmm:blocks/deco/door/bamboo/bottom", + "top": "mmm:blocks/deco/door/bamboo/top" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/block/deco/door/bamboo/bottom_rh.json b/src/resources/assets/mmm/models/block/deco/door/bamboo/bottom_rh.json new file mode 100644 index 0000000..7525241 --- /dev/null +++ b/src/resources/assets/mmm/models/block/deco/door/bamboo/bottom_rh.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/door_bottom_rh", + "textures": + { + "bottom": "mmm:blocks/deco/door/bamboo/bottom", + "top": "mmm:blocks/deco/door/bamboo/top" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/block/deco/door/bamboo/top_lh.json b/src/resources/assets/mmm/models/block/deco/door/bamboo/top_lh.json new file mode 100644 index 0000000..de414d6 --- /dev/null +++ b/src/resources/assets/mmm/models/block/deco/door/bamboo/top_lh.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/door_top", + "textures": + { + "bottom": "mmm:blocks/deco/door/bamboo/bottom", + "top": "mmm:blocks/deco/door/bamboo/top" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/block/deco/door/bamboo/top_rh.json b/src/resources/assets/mmm/models/block/deco/door/bamboo/top_rh.json new file mode 100644 index 0000000..fe9f400 --- /dev/null +++ b/src/resources/assets/mmm/models/block/deco/door/bamboo/top_rh.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/door_top_rh", + "textures": + { + "bottom": "mmm:blocks/deco/door/bamboo/bottom", + "top": "mmm:blocks/deco/door/bamboo/top" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/block/deco/door/hevea/bottom_lh.json b/src/resources/assets/mmm/models/block/deco/door/hevea/bottom_lh.json new file mode 100644 index 0000000..9943308 --- /dev/null +++ b/src/resources/assets/mmm/models/block/deco/door/hevea/bottom_lh.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/door_bottom", + "textures": + { + "bottom": "mmm:blocks/deco/door/hevea/bottom", + "top": "mmm:blocks/deco/door/hevea/top" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/block/deco/door/hevea/bottom_rh.json b/src/resources/assets/mmm/models/block/deco/door/hevea/bottom_rh.json new file mode 100644 index 0000000..1aab346 --- /dev/null +++ b/src/resources/assets/mmm/models/block/deco/door/hevea/bottom_rh.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/door_bottom_rh", + "textures": + { + "bottom": "mmm:blocks/deco/door/hevea/bottom", + "top": "mmm:blocks/deco/door/hevea/top" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/block/deco/door/hevea/top_lh.json b/src/resources/assets/mmm/models/block/deco/door/hevea/top_lh.json new file mode 100644 index 0000000..9a5d1c2 --- /dev/null +++ b/src/resources/assets/mmm/models/block/deco/door/hevea/top_lh.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/door_top", + "textures": + { + "bottom": "mmm:blocks/deco/door/hevea/bottom", + "top": "mmm:blocks/deco/door/hevea/top" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/block/deco/door/hevea/top_rh.json b/src/resources/assets/mmm/models/block/deco/door/hevea/top_rh.json new file mode 100644 index 0000000..83668e7 --- /dev/null +++ b/src/resources/assets/mmm/models/block/deco/door/hevea/top_rh.json @@ -0,0 +1,8 @@ +{ + "parent": "minecraft:block/door_top_rh", + "textures": + { + "bottom": "mmm:blocks/deco/door/hevea/bottom", + "top": "mmm:blocks/deco/door/hevea/top" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/deco/door/bamboo.json b/src/resources/assets/mmm/models/item/deco/door/bamboo.json new file mode 100644 index 0000000..67037c0 --- /dev/null +++ b/src/resources/assets/mmm/models/item/deco/door/bamboo.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/deco/door/bamboo" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/item/deco/door/hevea.json b/src/resources/assets/mmm/models/item/deco/door/hevea.json new file mode 100644 index 0000000..ae1da11 --- /dev/null +++ b/src/resources/assets/mmm/models/item/deco/door/hevea.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "mmm:items/deco/door/hevea" + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/textures/blocks/deco/door/bamboo/bottom.png b/src/resources/assets/mmm/textures/blocks/deco/door/bamboo/bottom.png new file mode 100644 index 0000000..ab2d5dc Binary files /dev/null and b/src/resources/assets/mmm/textures/blocks/deco/door/bamboo/bottom.png differ diff --git a/src/resources/assets/mmm/textures/blocks/deco/door/bamboo/top.png b/src/resources/assets/mmm/textures/blocks/deco/door/bamboo/top.png new file mode 100644 index 0000000..8ffba47 Binary files /dev/null and b/src/resources/assets/mmm/textures/blocks/deco/door/bamboo/top.png differ diff --git a/src/resources/assets/mmm/textures/blocks/deco/door/hevea/bottom.png b/src/resources/assets/mmm/textures/blocks/deco/door/hevea/bottom.png new file mode 100644 index 0000000..676b3ba Binary files /dev/null and b/src/resources/assets/mmm/textures/blocks/deco/door/hevea/bottom.png differ diff --git a/src/resources/assets/mmm/textures/blocks/deco/door/hevea/top.png b/src/resources/assets/mmm/textures/blocks/deco/door/hevea/top.png new file mode 100644 index 0000000..d50842d Binary files /dev/null and b/src/resources/assets/mmm/textures/blocks/deco/door/hevea/top.png differ diff --git a/src/resources/assets/mmm/textures/items/deco/door/bamboo.png b/src/resources/assets/mmm/textures/items/deco/door/bamboo.png new file mode 100644 index 0000000..7397d14 Binary files /dev/null and b/src/resources/assets/mmm/textures/items/deco/door/bamboo.png differ diff --git a/src/resources/assets/mmm/textures/items/deco/door/hevea.png b/src/resources/assets/mmm/textures/items/deco/door/hevea.png new file mode 100644 index 0000000..2d9e580 Binary files /dev/null and b/src/resources/assets/mmm/textures/items/deco/door/hevea.png differ