diff --git a/1.12/meta/update.json b/1.12/meta/update.json index 862c69d..83e4333 100644 --- a/1.12/meta/update.json +++ b/1.12/meta/update.json @@ -1,6 +1,7 @@ { "homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/", "1.12.2": { + "1.0.1-b3": "[A] Added inset light (glowstone-metal, light level like torch, can be used as floor/ceiling/wall light).\n[M] Crafting table model updated (issue #7, thanks majijn).\n[M] Logo image updated.", "1.0.1-b2": "[A] Added treated wood crafting table.\n[A] Added treated wood stool.\n[F] Fixed ladder bounding boxes to allow climbing connected trap doors (issue #6, thanks to Forgilageord).\n[M] Improved wall-block connections (wall elements only connect to other walls or gates, as well as to solid blocks if these blocks are in a straight line with at least two wall elements).\n[M] Decor walls are defined \"solid\" on top, so that e.g. torches and redstone tracks can be placed on them.", "1.0.1-b1": "[F] Fixed missing condition for ie:stone_deco in recipe constants.\n[A] Added clinker brick wall.", "1.0.0": "[R] Release based on v1.0.0-b4", @@ -11,6 +12,6 @@ }, "promos": { "1.12.2-recommended": "1.0.0", - "1.12.2-latest": "1.0.1-b2" + "1.12.2-latest": "1.0.1-b3" } } \ No newline at end of file diff --git a/1.12/readme.md b/1.12/readme.md index 5fa3fb1..fb99220 100644 --- a/1.12/readme.md +++ b/1.12/readme.md @@ -10,7 +10,10 @@ Mod sources for Minecraft version 1.12.2. ---- ## Revision history - - v1.0.1-b3 [A] Mod logo updated to an IE style design. + - v1.0.1-b3 [A] Added inset light (glowstone-metal, light level like torch, + can be used as floor/ceiling/wall light). + [M] Crafting table model updated (issue #7, thanks majijn). + [M] Logo image updated. - v1.0.1-b2 [A] Added treated wood crafting table. [A] Added treated wood stool. diff --git a/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecor.java b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecor.java index ce3d794..2a991a9 100644 --- a/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecor.java +++ b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecor.java @@ -41,10 +41,13 @@ public class BlockDecor extends Block // The config combines some aspects of blocks, allowing to define different behaviour at construction time, without excessive polymorphy. // It's an old school flag set as it is used internally only and shall not have as littlt impact on performance as possible. public final long config; + public static final long CFG_DEFAULT = 0x0000000000000000L; // no special config public static final long CFG_CUTOUT = 0x0000000000000001L; // cutout rendering public static final long CFG_HORIZIONTAL = 0x0000000000000002L; // horizontal block, affects bounding box calculation at construction time public static final long CFG_HORIZIONTAL_PLACEMENT = 0x0000000000000004L; // placed in the horizontzal direction the player is looking when placing. - public static final long CFG_WALL_DOOR_CONNECTION = 0x0000000000000008L; // wall block connects to fence gates and doors. + public static final long CFG_OPPOSITE_PLACEMENT = 0x0000000000000008L; // placed placed in the opposite direction of the face the player clicked. + public static final long CFG_LIGHT_VALUE_MASK = 0x00000000000000f0L; // fixed value for getLightValue() + public static final long CFG_LIGHT_VALUE_SHIFT = 4L; public BlockDecor(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound) { @@ -56,6 +59,7 @@ public class BlockDecor extends Block setHardness((hardness > 0) ? hardness : 5.0f); setResistance((resistance > 0) ? resistance : 10.0f); setSoundType((sound==null) ? SoundType.STONE : sound); + setLightOpacity(0); this.config = config; } @@ -148,6 +152,10 @@ public class BlockDecor extends Block public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos) {} + @Override + public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) + { return (int)((config & CFG_LIGHT_VALUE_MASK) >> CFG_LIGHT_VALUE_SHIFT); } + @Override public boolean canPlaceBlockOnSide(World world, BlockPos pos, EnumFacing side) { return super.canPlaceBlockOnSide(world, pos, side); } diff --git a/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorDirected.java b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorDirected.java index 0a0d798..7b7f647 100644 --- a/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorDirected.java +++ b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorDirected.java @@ -114,7 +114,7 @@ public class BlockDecorDirected extends BlockDecor return getDefaultState().withProperty(FACING, placer.getHorizontalFacing()); } else { // default: placement on the face the player clicking - return getDefaultState().withProperty(FACING, facing); + return getDefaultState().withProperty(FACING, ((config & CFG_OPPOSITE_PLACEMENT)==0) ? facing : facing.getOpposite()); } } } diff --git a/1.12/src/main/java/wile/engineersdecor/blocks/ModBlocks.java b/1.12/src/main/java/wile/engineersdecor/blocks/ModBlocks.java index e11abab..ed37653 100644 --- a/1.12/src/main/java/wile/engineersdecor/blocks/ModBlocks.java +++ b/1.12/src/main/java/wile/engineersdecor/blocks/ModBlocks.java @@ -44,16 +44,16 @@ public class ModBlocks public static final BlockDecorFull IRON_SHEET_ROOF_FULLBLOCK = new BlockDecorFull("iron_sheet_roof_block", 0, Material.IRON, 1.8f, 25f, SoundType.METAL); - public static final BlockDecorLadder METAL_RUNG_LADDER = new BlockDecorLadder("metal_rung_ladder", 0, Material.IRON, 1.8f, 25f, SoundType.METAL); - public static final BlockDecorLadder METAL_RUNG_STEPS = new BlockDecorLadder("metal_rung_steps", 0, Material.IRON, 1.8f, 25f, SoundType.METAL); + public static final BlockDecorLadder METAL_RUNG_LADDER = new BlockDecorLadder("metal_rung_ladder", 0, Material.IRON, 1.0f, 25f, SoundType.METAL); + public static final BlockDecorLadder METAL_RUNG_STEPS = new BlockDecorLadder("metal_rung_steps", 0, Material.IRON, 1.0f, 25f, SoundType.METAL); public static final BlockDecorLadder TREATED_WOOD_LADDER = new BlockDecorLadder("treated_wood_ladder", 0, Material.WOOD, 1.0f, 15f, SoundType.WOOD); public static final BlockDecorFull REBAR_CONCRETE_BLOCK = new BlockDecorFull("rebar_concrete", 0, Material.ROCK, 8f, 2000f, SoundType.STONE); public static final BlockDecorStairs REBAR_CONCRETE_STAIRS = new BlockDecorStairs("rebar_concrete_stairs", REBAR_CONCRETE_BLOCK.getDefaultState()); - public static final BlockDecorWall REBAR_CONCRETE_WALL = new BlockDecorWall("rebar_concrete_wall", BlockDecor.CFG_WALL_DOOR_CONNECTION, Material.ROCK, 8f, 2000f, SoundType.STONE); + public static final BlockDecorWall REBAR_CONCRETE_WALL = new BlockDecorWall("rebar_concrete_wall", BlockDecor.CFG_DEFAULT, Material.ROCK, 8f, 2000f, SoundType.STONE); - public static final BlockDecorWall CONCRETE_WALL = new BlockDecorWall("concrete_wall", BlockDecor.CFG_WALL_DOOR_CONNECTION, Material.ROCK, 8f, 50f, SoundType.STONE); - public static final BlockDecorWall CLINKER_BRICK_WALL = new BlockDecorWall("clinker_brick_wall", BlockDecor.CFG_WALL_DOOR_CONNECTION, Material.ROCK, 8f, 50f, SoundType.STONE); + public static final BlockDecorWall CONCRETE_WALL = new BlockDecorWall("concrete_wall", BlockDecor.CFG_DEFAULT, Material.ROCK, 8f, 50f, SoundType.STONE); + public static final BlockDecorWall CLINKER_BRICK_WALL = new BlockDecorWall("clinker_brick_wall", BlockDecor.CFG_DEFAULT, Material.ROCK, 8f, 50f, SoundType.STONE); public static final BlockDecorDirected TREATED_WOOD_POLE = new BlockDecorDirected( "treated_wood_pole", @@ -78,10 +78,15 @@ public class ModBlocks "treated_wood_crafting_table", BlockDecor.CFG_CUTOUT|BlockDecor.CFG_HORIZIONTAL_PLACEMENT|BlockDecor.CFG_HORIZIONTAL, Material.WOOD, 1.0f, 15f, SoundType.WOOD, - ModAuxiliaries.getPixeledAABB(0.5,0,3, 15.5,15.125,15.5) + ModAuxiliaries.getPixeledAABB(0.0,0,0, 16,15.9,16) ); - + public static final BlockDecorDirected INSET_LIGHT_IRON = new BlockDecorDirected( + "iron_inset_light", + BlockDecor.CFG_CUTOUT|BlockDecor.CFG_OPPOSITE_PLACEMENT|(14<