From ddbf4a0cd26490843eb2ecc37e77739825312b26 Mon Sep 17 00:00:00 2001 From: Thutmose Date: Mon, 14 Nov 2022 09:53:42 -0500 Subject: [PATCH] another round of elevator adjustments This makes changes to hitboxes of the elevator while it is moving, to help with some issues in high latency environments, when the server and client have different ideas as to what blocks are colliding with the player. --- build.gradle | 13 ----- .../entity/blockentity/BlockEntityBase.java | 2 +- .../entity/blockentity/block/TempBlock.java | 52 ++++++++++++++++--- .../entity/blockentity/block/TempTile.java | 1 - 4 files changed, 47 insertions(+), 21 deletions(-) diff --git a/build.gradle b/build.gradle index b4305e5095..9030072a81 100644 --- a/build.gradle +++ b/build.gradle @@ -113,19 +113,6 @@ minecraft { MainMods { sources sourceSets.main } } } - data = { - workingDirectory project.file('run') - //property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' - properties 'mixin.env.remapRefMap': 'true' - property 'mixin.env.refMapRemappingFile', "${project.projectDir}/build/createSrgToMcp/output.srg" - property 'forge.logging.console.level', 'debug' - args '--mod', 'pokecube', '--all', '--output', file('src/generated/resources/'), '--existing', sourceSets.main.resources.srcDirs[0] - mods { - pokecube { - source sourceSets.main - } - } - } } } diff --git a/src/main/java/thut/api/entity/blockentity/BlockEntityBase.java b/src/main/java/thut/api/entity/blockentity/BlockEntityBase.java index b7792a170f..14d3007867 100644 --- a/src/main/java/thut/api/entity/blockentity/BlockEntityBase.java +++ b/src/main/java/thut/api/entity/blockentity/BlockEntityBase.java @@ -296,7 +296,7 @@ public void checkCollision() var entityR = this.position().add(pos.x(), pos.y(), pos.z()); - if (newVy > 0) entityR = entityR.add(0, newVy, 0); + if (newVy > 0) entityR = entityR.add(0, 0, 0); var entityO = this.position().subtract(xo, yo, zo); double x = entity.getX(); diff --git a/src/main/java/thut/api/entity/blockentity/block/TempBlock.java b/src/main/java/thut/api/entity/blockentity/block/TempBlock.java index b2aabc6c9e..84664f648d 100644 --- a/src/main/java/thut/api/entity/blockentity/block/TempBlock.java +++ b/src/main/java/thut/api/entity/blockentity/block/TempBlock.java @@ -47,6 +47,9 @@ public static TempBlock make() private static boolean solidCheck(final BlockState state, final BlockGetter reader, final BlockPos pos) { + BlockEntity be = reader.getBlockEntity(pos); + if (be instanceof TempTile temp && temp.getEffectiveState() != null) + return temp.getEffectiveState().isRedstoneConductor(reader, pos); return false; } @@ -125,13 +128,25 @@ protected void createBlockStateDefinition(final StateDefinition.Builder