Improve log messages

This commit is contained in:
Bixilon 2020-11-23 21:44:09 +01:00
parent 0fba4510df
commit a43d4afbaa
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
154 changed files with 180 additions and 178 deletions

View File

@ -143,8 +143,11 @@ public class Versions {
loadVersionMappings(mapping, mod, data.getAsJsonObject(mod), version);
}
}
Log.verbose(String.format("Loaded mappings for version %s in %dms (%s)", version, (System.currentTimeMillis() - startTime), version.getVersionName()));
if (!files.isEmpty()) {
Log.verbose(String.format("Loaded mappings for version %s in %dms (%s)", version, (System.currentTimeMillis() - startTime), version.getVersionName()));
} else {
Log.verbose(String.format("Could not load mappings for version %s. Some features will be unavailable.", version));
}
version.setGettingLoaded(false);
}

View File

@ -34,7 +34,7 @@ public class ModLoader {
public static final LinkedList<MinosoftMod> mods = new LinkedList<>();
public static void loadMods(CountUpAndDownLatch progress) throws Exception {
Log.verbose("Start loading mods...");
Log.info("Start loading mods...");
ExecutorService executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors(), Util.getThreadFactory("ModLoader"));
// load all jars, parse the mod.json
@ -77,7 +77,7 @@ public class ModLoader {
// ToDo: check dependencies
for (ModPhases phase : ModPhases.values()) {
Log.verbose(String.format("Map loading phase changed: %s", phase));
Log.verbose(String.format("Mod loading phase changed: %s", phase));
CountDownLatch modLatch = new CountDownLatch(mods.size());
mods.forEach((instance) -> {
executor.execute(() -> {
@ -106,10 +106,9 @@ public class ModLoader {
Minosoft.eventManagers.add(instance.getEventManager());
} else {
mods.remove(instance);
Log.warn(String.format("An error occurred while loading %s", instance.getInfo()));
}
});
Log.verbose("Loading all mods finished!");
Log.info("Loading of %d mods finished!", mods.size());
}
public static MinosoftMod loadMod(CountUpAndDownLatch progress, File file) {

View File

@ -39,7 +39,7 @@ public class PacketEncryptionRequest implements ClientboundPacket {
@Override
public void log() {
Log.protocol("Receiving encryption request packet");
Log.protocol("[IN] Receiving encryption request packet");
}
public byte[] getPublicKey() {

View File

@ -35,7 +35,7 @@ public class PacketLoginDisconnect implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Receiving login disconnect packet (%s)", reason.getANSIColoredMessage()));
Log.protocol(String.format("[IN] Receiving login disconnect packet (%s)", reason.getANSIColoredMessage()));
}
public ChatComponent getReason() {

View File

@ -41,7 +41,7 @@ public class PacketLoginPluginRequest implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received login plugin request in channel \"%s\" with %s bytes of data (messageId=%d)", channel, data.length, messageId));
Log.protocol(String.format("[IN] Received login plugin request in channel \"%s\" with %s bytes of data (messageId=%d)", channel, data.length, messageId));
}
public int getMessageId() {

View File

@ -34,7 +34,7 @@ public class PacketLoginSetCompression implements PacketCompressionInterface {
@Override
public void log() {
Log.protocol(String.format("Received set compression packet (threshold=%d)", threshold));
Log.protocol(String.format("[IN] Received set compression packet (threshold=%d)", threshold));
}
@Override

View File

@ -44,7 +44,7 @@ public class PacketLoginSuccess implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Receiving login success packet (username=%s, UUID=%s)", username, uuid));
Log.protocol(String.format("[IN] Receiving login success packet (username=%s, UUID=%s)", username, uuid));
}
public UUID getUUID() {

View File

@ -43,7 +43,7 @@ public class PacketAcknowledgePlayerDigging implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received acknowledge digging packet (position=%s, block=%s, status=%s, successful=%s)", position, block, status, successful));
Log.protocol(String.format("[IN] Received acknowledge digging packet (position=%s, block=%s, status=%s, successful=%s)", position, block, status, successful));
}
public BlockPosition getPosition() {

View File

@ -108,7 +108,7 @@ public class PacketAdvancements implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Receiving advancements (reset=%s, advancements=%s, progresses=%s)", reset, advancements.size(), progresses.size()));
Log.protocol(String.format("[IN] Receiving advancements (reset=%s, advancements=%s, progresses=%s)", reset, advancements.size(), progresses.size()));
}
public boolean isReset() {

View File

@ -42,7 +42,7 @@ public class PacketAttachEntity implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Attaching entity %d to entity %d (leash=%s)", entityId, vehicleId, leash));
Log.protocol(String.format("[IN] Attaching entity %d to entity %d (leash=%s)", entityId, vehicleId, leash));
}
public int getEntityId() {

View File

@ -64,6 +64,6 @@ public class PacketBlockAction implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Block action received %s at %s", data, position));
Log.protocol(String.format("[IN] Block action received %s at %s", data, position));
}
}

View File

@ -44,7 +44,7 @@ public class PacketBlockBreakAnimation implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Receiving block break packet (entityId=%d, stage=%d) at %s", entityId, stage, position));
Log.protocol(String.format("[IN] Receiving block break packet (entityId=%d, stage=%d) at %s", entityId, stage, position));
}
public BlockPosition getPosition() {

View File

@ -44,7 +44,7 @@ public class PacketBlockChange implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Block change received at %s (block=%s)", position, block));
Log.protocol(String.format("[IN] Block change received at %s (block=%s)", position, block));
}
public BlockPosition getPosition() {

View File

@ -49,7 +49,7 @@ public class PacketBlockEntityMetadata implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Receiving blockEntityMeta (position=%s, action=%s)", position, action));
Log.protocol(String.format("[IN] Receiving blockEntityMeta (position=%s, action=%s)", position, action));
}
public BlockPosition getPosition() {

View File

@ -64,12 +64,12 @@ public class PacketBossBar implements ClientboundPacket {
@Override
public void log() {
switch (action) {
case ADD -> Log.protocol(String.format("Received boss bar (action=%s, uuid=%s, title=\"%s\", health=%s, color=%s, divisions=%s, dragonBar=%s, darkenSky=%s)", action, uuid.toString(), title.getANSIColoredMessage(), health, color, divisions, isDragonBar(), shouldDarkenSky()));
case REMOVE -> Log.protocol(String.format("Received boss bar (action=%s, uuid=%s)", action, uuid.toString()));
case UPDATE_HEALTH -> Log.protocol(String.format("Received boss bar (action=%s, uuid=%s, health=%s)", action, uuid.toString(), health));
case UPDATE_TITLE -> Log.protocol(String.format("Received boss bar (action=%s, uuid=%s, title=\"%s\")", action, uuid.toString(), title.getANSIColoredMessage()));
case UPDATE_STYLE -> Log.protocol(String.format("Received boss bar (action=%s, uuid=%s, color=%s, divisions=%s)", action, uuid.toString(), color, divisions));
case UPDATE_FLAGS -> Log.protocol(String.format("Received boss bar (action=%s, uuid=%s, dragonBar=%s, darkenSky=%s)", action, uuid.toString(), isDragonBar(), shouldDarkenSky()));
case ADD -> Log.protocol(String.format("[IN] Received boss bar (action=%s, uuid=%s, title=\"%s\", health=%s, color=%s, divisions=%s, dragonBar=%s, darkenSky=%s)", action, uuid.toString(), title.getANSIColoredMessage(), health, color, divisions, isDragonBar(), shouldDarkenSky()));
case REMOVE -> Log.protocol(String.format("[IN] Received boss bar (action=%s, uuid=%s)", action, uuid.toString()));
case UPDATE_HEALTH -> Log.protocol(String.format("[IN] Received boss bar (action=%s, uuid=%s, health=%s)", action, uuid.toString(), health));
case UPDATE_TITLE -> Log.protocol(String.format("[IN] Received boss bar (action=%s, uuid=%s, title=\"%s\")", action, uuid.toString(), title.getANSIColoredMessage()));
case UPDATE_STYLE -> Log.protocol(String.format("[IN] Received boss bar (action=%s, uuid=%s, color=%s, divisions=%s)", action, uuid.toString(), color, divisions));
case UPDATE_FLAGS -> Log.protocol(String.format("[IN] Received boss bar (action=%s, uuid=%s, dragonBar=%s, darkenSky=%s)", action, uuid.toString(), isDragonBar(), shouldDarkenSky()));
}
}

View File

@ -34,7 +34,7 @@ public class PacketCamera implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Receiving camera packet (entityId=%d)", entityId));
Log.protocol(String.format("[IN] Receiving camera packet (entityId=%d)", entityId));
}
public int getEntityId() {

View File

@ -38,7 +38,7 @@ public class PacketChangeGameState implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received game status change (%s)", getReason()));
Log.protocol(String.format("[IN] Received game status change (%s)", getReason()));
}
public Reason getReason() {

View File

@ -48,7 +48,7 @@ public class PacketChatMessageReceiving implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received chat message (message=\"%s\")", message.getMessage()));
Log.protocol(String.format("[IN] Received chat message (message=\"%s\")", message.getMessage()));
}
public ChatComponent getMessage() {

View File

@ -79,7 +79,7 @@ public class PacketChunkBulk implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Chunk bulk packet received (chunks=%s)", chunks.size()));
Log.protocol(String.format("[IN] Chunk bulk packet received (chunks=%s)", chunks.size()));
}
public HashMap<ChunkLocation, Chunk> getChunks() {

View File

@ -124,7 +124,7 @@ public class PacketChunkData implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Chunk packet received (chunk: %s)", location));
Log.protocol(String.format("[IN] Chunk packet received (chunk: %s)", location));
}
public ChunkLocation getLocation() {

View File

@ -34,7 +34,7 @@ public class PacketCloseWindowReceiving implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Closing inventory (windowId=%d)", windowId));
Log.protocol(String.format("[IN] Closing inventory (windowId=%d)", windowId));
}
public byte getWindowId() {

View File

@ -46,7 +46,7 @@ public class PacketCollectItem implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Item %s was collected by %d (count=%s)", item, collectorId, ((count == 0) ? "?" : count)));
Log.protocol(String.format("[IN] Item %s was collected by %d (count=%s)", item, collectorId, ((count == 0) ? "?" : count)));
}
public Item getItem() {

View File

@ -52,9 +52,9 @@ public class PacketCombatEvent implements ClientboundPacket {
@Override
public void log() {
switch (action) {
case ENTER_COMBAT -> Log.protocol(String.format("Received combat packet (action=%s)", action));
case END_COMBAT -> Log.protocol(String.format("Received combat packet (action=%s, duration=%d, entityId=%d)", action, duration, entityId));
case ENTITY_DEAD -> Log.protocol(String.format("Received combat packet (action=%s, playerId=%d, entityId=%d, message=\"%s\")", action, playerId, entityId, message));
case ENTER_COMBAT -> Log.protocol(String.format("[IN] Received combat packet (action=%s)", action));
case END_COMBAT -> Log.protocol(String.format("[IN] Received combat packet (action=%s, duration=%d, entityId=%d)", action, duration, entityId));
case ENTITY_DEAD -> Log.protocol(String.format("[IN] Received combat packet (action=%s, playerId=%d, entityId=%d, message=\"%s\")", action, playerId, entityId, message));
}
}

View File

@ -38,7 +38,7 @@ public class PacketConfirmTransactionReceiving implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Closing inventory (windowId=%d)", windowId));
Log.protocol(String.format("[IN] Closing inventory (windowId=%d)", windowId));
}
public byte getWindowId() {

View File

@ -42,7 +42,7 @@ public class PacketCraftRecipeResponse implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received Crafting recipe response (windowId=%d, recipeId=%d)", windowId, recipeId));
Log.protocol(String.format("[IN] Received Crafting recipe response (windowId=%d, recipeId=%d)", windowId, recipeId));
}
public byte getWindowId() {

View File

@ -90,7 +90,7 @@ public class PacketDeclareRecipes implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received declare recipe packet (recipeLength=%d)", recipes.size()));
Log.protocol(String.format("[IN] Received declare recipe packet (recipeLength=%d)", recipes.size()));
}
public HashBiMap<String, Recipe> getRecipes() {

View File

@ -44,7 +44,7 @@ public class PacketDestroyEntity implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Despawning the following entities: %s", Arrays.toString(entityIds)));
Log.protocol(String.format("[IN] Despawning the following entities: %s", Arrays.toString(entityIds)));
}
public int[] getEntityIds() {

View File

@ -35,7 +35,7 @@ public class PacketDisconnect implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received disconnect packet (reason=\"%s\")", reason.getANSIColoredMessage()));
Log.protocol(String.format("[IN] Received disconnect packet (reason=\"%s\")", reason.getANSIColoredMessage()));
}
public ChatComponent getReason() {

View File

@ -50,7 +50,7 @@ public class PacketEffect implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received effect packet at %s (effect=%s, data=%d, disableRelativeVolume=%s)", position, effect, data, disableRelativeVolume));
Log.protocol(String.format("[IN] Received effect packet at %s (effect=%s, data=%d, disableRelativeVolume=%s)", position, effect, data, disableRelativeVolume));
}
public BlockPosition getPosition() {

View File

@ -38,7 +38,7 @@ public class PacketEntityAnimation implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Play entity animation (entityId=%d, animation=%s)", entityId, animation));
Log.protocol(String.format("[IN] Play entity animation (entityId=%d, animation=%s)", entityId, animation));
}
public enum EntityAnimations {

View File

@ -57,7 +57,7 @@ public class PacketEntityEffect implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Entity effect added: %d %s", entityId, effect.toString()));
Log.protocol(String.format("[IN] Entity effect added: %d %s", entityId, effect.toString()));
}
public int getEntityId() {

View File

@ -67,12 +67,12 @@ public class PacketEntityEquipment implements ClientboundPacket {
if (slots.size() == 1) {
Map.Entry<InventorySlots.EntityInventorySlots, Slot> set = slots.entrySet().iterator().next();
if (set.getValue() == null) {
Log.protocol(String.format("Entity equipment changed (entityId=%d, slot=%s): AIR", entityId, set.getKey()));
Log.protocol(String.format("[IN] Entity equipment changed (entityId=%d, slot=%s): AIR", entityId, set.getKey()));
return;
}
Log.protocol(String.format("Entity equipment changed (entityId=%d, slot=%s): %dx %s", entityId, set.getKey(), set.getValue().getItemCount(), set.getValue().getDisplayName()));
Log.protocol(String.format("[IN] Entity equipment changed (entityId=%d, slot=%s): %dx %s", entityId, set.getKey(), set.getValue().getItemCount(), set.getValue().getDisplayName()));
} else {
Log.protocol(String.format("Entity equipment changed (entityId=%d, slotCount=%d)", entityId, slots.size()));
Log.protocol(String.format("[IN] Entity equipment changed (entityId=%d, slotCount=%d)", entityId, slots.size()));
}
}

View File

@ -36,6 +36,6 @@ public class PacketEntityEvent implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Entity status: (entityId=%d, eventId=%s)", entityId, eventId));
Log.protocol(String.format("[IN] Entity status: (entityId=%d, eventId=%s)", entityId, eventId));
}
}

View File

@ -37,7 +37,7 @@ public class PacketEntityHeadRotation implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Entity %d moved head (yaw=%s)", entityId, headYaw));
Log.protocol(String.format("[IN] Entity %d moved head (yaw=%s)", entityId, headYaw));
}
public int getEntityId() {

View File

@ -34,7 +34,7 @@ public class PacketEntityInitialisation implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Initialising entity (entityId=%d)", entityId));
Log.protocol(String.format("[IN] Initialising entity (entityId=%d)", entityId));
}
public int getEntityId() {

View File

@ -37,7 +37,7 @@ public class PacketEntityMetadata implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received entity metadata (entityId=%d)", entityId));
Log.protocol(String.format("[IN] Received entity metadata (entityId=%d)", entityId));
}
public int getEntityId() {

View File

@ -45,7 +45,7 @@ public class PacketEntityMovement implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Entity %d moved relative %s", entityId, location));
Log.protocol(String.format("[IN] Entity %d moved relative %s", entityId, location));
}
public int getEntityId() {

View File

@ -50,7 +50,7 @@ public class PacketEntityMovementAndRotation implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Entity %d moved relative %s (yaw=%s, pitch=%s)", entityId, location, yaw, pitch));
Log.protocol(String.format("[IN] Entity %d moved relative %s (yaw=%s, pitch=%s)", entityId, location, yaw, pitch));
}
public int getEntityId() {

View File

@ -69,7 +69,7 @@ public class PacketEntityProperties implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received entity properties (entityId=%d)", entityId));
Log.protocol(String.format("[IN] Received entity properties (entityId=%d)", entityId));
}
public int getEntityId() {

View File

@ -44,7 +44,7 @@ public class PacketEntityRotation implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Entity %d moved relative (yaw=%s, pitch=%s)", entityId, yaw, pitch));
Log.protocol(String.format("[IN] Entity %d moved relative (yaw=%s, pitch=%s)", entityId, yaw, pitch));
}
public int getEntityId() {

View File

@ -43,7 +43,7 @@ public class PacketEntitySoundEffect implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Play sound entity effect (soundId=%d, category=%s, entityId=%d, volume=%s, pitch=%s)", soundId, category, entityId, volume, pitch));
Log.protocol(String.format("[IN] Play sound entity effect (soundId=%d, category=%s, entityId=%d, volume=%s, pitch=%s)", soundId, category, entityId, volume, pitch));
}
public int getSoundId() {

View File

@ -51,7 +51,7 @@ public class PacketEntityTeleport implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Entity %d moved to %s (yaw=%s, pitch=%s)", entityId, location, yaw, pitch));
Log.protocol(String.format("[IN] Entity %d moved to %s (yaw=%s, pitch=%s)", entityId, location, yaw, pitch));
}
public int getEntityId() {

View File

@ -38,7 +38,7 @@ public class PacketEntityVelocity implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Entity velocity changed %d: %s", entityId, velocity.toString()));
Log.protocol(String.format("[IN] Entity velocity changed %d: %s", entityId, velocity.toString()));
}
public int getEntityId() {

View File

@ -55,7 +55,7 @@ public class PacketExplosion implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Explosion packet received at %s (recordCount=%d, radius=%s)", location, records.length, radius));
Log.protocol(String.format("[IN] Explosion packet received at %s (recordCount=%d, radius=%s)", location, records.length, radius));
}
public Location getLocation() {

View File

@ -44,7 +44,7 @@ public class PacketFacePlayer implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received face player packet (face=%s, location=%s, entityId=%d, entityFace=%s)", face, location, entityId, entityFace));
Log.protocol(String.format("[IN] Received face player packet (face=%s, location=%s, entityId=%d, entityFace=%s)", face, location, entityId, entityFace));
}
public PlayerFaces getFace() {

View File

@ -34,7 +34,7 @@ public class PacketHeldItemChangeReceiving implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Slot change received. Now on slot %s", slot));
Log.protocol(String.format("[IN] Slot change received. Now on slot %s", slot));
}
public byte getSlot() {

View File

@ -177,7 +177,7 @@ public class PacketJoinGame implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Receiving join game packet (entityId=%s, gameMode=%s, dimension=%s, difficulty=%s, hardcore=%s, viewDistance=%d)", entityId, gameMode, dimension, difficulty, hardcore, viewDistance));
Log.protocol(String.format("[IN] Receiving join game packet (entityId=%s, gameMode=%s, dimension=%s, difficulty=%s, hardcore=%s, viewDistance=%d)", entityId, gameMode, dimension, difficulty, hardcore, viewDistance));
}
public boolean isHardcore() {

View File

@ -42,7 +42,7 @@ public class PacketKeepAlive implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Keep alive packet received (%d)", id));
Log.protocol(String.format("[IN] Keep alive packet received (%d)", id));
}
public long getId() {

View File

@ -126,7 +126,7 @@ public class PacketMapData implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received map meta data (mapId=%d)", mapId));
Log.protocol(String.format("[IN] Received map meta data (mapId=%d)", mapId));
}
public PacketMapDataDataActions getDataData() {

View File

@ -80,7 +80,7 @@ public class PacketMultiBlockChange implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Multi block change received at %s (size=%d)", location, blocks.size()));
Log.protocol(String.format("[IN] Multi block change received at %s (size=%d)", location, blocks.size()));
}
public ChunkLocation getLocation() {

View File

@ -37,7 +37,7 @@ public class PacketNBTQueryResponse implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received nbt response (transactionId=%d, nbt=%s)", transactionId, tag.toString()));
Log.protocol(String.format("[IN] Received nbt response (transactionId=%d, nbt=%s)", transactionId, tag.toString()));
}
public int getTransactionId() {

View File

@ -65,7 +65,7 @@ public class PacketNamedSoundEffect implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Play sound effect (sound=%s, category=%s, volume=%s, pitch=%s, location=%s)", sound, category, volume, pitch, location));
Log.protocol(String.format("[IN] Play sound effect (sound=%s, category=%s, volume=%s, pitch=%s, location=%s)", sound, category, volume, pitch, location));
}
public Location getLocation() {

View File

@ -39,7 +39,7 @@ public class PacketOpenBook implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received open book packet (hand=%s)", hand));
Log.protocol(String.format("[IN] Received open book packet (hand=%s)", hand));
}
public Hands getHand() {

View File

@ -38,7 +38,7 @@ public class PacketOpenHorseWindow implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received open horse window packet (windowId=%d, slotCount=%d, entityId=%s)", windowId, slotCount, entityId));
Log.protocol(String.format("[IN] Received open horse window packet (windowId=%d, slotCount=%d, entityId=%s)", windowId, slotCount, entityId));
}
public byte getWindowId() {

View File

@ -39,7 +39,7 @@ public class PacketOpenSignEditor implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Opening sign editor: %s", position));
Log.protocol(String.format("[IN] Opening sign editor: %s", position));
}
public BlockPosition getPosition() {

View File

@ -61,7 +61,7 @@ public class PacketOpenWindow implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received inventory open packet (windowId=%d, type=%s, title=%s, entityId=%d, slotCount=%d)", windowId, type, title, entityId, slotCount));
Log.protocol(String.format("[IN] Received inventory open packet (windowId=%d, type=%s, title=%s, entityId=%d, slotCount=%d)", windowId, type, title, entityId, slotCount));
}
public byte getSlotCount() {

View File

@ -77,7 +77,7 @@ public class PacketParticle implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received particle spawn packet (location=%s, offsetX=%s, offsetY=%s, offsetZ=%s, particleType=%s, dataFloat=%s, count=%d, particleData=%s)", location, offsetX, offsetY, offsetZ, particleType, particleDataFloat, count, particleData));
Log.protocol(String.format("[IN] Received particle spawn packet (location=%s, offsetX=%s, offsetY=%s, offsetZ=%s, particleType=%s, dataFloat=%s, count=%d, particleData=%s)", location, offsetX, offsetY, offsetZ, particleType, particleDataFloat, count, particleData));
}
public Location getLocation() {

View File

@ -56,7 +56,7 @@ public class PacketPlayerAbilitiesReceiving implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received player abilities packet: (creative=%s, flying=%s, canFly=%s, godMode=%s, flyingSpeed=%s, walkingSpeed=%s)", creative, flying, canFly, godMode, flyingSpeed, walkingSpeed));
Log.protocol(String.format("[IN] Received player abilities packet: (creative=%s, flying=%s, canFly=%s, godMode=%s, flyingSpeed=%s, walkingSpeed=%s)", creative, flying, canFly, godMode, flyingSpeed, walkingSpeed));
}
public boolean canFly() {

View File

@ -83,7 +83,7 @@ public class PacketPlayerListItem implements ClientboundPacket {
@Override
public void log() {
for (PlayerListItemBulk property : playerList) {
Log.protocol(String.format("Received player list item bulk (%s)", property));
Log.protocol(String.format("[IN] Received player list item bulk (%s)", property));
}
}

View File

@ -52,7 +52,7 @@ public class PacketPlayerPositionAndRotation implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received player location: %s (yaw=%s, pitch=%s)", location, yaw, pitch));
Log.protocol(String.format("[IN] Received player location: %s (yaw=%s, pitch=%s)", location, yaw, pitch));
}
public Location getLocation() {

View File

@ -45,7 +45,7 @@ public class PacketPluginMessageReceiving implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Plugin message received in channel \"%s\" with %s bytes of data", channel, data.length));
Log.protocol(String.format("[IN] Plugin message received in channel \"%s\" with %s bytes of data", channel, data.length));
}
public String getChannel() {

View File

@ -38,7 +38,7 @@ public class PacketRemoveEntityEffect implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Entity effect removed (entityId=%d, effect=%s)", entityId, effect));
Log.protocol(String.format("[IN] Entity effect removed (entityId=%d, effect=%s)", entityId, effect));
}
public int getEntityId() {

View File

@ -40,7 +40,7 @@ public class PacketResourcePackSend implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received resource pack send (url=\"%s\", hash=%s", url, hash));
Log.protocol(String.format("[IN] Received resource pack send (url=\"%s\", hash=%s", url, hash));
}
public String getUrl() {

View File

@ -82,7 +82,7 @@ public class PacketRespawn implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Respawn packet received (dimension=%s, difficulty=%s, gamemode=%s, levelType=%s)", dimension, difficulty, gameMode, levelType));
Log.protocol(String.format("[IN] Respawn packet received (dimension=%s, difficulty=%s, gamemode=%s, levelType=%s)", dimension, difficulty, gameMode, levelType));
}
public Dimension getDimension() {

View File

@ -36,7 +36,7 @@ public class PacketScoreboardDisplayScoreboard implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received display scoreboard packet (position=%s, scoreName=\"%s\"", action, scoreName));
Log.protocol(String.format("[IN] Received display scoreboard packet (position=%s, scoreName=\"%s\"", action, scoreName));
}
public enum ScoreboardAnimations {

View File

@ -59,9 +59,9 @@ public class PacketScoreboardObjective implements ClientboundPacket {
@Override
public void log() {
if (action == ScoreboardObjectiveActions.CREATE || action == ScoreboardObjectiveActions.UPDATE) {
Log.protocol(String.format("Received scoreboard objective action (action=%s, name=\"%s\", value=\"%s\", type=%s)", action, name, value.getANSIColoredMessage(), type));
Log.protocol(String.format("[IN] Received scoreboard objective action (action=%s, name=\"%s\", value=\"%s\", type=%s)", action, name, value.getANSIColoredMessage(), type));
} else {
Log.protocol(String.format("Received scoreboard objective action (action=%s, name=\"%s\")", action, name));
Log.protocol(String.format("[IN] Received scoreboard objective action (action=%s, name=\"%s\")", action, name));
}
}

View File

@ -54,7 +54,7 @@ public class PacketScoreboardUpdateScore implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received scoreboard score update (itemName=\"%s\", action=%s, scoreName=\"%s\", scoreValue=%d", itemName, action, scoreName, scoreValue));
Log.protocol(String.format("[IN] Received scoreboard score update (itemName=\"%s\", action=%s, scoreName=\"%s\", scoreValue=%d", itemName, action, scoreName, scoreValue));
}
public String getItemName() {

View File

@ -37,7 +37,7 @@ public class PacketSelectAdvancementTab implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received select advancement tab (tab=%s)", tab));
Log.protocol(String.format("[IN] Received select advancement tab (tab=%s)", tab));
}
public AdvancementTabs getTab() {

View File

@ -39,7 +39,7 @@ public class PacketServerDifficulty implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received server difficulty (difficulty=%s)", difficulty));
Log.protocol(String.format("[IN] Received server difficulty (difficulty=%s)", difficulty));
}
public Difficulties getDifficulty() {

View File

@ -34,7 +34,7 @@ public class PacketSetCompression implements PacketCompressionInterface {
@Override
public void log() {
Log.protocol(String.format("Received set compression packet (threshold=%d)", threshold));
Log.protocol(String.format("[IN] Received set compression packet (threshold=%d)", threshold));
}
@Override

View File

@ -37,7 +37,7 @@ public class PacketSetCooldown implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Receiving item cooldown (item=%s, coolDown=%dt)", item, cooldownTicks));
Log.protocol(String.format("[IN] Receiving item cooldown (item=%s, coolDown=%dt)", item, cooldownTicks));
}
public int getItem() {

View File

@ -43,7 +43,7 @@ public class PacketSetExperience implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Level update received. Now at %d levels, totally %d exp", level, total));
Log.protocol(String.format("[IN] Level update received. Now at %d levels, totally %d exp", level, total));
}
public float getBar() {

View File

@ -39,7 +39,7 @@ public class PacketSetPassenger implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Attaching %d entities (vehicleId=%d)", entityIds.length, vehicleId));
Log.protocol(String.format("[IN] Attaching %d entities (vehicleId=%d)", entityIds.length, vehicleId));
}
public int getVehicleId() {

View File

@ -39,7 +39,7 @@ public class PacketSetSlot implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received slot data (windowId=%d, slotId=%d, item=%s)", windowId, slotId, ((slot == null) ? "AIR" : slot.getDisplayName())));
Log.protocol(String.format("[IN] Received slot data (windowId=%d, slotId=%d, item=%s)", windowId, slotId, ((slot == null) ? "AIR" : slot.getDisplayName())));
}
public byte getWindowId() {

View File

@ -59,7 +59,7 @@ public class PacketSoundEffect implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Play sound effect (soundId=%d, category=%s, volume=%s, pitch=%s, location=%s)", soundId, category, volume, pitch, location));
Log.protocol(String.format("[IN] Play sound effect (soundId=%d, category=%s, volume=%s, pitch=%s, location=%s)", soundId, category, volume, pitch, location));
}
public Location getLocation() {

View File

@ -44,7 +44,7 @@ public class PacketSpawnExperienceOrb implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Experience orb spawned at %s(entityId=%d, count=%d)", entity.getLocation().toString(), entity.getEntityId(), entity.getCount()));
Log.protocol(String.format("[IN] Experience orb spawned at %s(entityId=%d, count=%d)", entity.getLocation().toString(), entity.getEntityId(), entity.getCount()));
}
public ExperienceOrb getEntity() {

View File

@ -39,7 +39,7 @@ public class PacketSpawnLocation implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received spawn location %s", location));
Log.protocol(String.format("[IN] Received spawn location %s", location));
}
public BlockPosition getSpawnLocation() {

View File

@ -82,7 +82,7 @@ public class PacketSpawnMob implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Mob spawned at %s (entityId=%d, type=%s)", entity.getLocation().toString(), entity.getEntityId(), entity));
Log.protocol(String.format("[IN] Mob spawned at %s (entityId=%d, type=%s)", entity.getLocation().toString(), entity.getEntityId(), entity));
}
public Entity getEntity() {

View File

@ -89,7 +89,7 @@ public class PacketSpawnObject implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Object spawned at %s (entityId=%d, type=%s)", entity.getLocation().toString(), entity.getEntityId(), entity));
Log.protocol(String.format("[IN] Object spawned at %s (entityId=%d, type=%s)", entity.getLocation().toString(), entity.getEntityId(), entity));
}
public Entity getEntity() {

View File

@ -60,7 +60,7 @@ public class PacketSpawnPainting implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Spawning painting at %s (entityId=%d, motive=%s, direction=%s)", entity.getLocation(), entity.getEntityId(), entity.getMotive(), entity.getDirection()));
Log.protocol(String.format("[IN] Spawning painting at %s (entityId=%d, motive=%s, direction=%s)", entity.getLocation(), entity.getEntityId(), entity.getMotive(), entity.getDirection()));
}
public Painting getEntity() {

View File

@ -80,7 +80,7 @@ public class PacketSpawnPlayer implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Player spawned at %s (entityId=%d, name=%s, uuid=%s)", entity.getLocation(), entity.getEntityId(), entity.getName(), entity.getUUID()));
Log.protocol(String.format("[IN] Player spawned at %s (entityId=%d, name=%s, uuid=%s)", entity.getLocation(), entity.getEntityId(), entity.getName(), entity.getUUID()));
}
public PlayerEntity getEntity() {

View File

@ -44,7 +44,7 @@ public class PacketSpawnWeatherEntity implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Thunderbolt spawned at %s (entityId=%d)", entity.getLocation(), entity.getEntityId()));
Log.protocol(String.format("[IN] Thunderbolt spawned at %s (entityId=%d)", entity.getLocation(), entity.getEntityId()));
}
public LightningBolt getEntity() {

View File

@ -46,7 +46,7 @@ public class PacketStatistics implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received player statistics (count=%d)", statistics.size()));
Log.protocol(String.format("[IN] Received player statistics (count=%d)", statistics.size()));
}
public HashMap<Statistic, Integer> getStatistics() {

View File

@ -48,7 +48,7 @@ public class PacketStopSound implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received stop sound (category=%s, soundIdentifier=%s)", category, soundIdentifier));
Log.protocol(String.format("[IN] Received stop sound (category=%s, soundIdentifier=%s)", category, soundIdentifier));
}
public SoundCategories getSoundId() {

View File

@ -48,7 +48,7 @@ public class PacketTabCompleteReceiving implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received tab complete for message(count=%d)", count));
Log.protocol(String.format("[IN] Received tab complete for message(count=%d)", count));
}
public int getCount() {

View File

@ -37,8 +37,8 @@ public class PacketTabHeaderAndFooter implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received tab list header: %s", header.getANSIColoredMessage()));
Log.protocol(String.format("Received tab list footer: %s", footer.getANSIColoredMessage()));
Log.protocol(String.format("[IN] Received tab list header: %s", header.getANSIColoredMessage()));
Log.protocol(String.format("[IN] Received tab list footer: %s", footer.getANSIColoredMessage()));
}
public ChatComponent getHeader() {

View File

@ -51,6 +51,6 @@ public class PacketTags implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received tags (blockLength=%d, itemLength=%d, fluidLength=%d, entityLength=%d)", blockTags.length, itemTags.length, fluidTags.length, ((entityTags == null) ? 0 : entityTags.length)));
Log.protocol(String.format("[IN] Received tags (blockLength=%d, itemLength=%d, fluidLength=%d, entityLength=%d)", blockTags.length, itemTags.length, fluidTags.length, ((entityTags == null) ? 0 : entityTags.length)));
}
}

