Skip to content

Commit

Permalink
Add 1.14 support! Update version to 1.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
MinusKube committed Jul 15, 2019
1 parent 50b6fdd commit 499fcc2
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 25 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Scoreboard API for your Minecraft Sponge and Bukkit Plugins.
**You can use this as a Plugin, or just add it to your dependencies.**

## Features:
- Works for all the **Bukkit** versions since **1.7** (even **1.13**!).
- Works for all the **Bukkit** versions since **1.7** (even **1.14**!).
- Works with **Sponge**! (Tell me if a version is not compatible)
- No blinking!
- Max characters per line:
Expand Down Expand Up @@ -70,10 +70,10 @@ repositories {
}
dependencies {
compile 'fr.minuskube:netherboard-bukkit:1.1.2'
compile 'fr.minuskube:netherboard-bukkit:1.1.3'
// Or if you use Sponge:
// compile 'fr.minuskube:netherboard-sponge:1.1.2'
// compile 'fr.minuskube:netherboard-sponge:1.1.3'
}
```

Expand All @@ -89,7 +89,7 @@ dependencies {
<artifactId>netherboard-sponge</artifactId>
-->

<version>1.1.2</version>
<version>1.1.3</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ subprojects {
sourceCompatibility = '1.8'

group 'fr.minuskube'
version '1.1.2'
version '1.1.3'

configurations { provided }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,19 +196,11 @@ private void sendScore(Objective obj, String name, int score, boolean remove) {
break;
}

case "1.13": {
Object packet = NMS.PACKET_SCORE.newInstance(
remove ? NMS.ENUM_SCORE_ACTION_REMOVE : NMS.ENUM_SCORE_ACTION_CHANGE,
obj.getName(),
name,
score
);

NMS.sendPacket(packet, player);
break;
}

default: {
case "1.8":
case "1.9":
case "1.10":
case "1.11":
case "1.12": {
Object packet;

if(remove) {
Expand All @@ -226,6 +218,18 @@ private void sendScore(Objective obj, String name, int score, boolean remove) {
NMS.sendPacket(packet, player);
break;
}

default: {
Object packet = NMS.PACKET_SCORE.newInstance(
remove ? NMS.ENUM_SCORE_ACTION_REMOVE : NMS.ENUM_SCORE_ACTION_CHANGE,
obj.getName(),
name,
score
);

NMS.sendPacket(packet, player);
break;
}
}
} catch(InstantiationException | IllegalAccessException
| InvocationTargetException | NoSuchMethodException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,21 @@ public class NMS {
case "1.7":
packetScore = packetScoreClass.getConstructor(scoreClass, int.class);
break;
case "1.13":
case "1.8":
case "1.9":
case "1.10":
case "1.11":
case "1.12":
packetScore = packetScoreClass.getConstructor(scoreClass);
packetScoreRemove = packetScoreClass.getConstructor(String.class, objClass);
break;
default:
packetScore = packetScoreClass.getConstructor(scoreActionClass,
String.class, String.class, int.class);

enumScoreActionChange = scoreActionClass.getEnumConstants()[0];
enumScoreActionRemove = scoreActionClass.getEnumConstants()[1];
break;
default:
packetScore = packetScoreClass.getConstructor(scoreClass);
packetScoreRemove = packetScoreClass.getConstructor(String.class, objClass);
break;
}

packetDisplay = packetDisplayClass.getConstructor(int.class, objClass);
Expand Down
2 changes: 1 addition & 1 deletion bukkit/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Netherboard
version: 1.1.2
version: 1.1.3
description: Scoreboard API for your Bukkit Plugins.
author: MinusKube
website: https://github.com/MinusKube/netherboard
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
description = "Scoreboard API for your Sponge Plugins.",
authors = "MinusKube",
url = "https://github.com/MinusKube/netherboard",
version = "1.1.2")
version = "1.1.3")
public class NetherboardPlugin {}

0 comments on commit 499fcc2

Please sign in to comment.