Skip to content

Commit

Permalink
fix dependency versioning/fix ench short tags
Browse files Browse the repository at this point in the history
  • Loading branch information
ds58 committed Mar 17, 2019
1 parent 2b6f0c5 commit 367b047
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
public class NbtCheck_CanDestroy extends NbtCheck {

public NbtCheck_CanDestroy() {
super("CanDestroy", PStrictness.AVERAGE);
super("CanDestroy", PStrictness.STRICT);
}

@Override
public boolean check(INbtTagCompound tag, String nmsItemClassName, IProtocolConstants protocolConstants, PConfig config) {
return true;
return false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
public class NbtCheck_CanPlaceOn extends NbtCheck {

public NbtCheck_CanPlaceOn() {
super("CanPlaceOn", PStrictness.AVERAGE);
super("CanPlaceOn", PStrictness.STRICT);
}

@Override
public boolean check(INbtTagCompound tag, String nmsItemClassName, IProtocolConstants protocolConstants, PConfig config) {
return true;
return false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ public boolean check(INbtTagCompound tag, String nmsItemClassName, IProtocolCons
INbtTagCompound enchantment = enchantments.get(i);
Enchantment bukkitEnchantment = getEnchantment(enchantment);

if (bukkitEnchantment == null) return true;
if (bukkitEnchantment == null) {
continue;
}

int lvl = 0xFFFF & enchantments.get(i).getShort("lvl");

Expand All @@ -64,7 +66,7 @@ public boolean check(INbtTagCompound tag, String nmsItemClassName, IProtocolCons
}

private static Enchantment getEnchantment(INbtTagCompound enchantment) {
if (enchantment.hasKeyOfType("id", NbtDataType.INT)) {
if (enchantment.hasKeyOfType("id", NbtDataType.INT) || enchantment.hasKeyOfType("id", NbtDataType.SHORT)) {
final int id = enchantment.getInt("id");

try {
Expand Down
6 changes: 3 additions & 3 deletions plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@
<dependency>
<groupId>com.ruinscraft</groupId>
<artifactId>panilla-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.ruinscraft</groupId>
<artifactId>panilla-v1_12_R1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.ruinscraft</groupId>
<artifactId>panilla-v1_13_R2</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion v1_12_R1/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<dependency>
<groupId>com.ruinscraft</groupId>
<artifactId>panilla-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion v1_13_R2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<dependency>
<groupId>com.ruinscraft</groupId>
<artifactId>panilla-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down

0 comments on commit 367b047

Please sign in to comment.