[1.20.2] Final remaining template issues are now fixed
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
This commit is contained in:
1 parent
1f10dbf6ae
commit
2829cd6fab
9 files changed
+242
-142
No files matched your search
+9
-9
@@ -1,21 +1,21 @@
|
||||
package com.bergerkiller.generated.net.minecraft.network.protocol.game;
|
||||
package com.bergerkiller.generated.net.minecraft.network.protocol.common;
|
||||
|
||||
import com.bergerkiller.mountiplex.reflection.declarations.Template;
|
||||
import com.bergerkiller.bukkit.common.wrappers.ChatText;
|
||||
import com.bergerkiller.generated.net.minecraft.network.protocol.PacketHandle;
|
||||
|
||||
/**
|
||||
* Instance wrapper handle for type <b>net.minecraft.network.protocol.game.PacketPlayOutKickDisconnect</b>.
|
||||
* Instance wrapper handle for type <b>net.minecraft.network.protocol.common.ClientboundDisconnectPacket</b>.
|
||||
* To access members without creating a handle type, use the static {@link #T} member.
|
||||
* New handles can be created from raw instances using {@link #createHandle(Object)}.
|
||||
*/
|
||||
@Template.InstanceType("net.minecraft.network.protocol.game.PacketPlayOutKickDisconnect")
|
||||
public abstract class PacketPlayOutKickDisconnectHandle extends PacketHandle {
|
||||
/** @see PacketPlayOutKickDisconnectClass */
|
||||
public static final PacketPlayOutKickDisconnectClass T = Template.Class.create(PacketPlayOutKickDisconnectClass.class, com.bergerkiller.bukkit.common.Common.TEMPLATE_RESOLVER);
|
||||
@Template.InstanceType("net.minecraft.network.protocol.common.ClientboundDisconnectPacket")
|
||||
public abstract class ClientboundDisconnectPacketHandle extends PacketHandle {
|
||||
/** @see ClientboundDisconnectPacketClass */
|
||||
public static final ClientboundDisconnectPacketClass T = Template.Class.create(ClientboundDisconnectPacketClass.class, com.bergerkiller.bukkit.common.Common.TEMPLATE_RESOLVER);
|
||||
/* ============================================================================== */
|
||||
|
||||
public static PacketPlayOutKickDisconnectHandle createHandle(Object handleInstance) {
|
||||
public static ClientboundDisconnectPacketHandle createHandle(Object handleInstance) {
|
||||
return T.createHandle(handleInstance);
|
||||
}
|
||||
|
||||
@@ -24,10 +24,10 @@ public abstract class PacketPlayOutKickDisconnectHandle extends PacketHandle {
|
||||
public abstract ChatText getReason();
|
||||
public abstract void setReason(ChatText value);
|
||||
/**
|
||||
* Stores class members for <b>net.minecraft.network.protocol.game.PacketPlayOutKickDisconnect</b>.
|
||||
* Stores class members for <b>net.minecraft.network.protocol.common.ClientboundDisconnectPacket</b>.
|
||||
* Methods, fields, and constructors can be used without using Handle Objects.
|
||||
*/
|
||||
public static final class PacketPlayOutKickDisconnectClass extends Template.Class<PacketPlayOutKickDisconnectHandle> {
|
||||
public static final class ClientboundDisconnectPacketClass extends Template.Class<ClientboundDisconnectPacketHandle> {
|
||||
public final Template.Field.Converted<ChatText> reason = new Template.Field.Converted<ChatText>();
|
||||
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package com.bergerkiller.generated.net.minecraft.network.protocol.common;
|
||||
|
||||
import com.bergerkiller.mountiplex.reflection.declarations.Template;
|
||||
import com.bergerkiller.bukkit.common.wrappers.HumanHand;
|
||||
import com.bergerkiller.generated.net.minecraft.network.protocol.PacketHandle;
|
||||
|
||||
/**
|
||||
* Instance wrapper handle for type <b>net.minecraft.network.protocol.common.ServerboundClientInformationPacket</b>.
|
||||
* To access members without creating a handle type, use the static {@link #T} member.
|
||||
* New handles can be created from raw instances using {@link #createHandle(Object)}.
|
||||
*/
|
||||
@Template.InstanceType("net.minecraft.network.protocol.common.ServerboundClientInformationPacket")
|
||||
public abstract class ServerboundClientInformationPacketHandle extends PacketHandle {
|
||||
/** @see ServerboundClientInformationPacketClass */
|
||||
public static final ServerboundClientInformationPacketClass T = Template.Class.create(ServerboundClientInformationPacketClass.class, com.bergerkiller.bukkit.common.Common.TEMPLATE_RESOLVER);
|
||||
/* ============================================================================== */
|
||||
|
||||
public static ServerboundClientInformationPacketHandle createHandle(Object handleInstance) {
|
||||
return T.createHandle(handleInstance);
|
||||
}
|
||||
|
||||
/* ============================================================================== */
|
||||
|
||||
public abstract String getLocale();
|
||||
public abstract void setLocale(String locale);
|
||||
public abstract int getView();
|
||||
public abstract void setView(int view);
|
||||
public abstract Object getChatVisibility();
|
||||
public abstract void setChatVisibility(Object visibility);
|
||||
public abstract boolean getEnableColors();
|
||||
public abstract void setEnableColors(boolean enable);
|
||||
public abstract int getModelPartFlags();
|
||||
public abstract void setModelPartFlags(int flags);
|
||||
public abstract HumanHand getMainHand();
|
||||
public abstract void setMainHand(HumanHand mainHand);
|
||||
/**
|
||||
* Stores class members for <b>net.minecraft.network.protocol.common.ServerboundClientInformationPacket</b>.
|
||||
* Methods, fields, and constructors can be used without using Handle Objects.
|
||||
*/
|
||||
public static final class ServerboundClientInformationPacketClass extends Template.Class<ServerboundClientInformationPacketHandle> {
|
||||
public final Template.Method<String> getLocale = new Template.Method<String>();
|
||||
public final Template.Method<Void> setLocale = new Template.Method<Void>();
|
||||
public final Template.Method<Integer> getView = new Template.Method<Integer>();
|
||||
public final Template.Method<Void> setView = new Template.Method<Void>();
|
||||
public final Template.Method<Object> getChatVisibility = new Template.Method<Object>();
|
||||
public final Template.Method.Converted<Void> setChatVisibility = new Template.Method.Converted<Void>();
|
||||
public final Template.Method<Boolean> getEnableColors = new Template.Method<Boolean>();
|
||||
public final Template.Method<Void> setEnableColors = new Template.Method<Void>();
|
||||
public final Template.Method<Integer> getModelPartFlags = new Template.Method<Integer>();
|
||||
public final Template.Method<Void> setModelPartFlags = new Template.Method<Void>();
|
||||
public final Template.Method.Converted<HumanHand> getMainHand = new Template.Method.Converted<HumanHand>();
|
||||
public final Template.Method.Converted<Void> setMainHand = new Template.Method.Converted<Void>();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-64
@@ -1,64 +0,0 @@
|
||||
package com.bergerkiller.generated.net.minecraft.network.protocol.game;
|
||||
|
||||
import com.bergerkiller.mountiplex.reflection.declarations.Template;
|
||||
import com.bergerkiller.bukkit.common.wrappers.HumanHand;
|
||||
import com.bergerkiller.generated.net.minecraft.network.protocol.PacketHandle;
|
||||
|
||||
/**
|
||||
* Instance wrapper handle for type <b>net.minecraft.network.protocol.game.PacketPlayInSettings</b>.
|
||||
* To access members without creating a handle type, use the static {@link #T} member.
|
||||
* New handles can be created from raw instances using {@link #createHandle(Object)}.
|
||||
*/
|
||||
@Template.InstanceType("net.minecraft.network.protocol.game.PacketPlayInSettings")
|
||||
public abstract class PacketPlayInSettingsHandle extends PacketHandle {
|
||||
/** @see PacketPlayInSettingsClass */
|
||||
public static final PacketPlayInSettingsClass T = Template.Class.create(PacketPlayInSettingsClass.class, com.bergerkiller.bukkit.common.Common.TEMPLATE_RESOLVER);
|
||||
/* ============================================================================== */
|
||||
|
||||
public static PacketPlayInSettingsHandle createHandle(Object handleInstance) {
|
||||
return T.createHandle(handleInstance);
|
||||
}
|
||||
|
||||
/* ============================================================================== */
|
||||
|
||||
|
||||
public HumanHand getMainHand() {
|
||||
if (T.mainHand.isAvailable()) {
|
||||
return T.mainHand.get(getRaw());
|
||||
} else {
|
||||
return HumanHand.RIGHT;
|
||||
}
|
||||
}
|
||||
|
||||
public void setMainHand(HumanHand mainHand) {
|
||||
if (T.mainHand.isAvailable()) {
|
||||
T.mainHand.set(getRaw(), mainHand);
|
||||
}
|
||||
}
|
||||
public abstract String getLocale();
|
||||
public abstract void setLocale(String value);
|
||||
public abstract int getView();
|
||||
public abstract void setView(int value);
|
||||
public abstract Object getChatVisibility();
|
||||
public abstract void setChatVisibility(Object value);
|
||||
public abstract boolean isEnableColors();
|
||||
public abstract void setEnableColors(boolean value);
|
||||
public abstract int getModelPartFlags();
|
||||
public abstract void setModelPartFlags(int value);
|
||||
/**
|
||||
* Stores class members for <b>net.minecraft.network.protocol.game.PacketPlayInSettings</b>.
|
||||
* Methods, fields, and constructors can be used without using Handle Objects.
|
||||
*/
|
||||
public static final class PacketPlayInSettingsClass extends Template.Class<PacketPlayInSettingsHandle> {
|
||||
public final Template.Field<String> locale = new Template.Field<String>();
|
||||
public final Template.Field.Integer view = new Template.Field.Integer();
|
||||
public final Template.Field.Converted<Object> chatVisibility = new Template.Field.Converted<Object>();
|
||||
public final Template.Field.Boolean enableColors = new Template.Field.Boolean();
|
||||
public final Template.Field.Integer modelPartFlags = new Template.Field.Integer();
|
||||
@Template.Optional
|
||||
public final Template.Field.Converted<HumanHand> mainHand = new Template.Field.Converted<HumanHand>();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -692,6 +692,9 @@ public class CommonBootstrap {
|
||||
// Not de-obfuscated
|
||||
remappings.put("net.minecraft.network.protocol.common.ServerboundResourcePackPacket$EnumResourcePackStatus", "net.minecraft.network.protocol.common.ServerboundResourcePackPacket$a");
|
||||
|
||||
// The Named spawn packet was removed and the normal spawn packet can now be used
|
||||
remappings.put("net.minecraft.network.protocol.game.PacketPlayOutNamedEntitySpawn", "net.minecraft.network.protocol.game.PacketPlayOutSpawnEntity");
|
||||
|
||||
// De-obfuscate a ClientboundCustomPayloadPacket implementation used when sending messages using Bukkit API
|
||||
// Spigot devs made this an anonymous Class which is highly annoying if you want to send it yourself
|
||||
Class<?> customPayloadType = null;
|
||||
@@ -728,6 +731,8 @@ public class CommonBootstrap {
|
||||
remappings.put("net.minecraft.network.protocol.common.ServerboundResourcePackPacket$EnumResourcePackStatus", "net.minecraft.network.protocol.game.PacketPlayInResourcePackStatus$EnumResourcePackStatus");
|
||||
remappings.put("net.minecraft.network.protocol.common.ClientboundResourcePackPacket", "net.minecraft.network.protocol.game.PacketPlayOutResourcePackSend");
|
||||
remappings.put("net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket", "net.minecraft.network.protocol.game.PacketPlayOutCustomPayload");
|
||||
remappings.put("net.minecraft.network.protocol.common.ClientboundDisconnectPacket", "net.minecraft.network.protocol.game.PacketPlayOutKickDisconnect");
|
||||
remappings.put("net.minecraft.network.protocol.common.ServerboundClientInformationPacket", "net.minecraft.network.protocol.game.PacketPlayInSettings");
|
||||
}
|
||||
|
||||
// There have been various locations where starlight was installed
|
||||
|
||||
@@ -61,7 +61,7 @@ public class PacketType extends ClassTemplate<Object> {
|
||||
public static final NMSPacketPlayOutGameStateChange OUT_GAME_STATE_CHANGE = new NMSPacketPlayOutGameStateChange();
|
||||
public static final NMSPacketPlayOutHeldItemSlot OUT_HELD_ITEM_SLOT = new NMSPacketPlayOutHeldItemSlot();
|
||||
public static final NMSClientboundKeepAlivePacket OUT_KEEP_ALIVE = new NMSClientboundKeepAlivePacket();
|
||||
public static final NMSPacketPlayOutKickDisconnect OUT_KICK_DISCONNECT = new NMSPacketPlayOutKickDisconnect();
|
||||
public static final NMSClientboundDisconnectPacket OUT_KICK_DISCONNECT = new NMSClientboundDisconnectPacket();
|
||||
public static final NMSPacketPlayOutLogin OUT_LOGIN = new NMSPacketPlayOutLogin();
|
||||
public static final NMSPacketPlayOutMap OUT_MAP = new NMSPacketPlayOutMap();
|
||||
public static final NMSPacketPlayOutMapChunk OUT_MAP_CHUNK = new NMSPacketPlayOutMapChunk();
|
||||
@@ -154,7 +154,7 @@ public class PacketType extends ClassTemplate<Object> {
|
||||
public static final NMSServerboundKeepAlivePacket IN_KEEP_ALIVE = new NMSServerboundKeepAlivePacket();
|
||||
public static final NMSPacketPlayInSpectate IN_SPECTATE = new NMSPacketPlayInSpectate();
|
||||
public static final NMSPacketPlayInSetCreativeSlot IN_SET_CREATIVE_SLOT = new NMSPacketPlayInSetCreativeSlot();
|
||||
public static final NMSPacketPlayInSettings IN_SETTINGS = new NMSPacketPlayInSettings();
|
||||
public static final NMSServerboundClientInformationPacket IN_SETTINGS = new NMSServerboundClientInformationPacket();
|
||||
public static final NMSPacketPlayInSteerVehicle IN_STEER_VEHICLE = new NMSPacketPlayInSteerVehicle();
|
||||
public static final NMSPacketPlayInTabComplete IN_TAB_COMPLETE = new NMSPacketPlayInTabComplete();
|
||||
public static final NMSPacketPlayInTeleportAccept IN_TELEPORT_ACCEPT = new NMSPacketPlayInTeleportAccept();
|
||||
|
||||
+75
-9
@@ -417,14 +417,80 @@ public class NMSPacketClasses {
|
||||
public final FieldAccessor<ItemStack> item = PacketPlayInSetCreativeSlotHandle.T.item.toFieldAccessor();
|
||||
}
|
||||
|
||||
public static class NMSPacketPlayInSettings extends NMSPacket {
|
||||
public static class NMSServerboundClientInformationPacket extends NMSPacket {
|
||||
|
||||
public final FieldAccessor<String> locale = PacketPlayInSettingsHandle.T.locale.toFieldAccessor();
|
||||
public final FieldAccessor<Integer> view = PacketPlayInSettingsHandle.T.view.toFieldAccessor();
|
||||
public final FieldAccessor<Object> chatVisibility = PacketPlayInSettingsHandle.T.chatVisibility.toFieldAccessor();
|
||||
public final FieldAccessor<Boolean> enableColors = PacketPlayInSettingsHandle.T.enableColors.toFieldAccessor();
|
||||
public final FieldAccessor<Integer> modelPartFlags = PacketPlayInSettingsHandle.T.modelPartFlags.toFieldAccessor();
|
||||
public final FieldAccessor<HumanHand> mainHand = PacketPlayInSettingsHandle.T.mainHand.toFieldAccessor().ignoreInvalid(HumanHand.RIGHT);
|
||||
public final FieldAccessor<String> locale = new SafeDirectField<String>() {
|
||||
@Override
|
||||
public String get(Object instance) {
|
||||
return ServerboundClientInformationPacketHandle.T.getLocale.invoke(instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean set(Object instance, String value) {
|
||||
ServerboundClientInformationPacketHandle.T.setLocale.invoke(instance, value);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
public final FieldAccessor<Integer> view = new SafeDirectField<Integer>() {
|
||||
@Override
|
||||
public Integer get(Object instance) {
|
||||
return ServerboundClientInformationPacketHandle.T.getView.invoke(instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean set(Object instance, Integer value) {
|
||||
ServerboundClientInformationPacketHandle.T.setView.invoke(instance, value);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
public final FieldAccessor<Object> chatVisibility = new SafeDirectField<Object>() {
|
||||
@Override
|
||||
public Object get(Object instance) {
|
||||
return ServerboundClientInformationPacketHandle.T.getChatVisibility.invoke(instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean set(Object instance, Object value) {
|
||||
ServerboundClientInformationPacketHandle.T.setChatVisibility.invoke(instance, value);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
public final FieldAccessor<Boolean> enableColors = new SafeDirectField<Boolean>() {
|
||||
@Override
|
||||
public Boolean get(Object instance) {
|
||||
return ServerboundClientInformationPacketHandle.T.getEnableColors.invoke(instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean set(Object instance, Boolean value) {
|
||||
ServerboundClientInformationPacketHandle.T.setEnableColors.invoke(instance, value);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
public final FieldAccessor<Integer> modelPartFlags = new SafeDirectField<Integer>() {
|
||||
@Override
|
||||
public Integer get(Object instance) {
|
||||
return ServerboundClientInformationPacketHandle.T.getModelPartFlags.invoke(instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean set(Object instance, Integer value) {
|
||||
ServerboundClientInformationPacketHandle.T.setModelPartFlags.invoke(instance, value);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
public final FieldAccessor<HumanHand> mainHand = new SafeDirectField<HumanHand>() {
|
||||
@Override
|
||||
public HumanHand get(Object instance) {
|
||||
return ServerboundClientInformationPacketHandle.T.getMainHand.invoke(instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean set(Object instance, HumanHand value) {
|
||||
ServerboundClientInformationPacketHandle.T.setMainHand.invoke(instance, value);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static class NMSPacketPlayInSpectate extends NMSPacket {
|
||||
@@ -1215,9 +1281,9 @@ public class NMSPacketClasses {
|
||||
public final FieldAccessor<Long> key = FieldAccessor.wrapMethods(ClientboundKeepAlivePacketHandle.T.getKey, ClientboundKeepAlivePacketHandle.T.setKey);
|
||||
}
|
||||
|
||||
public static class NMSPacketPlayOutKickDisconnect extends NMSPacket {
|
||||
public static class NMSClientboundDisconnectPacket extends NMSPacket {
|
||||
|
||||
public final FieldAccessor<ChatText> reason = PacketPlayOutKickDisconnectHandle.T.reason.toFieldAccessor();
|
||||
public final FieldAccessor<ChatText> reason = ClientboundDisconnectPacketHandle.T.reason.toFieldAccessor();
|
||||
}
|
||||
|
||||
public static class NMSPacketPlayOutLogin extends NMSPacket {
|
||||
|
||||
+89
@@ -5,8 +5,11 @@ import net.minecraft.network.chat.IChatBaseComponent;
|
||||
import net.minecraft.network.PacketDataSerializer;
|
||||
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
|
||||
import net.minecraft.network.protocol.common.custom.BukkitCustomPayload;
|
||||
import net.minecraft.server.level.ClientInformation;
|
||||
import net.minecraft.world.entity.player.EnumChatVisibility;
|
||||
|
||||
import com.bergerkiller.bukkit.common.wrappers.ChatText;
|
||||
import com.bergerkiller.bukkit.common.wrappers.HumanHand;
|
||||
|
||||
import com.bergerkiller.generated.net.minecraft.network.protocol.common.ClientboundKeepAlivePacketHandle;
|
||||
import com.bergerkiller.generated.net.minecraft.network.protocol.common.ClientboundCustomPayloadPacketHandle;
|
||||
@@ -214,3 +217,89 @@ class ClientboundCustomPayloadPacket extends Packet {
|
||||
}
|
||||
</code>
|
||||
}
|
||||
|
||||
class ClientboundDisconnectPacket extends Packet {
|
||||
#if version >= 1.17
|
||||
private (ChatText) IChatBaseComponent reason;
|
||||
#else
|
||||
private (ChatText) IChatBaseComponent reason:a;
|
||||
#endif
|
||||
}
|
||||
|
||||
class ServerboundClientInformationPacket extends Packet {
|
||||
#if version >= 1.20.2
|
||||
#require ServerboundClientInformationPacket public ClientInformation information();
|
||||
#else
|
||||
#require ServerboundClientInformationPacket public ServerboundClientInformationPacket information() {
|
||||
return instance;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if version >= 1.20.2
|
||||
#require ClientInformation private String locale:language;
|
||||
#elseif version >= 1.17
|
||||
#require ServerboundClientInformationPacket public String locale:language;
|
||||
#elseif version >= 1.16
|
||||
#require ServerboundClientInformationPacket public String locale;
|
||||
#else
|
||||
#require ServerboundClientInformationPacket private String locale:a;
|
||||
#endif
|
||||
public String getLocale() { return instance#information()#locale; }
|
||||
public void setLocale(String locale) { return instance#information()#locale = locale; }
|
||||
|
||||
#if version >= 1.20.2
|
||||
#require ClientInformation private int view:viewDistance;
|
||||
#elseif version >= 1.17
|
||||
#require ServerboundClientInformationPacket public int view:viewDistance;
|
||||
#elseif fieldexists net.minecraft.network.protocol.game.PacketPlayInSettings public int viewDistance
|
||||
#require ServerboundClientInformationPacket public int view:viewDistance;
|
||||
#else
|
||||
#require ServerboundClientInformationPacket private int view:b;
|
||||
#endif
|
||||
public int getView() { return instance#information()#view; }
|
||||
public void setView(int view) { instance#information()#view = view; }
|
||||
|
||||
#if version >= 1.20.2
|
||||
#require ClientInformation private EnumChatVisibility chatVisibility;
|
||||
#require ClientInformation private boolean enableColors:chatColors;
|
||||
#require ClientInformation private int modelPartFlags:modelCustomisation;
|
||||
#elseif version >= 1.17
|
||||
#require ServerboundClientInformationPacket private EnumChatVisibility chatVisibility;
|
||||
#require ServerboundClientInformationPacket private boolean enableColors:chatColors;
|
||||
#require ServerboundClientInformationPacket private int modelPartFlags:modelCustomisation;
|
||||
#else
|
||||
#require ServerboundClientInformationPacket private EnumChatVisibility chatVisibility:c;
|
||||
#require ServerboundClientInformationPacket private boolean enableColors:d;
|
||||
#require ServerboundClientInformationPacket private int modelPartFlags:e;
|
||||
#endif
|
||||
public (Object) EnumChatVisibility getChatVisibility() { return instance#information()#chatVisibility; }
|
||||
public void setChatVisibility((Object) EnumChatVisibility visibility) { instance#information()#chatVisibility = visibility; }
|
||||
public boolean getEnableColors() { return instance#information()#enableColors; }
|
||||
public void setEnableColors(boolean enable) { instance#information()#enableColors = enable; }
|
||||
public int getModelPartFlags() { return instance#information()#modelPartFlags; }
|
||||
public void setModelPartFlags(int flags) { instance#information()#modelPartFlags = flags; }
|
||||
|
||||
//TODO: textFilteringEnabled
|
||||
|
||||
#if version >= 1.20.2
|
||||
#require ClientInformation private net.minecraft.world.entity.EnumMainHand mainHand;
|
||||
#elseif version >= 1.17
|
||||
#require ServerboundClientInformationPacket private net.minecraft.world.entity.EnumMainHand mainHand;
|
||||
#elseif version >= 1.9
|
||||
#require ServerboundClientInformationPacket private net.minecraft.world.entity.EnumMainHand mainHand:f;
|
||||
#endif
|
||||
|
||||
public (HumanHand) net.minecraft.world.entity.EnumMainHand getMainHand() {
|
||||
#if version >= 1.9
|
||||
return instance#information()#mainHand;
|
||||
#else
|
||||
return HumanHand.RIGHT;
|
||||
#endif
|
||||
}
|
||||
|
||||
public void setMainHand((HumanHand) net.minecraft.world.entity.EnumMainHand mainHand) {
|
||||
#if version >= 1.9
|
||||
instance#information()#mainHand = mainHand;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
-57
@@ -22,7 +22,6 @@ import net.minecraft.world.EnumDifficulty;
|
||||
import net.minecraft.world.EnumHand;
|
||||
import net.minecraft.world.effect.MobEffect;
|
||||
import net.minecraft.world.effect.MobEffectList;
|
||||
import net.minecraft.world.entity.player.EnumChatVisibility;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.RelativeMovement;
|
||||
import net.minecraft.world.item.Item;
|
||||
@@ -2054,54 +2053,6 @@ optional class PacketPlayOutSetCooldown extends Packet {
|
||||
#endif
|
||||
}
|
||||
|
||||
class PacketPlayInSettings extends Packet {
|
||||
#if version >= 1.17
|
||||
public String locale:language;
|
||||
#elseif version >= 1.16
|
||||
public String locale;
|
||||
#else
|
||||
private String locale:a;
|
||||
#endif
|
||||
|
||||
#if version >= 1.17
|
||||
public int view:viewDistance;
|
||||
#elseif fieldexists net.minecraft.network.protocol.game.PacketPlayInSettings public int viewDistance
|
||||
public int view:viewDistance;
|
||||
#else
|
||||
private int view:b;
|
||||
#endif
|
||||
|
||||
#if version >= 1.17
|
||||
private (Object) EnumChatVisibility chatVisibility;
|
||||
private boolean enableColors:chatColors;
|
||||
private int modelPartFlags:modelCustomisation;
|
||||
private optional (HumanHand) net.minecraft.world.entity.EnumMainHand mainHand;
|
||||
#else
|
||||
private (Object) EnumChatVisibility chatVisibility:c;
|
||||
private boolean enableColors:d;
|
||||
private int modelPartFlags:e;
|
||||
private optional (HumanHand) net.minecraft.world.entity.EnumMainHand mainHand:f;
|
||||
#endif
|
||||
|
||||
//TODO: textFilteringEnabled
|
||||
|
||||
<code>
|
||||
public HumanHand getMainHand() {
|
||||
if (T.mainHand.isAvailable()) {
|
||||
return T.mainHand.get(getRaw());
|
||||
} else {
|
||||
return HumanHand.RIGHT;
|
||||
}
|
||||
}
|
||||
|
||||
public void setMainHand(HumanHand mainHand) {
|
||||
if (T.mainHand.isAvailable()) {
|
||||
T.mainHand.set(getRaw(), mainHand);
|
||||
}
|
||||
}
|
||||
</code>
|
||||
}
|
||||
|
||||
// Changed completely on MC 1.13
|
||||
// class PacketPlayInTabComplete extends Packet {
|
||||
// private String text:a;
|
||||
@@ -2602,14 +2553,6 @@ class PacketPlayOutWorldParticles extends Packet {
|
||||
#endif
|
||||
}
|
||||
|
||||
class PacketPlayOutKickDisconnect extends Packet {
|
||||
#if version >= 1.17
|
||||
private (ChatText) IChatBaseComponent reason;
|
||||
#else
|
||||
private (ChatText) IChatBaseComponent reason:a;
|
||||
#endif
|
||||
}
|
||||
|
||||
class PacketPlayOutBlockChange extends Packet {
|
||||
#if version >= 1.17
|
||||
private final (IntVector3) BlockPosition position:pos;
|
||||
|
||||
+5
-1
@@ -284,8 +284,12 @@ class PacketPlayOutSpawnEntity extends Packet {
|
||||
</code>
|
||||
}
|
||||
|
||||
// Note: since MC 1.20.2 this is identical to PacketPlayOutSpawnEntity
|
||||
class PacketPlayOutNamedEntitySpawn extends Packet {
|
||||
#if version >= 1.17
|
||||
#if version >= 1.20.2
|
||||
private int entityId:id;
|
||||
private UUID entityUUID:uuid;
|
||||
#elseif version >= 1.17
|
||||
private int entityId;
|
||||
private UUID entityUUID:playerId;
|
||||
#else
|
||||
|
||||
Reference in new issue
Block a user