View File

@ -102,7 +102,7 @@ public class PacketTeams implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received scoreboard Team update (name=\"%s\", action=%s, displayName=\"%s\", prefix=\"%s\", suffix=\"%s\", friendlyFire=%s, seeFriendlyInvisibiles=%s, playerCount=%s)", name, action, displayName, prefix, suffix, friendlyFire, seeFriendlyInvisibles, ((playerNames == null) ? null : playerNames.length)));
Log.protocol(String.format("[IN] Received scoreboard Team update (name=\"%s\", action=%s, displayName=\"%s\", prefix=\"%s\", suffix=\"%s\", friendlyFire=%s, seeFriendlyInvisibiles=%s, playerCount=%s)", name, action, displayName, prefix, suffix, friendlyFire, seeFriendlyInvisibles, ((playerNames == null) ? null : playerNames.length)));
}
public String getName() {

View File

@ -36,7 +36,7 @@ public class PacketTimeUpdate implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Time Update packet received. Time is now %st (total %st, moving=%s)", Math.abs(timeOfDay), worldAge, timeOfDay > 0));
Log.protocol(String.format("[IN] Time Update packet received. Time is now %st (total %st, moving=%s)", Math.abs(timeOfDay), worldAge, timeOfDay > 0));
}
public long getWorldAge() {

View File

@ -54,10 +54,10 @@ public class PacketTitle implements ClientboundPacket {
@Override
public void log() {
switch (action) {
case SET_TITLE -> Log.protocol(String.format("Received title (action=%s, text=%s)", action, text.getANSIColoredMessage()));
case SET_SUBTITLE -> Log.protocol(String.format("Received title (action=%s, subText=%s)", action, subText.getANSIColoredMessage()));
case SET_TIMES_AND_DISPLAY -> Log.protocol(String.format("Received title (action=%s, fadeInTime=%d, stayTime=%d, fadeOutTime=%d)", action, fadeInTime, stayTime, fadeOutTime));
case HIDE, RESET -> Log.protocol(String.format("Received title (action=%s)", action));
case SET_TITLE -> Log.protocol(String.format("[IN] Received title (action=%s, text=%s)", action, text.getANSIColoredMessage()));
case SET_SUBTITLE -> Log.protocol(String.format("[IN] Received title (action=%s, subText=%s)", action, subText.getANSIColoredMessage()));
case SET_TIMES_AND_DISPLAY -> Log.protocol(String.format("[IN] Received title (action=%s, fadeInTime=%d, stayTime=%d, fadeOutTime=%d)", action, fadeInTime, stayTime, fadeOutTime));
case HIDE, RESET -> Log.protocol(String.format("[IN] Received title (action=%s)", action));
}
}

View File

@ -68,7 +68,7 @@ public class PacketTradeList implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received select trade packet (windowId=%d, tradeLength=%d, level=%s, experience=%d, regularVillager=%s, canRestock=%s)", windowId, trades.length, level, experience, isRegularVillager, canRestock));
Log.protocol(String.format("[IN] Received select trade packet (windowId=%d, tradeLength=%d, level=%s, experience=%d, regularVillager=%s, canRestock=%s)", windowId, trades.length, level, experience, isRegularVillager, canRestock));
}
public int getWindowId() {

View File

@ -35,7 +35,7 @@ public class PacketUnloadChunk implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received unload chunk packet (location=%s)", location));
Log.protocol(String.format("[IN] Received unload chunk packet (location=%s)", location));
}
public ChunkLocation getLocation() {

View File

@ -80,7 +80,7 @@ public class PacketUnlockRecipes implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received unlock crafting recipe packet (action=%s, isCraftingBookOpen=%s, isFilteringActive=%s, isSmeltingBookOpen=%s, isSmeltingFilteringActive=%s listedLength=%d, taggedLength=%s)", action, isCraftingBookOpen, isCraftingFilteringActive, isSmeltingBookOpen, isSmeltingFilteringActive, listed.length, ((tagged == null) ? 0 : tagged.length)));
Log.protocol(String.format("[IN] Received unlock crafting recipe packet (action=%s, isCraftingBookOpen=%s, isFilteringActive=%s, isSmeltingBookOpen=%s, isSmeltingFilteringActive=%s listedLength=%d, taggedLength=%s)", action, isCraftingBookOpen, isCraftingFilteringActive, isSmeltingBookOpen, isSmeltingFilteringActive, listed.length, ((tagged == null) ? 0 : tagged.length)));
}
public boolean isCraftingBookOpen() {

View File

@ -42,7 +42,7 @@ public class PacketUpdateHealth implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Health update. Now at %s hearts and %s food level and %s saturation", health, food, saturation));
Log.protocol(String.format("[IN] Health update. Now at %s hearts and %s food level and %s saturation", health, food, saturation));
}
public int getFood() {

View File

@ -45,6 +45,6 @@ public class PacketUpdateLight implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received light update (location=%s)", location));
Log.protocol(String.format("[IN] Received light update (location=%s)", location));
}
}

