More renames

This commit is contained in:
RednedEpic 2021-11-13 17:14:13 -06:00
parent c18fa85120
commit 955986da96
102 changed files with 836 additions and 871 deletions

View file

@ -53,15 +53,15 @@ import com.github.steveice10.mc.protocol.packet.ingame.clientbound.title.Clientb
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.title.ClientboundSetSubtitleTextPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.title.ClientboundSetTitleTextPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.title.ClientboundSetTitlesAnimationPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.window.ClientboundContainerClosePacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.window.ClientboundContainerSetContentPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.window.ClientboundContainerSetDataPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.window.ClientboundContainerSetSlotPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.window.ClientboundHorseScreenOpenPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.window.ClientboundMerchantOffersPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.window.ClientboundOpenBookPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.window.ClientboundOpenScreenPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.window.ClientboundPlaceGhostRecipePacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory.ClientboundContainerClosePacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory.ClientboundContainerSetContentPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory.ClientboundContainerSetDataPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory.ClientboundContainerSetSlotPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory.ClientboundHorseScreenOpenPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory.ClientboundMerchantOffersPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory.ClientboundOpenBookPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory.ClientboundOpenScreenPacket;
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory.ClientboundPlaceGhostRecipePacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.ServerboundChangeDifficultyPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.ServerboundChatPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.ServerboundClientCommandPacket;
@ -93,23 +93,23 @@ import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.Server
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.ServerboundSwingPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.ServerboundUseItemOnPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.ServerboundUseItemPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.window.ServerboundContainerButtonClickPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.window.ServerboundContainerClickPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.window.ServerboundContainerClosePacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.window.ServerboundEditBookPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.window.ServerboundPickItemPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.window.ServerboundPlaceRecipePacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.window.ServerboundRecipeBookChangeSettingsPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.window.ServerboundRecipeBookSeenRecipePacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.window.ServerboundRenameItemPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.window.ServerboundSeenAdvancementsPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.window.ServerboundSelectTradePacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.window.ServerboundSetBeaconPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.window.ServerboundSetCommandBlockPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.window.ServerboundSetCommandMinecartPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.window.ServerboundSetCreativeModeSlotPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.window.ServerboundSetJigsawBlockPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.window.ServerboundSetStructureBlockPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundContainerButtonClickPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundContainerClickPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundContainerClosePacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundEditBookPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundPickItemPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundPlaceRecipePacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundRecipeBookChangeSettingsPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundRecipeBookSeenRecipePacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundRenameItemPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundSeenAdvancementsPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundSelectTradePacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundSetBeaconPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundSetCommandBlockPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundSetCommandMinecartPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundSetCreativeModeSlotPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundSetJigsawBlockPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory.ServerboundSetStructureBlockPacket;
import com.github.steveice10.mc.protocol.packet.login.clientbound.ClientboundCustomQueryPacket;
import com.github.steveice10.mc.protocol.packet.login.clientbound.ClientboundGameProfilePacket;
import com.github.steveice10.mc.protocol.packet.login.clientbound.ClientboundHelloPacket;

View file

