Skip to content

Commit c5ffaf6

Browse files
committed
2.8.0 for MC 1.20
1 parent ed4ea4b commit c5ffaf6

4 files changed

Lines changed: 25 additions & 10 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Sentinel NPCs: Combat NPCs for Spigot!
2424

2525
![AnimatedSentinel](https://i.imgur.com/VDwTzrs.gif)
2626

27-
**Version 2.7.3**: Compatible with Spigot 1.8.8 through 1.19.4 (Primarily targeted at 1.19.4) - see 'Common Issues' section below if on older supported versions)
27+
**Version 2.8.0**: Compatible with Spigot 1.8.8 through 1.20.1 (Primarily targeted at 1.20.1) - see 'Common Issues' section below if on older supported versions)
2828

2929
### Downloads
3030

@@ -346,7 +346,7 @@ If you're building a separate plugin you would like to integrate into Sentinel,
346346
<dependency>
347347
<groupId>org.mcmonkey</groupId>
348348
<artifactId>sentinel</artifactId>
349-
<version>2.7.3-SNAPSHOT</version>
349+
<version>2.8.0-SNAPSHOT</version>
350350
<type>jar</type>
351351
<scope>provided</scope>
352352
<exclusions>

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
<groupId>org.mcmonkey</groupId>
88
<artifactId>sentinel</artifactId>
99
<packaging>jar</packaging>
10-
<version>2.7.3-SNAPSHOT</version>
10+
<version>2.8.0-SNAPSHOT</version>
1111
<name>Sentinel</name>
1212
<description>Combat NPCs for Spigot</description>
1313

1414
<properties>
1515
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
16-
<bukkit.version>1.19.4-R0.1-SNAPSHOT</bukkit.version>
17-
<citizens.version>2.0.31-SNAPSHOT</citizens.version>
16+
<bukkit.version>1.20.1-R0.1-SNAPSHOT</bukkit.version>
17+
<citizens.version>2.0.32-SNAPSHOT</citizens.version>
1818
<BUILD_NUMBER>Unknown</BUILD_NUMBER>
1919
</properties>
2020

src/main/java/org/mcmonkey/sentinel/utilities/SentinelNMSHelper.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,15 @@ public static void init() {
4343
nmsLivingEntity = Class.forName("net.minecraft.world.entity.EntityLiving");
4444
String attackStrengthField = null;
4545
boolean isCompat = false;
46-
if (SentinelVersionCompat.v1_19 && !SentinelVersionCompat.vFuture) { // 1.19.4 names
46+
if (SentinelVersionCompat.v1_20 && !SentinelVersionCompat.vFuture) { // 1.20 names
47+
// https://minidigger.github.io/MiniMappingViewer/#/mojang/server/1.20
48+
endermanAngryField = "bV"; // net.minecraft.world.entity.monster.EnderMan#DATA_CREEPY
49+
attackStrengthField = "aQ"; // net.minecraft.world.entity.LivingEntity#attackStrengthTicker
50+
broadcastEffectMethod = "a"; // net.minecraft.world.level.Level#broadcastEntityEvent(Entity,byte)
51+
dataWatcherSet = "a"; // net.minecraft.network.syncher.SynchedEntityData#set
52+
isCompat = true;
53+
}
54+
else if (SentinelVersionCompat.v1_19 && !SentinelVersionCompat.v1_20) { // 1.19.4 names
4755
// https://minidigger.github.io/MiniMappingViewer/#/mojang/server/1.19.4
4856
endermanAngryField = "bU"; // net.minecraft.world.entity.monster.EnderMan#DATA_CREEPY
4957
attackStrengthField = "aO"; // net.minecraft.world.entity.LivingEntity#attackStrengthTicker

src/main/java/org/mcmonkey/sentinel/utilities/SentinelVersionCompat.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,13 @@ public class SentinelVersionCompat {
4949
/**
5050
* Boolean indicating if the server version is >= the named version.
5151
*/
52-
public static final boolean v1_8, v1_9, v1_10, v1_11, v1_12, v1_13, v1_14, v1_15, v1_16, v1_17, v1_18, v1_19, vFuture;
52+
public static final boolean v1_8, v1_9, v1_10, v1_11, v1_12, v1_13, v1_14, v1_15, v1_16, v1_17, v1_18, v1_19, v1_20, vFuture;
5353

5454
static {
5555
String vers = Bukkit.getBukkitVersion(); // Returns in format like: 1.12.2-R0.1-SNAPSHOT
56-
vFuture = vers.startsWith("1.20") || vers.startsWith("1.21") || vers.startsWith("1.22");
57-
v1_19 = vers.startsWith("1.19") || vFuture;
56+
vFuture = vers.startsWith("1.21") || vers.startsWith("1.22") || vers.startsWith("1.23");
57+
v1_20 = vers.startsWith("1.20") || vFuture;
58+
v1_19 = vers.startsWith("1.19") || v1_20;
5859
v1_18 = vers.startsWith("1.18") || v1_19;
5960
v1_17 = vers.startsWith("1.17") || v1_18;
6061
v1_16 = vers.startsWith("1.16") || v1_17;
@@ -193,7 +194,13 @@ public class SentinelVersionCompat {
193194
// ignore: 1.19.2 lacked camels, 1.19.3 lacked sniffers.
194195
}
195196
}
196-
if (v1_19) { // && !v1_20
197+
if (v1_19 && !v1_20) {
198+
SentinelTarget.PASSIVE_MOBS = new SentinelTarget(v1_19_passive(), passiveNames());
199+
SentinelTarget.MOBS = new SentinelTarget(combine(v1_19_passive(), v1_19_monsters()), "MOB");
200+
SentinelTarget.MONSTERS = new SentinelTarget(v1_19_monsters(), "MONSTER");
201+
}
202+
// 1.20 didn't add new mobs
203+
if (v1_20) { // && !v1_21
197204
SentinelTarget.PASSIVE_MOBS = new SentinelTarget(v1_19_passive(), passiveNames());
198205
SentinelTarget.MOBS = new SentinelTarget(combine(v1_19_passive(), v1_19_monsters()), "MOB");
199206
SentinelTarget.MONSTERS = new SentinelTarget(v1_19_monsters(), "MONSTER");

0 commit comments

Comments
 (0)