Skip to content

Commit

Permalink
Starting NecroTempus native support. WIP (#132)
Browse files Browse the repository at this point in the history
* Starting NecroTempus native support.

* Implemented action bar support.

* Implemented BossBar base.

* Now it should work properly

* This constructor should not have any throws inside.

* An added missing method whose wrap the createBossBar

* Now it's accessible

* Cleaning and Organizing
  • Loading branch information
brunoxkk0 authored Aug 5, 2023
1 parent 3aba0ea commit 81fcb90
Show file tree
Hide file tree
Showing 14 changed files with 1,124 additions and 43 deletions.
26 changes: 26 additions & 0 deletions patches/org/bukkit/Bukkit.java.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--- ../src-base/minecraft/org/bukkit/Bukkit.java
+++ ../src-work/minecraft/org/bukkit/Bukkit.java
@@ -11,6 +11,10 @@
import java.util.logging.Logger;

import org.bukkit.Warning.WarningState;
+import org.bukkit.boss.BarColor;
+import org.bukkit.boss.BarFlag;
+import org.bukkit.boss.BarStyle;
+import org.bukkit.boss.BossBar;
import org.bukkit.command.CommandException;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
@@ -747,4 +751,12 @@
public static UnsafeValues getUnsafe() {
return server.getUnsafe();
}
+
+ /**
+ * @see Server#createBossBar(String, BarColor, BarStyle, BarFlag...)
+ */
+ public static BossBar createBossBar(String title, BarColor color, BarStyle style, BarFlag... flags){
+ return server.createBossBar(title, color, style, flags);
+ }
+
}
20 changes: 18 additions & 2 deletions patches/org/bukkit/Server.java.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
--- ../src-base/minecraft/org/bukkit/Server.java
+++ ../src-work/minecraft/org/bukkit/Server.java
@@ -12,11 +12,13 @@
@@ -12,11 +12,17 @@
import java.util.UUID;
import java.util.logging.Logger;

+import net.md_5.bungee.api.chat.BaseComponent;
import org.bukkit.Warning.WarningState;
+import org.bukkit.boss.BarColor;
+import org.bukkit.boss.BarFlag;
+import org.bukkit.boss.BarStyle;
+import org.bukkit.boss.BossBar;
import org.bukkit.command.CommandException;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
Expand All @@ -14,7 +18,7 @@
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.inventory.InventoryType;
@@ -916,4 +918,20 @@
@@ -916,4 +922,32 @@
*/
@Deprecated
UnsafeValues getUnsafe();
Expand All @@ -34,4 +38,16 @@
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+ }
+
+ /**
+ * Creates a boss bar instance to display to players. The progress
+ * defaults to 1.0
+ *
+ * @param title the title of the boss bar
+ * @param color the color of the boss bar
+ * @param style the style of the boss bar
+ * @param flags an optional list of flags to set on the boss bar
+ * @return the created boss bar
+ */
+ BossBar createBossBar(String title, BarColor color, BarStyle style, BarFlag... flags);
}
Loading

0 comments on commit 81fcb90

Please sign in to comment.