forked from Minecraft/QoL
Add Config To Disable Enderman Grief (#14)
Added default config value Bumped version number Add config for disabling enderman grief Co-authored-by: Joey Hines <joey@ahines.net> Reviewed-on: https://git.canopymc.net/Canopy/QoL/pulls/14 Reviewed-by: Etzelia <etzelia@hotmail.com> Co-Authored-By: ZeroHD <joey@ahines.net> Co-Committed-By: ZeroHD <joey@ahines.net>main
parent
2e72736571
commit
fa2f79239e
2
pom.xml
2
pom.xml
|
@ -3,7 +3,7 @@
|
|||
<groupId>xyz.etztech</groupId>
|
||||
<artifactId>QoL</artifactId>
|
||||
<!-- Version is used in plugin.yml -->
|
||||
<version>1.12</version>
|
||||
<version>1.13</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<!-- Plugin Information -->
|
||||
|
|
|
@ -104,6 +104,7 @@ public class QoL extends JavaPlugin {
|
|||
new BlockIgniteListener(this);
|
||||
new CommandPreprocessListener(this);
|
||||
new DeathListener(this);
|
||||
new EntityChangeBlockListener(this);
|
||||
|
||||
// Add commands
|
||||
new MainCommand(this);
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package xyz.etztech.qol.listeners;
|
||||
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||
import xyz.etztech.qol.QoL;
|
||||
|
||||
public class EntityChangeBlockListener implements Listener {
|
||||
QoL plugin;
|
||||
|
||||
public EntityChangeBlockListener(QoL plugin) {
|
||||
this.plugin = plugin;
|
||||
plugin.getServer().getPluginManager().registerEvents(this, plugin);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onEntityChangeBlock(EntityChangeBlockEvent e) {
|
||||
if (e.getEntity().getType() == EntityType.ENDERMAN) {
|
||||
if(plugin.getConfig().getBoolean("disable-mob-grief.enderman", false)){
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -93,6 +93,9 @@ disable-fire:
|
|||
ender_crystal: false
|
||||
explosion: false
|
||||
|
||||
disable-mob-grief:
|
||||
enderman: false
|
||||
|
||||
# A list of commands to confirm before using if the user isn't in spectator mode
|
||||
spec-confirm:
|
||||
- "tp"
|
||||
|
|
Loading…
Reference in New Issue