View File

@ -44,7 +44,7 @@ public class PacketUpdateSignReceiving implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Sign data received at: %s", position));
Log.protocol(String.format("[IN] Sign data received at: %s", position));
}
public BlockPosition getPosition() {

View File

@ -34,6 +34,6 @@ public class PacketUpdateViewDistance implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received view distance update (viewDistance=%s)", viewDistance));
Log.protocol(String.format("[IN] Received view distance update (viewDistance=%s)", viewDistance));
}
}

View File

@ -35,6 +35,6 @@ public class PacketUpdateViewPosition implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received view position update (location=%s)", location));
Log.protocol(String.format("[IN] Received view position update (location=%s)", location));
}
}

View File

@ -41,7 +41,7 @@ public class PacketUseBed implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Entity used bed at %s (entityId=%d)", position, entityId));
Log.protocol(String.format("[IN] Entity used bed at %s (entityId=%d)", position, entityId));
}
public int getEntityId() {

View File

@ -39,7 +39,7 @@ public class PacketVehicleMovement implements ClientboundPacket {
@Override
public void log() {
Log.protocol(String.format("Received vehicle movement (location=%s, yaw=%s, pitch=%s)", location, yaw, pitch));
Log.protocol(String.format("[IN] Received vehicle movement (location=%s, yaw=%s, pitch=%s)", location, yaw, pitch));
}
public Location getLocation() {

Some files were not shown because too many files have changed in this diff Show More