Compare commits
4 Commits
e35fa9139b
...
550b33c65b
Author | SHA1 | Date |
---|---|---|
Matvei Slotvinskiy | 550b33c65b | |
filoghost | 563df95561 | |
Spongecade | 3f067145b7 | |
Matvei Slotvinskiy | 94de2e79cd |
|
@ -93,7 +93,7 @@ public class TickingTask implements Runnable {
|
|||
}
|
||||
|
||||
// Holograms need to disappear before chunks (code taken from Bukkit)
|
||||
int maxViewRange = (Bukkit.getViewDistance() - 1) * 16;
|
||||
int maxViewRange = Math.max((Bukkit.getViewDistance() - 1),1) * 16;
|
||||
if (maxViewRange > CoreGlobalConfig.maxViewRange) {
|
||||
maxViewRange = CoreGlobalConfig.maxViewRange;
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_10_R1;
|
|||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.EventLoop;
|
||||
import me.filoghost.fcommons.logging.ErrorCollector;
|
||||
import me.filoghost.fcommons.logging.Log;
|
||||
import me.filoghost.fcommons.reflection.ReflectField;
|
||||
|
@ -115,8 +116,12 @@ public class VersionNMSManager implements NMSManager {
|
|||
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
|
||||
NetworkManager networkManager = playerConnection.a();
|
||||
Channel channel = networkManager.channel;
|
||||
if (channel == null) {
|
||||
return;
|
||||
}
|
||||
EventLoop eventLoop = channel.eventLoop();
|
||||
|
||||
channel.eventLoop().execute(() -> {
|
||||
Runnable safeModifierTask = () -> {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
@ -125,7 +130,13 @@ public class VersionNMSManager implements NMSManager {
|
|||
} catch (Exception e) {
|
||||
Log.warning(NMSErrors.EXCEPTION_MODIFYING_CHANNEL_PIPELINE, e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (eventLoop.inEventLoop()) {
|
||||
safeModifierTask.run();
|
||||
} else {
|
||||
eventLoop.execute(safeModifierTask);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_11_R1;
|
|||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.EventLoop;
|
||||
import me.filoghost.fcommons.logging.ErrorCollector;
|
||||
import me.filoghost.fcommons.logging.Log;
|
||||
import me.filoghost.fcommons.reflection.ReflectField;
|
||||
|
@ -115,8 +116,12 @@ public class VersionNMSManager implements NMSManager {
|
|||
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
|
||||
NetworkManager networkManager = playerConnection.a();
|
||||
Channel channel = networkManager.channel;
|
||||
if (channel == null) {
|
||||
return;
|
||||
}
|
||||
EventLoop eventLoop = channel.eventLoop();
|
||||
|
||||
channel.eventLoop().execute(() -> {
|
||||
Runnable safeModifierTask = () -> {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
@ -125,7 +130,13 @@ public class VersionNMSManager implements NMSManager {
|
|||
} catch (Exception e) {
|
||||
Log.warning(NMSErrors.EXCEPTION_MODIFYING_CHANNEL_PIPELINE, e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (eventLoop.inEventLoop()) {
|
||||
safeModifierTask.run();
|
||||
} else {
|
||||
eventLoop.execute(safeModifierTask);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_12_R1;
|
|||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.EventLoop;
|
||||
import me.filoghost.fcommons.logging.ErrorCollector;
|
||||
import me.filoghost.fcommons.logging.Log;
|
||||
import me.filoghost.fcommons.reflection.ReflectField;
|
||||
|
@ -115,8 +116,12 @@ public class VersionNMSManager implements NMSManager {
|
|||
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
|
||||
NetworkManager networkManager = playerConnection.a();
|
||||
Channel channel = networkManager.channel;
|
||||
if (channel == null) {
|
||||
return;
|
||||
}
|
||||
EventLoop eventLoop = channel.eventLoop();
|
||||
|
||||
channel.eventLoop().execute(() -> {
|
||||
Runnable safeModifierTask = () -> {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
@ -125,7 +130,13 @@ public class VersionNMSManager implements NMSManager {
|
|||
} catch (Exception e) {
|
||||
Log.warning(NMSErrors.EXCEPTION_MODIFYING_CHANNEL_PIPELINE, e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (eventLoop.inEventLoop()) {
|
||||
safeModifierTask.run();
|
||||
} else {
|
||||
eventLoop.execute(safeModifierTask);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_13_R2;
|
|||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.EventLoop;
|
||||
import me.filoghost.fcommons.logging.ErrorCollector;
|
||||
import me.filoghost.fcommons.logging.Log;
|
||||
import me.filoghost.fcommons.reflection.ReflectField;
|
||||
|
@ -115,8 +116,12 @@ public class VersionNMSManager implements NMSManager {
|
|||
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
|
||||
NetworkManager networkManager = playerConnection.a();
|
||||
Channel channel = networkManager.channel;
|
||||
if (channel == null) {
|
||||
return;
|
||||
}
|
||||
EventLoop eventLoop = channel.eventLoop();
|
||||
|
||||
channel.eventLoop().execute(() -> {
|
||||
Runnable safeModifierTask = () -> {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
@ -125,7 +130,13 @@ public class VersionNMSManager implements NMSManager {
|
|||
} catch (Exception e) {
|
||||
Log.warning(NMSErrors.EXCEPTION_MODIFYING_CHANNEL_PIPELINE, e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (eventLoop.inEventLoop()) {
|
||||
safeModifierTask.run();
|
||||
} else {
|
||||
eventLoop.execute(safeModifierTask);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_14_R1;
|
|||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.EventLoop;
|
||||
import me.filoghost.fcommons.logging.ErrorCollector;
|
||||
import me.filoghost.fcommons.logging.Log;
|
||||
import me.filoghost.fcommons.reflection.ReflectField;
|
||||
|
@ -100,8 +101,12 @@ public class VersionNMSManager implements NMSManager {
|
|||
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
|
||||
NetworkManager networkManager = playerConnection.a();
|
||||
Channel channel = networkManager.channel;
|
||||
if (channel == null) {
|
||||
return;
|
||||
}
|
||||
EventLoop eventLoop = channel.eventLoop();
|
||||
|
||||
channel.eventLoop().execute(() -> {
|
||||
Runnable safeModifierTask = () -> {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
@ -110,7 +115,13 @@ public class VersionNMSManager implements NMSManager {
|
|||
} catch (Exception e) {
|
||||
Log.warning(NMSErrors.EXCEPTION_MODIFYING_CHANNEL_PIPELINE, e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (eventLoop.inEventLoop()) {
|
||||
safeModifierTask.run();
|
||||
} else {
|
||||
eventLoop.execute(safeModifierTask);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_15_R1;
|
|||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.EventLoop;
|
||||
import me.filoghost.fcommons.logging.ErrorCollector;
|
||||
import me.filoghost.fcommons.logging.Log;
|
||||
import me.filoghost.fcommons.reflection.ReflectField;
|
||||
|
@ -100,8 +101,12 @@ public class VersionNMSManager implements NMSManager {
|
|||
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
|
||||
NetworkManager networkManager = playerConnection.a();
|
||||
Channel channel = networkManager.channel;
|
||||
if (channel == null) {
|
||||
return;
|
||||
}
|
||||
EventLoop eventLoop = channel.eventLoop();
|
||||
|
||||
channel.eventLoop().execute(() -> {
|
||||
Runnable safeModifierTask = () -> {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
@ -110,7 +115,13 @@ public class VersionNMSManager implements NMSManager {
|
|||
} catch (Exception e) {
|
||||
Log.warning(NMSErrors.EXCEPTION_MODIFYING_CHANNEL_PIPELINE, e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (eventLoop.inEventLoop()) {
|
||||
safeModifierTask.run();
|
||||
} else {
|
||||
eventLoop.execute(safeModifierTask);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_16_R3;
|
|||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.EventLoop;
|
||||
import me.filoghost.fcommons.logging.ErrorCollector;
|
||||
import me.filoghost.fcommons.logging.Log;
|
||||
import me.filoghost.fcommons.reflection.ReflectField;
|
||||
|
@ -100,8 +101,12 @@ public class VersionNMSManager implements NMSManager {
|
|||
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
|
||||
NetworkManager networkManager = playerConnection.a();
|
||||
Channel channel = networkManager.channel;
|
||||
if (channel == null) {
|
||||
return;
|
||||
}
|
||||
EventLoop eventLoop = channel.eventLoop();
|
||||
|
||||
channel.eventLoop().execute(() -> {
|
||||
Runnable safeModifierTask = () -> {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
@ -110,7 +115,13 @@ public class VersionNMSManager implements NMSManager {
|
|||
} catch (Exception e) {
|
||||
Log.warning(NMSErrors.EXCEPTION_MODIFYING_CHANNEL_PIPELINE, e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (eventLoop.inEventLoop()) {
|
||||
safeModifierTask.run();
|
||||
} else {
|
||||
eventLoop.execute(safeModifierTask);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_17_R1;
|
|||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.EventLoop;
|
||||
import me.filoghost.fcommons.logging.ErrorCollector;
|
||||
import me.filoghost.fcommons.logging.Log;
|
||||
import me.filoghost.fcommons.reflection.ReflectField;
|
||||
|
@ -99,8 +100,12 @@ public class VersionNMSManager implements NMSManager {
|
|||
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
|
||||
NetworkManager networkManager = playerConnection.a();
|
||||
Channel channel = networkManager.k;
|
||||
if (channel == null) {
|
||||
return;
|
||||
}
|
||||
EventLoop eventLoop = channel.eventLoop();
|
||||
|
||||
channel.eventLoop().execute(() -> {
|
||||
Runnable safeModifierTask = () -> {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
@ -109,7 +114,13 @@ public class VersionNMSManager implements NMSManager {
|
|||
} catch (Exception e) {
|
||||
Log.warning(NMSErrors.EXCEPTION_MODIFYING_CHANNEL_PIPELINE, e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (eventLoop.inEventLoop()) {
|
||||
safeModifierTask.run();
|
||||
} else {
|
||||
eventLoop.execute(safeModifierTask);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_18_R1;
|
|||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.EventLoop;
|
||||
import me.filoghost.fcommons.logging.ErrorCollector;
|
||||
import me.filoghost.fcommons.logging.Log;
|
||||
import me.filoghost.fcommons.reflection.ReflectField;
|
||||
|
@ -99,8 +100,12 @@ public class VersionNMSManager implements NMSManager {
|
|||
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
|
||||
NetworkManager networkManager = playerConnection.a();
|
||||
Channel channel = networkManager.k;
|
||||
if (channel == null) {
|
||||
return;
|
||||
}
|
||||
EventLoop eventLoop = channel.eventLoop();
|
||||
|
||||
channel.eventLoop().execute(() -> {
|
||||
Runnable safeModifierTask = () -> {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
@ -109,7 +114,13 @@ public class VersionNMSManager implements NMSManager {
|
|||
} catch (Exception e) {
|
||||
Log.warning(NMSErrors.EXCEPTION_MODIFYING_CHANNEL_PIPELINE, e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (eventLoop.inEventLoop()) {
|
||||
safeModifierTask.run();
|
||||
} else {
|
||||
eventLoop.execute(safeModifierTask);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_18_R2;
|
|||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.EventLoop;
|
||||
import me.filoghost.fcommons.logging.ErrorCollector;
|
||||
import me.filoghost.fcommons.logging.Log;
|
||||
import me.filoghost.fcommons.reflection.ReflectField;
|
||||
|
@ -99,8 +100,12 @@ public class VersionNMSManager implements NMSManager {
|
|||
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
|
||||
NetworkManager networkManager = playerConnection.a();
|
||||
Channel channel = networkManager.m;
|
||||
if (channel == null) {
|
||||
return;
|
||||
}
|
||||
EventLoop eventLoop = channel.eventLoop();
|
||||
|
||||
channel.eventLoop().execute(() -> {
|
||||
Runnable safeModifierTask = () -> {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
@ -109,7 +114,13 @@ public class VersionNMSManager implements NMSManager {
|
|||
} catch (Exception e) {
|
||||
Log.warning(NMSErrors.EXCEPTION_MODIFYING_CHANNEL_PIPELINE, e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (eventLoop.inEventLoop()) {
|
||||
safeModifierTask.run();
|
||||
} else {
|
||||
eventLoop.execute(safeModifierTask);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_19_R1;
|
|||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.EventLoop;
|
||||
import me.filoghost.fcommons.logging.ErrorCollector;
|
||||
import me.filoghost.fcommons.logging.Log;
|
||||
import me.filoghost.fcommons.reflection.ReflectField;
|
||||
|
@ -99,8 +100,12 @@ public class VersionNMSManager implements NMSManager {
|
|||
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
|
||||
NetworkManager networkManager = playerConnection.a();
|
||||
Channel channel = networkManager.m;
|
||||
if (channel == null) {
|
||||
return;
|
||||
}
|
||||
EventLoop eventLoop = channel.eventLoop();
|
||||
|
||||
channel.eventLoop().execute(() -> {
|
||||
Runnable safeModifierTask = () -> {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
@ -109,7 +114,13 @@ public class VersionNMSManager implements NMSManager {
|
|||
} catch (Exception e) {
|
||||
Log.warning(NMSErrors.EXCEPTION_MODIFYING_CHANNEL_PIPELINE, e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (eventLoop.inEventLoop()) {
|
||||
safeModifierTask.run();
|
||||
} else {
|
||||
eventLoop.execute(safeModifierTask);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_19_R2;
|
|||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.EventLoop;
|
||||
import me.filoghost.fcommons.logging.ErrorCollector;
|
||||
import me.filoghost.fcommons.logging.Log;
|
||||
import me.filoghost.fcommons.reflection.ReflectField;
|
||||
|
@ -99,8 +100,12 @@ public class VersionNMSManager implements NMSManager {
|
|||
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().b;
|
||||
NetworkManager networkManager = playerConnection.a();
|
||||
Channel channel = networkManager.m;
|
||||
if (channel == null) {
|
||||
return;
|
||||
}
|
||||
EventLoop eventLoop = channel.eventLoop();
|
||||
|
||||
channel.eventLoop().execute(() -> {
|
||||
Runnable safeModifierTask = () -> {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
@ -109,7 +114,13 @@ public class VersionNMSManager implements NMSManager {
|
|||
} catch (Exception e) {
|
||||
Log.warning(NMSErrors.EXCEPTION_MODIFYING_CHANNEL_PIPELINE, e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (eventLoop.inEventLoop()) {
|
||||
safeModifierTask.run();
|
||||
} else {
|
||||
eventLoop.execute(safeModifierTask);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_19_R3;
|
|||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.EventLoop;
|
||||
import me.filoghost.fcommons.logging.ErrorCollector;
|
||||
import me.filoghost.fcommons.logging.Log;
|
||||
import me.filoghost.fcommons.reflection.ReflectField;
|
||||
|
@ -106,8 +107,12 @@ public class VersionNMSManager implements NMSManager {
|
|||
return;
|
||||
}
|
||||
Channel channel = networkManager.m;
|
||||
if (channel == null) {
|
||||
return;
|
||||
}
|
||||
EventLoop eventLoop = channel.eventLoop();
|
||||
|
||||
channel.eventLoop().execute(() -> {
|
||||
Runnable safeModifierTask = () -> {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
@ -116,7 +121,13 @@ public class VersionNMSManager implements NMSManager {
|
|||
} catch (Exception e) {
|
||||
Log.warning(NMSErrors.EXCEPTION_MODIFYING_CHANNEL_PIPELINE, e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (eventLoop.inEventLoop()) {
|
||||
safeModifierTask.run();
|
||||
} else {
|
||||
eventLoop.execute(safeModifierTask);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_20_R1;
|
|||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.EventLoop;
|
||||
import me.filoghost.fcommons.logging.ErrorCollector;
|
||||
import me.filoghost.fcommons.logging.Log;
|
||||
import me.filoghost.fcommons.reflection.ReflectField;
|
||||
|
@ -106,8 +107,12 @@ public class VersionNMSManager implements NMSManager {
|
|||
return;
|
||||
}
|
||||
Channel channel = networkManager.m;
|
||||
if (channel == null) {
|
||||
return;
|
||||
}
|
||||
EventLoop eventLoop = channel.eventLoop();
|
||||
|
||||
channel.eventLoop().execute(() -> {
|
||||
Runnable safeModifierTask = () -> {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
@ -116,7 +121,13 @@ public class VersionNMSManager implements NMSManager {
|
|||
} catch (Exception e) {
|
||||
Log.warning(NMSErrors.EXCEPTION_MODIFYING_CHANNEL_PIPELINE, e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (eventLoop.inEventLoop()) {
|
||||
safeModifierTask.run();
|
||||
} else {
|
||||
eventLoop.execute(safeModifierTask);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_20_R2;
|
|||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.EventLoop;
|
||||
import me.filoghost.fcommons.logging.ErrorCollector;
|
||||
import me.filoghost.fcommons.logging.Log;
|
||||
import me.filoghost.fcommons.reflection.ReflectField;
|
||||
|
@ -107,8 +108,12 @@ public class VersionNMSManager implements NMSManager {
|
|||
return;
|
||||
}
|
||||
Channel channel = networkManager.n;
|
||||
if (channel == null) {
|
||||
return;
|
||||
}
|
||||
EventLoop eventLoop = channel.eventLoop();
|
||||
|
||||
channel.eventLoop().execute(() -> {
|
||||
Runnable safeModifierTask = () -> {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
@ -117,7 +122,13 @@ public class VersionNMSManager implements NMSManager {
|
|||
} catch (Exception e) {
|
||||
Log.warning(NMSErrors.EXCEPTION_MODIFYING_CHANNEL_PIPELINE, e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (eventLoop.inEventLoop()) {
|
||||
safeModifierTask.run();
|
||||
} else {
|
||||
eventLoop.execute(safeModifierTask);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_20_R3;
|
|||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.EventLoop;
|
||||
import me.filoghost.fcommons.logging.ErrorCollector;
|
||||
import me.filoghost.fcommons.logging.Log;
|
||||
import me.filoghost.fcommons.reflection.ReflectField;
|
||||
|
@ -107,8 +108,12 @@ public class VersionNMSManager implements NMSManager {
|
|||
return;
|
||||
}
|
||||
Channel channel = networkManager.n;
|
||||
if (channel == null) {
|
||||
return;
|
||||
}
|
||||
EventLoop eventLoop = channel.eventLoop();
|
||||
|
||||
channel.eventLoop().execute(() -> {
|
||||
Runnable safeModifierTask = () -> {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
@ -117,7 +122,13 @@ public class VersionNMSManager implements NMSManager {
|
|||
} catch (Exception e) {
|
||||
Log.warning(NMSErrors.EXCEPTION_MODIFYING_CHANNEL_PIPELINE, e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (eventLoop.inEventLoop()) {
|
||||
safeModifierTask.run();
|
||||
} else {
|
||||
eventLoop.execute(safeModifierTask);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_8_R3;
|
|||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.EventLoop;
|
||||
import me.filoghost.fcommons.logging.ErrorCollector;
|
||||
import me.filoghost.fcommons.logging.Log;
|
||||
import me.filoghost.fcommons.reflection.ReflectField;
|
||||
|
@ -112,8 +113,12 @@ public class VersionNMSManager implements NMSManager {
|
|||
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
|
||||
NetworkManager networkManager = playerConnection.a();
|
||||
Channel channel = networkManager.channel;
|
||||
if (channel == null) {
|
||||
return;
|
||||
}
|
||||
EventLoop eventLoop = channel.eventLoop();
|
||||
|
||||
channel.eventLoop().execute(() -> {
|
||||
Runnable safeModifierTask = () -> {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
@ -122,7 +127,13 @@ public class VersionNMSManager implements NMSManager {
|
|||
} catch (Exception e) {
|
||||
Log.warning(NMSErrors.EXCEPTION_MODIFYING_CHANNEL_PIPELINE, e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (eventLoop.inEventLoop()) {
|
||||
safeModifierTask.run();
|
||||
} else {
|
||||
eventLoop.execute(safeModifierTask);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ package me.filoghost.holographicdisplays.nms.v1_9_R2;
|
|||
import io.netty.channel.Channel;
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import io.netty.channel.ChannelPipeline;
|
||||
import io.netty.channel.EventLoop;
|
||||
import me.filoghost.fcommons.logging.ErrorCollector;
|
||||
import me.filoghost.fcommons.logging.Log;
|
||||
import me.filoghost.fcommons.reflection.ReflectField;
|
||||
|
@ -115,8 +116,12 @@ public class VersionNMSManager implements NMSManager {
|
|||
PlayerConnection playerConnection = ((CraftPlayer) player).getHandle().playerConnection;
|
||||
NetworkManager networkManager = playerConnection.a();
|
||||
Channel channel = networkManager.channel;
|
||||
if (channel == null) {
|
||||
return;
|
||||
}
|
||||
EventLoop eventLoop = channel.eventLoop();
|
||||
|
||||
channel.eventLoop().execute(() -> {
|
||||
Runnable safeModifierTask = () -> {
|
||||
if (!player.isOnline()) {
|
||||
return;
|
||||
}
|
||||
|
@ -125,7 +130,13 @@ public class VersionNMSManager implements NMSManager {
|
|||
} catch (Exception e) {
|
||||
Log.warning(NMSErrors.EXCEPTION_MODIFYING_CHANNEL_PIPELINE, e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (eventLoop.inEventLoop()) {
|
||||
safeModifierTask.run();
|
||||
} else {
|
||||
eventLoop.execute(safeModifierTask);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ package me.filoghost.holographicdisplays.plugin.lib.nbt;
|
|||
* </p>
|
||||
* <p>
|
||||
* For a community maintained documentation of the NBT format and its types, visit the
|
||||
* <a href=https://minecraft.gamepedia.com/NBT_format>Minecraft Wiki</a>
|
||||
* <a href=https://minecraft.wiki/w/NBT_format>Minecraft Wiki</a>
|
||||
* </p>
|
||||
*/
|
||||
public enum NBTType {
|
||||
|
|
Loading…
Reference in New Issue