Skip to content

Commit

Permalink
Fix 1.14 item lore and version is now 1.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Exceptionflug committed Apr 27, 2019
1 parent 21f2f31 commit b88ef89
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 40 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@ This is the full portfolio of protocolize dependencies:
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-api</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-items</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-inventory</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-world</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
```
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
<packaging>pom</packaging>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion protocolize-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
Expand Down
8 changes: 4 additions & 4 deletions protocolize-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
Expand All @@ -18,19 +18,19 @@
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-api</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-items</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-inventory</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
6 changes: 3 additions & 3 deletions protocolize-inventory/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-inventory</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-api</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
6 changes: 3 additions & 3 deletions protocolize-items/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<plugin>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-protogen-plugin</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
<executions>
<execution>
<phase>generate-sources</phase>
Expand All @@ -33,12 +33,12 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-items</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ private void setLoreTag(final List<String> lore, final int protocolVersion) {
display.getValue().put(tag);
nbtdata.getValue().put(display);
} else {
final ListTag<StringTag> tag = new ListTag<>("Lore", StringTag.class, lore.stream().map(i -> new StringTag(String.valueOf(ThreadLocalRandom.current().nextLong()), ComponentSerializer.toString(TextComponent.fromLegacyText(i)))).collect(Collectors.toList()));
display.getValue().put(tag);
nbtdata.getValue().put(display);
}
}

Expand Down Expand Up @@ -208,7 +211,7 @@ public static ItemStack read(final ByteBuf buf, final int protocolVersion) {
} else {
displayName = getDisplayNameTag(tag);
}
loreOut = getLoreTag(tag);
loreOut = getLoreTag(tag, protocolVersion);
final ItemStack out = new ItemStack(null, amount, durability);
out.homebrew = false;
out.displayName = displayName;
Expand Down Expand Up @@ -313,7 +316,7 @@ private static String getDisplayNameTag(final CompoundTag nbtdata) {
return name.getValue();
}

private static List<String> getLoreTag(final CompoundTag nbtdata) {
private static List<String> getLoreTag(final CompoundTag nbtdata, final int protocolVersion) {
if (nbtdata == null)
return null;
final CompoundTag display = (CompoundTag) nbtdata.getValue().get("display");
Expand All @@ -324,7 +327,11 @@ private static List<String> getLoreTag(final CompoundTag nbtdata) {
if (lore == null) {
return null;
}
return lore.getValue().stream().map(StringTag::getValue).collect(Collectors.toList());
if(protocolVersion < MINECRAFT_1_14) {
return lore.getValue().stream().map(StringTag::getValue).collect(Collectors.toList());
} else {
return lore.getValue().stream().map(it -> new TextComponent(it.getValue()).toLegacyText()).collect(Collectors.toList());
}
}

public List<String> getLore() {
Expand Down
12 changes: 6 additions & 6 deletions protocolize-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-plugin</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>

<properties>
<plugin.main>de.exceptionflug.protocolize.ProtocolizePlugin</plugin.main>
Expand All @@ -23,22 +23,22 @@
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-api</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-items</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-world</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-inventory</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
</dependency>
</dependencies>

Expand Down
4 changes: 2 additions & 2 deletions protocolize-protogen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-protogen</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
Expand Down
6 changes: 3 additions & 3 deletions protocolize-protogen/protocolize-protogen-compiler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-protogen</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-protogen-compiler</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>

<build>
<plugins>
Expand Down Expand Up @@ -45,7 +45,7 @@
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-api</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
6 changes: 3 additions & 3 deletions protocolize-protogen/protocolize-protogen-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-protogen</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-protogen-plugin</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
<packaging>maven-plugin</packaging>

<build>
Expand Down Expand Up @@ -52,7 +52,7 @@
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-protogen-compiler</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
</dependency>
</dependencies>

Expand Down
10 changes: 5 additions & 5 deletions protocolize-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-util</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>

<dependencies>
<dependency>
Expand All @@ -36,17 +36,17 @@
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-api</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-world</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-items</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
</dependency>
</dependencies>

Expand Down
4 changes: 2 additions & 2 deletions protocolize-world/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
<parent>
<groupId>de.exceptionflug</groupId>
<artifactId>protocolize</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>
</parent>

<groupId>de.exceptionflug</groupId>
<artifactId>protocolize-world</artifactId>
<version>1.4.0-SNAPSHOT</version>
<version>1.4.1-SNAPSHOT</version>

<dependencies>
<dependency>
Expand Down

0 comments on commit b88ef89

Please sign in to comment.