@@ -40,11 +40,7 @@ public PacketAbstract(Object packet, Cancellable cancellable, ChannelWrapper cha
4040 * @param value Value to be assigned to the field
4141 */
4242 public void setPacketValue (String field , Object value ) {
43- try {
44- fieldResolver .resolve (field ).set (getPacket (), value );
45- } catch (Exception e ) {
46- throw new RuntimeException (e );
47- }
43+ fieldResolver .resolveAccessor (field ).set (getPacket (), value );
4844 }
4945
5046 /**
@@ -55,7 +51,7 @@ public void setPacketValue(String field, Object value) {
5551 */
5652 public void setPacketValueSilent (String field , Object value ) {
5753 try {
58- fieldResolver . resolve (field ). set ( getPacket () , value );
54+ setPacketValue (field , value );
5955 } catch (Exception e ) {
6056 }
6157 }
@@ -68,7 +64,7 @@ public void setPacketValueSilent(String field, Object value) {
6864 */
6965 public void setPacketValue (int index , Object value ) {
7066 try {
71- fieldResolver .resolveIndex (index ).set (getPacket (), value );
67+ fieldResolver .resolveIndexAccessor (index ).set (getPacket (), value );
7268 } catch (Exception e ) {
7369 throw new RuntimeException (e );
7470 }
@@ -82,7 +78,7 @@ public void setPacketValue(int index, Object value) {
8278 */
8379 public void setPacketValueSilent (int index , Object value ) {
8480 try {
85- fieldResolver . resolveIndex (index ). set ( getPacket () , value );
81+ setPacketValue (index , value );
8682 } catch (Exception e ) {
8783 }
8884 }
@@ -94,11 +90,7 @@ public void setPacketValueSilent(int index, Object value) {
9490 * @return current value of the field
9591 */
9692 public Object getPacketValue (String field ) {
97- try {
98- return fieldResolver .resolve (field ).get (getPacket ());
99- } catch (Exception e ) {
100- throw new RuntimeException (e );
101- }
93+ return fieldResolver .resolveAccessor (field ).get (getPacket ());
10294 }
10395
10496 /**
@@ -109,7 +101,7 @@ public Object getPacketValue(String field) {
109101 */
110102 public Object getPacketValueSilent (String field ) {
111103 try {
112- return fieldResolver . resolve (field ). get ( getPacket () );
104+ return getPacketValue (field );
113105 } catch (Exception e ) {
114106 }
115107 return null ;
@@ -122,11 +114,7 @@ public Object getPacketValueSilent(String field) {
122114 * @return value of the field
123115 */
124116 public Object getPacketValue (int index ) {
125- try {
126- return fieldResolver .resolveIndex (index ).get (getPacket ());
127- } catch (Exception e ) {
128- throw new RuntimeException (e );
129- }
117+ return fieldResolver .resolveIndexAccessor (index ).get (getPacket ());
130118 }
131119
132120 /**
@@ -137,7 +125,7 @@ public Object getPacketValue(int index) {
137125 */
138126 public Object getPacketValueSilent (int index ) {
139127 try {
140- return fieldResolver . resolveIndex (index ). get ( getPacket () );
128+ return getPacketValue (index );
141129 } catch (Exception e ) {
142130 throw new RuntimeException (e );
143131 }
0 commit comments