From fa94e86a516f3e3ae1673b6379ab98877e16a56b Mon Sep 17 00:00:00 2001 From: doctor4t <25477005+doctor4t@users.noreply.github.com> Date: Mon, 21 Sep 2020 16:35:32 +0200 Subject: [PATCH] Fix server crash upon bugball use --- CHANGELOG.md | 2 +- .../client/particle/aura/PrideParticle.java | 2 +- .../illuminations/common/entities/BugBallEntity.java | 10 ++++------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0629e2de..957c3ffe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Illuminations - Changelog ### Illuminations 1.1 - 1.16.3 -- Introduced bugballs: get them from a full composter (up to four) and throw them around to spawn fireflies! +- Introduced bugballs: get them from a full composter (up to four) and throw them around to spawn fireflies! (only available if Illuminations is installed on both server and clients) - Introduced overheads, a new type of cosmetic that can be equipped independently of auras and will float over your head - Added the Pride and Trans Pride overheads - Fixed an issue where server players using Illuminations would crash upon a player with an aura dying diff --git a/src/main/java/ladysnake/illuminations/client/particle/aura/PrideParticle.java b/src/main/java/ladysnake/illuminations/client/particle/aura/PrideParticle.java index 4d9ce3fe..f49b83d5 100644 --- a/src/main/java/ladysnake/illuminations/client/particle/aura/PrideParticle.java +++ b/src/main/java/ladysnake/illuminations/client/particle/aura/PrideParticle.java @@ -24,7 +24,7 @@ public PrideParticle(ClientWorld world, double x, double y, double z, double vel super(world, x, y, z, velocityX, velocityY, velocityZ, spriteProvider); this.alpha = 0; - this.maxAge = 40; + this.maxAge = 40000000; this.owner = world.getClosestPlayer((new TargetPredicate()).setBaseMaxDistance(1D), this.x, this.y, this.z); this.scale = 0.2f; diff --git a/src/main/java/ladysnake/illuminations/common/entities/BugBallEntity.java b/src/main/java/ladysnake/illuminations/common/entities/BugBallEntity.java index 1ba9a1fa..faf1f42b 100644 --- a/src/main/java/ladysnake/illuminations/common/entities/BugBallEntity.java +++ b/src/main/java/ladysnake/illuminations/common/entities/BugBallEntity.java @@ -70,13 +70,11 @@ protected void onCollision(HitResult hitResult) { this.world.setBlockState(this.getBlockPos(), Blocks.DIRT.getDefaultState()); world.breakBlock(this.getBlockPos(), false); } - } - - for (int i = 0; i < 100; i++) { - world.addParticle(IlluminationsClient.FIREFLY, (double)this.getBlockPos().getX() + this.random.nextDouble(), (double)this.getBlockPos().getY() + this.random.nextDouble(), (double)this.getBlockPos().getZ() + this.random.nextDouble(), 0.0D, 0.0D, 0.0D);; - } - if (!this.world.isClient) { + for (int i = 0; i < 100; i++) { + world.addParticle(IlluminationsClient.FIREFLY, (double) this.getBlockPos().getX() + this.random.nextDouble(), (double) this.getBlockPos().getY() + this.random.nextDouble(), (double) this.getBlockPos().getZ() + this.random.nextDouble(), 0.0D, 0.0D, 0.0D); + } + } else { this.world.sendEntityStatus(this, (byte)3); this.remove(); }