Fixed v1.20(.1), small startup print improvements

This commit is contained in:
Stijn Bannink 2023-07-05 11:33:48 +02:00
parent 3ac1042894
commit 8afc1fb202
4 changed files with 6 additions and 7 deletions

View file

@ -90,7 +90,6 @@ public class MapReflectionAPI extends JavaPlugin {
getLogger().info("Loading the commands...");
getCommand("mapmanager").setExecutor(new MapManagerCMD());
getLogger().info("Loading the packet listener...");
try {
packetListener = PacketListener.construct(this);
} catch (IllegalStateException e) {
@ -100,7 +99,6 @@ public class MapReflectionAPI extends JavaPlugin {
}
packetListener.init(this);
getLogger().info("Loading the map manager...");
try {
mapManager = new MapManager(this);
} catch (IllegalStateException e) {
@ -110,7 +108,8 @@ public class MapReflectionAPI extends JavaPlugin {
}
if (Configuration.getInstance().isAllowVanilla()) {
getLogger().info("Vanilla Maps are allowed. Discovering occupied Map IDs...");
getLogger().info("Vanilla Maps are allowed!");
getLogger().info("Discovering occupied Map IDs...");
int occupiedIDs = 0;
for (int s = 0; s < Short.MAX_VALUE; s++) {
try {
@ -131,7 +130,7 @@ public class MapReflectionAPI extends JavaPlugin {
getLogger().info("Registering the listeners...");
Bukkit.getPluginManager().registerEvents(new MapListener(), this);
getLogger().info("Loading metrics...");
getLogger().info("Enabling metrics...");
Metrics metrics = new Metrics(this, 16033);
metrics.addCustomChart(new SingleLineChart("managed_maps", () -> mapManager.getManagedMapsCount()));

View file

@ -46,7 +46,7 @@ public class MapManager {
String packageName = Bukkit.getServer().getClass().getPackage().getName();
String version = packageName.substring(packageName.lastIndexOf('.') + 1);
MapReflectionAPI.getInstance().getLogger().info("Initializing the map manager for Minecraft version " + version + "...");
plugin.getLogger().info("Enabling MapManager for " + version + "...");
try {
final Class<?> clazz = Class.forName("tech.sbdevelopment.mapreflectionapi.nms.MapWrapper_" + version);

View file

@ -34,7 +34,7 @@ public abstract class PacketListener implements Listener {
String packageName = Bukkit.getServer().getClass().getPackage().getName();
String version = packageName.substring(packageName.lastIndexOf('.') + 1);
plugin.getLogger().info("Initializing the packet handler for Minecraft version " + version + "...");
plugin.getLogger().info("Enabling PacketListener for " + version + "...");
try {
final Class<?> clazz = Class.forName("tech.sbdevelopment.mapreflectionapi.nms.PacketListener_" + version);

View file

@ -217,7 +217,7 @@ public class MapWrapper_v1_20_R1 extends MapWrapper {
private void sendItemFramePacket(Player player, int entityId, ItemStack stack, int mapId) {
net.minecraft.world.item.ItemStack nmsStack = CraftItemStack.asNMSCopy(stack);
nmsStack.v().a("map", mapId); //getOrCreateTag putInt
nmsStack.w().a("map", mapId); //getOrCreateTag putInt
List<DataWatcher.b<?>> list = new ArrayList<>();
DataWatcher.b<?> dataWatcherItem = DataWatcher.b.a(EntityItemFrame.g, nmsStack);