Skip to content

Commit 93ce4b5

Browse files
authored
Merge pull request #86 from BentoBoxWorld/develop
Release 2.6.1
2 parents e4d6a1a + 445964b commit 93ce4b5

3 files changed

Lines changed: 26 additions & 21 deletions

File tree

pom.xml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<!-- Do not change unless you want different name for local builds. -->
6666
<build.number>-LOCAL</build.number>
6767
<!-- This allows to change between versions. -->
68-
<build.version>2.6.0</build.version>
68+
<build.version>2.6.1</build.version>
6969

7070
<sonar.projectKey>BentoBoxWorld_Boxed</sonar.projectKey>
7171
<sonar.organization>bentobox-world</sonar.organization>
@@ -172,28 +172,30 @@
172172
<scope>provided</scope>
173173
</dependency>
174174
<!-- Spigot NMS. Used for chunk deletion and pasting. -->
175+
176+
<dependency>
177+
<groupId>org.spigotmc....</groupId>
178+
<artifactId>spigot</artifactId>
179+
<version>1.20.6-R0.1-SNAPSHOT</version>
180+
<scope>provided</scope>
181+
</dependency>
175182
<dependency>
176183
<groupId>org.spigotmc</groupId>
177184
<artifactId>spigot</artifactId>
178185
<version>${spigot.version}</version>
179186
<scope>provided</scope>
180-
</dependency>
187+
</dependency>
181188
<dependency>
182189
<groupId>org.spigotmc.....</groupId>
183190
<artifactId>spigot</artifactId>
184191
<version>1.21-R0.1-SNAPSHOT</version>
185192
<scope>provided</scope>
186193
</dependency>
187-
<dependency>
188-
<groupId>org.spigotmc....</groupId>
189-
<artifactId>spigot</artifactId>
190-
<version>1.20.6-R0.1-SNAPSHOT</version>
191-
<scope>provided</scope>
192-
</dependency>
194+
193195
<dependency>
194196
<groupId>org.spigotmc.</groupId>
195197
<artifactId>spigot</artifactId>
196-
<version>1.20.3-R0.1-SNAPSHOT</version>
198+
<version>1.20.4-R0.1-SNAPSHOT</version>
197199
<scope>provided</scope>
198200
</dependency>
199201
<dependency>

src/main/java/world/bentobox/boxed/nms/AbstractMetaData.java

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,22 @@ protected String getData(TileEntity te, String method, String field) {
2323
if (updatePacketMethod != null) {
2424
// Invoke the method to get the PacketPlayOutTileEntityData object
2525
updatePacketMethod.setAccessible(true);
26-
PacketPlayOutTileEntityData packet = (PacketPlayOutTileEntityData) updatePacketMethod.invoke(te);
27-
28-
// Access the private field for the NBTTagCompound getter in PacketPlayOutTileEntityData
29-
Field fieldC = packet.getClass().getDeclaredField(field);
30-
fieldC.setAccessible(true);
31-
NBTTagCompound nbtTag = (NBTTagCompound) fieldC.get(packet);
32-
33-
return nbtTag.toString(); // This will show what you want
26+
Object object = updatePacketMethod.invoke(te);
27+
PacketPlayOutTileEntityData packet = (PacketPlayOutTileEntityData) object;
28+
//if (object instanceof PacketPlayOutTileEntityData packet) {
29+
// Access the private field for the NBTTagCompound getter in PacketPlayOutTileEntityData
30+
Field fieldC = packet.getClass().getDeclaredField(field);
31+
fieldC.setAccessible(true);
32+
NBTTagCompound nbtTag = (NBTTagCompound) fieldC.get(packet);
33+
34+
return nbtTag.toString(); // This will show what you want
35+
//} else {
36+
// throw new ClassNotFoundException(
37+
// object.getClass().getCanonicalName() + " is not a PacketPlayOutTileEntityData");
38+
//}
3439
}
35-
} catch (NoSuchMethodException e) {
36-
System.out.println("The method '" + method + "' does not exist in the TileEntity class.");
3740
} catch (Exception e) {
41+
System.out.println("The method '" + method + "' does not exist in the TileEntity class.");
3842
e.printStackTrace();
3943
}
4044
return "";

src/main/java/world/bentobox/boxed/nms/v1_20_6_R0_1_SNAPSHOT/GetMetaData.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public String nmsData(Block block) {
1515
Location w = block.getLocation();
1616
CraftWorld cw = (CraftWorld) w.getWorld(); // CraftWorld is NMS one
1717
TileEntity te = cw.getHandle().c_(new BlockPosition(w.getBlockX(), w.getBlockY(), w.getBlockZ()));
18-
19-
return getData(te, "j", "c");
18+
return getData(te, "au_", "tag");
2019
}
2120
}

0 commit comments

Comments
 (0)