diff options
author | snowleo <schneeleo@gmail.com> | 2012-01-02 23:25:17 +0100 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2012-01-02 23:25:17 +0100 |
commit | cb31939a7a71421ff91e89d22577f0031f635ede (patch) | |
tree | be55dc30b771ca27f44024eecc554aad15dd7ad9 | |
parent | 41e0e64a5f83cb036e90d3c299f65b69caa9dd63 (diff) | |
download | Essentials-cb31939a7a71421ff91e89d22577f0031f635ede.tar Essentials-cb31939a7a71421ff91e89d22577f0031f635ede.tar.gz Essentials-cb31939a7a71421ff91e89d22577f0031f635ede.tar.lz Essentials-cb31939a7a71421ff91e89d22577f0031f635ede.tar.xz Essentials-cb31939a7a71421ff91e89d22577f0031f635ede.zip |
New Protect config
3 files changed, 124 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/settings/protect/Prevent.java b/Essentials/src/com/earth2me/essentials/settings/protect/Prevent.java new file mode 100644 index 000000000..5d309e31e --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/settings/protect/Prevent.java @@ -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>(); +}
\ No newline at end of file diff --git a/Essentials/src/com/earth2me/essentials/settings/protect/Protect.java b/Essentials/src/com/earth2me/essentials/settings/protect/Protect.java new file mode 100644 index 000000000..bb745ad8f --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/settings/protect/Protect.java @@ -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(); +} diff --git a/Essentials/src/com/earth2me/essentials/settings/protect/SignsAndRails.java b/Essentials/src/com/earth2me/essentials/settings/protect/SignsAndRails.java new file mode 100644 index 000000000..db895b3ec --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/settings/protect/SignsAndRails.java @@ -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; +} |