mirror of
https://github.com/Xiao-MoMi/Custom-Fishing.git
synced 2026-01-06 15:51:50 +00:00
fix particles on 1.21.9
This commit is contained in:
@@ -25,6 +25,7 @@ import net.momirealms.customfishing.api.mechanic.context.ContextKeys;
|
||||
import net.momirealms.customfishing.api.mechanic.effect.Effect;
|
||||
import net.momirealms.customfishing.api.mechanic.effect.EffectProperties;
|
||||
import net.momirealms.customfishing.api.util.EventUtils;
|
||||
import net.momirealms.customfishing.common.helper.VersionHelper;
|
||||
import net.momirealms.customfishing.common.plugin.scheduler.SchedulerTask;
|
||||
import net.momirealms.customfishing.common.util.RandomUtils;
|
||||
import org.bukkit.Location;
|
||||
@@ -40,7 +41,6 @@ import java.util.Objects;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class VoidFishingMechanic implements HookMechanic {
|
||||
|
||||
private final FishHook hook;
|
||||
private final Effect gearsEffect;
|
||||
private final Context<Player> context;
|
||||
@@ -156,7 +156,11 @@ public class VoidFishingMechanic implements HookMechanic {
|
||||
d0 = location.getX() + Math.sin(f1) * f2 * 0.1D;
|
||||
d1 = location.getY();
|
||||
d2 = location.getZ() + Math.cos(f1) * f2 * 0.1D;
|
||||
hook.getWorld().spawnParticle(Particle.DRAGON_BREATH, d0, d1, d2, 2 + RandomUtils.generateRandomInt(0,1), 0.10000000149011612D, 0.0D, 0.10000000149011612D, 0.0D, 0F);
|
||||
if (VersionHelper.isVersionNewerThan1_21_9()) {
|
||||
this.hook.getWorld().spawnParticle(Particle.DRAGON_BREATH, d0, d1, d2, 2 + RandomUtils.generateRandomInt(0,1), 0.10000000149011612D, 0.0D, 0.10000000149011612D, 0.0D, 0f);
|
||||
} else {
|
||||
this.hook.getWorld().spawnParticle(Particle.DRAGON_BREATH, d0, d1, d2, 2 + RandomUtils.generateRandomInt(0,1), 0.10000000149011612D, 0.0D, 0.10000000149011612D, 0.0D);
|
||||
}
|
||||
}
|
||||
if (this.timeUntilLured <= 0) {
|
||||
this.fishAngle = RandomUtils.generateRandomFloat(0F, 360F);
|
||||
|
||||
@@ -22,16 +22,17 @@ import org.bukkit.util.io.BukkitObjectInputStream;
|
||||
import org.bukkit.util.io.BukkitObjectOutputStream;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.yaml.snakeyaml.external.biz.base64Coder.Base64Coder;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Base64;
|
||||
|
||||
/**
|
||||
* Utility class for working with Bukkit Inventories and item stacks.
|
||||
*/
|
||||
public class InventoryUtils {
|
||||
private static final String systemLineSeparator = System.lineSeparator();
|
||||
|
||||
private InventoryUtils() {
|
||||
}
|
||||
@@ -56,7 +57,7 @@ public class InventoryUtils {
|
||||
dataOutput.close();
|
||||
byte[] byteArr = outputStream.toByteArray();
|
||||
outputStream.close();
|
||||
return Base64Coder.encodeLines(byteArr);
|
||||
return Base64.getEncoder().encodeToString(byteArr);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
@@ -75,7 +76,7 @@ public class InventoryUtils {
|
||||
if (base64 == null || base64.isEmpty()) return new ItemStack[]{};
|
||||
ByteArrayInputStream inputStream;
|
||||
try {
|
||||
inputStream = new ByteArrayInputStream(Base64Coder.decodeLines(base64));
|
||||
inputStream = new ByteArrayInputStream(Base64.getDecoder().decode(base64));
|
||||
} catch (IllegalArgumentException ignored) {
|
||||
return new ItemStack[]{};
|
||||
}
|
||||
|
||||
@@ -27,9 +27,7 @@ import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||
import net.kyori.adventure.text.serializer.json.JSONOptions;
|
||||
import net.kyori.adventure.text.serializer.json.legacyimpl.NBTLegacyHoverEventSerializer;
|
||||
import net.kyori.adventure.title.Title;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
|
||||
@@ -141,6 +141,10 @@ public class VersionHelper {
|
||||
return version >= 12105;
|
||||
}
|
||||
|
||||
public static boolean isVersionNewerThan1_21_9() {
|
||||
return version >= 12109;
|
||||
}
|
||||
|
||||
public static boolean isFolia() {
|
||||
return folia;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import dev.dejvokep.boostedyaml.block.implementation.Section;
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import net.kyori.adventure.sound.Sound;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.momirealms.customfishing.api.BukkitCustomFishingPlugin;
|
||||
import net.momirealms.customfishing.api.mechanic.action.Action;
|
||||
import net.momirealms.customfishing.api.mechanic.action.ActionExpansion;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
package net.momirealms.customfishing.bukkit.competition;
|
||||
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
import net.momirealms.customfishing.api.BukkitCustomFishingPlugin;
|
||||
import net.momirealms.customfishing.api.event.CompetitionEvent;
|
||||
import net.momirealms.customfishing.api.mechanic.action.Action;
|
||||
@@ -51,7 +50,6 @@ import java.time.Instant;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class Competition implements FishingCompetition {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Project settings
|
||||
# Rule: [major update].[feature update].[bug fix]
|
||||
project_version=2.3.19.2
|
||||
project_version=2.3.19.3
|
||||
config_version=38
|
||||
project_group=net.momirealms
|
||||
|
||||
|
||||
Reference in New Issue
Block a user