1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-22 22:34:43 +02:00

New Protect config

This commit is contained in:
snowleo
2012-01-02 23:25:17 +01:00
parent 41e0e64a5f
commit cb31939a7a
3 changed files with 124 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
package com.earth2me.essentials.settings.protect;
import com.earth2me.essentials.storage.Comment;
import com.earth2me.essentials.storage.ListType;
import com.earth2me.essentials.storage.MapKeyType;
import com.earth2me.essentials.storage.MapValueType;
import com.earth2me.essentials.storage.StorageObject;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.bukkit.Material;
import org.bukkit.entity.CreatureType;
@Data
@EqualsAndHashCode(callSuper = false)
public class Prevent implements StorageObject
{
@Comment("Which blocks should a piston not be able to push?")
@ListType(Material.class)
private Set<Material> pistonPush = new HashSet<Material>();
private boolean lavaFlow = false;
private boolean waterFlow = false;
private boolean waterbucketFlow = false;
private boolean firespread = true;
private boolean lavaFirespread = true;
private boolean flintfire = false;
private boolean lightningFirespread = true;
private boolean portalCreation = false;
private boolean tntExplosion = false;
private boolean tntPlayerdamage = false;
private boolean fireballExplosion = false;
private boolean fireballFire = false;
private boolean fireballPlayerdamage = false;
private boolean creeperExplosion = false;
private boolean creeperPlayerdamage = false;
private boolean creeperBlockdamage = false;
private boolean enderdragonBlockdamage = false;
private boolean endermanPickup = false;
private boolean villagerDeath = false;
@Comment(
{
"Monsters won't follow players",
"permission essentials.protect.entitytarget.bypass disables this"
})
private boolean entitytarget = false;
@MapKeyType(CreatureType.class)
@MapValueType(Boolean.class)
private Map<CreatureType, Boolean> spawn = new HashMap<CreatureType, Boolean>();
}

View File

@@ -0,0 +1,45 @@
package com.earth2me.essentials.settings.protect;
import com.earth2me.essentials.storage.Comment;
import com.earth2me.essentials.storage.ListType;
import com.earth2me.essentials.storage.StorageObject;
import java.util.HashSet;
import java.util.Set;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.bukkit.Material;
@Data
@EqualsAndHashCode(callSuper = false)
public class Protect implements StorageObject
{
@Comment("Either mysql or sqlite")
private String dbtype = "sqlite";
@Comment("If you specified MySQL above, you MUST enter the appropriate details here.")
private String dbuser = "root";
private String dbpassword = "";
private String dburl = "jdbc:mysql://localhost:3306/minecraft";
@Comment("For which block types would you like to be alerted?")
@ListType(Material.class)
private Set<Material> alertOnPlacement = new HashSet<Material>();
@ListType(Material.class)
private Set<Material> alertOnUse = new HashSet<Material>();
@ListType(Material.class)
private Set<Material> alertOnBreak = new HashSet<Material>();
@Comment("General physics/behavior modifications")
private Prevent prevent = new Prevent();
@Comment(
{
"Maximum height the creeper should explode. -1 allows them to explode everywhere.",
"Set prevent.creeper-explosion to true, if you want to disable creeper explosions."
})
private int creeperMaxHeight = -1;
@Comment("Should we tell people they are not allowed to build")
private boolean warnOnBuildDisallow = true;
@Comment("Disable weather options")
private boolean disableStorm = false;
private boolean disableThunder = false;
private boolean disableLighting = false;
private SignsAndRails signsAndRails = new SignsAndRails();
}

View File

@@ -0,0 +1,26 @@
package com.earth2me.essentials.settings.protect;
import com.earth2me.essentials.storage.Comment;
import com.earth2me.essentials.storage.StorageObject;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class SignsAndRails implements StorageObject
{
@Comment("Protect all signs")
private boolean signs = true;
@Comment("Prevent users from destroying rails")
private boolean rails = true;
@Comment(
{
"Blocks below rails/signs are also protected if the respective rail/sign is protected.",
"This makes it more difficult to circumvent protection, and should be enabled.",
"This only has an effect if rails or signs is also enabled."
})
private boolean blockBelow = true;
@Comment("Prevent placing blocks above protected rails, this is to stop a potential griefing")
private boolean preventBlockAboveRails = false;
}