[CI-SKIP] Removes unused nms changes w/ Better changes note for unmixinable classes
This commit is contained in:
@@ -30,10 +30,8 @@ import org.bukkit.Bukkit;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
* <b>Akarin Changes Note</b><br>
|
||||
* <br>
|
||||
* 1) Add volatile to fields<br>
|
||||
* @author cakoyo
|
||||
* Akarin Changes Note
|
||||
* 1) Add volatile to fields (safety issue)
|
||||
*/
|
||||
class TimingHandler implements Timing {
|
||||
|
||||
|
||||
@@ -293,7 +293,7 @@ public abstract class MixinChunk implements IMixinChunk {
|
||||
if (chunk == null) {
|
||||
continue;
|
||||
}
|
||||
chunk.checkLightSide(enumfacing.opposite());
|
||||
chunk.a(enumfacing.opposite()); // PAIL: checkLightSide
|
||||
}
|
||||
|
||||
this.setSkylightUpdated();
|
||||
|
||||
@@ -20,11 +20,9 @@ import org.bukkit.Server; // CraftBukkit
|
||||
import org.bukkit.craftbukkit.util.CraftMagicNumbers; // Paper
|
||||
|
||||
/**
|
||||
* <b>Akarin Changes Note</b><br>
|
||||
* <br>
|
||||
* 1) Add volatile to fields<br>
|
||||
* 2) Add OBFHELPER<br>
|
||||
* @author cakoyo
|
||||
* Akarin Changes Note
|
||||
* 1) Add volatile to fields (async lighting)
|
||||
* 2) Expose private methods (async lighting)
|
||||
*/
|
||||
public class Chunk {
|
||||
|
||||
@@ -1340,8 +1338,7 @@ public class Chunk {
|
||||
this.h(false);
|
||||
}
|
||||
|
||||
public void checkLightSide(EnumDirection direction) { a(direction); } // Akarin - OBFHELPER
|
||||
private void a(EnumDirection enumdirection) {
|
||||
public void a(EnumDirection enumdirection) { // Akarin - private -> public
|
||||
if (this.done) {
|
||||
int i;
|
||||
|
||||
|
||||
@@ -11,10 +11,8 @@ import java.util.Random;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
/**
|
||||
* <b>Akarin Changes Note</b><br>
|
||||
* <br>
|
||||
* 1) Expose private members<br>
|
||||
* @author cakoyo
|
||||
* Akarin Changes Note
|
||||
* 1) Expose private members (cause mixin errors)
|
||||
*/
|
||||
public class EnchantmentManager {
|
||||
|
||||
|
||||
@@ -32,10 +32,9 @@ import org.bukkit.inventory.MainHand;
|
||||
// CraftBukkit end
|
||||
|
||||
/**
|
||||
* <b>Akarin Changes Note</b><br>
|
||||
* <br>
|
||||
* 1) Add volatile to fields<br>
|
||||
* @author cakoyo
|
||||
* Akarin Changes Note
|
||||
* 1) Add volatile to fields (time update)
|
||||
* 2) Add lock to player track (safety issue)
|
||||
*/
|
||||
public class EntityPlayer extends EntityHuman implements ICrafting {
|
||||
|
||||
|
||||
@@ -12,10 +12,8 @@ import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
/**
|
||||
* <b>Akarin Changes Note</b><br>
|
||||
* <br>
|
||||
* 1) Add lock for entries-set operations<br>
|
||||
* @author cakoyo
|
||||
* Akarin Changes Note
|
||||
* 1) Add lock for entries set operations (safety issue)
|
||||
*/
|
||||
public class EntityTracker {
|
||||
|
||||
|
||||
@@ -13,6 +13,10 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerVelocityEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
/**
|
||||
* Akarin Changes Note
|
||||
* 1) Make trackedPlayerMap thread-safe (safety issue)
|
||||
*/
|
||||
public class EntityTrackerEntry {
|
||||
|
||||
private static final Logger c = LogManager.getLogger();
|
||||
|
||||
@@ -10,10 +10,8 @@ import java.util.Random;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* <b>Akarin Changes Note</b><br>
|
||||
* <br>
|
||||
* 1) Add OBFHELPER<br>
|
||||
* @author cakoyo
|
||||
* Akarin Changes Note
|
||||
* 1) Add OBFHELPER (panda redstone)
|
||||
*/
|
||||
public enum EnumDirection implements INamable {
|
||||
|
||||
|
||||
@@ -3,10 +3,8 @@ package net.minecraft.server;
|
||||
import io.akarin.server.core.AkarinGlobalConfig;
|
||||
|
||||
/**
|
||||
* <b>Akarin Changes Note</b><br>
|
||||
* <br>
|
||||
* 1) Add end portal disable feature<br>
|
||||
* @author cakoyo
|
||||
* Akarin Changes Note
|
||||
* 1) Add end portal disable feature (feature)
|
||||
*/
|
||||
public class ItemEnderEye extends Item {
|
||||
|
||||
|
||||
@@ -43,6 +43,10 @@ import joptsimple.OptionSet;
|
||||
import org.spigotmc.SlackActivityAccountant; // Spigot
|
||||
import co.aikar.timings.MinecraftTimings; // Paper
|
||||
|
||||
/**
|
||||
* Akarin Changes Note
|
||||
* 1) Make worlds list thread-safe (slack service)
|
||||
*/
|
||||
public abstract class MinecraftServer implements ICommandListener, Runnable, IAsyncTaskHandler, IMojangStatistics {
|
||||
|
||||
private static MinecraftServer SERVER; // Paper
|
||||
|
||||
@@ -32,11 +32,11 @@ import org.apache.logging.log4j.Marker;
|
||||
import org.apache.logging.log4j.MarkerManager;
|
||||
|
||||
/**
|
||||
* <b>Akarin Changes Note</b><br>
|
||||
* <br>
|
||||
* 1) Add volatile to fields<br>
|
||||
* 2) Expose private members<br>
|
||||
* @author cakoyo
|
||||
* Akarin Changes Note
|
||||
* 1) Add volatile to fields (nsc)
|
||||
* 2) Expose private members (nsc)
|
||||
* 3) Changes lock type to updatable lock (compatibility)
|
||||
* 4) Removes unneed array creation (performance)
|
||||
*/
|
||||
public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
package net.minecraft.server;
|
||||
|
||||
import co.aikar.timings.Timing;
|
||||
import it.unimi.dsi.fastutil.objects.ObjectCollection;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
|
||||
/**
|
||||
* <b>Akarin Changes Note</b><br>
|
||||
* <br>
|
||||
* 1) Expose private members<br>
|
||||
* @author cakoyo
|
||||
*/
|
||||
class PaperLightingQueue {
|
||||
private static final long MAX_TIME = (long) (1000000000 / 20 * .95);
|
||||
private static int updatesThisTick;
|
||||
|
||||
|
||||
static void processQueue(long curTime) {
|
||||
updatesThisTick = 0;
|
||||
|
||||
final long startTime = System.nanoTime();
|
||||
final long maxTickTime = MAX_TIME - (startTime - curTime);
|
||||
|
||||
START:
|
||||
for (World world : MinecraftServer.getServer().worlds) {
|
||||
if (!world.paperConfig.queueLightUpdates) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ObjectCollection<Chunk> loadedChunks = ((WorldServer) world).getChunkProviderServer().chunks.values();
|
||||
for (Chunk chunk : loadedChunks.toArray(new Chunk[loadedChunks.size()])) {
|
||||
if (chunk.lightingQueue.processQueue(startTime, maxTickTime)) {
|
||||
break START;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class LightingQueue extends ArrayDeque<Runnable> { // Akarin - public
|
||||
final private Chunk chunk;
|
||||
|
||||
LightingQueue(Chunk chunk) {
|
||||
super();
|
||||
this.chunk = chunk;
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the lighting queue for this chunk
|
||||
*
|
||||
* @param startTime If start Time is 0, we will not limit execution time
|
||||
* @param maxTickTime Maximum time to spend processing lighting updates
|
||||
* @return true to abort processing furthur lighting updates
|
||||
*/
|
||||
private boolean processQueue(long startTime, long maxTickTime) {
|
||||
if (this.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
try (Timing ignored = chunk.world.timings.lightingQueueTimer.startTiming()) {
|
||||
Runnable lightUpdate;
|
||||
while ((lightUpdate = this.poll()) != null) {
|
||||
lightUpdate.run();
|
||||
if (startTime > 0 && ++PaperLightingQueue.updatesThisTick % 10 == 0 && PaperLightingQueue.updatesThisTick > 10) {
|
||||
if (System.nanoTime() - startTime > maxTickTime) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flushes lighting updates to unload the chunk
|
||||
*/
|
||||
public void processUnload() { // Akarin - public
|
||||
if (!chunk.world.paperConfig.queueLightUpdates) {
|
||||
return;
|
||||
}
|
||||
processQueue(0, 0); // No timeout
|
||||
|
||||
final int radius = 1; // TODO: bitflip, why should this ever be 2?
|
||||
for (int x = chunk.locX - radius; x <= chunk.locX + radius; ++x) {
|
||||
for (int z = chunk.locZ - radius; z <= chunk.locZ + radius; ++z) {
|
||||
if (x == chunk.locX && z == chunk.locZ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Chunk neighbor = MCUtil.getLoadedChunkWithoutMarkingActive(chunk.world, x, z);
|
||||
if (neighbor != null) {
|
||||
neighbor.lightingQueue.processQueue(0, 0); // No timeout
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,10 +14,8 @@ import org.bukkit.craftbukkit.chunkio.ChunkIOExecutor;
|
||||
// CraftBukkit end
|
||||
|
||||
/**
|
||||
* <b>Akarin Changes Note</b><br>
|
||||
* <br>
|
||||
* 1) Check player list empty<br>
|
||||
* @author cakoyo
|
||||
* Akarin Changes Note
|
||||
* 1) Check whether players empty (performance, MC-120780)
|
||||
*/
|
||||
public class PlayerChunk {
|
||||
|
||||
|
||||
@@ -62,12 +62,11 @@ import co.aikar.timings.MinecraftTimings; // Paper
|
||||
// CraftBukkit end
|
||||
|
||||
/**
|
||||
* <b>Akarin Changes Note</b><br>
|
||||
* <br>
|
||||
* 1) Add volatile to fields<br>
|
||||
* 2) Expose private members<br>
|
||||
* 3) Migrated keep alive packet handling to service thread<br>
|
||||
* @author cakoyo
|
||||
* Akarin Changes Note
|
||||
* 1) Add volatile to fields (slack service)
|
||||
* 2) Expose private members (slack service)
|
||||
* 3) Removed keep-alive codes (slack service)
|
||||
* 4) Accessible keep-alive limit (feature, compatibility)
|
||||
*/
|
||||
public class PlayerConnection implements PacketListenerPlayIn, ITickable {
|
||||
|
||||
|
||||
@@ -48,10 +48,8 @@ import org.spigotmc.event.player.PlayerSpawnLocationEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
/**
|
||||
* <b>Akarin Changes Note</b><br>
|
||||
* <br>
|
||||
* 1) Modify disconnect and connect messages<br>
|
||||
* @author cakoyo
|
||||
* Akarin Changes Note
|
||||
* 1) Changes (dis)connect messages (feature)
|
||||
*/
|
||||
public abstract class PlayerList {
|
||||
|
||||
|
||||
@@ -24,6 +24,10 @@ import com.mojang.authlib.ProfileLookupCallback;
|
||||
import java.util.concurrent.Callable;
|
||||
// Spigot end
|
||||
|
||||
/**
|
||||
* Akarin Changes Note
|
||||
* 1) Guava -> Caffeine (performance)
|
||||
*/
|
||||
public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Paper - remove tickable
|
||||
|
||||
private int a;
|
||||
|
||||
@@ -12,10 +12,8 @@ import org.bukkit.event.weather.WeatherChangeEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
/**
|
||||
* <b>Akarin Changes Note</b><br>
|
||||
* <br>
|
||||
* 1) Add volatile to fields<br>
|
||||
* @author cakoyo
|
||||
* Akarin Changes Note
|
||||
* 1) Add volatile to fields (slack service)
|
||||
*/
|
||||
public class WorldData {
|
||||
|
||||
|
||||
@@ -27,10 +27,9 @@ import org.bukkit.event.weather.LightningStrikeEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
/**
|
||||
* <b>Akarin Changes Note</b><br>
|
||||
* <br>
|
||||
* 1) Expose private members<br>
|
||||
* @author cakoyo
|
||||
* Akarin Changes Note
|
||||
* 1) Expose private members (core, safety issue)
|
||||
* 2) Removed hardcore difficulty codes (slack service, feature)
|
||||
*/
|
||||
public class WorldServer extends World implements IAsyncTaskHandler {
|
||||
|
||||
|
||||
@@ -138,7 +138,10 @@ import net.md_5.bungee.api.chat.BaseComponent;
|
||||
import javax.annotation.Nullable; // Paper
|
||||
import javax.annotation.Nonnull; // Paper
|
||||
|
||||
|
||||
/**
|
||||
* Akarin Changes Note
|
||||
* 1) Guava -> Caffeine (performance)
|
||||
*/
|
||||
public final class CraftServer implements Server {
|
||||
private final String serverName = "Paper";
|
||||
private final String serverVersion;
|
||||
|
||||
@@ -76,10 +76,8 @@ import org.bukkit.scoreboard.Scoreboard;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* <b>Akarin Changes Note</b><br>
|
||||
* <br>
|
||||
* 1) Make hidden-players-set concurrent<br>
|
||||
* @author cakoyo
|
||||
* Akarin Changes Note
|
||||
* 1) Make hidden players thread-safe (safety issue)
|
||||
*/
|
||||
@DelegateDeserialization(CraftOfflinePlayer.class)
|
||||
public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
Reference in New Issue
Block a user