Skip to content

Commit

Permalink
- Update to 1.13
Browse files Browse the repository at this point in the history
- Get ready for bossbar support

Pre release 0.19
  • Loading branch information
teozfrank committed Aug 24, 2018
1 parent e05a712 commit 2ac4994
Show file tree
Hide file tree
Showing 20 changed files with 309 additions and 12 deletions.
1 change: 1 addition & 0 deletions .idea/artifacts/DuelMe_jar.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.github.teozfrank.duelme.api;

import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;

/**
* Created by Frank on 06/06/2016.
Expand All @@ -15,4 +16,6 @@ public interface TitleActionbar {

public void sendTitle(Player sender, Player accepter, String title, String subtitle, int fadeIn, int stay, int fadeOut);

public void sendBossbar(String title, String colorName, String styleName, Player player, Plugin plugin, int period);

}
5 changes: 3 additions & 2 deletions Plugin/Plugin.iml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
<orderEntry type="library" name="Maven: javax.persistence:persistence-api:1.0" level="project" />
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.15" level="project" />
<orderEntry type="library" name="Maven: net.md-5:bungeecord-chat:1.9-SNAPSHOT" level="project" />
<orderEntry type="module" module-name="v1_12_R1" />
<orderEntry type="library" name="Maven: org.bukkit:craftbukkit:1.12-R0.1-SNAPSHOT" level="project" />
<orderEntry type="module" module-name="v1_13_R1" />
<orderEntry type="library" name="Maven: org.bukkit:craftbukkit:1.13-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: com.sk89q:worldedit:6.0.0-SNAPSHOT" level="project" />
<orderEntry type="library" name="Maven: de.schlichtherle:truezip:6.8.3" level="project" />
<orderEntry type="library" name="Maven: rhino:js:1.7R2" level="project" />
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
<orderEntry type="library" name="Maven: com.github.teozfrank:duelme-v1_12_R1:v1.12_R1" level="project" />
<orderEntry type="library" name="Maven: com.github.teozfrank:duelme-v1_11_R1:v1.11_R1" level="project" />
<orderEntry type="module" module-name="v1_10_R1" />
<orderEntry type="module" module-name="v1_9_R2" />
Expand Down
10 changes: 9 additions & 1 deletion Plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,22 @@
<artifactId>DuelMe</artifactId>
<packaging>jar</packaging>
<name>DuelMe</name>
<version>0.18.4</version>
<version>0.19.0</version>

<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.10-R0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.github.teozfrank</groupId>
<artifactId>duelme-v1_13_R1</artifactId>
<version>v1.13_R1</version>
<type>jar</type>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.github.teozfrank</groupId>
<artifactId>duelme-v1_12_R1</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public void onPlayerInteractSign(PlayerInteractEvent e) {
if (! clickedBlock.getType().equals(Material.WALL_SIGN)) {
return;
}
SendConsoleMessage.debug("Right click wall sign yay!.");

try {
Sign sign = (Sign) clickedBlock.getState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ public void run() {
if(duelSize == 2) {
plugin.getTitleActionbar().sendTitle(sender, target, mm.getDuelStartedMessage(), "", 10, 10, 10);
sender.setFoodLevel(20);
sender.setHealth(20);
sender.setHealth(sender.getMaxHealth());
target.setFoodLevel(20);
target.setHealth(target.getMaxHealth());
duelArena.setDuelState(DuelState.STARTED);
dm.surroundLocation(duelArena.getSpawnpoint1(), Material.AIR);
dm.surroundLocation(duelArena.getSpawnpoint2(), Material.AIR);
Expand Down
5 changes: 1 addition & 4 deletions Plugin/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: DuelMe
version: '${project.version}'
author: teozfrank
api-version: 1.13
description: allows players to duel each other in a controlled environment
main: com.github.teozfrank.duelme.main.DuelMe
depend: [WorldEdit]
Expand Down Expand Up @@ -35,7 +36,6 @@ permissions:
duelme.admin.setspawnpoint2: true
duelme.admin.restore: true
duelme.admin.forceduel: true
duelme.admin.info: true
duelme.player.*:
description: Gives access to all player commands
children:
Expand Down Expand Up @@ -93,9 +93,6 @@ permissions:
duelme.admin.forceduel:
description: allows admins to force a duel between two players
default: op
duelme.admin.info:
description: allows admins to get the plugin information
default: op
duelme.admin.join:
description: allows players to join a duel queue
default: op
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<module>v1_11_R1</module>
<module>Plugin</module>
<module>v1_12_R1</module>
<module>v1_13_R1</module>
</modules>

<repositories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@
import net.minecraft.server.v1_10_R1.PacketPlayOutChat;
import net.minecraft.server.v1_10_R1.PacketPlayOutTitle;
import net.minecraft.server.v1_10_R1.PlayerConnection;
import org.bukkit.Bukkit;
import org.bukkit.boss.BarColor;
import org.bukkit.boss.BarStyle;
import org.bukkit.boss.BossBar;
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;

public class NMSHandler implements TitleActionbar {

Expand Down Expand Up @@ -40,4 +46,28 @@ public void sendTitle(Player sender, Player acceptor, String title, String subti
sendTitle(sender, title, subtitle, fadeIn, stay, fadeOut);
sendTitle(acceptor, title, subtitle, fadeIn, stay, fadeOut);
}

@Override
public void sendBossbar(String title, String colorName, String styleName, Player player, Plugin plugin, int period) {
BarColor color = BarColor.valueOf(colorName.toUpperCase());
BarStyle style = BarStyle.valueOf(styleName.toUpperCase());
final BossBar bar = Bukkit.createBossBar(title, color, style);
bar.addPlayer(player);
bar.setVisible(true);
final double interval = 1.0 / (period * 20L);
new BukkitRunnable() {
@Override
public void run() {
double progress = bar.getProgress();
double newProgress = progress - interval;
if (progress <= 0.0 || newProgress <= 0.0) {
bar.setVisible(false);
bar.removeAll();
this.cancel();
} else {
bar.setProgress(newProgress);
}
}
}.runTaskTimerAsynchronously(plugin, 0, 1L);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@
import net.minecraft.server.v1_11_R1.PacketPlayOutChat;
import net.minecraft.server.v1_11_R1.PacketPlayOutTitle;
import net.minecraft.server.v1_11_R1.PlayerConnection;
import org.bukkit.Bukkit;
import org.bukkit.boss.BarColor;
import org.bukkit.boss.BarStyle;
import org.bukkit.boss.BossBar;
import org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;

/**
* Created by Frank on 22-Dec-16.
Expand Down Expand Up @@ -43,4 +49,28 @@ public void sendTitle(Player sender, Player acceptor, String title, String subti
sendTitle(sender, title, subtitle, fadeIn, stay, fadeOut);
sendTitle(acceptor, title, subtitle, fadeIn, stay, fadeOut);
}

@Override
public void sendBossbar(String title, String colorName, String styleName, Player player, Plugin plugin, int period) {
BarColor color = BarColor.valueOf(colorName.toUpperCase());
BarStyle style = BarStyle.valueOf(styleName.toUpperCase());
final BossBar bar = Bukkit.createBossBar(title, color, style);
bar.addPlayer(player);
bar.setVisible(true);
final double interval = 1.0 / (period * 20L);
new BukkitRunnable() {
@Override
public void run() {
double progress = bar.getProgress();
double newProgress = progress - interval;
if (progress <= 0.0 || newProgress <= 0.0) {
bar.setVisible(false);
bar.removeAll();
this.cancel();
} else {
bar.setProgress(newProgress);
}
}
}.runTaskTimerAsynchronously(plugin, 0, 1L);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@

import com.github.teozfrank.duelme.api.TitleActionbar;
import net.minecraft.server.v1_12_R1.*;
import org.bukkit.Bukkit;
import org.bukkit.boss.BarColor;
import org.bukkit.boss.BarStyle;
import org.bukkit.boss.BossBar;
import org.bukkit.craftbukkit.v1_12_R1.entity.CraftPlayer;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;

/**
* Created by Frank on 22-Dec-16.
Expand Down Expand Up @@ -40,4 +46,28 @@ public void sendTitle(Player sender, Player acceptor, String title, String subti
sendTitle(sender, title, subtitle, fadeIn, stay, fadeOut);
sendTitle(acceptor, title, subtitle, fadeIn, stay, fadeOut);
}

@Override
public void sendBossbar(String title, String colorName, String styleName, Player player, Plugin plugin, int period) {
BarColor color = BarColor.valueOf(colorName.toUpperCase());
BarStyle style = BarStyle.valueOf(styleName.toUpperCase());
final BossBar bar = Bukkit.createBossBar(title, color, style);
bar.addPlayer(player);
bar.setVisible(true);
final double interval = 1.0 / (period * 20L);
new BukkitRunnable() {
@Override
public void run() {
double progress = bar.getProgress();
double newProgress = progress - interval;
if (progress <= 0.0 || newProgress <= 0.0) {
bar.setVisible(false);
bar.removeAll();
this.cancel();
} else {
bar.setProgress(newProgress);
}
}
}.runTaskTimerAsynchronously(plugin, 0, 1L);
}
}
37 changes: 37 additions & 0 deletions v1_13_R1/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.teozfrank</groupId>
<artifactId>duelme-v1_13_R1</artifactId>
<packaging>jar</packaging>
<name>DuelMe implementation 1_13_R1</name>
<version>v1.13_R1</version>

<parent>
<groupId>com.github.teozfrank</groupId>
<artifactId>duelme-parent</artifactId>
<version>parent</version>
</parent>

<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.13-R0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.github.teozfrank</groupId>
<artifactId>duelme-api</artifactId>
<version>API</version>
<type>jar</type>
</dependency>
</dependencies>

<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>

</project>

0 comments on commit 2ac4994

Please sign in to comment.