From 5572bd436abdeaeb66b5f0aa5e6593a2fe9a8530 Mon Sep 17 00:00:00 2001 From: Shroopy <46693163+Shroopy@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:36:56 -0800 Subject: [PATCH] remove running = false --- .../kinetics/press/PressingBehaviour.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/kinetics/press/PressingBehaviour.java b/src/main/java/com/simibubi/create/content/kinetics/press/PressingBehaviour.java index 8b3f6b06c5..a663480f56 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/press/PressingBehaviour.java +++ b/src/main/java/com/simibubi/create/content/kinetics/press/PressingBehaviour.java @@ -78,7 +78,7 @@ public void read(CompoundTag compound, boolean clientPacket) { if (clientPacket) { NBTHelper.iterateCompoundList(compound.getList("ParticleItems", Tag.TAG_COMPOUND), - c -> particleItems.add(ItemStack.of(c))); + c -> particleItems.add(ItemStack.of(c))); spawnParticles(); } } @@ -146,13 +146,13 @@ public void tick() { entityScanCooldown = ENTITY_SCAN; if (BlockEntityBehaviour.get(level, worldPosition.below(2), - TransportedItemStackHandlerBehaviour.TYPE) != null) + TransportedItemStackHandlerBehaviour.TYPE) != null) return; if (BasinBlock.isBasin(level, worldPosition.below(2))) return; for (ItemEntity itemEntity : level.getEntitiesOfClass(ItemEntity.class, - new AABB(worldPosition.below()).deflate(.125f))) { + new AABB(worldPosition.below()).deflate(.125f))) { if (!itemEntity.isAlive() || !itemEntity.onGround()) continue; if (!specifics.tryProcessInWorld(itemEntity, true)) @@ -178,11 +178,11 @@ public void tick() { applyOnBasin(); if (level.getBlockState(worldPosition.below(2)) - .getSoundType() == SoundType.WOOL) + .getSoundType() == SoundType.WOOL) AllSoundEvents.MECHANICAL_PRESS_ACTIVATION_ON_BELT.playOnServer(level, worldPosition); else AllSoundEvents.MECHANICAL_PRESS_ACTIVATION.playOnServer(level, worldPosition, .5f, - .75f + (Math.abs(specifics.getKineticSpeed()) / 1024f)); + .75f + (Math.abs(specifics.getKineticSpeed()) / 1024f)); if (!level.isClientSide) blockEntity.sendData(); @@ -190,7 +190,6 @@ public void tick() { if (!level.isClientSide && runningTicks > CYCLE) { finished = true; - running = false; particleItems.clear(); specifics.onPressingCompleted(); blockEntity.sendData(); @@ -258,13 +257,14 @@ protected void spawnParticles() { if (mode == Mode.BASIN) particleItems - .forEach(stack -> makeCompactingParticleEffect(VecHelper.getCenterOf(worldPosition.below(2)), stack)); + .forEach(stack -> makeCompactingParticleEffect(VecHelper.getCenterOf(worldPosition.below(2)), + stack)); if (mode == Mode.BELT) particleItems.forEach(stack -> makePressingParticleEffect(VecHelper.getCenterOf(worldPosition.below(2)) - .add(0, 8 / 16f, 0), stack)); + .add(0, 8 / 16f, 0), stack)); if (mode == Mode.WORLD) particleItems.forEach(stack -> makePressingParticleEffect(VecHelper.getCenterOf(worldPosition.below(1)) - .add(0, -1 / 4f, 0), stack)); + .add(0, -1 / 4f, 0), stack)); particleItems.clear(); } @@ -279,10 +279,10 @@ public void makePressingParticleEffect(Vec3 pos, ItemStack stack, int amount) { return; for (int i = 0; i < amount; i++) { Vec3 motion = VecHelper.offsetRandomly(Vec3.ZERO, level.random, .125f) - .multiply(1, 0, 1); + .multiply(1, 0, 1); motion = motion.add(0, amount != 1 ? 0.125f : 1 / 16f, 0); level.addParticle(new ItemParticleOption(ParticleTypes.ITEM, stack), pos.x, pos.y - .25f, pos.z, motion.x, - motion.y, motion.z); + motion.y, motion.z); } } @@ -292,9 +292,9 @@ public void makeCompactingParticleEffect(Vec3 pos, ItemStack stack) { return; for (int i = 0; i < 20; i++) { Vec3 motion = VecHelper.offsetRandomly(Vec3.ZERO, level.random, .175f) - .multiply(1, 0, 1); + .multiply(1, 0, 1); level.addParticle(new ItemParticleOption(ParticleTypes.ITEM, stack), pos.x, pos.y, pos.z, motion.x, - motion.y + .25f, motion.z); + motion.y + .25f, motion.z); } }