Skip to content

Commit

Permalink
Fixed packet fields not found
Browse files Browse the repository at this point in the history
  • Loading branch information
funkemunky committed Mar 2, 2020
1 parent c66e57d commit d2c2b28
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class MinecraftReflection {
public static WrappedClass serverConnection = Reflections.getNMSClass("ServerConnection");
private static WrappedClass gameProfile = Reflections.getClass("com.mojang.authlib.GameProfile");
private static WrappedClass propertyMap = Reflections.getClass("com.mojang.authlib.properties.PropertyMap");
public static WrappedClass iChatBaseComponent = Reflections.getNMSClass("IChatBaseComponent");

private static WrappedMethod getProfile = CraftReflection.craftPlayer.getMethod("getProfile");
private static WrappedMethod getProperties = gameProfile.getMethod("getProperties");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cc.funkemunky.api.tinyprotocol.packet.out;

import cc.funkemunky.api.reflections.impl.MinecraftReflection;
import cc.funkemunky.api.tinyprotocol.api.NMSObject;
import cc.funkemunky.api.tinyprotocol.api.ProtocolVersion;
import cc.funkemunky.api.tinyprotocol.packet.types.WrappedChatMessage;
Expand All @@ -22,7 +23,8 @@ public WrappedOutOpenWindow(int id, String name, WrappedChatMessage msg, int siz

private static FieldAccessor<Integer> idField = fetchField(packet, int.class, 0);
private static FieldAccessor<String> nameField = fetchField(packet, String.class, 0);
private static FieldAccessor<Object> chatCompField = fetchField(packet, Object.class, 1);
private static FieldAccessor<Object> chatCompField = fetchField(packet,
MinecraftReflection.iChatBaseComponent.getParent(), 0);
private static FieldAccessor<Integer> inventorySize = fetchField(packet, int.class, 1);

private int id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class WrappedChatMessage extends NMSObject {
private String chatMessage;
private Object[] objects;

private static WrappedClass chatMessageClass = Reflections.getClass(type);
private static WrappedClass chatMessageClass = Reflections.getNMSClass("ChatMessage");
private static WrappedField messageField = chatMessageClass.getFieldByType(String.class, 0);
private static WrappedField objectsField = chatMessageClass.getFieldByType(Object[].class, 0);

Expand Down
4 changes: 2 additions & 2 deletions AtlasParent/AtlasBungee/buildNumber.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file
#Fri Feb 28 10:55:49 EST 2020
buildNumber=812
#Mon Mar 02 06:23:00 EST 2020
buildNumber=813

0 comments on commit d2c2b28

Please sign in to comment.