Skip to content

Commit 1bb39ba

Browse files
author
lukas81298
committed
prepare 1.20 update
1 parent 82ab803 commit 1bb39ba

File tree

9 files changed

+88
-10
lines changed

9 files changed

+88
-10
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![Javadoc](https://img.shields.io/badge/JavaDoc-Online-green)](https://lukalt.github.io/PacketWrapper/javadocs/apidocs)
55
![GitHub](https://img.shields.io/github/license/lukalt/PacketWrapper)
66
[![ProtocolLib](https://img.shields.io/badge/ProtocolLib-%3E%3D%205.1.0--SNAPSHOT-blue)](https://ci.dmulloy2.net/job/ProtocolLib/645/)
7-
[![ProtocolLib](https://img.shields.io/badge/Minecraft-1.19.4-green)](https://papermc.io/downloads/paper)
7+
[![ProtocolLib](https://img.shields.io/badge/Minecraft-1.20-green)](https://papermc.io/downloads/paper)
88

99
This is an unofficial continuation of PacketWrapper by dmulloy2 and aadnk. The original versions can be found [here](https://github.com/dmulloy2/PacketWrapper) and [here](https://github.com/aadnk/PacketWrapper).
1010

@@ -34,7 +34,7 @@ Then, include the actual dependency
3434
<dependency>
3535
<groupId>com.comphenix.packetwrapper</groupId>
3636
<artifactId>PacketWrapper</artifactId>
37-
<version>1.19.4-2.1.0</version>
37+
<version>1.20-2.2.0</version>
3838
<scope>provided</scope>
3939
</dependency>
4040
</dependencies>
@@ -60,7 +60,7 @@ Then add the actual dependency:
6060
```
6161
dependencies {
6262
...
63-
compile 'com.comphenix.packetwrapper:PacketWrapper:1.19.4-2.1.0'
63+
compile 'com.comphenix.packetwrapper:PacketWrapper:1.20-2.2.0-SNAPSHOT'
6464
}
6565
```
6666

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.comphenix.packetwrapper</groupId>
66
<artifactId>PacketWrapper</artifactId>
7-
<version>1.19.4-2.1.1-SNAPSHOT</version>
7+
<version>1.20-2.1.1-SNAPSHOT</version>
88

99
<name>PacketWrapper</name>
1010

@@ -14,7 +14,7 @@
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515
<junit.version>5.9.2</junit.version>
1616
<mockito.version>4.11.0</mockito.version>
17-
<minecraft.version>1.19.4-R0.1-SNAPSHOT</minecraft.version>
17+
<minecraft.version>1.20-R0.1-SNAPSHOT</minecraft.version>
1818
</properties>
1919

2020
<repositories>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
public class PacketWrapper extends JavaPlugin {
99
@Override
1010
public void onEnable() {
11-
if(!Objects.equals(MinecraftVersion.getCurrentVersion(), MinecraftVersion.FEATURE_PREVIEW_2)) {
12-
this.getLogger().severe("Incompatible version of Minecraft. This version of PacketWrapper is only compatible with Minecraft 1.19.4 but you are using " + MinecraftVersion.getCurrentVersion());
11+
if(!Objects.equals(MinecraftVersion.getCurrentVersion(), MinecraftVersion.FEATURE_PREVIEW_2) && !Objects.equals(MinecraftVersion.getCurrentVersion(), MinecraftVersion.TRAILS_AND_TAILS)) {
12+
this.getLogger().severe("Incompatible version of Minecraft. This version of PacketWrapper is only compatible with Minecraft 1.19.4 and 1.20 but you are using " + MinecraftVersion.getCurrentVersion());
1313
}
1414
}
1515
}

src/main/java/com/comphenix/packetwrapper/wrappers/play/clientbound/WrapperPlayServerLogin.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,4 +384,25 @@ public void setLastDeathLocation(@Nullable Vector3I value) {
384384
this.handle.getOptionals(Vector3I.getConverter()).write(0, Optional.ofNullable(value));
385385
}
386386

387+
388+
389+
/**
390+
* Gets the portal cooldown
391+
* @since 1.20
392+
* @return the number of ticks until the player can use the portal again
393+
*/
394+
public int getPortalCooldown() {
395+
return this.getHandle().getIntegers().read(1);
396+
}
397+
398+
/**
399+
* Sets the portal cooldown
400+
* @since 1.20
401+
* @param value the number of ticks until the player can use the portal again
402+
*/
403+
public void setPortalCooldown(int value) {
404+
this.getHandle().getIntegers().write(1, value);
405+
}
406+
407+
387408
}

src/main/java/com/comphenix/packetwrapper/wrappers/play/clientbound/WrapperPlayServerMultiBlockChange.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,20 @@ public void setStates(WrappedBlockData[] value) {
8080

8181
/**
8282
* Retrieves the value of field 'suppressLightUpdates'
83-
*
83+
* Removed in 1.20
8484
* @return 'suppressLightUpdates'
8585
*/
86+
@Deprecated
8687
public boolean getSuppressLightUpdates() {
8788
return this.handle.getBooleans().read(0);
8889
}
8990

9091
/**
9192
* Sets the value of field 'suppressLightUpdates'
92-
*
93+
* Removed in 1.20
9394
* @param value New value for field 'suppressLightUpdates'
9495
*/
96+
@Deprecated
9597
public void setSuppressLightUpdates(boolean value) {
9698
this.handle.getBooleans().write(0, value);
9799
}

src/main/java/com/comphenix/packetwrapper/wrappers/play/clientbound/WrapperPlayServerOpenSignEditor.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,23 @@ public void setPos(BlockPosition value) {
3838
this.handle.getBlockPositionModifier().write(0, value);
3939
}
4040

41+
42+
/**
43+
* Gets the field front text
44+
* @since 1.20
45+
* @return whether the opened editor is for the front or on the back of the sign
46+
*/
47+
public boolean getIsFrontText() {
48+
return this.handle.getBooleans().read(0);
49+
}
50+
51+
/**
52+
* Sets the field front text
53+
* @since 1.20
54+
* @param value whether the opened editor is for the front or on the back of the sign
55+
*/
56+
public void setIsFrontText(boolean value) {
57+
this.handle.getBooleans().write(0, value);
58+
}
59+
4160
}

src/main/java/com/comphenix/packetwrapper/wrappers/play/clientbound/WrapperPlayServerRespawn.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,4 +234,22 @@ public void setLastDeathLocation(@Nullable Vector3I value) {
234234
this.handle.getOptionals(Vector3I.getConverter()).write(0, Optional.ofNullable(value));
235235
}
236236

237+
/**
238+
* Gets the portal cooldown
239+
* @since 1.20
240+
* @return the number of ticks until the player can use the portal again
241+
*/
242+
public int getPortalCooldown() {
243+
return this.getHandle().getIntegers().read(0);
244+
}
245+
246+
/**
247+
* Sets the portal cooldown
248+
* @since 1.20
249+
* @param value the number of ticks until the player can use the portal again
250+
*/
251+
public void setPortalCooldown(int value) {
252+
this.getHandle().getIntegers().write(0, value);
253+
}
254+
237255
}

src/main/java/com/comphenix/packetwrapper/wrappers/play/serverbound/WrapperPlayClientUpdateSign.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@ public void setPos(BlockPosition value) {
3535
this.handle.getBlockPositionModifier().write(0, value);
3636
}
3737

38+
/**
39+
* Gets the face of the sign to update
40+
* @since 1.20
41+
* @return whether the front (true) or on the back (false) of the sign is updated
42+
*/
43+
public boolean getFrontText() {
44+
return this.handle.getBooleans().read(0);
45+
}
46+
47+
/**
48+
* Sets the face of the sign to update
49+
* @since 1.20
50+
* @param value whether the front (true) or on the back (false) of the sign is updated
51+
*/
52+
public void setFrontText(boolean value) {
53+
this.handle.getBooleans().write(0, value);
54+
}
55+
3856
/**
3957
* Retrieves the value of field 'lines'
4058
*

src/main/resources/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ main: com.comphenix.packetwrapper.PacketWrapper
44
description: Contains wrappers for each packet in Minecraft.
55
authors: [dmulloy2, Comphenix, lukas81298]
66
version: ${project.version}
7-
api-version: 1.19
7+
api-version: 1.20
88

99
depend: [ProtocolLib]

0 commit comments

Comments
 (0)