From 16ad286f593b88ed6d06461510e1b539707002d0 Mon Sep 17 00:00:00 2001 From: stfwi Date: Sun, 13 Sep 2020 14:53:56 +0200 Subject: [PATCH] Fixed Double-T support thick steel pole connection. Concrete and Clinker walls connect to windows and glass panes. --- build.gradle | 16 ++++--- gradle.properties | 2 +- meta/update.json | 5 +- readme.md | 3 ++ .../java/wile/engineersdecor/ModContent.java | 5 +- .../blocks/EdHorizontalSupportBlock.java | 48 ++++++++++++------- .../engineersdecor/blocks/EdWallBlock.java | 15 +++++- .../libmc/blocks/VariantWallBlock.java | 2 +- .../blockstates/steel_double_t_support.json | 2 +- 9 files changed, 67 insertions(+), 31 deletions(-) diff --git a/build.gradle b/build.gradle index 15abcd7..47fe2d5 100644 --- a/build.gradle +++ b/build.gradle @@ -93,14 +93,18 @@ def reobfArtifact = artifacts.add('default', reobfFile) { type 'jar'; builtBy 'r def signing = { -> def sp = new Properties() - sp.keystore_file = project.keystore_file - sp.keystore_alias = project.keystore_alias - sp.keystore_pass = project.keystore_pass - sp.keystore_keypass = project.keystore_keypass - sp.fingerprint_sha1 = project.fingerprint_sha1 + if(project.hasProperty("keystore_file")) { + sp.keystore_file = project.keystore_file + sp.keystore_alias = project.keystore_alias + sp.keystore_pass = project.keystore_pass + sp.keystore_keypass = project.keystore_keypass + sp.fingerprint_sha1 = project.fingerprint_sha1 + } else { + logger.warn("[WARNING] No signing data available.") + } if(file("signing.properties").exists()) file("signing.properties").withInputStream { sp.load(it) } return sp -}(); +}() task signJar(type: SignJar, dependsOn: jar) { onlyIf { signing.hasProperty("keystore_file") } if(signing.hasProperty("keystore_file")) { diff --git a/gradle.properties b/gradle.properties index eb48707..656ee0e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,4 +5,4 @@ version_minecraft=1.16.3 version_forge_minecraft=1.16.3-34.0.1 version_fml_mappings=20200723-1.16.1 version_jei=1.16.3:7.1.3.19 -version_engineersdecor=1.1.2-b7 +version_engineersdecor=1.1.2-b8 diff --git a/meta/update.json b/meta/update.json index 09e3be7..cab8028 100644 --- a/meta/update.json +++ b/meta/update.json @@ -1,6 +1,7 @@ { "homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/", "1.16.3": { + "1.1.2-b8": "[F] Fixed Double-T support thick steel pole connection (thx @CastCrafter).\n[A] Concrete and Clinker walls connect to windows and glass panes.", "1.1.2-b7": "[U] Ported to MC1.16.3.\n[F] Roof lighting improved.", "1.1.2-b6": "[A] Signs added: Generic Caution, Magical Hazard, Radioactive Hazard, Laser Hazard, Fire Hazard, Caution Hot Surface, Magnetic Field Caution, Frost Warning.\n[A] Water Freezer added (generates Ice, Packed Ice, Blue Ice from water).\n[F] Mineral Smelter GUI model facing fixed.\n[M] Hatch handling improved.\n[M] Ladder fast-move improved.\n[F] Roof Chimney Trunk shape hollow to allow feeding IE Wire power over the roof into the building.\n[A] Roof Chimney added (smoking offset for Dark Shingle Roof Chimney Trunk block).\n[A] Metal Bar (ingredient item) added to circumvent recipe collisions with other mods.\n[M] Recipes for metallic blocks modified accordingly to depend on Metal Bars.", "1.1.2-b5": "[A] Sandstone Ornamented Clinker Brick added.\n[A] Old Industrial Wood Planks/Stairs/Slabs/Slab Slices added.\n[A] Old Industrial Wood Door added.\n[M] Wood textures made slightly darker.\n[F] Milking Machine fluid transfer re-added (thx gebcrafter).\n[F] Fluid Barrel status overlay message format fixed.\n[F] Fixed missing Dense Grit Dirt loot table (issue #124, thx vaelzan).", @@ -10,7 +11,7 @@ "1.1.2-b1": "[U] Ported to MC1.16.2." }, "promos": { - "1.16.3-recommended": "1.1.2-b7", - "1.16.3-latest": "1.1.2-b7" + "1.16.3-recommended": "1.1.2-b8", + "1.16.3-latest": "1.1.2-b8" } } \ No newline at end of file diff --git a/readme.md b/readme.md index 36bc055..6be245d 100644 --- a/readme.md +++ b/readme.md @@ -11,6 +11,9 @@ Mod sources for Minecraft version 1.16.3. ## Version history + - v1.1.2-b8 [F] Fixed Double-T support thick steel pole connection (thx @CastCrafter). + [A] Concrete and Clinker walls connect to windows and glass panes. + - v1.1.2-b7 [U] Ported to MC1.16.3. [F] Roof lighting improved. diff --git a/src/main/java/wile/engineersdecor/ModContent.java b/src/main/java/wile/engineersdecor/ModContent.java index f8c4f7c..65a9567 100644 --- a/src/main/java/wile/engineersdecor/ModContent.java +++ b/src/main/java/wile/engineersdecor/ModContent.java @@ -484,7 +484,10 @@ public class ModContent public static final EdHorizontalSupportBlock STEEL_DOUBLE_T_SUPPORT = (EdHorizontalSupportBlock)(new EdHorizontalSupportBlock( DecorBlock.CFG_CUTOUT|DecorBlock.CFG_HORIZIONTAL|DecorBlock.CFG_LOOK_PLACEMENT, Block.Properties.create(Material.IRON, MaterialColor.IRON).hardnessAndResistance(2f, 15f).sound(SoundType.METAL).notSolid(), - Auxiliaries.getPixeledAABB(5,11,0, 11,16,16) + Auxiliaries.getPixeledAABB( 5,11,0, 11,16,16), // main beam + Auxiliaries.getPixeledAABB(10,11,5, 16,16,11), // east beam (also for west 180deg) + Auxiliaries.getPixeledAABB( 6, 0,6, 10,16,10), // down thin + Auxiliaries.getPixeledAABB( 5, 0,5, 11,16,11) // down thick )).setRegistryName(new ResourceLocation(MODID, "steel_double_t_support")); // ------------------------------------------------------------------------------------------------------------------- diff --git a/src/main/java/wile/engineersdecor/blocks/EdHorizontalSupportBlock.java b/src/main/java/wile/engineersdecor/blocks/EdHorizontalSupportBlock.java index 70d243c..ed96794 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdHorizontalSupportBlock.java +++ b/src/main/java/wile/engineersdecor/blocks/EdHorizontalSupportBlock.java @@ -9,12 +9,9 @@ */ package wile.engineersdecor.blocks; -import net.minecraft.entity.EntitySpawnPlacementRegistry; -import wile.engineersdecor.ModContent; -import wile.engineersdecor.libmc.detail.Auxiliaries; -import net.minecraft.entity.EntityType; -import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.block.Block; +import net.minecraft.entity.EntitySpawnPlacementRegistry; +import net.minecraft.entity.EntityType; import net.minecraft.item.BlockItemUseContext; import net.minecraft.state.BooleanProperty; import net.minecraft.state.IntegerProperty; @@ -22,15 +19,20 @@ import net.minecraft.state.StateContainer; import net.minecraft.util.*; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShapes; +import net.minecraft.util.math.shapes.IBooleanFunction; +import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.world.IBlockReader; import net.minecraft.world.IWorld; import net.minecraft.world.World; import net.minecraft.block.BlockState; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; +import wile.engineersdecor.ModContent; +import wile.engineersdecor.libmc.detail.Auxiliaries; + import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; public class EdHorizontalSupportBlock extends DecorBlock.WaterLoggable implements IDecorBlock @@ -39,19 +41,29 @@ public class EdHorizontalSupportBlock extends DecorBlock.WaterLoggable implement public static final BooleanProperty LEFTBEAM = BooleanProperty.create("leftbeam"); public static final BooleanProperty RIGHTBEAM = BooleanProperty.create("rightbeam"); public static final IntegerProperty DOWNCONNECT = IntegerProperty.create("downconnect", 0, 2); - protected final ArrayList AABBs; + protected final Map AABBs; - public EdHorizontalSupportBlock(long config, Block.Properties builder, final AxisAlignedBB unrotatedAABB) + public EdHorizontalSupportBlock(long config, Block.Properties builder, final AxisAlignedBB mainBeamAABB, final AxisAlignedBB eastBeamAABB, final AxisAlignedBB thinDownBeamAABB, final AxisAlignedBB thickDownBeamAABB) { super(config|DecorBlock.CFG_HORIZIONTAL, builder); - AABBs = new ArrayList(Arrays.asList( - // Effective bounding box - VoxelShapes.create(Auxiliaries.getRotatedAABB(unrotatedAABB.grow(2.0/16, 0, 0), Direction.NORTH, true)), - VoxelShapes.create(Auxiliaries.getRotatedAABB(unrotatedAABB.grow(2.0/16, 0, 0), Direction.WEST, true)), - // Displayed bounding box - VoxelShapes.create(Auxiliaries.getRotatedAABB(unrotatedAABB, Direction.NORTH, true)), - VoxelShapes.create(Auxiliaries.getRotatedAABB(unrotatedAABB, Direction.WEST, true)) - )); + Map aabbs = new HashMap<>(); + for(boolean eastwest:EASTWEST.getAllowedValues()) { + for(boolean leftbeam:LEFTBEAM.getAllowedValues()) { + for(boolean rightbeam:RIGHTBEAM.getAllowedValues()) { + for(int downconnect:DOWNCONNECT.getAllowedValues()) { + final BlockState state = getDefaultState().with(EASTWEST, eastwest).with(LEFTBEAM, leftbeam).with(RIGHTBEAM, rightbeam).with(DOWNCONNECT, downconnect); + VoxelShape shape = VoxelShapes.create(Auxiliaries.getRotatedAABB(mainBeamAABB, eastwest?Direction.EAST:Direction.NORTH, true)); + if(rightbeam) shape = VoxelShapes.combine(shape, VoxelShapes.create(Auxiliaries.getRotatedAABB(eastBeamAABB, eastwest?Direction.EAST:Direction.NORTH, true)), IBooleanFunction.OR); + if(leftbeam) shape = VoxelShapes.combine(shape, VoxelShapes.create(Auxiliaries.getRotatedAABB(eastBeamAABB, eastwest?Direction.WEST:Direction.SOUTH, true)), IBooleanFunction.OR); + if(downconnect==1) shape = VoxelShapes.combine(shape, VoxelShapes.create(thinDownBeamAABB), IBooleanFunction.OR); + if(downconnect==2) shape = VoxelShapes.combine(shape, VoxelShapes.create(thickDownBeamAABB), IBooleanFunction.OR); + aabbs.put(state.with(WATERLOGGED, false), shape); + aabbs.put(state.with(WATERLOGGED, true), shape); + } + } + } + } + AABBs = aabbs; } @Override @@ -68,7 +80,7 @@ public class EdHorizontalSupportBlock extends DecorBlock.WaterLoggable implement @Override public VoxelShape getShape(BlockState state, IBlockReader source, BlockPos pos, ISelectionContext selectionContext) - { return AABBs.get(state.get(EASTWEST) ? 0x1 : 0x0); } + { return AABBs.get(state); } @Override public VoxelShape getCollisionShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext selectionContext) diff --git a/src/main/java/wile/engineersdecor/blocks/EdWallBlock.java b/src/main/java/wile/engineersdecor/blocks/EdWallBlock.java index a43cf68..5a999f9 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdWallBlock.java +++ b/src/main/java/wile/engineersdecor/blocks/EdWallBlock.java @@ -8,11 +8,24 @@ */ package wile.engineersdecor.blocks; -import wile.engineersdecor.libmc.blocks.VariantWallBlock; import net.minecraft.block.*; +import net.minecraft.util.Direction; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.IWorldReader; +import wile.engineersdecor.libmc.blocks.VariantWallBlock; + public class EdWallBlock extends VariantWallBlock implements IDecorBlock { public EdWallBlock(long config, Block.Properties builder) { super(config, builder); } + + protected boolean attachesTo(BlockState facingState, IWorldReader world, BlockPos facingPos, Direction side) + { + if(facingState==null) return false; + if(super.attachesTo(facingState, world, facingPos, side)) return true; + if(facingState.getBlock() instanceof EdWindowBlock) return true; + if(facingState.getBlock() instanceof PaneBlock) return true; + return false; + } } diff --git a/src/main/java/wile/engineersdecor/libmc/blocks/VariantWallBlock.java b/src/main/java/wile/engineersdecor/libmc/blocks/VariantWallBlock.java index 89e575e..1de9728 100644 --- a/src/main/java/wile/engineersdecor/libmc/blocks/VariantWallBlock.java +++ b/src/main/java/wile/engineersdecor/libmc/blocks/VariantWallBlock.java @@ -132,7 +132,7 @@ public class VariantWallBlock extends WallBlock implements StandardBlocks.IStand protected void fillStateContainer(StateContainer.Builder builder) { super.fillStateContainer(builder); builder.add(TEXTURE_VARIANT); } - private boolean attachesTo(BlockState facingState, IWorldReader world, BlockPos facingPos, Direction side) + protected boolean attachesTo(BlockState facingState, IWorldReader world, BlockPos facingPos, Direction side) { final Block block = facingState.getBlock(); if((block instanceof FenceGateBlock) || (block instanceof WallBlock)) return true; diff --git a/src/main/resources/assets/engineersdecor/blockstates/steel_double_t_support.json b/src/main/resources/assets/engineersdecor/blockstates/steel_double_t_support.json index 53b98f0..f85abcb 100644 --- a/src/main/resources/assets/engineersdecor/blockstates/steel_double_t_support.json +++ b/src/main/resources/assets/engineersdecor/blockstates/steel_double_t_support.json @@ -14,6 +14,6 @@ },{ "when": { "downconnect" : "1" }, "apply": { "model": "engineersdecor:block/hsupport/steel_double_t_support_xconnect_thin_pole_model" } },{ "when": { "downconnect" : "2" }, - "apply": { "model": "engineersdecor:block/hsupport/steel_double_t_support_xconnect_thin_pole_model" } + "apply": { "model": "engineersdecor:block/hsupport/steel_double_t_support_xconnect_thick_pole_model" } } ]}