Skip to content

Commit ff5601a

Browse files
authored
Add files via upload
1 parent 89dd785 commit ff5601a

File tree

5 files changed

+56
-53
lines changed

5 files changed

+56
-53
lines changed

README.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
1-
# no-health-hunger
2-
## Bukkit plugin that disables health and hunger
1+
# no-damage-no-hunger
2+
## Spigot plugin that disables damage and hunger
33

44
### Features
5-
* Disables health
5+
* Disables damage
66
* Disables hunger
7-
* Teleports players in the void to spawn
87

98
### Permissions
109
|Node|Default|Description|
1110
|:---|-------|----------:|
12-
|NoHealthHunger.nohealth|OP|Player takes no damage|
13-
|NoHealthHunger.nohunger|OP|Player loses no hunger|
14-
|NoHealthHunger.escapevoid|TRUE|On entering void, player is teleported to spawn|
15-
16-
### Config
17-
|Node|Sample|Description|
18-
|:---|------|----------:|
19-
|escapevoid.teleport_out_of_void|true|Set _false_ to prevent all players from escaping the void (NOTE: This overrides permissions!|
20-
|escapevoid.message|Please don't go on spacewalks.|Message that players see when they are teleported _out_ of the void.|
21-
|spawn.world|Server_lobby|The name of the world that your spawn point is located in. This is usually the name of the folder containing the world data files.|
22-
|spawn.x|0.5|The x-coordinate of the spawn point. Press F3 in-game to view your coordinates.|
23-
|spawn.y|3|The y-coordinate of the spawn point. Press F3 in-game to view your coordinates.|
24-
|spawn.z|0.5|The z-coordinate of the spawn point. Press F3 in-game to view your coordinates.|
11+
|NoDamageNoHunger.nodamage|OP|Player takes no damage|
12+
|NoDamageNoHunger.nohunger|OP|Player loses no hunger|

pom.xml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
<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">
22
<modelVersion>4.0.0</modelVersion>
3-
<groupId>org.rainas</groupId>
4-
<artifactId>NoHealthHunger</artifactId>
5-
<version>1.0.1</version>
3+
<groupId>io.github.itasli</groupId>
4+
<artifactId>NoDamageNoHunger</artifactId>
5+
<version>1.0</version>
66
<build>
77
<plugins>
88
<plugin>
99
<groupId>org.apache.maven.plugins</groupId>
1010
<artifactId>maven-compiler-plugin</artifactId>
11+
<version>3.8.1</version>
1112
<configuration>
12-
<source>1.7</source>
13-
<target>1.7</target>
13+
<source>1.8</source>
14+
<target>1.8</target>
1415
</configuration>
1516
</plugin>
1617
</plugins>
1718
</build>
1819
<repositories>
19-
<repository>
20-
<id>bukkit-repo</id>
21-
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
22-
</repository>
20+
<repository>
21+
<id>papermc</id>
22+
<url>https://papermc.io/repo/repository/maven-public/</url>
23+
</repository>
2324
</repositories>
2425
<dependencies>
2526
<dependency>
26-
<groupId>org.bukkit</groupId>
27-
<artifactId>bukkit</artifactId>
28-
<version>1.8-R0.1-SNAPSHOT</version>
29-
<type>jar</type>
30-
<scope>provided</scope>
31-
</dependency>
27+
<groupId>io.papermc.paper</groupId>
28+
<artifactId>paper-api</artifactId>
29+
<version>1.18-R0.1-SNAPSHOT</version>
30+
<scope>provided</scope>
31+
</dependency>
3232
</dependencies>
3333
</project>

src/main/java/org/rainas/nohealthhunger/HealthHungerListener.java

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.rainas.nohealthhunger;
1+
package io.github.itasli.nodamagenohunger;
22

33
import org.bukkit.entity.Player;
44
import org.bukkit.event.EventHandler;
@@ -8,34 +8,27 @@
88
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
99

1010
public class HealthHungerListener implements Listener {
11-
NoHealthHunger plugin;
11+
NoDamageNoHunger plugin;
1212

13-
public HealthHungerListener(NoHealthHunger plugin) {
13+
public HealthHungerListener(NoDamageNoHunger plugin) {
1414
this.plugin = plugin;
1515
}
1616

1717
@EventHandler
1818
public void onEntityDamage(EntityDamageEvent event) {
1919
if (event.getEntity() instanceof Player) {
2020
Player player = (Player) event.getEntity();
21-
if (player.hasPermission("NoHealthHunger.nohealth")) {
21+
if (player.hasPermission("NoDamageNoHunger.nohealth")) {
2222
event.setCancelled(true);
2323
}
24-
25-
if (event.getCause() == DamageCause.VOID) {
26-
if (plugin.doVoid && player.hasPermission("NoHealthHunger.escapevoid")) {
27-
player.teleport(plugin.spawn);
28-
player.sendMessage(plugin.voidMessage);
29-
}
30-
}
3124
}
3225
}
3326

3427
@EventHandler
3528
public void onFoodLevelChange(FoodLevelChangeEvent event) {
3629
if (event.getEntity() instanceof Player) {
3730
Player player = (Player) event.getEntity();
38-
if (player.hasPermission("NoHealthHunger.nohunger")) {
31+
if (player.hasPermission("NoDamageNoHunger.nohunger")) {
3932
event.setCancelled(true);
4033
}
4134
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package io.github.itasli.nodamagenohunger;
2+
3+
import org.bukkit.Bukkit;
4+
import org.bukkit.Location;
5+
import org.bukkit.plugin.java.JavaPlugin;
6+
7+
public class NoDamageNoHunger extends JavaPlugin {
8+
9+
10+
@Override
11+
public void onDisable() {
12+
getLogger().info("Plugin disabled");
13+
}
14+
15+
@Override
16+
public void onEnable() {
17+
getLogger().info("Plugin enabled");
18+
Bukkit.getServer().getPluginManager().registerEvents(new HealthHungerListener(this), this);
19+
}
20+
21+
}

src/main/resources/plugin.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
name: NoHealthHunger
2-
main: org.rainas.nohealthhunger.NoHealthHunger
3-
version: 0.0.1
1+
main: io.github.itasli.nodamagenohunger.NoDamageNoHunger
2+
name: NoDamageNoHunger
3+
version: 1.0
4+
description: This plugin cancel damage and hunger if player has the permission !
5+
api-version: 1.18
6+
author: itasli
7+
website: spigotmc.org
48
permissions:
5-
NoHealthHunger.nohealth:
9+
NoDamageNoHunger.nodamage:
610
description: Take no damage
711
default: op
8-
NoHealthHunger.nohunger:
12+
NoDamageNoHunger.nohunger:
913
description: Never go hungry
10-
default: op
11-
NoHealthHunger.escapevoid:
12-
description: Teleport to spawn on entering the void
13-
default: true
14+
default: op

0 commit comments

Comments
 (0)