diff --git a/src/main/java/drzhark/mocreatures/block/MoCBlockButtonStone.java b/src/main/java/drzhark/mocreatures/block/MoCBlockButtonStone.java index 97cc7c0b2..87897d56b 100644 --- a/src/main/java/drzhark/mocreatures/block/MoCBlockButtonStone.java +++ b/src/main/java/drzhark/mocreatures/block/MoCBlockButtonStone.java @@ -12,6 +12,5 @@ public MoCBlockButtonStone() { this.setSoundType(SoundType.STONE); this.setHardness(0.5F); this.setHarvestLevel("pickaxe", 0); - this.setResistance(0.5F); } } diff --git a/src/main/java/drzhark/mocreatures/block/MoCBlockButtonWood.java b/src/main/java/drzhark/mocreatures/block/MoCBlockButtonWood.java index f24272918..cdcc239ee 100644 --- a/src/main/java/drzhark/mocreatures/block/MoCBlockButtonWood.java +++ b/src/main/java/drzhark/mocreatures/block/MoCBlockButtonWood.java @@ -6,6 +6,7 @@ import net.minecraft.block.BlockButtonWood; import net.minecraft.block.SoundType; +// NOTE: Wooden buttons are not flammable in vanilla public class MoCBlockButtonWood extends BlockButtonWood { public MoCBlockButtonWood() { super(); diff --git a/src/main/java/drzhark/mocreatures/block/MoCBlockDoorWood.java b/src/main/java/drzhark/mocreatures/block/MoCBlockDoorWood.java new file mode 100644 index 000000000..2b0cc21da --- /dev/null +++ b/src/main/java/drzhark/mocreatures/block/MoCBlockDoorWood.java @@ -0,0 +1,57 @@ +package drzhark.mocreatures.block; + +import java.util.Random; + +import drzhark.mocreatures.init.MoCBlocks; +import drzhark.mocreatures.init.MoCItems; +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.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +// NOTE: Wooden doors are not flammable in vanilla +public class MoCBlockDoorWood extends BlockDoor { + private final MapColor mapColor; + + public MoCBlockDoorWood(MapColor mapColor) { + super(Material.WOOD); + this.setSoundType(SoundType.WOOD); + this.setHardness(3.0F); + this.setHarvestLevel("axe", 0); + this.mapColor = mapColor; + //this.enableStats = false; + } + + @Override + public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state) { + return new ItemStack(getItemBlock()); + } + + protected Item getItemBlock() { + if (this == MoCBlocks.wyvwoodDoor) { + return MoCItems.wyvwoodDoor; + } + + // If door is not listed here give an oak one instead to prevent issues + else { + return Items.OAK_DOOR; + } + } + + @Override + public Item getItemDropped(IBlockState state, Random rand, int fortune) { + return state.getValue(HALF) == BlockDoor.EnumDoorHalf.UPPER ? Items.AIR : getItemBlock(); + } + + @Override + public MapColor getMapColor(IBlockState state, IBlockAccess world, BlockPos pos) { + return mapColor; + } +} diff --git a/src/main/java/drzhark/mocreatures/block/MoCBlockPressurePlateStone.java b/src/main/java/drzhark/mocreatures/block/MoCBlockPressurePlateStone.java index a169e6f1a..54e63ddaa 100644 --- a/src/main/java/drzhark/mocreatures/block/MoCBlockPressurePlateStone.java +++ b/src/main/java/drzhark/mocreatures/block/MoCBlockPressurePlateStone.java @@ -19,7 +19,6 @@ public MoCBlockPressurePlateStone(MapColor mapColor) { this.setSoundType(SoundType.STONE); this.setHardness(0.5F); this.setHarvestLevel("pickaxe", 0); - this.setResistance(0.5F); this.mapColor = mapColor; } diff --git a/src/main/java/drzhark/mocreatures/block/MoCBlockPressurePlateWood.java b/src/main/java/drzhark/mocreatures/block/MoCBlockPressurePlateWood.java index 292bf3299..741fe3bcf 100644 --- a/src/main/java/drzhark/mocreatures/block/MoCBlockPressurePlateWood.java +++ b/src/main/java/drzhark/mocreatures/block/MoCBlockPressurePlateWood.java @@ -11,6 +11,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.IBlockAccess; +// NOTE: Wooden pressure plates are not flammable in vanilla public class MoCBlockPressurePlateWood extends BlockPressurePlate { private final MapColor mapColor; diff --git a/src/main/java/drzhark/mocreatures/init/MoCBlocks.java b/src/main/java/drzhark/mocreatures/init/MoCBlocks.java index 6739c00da..62eecd0d9 100644 --- a/src/main/java/drzhark/mocreatures/init/MoCBlocks.java +++ b/src/main/java/drzhark/mocreatures/init/MoCBlocks.java @@ -9,6 +9,7 @@ import drzhark.mocreatures.block.*; import drzhark.mocreatures.block.MoCBlockSapling.EnumWoodType; import net.minecraft.block.Block; +import net.minecraft.block.BlockDoor; import net.minecraft.block.material.MapColor; import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.statemap.StateMap; @@ -118,6 +119,8 @@ public class MoCBlocks { public static Block wyvdirt; @GameRegistry.ObjectHolder("wyvwood_button") public static MoCBlockButtonWood wyvwoodButton; + @GameRegistry.ObjectHolder("wyvwood_door") + public static MoCBlockDoorWood wyvwoodDoor; @GameRegistry.ObjectHolder("wyvwood_fence") public static MoCBlockFenceWood wyvwoodFence; @GameRegistry.ObjectHolder("wyvwood_fence_gate") @@ -183,6 +186,7 @@ public static void registerBlocks(RegistryEvent.Register event) { setup(new MoCBlockTallGrass(MapColor.LIGHT_BLUE_STAINED_HARDENED_CLAY, false), "tall_wyvgrass").setHardness(0.0F), setup(new MoCBlockPlanks(MapColor.DIAMOND, true), "wyvwood_planks").setHardness(2.0F).setResistance(5.0F), setup(new MoCBlockButtonWood(), "wyvwood_button"), + setup(new MoCBlockDoorWood(MapColor.DIAMOND), "wyvwood_door"), setup(new MoCBlockFenceWood(MapColor.DIAMOND, true), "wyvwood_fence"), setup(new MoCBlockFenceGateWood(MapColor.DIAMOND, true), "wyvwood_fence_gate"), setup(new MoCBlockPressurePlateWood(MapColor.DIAMOND), "wyvwood_pressure_plate"), @@ -196,6 +200,7 @@ public static void registerItemBlocks(RegistryEvent.Register event) { final IForgeRegistry registry = event.getRegistry(); ForgeRegistries.BLOCKS.getValues().stream() .filter(block -> block.getRegistryName().getNamespace().equals(MoCConstants.MOD_ID)) + .filter(block -> !(block instanceof BlockDoor)) .forEach(block -> registry.register(setup(new ItemBlock(block), block.getRegistryName()))); } @@ -209,6 +214,8 @@ public static void registerModels(ModelRegistryEvent event) { } // All doors, fence gates, slabs, and walls go here + ModelLoader.setCustomStateMapper(wyvwoodDoor, (new StateMap.Builder()).ignore(MoCBlockDoorWood.POWERED).build()); + ModelLoader.setCustomStateMapper(wyvwoodFenceGate, (new StateMap.Builder()).ignore(MoCBlockFenceGateWood.POWERED).build()); ModelLoader.setCustomStateMapper(cobbledWyvstoneWall, (new StateMap.Builder()).ignore(MoCBlockWall.VARIANT).build()); diff --git a/src/main/java/drzhark/mocreatures/init/MoCItems.java b/src/main/java/drzhark/mocreatures/init/MoCItems.java index 0aea2d3bc..ba258419a 100644 --- a/src/main/java/drzhark/mocreatures/init/MoCItems.java +++ b/src/main/java/drzhark/mocreatures/init/MoCItems.java @@ -94,6 +94,8 @@ public class MoCItems { public static final MoCItem ancientSilverNugget = new MoCItem("ancientsilvernugget"); public static final MoCItem firestoneChunk = new MoCItem("firestonechunk"); //public static final MoCItemCrabClaw brackishClaw = new MoCItemCrabClaw("brackish_claw", 768, 15, 0.0F, 1, 2.0F); + // Doors - These need to be registered alongside the blocks + public static final MoCItemDoor wyvwoodDoor = new MoCItemDoor(MoCBlocks.wyvwoodDoor, "wyvwood_door"); // Food public static final MoCItemFood cookedTurkey = new MoCItemFood("turkeycooked", 7, 0.8F, true); public static final MoCItemFood crabraw = (MoCItemFood) new MoCItemFood("crabraw", 2, 0.1F, true).setPotionEffect(new PotionEffect(MobEffects.HUNGER, 30 * 20, 0), 0.8F); @@ -204,12 +206,12 @@ public class MoCItems { public static final MoCItemArmor helmetSilver = new MoCItemArmor("ancient_silver_helmet", silverARMOR, 4, EntityEquipmentSlot.HEAD); public static final MoCItemArmor legsSilver = new MoCItemArmor("ancient_silver_leggings", silverARMOR, 4, EntityEquipmentSlot.LEGS); public static final MoCItemArmor bootsSilver = new MoCItemArmor("ancient_silver_boots", silverARMOR, 4, EntityEquipmentSlot.FEET); - + @SubscribeEvent @SideOnly(Side.CLIENT) public static void registerRenders(final ModelRegistryEvent modelRegistryEvent) { - // All bow items go here - ModelLoader.setCustomModelResourceLocation(silverBow, 0, new ModelResourceLocation(silverBow.delegate.name(), "inventory")); + // All bow items go here + ModelLoader.setCustomModelResourceLocation(silverBow, 0, new ModelResourceLocation(silverBow.delegate.name(), "inventory")); } @Mod.EventBusSubscriber(modid = MoCConstants.MOD_ID) @@ -301,6 +303,7 @@ public static void registerItems(final RegistryEvent.Register event) { horsearmorcrystal, mysticPear, recordshuffle, + wyvwoodDoor, animalHide, rawTurkey, diff --git a/src/main/java/drzhark/mocreatures/item/MoCItemDoor.java b/src/main/java/drzhark/mocreatures/item/MoCItemDoor.java new file mode 100644 index 000000000..f7ee823bc --- /dev/null +++ b/src/main/java/drzhark/mocreatures/item/MoCItemDoor.java @@ -0,0 +1,15 @@ +package drzhark.mocreatures.item; + +import drzhark.mocreatures.MoCConstants; +import drzhark.mocreatures.MoCreatures; +import net.minecraft.block.Block; +import net.minecraft.item.ItemDoor; + +public class MoCItemDoor extends ItemDoor { + public MoCItemDoor(Block block, String name) { + super(block); + this.setCreativeTab(MoCreatures.tabMoC); + this.setRegistryName(MoCConstants.MOD_ID, name); + this.setTranslationKey(name); + } +} diff --git a/src/main/resources/assets/mocreatures/blockstates/wyvwood_door.json b/src/main/resources/assets/mocreatures/blockstates/wyvwood_door.json new file mode 100644 index 000000000..cbb01be94 --- /dev/null +++ b/src/main/resources/assets/mocreatures/blockstates/wyvwood_door.json @@ -0,0 +1,149 @@ +{ + "forge_marker": 1, + "defaults": { + "textures": { + "bottom": "mocreatures:blocks/door_wyvwood_lower", + "top": "mocreatures:blocks/door_wyvwood_upper" + } + }, + "variants": { + "normal": [ + { + "transform": "forge:default-item", + "model": "builtin/generated", + "textures": { + "layer0": "mocreatures:items/door_wyvwood" + } + } + ], + "inventory": [ + { + "transform": "forge:default-item", + "model": "builtin/generated", + "textures": { + "layer0": "mocreatures:items/door_wyvwood" + } + } + ], + "facing=east,half=lower,hinge=left,open=false": { + "model": "door_bottom" + }, + "facing=south,half=lower,hinge=left,open=false": { + "model": "door_bottom", + "y": 90 + }, + "facing=west,half=lower,hinge=left,open=false": { + "model": "door_bottom", + "y": 180 + }, + "facing=north,half=lower,hinge=left,open=false": { + "model": "door_bottom", + "y": 270 + }, + "facing=east,half=lower,hinge=right,open=false": { + "model": "door_bottom_rh" + }, + "facing=south,half=lower,hinge=right,open=false": { + "model": "door_bottom_rh", + "y": 90 + }, + "facing=west,half=lower,hinge=right,open=false": { + "model": "door_bottom_rh", + "y": 180 + }, + "facing=north,half=lower,hinge=right,open=false": { + "model": "door_bottom_rh", + "y": 270 + }, + "facing=east,half=lower,hinge=left,open=true": { + "model": "door_bottom_rh", + "y": 90 + }, + "facing=south,half=lower,hinge=left,open=true": { + "model": "door_bottom_rh", + "y": 180 + }, + "facing=west,half=lower,hinge=left,open=true": { + "model": "door_bottom_rh", + "y": 270 + }, + "facing=north,half=lower,hinge=left,open=true": { + "model": "door_bottom_rh" + }, + "facing=east,half=lower,hinge=right,open=true": { + "model": "door_bottom", + "y": 270 + }, + "facing=south,half=lower,hinge=right,open=true": { + "model": "door_bottom" + }, + "facing=west,half=lower,hinge=right,open=true": { + "model": "door_bottom", + "y": 90 + }, + "facing=north,half=lower,hinge=right,open=true": { + "model": "door_bottom", + "y": 180 + }, + "facing=east,half=upper,hinge=left,open=false": { + "model": "door_top" + }, + "facing=south,half=upper,hinge=left,open=false": { + "model": "door_top", + "y": 90 + }, + "facing=west,half=upper,hinge=left,open=false": { + "model": "door_top", + "y": 180 + }, + "facing=north,half=upper,hinge=left,open=false": { + "model": "door_top", + "y": 270 + }, + "facing=east,half=upper,hinge=right,open=false": { + "model": "door_top_rh" + }, + "facing=south,half=upper,hinge=right,open=false": { + "model": "door_top_rh", + "y": 90 + }, + "facing=west,half=upper,hinge=right,open=false": { + "model": "door_top_rh", + "y": 180 + }, + "facing=north,half=upper,hinge=right,open=false": { + "model": "door_top_rh", + "y": 270 + }, + "facing=east,half=upper,hinge=left,open=true": { + "model": "door_top_rh", + "y": 90 + }, + "facing=south,half=upper,hinge=left,open=true": { + "model": "door_top_rh", + "y": 180 + }, + "facing=west,half=upper,hinge=left,open=true": { + "model": "door_top_rh", + "y": 270 + }, + "facing=north,half=upper,hinge=left,open=true": { + "model": "door_top_rh" + }, + "facing=east,half=upper,hinge=right,open=true": { + "model": "door_top", + "y": 270 + }, + "facing=south,half=upper,hinge=right,open=true": { + "model": "door_top" + }, + "facing=west,half=upper,hinge=right,open=true": { + "model": "door_top", + "y": 90 + }, + "facing=north,half=upper,hinge=right,open=true": { + "model": "door_top", + "y": 180 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/mocreatures/lang/en_us.lang b/src/main/resources/assets/mocreatures/lang/en_us.lang index b429a94bf..8aba41327 100644 --- a/src/main/resources/assets/mocreatures/lang/en_us.lang +++ b/src/main/resources/assets/mocreatures/lang/en_us.lang @@ -45,12 +45,14 @@ tile.mocreatures.wyvstone_pressure_plate.name=Wyvstone Pressure Plate tile.mocreatures.wyvstone_stairs.name=Wyvstone Stairs tile.mocreatures.wyvstone_wall.name=Wyvstone Wall tile.mocreatures.wyvwood_button.name=Wyvwood Button +tile.mocreatures.wyvwood_door.name=Wyvwood Door tile.mocreatures.wyvwood_fence.name=Wyvwood Fence tile.mocreatures.wyvwood_fence_gate.name=Wyvwood Fence Gate tile.mocreatures.wyvwood_planks.name=Wyvwood Planks tile.mocreatures.wyvwood_pressure_plate.name=Wyvwood Pressure Plate tile.mocreatures.wyvwood_sapling.name=Wyvwood Sapling tile.mocreatures.wyvwood_stairs.name=Wyvwood Stairs +tile.mocreatures.wyvwood_trapdoor.name=Wyvwood Trapdoor [WIP] # ITEMS item.amuletbone.name=Bone Amulet @@ -277,6 +279,7 @@ item.venisoncooked.name=Cooked Venison item.venisonraw.name=Raw Venison item.whip.name=Whip item.woolball.name=Wool Ball +item.wyvwood_door.name=Wyvwood Door [WIP] # ENTITIES entity.mocreatures:anchovy.name=Anchovy diff --git a/src/main/resources/assets/mocreatures/recipes/wyvwood_door.json b/src/main/resources/assets/mocreatures/recipes/wyvwood_door.json new file mode 100644 index 000000000..699274aa0 --- /dev/null +++ b/src/main/resources/assets/mocreatures/recipes/wyvwood_door.json @@ -0,0 +1,17 @@ +{ + "type": "forge:ore_shaped", + "pattern": [ + "XX", + "XX", + "XX" + ], + "key": { + "X": { + "item": "mocreatures:wyvwood_planks" + } + }, + "result": { + "item": "mocreatures:wyvwood_door", + "count": 3 + } +} \ No newline at end of file diff --git a/src/main/resources/assets/mocreatures/textures/blocks/door_wyvwood_lower.png b/src/main/resources/assets/mocreatures/textures/blocks/door_wyvwood_lower.png new file mode 100644 index 000000000..f381dcc8e Binary files /dev/null and b/src/main/resources/assets/mocreatures/textures/blocks/door_wyvwood_lower.png differ diff --git a/src/main/resources/assets/mocreatures/textures/blocks/door_wyvwood_upper.png b/src/main/resources/assets/mocreatures/textures/blocks/door_wyvwood_upper.png new file mode 100644 index 000000000..2b2e4aee7 Binary files /dev/null and b/src/main/resources/assets/mocreatures/textures/blocks/door_wyvwood_upper.png differ diff --git a/src/main/resources/assets/mocreatures/textures/items/door_wyvwood.png b/src/main/resources/assets/mocreatures/textures/items/door_wyvwood.png new file mode 100644 index 000000000..3bf6662a3 Binary files /dev/null and b/src/main/resources/assets/mocreatures/textures/items/door_wyvwood.png differ