Made small changes

This commit is contained in:
ImHacking 2022-06-22 15:32:21 -04:00
parent ae0c7fbd79
commit 8d4f78755d
8 changed files with 21 additions and 21 deletions

View File

@ -61,7 +61,7 @@ public class TicksPerSecondCommand extends Command {
sender.sendMessage("" + ChatColor.GRAY + ChatColor.STRIKETHROUGH + "----------------------------------------------");
sender.sendMessage(ChatColor.DARK_AQUA + "TPS (1m, 5m, 15m): " + ChatColor.GREEN + org.apache.commons.lang.StringUtils.join(tpsAvg, ", "));
sender.sendMessage(ChatColor.DARK_AQUA + "Lag: " + bar + ChatColor.GRAY + "(" + ChatColor.RED + lag + "%" + ChatColor.GRAY + ")");
sender.sendMessage(ChatColor.DARK_AQUA + "Last tick: " + ChatColor.GREEN + (System.currentTimeMillis() - Math.round(MinecraftServer.getLastTickTime() / 10*6) + "ms"));
sender.sendMessage(ChatColor.DARK_AQUA + "Last tick: " + ChatColor.GREEN + (System.currentTimeMillis() - Math.round(MinecraftServer.getLastTickTime() / 10 * 6) + "ms"));
sender.sendMessage(ChatColor.DARK_AQUA + "Uptime: " + ChatColor.AQUA + DateUtil.formatDateDiff(ManagementFactory.getRuntimeMXBean().getStartTime()));
sender.sendMessage(ChatColor.DARK_AQUA + "Timings: " + (Bukkit.getPluginManager().useTimings() ? ChatColor.GREEN + "Enabled" : ChatColor.RED + "Disabled"));
sender.sendMessage(ChatColor.DARK_AQUA + "Online: " + ChatColor.AQUA + Bukkit.getOnlinePlayers().size() + ChatColor.GRAY + "/" + ChatColor.AQUA + Bukkit.getMaxPlayers());

View File

@ -30,13 +30,13 @@ public class eSpigot {
// Set instance of the server
instance = this;
config = new YamlConfig("monkeyspigot.yml");
config = new YamlConfig("espigot.yml");
knockbackConfig = new YamlConfig("knockback.yml");
knockbackHandler = new KnockbackHandler();
for (MonkeyFeature monkeyFeature : MonkeyFeature.values())
monkeyFeature.reload(config);
for (eSpigotFeature eSpigotFeature : eSpigotFeature.values())
eSpigotFeature.reload(config);
for (Command command : Arrays.asList(new KnockbackCommand(), new TicksPerSecondCommand()))
MinecraftServer.getServer().server.getCommandMap()

View File

@ -3,7 +3,7 @@ package com.elevatemc.spigot;
import org.bukkit.configuration.file.YamlConfiguration;
import com.elevatemc.spigot.util.YamlConfig;
public enum MonkeyFeature {
public enum eSpigotFeature {
ENTITY_COLLISION(false),
VILLAGE_TICKING(false),
@ -15,7 +15,7 @@ public enum MonkeyFeature {
private boolean enabled;
MonkeyFeature(boolean enabled) {
eSpigotFeature(boolean enabled) {
this.enabled = enabled;
}

View File

@ -27,7 +27,7 @@ import org.bukkit.event.vehicle.VehicleExitEvent;
// PaperSpigot start
import org.bukkit.Bukkit;
import com.elevatemc.spigot.MonkeyFeature;
import com.elevatemc.spigot.eSpigotFeature;
import com.elevatemc.spigot.eSpigot;
import org.spigotmc.event.entity.EntityDismountEvent;
// PaperSpigot end
@ -1690,7 +1690,7 @@ public abstract class EntityLiving extends Entity {
this.ba = 0.0F;
this.bb = 0.0F;
} else if (this.bM()) {
if (MonkeyFeature.MOB_AI.isEnabled() || this instanceof EntityHuman) {
if (eSpigotFeature.MOB_AI.isEnabled() || this instanceof EntityHuman) {
this.world.methodProfiler.a("newAi");
this.doTick();
this.world.methodProfiler.b();
@ -1730,7 +1730,7 @@ public abstract class EntityLiving extends Entity {
protected void doTick() {}
protected void bL() {
if (!MonkeyFeature.ENTITY_COLLISION.isEnabled())
if (!eSpigotFeature.ENTITY_COLLISION.isEnabled())
return;
List list = this.world.a((Entity) this, this.getBoundingBox().grow(0.20000000298023224D, 0.0D, 0.20000000298023224D), Predicates.and(IEntitySelector.d, new Predicate() {

View File

@ -63,7 +63,7 @@ import co.aikar.timings.SpigotTimings; // Spigot
// CraftBukkit end
import org.github.paperspigot.PaperSpigotConfig; // PaperSpigot
import com.elevatemc.spigot.MonkeyFeature;
import com.elevatemc.spigot.eSpigotFeature;
public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerListBox {
@ -609,7 +609,7 @@ public class PlayerConnection implements PacketListenerPlayIn, IUpdatePlayerList
return;
case 3: // RELEASE_USE_ITEM
if (MonkeyFeature.FIX_SPRINT_EAT_EXPLOIT.isEnabled())
if (eSpigotFeature.FIX_SPRINT_EAT_EXPLOIT.isEnabled())
this.player.bU(); // eSpigot - Patch eat while running glitch
this.player.setSprinting(true);

View File

@ -16,7 +16,7 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
import com.elevatemc.spigot.MonkeyFeature;
import com.elevatemc.spigot.eSpigotFeature;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -332,11 +332,11 @@ public abstract class PlayerList {
for (int i = 0; i < this.players.size(); ++i) {
EntityPlayer entityplayer1 = (EntityPlayer) this.players.get(i);
if (MonkeyFeature.SHOW_HIDDEN_PLAYERS_IN_TAB.isEnabled() || entityplayer1.getBukkitEntity().canSee(entityplayer.getBukkitEntity())) {
if (eSpigotFeature.SHOW_HIDDEN_PLAYERS_IN_TAB.isEnabled() || entityplayer1.getBukkitEntity().canSee(entityplayer.getBukkitEntity())) {
entityplayer1.playerConnection.sendPacket(packet);
}
if (!entityplayer.getBukkitEntity().canSee(entityplayer1.getBukkitEntity()) && !MonkeyFeature.SHOW_HIDDEN_PLAYERS_IN_TAB.isEnabled()) {
if (!entityplayer.getBukkitEntity().canSee(entityplayer1.getBukkitEntity()) && !eSpigotFeature.SHOW_HIDDEN_PLAYERS_IN_TAB.isEnabled()) {
continue;
}

View File

@ -24,7 +24,7 @@ import org.bukkit.craftbukkit.util.HashTreeSet;
import org.bukkit.event.block.BlockFormEvent;
import org.bukkit.event.weather.LightningStrikeEvent;
import com.elevatemc.spigot.MonkeyFeature;
import com.elevatemc.spigot.eSpigotFeature;
// CraftBukkit end
public class WorldServer extends World implements IAsyncTaskHandler {
@ -208,7 +208,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
}
this.worldProvider.m().b();
if (MonkeyFeature.DAY_LIGHT_CYCLE.isEnabled()) {
if (eSpigotFeature.DAY_LIGHT_CYCLE.isEnabled()) {
if (this.everyoneDeeplySleeping()) {
if (this.getGameRules().getBoolean("doDaylightCycle")) {
long i = this.worldData.getDayTime() + 24000L;
@ -220,7 +220,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
}
}
if (MonkeyFeature.NATURAL_MOB_SPAWNING.isEnabled()) {
if (eSpigotFeature.NATURAL_MOB_SPAWNING.isEnabled()) {
// CraftBukkit start - Only call spawner if we have players online and the world allows for mobs or animals
long time = this.worldData.getTime();
if (this.getGameRules().getBoolean("doMobSpawning") && this.worldData.getType() != WorldType.DEBUG_ALL_BLOCK_STATES && (this.allowMonsters || this.allowAnimals) && (this instanceof WorldServer && this.players.size() > 0)) {
@ -260,7 +260,7 @@ public class WorldServer extends World implements IAsyncTaskHandler {
this.manager.flush();
timings.doChunkMap.stopTiming(); // Spigot
if (MonkeyFeature.VILLAGE_TICKING.isEnabled()) { // eSpigot - Disable village ticking
if (eSpigotFeature.VILLAGE_TICKING.isEnabled()) { // eSpigot - Disable village ticking
this.methodProfiler.c("village");
timings.doVillages.startTiming(); // Spigot
this.villages.tick();

View File

@ -21,7 +21,7 @@ import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.elevatemc.spigot.MonkeyFeature;
import com.elevatemc.spigot.eSpigotFeature;
import net.md_5.bungee.api.chat.BaseComponent;
import net.minecraft.server.*;
@ -984,7 +984,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
//remove the hidden player from this player user list
if (!MonkeyFeature.SHOW_HIDDEN_PLAYERS_IN_TAB.isEnabled())
if (!eSpigotFeature.SHOW_HIDDEN_PLAYERS_IN_TAB.isEnabled())
getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, other));
}
@ -999,7 +999,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
EntityTracker tracker = ((WorldServer) entity.world).tracker;
EntityPlayer other = ((CraftPlayer) player).getHandle();
if (!MonkeyFeature.SHOW_HIDDEN_PLAYERS_IN_TAB.isEnabled())
if (!eSpigotFeature.SHOW_HIDDEN_PLAYERS_IN_TAB.isEnabled())
getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, other));
EntityTrackerEntry entry = (EntityTrackerEntry) tracker.trackedEntities.get(other.getId());