Skip to content

Commit 56e90f0

Browse files
author
Im-Fran
committed
Fixes
* Fixed debug throwing null exceptions in Titles * Minor Fixes Signed-off-by: fran <[email protected]>
1 parent 0d99993 commit 56e90f0

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

dependency-reduced-pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>xyz.theprogramsrc</groupId>
55
<artifactId>SuperCoreAPI</artifactId>
66
<name>SuperCoreAPI</name>
7-
<version>4.8.1</version>
7+
<version>4.8.2</version>
88
<build>
99
<sourceDirectory>src/main/java</sourceDirectory>
1010
<defaultGoal>clean package</defaultGoal>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>xyz.theprogramsrc</groupId>
88
<artifactId>SuperCoreAPI</artifactId>
9-
<version>4.8.2</version>
9+
<version>4.8.3</version>
1010
<packaging>jar</packaging>
1111

1212
<name>SuperCoreAPI</name>

src/main/java/xyz/theprogramsrc/supercoreapi/spigot/dialog/Dialog.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public abstract class Dialog extends SpigotModule {
3232
*/
3333
public Dialog(Player player){
3434
super(false);
35-
this.debug("Registering and opening dialog to '" + player.getName() + "'");
3635
this.player = player;
3736
this.placeholders = new HashMap<>();
3837
this.openDialog();
@@ -50,13 +49,14 @@ public void openDialog(){
5049
if(this.canClose()){
5150
this.getSuperUtils().sendMessage(this.getPlayer(), Base.DIALOG_HOW_TO_CLOSE.toString());
5251
}
53-
});
52+
this.debug("Opening dialog with title '" + this.getTitle() + "&r'");
5453

55-
if(this.task == null){
56-
this.task = this.getSpigotTasks().runRepeatingTask(0L, 1L, this::sendTitleAndActionbar);
57-
}else{
58-
this.task.start();
59-
}
54+
if(this.task == null){
55+
this.task = this.getSpigotTasks().runRepeatingTask(1L, 1L, this::sendTitleAndActionbar);
56+
}else{
57+
this.task.start();
58+
}
59+
});
6060
}
6161

6262
private void sendTitleAndActionbar() {
@@ -69,7 +69,7 @@ private void sendTitleAndActionbar() {
6969
*/
7070
public void close(){
7171
this.getSpigotTasks().runTask(()->{
72-
this.task.stop();
72+
if(this.task != null) this.task.stop();
7373
HandlerList.unregisterAll(this);
7474
Title.clearTitle(this.getPlayer());
7575
Actionbar.clearActionbar(this.getPlayer());

src/main/java/xyz/theprogramsrc/supercoreapi/spigot/guis/GUI.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ public abstract class GUI extends SpigotModule {
4343
*/
4444
public GUI(Player player){
4545
super(false);
46-
this.debug("Registering GUI with title '" + this.getTitle() + "&r'");
4746
this.manuallyClosed = false;
4847
this.player = player;
4948
this.buttons = new LinkedHashMap<>();
49+
this.debug("Registering GUI with title '" + this.getTitle() + "&r'");
5050
this.task = this.getSpigotTasks().runRepeatingTask(1L, 1L, ()->{
5151
if(this.inv != null){
5252
if(!this.previousTitle.equals(this.getTitle()) || this.getRows().getSize() != this.previousSize){

0 commit comments

Comments
 (0)