Merge pull request #5192 from laxadeR/fix-elevator-contacts

Fixed wrong elevator contacts powering sometimes
This commit is contained in:
simibubi 2023-09-20 10:00:34 +02:00 committed by GitHub
commit 72882f89c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,14 +82,14 @@ public class ElevatorPulleyBlockEntity extends PulleyBlockEntity {
double y = movedContraption.getY();
int targetLevel = Mth.floor(0.5f + y) + ec.contactYOffset;
Integer ecCurrentTargetY = ec.getCurrentTargetY(level);
if (ecCurrentTargetY != null)
targetLevel = ecCurrentTargetY;
if (level.isClientSide())
targetLevel = ec.clientYTarget;
if (!wasArrived && !level.isClientSide()) {
triggerContact(ec, targetLevel);
triggerContact(ec, targetLevel - ec.contactYOffset);
AllSoundEvents.CONTRAPTION_DISASSEMBLE.play(level, null, worldPosition.below((int) offset), 0.75f, 0.8f);
}