File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
module/module-nms-util/src/main/java/taboolib/module/nms Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 48
48
import java .util .concurrent .atomic .AtomicInteger ;
49
49
import java .util .function .Consumer ;
50
50
51
+ import static taboolib .module .nms .MinecraftServerUtilKt .nmsClass ;
51
52
import static taboolib .module .nms .MinecraftServerUtilKt .sendPacket ;
52
53
53
54
/**
@@ -65,6 +66,7 @@ public class NMSGenericImpl extends NMSGeneric {
65
66
private Method getKeyMethod ;
66
67
67
68
public NMSGenericImpl () {
69
+ // 1.13+
68
70
if (MinecraftVersion .INSTANCE .getMajor () >= 5 ) {
69
71
for (Field declaredField : net .minecraft .server .v1_12_R1 .Entity .class .getDeclaredFields ()) {
70
72
if (declaredField .getType ().getSimpleName ().equals ("EntityTypes" )) {
@@ -73,16 +75,19 @@ public NMSGenericImpl() {
73
75
}
74
76
}
75
77
}
78
+ // 1.17+
76
79
if (MinecraftVersion .INSTANCE .getMajor () >= 9 ) {
77
80
try {
81
+ // 1.18+
78
82
if (MinecraftVersion .INSTANCE .getMajor () >= 10 ) {
79
83
Class <?> entityTypes = MinecraftServerUtilKt .nmsClass ("EntityTypes" );
80
84
getKeyMethod = ((Class <?>) entityTypes ).getDeclaredMethod ("a" , entityTypes );
81
85
}
86
+ // 1.20+
82
87
if (MinecraftVersion .INSTANCE .getMajor () >= 12 ) {
83
88
packetPlayOutLightUpdateConstructor = net .minecraft .server .v1_16_R1 .PacketPlayOutLightUpdate .class .getDeclaredConstructor (
84
89
net .minecraft .server .v1_16_R1 .ChunkCoordIntPair .class ,
85
- net . minecraft . world . level . lighting . LevelLightEngine . class ,
90
+ nmsClass ( " LevelLightEngine" ), // class file has wrong version 61.0, should be 52.0
86
91
BitSet .class ,
87
92
BitSet .class
88
93
);
You can’t perform that action at this time.
0 commit comments