1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-17 20:11:21 +02:00

Add some default values to protect config.

Figure out a better way to do this for HashMaps....
This commit is contained in:
ementalo
2012-06-26 23:31:38 +01:00
parent 1596ea1335
commit 68463b4af8
2 changed files with 15 additions and 1 deletions

View File

@@ -17,7 +17,7 @@ public class Prevent implements StorageObject
{ {
@Comment("Which blocks should a piston not be able to push?") @Comment("Which blocks should a piston not be able to push?")
@ListType(Material.class) @ListType(Material.class)
private Set<Material> pistonPush = new HashSet<Material>(); private Set<Material> pistonPush = new HashSet<Material>();
private boolean lavaFlow = false; private boolean lavaFlow = false;
private boolean waterFlow = false; private boolean waterFlow = false;
// private boolean waterbucketFlow = false; TODO: Test if this still works // private boolean waterbucketFlow = false; TODO: Test if this still works
@@ -42,4 +42,10 @@ public class Prevent implements StorageObject
@MapKeyType(EntityType.class) @MapKeyType(EntityType.class)
@MapValueType(Boolean.class) @MapValueType(Boolean.class)
private Map<EntityType, Boolean> spawn = new HashMap<EntityType, Boolean>(); private Map<EntityType, Boolean> spawn = new HashMap<EntityType, Boolean>();
public Prevent()
{
spawn.put(EntityType.PIG, false);
pistonPush.add(Material.GLASS);
}
} }

View File

@@ -3,6 +3,7 @@ package com.earth2me.essentials.settings.protect;
import com.earth2me.essentials.storage.Comment; import com.earth2me.essentials.storage.Comment;
import com.earth2me.essentials.storage.ListType; import com.earth2me.essentials.storage.ListType;
import com.earth2me.essentials.storage.StorageObject; import com.earth2me.essentials.storage.StorageObject;
import com.sun.org.apache.xml.internal.security.Init;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import lombok.Data; import lombok.Data;
@@ -42,4 +43,11 @@ public class Protect implements StorageObject
private boolean disableThunder = false; private boolean disableThunder = false;
private boolean disableLighting = false; private boolean disableLighting = false;
private SignsAndRails signsAndRails = new SignsAndRails(); private SignsAndRails signsAndRails = new SignsAndRails();
public Protect()
{
alertOnPlacement.add(Material.LAVA);
alertOnUse.add(Material.LAVA_BUCKET);
alertOnBreak.add(Material.GLASS);
}
} }