@ -3,7 +3,7 @@ package com.github.steveice10.mc.protocol.data;
import com.github.steveice10.mc.protocol.data.game.BossBarAction;
import com.github.steveice10.mc.protocol.data.game.BossBarColor;
import com.github.steveice10.mc.protocol.data.game.BossBarDivision;
import com.github.steveice10.mc.protocol.data.game.ClientRequest;
import com.github.steveice10.mc.protocol.data.game.ClientCommand;
import com.github.steveice10.mc.protocol.data.game.MessageType;
import com.github.steveice10.mc.protocol.data.game.PlayerListEntryAction;
import com.github.steveice10.mc.protocol.data.game.ResourcePackStatus;
@ -13,7 +13,7 @@ import com.github.steveice10.mc.protocol.data.game.command.CommandParser;
import com.github.steveice10.mc.protocol.data.game.command.CommandType;
import com.github.steveice10.mc.protocol.data.game.command.SuggestionType;
import com.github.steveice10.mc.protocol.data.game.command.properties.StringProperties;
import com.github.steveice10.mc.protocol.data.game.entity.EntityStatus;
import com.github.steveice10.mc.protocol.data.game.entity.EntityEvent;
import com.github.steveice10.mc.protocol.data.game.entity.EquipmentSlot;
import com.github.steveice10.mc.protocol.data.game.entity.RotationOrigin;
import com.github.steveice10.mc.protocol.data.game.entity.attribute.AttributeType;
@ -24,7 +24,6 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.Pose;
import com.github.steveice10.mc.protocol.data.game.entity.object.HangingDirection;
import com.github.steveice10.mc.protocol.data.game.entity.object.MinecartType;
import com.github.steveice10.mc.protocol.data.game.entity.player.Animation;
import com.github.steveice10.mc.protocol.data.game.entity.player.BlockBreakStage;
import com.github.steveice10.mc.protocol.data.game.entity.player.GameMode;
import com.github.steveice10.mc.protocol.data.game.entity.player.Hand;
import com.github.steveice10.mc.protocol.data.game.entity.player.HandPreference;
@ -39,7 +38,7 @@ import com.github.steveice10.mc.protocol.data.game.level.block.BlockFace;
import com.github.steveice10.mc.protocol.data.game.level.block.CommandBlockMode;
import com.github.steveice10.mc.protocol.data.game.level.block.StructureMirror;
import com.github.steveice10.mc.protocol.data.game.level.block.StructureRotation;
import com.github.steveice10.mc.protocol.data.game.level.block.UpdatedTileType;
import com.github.steveice10.mc.protocol.data.game.level.block.BlockEntityType;
import com.github.steveice10.mc.protocol.data.game.level.block.value.ChestValueType;
import com.github.steveice10.mc.protocol.data.game.level.block.value.EndGatewayValueType;
import com.github.steveice10.mc.protocol.data.game.level.block.value.GenericBlockValueType;
@ -47,13 +46,13 @@ import com.github.steveice10.mc.protocol.data.game.level.block.value.MobSpawnerV
import com.github.steveice10.mc.protocol.data.game.level.block.value.NoteBlockValueType;
import com.github.steveice10.mc.protocol.data.game.level.block.value.PistonValue;
import com.github.steveice10.mc.protocol.data.game.level.block.value.PistonValueType;
import com.github.steveice10.mc.protocol.data.game.level.effect.ComposterEffectData;
import com.github.steveice10.mc.protocol.data.game.level.effect.DragonFireballEffectData;
import com.github.steveice10.mc.protocol.data.game.level.effect.ParticleEffect;
import com.github.steveice10.mc.protocol.data.game.level.effect.SmokeEffectData;
import com.github.steveice10.mc.protocol.data.game.level.effect.SoundEffect;
import com.github.steveice10.mc.protocol.data.game.level.event.ComposterEventData;
import com.github.steveice10.mc.protocol.data.game.level.event.DragonFireballEventData;
import com.github.steveice10.mc.protocol.data.game.level.event.ParticleEvent;
import com.github.steveice10.mc.protocol.data.game.level.event.SmokeEventData;
import com.github.steveice10.mc.protocol.data.game.level.event.SoundEvent;
import com.github.steveice10.mc.protocol.data.game.level.map.MapIconType;
import com.github.steveice10.mc.protocol.data.game.level.notify.ClientNotification;
import com.github.steveice10.mc.protocol.data.game.level.notify.GameEvent;
import com.github.steveice10.mc.protocol.data.game.level.notify.DemoMessageValue;
import com.github.steveice10.mc.protocol.data.game.level.notify.EnterCreditsValue;
import com.github.steveice10.mc.protocol.data.game.level.notify.RespawnScreenValue;
@ -70,23 +69,23 @@ import com.github.steveice10.mc.protocol.data.game.setting.ChatVisibility;
import com.github.steveice10.mc.protocol.data.game.setting.Difficulty;
import com.github.steveice10.mc.protocol.data.game.statistic.GenericStatistic;
import com.github.steveice10.mc.protocol.data.game.statistic.StatisticCategory;
import com.github.steveice10.mc.protocol.data.game.window.AdvancementTabAction;
import com.github.steveice10.mc.protocol.data.game.window.ClickItemParam;
import com.github.steveice10.mc.protocol.data.game.window.CraftingBookStateType;
import com.github.steveice10.mc.protocol.data.game.window.CreativeGrabParam;
import com.github.steveice10.mc.protocol.data.game.window.DropItemParam;
import com.github.steveice10.mc.protocol.data.game.window.FillStackParam;
import com.github.steveice10.mc.protocol.data.game.window.MoveToHotbarParam;
import com.github.steveice10.mc.protocol.data.game.window.ShiftClickItemParam;
import com.github.steveice10.mc.protocol.data.game.window.SpreadItemParam;
import com.github.steveice10.mc.protocol.data.game.window.UpdateStructureBlockAction;
import com.github.steveice10.mc.protocol.data.game.window.UpdateStructureBlockMode;
import com.github.steveice10.mc.protocol.data.game.window.WindowAction;
import com.github.steveice10.mc.protocol.data.game.window.WindowType;
import com.github.steveice10.mc.protocol.data.game.window.property.AnvilProperty;
import com.github.steveice10.mc.protocol.data.game.window.property.BrewingStandProperty;
import com.github.steveice10.mc.protocol.data.game.window.property.EnchantmentTableProperty;
import com.github.steveice10.mc.protocol.data.game.window.property.FurnaceProperty;
import com.github.steveice10.mc.protocol.data.game.inventory.AdvancementTabAction;
import com.github.steveice10.mc.protocol.data.game.inventory.ClickItemAction;
import com.github.steveice10.mc.protocol.data.game.inventory.CraftingBookStateType;
import com.github.steveice10.mc.protocol.data.game.inventory.CreativeGrabAction;
import com.github.steveice10.mc.protocol.data.game.inventory.DropItemAction;
import com.github.steveice10.mc.protocol.data.game.inventory.FillStackAction;
import com.github.steveice10.mc.protocol.data.game.inventory.MoveToHotbarAction;
import com.github.steveice10.mc.protocol.data.game.inventory.ShiftClickItemAction;
import com.github.steveice10.mc.protocol.data.game.inventory.SpreadItemAction;
import com.github.steveice10.mc.protocol.data.game.inventory.UpdateStructureBlockAction;
import com.github.steveice10.mc.protocol.data.game.inventory.UpdateStructureBlockMode;
import com.github.steveice10.mc.protocol.data.game.inventory.ContainerActionType;
import com.github.steveice10.mc.protocol.data.game.inventory.ContainerType;
import com.github.steveice10.mc.protocol.data.game.inventory.property.AnvilProperty;
import com.github.steveice10.mc.protocol.data.game.inventory.property.BrewingStandProperty;
import com.github.steveice10.mc.protocol.data.game.inventory.property.EnchantmentTableProperty;
import com.github.steveice10.mc.protocol.data.game.inventory.property.FurnaceProperty;
import com.github.steveice10.mc.protocol.data.handshake.HandshakeIntent;
import java.util.ArrayList;
@ -176,8 +175,8 @@ public class MagicValues {
register(HandshakeIntent.STATUS, 1);
register(HandshakeIntent.LOGIN, 2);
register(ClientRequest.RESPAWN, 0);
register(ClientRequest.STATS, 1);
register(ClientCommand.RESPAWN, 0);
register(ClientCommand.STATS, 1);
register(ChatVisibility.FULL, 0);
register(ChatVisibility.SYSTEM, 1);
@ -205,48 +204,48 @@ public class MagicValues {
register(PlayerAction.RELEASE_USE_ITEM, 5);
register(PlayerAction.SWAP_HANDS, 6);
register(WindowAction.CLICK_ITEM, 0);
register(WindowAction.SHIFT_CLICK_ITEM, 1);
register(WindowAction.MOVE_TO_HOTBAR_SLOT, 2);
register(WindowAction.CREATIVE_GRAB_MAX_STACK, 3);
register(WindowAction.DROP_ITEM, 4);
register(WindowAction.SPREAD_ITEM, 5);
register(WindowAction.FILL_STACK, 6);
register(ContainerActionType.CLICK_ITEM, 0);
register(ContainerActionType.SHIFT_CLICK_ITEM, 1);
register(ContainerActionType.MOVE_TO_HOTBAR_SLOT, 2);
register(ContainerActionType.CREATIVE_GRAB_MAX_STACK, 3);
register(ContainerActionType.DROP_ITEM, 4);
register(ContainerActionType.SPREAD_ITEM, 5);
register(ContainerActionType.FILL_STACK, 6);
register(ClickItemParam.LEFT_CLICK, 0);
register(ClickItemParam.RIGHT_CLICK, 1);
register(ClickItemAction.LEFT_CLICK, 0);
register(ClickItemAction.RIGHT_CLICK, 1);
register(ShiftClickItemParam.LEFT_CLICK, 0);
register(ShiftClickItemParam.RIGHT_CLICK, 1);
register(ShiftClickItemAction.LEFT_CLICK, 0);
register(ShiftClickItemAction.RIGHT_CLICK, 1);
register(MoveToHotbarParam.SLOT_1, 0);
register(MoveToHotbarParam.SLOT_2, 1);
register(MoveToHotbarParam.SLOT_3, 2);
register(MoveToHotbarParam.SLOT_4, 3);
register(MoveToHotbarParam.SLOT_5, 4);
register(MoveToHotbarParam.SLOT_6, 5);
register(MoveToHotbarParam.SLOT_7, 6);
register(MoveToHotbarParam.SLOT_8, 7);
register(MoveToHotbarParam.SLOT_9, 8);
register(MoveToHotbarAction.SLOT_1, 0);
register(MoveToHotbarAction.SLOT_2, 1);
register(MoveToHotbarAction.SLOT_3, 2);
register(MoveToHotbarAction.SLOT_4, 3);
register(MoveToHotbarAction.SLOT_5, 4);
register(MoveToHotbarAction.SLOT_6, 5);
register(MoveToHotbarAction.SLOT_7, 6);
register(MoveToHotbarAction.SLOT_8, 7);
register(MoveToHotbarAction.SLOT_9, 8);
register(CreativeGrabParam.GRAB, 2);
register(CreativeGrabAction.GRAB, 2);
register(DropItemParam.LEFT_CLICK_OUTSIDE_NOT_HOLDING, 0);
register(DropItemParam.RIGHT_CLICK_OUTSIDE_NOT_HOLDING, 1);
register(DropItemParam.DROP_FROM_SELECTED, 2);
register(DropItemParam.DROP_SELECTED_STACK, 3);
register(DropItemAction.LEFT_CLICK_OUTSIDE_NOT_HOLDING, 0);
register(DropItemAction.RIGHT_CLICK_OUTSIDE_NOT_HOLDING, 1);
register(DropItemAction.DROP_FROM_SELECTED, 2);
register(DropItemAction.DROP_SELECTED_STACK, 3);
register(SpreadItemParam.LEFT_MOUSE_BEGIN_DRAG, 0);
register(SpreadItemParam.LEFT_MOUSE_ADD_SLOT, 1);
register(SpreadItemParam.LEFT_MOUSE_END_DRAG, 2);
register(SpreadItemParam.RIGHT_MOUSE_BEGIN_DRAG, 4);
register(SpreadItemParam.RIGHT_MOUSE_ADD_SLOT, 5);
register(SpreadItemParam.RIGHT_MOUSE_END_DRAG, 6);
register(SpreadItemParam.MIDDLE_MOUSE_BEGIN_DRAG, 8);
register(SpreadItemParam.MIDDLE_MOUSE_ADD_SLOT, 9);
register(SpreadItemParam.MIDDLE_MOUSE_END_DRAG, 10);
register(SpreadItemAction.LEFT_MOUSE_BEGIN_DRAG, 0);
register(SpreadItemAction.LEFT_MOUSE_ADD_SLOT, 1);
register(SpreadItemAction.LEFT_MOUSE_END_DRAG, 2);
register(SpreadItemAction.RIGHT_MOUSE_BEGIN_DRAG, 4);
register(SpreadItemAction.RIGHT_MOUSE_ADD_SLOT, 5);
register(SpreadItemAction.RIGHT_MOUSE_END_DRAG, 6);
register(SpreadItemAction.MIDDLE_MOUSE_BEGIN_DRAG, 8);
register(SpreadItemAction.MIDDLE_MOUSE_ADD_SLOT, 9);
register(SpreadItemAction.MIDDLE_MOUSE_END_DRAG, 10);
register(FillStackParam.FILL, 0);
register(FillStackAction.FILL, 0);
register(MessageType.CHAT, 0);
register(MessageType.SYSTEM, 1);
@ -270,66 +269,66 @@ public class MagicValues {
register(Animation.CRITICAL_HIT, 4);
register(Animation.ENCHANTMENT_CRITICAL_HIT, 5);
register(EntityStatus.TIPPED_ARROW_EMIT_PARTICLES, 0);
register(EntityStatus.RABBIT_JUMP_OR_MINECART_SPAWNER_DELAY_RESET, 1);
register(EntityStatus.LIVING_HURT, 2);
register(EntityStatus.LIVING_DEATH, 3);
register(EntityStatus.IRON_GOLEM_ATTACK, 4);
register(EntityStatus.TAMEABLE_TAMING_FAILED, 6);
register(EntityStatus.TAMEABLE_TAMING_SUCCEEDED, 7);
register(EntityStatus.WOLF_SHAKE_WATER, 8);
register(EntityStatus.PLAYER_FINISH_USING_ITEM, 9);
register(EntityStatus.SHEEP_GRAZE_OR_TNT_CART_EXPLODE, 10);
register(EntityStatus.IRON_GOLEM_HOLD_POPPY, 11);
register(EntityStatus.VILLAGER_MATE, 12);
register(EntityStatus.VILLAGER_ANGRY, 13);
register(EntityStatus.VILLAGER_HAPPY, 14);
register(EntityStatus.WITCH_EMIT_PARTICLES, 15);
register(EntityStatus.ZOMBIE_VILLAGER_CURE, 16);
register(EntityStatus.FIREWORK_EXPLODE, 17);
register(EntityStatus.ANIMAL_EMIT_HEARTS, 18);
register(EntityStatus.SQUID_RESET_ROTATION, 19);
register(EntityStatus.MOB_EMIT_SMOKE, 20);
register(EntityStatus.GUARDIAN_MAKE_SOUND, 21);
register(EntityStatus.PLAYER_ENABLE_REDUCED_DEBUG, 22);
register(EntityStatus.PLAYER_DISABLE_REDUCED_DEBUG, 23);
register(EntityStatus.PLAYER_OP_PERMISSION_LEVEL_0, 24);
register(EntityStatus.PLAYER_OP_PERMISSION_LEVEL_1, 25);
register(EntityStatus.PLAYER_OP_PERMISSION_LEVEL_2, 26);
register(EntityStatus.PLAYER_OP_PERMISSION_LEVEL_3, 27);
register(EntityStatus.PLAYER_OP_PERMISSION_LEVEL_4, 28);
register(EntityStatus.LIVING_SHIELD_BLOCK, 29);
register(EntityStatus.LIVING_SHIELD_BREAK, 30);
register(EntityStatus.FISHING_HOOK_PULL_PLAYER, 31);
register(EntityStatus.ARMOR_STAND_HIT, 32);
register(EntityStatus.LIVING_HURT_THORNS, 33);
register(EntityStatus.IRON_GOLEM_EMPTY_HAND, 34);
register(EntityStatus.TOTEM_OF_UNDYING_MAKE_SOUND, 35);
register(EntityStatus.LIVING_DROWN, 36);
register(EntityStatus.LIVING_BURN, 37);
register(EntityStatus.DOLPHIN_HAPPY, 38);
register(EntityStatus.RAVAGER_STUNNED, 39);
register(EntityStatus.OCELOT_TAMING_FAILED, 40);
register(EntityStatus.OCELOT_TAMING_SUCCEEDED, 41);
register(EntityStatus.VILLAGER_SWEAT, 42);
register(EntityStatus.PLAYER_EMIT_CLOUD, 43);
register(EntityStatus.LIVING_HURT_SWEET_BERRY_BUSH, 44);
register(EntityStatus.FOX_EATING, 45);
register(EntityStatus.LIVING_TELEPORT, 46);
register(EntityStatus.LIVING_EQUIPMENT_BREAK_MAIN_HAND, 47);
register(EntityStatus.LIVING_EQUIPMENT_BREAK_OFF_HAND, 48);
register(EntityStatus.LIVING_EQUIPMENT_BREAK_HEAD, 49);
register(EntityStatus.LIVING_EQUIPMENT_BREAK_CHEST, 50);
register(EntityStatus.LIVING_EQUIPMENT_BREAK_LEGS, 51);
register(EntityStatus.LIVING_EQUIPMENT_BREAK_FEET, 52);
register(EntityStatus.HONEY_BLOCK_SLIDE, 53);
register(EntityStatus.HONEY_BLOCK_LAND, 54);
register(EntityStatus.PLAYER_SWAP_SAME_ITEM, 55);
register(EntityStatus.WOLF_SHAKE_WATER_STOP, 56);
register(EntityStatus.LIVING_FREEZE, 57);
register(EntityStatus.GOAT_LOWERING_HEAD, 58);
register(EntityStatus.GOAT_STOP_LOWERING_HEAD, 59);
register(EntityStatus.MAKE_POOF_PARTICLES, 60);
register(EntityEvent.TIPPED_ARROW_EMIT_PARTICLES, 0);
register(EntityEvent.RABBIT_JUMP_OR_MINECART_SPAWNER_DELAY_RESET, 1);
register(EntityEvent.LIVING_HURT, 2);
register(EntityEvent.LIVING_DEATH, 3);
register(EntityEvent.IRON_GOLEM_ATTACK, 4);
register(EntityEvent.TAMEABLE_TAMING_FAILED, 6);
register(EntityEvent.TAMEABLE_TAMING_SUCCEEDED, 7);
register(EntityEvent.WOLF_SHAKE_WATER, 8);
register(EntityEvent.PLAYER_FINISH_USING_ITEM, 9);
register(EntityEvent.SHEEP_GRAZE_OR_TNT_CART_EXPLODE, 10);
register(EntityEvent.IRON_GOLEM_HOLD_POPPY, 11);
register(EntityEvent.VILLAGER_MATE, 12);
register(EntityEvent.VILLAGER_ANGRY, 13);
register(EntityEvent.VILLAGER_HAPPY, 14);
register(EntityEvent.WITCH_EMIT_PARTICLES, 15);
register(EntityEvent.ZOMBIE_VILLAGER_CURE, 16);
register(EntityEvent.FIREWORK_EXPLODE, 17);
register(EntityEvent.ANIMAL_EMIT_HEARTS, 18);
register(EntityEvent.SQUID_RESET_ROTATION, 19);
register(EntityEvent.MOB_EMIT_SMOKE, 20);
register(EntityEvent.GUARDIAN_MAKE_SOUND, 21);
register(EntityEvent.PLAYER_ENABLE_REDUCED_DEBUG, 22);
register(EntityEvent.PLAYER_DISABLE_REDUCED_DEBUG, 23);
register(EntityEvent.PLAYER_OP_PERMISSION_LEVEL_0, 24);
register(EntityEvent.PLAYER_OP_PERMISSION_LEVEL_1, 25);
register(EntityEvent.PLAYER_OP_PERMISSION_LEVEL_2, 26);
register(EntityEvent.PLAYER_OP_PERMISSION_LEVEL_3, 27);
register(EntityEvent.PLAYER_OP_PERMISSION_LEVEL_4, 28);
register(EntityEvent.LIVING_SHIELD_BLOCK, 29);
register(EntityEvent.LIVING_SHIELD_BREAK, 30);
register(EntityEvent.FISHING_HOOK_PULL_PLAYER, 31);
register(EntityEvent.ARMOR_STAND_HIT, 32);
register(EntityEvent.LIVING_HURT_THORNS, 33);
register(EntityEvent.IRON_GOLEM_EMPTY_HAND, 34);
register(EntityEvent.TOTEM_OF_UNDYING_MAKE_SOUND, 35);
register(EntityEvent.LIVING_DROWN, 36);
register(EntityEvent.LIVING_BURN, 37);
register(EntityEvent.DOLPHIN_HAPPY, 38);
register(EntityEvent.RAVAGER_STUNNED, 39);
register(EntityEvent.OCELOT_TAMING_FAILED, 40);
register(EntityEvent.OCELOT_TAMING_SUCCEEDED, 41);
register(EntityEvent.VILLAGER_SWEAT, 42);
register(EntityEvent.PLAYER_EMIT_CLOUD, 43);
register(EntityEvent.LIVING_HURT_SWEET_BERRY_BUSH, 44);
register(EntityEvent.FOX_EATING, 45);
register(EntityEvent.LIVING_TELEPORT, 46);
register(EntityEvent.LIVING_EQUIPMENT_BREAK_MAIN_HAND, 47);
register(EntityEvent.LIVING_EQUIPMENT_BREAK_OFF_HAND, 48);
register(EntityEvent.LIVING_EQUIPMENT_BREAK_HEAD, 49);
register(EntityEvent.LIVING_EQUIPMENT_BREAK_CHEST, 50);
register(EntityEvent.LIVING_EQUIPMENT_BREAK_LEGS, 51);
register(EntityEvent.LIVING_EQUIPMENT_BREAK_FEET, 52);
register(EntityEvent.HONEY_BLOCK_SLIDE, 53);
register(EntityEvent.HONEY_BLOCK_LAND, 54);
register(EntityEvent.PLAYER_SWAP_SAME_ITEM, 55);
register(EntityEvent.WOLF_SHAKE_WATER_STOP, 56);
register(EntityEvent.LIVING_FREEZE, 57);
register(EntityEvent.GOAT_LOWERING_HEAD, 58);
register(EntityEvent.GOAT_STOP_LOWERING_HEAD, 59);
register(EntityEvent.MAKE_POOF_PARTICLES, 60);
register(PositionElement.X, 0);
register(PositionElement.Y, 1);
@ -556,30 +555,30 @@ public class MagicValues {
register(MapIconType.BLACK_BANNER, 25);
register(MapIconType.TREASURE_MARKER, 26);
register(WindowType.GENERIC_9X1, 0);
register(WindowType.GENERIC_9X2, 1);
register(WindowType.GENERIC_9X3, 2);
register(WindowType.GENERIC_9X4, 3);
register(WindowType.GENERIC_9X5, 4);
register(WindowType.GENERIC_9X6, 5);
register(WindowType.GENERIC_3X3, 6);
register(WindowType.ANVIL, 7);
register(WindowType.BEACON, 8);
register(WindowType.BLAST_FURNACE, 9);
register(WindowType.BREWING_STAND, 10);
register(WindowType.CRAFTING, 11);
register(WindowType.ENCHANTMENT, 12);
register(WindowType.FURNACE, 13);
register(WindowType.GRINDSTONE, 14);
register(WindowType.HOPPER, 15);
register(WindowType.LECTERN, 16);
register(WindowType.LOOM, 17);
register(WindowType.MERCHANT, 18);
register(WindowType.SHULKER_BOX, 19);
register(WindowType.SMITHING, 20);
register(WindowType.SMOKER, 21);
register(WindowType.CARTOGRAPHY, 22);
register(WindowType.STONECUTTER, 23);
register(ContainerType.GENERIC_9X1, 0);
register(ContainerType.GENERIC_9X2, 1);
register(ContainerType.GENERIC_9X3, 2);
register(ContainerType.GENERIC_9X4, 3);
register(ContainerType.GENERIC_9X5, 4);
register(ContainerType.GENERIC_9X6, 5);
register(ContainerType.GENERIC_3X3, 6);
register(ContainerType.ANVIL, 7);
register(ContainerType.BEACON, 8);
register(ContainerType.BLAST_FURNACE, 9);
register(ContainerType.BREWING_STAND, 10);
register(ContainerType.CRAFTING, 11);
register(ContainerType.ENCHANTMENT, 12);
register(ContainerType.FURNACE, 13);
register(ContainerType.GRINDSTONE, 14);
register(ContainerType.HOPPER, 15);
register(ContainerType.LECTERN, 16);
register(ContainerType.LOOM, 17);
register(ContainerType.MERCHANT, 18);
register(ContainerType.SHULKER_BOX, 19);
register(ContainerType.SMITHING, 20);
register(ContainerType.SMOKER, 21);
register(ContainerType.CARTOGRAPHY, 22);
register(ContainerType.STONECUTTER, 23);
register(BrewingStandProperty.BREW_TIME, 0);
@ -598,33 +597,33 @@ public class MagicValues {
register(AnvilProperty.MAXIMUM_COST, 0);
register(UpdatedTileType.MOB_SPAWNER, 1);
register(UpdatedTileType.COMMAND_BLOCK, 2);
register(UpdatedTileType.BEACON, 3);
register(UpdatedTileType.SKULL, 4);
register(UpdatedTileType.CONDUIT, 5);
register(UpdatedTileType.BANNER, 6);
register(UpdatedTileType.STRUCTURE_BLOCK, 7);
register(UpdatedTileType.END_GATEWAY, 8);
register(UpdatedTileType.SIGN, 9);
register(UpdatedTileType.SHULKER_BOX, 10);
register(UpdatedTileType.BED, 11);
register(UpdatedTileType.JIGSAW_BLOCK, 12);
register(UpdatedTileType.CAMPFIRE, 13);
register(UpdatedTileType.BEEHIVE, 14);
register(BlockEntityType.MOB_SPAWNER, 1);
register(BlockEntityType.COMMAND_BLOCK, 2);
register(BlockEntityType.BEACON, 3);
register(BlockEntityType.SKULL, 4);
register(BlockEntityType.CONDUIT, 5);
register(BlockEntityType.BANNER, 6);
register(BlockEntityType.STRUCTURE_BLOCK, 7);
register(BlockEntityType.END_GATEWAY, 8);
register(BlockEntityType.SIGN, 9);
register(BlockEntityType.SHULKER_BOX, 10);
register(BlockEntityType.BED, 11);
register(BlockEntityType.JIGSAW_BLOCK, 12);
register(BlockEntityType.CAMPFIRE, 13);
register(BlockEntityType.BEEHIVE, 14);
register(ClientNotification.INVALID_BED, 0);
register(ClientNotification.STOP_RAIN, 1);
register(ClientNotification.START_RAIN, 2);
register(ClientNotification.CHANGE_GAMEMODE, 3);
register(ClientNotification.ENTER_CREDITS, 4);
register(ClientNotification.DEMO_MESSAGE, 5);
register(ClientNotification.ARROW_HIT_PLAYER, 6);
register(ClientNotification.RAIN_STRENGTH, 7);
register(ClientNotification.THUNDER_STRENGTH, 8);
register(ClientNotification.PUFFERFISH_STING_SOUND, 9);
register(ClientNotification.AFFECTED_BY_ELDER_GUARDIAN, 10);
register(ClientNotification.ENABLE_RESPAWN_SCREEN, 11);
register(GameEvent.INVALID_BED, 0);
register(GameEvent.STOP_RAIN, 1);
register(GameEvent.START_RAIN, 2);
register(GameEvent.CHANGE_GAMEMODE, 3);
register(GameEvent.ENTER_CREDITS, 4);
register(GameEvent.DEMO_MESSAGE, 5);
register(GameEvent.ARROW_HIT_PLAYER, 6);
register(GameEvent.RAIN_STRENGTH, 7);
register(GameEvent.THUNDER_STRENGTH, 8);
register(GameEvent.PUFFERFISH_STING_SOUND, 9);
register(GameEvent.AFFECTED_BY_ELDER_GUARDIAN, 10);
register(GameEvent.ENABLE_RESPAWN_SCREEN, 11);
register(CommandBlockMode.SEQUENCE, 0);
register(CommandBlockMode.AUTO, 1);
@ -783,91 +782,91 @@ public class MagicValues {
register(PistonValue.WEST, 4);
register(PistonValue.EAST, 5);
register(SoundEffect.BLOCK_DISPENSER_DISPENSE, 1000);
register(SoundEffect.BLOCK_DISPENSER_FAIL, 1001);
register(SoundEffect.BLOCK_DISPENSER_LAUNCH, 1002);
register(SoundEffect.ENTITY_ENDEREYE_LAUNCH, 1003);
register(SoundEffect.ENTITY_FIREWORK_SHOOT, 1004);
register(SoundEffect.BLOCK_IRON_DOOR_OPEN, 1005);
register(SoundEffect.BLOCK_WOODEN_DOOR_OPEN, 1006);
register(SoundEffect.BLOCK_WOODEN_TRAPDOOR_OPEN, 1007);
register(SoundEffect.BLOCK_FENCE_GATE_OPEN, 1008);
register(SoundEffect.BLOCK_FIRE_EXTINGUISH, 1009);
register(SoundEffect.RECORD, 1010);
register(SoundEffect.BLOCK_IRON_DOOR_CLOSE, 1011);
register(SoundEffect.BLOCK_WOODEN_DOOR_CLOSE, 1012);
register(SoundEffect.BLOCK_WOODEN_TRAPDOOR_CLOSE, 1013);
register(SoundEffect.BLOCK_FENCE_GATE_CLOSE, 1014);
register(SoundEffect.ENTITY_GHAST_WARN, 1015);
register(SoundEffect.ENTITY_GHAST_SHOOT, 1016);
register(SoundEffect.ENTITY_ENDERDRAGON_SHOOT, 1017);
register(SoundEffect.ENTITY_BLAZE_SHOOT, 1018);
register(SoundEffect.ENTITY_ZOMBIE_ATTACK_DOOR_WOOD, 1019);
register(SoundEffect.ENTITY_ZOMBIE_ATTACK_DOOR_IRON, 1020);
register(SoundEffect.ENTITY_ZOMBIE_BREAK_DOOR_WOOD, 1021);
register(SoundEffect.ENTITY_WITHER_BREAK_BLOCK, 1022);
register(SoundEffect.ENTITY_WITHER_SPAWN, 1023);
register(SoundEffect.ENTITY_WITHER_SHOOT, 1024);
register(SoundEffect.ENTITY_BAT_TAKEOFF, 1025);
register(SoundEffect.ENTITY_ZOMBIE_INFECT, 1026);
register(SoundEffect.ENTITY_ZOMBIE_VILLAGER_CONVERTED, 1027);
register(SoundEffect.ENTITY_ENDERDRAGON_DEATH, 1028);
register(SoundEffect.BLOCK_ANVIL_DESTROY, 1029);
register(SoundEffect.BLOCK_ANVIL_USE, 1030);
register(SoundEffect.BLOCK_ANVIL_LAND, 1031);
register(SoundEffect.BLOCK_PORTAL_TRAVEL, 1032);
register(SoundEffect.BLOCK_CHORUS_FLOWER_GROW, 1033);
register(SoundEffect.BLOCK_CHORUS_FLOWER_DEATH, 1034);
register(SoundEffect.BLOCK_BREWING_STAND_BREW, 1035);
register(SoundEffect.BLOCK_IRON_TRAPDOOR_CLOSE, 1036);
register(SoundEffect.BLOCK_IRON_TRAPDOOR_OPEN, 1037);
register(SoundEffect.BLOCK_END_PORTAL_SPAWN, 1038);
register(SoundEffect.ENTITY_PHANTOM_BITE, 1039);
register(SoundEffect.ENTITY_ZOMBIE_CONVERTED_TO_DROWNED, 1040);
register(SoundEffect.ENTITY_HUSK_CONVERTED_TO_ZOMBIE, 1041);
register(SoundEffect.BLOCK_GRINDSTONE_USE, 1042);
register(SoundEffect.ITEM_BOOK_PAGE_TURN, 1043);
register(SoundEffect.BLOCK_SMITHING_TABLE_USE, 1044);
register(SoundEffect.POINTED_DRIPSTONE_LAND, 1045);
register(SoundEffect.DRIP_LAVA_INTO_CAULDRON, 1046);
register(SoundEffect.DRIP_WATER_INTO_CAULDRON, 1047);
register(SoundEffect.ENTITY_SKELETON_CONVERTED_TO_STRAY, 1048);
register(SoundEffect.ENTITY_ENDERDRAGON_GROWL, 3001);
register(SoundEvent.BLOCK_DISPENSER_DISPENSE, 1000);
register(SoundEvent.BLOCK_DISPENSER_FAIL, 1001);
register(SoundEvent.BLOCK_DISPENSER_LAUNCH, 1002);
register(SoundEvent.ENTITY_ENDEREYE_LAUNCH, 1003);
register(SoundEvent.ENTITY_FIREWORK_SHOOT, 1004);
register(SoundEvent.BLOCK_IRON_DOOR_OPEN, 1005);
register(SoundEvent.BLOCK_WOODEN_DOOR_OPEN, 1006);
register(SoundEvent.BLOCK_WOODEN_TRAPDOOR_OPEN, 1007);
register(SoundEvent.BLOCK_FENCE_GATE_OPEN, 1008);
register(SoundEvent.BLOCK_FIRE_EXTINGUISH, 1009);
register(SoundEvent.RECORD, 1010);
register(SoundEvent.BLOCK_IRON_DOOR_CLOSE, 1011);
register(SoundEvent.BLOCK_WOODEN_DOOR_CLOSE, 1012);
register(SoundEvent.BLOCK_WOODEN_TRAPDOOR_CLOSE, 1013);
register(SoundEvent.BLOCK_FENCE_GATE_CLOSE, 1014);
register(SoundEvent.ENTITY_GHAST_WARN, 1015);
register(SoundEvent.ENTITY_GHAST_SHOOT, 1016);
register(SoundEvent.ENTITY_ENDERDRAGON_SHOOT, 1017);
register(SoundEvent.ENTITY_BLAZE_SHOOT, 1018);
register(SoundEvent.ENTITY_ZOMBIE_ATTACK_DOOR_WOOD, 1019);
register(SoundEvent.ENTITY_ZOMBIE_ATTACK_DOOR_IRON, 1020);
register(SoundEvent.ENTITY_ZOMBIE_BREAK_DOOR_WOOD, 1021);
register(SoundEvent.ENTITY_WITHER_BREAK_BLOCK, 1022);
register(SoundEvent.ENTITY_WITHER_SPAWN, 1023);
register(SoundEvent.ENTITY_WITHER_SHOOT, 1024);
register(SoundEvent.ENTITY_BAT_TAKEOFF, 1025);
register(SoundEvent.ENTITY_ZOMBIE_INFECT, 1026);
register(SoundEvent.ENTITY_ZOMBIE_VILLAGER_CONVERTED, 1027);
register(SoundEvent.ENTITY_ENDERDRAGON_DEATH, 1028);
register(SoundEvent.BLOCK_ANVIL_DESTROY, 1029);
register(SoundEvent.BLOCK_ANVIL_USE, 1030);
register(SoundEvent.BLOCK_ANVIL_LAND, 1031);
register(SoundEvent.BLOCK_PORTAL_TRAVEL, 1032);
register(SoundEvent.BLOCK_CHORUS_FLOWER_GROW, 1033);
register(SoundEvent.BLOCK_CHORUS_FLOWER_DEATH, 1034);
register(SoundEvent.BLOCK_BREWING_STAND_BREW, 1035);
register(SoundEvent.BLOCK_IRON_TRAPDOOR_CLOSE, 1036);
register(SoundEvent.BLOCK_IRON_TRAPDOOR_OPEN, 1037);
register(SoundEvent.BLOCK_END_PORTAL_SPAWN, 1038);
register(SoundEvent.ENTITY_PHANTOM_BITE, 1039);
register(SoundEvent.ENTITY_ZOMBIE_CONVERTED_TO_DROWNED, 1040);
register(SoundEvent.ENTITY_HUSK_CONVERTED_TO_ZOMBIE, 1041);
register(SoundEvent.BLOCK_GRINDSTONE_USE, 1042);
register(SoundEvent.ITEM_BOOK_PAGE_TURN, 1043);
register(SoundEvent.BLOCK_SMITHING_TABLE_USE, 1044);
register(SoundEvent.POINTED_DRIPSTONE_LAND, 1045);
register(SoundEvent.DRIP_LAVA_INTO_CAULDRON, 1046);
register(SoundEvent.DRIP_WATER_INTO_CAULDRON, 1047);
register(SoundEvent.ENTITY_SKELETON_CONVERTED_TO_STRAY, 1048);
register(SoundEvent.ENTITY_ENDERDRAGON_GROWL, 3001);
register(ParticleEffect.COMPOSTER, 1500);
register(ParticleEffect.BLOCK_LAVA_EXTINGUISH, 1501);
register(ParticleEffect.BLOCK_REDSTONE_TORCH_BURNOUT, 1502);
register(ParticleEffect.BLOCK_END_PORTAL_FRAME_FILL, 1503);
register(ParticleEffect.DRIPSTONE_DRIP, 1504);
register(ParticleEffect.BONEMEAL_GROW_WITH_SOUND, 1505);
register(ParticleEffect.SMOKE, 2000);
register(ParticleEffect.BREAK_BLOCK, 2001);
register(ParticleEffect.BREAK_SPLASH_POTION, 2002);
register(ParticleEffect.BREAK_EYE_OF_ENDER, 2003);
register(ParticleEffect.MOB_SPAWN, 2004);
register(ParticleEffect.BONEMEAL_GROW, 2005);
register(ParticleEffect.ENDERDRAGON_FIREBALL_EXPLODE, 2006);
register(ParticleEffect.BREAK_SPLASH_POTION, 2007);
register(ParticleEffect.EXPLOSION, 2008);
register(ParticleEffect.EVAPORATE, 2009);
register(ParticleEffect.END_GATEWAY_SPAWN, 3000);
register(ParticleEffect.ELECTRIC_SPARK, 3002);
register(ParticleEffect.WAX_ON, 3003);
register(ParticleEffect.WAX_OFF, 3004);
register(ParticleEffect.SCRAPE, 3005);
register(ParticleEvent.COMPOSTER, 1500);
register(ParticleEvent.BLOCK_LAVA_EXTINGUISH, 1501);
register(ParticleEvent.BLOCK_REDSTONE_TORCH_BURNOUT, 1502);
register(ParticleEvent.BLOCK_END_PORTAL_FRAME_FILL, 1503);
register(ParticleEvent.DRIPSTONE_DRIP, 1504);
register(ParticleEvent.BONEMEAL_GROW_WITH_SOUND, 1505);
register(ParticleEvent.SMOKE, 2000);
register(ParticleEvent.BREAK_BLOCK, 2001);
register(ParticleEvent.BREAK_SPLASH_POTION, 2002);
register(ParticleEvent.BREAK_EYE_OF_ENDER, 2003);
register(ParticleEvent.MOB_SPAWN, 2004);
register(ParticleEvent.BONEMEAL_GROW, 2005);
register(ParticleEvent.ENDERDRAGON_FIREBALL_EXPLODE, 2006);
register(ParticleEvent.BREAK_SPLASH_POTION, 2007);
register(ParticleEvent.EXPLOSION, 2008);
register(ParticleEvent.EVAPORATE, 2009);
register(ParticleEvent.END_GATEWAY_SPAWN, 3000);
register(ParticleEvent.ELECTRIC_SPARK, 3002);
register(ParticleEvent.WAX_ON, 3003);
register(ParticleEvent.WAX_OFF, 3004);
register(ParticleEvent.SCRAPE, 3005);
register(SmokeEffectData.DOWN, 0);
register(SmokeEffectData.UP, 1);
register(SmokeEffectData.NORTH, 2);
register(SmokeEffectData.SOUTH, 3);
register(SmokeEffectData.WEST, 4);
register(SmokeEffectData.EAST, 5);
register(SmokeEventData.DOWN, 0);
register(SmokeEventData.UP, 1);
register(SmokeEventData.NORTH, 2);
register(SmokeEventData.SOUTH, 3);
register(SmokeEventData.WEST, 4);
register(SmokeEventData.EAST, 5);
register(ComposterEffectData.FILL, 0);
register(ComposterEffectData.FILL_SUCCESS, 1);
register(ComposterEventData.FILL, 0);
register(ComposterEventData.FILL_SUCCESS, 1);
register(DragonFireballEffectData.NO_SOUND, 0);
register(DragonFireballEffectData.HAS_SOUND, 1);
register(DragonFireballEventData.NO_SOUND, 0);
register(DragonFireballEventData.HAS_SOUND, 1);
register(NameTagVisibility.ALWAYS, "");
register(NameTagVisibility.ALWAYS, "always");

View file

@ -1,6 +1,6 @@
package com.github.steveice10.mc.protocol.data.game;
public enum ClientRequest {
public enum ClientCommand {
RESPAWN,
STATS;
}

View file

@ -1,134 +1,34 @@
package com.github.steveice10.mc.protocol.data.game.chunk;
import com.github.steveice10.mc.protocol.data.game.chunk.palette.GlobalPalette;
import com.github.steveice10.mc.protocol.data.game.chunk.palette.ListPalette;
import com.github.steveice10.mc.protocol.data.game.chunk.palette.MapPalette;
import com.github.steveice10.mc.protocol.data.game.chunk.palette.Palette;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
import lombok.Data;
import lombok.NonNull;
import lombok.Setter;
import java.io.IOException;
import java.util.Arrays;
@Data
@Setter(AccessLevel.NONE)
@AllArgsConstructor
public class Chunk {
private static final int CHUNK_SIZE = 4096;
private static final int MIN_PALETTE_BITS_PER_ENTRY = 4;
private static final int MAX_PALETTE_BITS_PER_ENTRY = 8;
private static final int GLOBAL_PALETTE_BITS_PER_ENTRY = 14;
private final int x;
private final int z;
private final @NonNull ChunkSection[] sections;
private final @NonNull CompoundTag[] blockEntities;
private final @NonNull CompoundTag heightMaps;
private final @NonNull int[] biomeData;
private static final int AIR = 0;
private int blockCount;
private @NonNull Palette palette;
private @NonNull BitStorage storage;
public Chunk() {
this(0, new ListPalette(MIN_PALETTE_BITS_PER_ENTRY), new BitStorage(MIN_PALETTE_BITS_PER_ENTRY, CHUNK_SIZE));
/**
* @deprecated Non-full chunks no longer exist since 1.17.
*/
@Deprecated
public Chunk(int x, int z, @NonNull ChunkSection[] sections, @NonNull CompoundTag[] blockEntities, @NonNull CompoundTag heightMaps) {
this(x, z, sections, blockEntities, heightMaps, new int[1024]);
}
public static Chunk read(NetInput in) throws IOException {
int blockCount = in.readShort();
int bitsPerEntry = in.readUnsignedByte();
Palette palette = readPalette(bitsPerEntry, in);
BitStorage storage = new BitStorage(bitsPerEntry, CHUNK_SIZE, in.readLongs(in.readVarInt()));
return new Chunk(blockCount, palette, storage);
}
public static void write(NetOutput out, Chunk chunk) throws IOException {
out.writeShort(chunk.blockCount);
out.writeByte(chunk.storage.getBitsPerEntry());
if (!(chunk.palette instanceof GlobalPalette)) {
int paletteLength = chunk.palette.size();
out.writeVarInt(paletteLength);
for (int i = 0; i < paletteLength; i++) {
out.writeVarInt(chunk.palette.idToState(i));
}
}
long[] data = chunk.storage.getData();
out.writeVarInt(data.length);
out.writeLongs(data);
}
public int get(int x, int y, int z) {
int id = this.storage.get(index(x, y, z));
return this.palette.idToState(id);
}
public void set(int x, int y, int z, @NonNull int state) {
int id = this.palette.stateToId(state);
if (id == -1) {
this.resizePalette();
id = this.palette.stateToId(state);
}
int index = index(x, y, z);
int curr = this.storage.get(index);
if (state != AIR && curr == AIR) {
this.blockCount++;
} else if (state == AIR && curr != AIR) {
this.blockCount--;
}
this.storage.set(index, id);
}
public boolean isEmpty() {
return this.blockCount == 0;
}
private int sanitizeBitsPerEntry(int bitsPerEntry) {
if (bitsPerEntry <= MAX_PALETTE_BITS_PER_ENTRY) {
return Math.max(MIN_PALETTE_BITS_PER_ENTRY, bitsPerEntry);
} else {
return GLOBAL_PALETTE_BITS_PER_ENTRY;
}
}
private void resizePalette() {
Palette oldPalette = this.palette;
BitStorage oldData = this.storage;
int bitsPerEntry = sanitizeBitsPerEntry(oldData.getBitsPerEntry() + 1);
this.palette = createPalette(bitsPerEntry);
this.storage = new BitStorage(bitsPerEntry, CHUNK_SIZE);
for (int i = 0; i < CHUNK_SIZE; i++) {
this.storage.set(i, this.palette.stateToId(oldPalette.idToState(oldData.get(i))));
}
}
private static Palette createPalette(int bitsPerEntry) {
if (bitsPerEntry <= MIN_PALETTE_BITS_PER_ENTRY) {
return new ListPalette(bitsPerEntry);
} else if (bitsPerEntry <= MAX_PALETTE_BITS_PER_ENTRY) {
return new MapPalette(bitsPerEntry);
} else {
return new GlobalPalette();
}
}
private static Palette readPalette(int bitsPerEntry, NetInput in) throws IOException {
if (bitsPerEntry <= MIN_PALETTE_BITS_PER_ENTRY) {
return new ListPalette(bitsPerEntry, in);
} else if (bitsPerEntry <= MAX_PALETTE_BITS_PER_ENTRY) {
return new MapPalette(bitsPerEntry, in);
} else {
return new GlobalPalette();
}
}
private static int index(int x, int y, int z) {
return y << 8 | z << 4 | x;
public Chunk(int x, int z, @NonNull ChunkSection[] sections, @NonNull CompoundTag[] blockEntities, @NonNull CompoundTag heightMaps, @NonNull int[] biomeData) {
this.x = x;
this.z = z;
this.sections = Arrays.copyOf(sections, sections.length);
this.biomeData = biomeData != null ? Arrays.copyOf(biomeData, biomeData.length) : null;
this.blockEntities = blockEntities != null ? blockEntities : new CompoundTag[0];
this.heightMaps = heightMaps;
}
}

View file

@ -0,0 +1,134 @@
package com.github.steveice10.mc.protocol.data.game.chunk;
import com.github.steveice10.mc.protocol.data.game.chunk.palette.GlobalPalette;
import com.github.steveice10.mc.protocol.data.game.chunk.palette.ListPalette;
import com.github.steveice10.mc.protocol.data.game.chunk.palette.MapPalette;
import com.github.steveice10.mc.protocol.data.game.chunk.palette.Palette;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NonNull;
import lombok.Setter;
import java.io.IOException;
@Data
@Setter(AccessLevel.NONE)
@AllArgsConstructor
public class ChunkSection {
private static final int CHUNK_SIZE = 4096;
private static final int MIN_PALETTE_BITS_PER_ENTRY = 4;
private static final int MAX_PALETTE_BITS_PER_ENTRY = 8;
private static final int GLOBAL_PALETTE_BITS_PER_ENTRY = 14;
private static final int AIR = 0;
private int blockCount;
private @NonNull Palette palette;
private @NonNull BitStorage storage;
public ChunkSection() {
this(0, new ListPalette(MIN_PALETTE_BITS_PER_ENTRY), new BitStorage(MIN_PALETTE_BITS_PER_ENTRY, CHUNK_SIZE));
}
public static ChunkSection read(NetInput in) throws IOException {
int blockCount = in.readShort();
int bitsPerEntry = in.readUnsignedByte();
Palette palette = readPalette(bitsPerEntry, in);
BitStorage storage = new BitStorage(bitsPerEntry, CHUNK_SIZE, in.readLongs(in.readVarInt()));
return new ChunkSection(blockCount, palette, storage);
}
public static void write(NetOutput out, ChunkSection section) throws IOException {
out.writeShort(section.blockCount);
out.writeByte(section.storage.getBitsPerEntry());
if (!(section.palette instanceof GlobalPalette)) {
int paletteLength = section.palette.size();
out.writeVarInt(paletteLength);
for (int i = 0; i < paletteLength; i++) {
out.writeVarInt(section.palette.idToState(i));
}
}
long[] data = section.storage.getData();
out.writeVarInt(data.length);
out.writeLongs(data);
}
public int get(int x, int y, int z) {
int id = this.storage.get(index(x, y, z));
return this.palette.idToState(id);
}
public void set(int x, int y, int z, @NonNull int state) {
int id = this.palette.stateToId(state);
if (id == -1) {
this.resizePalette();
id = this.palette.stateToId(state);
}
int index = index(x, y, z);
int curr = this.storage.get(index);
if (state != AIR && curr == AIR) {
this.blockCount++;
} else if (state == AIR && curr != AIR) {
this.blockCount--;
}
this.storage.set(index, id);
}
public boolean isEmpty() {
return this.blockCount == 0;
}
private int sanitizeBitsPerEntry(int bitsPerEntry) {
if (bitsPerEntry <= MAX_PALETTE_BITS_PER_ENTRY) {
return Math.max(MIN_PALETTE_BITS_PER_ENTRY, bitsPerEntry);
} else {
return GLOBAL_PALETTE_BITS_PER_ENTRY;
}
}
private void resizePalette() {
Palette oldPalette = this.palette;
BitStorage oldData = this.storage;
int bitsPerEntry = sanitizeBitsPerEntry(oldData.getBitsPerEntry() + 1);
this.palette = createPalette(bitsPerEntry);
this.storage = new BitStorage(bitsPerEntry, CHUNK_SIZE);
for (int i = 0; i < CHUNK_SIZE; i++) {
this.storage.set(i, this.palette.stateToId(oldPalette.idToState(oldData.get(i))));
}
}
private static Palette createPalette(int bitsPerEntry) {
if (bitsPerEntry <= MIN_PALETTE_BITS_PER_ENTRY) {
return new ListPalette(bitsPerEntry);
} else if (bitsPerEntry <= MAX_PALETTE_BITS_PER_ENTRY) {
return new MapPalette(bitsPerEntry);
} else {
return new GlobalPalette();
}
}
private static Palette readPalette(int bitsPerEntry, NetInput in) throws IOException {
if (bitsPerEntry <= MIN_PALETTE_BITS_PER_ENTRY) {
return new ListPalette(bitsPerEntry, in);
} else if (bitsPerEntry <= MAX_PALETTE_BITS_PER_ENTRY) {
return new MapPalette(bitsPerEntry, in);
} else {
return new GlobalPalette();
}
}
private static int index(int x, int y, int z) {
return y << 8 | z << 4 | x;
}
}

View file

@ -1,34 +0,0 @@
package com.github.steveice10.mc.protocol.data.game.chunk;
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
import lombok.Data;
import lombok.NonNull;
import java.util.Arrays;
@Data
public class Column {
private final int x;
private final int z;
private final @NonNull Chunk[] chunks;
private final @NonNull CompoundTag[] tileEntities;
private final @NonNull CompoundTag heightMaps;
private final @NonNull int[] biomeData;
/**
* @deprecated Non-full chunks no longer exist since 1.17.
*/
@Deprecated
public Column(int x, int z, @NonNull Chunk[] chunks, @NonNull CompoundTag[] tileEntities, @NonNull CompoundTag heightMaps) {
this(x, z, chunks, tileEntities, heightMaps, new int[1024]);
}
public Column(int x, int z, @NonNull Chunk[] chunks, @NonNull CompoundTag[] tileEntities, @NonNull CompoundTag heightMaps, @NonNull int[] biomeData) {
this.x = x;
this.z = z;
this.chunks = Arrays.copyOf(chunks, chunks.length);
this.biomeData = biomeData != null ? Arrays.copyOf(biomeData, biomeData.length) : null;
this.tileEntities = tileEntities != null ? tileEntities : new CompoundTag[0];
this.heightMaps = heightMaps;
}
}

View file

@ -1,6 +1,6 @@
package com.github.steveice10.mc.protocol.data.game.entity;
public enum EntityStatus {
public enum EntityEvent {
TIPPED_ARROW_EMIT_PARTICLES,
RABBIT_JUMP_OR_MINECART_SPAWNER_DELAY_RESET,
LIVING_HURT,

View file

@ -1,8 +1,8 @@
package com.github.steveice10.mc.protocol.data.game.entity.player;
import com.github.steveice10.mc.protocol.data.game.level.notify.ClientNotificationValue;
import com.github.steveice10.mc.protocol.data.game.level.notify.GameEventValue;
public enum GameMode implements ClientNotificationValue {
public enum GameMode implements GameEventValue {
SURVIVAL,
CREATIVE,
ADVENTURE,

View file

@ -1,4 +1,4 @@
package com.github.steveice10.mc.protocol.data.game.window;
package com.github.steveice10.mc.protocol.data.game.inventory;
public enum AdvancementTabAction {
OPENED_TAB,

View file

@ -0,0 +1,6 @@
package com.github.steveice10.mc.protocol.data.game.inventory;
public enum ClickItemAction implements ContainerAction {
LEFT_CLICK,
RIGHT_CLICK;
}

View file

@ -0,0 +1,4 @@
package com.github.steveice10.mc.protocol.data.game.inventory;
public interface ContainerAction {
}

View file

@ -1,6 +1,6 @@
package com.github.steveice10.mc.protocol.data.game.window;
package com.github.steveice10.mc.protocol.data.game.inventory;
public enum WindowAction {
public enum ContainerActionType {
CLICK_ITEM,
SHIFT_CLICK_ITEM,
MOVE_TO_HOTBAR_SLOT,

View file

@ -1,6 +1,6 @@
package com.github.steveice10.mc.protocol.data.game.window;
package com.github.steveice10.mc.protocol.data.game.inventory;
public enum WindowType {
public enum ContainerType {
GENERIC_9X1,
GENERIC_9X2,
GENERIC_9X3,

View file

@ -1,4 +1,4 @@
package com.github.steveice10.mc.protocol.data.game.window;
package com.github.steveice10.mc.protocol.data.game.inventory;
public enum CraftingBookStateType {
CRAFTING,

View file

@ -0,0 +1,5 @@
package com.github.steveice10.mc.protocol.data.game.inventory;
public enum CreativeGrabAction implements ContainerAction {
GRAB;
}

View file

@ -1,6 +1,6 @@
package com.github.steveice10.mc.protocol.data.game.window;
package com.github.steveice10.mc.protocol.data.game.inventory;
public enum DropItemParam implements WindowActionParam {
public enum DropItemAction implements ContainerAction {
DROP_FROM_SELECTED,
DROP_SELECTED_STACK,
LEFT_CLICK_OUTSIDE_NOT_HOLDING,

View file

@ -0,0 +1,5 @@
package com.github.steveice10.mc.protocol.data.game.inventory;
public enum FillStackAction implements ContainerAction {
FILL;
}

View file

@ -0,0 +1,13 @@
package com.github.steveice10.mc.protocol.data.game.inventory;
public enum MoveToHotbarAction implements ContainerAction {
SLOT_1,
SLOT_2,
SLOT_3,
SLOT_4,
SLOT_5,
SLOT_6,
SLOT_7,
SLOT_8,
SLOT_9;
}

View file

@ -0,0 +1,6 @@
package com.github.steveice10.mc.protocol.data.game.inventory;
public enum ShiftClickItemAction implements ContainerAction {
LEFT_CLICK,
RIGHT_CLICK;
}

View file

@ -1,6 +1,6 @@
package com.github.steveice10.mc.protocol.data.game.window;
package com.github.steveice10.mc.protocol.data.game.inventory;
public enum SpreadItemParam implements WindowActionParam {
public enum SpreadItemAction implements ContainerAction {
LEFT_MOUSE_BEGIN_DRAG,
LEFT_MOUSE_ADD_SLOT,
LEFT_MOUSE_END_DRAG,

View file

@ -1,4 +1,4 @@
package com.github.steveice10.mc.protocol.data.game.window;
package com.github.steveice10.mc.protocol.data.game.inventory;
public enum UpdateStructureBlockAction {
UPDATE_DATA,

View file

@ -1,4 +1,4 @@
package com.github.steveice10.mc.protocol.data.game.window;
package com.github.steveice10.mc.protocol.data.game.inventory;
public enum UpdateStructureBlockMode {
SAVE,

View file

@ -1,4 +1,4 @@
package com.github.steveice10.mc.protocol.data.game.window;
package com.github.steveice10.mc.protocol.data.game.inventory;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
import lombok.AllArgsConstructor;

View file

@ -1,7 +1,7 @@
package com.github.steveice10.mc.protocol.data.game.window.property;
package com.github.steveice10.mc.protocol.data.game.inventory.property;
/**
* Window properties of an anvil.
* Container properties of an anvil.
*/
public enum AnvilProperty {
/**

View file

@ -0,0 +1,12 @@
package com.github.steveice10.mc.protocol.data.game.inventory.property;
/**
* Container properties of a brewing stand.
*/
public enum BrewingStandProperty implements ContainerProperty {
/**
* Time remaining for potions to finish brewing.
* Usually a value between 0 (done) and 400 (just started).
*/
BREW_TIME,
}

View file

@ -0,0 +1,4 @@
package com.github.steveice10.mc.protocol.data.game.inventory.property;
public interface ContainerProperty {
}

View file

@ -1,9 +1,9 @@
package com.github.steveice10.mc.protocol.data.game.window.property;
package com.github.steveice10.mc.protocol.data.game.inventory.property;
/**
* Window properties of an enchantment table.
* Container properties of an enchantment table.
*/
public enum EnchantmentTableProperty implements WindowProperty {
public enum EnchantmentTableProperty implements ContainerProperty {
/**
* Level of the enchantment in slot 1.
*/

View file

@ -1,7 +1,7 @@
package com.github.steveice10.mc.protocol.data.game.window.property;
package com.github.steveice10.mc.protocol.data.game.inventory.property;
/**
* Window properties of a furnace.
* Container properties of a furnace.
*/
public enum FurnaceProperty {
/**

View file

@ -7,7 +7,7 @@ import lombok.NonNull;
@Data
@AllArgsConstructor
public class BlockChangeRecord {
public class BlockChangeEntry {
private final @NonNull Position position;
private final @NonNull int block;
}

View file

@ -1,6 +1,6 @@
package com.github.steveice10.mc.protocol.data.game.level.block;
public enum UpdatedTileType {
public enum BlockEntityType {
MOB_SPAWNER,
COMMAND_BLOCK,
BEACON,

View file

@ -1,10 +0,0 @@
package com.github.steveice10.mc.protocol.data.game.level.effect;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class BonemealGrowEffectData implements WorldEffectData {
private final int particleCount;
}

View file

@ -1,10 +0,0 @@
package com.github.steveice10.mc.protocol.data.game.level.effect;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class BreakPotionEffectData implements WorldEffectData {
private final int potionId;
}

View file

@ -1,6 +0,0 @@
package com.github.steveice10.mc.protocol.data.game.level.effect;
public enum ComposterEffectData implements WorldEffectData {
FILL,
FILL_SUCCESS;
}

View file

@ -1,6 +0,0 @@
package com.github.steveice10.mc.protocol.data.game.level.effect;
public enum DragonFireballEffectData implements WorldEffectData {
NO_SOUND,
HAS_SOUND;
}

View file

@ -1,10 +0,0 @@
package com.github.steveice10.mc.protocol.data.game.level.effect;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class RecordEffectData implements WorldEffectData {
private final int recordId;
}

View file

@ -1,10 +0,0 @@
package com.github.steveice10.mc.protocol.data.game.level.effect;
public enum SmokeEffectData implements WorldEffectData {
DOWN,
UP,
NORTH,
SOUTH,
WEST,
EAST;
}

View file

@ -1,4 +0,0 @@
package com.github.steveice10.mc.protocol.data.game.level.effect;
public interface WorldEffect {
}

View file

@ -1,4 +0,0 @@
package com.github.steveice10.mc.protocol.data.game.level.effect;
public interface WorldEffectData {
}

View file

@ -0,0 +1,10 @@
package com.github.steveice10.mc.protocol.data.game.level.event;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class BonemealGrowEventData implements LevelEventData {
private final int particleCount;
}

View file

@ -1,4 +1,4 @@
package com.github.steveice10.mc.protocol.data.game.level.effect;
package com.github.steveice10.mc.protocol.data.game.level.event;
import lombok.AllArgsConstructor;
import lombok.Data;
@ -6,6 +6,6 @@ import lombok.NonNull;
@Data
@AllArgsConstructor
public class BreakBlockEffectData implements WorldEffectData {
public class BreakBlockEventData implements LevelEventData {
private final @NonNull int blockState;
}

View file

@ -0,0 +1,10 @@
package com.github.steveice10.mc.protocol.data.game.level.event;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class BreakPotionEventData implements LevelEventData {
private final int potionId;
}

View file

@ -0,0 +1,6 @@
package com.github.steveice10.mc.protocol.data.game.level.event;
public enum ComposterEventData implements LevelEventData {
FILL,
FILL_SUCCESS;
}

View file

@ -0,0 +1,6 @@
package com.github.steveice10.mc.protocol.data.game.level.event;
public enum DragonFireballEventData implements LevelEventData {
NO_SOUND,
HAS_SOUND;
}

View file

@ -0,0 +1,4 @@
package com.github.steveice10.mc.protocol.data.game.level.event;
public interface LevelEvent {
}

View file

@ -0,0 +1,4 @@
package com.github.steveice10.mc.protocol.data.game.level.event;
public interface LevelEventData {
}

View file

@ -1,6 +1,6 @@
package com.github.steveice10.mc.protocol.data.game.level.effect;
package com.github.steveice10.mc.protocol.data.game.level.event;
public enum ParticleEffect implements WorldEffect {
public enum ParticleEvent implements LevelEvent {
COMPOSTER,
BLOCK_LAVA_EXTINGUISH,
BLOCK_REDSTONE_TORCH_BURNOUT,

View file

@ -0,0 +1,10 @@
package com.github.steveice10.mc.protocol.data.game.level.event;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class RecordEventData implements LevelEventData {
private final int recordId;
}

View file

@ -0,0 +1,10 @@
package com.github.steveice10.mc.protocol.data.game.level.event;
public enum SmokeEventData implements LevelEventData {
DOWN,
UP,
NORTH,
SOUTH,
WEST,
EAST;
}

View file

@ -1,6 +1,6 @@
package com.github.steveice10.mc.protocol.data.game.level.effect;
package com.github.steveice10.mc.protocol.data.game.level.event;
public enum SoundEffect implements WorldEffect {
public enum SoundEvent implements LevelEvent {
BLOCK_DISPENSER_DISPENSE,
BLOCK_DISPENSER_FAIL,
BLOCK_DISPENSER_LAUNCH,

View file

@ -1,6 +1,6 @@
package com.github.steveice10.mc.protocol.data.game.level.notify;
public enum DemoMessageValue implements ClientNotificationValue {
public enum DemoMessageValue implements GameEventValue {
WELCOME,
MOVEMENT_CONTROLS,
JUMP_CONTROL,

View file

@ -1,6 +1,6 @@
package com.github.steveice10.mc.protocol.data.game.level.notify;
public enum EnterCreditsValue implements ClientNotificationValue {
public enum EnterCreditsValue implements GameEventValue {
SEEN_BEFORE,
FIRST_TIME;
}

View file

@ -1,6 +1,6 @@
package com.github.steveice10.mc.protocol.data.game.level.notify;
public enum ClientNotification {
public enum GameEvent {
INVALID_BED,
START_RAIN,
STOP_RAIN,

View file

@ -1,4 +1,4 @@
package com.github.steveice10.mc.protocol.data.game.level.notify;
public interface ClientNotificationValue {
public interface GameEventValue {
}

View file

@ -3,7 +3,7 @@ package com.github.steveice10.mc.protocol.data.game.level.notify;
import lombok.Data;
@Data
public class RainStrengthValue implements ClientNotificationValue {
public class RainStrengthValue implements GameEventValue {
private final float strength;
public RainStrengthValue(float strength) {

View file

@ -1,6 +1,6 @@
package com.github.steveice10.mc.protocol.data.game.level.notify;
public enum RespawnScreenValue implements ClientNotificationValue {
public enum RespawnScreenValue implements GameEventValue {
ENABLE_RESPAWN_SCREEN,
IMMEDIATE_RESPAWN;

View file

@ -3,7 +3,7 @@ package com.github.steveice10.mc.protocol.data.game.level.notify;
import lombok.Data;
@Data
public class ThunderStrengthValue implements ClientNotificationValue {
public class ThunderStrengthValue implements GameEventValue {
private final float strength;
public ThunderStrengthValue(float strength) {

View file

@ -1,6 +0,0 @@
package com.github.steveice10.mc.protocol.data.game.window;
public enum ClickItemParam implements WindowActionParam {
LEFT_CLICK,
RIGHT_CLICK;
}

View file

@ -1,5 +0,0 @@
package com.github.steveice10.mc.protocol.data.game.window;
public enum CreativeGrabParam implements WindowActionParam {
GRAB;
}

View file

@ -1,5 +0,0 @@
package com.github.steveice10.mc.protocol.data.game.window;
public enum FillStackParam implements WindowActionParam {
FILL;
}

View file

@ -1,13 +0,0 @@
package com.github.steveice10.mc.protocol.data.game.window;
public enum MoveToHotbarParam implements WindowActionParam {
SLOT_1,
SLOT_2,
SLOT_3,
SLOT_4,
SLOT_5,
SLOT_6,
SLOT_7,
SLOT_8,
SLOT_9;
}

View file

@ -1,6 +0,0 @@
package com.github.steveice10.mc.protocol.data.game.window;
public enum ShiftClickItemParam implements WindowActionParam {
LEFT_CLICK,
RIGHT_CLICK;
}

View file

@ -1,4 +0,0 @@
package com.github.steveice10.mc.protocol.data.game.window;
public interface WindowActionParam {
}

View file

@ -1,12 +0,0 @@
package com.github.steveice10.mc.protocol.data.game.window.property;
/**
* Window properties of a brewing stand.
*/
public enum BrewingStandProperty implements WindowProperty {
/**
* Time remaining for potions to finish brewing.
* Usually a value between 0 (done) and 400 (just started).
*/
BREW_TIME,
}

View file

@ -1,4 +0,0 @@
package com.github.steveice10.mc.protocol.data.game.window.property;
public interface WindowProperty {
}

View file

@ -1,7 +1,7 @@
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.entity;
import com.github.steveice10.mc.protocol.data.MagicValues;
import com.github.steveice10.mc.protocol.data.game.entity.EntityStatus;
import com.github.steveice10.mc.protocol.data.game.entity.EntityEvent;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;
@ -17,11 +17,11 @@ import java.io.IOException;
@AllArgsConstructor
public class ClientboundEntityEventPacket implements Packet {
private final int entityId;
private final @NonNull EntityStatus status;
private final @NonNull EntityEvent status;
public ClientboundEntityEventPacket(NetInput in) throws IOException {
this.entityId = in.readInt();
this.status = MagicValues.key(EntityStatus.class, in.readByte());
this.status = MagicValues.key(EntityEvent.class, in.readByte());
}
@Override

View file

@ -1,13 +1,10 @@
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.With;
import java.io.IOException;
@ -16,14 +13,14 @@ import java.io.IOException;
@With
@AllArgsConstructor
public class ClientboundContainerClosePacket implements Packet {
private final int windowId;
private final int containerId;
public ClientboundContainerClosePacket(NetInput in) throws IOException {
this.windowId = in.readUnsignedByte();
this.containerId = in.readUnsignedByte();
}
@Override
public void write(NetOutput out) throws IOException {
out.writeByte(this.windowId);
out.writeByte(this.containerId);
}
}

View file

@ -1,4 +1,4 @@
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
import com.github.steveice10.packetlib.io.NetInput;
@ -15,13 +15,13 @@ import java.io.IOException;
@With
@AllArgsConstructor
public class ClientboundContainerSetContentPacket implements Packet {
private final int windowId;
private final int containerId;
private final int stateId;
private final @NonNull ItemStack[] items;
private final ItemStack carriedItem;
public ClientboundContainerSetContentPacket(NetInput in) throws IOException {
this.windowId = in.readUnsignedByte();
this.containerId = in.readUnsignedByte();
this.stateId = in.readVarInt();
this.items = new ItemStack[in.readVarInt()];
for (int index = 0; index < this.items.length; index++) {
@ -32,7 +32,7 @@ public class ClientboundContainerSetContentPacket implements Packet {
@Override
public void write(NetOutput out) throws IOException {
out.writeByte(this.windowId);
out.writeByte(this.containerId);
out.writeVarInt(this.stateId);
out.writeVarInt(this.items.length);
for (ItemStack item : this.items) {

View file

@ -1,15 +1,12 @@
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory;
import com.github.steveice10.mc.protocol.data.MagicValues;
import com.github.steveice10.mc.protocol.data.game.window.property.WindowProperty;
import com.github.steveice10.mc.protocol.data.game.inventory.property.ContainerProperty;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.With;
import java.io.IOException;
@ -18,27 +15,27 @@ import java.io.IOException;
@With
@AllArgsConstructor
public class ClientboundContainerSetDataPacket implements Packet {
private final int windowId;
private final int containerId;
private final int rawProperty;
private final int value;
public ClientboundContainerSetDataPacket(int windowId, WindowProperty rawProperty, int value) {
this(windowId, MagicValues.value(Integer.class, rawProperty), value);
public ClientboundContainerSetDataPacket(int containerId, ContainerProperty rawProperty, int value) {
this(containerId, MagicValues.value(Integer.class, rawProperty), value);
}
public <T extends WindowProperty> T getProperty(Class<T> type) {
public <T extends ContainerProperty> T getProperty(Class<T> type) {
return MagicValues.key(type, this.value);
}
public ClientboundContainerSetDataPacket(NetInput in) throws IOException {
this.windowId = in.readUnsignedByte();
this.containerId = in.readUnsignedByte();
this.rawProperty = in.readShort();
this.value = in.readShort();
}
@Override
public void write(NetOutput out) throws IOException {
out.writeByte(this.windowId);
out.writeByte(this.containerId);
out.writeShort(this.rawProperty);
out.writeShort(this.value);
}

View file

@ -1,14 +1,11 @@
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.With;
import java.io.IOException;
@ -17,13 +14,13 @@ import java.io.IOException;
@With
@AllArgsConstructor
public class ClientboundContainerSetSlotPacket implements Packet {
private final int windowId;
private final int containerId;
private final int stateId;
private final int slot;
private final ItemStack item;
public ClientboundContainerSetSlotPacket(NetInput in) throws IOException {
this.windowId = in.readUnsignedByte();
this.containerId = in.readUnsignedByte();
this.stateId = in.readVarInt();
this.slot = in.readShort();
this.item = ItemStack.read(in);
@ -31,7 +28,7 @@ public class ClientboundContainerSetSlotPacket implements Packet {
@Override
public void write(NetOutput out) throws IOException {
out.writeByte(this.windowId);
out.writeByte(this.containerId);
out.writeVarInt(this.stateId);
out.writeShort(this.slot);
ItemStack.write(out, this.item);

View file

@ -1,13 +1,10 @@
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.With;
import java.io.IOException;
@ -16,19 +13,19 @@ import java.io.IOException;
@With
@AllArgsConstructor
public class ClientboundHorseScreenOpenPacket implements Packet {
private final int windowId;
private final int containerId;
private final int numberOfSlots;
private final int entityId;
public ClientboundHorseScreenOpenPacket(NetInput in) throws IOException {
this.windowId = in.readByte();
this.containerId = in.readByte();
this.numberOfSlots = in.readVarInt();
this.entityId = in.readInt();
}
@Override
public void write(NetOutput out) throws IOException {
out.writeByte(this.windowId);
out.writeByte(this.containerId);
out.writeVarInt(this.numberOfSlots);
out.writeInt(this.entityId);
}

View file

@ -1,7 +1,7 @@
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
import com.github.steveice10.mc.protocol.data.game.window.VillagerTrade;
import com.github.steveice10.mc.protocol.data.game.inventory.VillagerTrade;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;
@ -16,7 +16,7 @@ import java.io.IOException;
@With
@AllArgsConstructor
public class ClientboundMerchantOffersPacket implements Packet {
private final int windowId;
private final int containerId;
private final @NonNull VillagerTrade[] trades;
private final int villagerLevel;
private final int experience;
@ -24,7 +24,7 @@ public class ClientboundMerchantOffersPacket implements Packet {
private final boolean canRestock;
public ClientboundMerchantOffersPacket(NetInput in) throws IOException {
this.windowId = in.readVarInt();
this.containerId = in.readVarInt();
byte size = in.readByte();
this.trades = new VillagerTrade[size];
@ -56,7 +56,7 @@ public class ClientboundMerchantOffersPacket implements Packet {
@Override
public void write(NetOutput out) throws IOException {
out.writeVarInt(this.windowId);
out.writeVarInt(this.containerId);
out.writeByte(this.trades.length);
for (int i = 0; i < this.trades.length; i++) {

View file

@ -1,4 +1,4 @@
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory;
import com.github.steveice10.mc.protocol.data.MagicValues;
import com.github.steveice10.mc.protocol.data.game.entity.player.Hand;

View file

@ -1,7 +1,7 @@
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory;
import com.github.steveice10.mc.protocol.data.MagicValues;
import com.github.steveice10.mc.protocol.data.game.window.WindowType;
import com.github.steveice10.mc.protocol.data.game.inventory.ContainerType;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;
@ -16,19 +16,19 @@ import java.io.IOException;
@With
@AllArgsConstructor
public class ClientboundOpenScreenPacket implements Packet {
private final int windowId;
private final @NonNull WindowType type;
private final int containerId;
private final @NonNull ContainerType type;
private final @NonNull String name;
public ClientboundOpenScreenPacket(NetInput in) throws IOException {
this.windowId = in.readVarInt();
this.type = MagicValues.key(WindowType.class, in.readVarInt());
this.containerId = in.readVarInt();
this.type = MagicValues.key(ContainerType.class, in.readVarInt());
this.name = in.readString();
}
@Override
public void write(NetOutput out) throws IOException {
out.writeVarInt(this.windowId);
out.writeVarInt(this.containerId);
out.writeVarInt(MagicValues.value(Integer.class, this.type));
out.writeString(this.name);
}

View file

@ -1,4 +1,4 @@
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.inventory;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
@ -14,17 +14,17 @@ import java.io.IOException;
@With
@AllArgsConstructor
public class ClientboundPlaceGhostRecipePacket implements Packet {
private final int windowId;
private final int containerId;
private final @NonNull String recipeId;
public ClientboundPlaceGhostRecipePacket(NetInput in) throws IOException {
this.windowId = in.readByte();
this.containerId = in.readByte();
this.recipeId = in.readString();
}
@Override
public void write(NetOutput out) throws IOException {
out.writeByte(this.windowId);
out.writeByte(this.containerId);
out.writeString(this.recipeId);
}
}

View file

@ -3,7 +3,7 @@ package com.github.steveice10.mc.protocol.packet.ingame.clientbound.level;
import com.github.steveice10.mc.protocol.data.MagicValues;
import com.github.steveice10.mc.protocol.data.game.NBT;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.Position;
import com.github.steveice10.mc.protocol.data.game.level.block.UpdatedTileType;
import com.github.steveice10.mc.protocol.data.game.level.block.BlockEntityType;
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
@ -20,12 +20,12 @@ import java.io.IOException;
@AllArgsConstructor
public class ClientboundBlockEntityDataPacket implements Packet {
private final @NonNull Position position;
private final @NonNull UpdatedTileType type;
private final @NonNull BlockEntityType type;
private final @NonNull CompoundTag nbt;
public ClientboundBlockEntityDataPacket(NetInput in) throws IOException {
this.position = Position.read(in);
this.type = MagicValues.key(UpdatedTileType.class, in.readUnsignedByte());
this.type = MagicValues.key(BlockEntityType.class, in.readUnsignedByte());
this.nbt = NBT.read(in);
}

View file

@ -1,7 +1,7 @@
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.level;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.Position;
import com.github.steveice10.mc.protocol.data.game.level.block.BlockChangeRecord;
import com.github.steveice10.mc.protocol.data.game.level.block.BlockChangeEntry;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;
@ -16,10 +16,10 @@ import java.io.IOException;
@With
@AllArgsConstructor
public class ClientboundBlockUpdatePacket implements Packet {
private final @NonNull BlockChangeRecord record;
private final @NonNull BlockChangeEntry record;
public ClientboundBlockUpdatePacket(NetInput in) throws IOException {
this.record = new BlockChangeRecord(Position.read(in), in.readVarInt());
this.record = new BlockChangeEntry(Position.read(in), in.readVarInt());
}
@Override

View file

@ -2,8 +2,8 @@ package com.github.steveice10.mc.protocol.packet.ingame.clientbound.level;
import com.github.steveice10.mc.protocol.data.MagicValues;
import com.github.steveice10.mc.protocol.data.game.entity.player.GameMode;
import com.github.steveice10.mc.protocol.data.game.level.notify.ClientNotification;
import com.github.steveice10.mc.protocol.data.game.level.notify.ClientNotificationValue;
import com.github.steveice10.mc.protocol.data.game.level.notify.GameEvent;
import com.github.steveice10.mc.protocol.data.game.level.notify.GameEventValue;
import com.github.steveice10.mc.protocol.data.game.level.notify.DemoMessageValue;
import com.github.steveice10.mc.protocol.data.game.level.notify.EnterCreditsValue;
import com.github.steveice10.mc.protocol.data.game.level.notify.RainStrengthValue;
@ -23,23 +23,23 @@ import java.io.IOException;
@With
@AllArgsConstructor
public class ClientboundGameEventPacket implements Packet {
private final @NonNull ClientNotification notification;
private final ClientNotificationValue value;
private final @NonNull GameEvent notification;
private final GameEventValue value;
public ClientboundGameEventPacket(NetInput in) throws IOException {
this.notification = MagicValues.key(ClientNotification.class, in.readUnsignedByte());
this.notification = MagicValues.key(GameEvent.class, in.readUnsignedByte());
float value = in.readFloat();
if (this.notification == ClientNotification.CHANGE_GAMEMODE) {
if (this.notification == GameEvent.CHANGE_GAMEMODE) {
this.value = MagicValues.key(GameMode.class, ((int) value == -1) ? 255 : (int) value); // https://bugs.mojang.com/browse/MC-189885 - since we read as a float this bug doesn't apply here
} else if (this.notification == ClientNotification.DEMO_MESSAGE) {
} else if (this.notification == GameEvent.DEMO_MESSAGE) {
this.value = MagicValues.key(DemoMessageValue.class, (int) value);
} else if (this.notification == ClientNotification.ENTER_CREDITS) {
} else if (this.notification == GameEvent.ENTER_CREDITS) {
this.value = MagicValues.key(EnterCreditsValue.class, (int) value);
} else if (this.notification == ClientNotification.ENABLE_RESPAWN_SCREEN) {
} else if (this.notification == GameEvent.ENABLE_RESPAWN_SCREEN) {
this.value = MagicValues.key(RespawnScreenValue.class, (int) value);
} else if (this.notification == ClientNotification.RAIN_STRENGTH) {
} else if (this.notification == GameEvent.RAIN_STRENGTH) {
this.value = new RainStrengthValue(value);
} else if (this.notification == ClientNotification.THUNDER_STRENGTH) {
} else if (this.notification == GameEvent.THUNDER_STRENGTH) {
this.value = new ThunderStrengthValue(value);
} else {
this.value = null;

View file

@ -1,8 +1,8 @@
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.level;
import com.github.steveice10.mc.protocol.data.game.NBT;
import com.github.steveice10.mc.protocol.data.game.chunk.ChunkSection;
import com.github.steveice10.mc.protocol.data.game.chunk.Chunk;
import com.github.steveice10.mc.protocol.data.game.chunk.Column;
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
@ -23,7 +23,7 @@ import java.util.BitSet;
@With
@AllArgsConstructor
public class ClientboundLevelChunkPacket implements Packet {
private final @NonNull Column column;
private final @NonNull Chunk chunk;
public ClientboundLevelChunkPacket(NetInput in) throws IOException {
int x = in.readInt();
@ -37,19 +37,19 @@ public class ClientboundLevelChunkPacket implements Packet {
byte[] data = in.readBytes(in.readVarInt());
NetInput dataIn = new StreamNetInput(new ByteArrayInputStream(data));
Chunk[] chunks = new Chunk[chunkMask.size()];
for (int index = 0; index < chunks.length; index++) {
ChunkSection[] sections = new ChunkSection[chunkMask.size()];
for (int index = 0; index < sections.length; index++) {
if (chunkMask.get(index)) {
chunks[index] = Chunk.read(dataIn);
sections[index] = ChunkSection.read(dataIn);
}
}
CompoundTag[] tileEntities = new CompoundTag[in.readVarInt()];
for (int i = 0; i < tileEntities.length; i++) {
tileEntities[i] = NBT.read(in);
CompoundTag[] blockEntities = new CompoundTag[in.readVarInt()];
for (int i = 0; i < blockEntities.length; i++) {
blockEntities[i] = NBT.read(in);
}
this.column = new Column(x, z, chunks, tileEntities, heightMaps, biomeData);
this.chunk = new Chunk(x, z, sections, blockEntities, heightMaps, biomeData);
}
@Override
@ -58,31 +58,31 @@ public class ClientboundLevelChunkPacket implements Packet {
NetOutput dataOut = new StreamNetOutput(dataBytes);
BitSet bitSet = new BitSet();
Chunk[] chunks = this.column.getChunks();
for (int index = 0; index < chunks.length; index++) {
Chunk chunk = chunks[index];
if (chunk != null && !chunk.isEmpty()) {
ChunkSection[] sections = this.chunk.getSections();
for (int index = 0; index < sections.length; index++) {
ChunkSection section = sections[index];
if (sections != null && !section.isEmpty()) {
bitSet.set(index);
Chunk.write(dataOut, chunk);
ChunkSection.write(dataOut, section);
}
}
out.writeInt(this.column.getX());
out.writeInt(this.column.getZ());
out.writeInt(this.chunk.getX());
out.writeInt(this.chunk.getZ());
long[] longArray = bitSet.toLongArray();
out.writeVarInt(longArray.length);
for (long content : longArray) {
out.writeLong(content);
}
NBT.write(out, this.column.getHeightMaps());
out.writeVarInt(this.column.getBiomeData().length);
for (int biomeData : this.column.getBiomeData()) {
NBT.write(out, this.chunk.getHeightMaps());
out.writeVarInt(this.chunk.getBiomeData().length);
for (int biomeData : this.chunk.getBiomeData()) {
out.writeVarInt(biomeData);
}
out.writeVarInt(dataBytes.size());
out.writeBytes(dataBytes.toByteArray(), dataBytes.size());
out.writeVarInt(this.column.getTileEntities().length);
for (CompoundTag tag : this.column.getTileEntities()) {
out.writeVarInt(this.chunk.getBlockEntities().length);
for (CompoundTag tag : this.chunk.getBlockEntities()) {
NBT.write(out, tag);
}
}

View file

@ -2,17 +2,17 @@ package com.github.steveice10.mc.protocol.packet.ingame.clientbound.level;
import com.github.steveice10.mc.protocol.data.MagicValues;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.Position;
import com.github.steveice10.mc.protocol.data.game.level.effect.BonemealGrowEffectData;
import com.github.steveice10.mc.protocol.data.game.level.effect.BreakBlockEffectData;
import com.github.steveice10.mc.protocol.data.game.level.effect.BreakPotionEffectData;
import com.github.steveice10.mc.protocol.data.game.level.effect.ComposterEffectData;
import com.github.steveice10.mc.protocol.data.game.level.effect.DragonFireballEffectData;
import com.github.steveice10.mc.protocol.data.game.level.effect.ParticleEffect;
import com.github.steveice10.mc.protocol.data.game.level.effect.RecordEffectData;
import com.github.steveice10.mc.protocol.data.game.level.effect.SmokeEffectData;
import com.github.steveice10.mc.protocol.data.game.level.effect.SoundEffect;
import com.github.steveice10.mc.protocol.data.game.level.effect.WorldEffect;
import com.github.steveice10.mc.protocol.data.game.level.effect.WorldEffectData;
import com.github.steveice10.mc.protocol.data.game.level.event.BonemealGrowEventData;
import com.github.steveice10.mc.protocol.data.game.level.event.BreakBlockEventData;
import com.github.steveice10.mc.protocol.data.game.level.event.BreakPotionEventData;
import com.github.steveice10.mc.protocol.data.game.level.event.ComposterEventData;
import com.github.steveice10.mc.protocol.data.game.level.event.DragonFireballEventData;
import com.github.steveice10.mc.protocol.data.game.level.event.ParticleEvent;
import com.github.steveice10.mc.protocol.data.game.level.event.RecordEventData;
import com.github.steveice10.mc.protocol.data.game.level.event.SmokeEventData;
import com.github.steveice10.mc.protocol.data.game.level.event.SoundEvent;
import com.github.steveice10.mc.protocol.data.game.level.event.LevelEvent;
import com.github.steveice10.mc.protocol.data.game.level.event.LevelEventData;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;
@ -27,33 +27,33 @@ import java.io.IOException;
@With
@AllArgsConstructor
public class ClientboundLevelEventPacket implements Packet {
private final @NonNull WorldEffect effect;
private final @NonNull LevelEvent event;
private final @NonNull Position position;
private final WorldEffectData data;
private final LevelEventData data;
private final boolean broadcast;
public ClientboundLevelEventPacket(@NonNull WorldEffect effect, @NonNull Position position, @NonNull WorldEffectData data) {
this(effect, position, data, false);
public ClientboundLevelEventPacket(@NonNull LevelEvent event, @NonNull Position position, @NonNull LevelEventData data) {
this(event, position, data, false);
}
public ClientboundLevelEventPacket(NetInput in) throws IOException {
this.effect = MagicValues.key(WorldEffect.class, in.readInt());
this.event = MagicValues.key(LevelEvent.class, in.readInt());
this.position = Position.read(in);
int value = in.readInt();
if (this.effect == SoundEffect.RECORD) {
this.data = new RecordEffectData(value);
} else if (this.effect == ParticleEffect.SMOKE) {
this.data = MagicValues.key(SmokeEffectData.class, value % 6);
} else if (this.effect == ParticleEffect.BREAK_BLOCK) {
this.data = new BreakBlockEffectData(value);
} else if (this.effect == ParticleEffect.BREAK_SPLASH_POTION) {
this.data = new BreakPotionEffectData(value);
} else if (this.effect == ParticleEffect.BONEMEAL_GROW || this.effect == ParticleEffect.BONEMEAL_GROW_WITH_SOUND) {
this.data = new BonemealGrowEffectData(value);
} else if (this.effect == ParticleEffect.COMPOSTER) {
this.data = value > 0 ? ComposterEffectData.FILL_SUCCESS : ComposterEffectData.FILL;
} else if (this.effect == ParticleEffect.ENDERDRAGON_FIREBALL_EXPLODE) {
this.data = value == 1 ? DragonFireballEffectData.HAS_SOUND : DragonFireballEffectData.NO_SOUND;
if (this.event == SoundEvent.RECORD) {
this.data = new RecordEventData(value);
} else if (this.event == ParticleEvent.SMOKE) {
this.data = MagicValues.key(SmokeEventData.class, value % 6);
} else if (this.event == ParticleEvent.BREAK_BLOCK) {
this.data = new BreakBlockEventData(value);
} else if (this.event == ParticleEvent.BREAK_SPLASH_POTION) {
this.data = new BreakPotionEventData(value);
} else if (this.event == ParticleEvent.BONEMEAL_GROW || this.event == ParticleEvent.BONEMEAL_GROW_WITH_SOUND) {
this.data = new BonemealGrowEventData(value);
} else if (this.event == ParticleEvent.COMPOSTER) {
this.data = value > 0 ? ComposterEventData.FILL_SUCCESS : ComposterEventData.FILL;
} else if (this.event == ParticleEvent.ENDERDRAGON_FIREBALL_EXPLODE) {
this.data = value == 1 ? DragonFireballEventData.HAS_SOUND : DragonFireballEventData.NO_SOUND;
} else {
this.data = null;
}
@ -63,22 +63,22 @@ public class ClientboundLevelEventPacket implements Packet {
@Override
public void write(NetOutput out) throws IOException {
out.writeInt(MagicValues.value(Integer.class, this.effect));
out.writeInt(MagicValues.value(Integer.class, this.event));
Position.write(out, this.position);
int value = 0;
if (this.data instanceof RecordEffectData) {
value = ((RecordEffectData) this.data).getRecordId();
} else if (this.data instanceof SmokeEffectData) {
value = MagicValues.value(Integer.class, (SmokeEffectData) this.data);
} else if (this.data instanceof BreakBlockEffectData) {
value = ((BreakBlockEffectData) this.data).getBlockState();
} else if (this.data instanceof BreakPotionEffectData) {
value = ((BreakPotionEffectData) this.data).getPotionId();
} else if (this.data instanceof BonemealGrowEffectData) {
value = ((BonemealGrowEffectData) this.data).getParticleCount();
} else if (this.data instanceof ComposterEffectData) {
if (this.data instanceof RecordEventData) {
value = ((RecordEventData) this.data).getRecordId();
} else if (this.data instanceof SmokeEventData) {
value = MagicValues.value(Integer.class, (SmokeEventData) this.data);
} else if (this.data instanceof BreakBlockEventData) {
value = ((BreakBlockEventData) this.data).getBlockState();
} else if (this.data instanceof BreakPotionEventData) {
value = ((BreakPotionEventData) this.data).getPotionId();
} else if (this.data instanceof BonemealGrowEventData) {
value = ((BonemealGrowEventData) this.data).getParticleCount();
} else if (this.data instanceof ComposterEventData) {
value = MagicValues.value(Integer.class, this.data);
} else if (this.data instanceof DragonFireballEffectData) {
} else if (this.data instanceof DragonFireballEventData) {
value = MagicValues.value(Integer.class, this.data);
}

View file

@ -1,15 +1,12 @@
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.level;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.Position;
import com.github.steveice10.mc.protocol.data.game.level.block.BlockChangeRecord;
import com.github.steveice10.mc.protocol.data.game.level.block.BlockChangeEntry;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;
import lombok.AccessLevel;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Setter;
import lombok.With;
import java.io.IOException;
@ -24,9 +21,9 @@ public class ClientboundSectionBlocksUpdatePacket implements Packet {
/**
* The server sends the record position in terms of the local chunk coordinate but it is stored here in terms of global coordinates.
*/
private final @NonNull BlockChangeRecord[] records;
private final @NonNull BlockChangeEntry[] records;
public ClientboundSectionBlocksUpdatePacket(int chunkX, int chunkY, int chunkZ, boolean ignoreOldLight, BlockChangeRecord... records) {
public ClientboundSectionBlocksUpdatePacket(int chunkX, int chunkY, int chunkZ, boolean ignoreOldLight, BlockChangeEntry... records) {
if (records == null || records.length == 0) {
throw new IllegalArgumentException("Records must contain at least 1 value.");
}
@ -44,14 +41,14 @@ public class ClientboundSectionBlocksUpdatePacket implements Packet {
this.chunkY = (int) (chunkPosition << 44 >> 44);
this.chunkZ = (int) (chunkPosition << 22 >> 42);
this.ignoreOldLight = in.readBoolean();
this.records = new BlockChangeRecord[in.readVarInt()];
this.records = new BlockChangeEntry[in.readVarInt()];
for (int index = 0; index < this.records.length; index++) {
long blockData = in.readVarLong();
short position = (short) (blockData & 0xFFFL);
int x = (this.chunkX << 4) + (position >>> 8 & 0xF);
int y = (this.chunkY << 4) + (position & 0xF);
int z = (this.chunkZ << 4) + (position >>> 4 & 0xF);
this.records[index] = new BlockChangeRecord(new Position(x, y, z), (int) (blockData >>> 12));
this.records[index] = new BlockChangeEntry(new Position(x, y, z), (int) (blockData >>> 12));
}
}
@ -63,7 +60,7 @@ public class ClientboundSectionBlocksUpdatePacket implements Packet {
out.writeLong(chunkPosition | (this.chunkY & 0xFFFFFL));
out.writeBoolean(this.ignoreOldLight);
out.writeVarInt(this.records.length);
for (BlockChangeRecord record : this.records) {
for (BlockChangeEntry record : this.records) {
short position = (short) ((record.getPosition().getX() - (this.chunkX << 4)) << 8 | (record.getPosition().getZ() - (this.chunkZ << 4)) << 4 | (record.getPosition().getY() - (this.chunkY << 4)));
out.writeVarLong((long) record.getBlock() << 12 | position);
}

View file

@ -1,7 +1,7 @@
package com.github.steveice10.mc.protocol.packet.ingame.serverbound;
import com.github.steveice10.mc.protocol.data.MagicValues;
import com.github.steveice10.mc.protocol.data.game.ClientRequest;
import com.github.steveice10.mc.protocol.data.game.ClientCommand;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;
@ -16,10 +16,10 @@ import java.io.IOException;
@With
@AllArgsConstructor
public class ServerboundClientCommandPacket implements Packet {
private final @NonNull ClientRequest request;
private final @NonNull ClientCommand request;
public ServerboundClientCommandPacket(NetInput in) throws IOException {
this.request = MagicValues.key(ClientRequest.class, in.readVarInt());
this.request = MagicValues.key(ClientCommand.class, in.readVarInt());
}
@Override

View file

@ -1,13 +1,10 @@
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.With;
import java.io.IOException;
@ -16,17 +13,17 @@ import java.io.IOException;
@With
@AllArgsConstructor
public class ServerboundContainerButtonClickPacket implements Packet {
private final int windowId;
private final int containerId;
private final int buttonId;
public ServerboundContainerButtonClickPacket(NetInput in) throws IOException {
this.windowId = in.readByte();
this.containerId = in.readByte();
this.buttonId = in.readByte();
}
@Override
public void write(NetOutput out) throws IOException {
out.writeByte(this.windowId);
out.writeByte(this.containerId);
out.writeByte(this.buttonId);
}
}

View file

@ -1,16 +1,16 @@
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory;
import com.github.steveice10.mc.protocol.data.MagicValues;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
import com.github.steveice10.mc.protocol.data.game.window.ClickItemParam;
import com.github.steveice10.mc.protocol.data.game.window.CreativeGrabParam;
import com.github.steveice10.mc.protocol.data.game.window.DropItemParam;
import com.github.steveice10.mc.protocol.data.game.window.FillStackParam;
import com.github.steveice10.mc.protocol.data.game.window.MoveToHotbarParam;
import com.github.steveice10.mc.protocol.data.game.window.ShiftClickItemParam;
import com.github.steveice10.mc.protocol.data.game.window.SpreadItemParam;
import com.github.steveice10.mc.protocol.data.game.window.WindowAction;
import com.github.steveice10.mc.protocol.data.game.window.WindowActionParam;
import com.github.steveice10.mc.protocol.data.game.inventory.ClickItemAction;
import com.github.steveice10.mc.protocol.data.game.inventory.CreativeGrabAction;
import com.github.steveice10.mc.protocol.data.game.inventory.DropItemAction;
import com.github.steveice10.mc.protocol.data.game.inventory.FillStackAction;
import com.github.steveice10.mc.protocol.data.game.inventory.MoveToHotbarAction;
import com.github.steveice10.mc.protocol.data.game.inventory.ShiftClickItemAction;
import com.github.steveice10.mc.protocol.data.game.inventory.SpreadItemAction;
import com.github.steveice10.mc.protocol.data.game.inventory.ContainerActionType;
import com.github.steveice10.mc.protocol.data.game.inventory.ContainerAction;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;
@ -28,22 +28,22 @@ import java.util.Map;
public class ServerboundContainerClickPacket implements Packet {
public static final int CLICK_OUTSIDE_NOT_HOLDING_SLOT = -999;
private final int windowId;
private final int containerId;
private final int stateId;
private final int slot;
private final WindowAction action;
private final WindowActionParam param;
private final ContainerActionType action;
private final ContainerAction param;
private final ItemStack carriedItem;
private final @NonNull Map<Integer, ItemStack> changedSlots;
public ServerboundContainerClickPacket(int windowId, int stateId, int slot, WindowAction action, WindowActionParam param, ItemStack carriedItem, @NotNull Map<Integer, ItemStack> changedSlots) {
if ((param == DropItemParam.LEFT_CLICK_OUTSIDE_NOT_HOLDING || param == DropItemParam.RIGHT_CLICK_OUTSIDE_NOT_HOLDING)
public ServerboundContainerClickPacket(int containerId, int stateId, int slot, ContainerActionType action, ContainerAction param, ItemStack carriedItem, @NotNull Map<Integer, ItemStack> changedSlots) {
if ((param == DropItemAction.LEFT_CLICK_OUTSIDE_NOT_HOLDING || param == DropItemAction.RIGHT_CLICK_OUTSIDE_NOT_HOLDING)
&& slot != -CLICK_OUTSIDE_NOT_HOLDING_SLOT) {
throw new IllegalArgumentException("Slot must be " + CLICK_OUTSIDE_NOT_HOLDING_SLOT
+ " with param LEFT_CLICK_OUTSIDE_NOT_HOLDING or RIGHT_CLICK_OUTSIDE_NOT_HOLDING");
}
this.windowId = windowId;
this.containerId = containerId;
this.stateId = stateId;
this.slot = slot;
this.action = action;
@ -53,25 +53,25 @@ public class ServerboundContainerClickPacket implements Packet {
}
public ServerboundContainerClickPacket(NetInput in) throws IOException {
this.windowId = in.readByte();
this.containerId = in.readByte();
this.stateId = in.readVarInt();
this.slot = in.readShort();
byte param = in.readByte();
this.action = MagicValues.key(WindowAction.class, in.readByte());
if (this.action == WindowAction.CLICK_ITEM) {
this.param = MagicValues.key(ClickItemParam.class, param);
} else if (this.action == WindowAction.SHIFT_CLICK_ITEM) {
this.param = MagicValues.key(ShiftClickItemParam.class, param);
} else if (this.action == WindowAction.MOVE_TO_HOTBAR_SLOT) {
this.param = MagicValues.key(MoveToHotbarParam.class, param);
} else if (this.action == WindowAction.CREATIVE_GRAB_MAX_STACK) {
this.param = MagicValues.key(CreativeGrabParam.class, param);
} else if (this.action == WindowAction.DROP_ITEM) {
this.param = MagicValues.key(DropItemParam.class, param + (this.slot != -999 ? 2 : 0));
} else if (this.action == WindowAction.SPREAD_ITEM) {
this.param = MagicValues.key(SpreadItemParam.class, param);
} else if (this.action == WindowAction.FILL_STACK) {
this.param = MagicValues.key(FillStackParam.class, param);
this.action = MagicValues.key(ContainerActionType.class, in.readByte());
if (this.action == ContainerActionType.CLICK_ITEM) {
this.param = MagicValues.key(ClickItemAction.class, param);
} else if (this.action == ContainerActionType.SHIFT_CLICK_ITEM) {
this.param = MagicValues.key(ShiftClickItemAction.class, param);
} else if (this.action == ContainerActionType.MOVE_TO_HOTBAR_SLOT) {
this.param = MagicValues.key(MoveToHotbarAction.class, param);
} else if (this.action == ContainerActionType.CREATIVE_GRAB_MAX_STACK) {
this.param = MagicValues.key(CreativeGrabAction.class, param);
} else if (this.action == ContainerActionType.DROP_ITEM) {
this.param = MagicValues.key(DropItemAction.class, param + (this.slot != -999 ? 2 : 0));
} else if (this.action == ContainerActionType.SPREAD_ITEM) {
this.param = MagicValues.key(SpreadItemAction.class, param);
} else if (this.action == ContainerActionType.FILL_STACK) {
this.param = MagicValues.key(FillStackAction.class, param);
} else {
throw new IllegalStateException();
}
@ -89,12 +89,12 @@ public class ServerboundContainerClickPacket implements Packet {
@Override
public void write(NetOutput out) throws IOException {
out.writeByte(this.windowId);
out.writeByte(this.containerId);
out.writeVarInt(this.stateId);
out.writeShort(this.slot);
int param = MagicValues.value(Integer.class, this.param);
if (this.action == WindowAction.DROP_ITEM) {
if (this.action == ContainerActionType.DROP_ITEM) {
param %= 2;
}

View file

@ -1,13 +1,10 @@
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.With;
import java.io.IOException;
@ -16,14 +13,14 @@ import java.io.IOException;
@With
@AllArgsConstructor
public class ServerboundContainerClosePacket implements Packet {
private final int windowId;
private final int containerId;
public ServerboundContainerClosePacket(NetInput in) throws IOException {
this.windowId = in.readByte();
this.containerId = in.readByte();
}
@Override
public void write(NetOutput out) throws IOException {
out.writeByte(this.windowId);
out.writeByte(this.containerId);
}
}

View file

@ -1,13 +1,10 @@
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.With;
import javax.annotation.Nullable;

View file

@ -1,13 +1,10 @@
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.With;
import java.io.IOException;

View file

@ -1,4 +1,4 @@
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
@ -14,19 +14,19 @@ import java.io.IOException;
@With
@AllArgsConstructor
public class ServerboundPlaceRecipePacket implements Packet {
private final int windowId;
private final int containerId;
private final @NonNull String recipeId;
private final boolean makeAll;
public ServerboundPlaceRecipePacket(NetInput in) throws IOException {
this.windowId = in.readByte();
this.containerId = in.readByte();
this.recipeId = in.readString();
this.makeAll = in.readBoolean();
}
@Override
public void write(NetOutput out) throws IOException {
out.writeByte(this.windowId);
out.writeByte(this.containerId);
out.writeString(this.recipeId);
out.writeBoolean(this.makeAll);
}

View file

@ -1,7 +1,7 @@
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory;
import com.github.steveice10.mc.protocol.data.MagicValues;
import com.github.steveice10.mc.protocol.data.game.window.CraftingBookStateType;
import com.github.steveice10.mc.protocol.data.game.inventory.CraftingBookStateType;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;

View file

@ -1,4 +1,4 @@
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;

View file

@ -1,4 +1,4 @@
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;

View file

@ -1,7 +1,7 @@
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory;
import com.github.steveice10.mc.protocol.data.MagicValues;
import com.github.steveice10.mc.protocol.data.game.window.AdvancementTabAction;
import com.github.steveice10.mc.protocol.data.game.inventory.AdvancementTabAction;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;

View file

@ -1,13 +1,10 @@
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.With;
import java.io.IOException;

View file

@ -1,13 +1,10 @@
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.With;
import java.io.IOException;

View file

@ -1,4 +1,4 @@
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory;
import com.github.steveice10.mc.protocol.data.MagicValues;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.Position;

View file

@ -1,4 +1,4 @@
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;

View file

@ -1,4 +1,4 @@
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
import com.github.steveice10.packetlib.io.NetInput;

View file

@ -1,4 +1,4 @@
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.Position;
import com.github.steveice10.packetlib.io.NetInput;

View file

@ -1,11 +1,11 @@
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.window;
package com.github.steveice10.mc.protocol.packet.ingame.serverbound.inventory;
import com.github.steveice10.mc.protocol.data.MagicValues;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.Position;
import com.github.steveice10.mc.protocol.data.game.level.block.StructureMirror;
import com.github.steveice10.mc.protocol.data.game.level.block.StructureRotation;
import com.github.steveice10.mc.protocol.data.game.window.UpdateStructureBlockAction;
import com.github.steveice10.mc.protocol.data.game.window.UpdateStructureBlockMode;
import com.github.steveice10.mc.protocol.data.game.inventory.UpdateStructureBlockAction;
import com.github.steveice10.mc.protocol.data.game.inventory.UpdateStructureBlockMode;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import com.github.steveice10.packetlib.packet.Packet;

View file

@ -3,7 +3,7 @@ package com.github.steveice10.mc.protocol.data;
import com.github.steveice10.mc.protocol.data.game.BossBarAction;
import com.github.steveice10.mc.protocol.data.game.BossBarColor;
import com.github.steveice10.mc.protocol.data.game.BossBarDivision;
import com.github.steveice10.mc.protocol.data.game.ClientRequest;
import com.github.steveice10.mc.protocol.data.game.ClientCommand;
import com.github.steveice10.mc.protocol.data.game.MessageType;
import com.github.steveice10.mc.protocol.data.game.PlayerListEntryAction;
import com.github.steveice10.mc.protocol.data.game.ResourcePackStatus;
@ -13,7 +13,7 @@ import com.github.steveice10.mc.protocol.data.game.command.CommandParser;
import com.github.steveice10.mc.protocol.data.game.command.CommandType;
import com.github.steveice10.mc.protocol.data.game.command.SuggestionType;
import com.github.steveice10.mc.protocol.data.game.command.properties.StringProperties;
import com.github.steveice10.mc.protocol.data.game.entity.EntityStatus;
import com.github.steveice10.mc.protocol.data.game.entity.EntityEvent;
import com.github.steveice10.mc.protocol.data.game.entity.EquipmentSlot;
import com.github.steveice10.mc.protocol.data.game.entity.RotationOrigin;
import com.github.steveice10.mc.protocol.data.game.entity.attribute.AttributeType;
@ -24,7 +24,6 @@ import com.github.steveice10.mc.protocol.data.game.entity.metadata.Pose;
import com.github.steveice10.mc.protocol.data.game.entity.object.HangingDirection;
import com.github.steveice10.mc.protocol.data.game.entity.object.MinecartType;
import com.github.steveice10.mc.protocol.data.game.entity.player.Animation;
import com.github.steveice10.mc.protocol.data.game.entity.player.BlockBreakStage;
import com.github.steveice10.mc.protocol.data.game.entity.player.GameMode;
import com.github.steveice10.mc.protocol.data.game.entity.player.Hand;
import com.github.steveice10.mc.protocol.data.game.entity.player.HandPreference;
@ -39,7 +38,7 @@ import com.github.steveice10.mc.protocol.data.game.level.block.BlockFace;
import com.github.steveice10.mc.protocol.data.game.level.block.CommandBlockMode;
import com.github.steveice10.mc.protocol.data.game.level.block.StructureMirror;
import com.github.steveice10.mc.protocol.data.game.level.block.StructureRotation;
import com.github.steveice10.mc.protocol.data.game.level.block.UpdatedTileType;
import com.github.steveice10.mc.protocol.data.game.level.block.BlockEntityType;
import com.github.steveice10.mc.protocol.data.game.level.block.value.ChestValueType;
import com.github.steveice10.mc.protocol.data.game.level.block.value.EndGatewayValueType;
import com.github.steveice10.mc.protocol.data.game.level.block.value.GenericBlockValueType;
@ -47,12 +46,12 @@ import com.github.steveice10.mc.protocol.data.game.level.block.value.MobSpawnerV
import com.github.steveice10.mc.protocol.data.game.level.block.value.NoteBlockValueType;
import com.github.steveice10.mc.protocol.data.game.level.block.value.PistonValue;
import com.github.steveice10.mc.protocol.data.game.level.block.value.PistonValueType;
import com.github.steveice10.mc.protocol.data.game.level.effect.ComposterEffectData;
import com.github.steveice10.mc.protocol.data.game.level.effect.ParticleEffect;
import com.github.steveice10.mc.protocol.data.game.level.effect.SmokeEffectData;
import com.github.steveice10.mc.protocol.data.game.level.effect.SoundEffect;
import com.github.steveice10.mc.protocol.data.game.level.event.ComposterEventData;
import com.github.steveice10.mc.protocol.data.game.level.event.ParticleEvent;
import com.github.steveice10.mc.protocol.data.game.level.event.SmokeEventData;
import com.github.steveice10.mc.protocol.data.game.level.event.SoundEvent;
import com.github.steveice10.mc.protocol.data.game.level.map.MapIconType;
import com.github.steveice10.mc.protocol.data.game.level.notify.ClientNotification;
import com.github.steveice10.mc.protocol.data.game.level.notify.GameEvent;
import com.github.steveice10.mc.protocol.data.game.level.notify.DemoMessageValue;
import com.github.steveice10.mc.protocol.data.game.level.notify.EnterCreditsValue;
import com.github.steveice10.mc.protocol.data.game.level.sound.SoundCategory;
@ -68,23 +67,23 @@ import com.github.steveice10.mc.protocol.data.game.setting.ChatVisibility;
import com.github.steveice10.mc.protocol.data.game.setting.Difficulty;
import com.github.steveice10.mc.protocol.data.game.statistic.GenericStatistic;
import com.github.steveice10.mc.protocol.data.game.statistic.StatisticCategory;
import com.github.steveice10.mc.protocol.data.game.window.AdvancementTabAction;
import com.github.steveice10.mc.protocol.data.game.window.ClickItemParam;
import com.github.steveice10.mc.protocol.data.game.window.CraftingBookStateType;
import com.github.steveice10.mc.protocol.data.game.window.CreativeGrabParam;
import com.github.steveice10.mc.protocol.data.game.window.DropItemParam;
import com.github.steveice10.mc.protocol.data.game.window.FillStackParam;
import com.github.steveice10.mc.protocol.data.game.window.MoveToHotbarParam;
import com.github.steveice10.mc.protocol.data.game.window.ShiftClickItemParam;
import com.github.steveice10.mc.protocol.data.game.window.SpreadItemParam;
import com.github.steveice10.mc.protocol.data.game.window.UpdateStructureBlockAction;
import com.github.steveice10.mc.protocol.data.game.window.UpdateStructureBlockMode;
import com.github.steveice10.mc.protocol.data.game.window.WindowAction;
import com.github.steveice10.mc.protocol.data.game.window.WindowType;
import com.github.steveice10.mc.protocol.data.game.window.property.AnvilProperty;
import com.github.steveice10.mc.protocol.data.game.window.property.BrewingStandProperty;
import com.github.steveice10.mc.protocol.data.game.window.property.EnchantmentTableProperty;
import com.github.steveice10.mc.protocol.data.game.window.property.FurnaceProperty;
import com.github.steveice10.mc.protocol.data.game.inventory.AdvancementTabAction;
import com.github.steveice10.mc.protocol.data.game.inventory.ClickItemAction;
import com.github.steveice10.mc.protocol.data.game.inventory.CraftingBookStateType;
import com.github.steveice10.mc.protocol.data.game.inventory.CreativeGrabAction;
import com.github.steveice10.mc.protocol.data.game.inventory.DropItemAction;
import com.github.steveice10.mc.protocol.data.game.inventory.FillStackAction;
import com.github.steveice10.mc.protocol.data.game.inventory.MoveToHotbarAction;
import com.github.steveice10.mc.protocol.data.game.inventory.ShiftClickItemAction;
import com.github.steveice10.mc.protocol.data.game.inventory.SpreadItemAction;
import com.github.steveice10.mc.protocol.data.game.inventory.UpdateStructureBlockAction;
import com.github.steveice10.mc.protocol.data.game.inventory.UpdateStructureBlockMode;
import com.github.steveice10.mc.protocol.data.game.inventory.ContainerActionType;
import com.github.steveice10.mc.protocol.data.game.inventory.ContainerType;
import com.github.steveice10.mc.protocol.data.game.inventory.property.AnvilProperty;
import com.github.steveice10.mc.protocol.data.game.inventory.property.BrewingStandProperty;
import com.github.steveice10.mc.protocol.data.game.inventory.property.EnchantmentTableProperty;
import com.github.steveice10.mc.protocol.data.game.inventory.property.FurnaceProperty;
import com.github.steveice10.mc.protocol.data.handshake.HandshakeIntent;
import org.junit.Before;
import org.junit.Test;
@ -114,24 +113,24 @@ public class MagicValuesTest {
this.register(ModifierOperation.class, Integer.class);
this.register(MetadataType.class, Integer.class);
this.register(HandshakeIntent.class, Integer.class);
this.register(ClientRequest.class, Integer.class);
this.register(ClientCommand.class, Integer.class);
this.register(ChatVisibility.class, Integer.class);
this.register(PlayerState.class, Integer.class);
this.register(InteractAction.class, Integer.class);
this.register(PlayerAction.class, Integer.class);
this.register(WindowAction.class, Integer.class);
this.register(ClickItemParam.class, Integer.class);
this.register(ShiftClickItemParam.class, Integer.class);
this.register(MoveToHotbarParam.class, Integer.class);
this.register(CreativeGrabParam.class, Integer.class);
this.register(DropItemParam.class, Integer.class);
this.register(SpreadItemParam.class, Integer.class);
this.register(FillStackParam.class, Integer.class);
this.register(ContainerActionType.class, Integer.class);
this.register(ClickItemAction.class, Integer.class);
this.register(ShiftClickItemAction.class, Integer.class);
this.register(MoveToHotbarAction.class, Integer.class);
this.register(CreativeGrabAction.class, Integer.class);
this.register(DropItemAction.class, Integer.class);
this.register(SpreadItemAction.class, Integer.class);
this.register(FillStackAction.class, Integer.class);
this.register(MessageType.class, Integer.class);
this.register(GameMode.class, Integer.class);
this.register(Difficulty.class, Integer.class);
this.register(Animation.class, Integer.class);
this.register(EntityStatus.class, Integer.class);
this.register(EntityEvent.class, Integer.class);
this.register(PositionElement.class, Integer.class);
this.register(WeatherEntityType.class, Integer.class);
this.register(EntityType.class, Integer.class);
@ -143,13 +142,13 @@ public class MagicValuesTest {
this.register(TeamAction.class, Integer.class);
this.register(ScoreboardAction.class, Integer.class);
this.register(MapIconType.class, Integer.class);
this.register(WindowType.class, Integer.class);
this.register(ContainerType.class, Integer.class);
this.register(BrewingStandProperty.class, Integer.class);
this.register(EnchantmentTableProperty.class, Integer.class);
this.register(FurnaceProperty.class, Integer.class);
this.register(AnvilProperty.class, Integer.class);
this.register(UpdatedTileType.class, Integer.class);
this.register(ClientNotification.class, Integer.class);
this.register(BlockEntityType.class, Integer.class);
this.register(GameEvent.class, Integer.class);
this.register(CommandBlockMode.class, Integer.class);
this.register(UpdateStructureBlockAction.class, Integer.class);
this.register(UpdateStructureBlockMode.class, Integer.class);
@ -166,10 +165,10 @@ public class MagicValuesTest {
this.register(EndGatewayValueType.class, Integer.class);
this.register(GenericBlockValueType.class, Integer.class);
this.register(PistonValue.class, Integer.class);
this.register(SoundEffect.class, Integer.class);
this.register(ParticleEffect.class, Integer.class);
this.register(SmokeEffectData.class, Integer.class);
this.register(ComposterEffectData.class, Integer.class);
this.register(SoundEvent.class, Integer.class);
this.register(ParticleEvent.class, Integer.class);
this.register(SmokeEventData.class, Integer.class);
this.register(ComposterEventData.class, Integer.class);
this.register(NameTagVisibility.class, String.class);
this.register(CollisionRule.class, String.class);
this.register(ScoreType.class, Integer.class);

View file

@ -1,7 +1,7 @@
package com.github.steveice10.mc.protocol.packet.ingame.clientbound.level;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.Position;
import com.github.steveice10.mc.protocol.data.game.level.block.BlockChangeRecord;
import com.github.steveice10.mc.protocol.data.game.level.block.BlockChangeEntry;
import com.github.steveice10.mc.protocol.packet.PacketTest;
import org.junit.Before;
@ -9,7 +9,7 @@ public class ClientboundBlockUpdatePacketTest extends PacketTest {
@Before
public void setup() {
this.setPackets(
new ClientboundBlockUpdatePacket(new BlockChangeRecord(
new ClientboundBlockUpdatePacket(new BlockChangeEntry(
new Position(1, 61, -1), 3
))
);

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