mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-29 03:59:06 +00:00
Cleanup
This commit is contained in:
@@ -18,109 +18,87 @@
|
||||
|
||||
package com.volmit.iris.util.collection;
|
||||
|
||||
public class StateList
|
||||
{
|
||||
private final KList<String> states;
|
||||
public class StateList {
|
||||
private final KList<String> states;
|
||||
|
||||
public StateList(String... states)
|
||||
{
|
||||
this.states = new KList<String>(states);
|
||||
public StateList(String... states) {
|
||||
this.states = new KList<String>(states);
|
||||
|
||||
if(getBits() > 64)
|
||||
{
|
||||
throw new RuntimeException("StateLists cannot exceed 64 bits! You are trying to use " + getBits() + " bits!");
|
||||
}
|
||||
}
|
||||
if (getBits() > 64) {
|
||||
throw new RuntimeException("StateLists cannot exceed 64 bits! You are trying to use " + getBits() + " bits!");
|
||||
}
|
||||
}
|
||||
|
||||
public StateList(Enum<?>... states)
|
||||
{
|
||||
this.states = new KList<Enum<?>>().convert(Enum::name);
|
||||
public StateList(Enum<?>... states) {
|
||||
this.states = new KList<Enum<?>>().convert(Enum::name);
|
||||
|
||||
if(getBits() > 64)
|
||||
{
|
||||
throw new RuntimeException("StateLists cannot exceed 64 bits! You are trying to use " + getBits() + " bits!");
|
||||
}
|
||||
}
|
||||
if (getBits() > 64) {
|
||||
throw new RuntimeException("StateLists cannot exceed 64 bits! You are trying to use " + getBits() + " bits!");
|
||||
}
|
||||
}
|
||||
|
||||
public long max()
|
||||
{
|
||||
return (long) (Math.pow(2, getBits()) - 1);
|
||||
}
|
||||
public long max() {
|
||||
return (long) (Math.pow(2, getBits()) - 1);
|
||||
}
|
||||
|
||||
public KList<String> getEnabled(long list)
|
||||
{
|
||||
KList<String> f = new KList<>();
|
||||
public KList<String> getEnabled(long list) {
|
||||
KList<String> f = new KList<>();
|
||||
|
||||
for(String i : states)
|
||||
{
|
||||
if(is(list, i))
|
||||
{
|
||||
f.add(i);
|
||||
}
|
||||
}
|
||||
for (String i : states) {
|
||||
if (is(list, i)) {
|
||||
f.add(i);
|
||||
}
|
||||
}
|
||||
|
||||
return f;
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
public long of(String... enabledStates)
|
||||
{
|
||||
long b = 0;
|
||||
public long of(String... enabledStates) {
|
||||
long b = 0;
|
||||
|
||||
for(String i : enabledStates)
|
||||
{
|
||||
b |= getBit(i);
|
||||
}
|
||||
for (String i : enabledStates) {
|
||||
b |= getBit(i);
|
||||
}
|
||||
|
||||
return b;
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
public long set(long list, String state, boolean enabled)
|
||||
{
|
||||
long bit = getBit(state);
|
||||
boolean is = is(list, state);
|
||||
public long set(long list, String state, boolean enabled) {
|
||||
long bit = getBit(state);
|
||||
boolean is = is(list, state);
|
||||
|
||||
if(enabled && !is)
|
||||
{
|
||||
return list | bit;
|
||||
}
|
||||
if (enabled && !is) {
|
||||
return list | bit;
|
||||
} else if (!enabled && is) {
|
||||
return list ^ bit;
|
||||
}
|
||||
|
||||
else if(!enabled && is)
|
||||
{
|
||||
return list ^ bit;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
public boolean is(long list, String state) {
|
||||
long bit = getBit(state);
|
||||
|
||||
public boolean is(long list, String state)
|
||||
{
|
||||
long bit = getBit(state);
|
||||
return bit > 0 && (list & bit) == bit;
|
||||
}
|
||||
|
||||
return bit > 0 && (list & bit) == bit;
|
||||
}
|
||||
public boolean hasBit(String state) {
|
||||
return getBit(state) > 0;
|
||||
}
|
||||
|
||||
public boolean hasBit(String state)
|
||||
{
|
||||
return getBit(state) > 0;
|
||||
}
|
||||
public long getBit(String state) {
|
||||
return getBit(states.indexOf(state));
|
||||
}
|
||||
|
||||
public long getBit(String state)
|
||||
{
|
||||
return getBit(states.indexOf(state));
|
||||
}
|
||||
public long getBit(int index) {
|
||||
return (long) (index < 0 ? -1 : Math.pow(2, index));
|
||||
}
|
||||
|
||||
public long getBit(int index)
|
||||
{
|
||||
return (long) (index < 0 ? -1 : Math.pow(2, index));
|
||||
}
|
||||
public int getBytes() {
|
||||
return getBits() == 0 ? 0 : ((getBits() >> 2) + 1);
|
||||
}
|
||||
|
||||
public int getBytes()
|
||||
{
|
||||
return getBits() == 0 ? 0 : ((getBits() >> 2) + 1);
|
||||
}
|
||||
|
||||
public int getBits()
|
||||
{
|
||||
return states.size();
|
||||
}
|
||||
public int getBits() {
|
||||
return states.size();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -384,13 +384,9 @@ public enum C {
|
||||
C o = C.getByChar(i);
|
||||
|
||||
if (hrad != 0 || srad != 0 || vrad != 0) {
|
||||
if(pulse > 0)
|
||||
{
|
||||
if (pulse > 0) {
|
||||
b.append(VolmitSender.pulse(spinToHex(o, hrad, srad, vrad), spinToHex(o, -hrad, -srad, -vrad), pulse));
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
} else {
|
||||
b.append("<gradient:")
|
||||
.append(spinToHex(o, hrad, srad, vrad))
|
||||
.append(":")
|
||||
|
||||
@@ -24,8 +24,7 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class InstanceState {
|
||||
public static int getInstanceId()
|
||||
{
|
||||
public static int getInstanceId() {
|
||||
try {
|
||||
return Integer.parseInt(IO.readAll(instanceFile()).trim());
|
||||
} catch (Throwable e) {
|
||||
@@ -35,8 +34,7 @@ public class InstanceState {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static void updateInstanceId()
|
||||
{
|
||||
public static void updateInstanceId() {
|
||||
try {
|
||||
IO.writeAll(instanceFile(), RNG.r.imax() + "");
|
||||
} catch (IOException e) {
|
||||
@@ -44,8 +42,7 @@ public class InstanceState {
|
||||
}
|
||||
}
|
||||
|
||||
private static File instanceFile()
|
||||
{
|
||||
private static File instanceFile() {
|
||||
File f = new File("plugins/Iris/cache/instance");
|
||||
f.getParentFile().mkdirs();
|
||||
return f;
|
||||
|
||||
@@ -34,9 +34,7 @@ import com.volmit.iris.util.parallel.BurstExecutor;
|
||||
import com.volmit.iris.util.parallel.HyperLock;
|
||||
import com.volmit.iris.util.parallel.MultiBurst;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Map;
|
||||
@@ -44,7 +42,6 @@ import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
/**
|
||||
* The mantle can store any type of data slice anywhere and manage regions & IO on it's own.
|
||||
@@ -81,28 +78,23 @@ public class Mantle {
|
||||
}
|
||||
|
||||
@ChunkCoordinates
|
||||
public void raiseFlag(int x, int z, MantleFlag flag, Runnable r)
|
||||
{
|
||||
if(!hasFlag(x, z, flag))
|
||||
{
|
||||
public void raiseFlag(int x, int z, MantleFlag flag, Runnable r) {
|
||||
if (!hasFlag(x, z, flag)) {
|
||||
flag(x, z, flag, true);
|
||||
r.run();
|
||||
}
|
||||
}
|
||||
|
||||
@ChunkCoordinates
|
||||
public void lowerFlag(int x, int z, MantleFlag flag, Runnable r)
|
||||
{
|
||||
if(hasFlag(x, z, flag))
|
||||
{
|
||||
public void lowerFlag(int x, int z, MantleFlag flag, Runnable r) {
|
||||
if (hasFlag(x, z, flag)) {
|
||||
flag(x, z, flag, false);
|
||||
r.run();
|
||||
}
|
||||
}
|
||||
|
||||
@ChunkCoordinates
|
||||
public void flag(int x, int z, MantleFlag flag, boolean flagged)
|
||||
{
|
||||
public void flag(int x, int z, MantleFlag flag, boolean flagged) {
|
||||
try {
|
||||
get(x >> 5, z >> 5).get().getOrCreate(x & 31, z & 31).flag(flag, flagged);
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
@@ -111,12 +103,9 @@ public class Mantle {
|
||||
}
|
||||
|
||||
@ChunkCoordinates
|
||||
public <T> void iterateChunk(int x, int z, Class<T> type, Consumer4<Integer, Integer, Integer, T> iterator, MantleFlag... requiredFlags)
|
||||
{
|
||||
for(MantleFlag i : requiredFlags)
|
||||
{
|
||||
if(!hasFlag(x, z, i))
|
||||
{
|
||||
public <T> void iterateChunk(int x, int z, Class<T> type, Consumer4<Integer, Integer, Integer, T> iterator, MantleFlag... requiredFlags) {
|
||||
for (MantleFlag i : requiredFlags) {
|
||||
if (!hasFlag(x, z, i)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -129,8 +118,7 @@ public class Mantle {
|
||||
}
|
||||
|
||||
@ChunkCoordinates
|
||||
public boolean hasFlag(int x, int z, MantleFlag flag)
|
||||
{
|
||||
public boolean hasFlag(int x, int z, MantleFlag flag) {
|
||||
try {
|
||||
return get(x >> 5, z >> 5).get().getOrCreate(x & 31, z & 31).isFlagged(flag);
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
@@ -274,7 +262,7 @@ public class Mantle {
|
||||
}
|
||||
|
||||
for (Long i : unload) {
|
||||
hyperLock.withLong(i, () ->{
|
||||
hyperLock.withLong(i, () -> {
|
||||
TectonicPlate m = loadedRegions.remove(i);
|
||||
lastUse.remove(i);
|
||||
|
||||
@@ -302,8 +290,7 @@ public class Mantle {
|
||||
Long k = key(x, z);
|
||||
TectonicPlate p = loadedRegions.get(k);
|
||||
|
||||
if(p != null)
|
||||
{
|
||||
if (p != null) {
|
||||
lastUse.put(k, M.ms());
|
||||
return CompletableFuture.completedFuture(p);
|
||||
}
|
||||
|
||||
@@ -18,10 +18,6 @@
|
||||
|
||||
package com.volmit.iris.util.mantle;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.util.collection.KSet;
|
||||
import com.volmit.iris.util.collection.StateList;
|
||||
import com.volmit.iris.util.data.Varint;
|
||||
import com.volmit.iris.util.documentation.ChunkCoordinates;
|
||||
import com.volmit.iris.util.function.Consumer4;
|
||||
import com.volmit.iris.util.matter.IrisMatter;
|
||||
@@ -52,8 +48,7 @@ public class MantleChunk {
|
||||
sections = new AtomicReferenceArray<>(sectionHeight);
|
||||
flags = new AtomicIntegerArray(MantleFlag.values().length);
|
||||
|
||||
for (int i = 0; i < flags.length(); i++)
|
||||
{
|
||||
for (int i = 0; i < flags.length(); i++) {
|
||||
flags.set(i, 0);
|
||||
}
|
||||
}
|
||||
@@ -70,8 +65,7 @@ public class MantleChunk {
|
||||
this(sectionHeight);
|
||||
int s = din.readByte();
|
||||
|
||||
for(int i = 0; i < flags.length(); i++)
|
||||
{
|
||||
for (int i = 0; i < flags.length(); i++) {
|
||||
flags.set(i, din.readBoolean() ? 1 : 0);
|
||||
}
|
||||
|
||||
@@ -176,38 +170,30 @@ public class MantleChunk {
|
||||
}
|
||||
|
||||
private void trimSlice(int i) {
|
||||
if(exists(i))
|
||||
{
|
||||
if (exists(i)) {
|
||||
Matter m = get(i);
|
||||
|
||||
if(m.getSliceMap().isEmpty())
|
||||
{
|
||||
if (m.getSliceMap().isEmpty()) {
|
||||
sections.set(i, null);
|
||||
}
|
||||
|
||||
else{
|
||||
} else {
|
||||
m.trimSlices();
|
||||
if(m.getSliceMap().isEmpty())
|
||||
{
|
||||
if (m.getSliceMap().isEmpty()) {
|
||||
sections.set(i, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public <T> void iterate(Class<T> type, Consumer4<Integer, Integer, Integer,T> iterator) {
|
||||
for(int i = 0; i < sections.length(); i++)
|
||||
{
|
||||
public <T> void iterate(Class<T> type, Consumer4<Integer, Integer, Integer, T> iterator) {
|
||||
for (int i = 0; i < sections.length(); i++) {
|
||||
int bs = (i << 4);
|
||||
Matter matter = get(i);
|
||||
|
||||
if(matter != null)
|
||||
{
|
||||
if (matter != null) {
|
||||
MatterSlice<T> t = matter.getSlice(type);
|
||||
|
||||
if(t != null)
|
||||
{
|
||||
t.iterateSync((a, b, c, f) -> iterator.accept(a,b + bs, c, f));
|
||||
if (t != null) {
|
||||
t.iterateSync((a, b, c, f) -> iterator.accept(a, b + bs, c, f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,10 +24,9 @@ public enum MantleFlag {
|
||||
OBJECT,
|
||||
UPDATE,
|
||||
JIGSAW,
|
||||
FEATURE
|
||||
;
|
||||
static StateList getStateList()
|
||||
{
|
||||
FEATURE;
|
||||
|
||||
static StateList getStateList() {
|
||||
return new StateList(MantleFlag.values());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,10 +172,7 @@ public class TectonicPlate {
|
||||
if (chunk != null) {
|
||||
dos.writeBoolean(true);
|
||||
chunk.write(dos);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
} else {
|
||||
dos.writeBoolean(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,8 +33,6 @@ import java.io.*;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
|
||||
/**
|
||||
* When Red Matter isn't enough
|
||||
|
||||
@@ -18,9 +18,7 @@
|
||||
|
||||
package com.volmit.iris.util.matter;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.engine.data.cache.Cache;
|
||||
import com.volmit.iris.util.data.NibbleDataPalette;
|
||||
import com.volmit.iris.util.data.Varint;
|
||||
import com.volmit.iris.util.hunk.Hunk;
|
||||
import org.bukkit.Location;
|
||||
@@ -108,8 +106,7 @@ public interface MatterSlice<T> extends Hunk<T> {
|
||||
return readFrom(mediumType) != null;
|
||||
}
|
||||
|
||||
default int getBitsPer(int needed)
|
||||
{
|
||||
default int getBitsPer(int needed) {
|
||||
int target = 1;
|
||||
for (int i = 1; i < 8; i++) {
|
||||
if (Math.pow(2, i) > needed) {
|
||||
|
||||
@@ -21,7 +21,6 @@ package com.volmit.iris.util.matter.slices;
|
||||
import com.volmit.iris.util.data.Varint;
|
||||
import com.volmit.iris.util.matter.Sliced;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
|
||||
@@ -127,8 +127,7 @@ public class HyperLock {
|
||||
}
|
||||
|
||||
public void lock(int x, int z) {
|
||||
if(!enabled)
|
||||
{
|
||||
if (!enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -136,8 +135,7 @@ public class HyperLock {
|
||||
}
|
||||
|
||||
public void unlock(int x, int z) {
|
||||
if(!enabled)
|
||||
{
|
||||
if (!enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ package com.volmit.iris.util.parallel;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
import com.volmit.iris.util.io.InstanceState;
|
||||
import com.volmit.iris.util.math.M;
|
||||
import com.volmit.iris.util.scheduling.J;
|
||||
@@ -55,8 +54,7 @@ public class MultiBurst {
|
||||
heartbeat = new Looper() {
|
||||
@Override
|
||||
protected long loop() {
|
||||
if(instance != InstanceState.getInstanceId())
|
||||
{
|
||||
if (instance != InstanceState.getInstanceId()) {
|
||||
shutdownNow();
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
package com.volmit.iris.util.plugin;
|
||||
|
||||
import com.google.common.collect.Comparators;
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.core.IrisSettings;
|
||||
import com.volmit.iris.util.collection.KList;
|
||||
@@ -27,8 +26,6 @@ import org.bukkit.Sound;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,8 +28,6 @@ import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.kyori.adventure.text.minimessage.transformation.inbuild.GradientTransformation;
|
||||
import net.kyori.adventure.text.minimessage.transformation.inbuild.RainbowTransformation;
|
||||
import net.kyori.adventure.title.Title;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -45,7 +43,6 @@ import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
/**
|
||||
@@ -193,95 +190,79 @@ public class VolmitSender implements CommandSender {
|
||||
s.sendMessage("========================================================");
|
||||
}
|
||||
|
||||
public void sendTitle(String title, String subtitle, int i, int s, int o)
|
||||
{
|
||||
public void sendTitle(String title, String subtitle, int i, int s, int o) {
|
||||
Iris.audiences.player(player()).showTitle(Title.title(
|
||||
createComponent(title),
|
||||
createComponent(subtitle),
|
||||
Title.Times.of(Duration.ofMillis(i), Duration.ofMillis(s), Duration.ofMillis(o))));
|
||||
}
|
||||
|
||||
public static long getTick()
|
||||
{
|
||||
public static long getTick() {
|
||||
return M.ms() / 16;
|
||||
}
|
||||
|
||||
public void sendProgress(double percent, String thing)
|
||||
{
|
||||
if(percent < 0)
|
||||
{
|
||||
public void sendProgress(double percent, String thing) {
|
||||
if (percent < 0) {
|
||||
int l = 44;
|
||||
int g = (int) (1D * l);
|
||||
sendTitle(C.IRIS + thing + " ", 0, 500, 250);
|
||||
sendActionNoProcessing("" + "" + pulse("#00ff80","#00373d",1D)+"<underlined> " + Form.repeat(" ", g) + "<reset>" + Form.repeat(" ", l - g));
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
sendActionNoProcessing("" + "" + pulse("#00ff80", "#00373d", 1D) + "<underlined> " + Form.repeat(" ", g) + "<reset>" + Form.repeat(" ", l - g));
|
||||
} else {
|
||||
int l = 44;
|
||||
int g = (int) (percent * l);
|
||||
sendTitle(C.IRIS + thing + " " + C.BLUE + "<font:minecraft:uniform>" + Form.pc(percent, 0), 0, 500, 250);
|
||||
sendActionNoProcessing("" + "" + pulse("#00ff80","#00373d",1D)+"<underlined> " + Form.repeat(" ", g) + "<reset>" + Form.repeat(" ", l - g));
|
||||
sendActionNoProcessing("" + "" + pulse("#00ff80", "#00373d", 1D) + "<underlined> " + Form.repeat(" ", g) + "<reset>" + Form.repeat(" ", l - g));
|
||||
}
|
||||
}
|
||||
|
||||
public static String pulse(String colorA, String colorB, double speed)
|
||||
{
|
||||
public static String pulse(String colorA, String colorB, double speed) {
|
||||
return "<gradient:" + colorA + ":" + colorB + ":" + pulse(speed) + ">";
|
||||
}
|
||||
|
||||
public static String pulse(double speed) {
|
||||
return Form.f(invertSpread((((getTick()*15D * speed)%1000D)/1000D)), 3).replaceAll("\\Q,\\E", ".");
|
||||
return Form.f(invertSpread((((getTick() * 15D * speed) % 1000D) / 1000D)), 3).replaceAll("\\Q,\\E", ".");
|
||||
}
|
||||
|
||||
public static double invertSpread(double v) {
|
||||
return ((1D - v) * 2D) - 1D;
|
||||
}
|
||||
|
||||
public void sendAction(String action)
|
||||
{
|
||||
public void sendAction(String action) {
|
||||
Iris.audiences.player(player()).sendActionBar(createNoPrefixComponent(action));
|
||||
}
|
||||
|
||||
public void sendActionNoProcessing(String action)
|
||||
{
|
||||
public void sendActionNoProcessing(String action) {
|
||||
Iris.audiences.player(player()).sendActionBar(createNoPrefixComponentNoProcessing(action));
|
||||
}
|
||||
|
||||
public void sendTitle(String subtitle, int i, int s, int o)
|
||||
{
|
||||
public void sendTitle(String subtitle, int i, int s, int o) {
|
||||
Iris.audiences.player(player()).showTitle(Title.title(
|
||||
createNoPrefixComponent(" "),
|
||||
createNoPrefixComponent(subtitle),
|
||||
Title.Times.of(Duration.ofMillis(i), Duration.ofMillis(s), Duration.ofMillis(o))));
|
||||
}
|
||||
|
||||
private Component createNoPrefixComponent(String message)
|
||||
{
|
||||
private Component createNoPrefixComponent(String message) {
|
||||
String t = C.translateAlternateColorCodes('&', message);
|
||||
String a = C.aura(t, IrisSettings.get().getGeneral().getSpinh(), IrisSettings.get().getGeneral().getSpins(), IrisSettings.get().getGeneral().getSpinb(), 0.36);
|
||||
return MiniMessage.get().parse(a);
|
||||
}
|
||||
|
||||
private Component createNoPrefixComponentNoProcessing(String message)
|
||||
{
|
||||
private Component createNoPrefixComponentNoProcessing(String message) {
|
||||
return MiniMessage.get().parse(message);
|
||||
}
|
||||
|
||||
private Component createComponent(String message)
|
||||
{
|
||||
private Component createComponent(String message) {
|
||||
String t = C.translateAlternateColorCodes('&', getTag() + message);
|
||||
String a = C.aura(t, IrisSettings.get().getGeneral().getSpinh(), IrisSettings.get().getGeneral().getSpins(), IrisSettings.get().getGeneral().getSpinb());
|
||||
return MiniMessage.get().parse(a);
|
||||
}
|
||||
|
||||
public <T> void showWaiting(String passive, CompletableFuture<T> f)
|
||||
{
|
||||
public <T> void showWaiting(String passive, CompletableFuture<T> f) {
|
||||
AtomicInteger v = new AtomicInteger();
|
||||
AtomicReference<T> g = new AtomicReference<>();
|
||||
v.set(J.ar(() -> {
|
||||
if(f.isDone() && g.get() != null)
|
||||
{
|
||||
if (f.isDone() && g.get() != null) {
|
||||
J.car(v.get());
|
||||
sendAction(" ");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user