Skip to content

Commit eb2b1cc

Browse files
committed
fix: replace incorrect usages of MAJOR_VERSION instead of MAJOR_VERSION
1 parent 7502272 commit eb2b1cc

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayClientSetJigsaw.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public void setAttachmentType(MinecraftKey value) {
131131
* @return The current Target pool
132132
*/
133133
public MinecraftKey getTargetPool() {
134-
return handle.getMinecraftKeys().read(MAJOR_VERSION >= 16 ? 2 : 1);
134+
return handle.getMinecraftKeys().read(MINOR_VERSION >= 16 ? 2 : 1);
135135
}
136136

137137
/**
@@ -140,7 +140,7 @@ public MinecraftKey getTargetPool() {
140140
* @param value - new value.
141141
*/
142142
public void setTargetPool(MinecraftKey value) {
143-
handle.getMinecraftKeys().write(MAJOR_VERSION >= 16 ? 2 : 1, value);
143+
handle.getMinecraftKeys().write(MINOR_VERSION >= 16 ? 2 : 1, value);
144144
}
145145

146146
/**

PacketWrapper/src/main/java/com/comphenix/packetwrapper/WrapperPlayServerSpawnEntityExperienceOrb.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public Entity getEntity(PacketEvent event) {
8585
* @return The current X
8686
*/
8787
public double getX() {
88-
return MAJOR_VERSION >= 9 ? handle.getDoubles().read(0) : handle.getIntegers().read(1) / 32D;
88+
return MINOR_VERSION >= 9 ? handle.getDoubles().read(0) : handle.getIntegers().read(1) / 32D;
8989
}
9090

9191
/**
@@ -94,7 +94,7 @@ public double getX() {
9494
* @param value - new value.
9595
*/
9696
public void setX(double value) {
97-
if (MAJOR_VERSION >= 9) handle.getDoubles().write(0, value);
97+
if (MINOR_VERSION >= 9) handle.getDoubles().write(0, value);
9898
else handle.getIntegers().write(1, ConversionUtil.floor(value * 32));
9999
}
100100

@@ -106,7 +106,7 @@ public void setX(double value) {
106106
* @return The current y
107107
*/
108108
public double getY() {
109-
return MAJOR_VERSION >= 9 ? handle.getDoubles().read(1) : handle.getIntegers().read(2) / 32D;
109+
return MINOR_VERSION >= 9 ? handle.getDoubles().read(1) : handle.getIntegers().read(2) / 32D;
110110
}
111111

112112
/**
@@ -115,7 +115,7 @@ public double getY() {
115115
* @param value - new value.
116116
*/
117117
public void setY(double value) {
118-
if (MAJOR_VERSION >= 9) handle.getDoubles().write(1, value);
118+
if (MINOR_VERSION >= 9) handle.getDoubles().write(1, value);
119119
else handle.getIntegers().write(2, ConversionUtil.floor(value * 32));
120120
}
121121

@@ -127,7 +127,7 @@ public void setY(double value) {
127127
* @return The current z
128128
*/
129129
public double getZ() {
130-
return MAJOR_VERSION >= 9 ? handle.getDoubles().read(2) : handle.getIntegers().read(3) / 32D;
130+
return MINOR_VERSION >= 9 ? handle.getDoubles().read(2) : handle.getIntegers().read(3) / 32D;
131131
}
132132

133133
/**
@@ -136,7 +136,7 @@ public double getZ() {
136136
* @param value - new value.
137137
*/
138138
public void setZ(double value) {
139-
if (MAJOR_VERSION >= 9) handle.getDoubles().write(2, value);
139+
if (MINOR_VERSION >= 9) handle.getDoubles().write(2, value);
140140
else handle.getIntegers().write(3, ConversionUtil.floor(value * 32));
141141
}
142142

@@ -148,7 +148,7 @@ public void setZ(double value) {
148148
* @return The current Count
149149
*/
150150
public int getCount() {
151-
return handle.getIntegers().read(MAJOR_VERSION >= 9 ? 1 : 4);
151+
return handle.getIntegers().read(MINOR_VERSION >= 9 ? 1 : 4);
152152
}
153153

154154
/**
@@ -157,6 +157,6 @@ public int getCount() {
157157
* @param value - new value.
158158
*/
159159
public void setCount(int value) {
160-
handle.getIntegers().write(MAJOR_VERSION >= 9 ? 1 : 4, value);
160+
handle.getIntegers().write(MINOR_VERSION >= 9 ? 1 : 4, value);
161161
}
162162
}

0 commit comments

Comments
 (0)