Skip to content

Commit

Permalink
Revert "allow entity protections to be configured in core.yml. storag…
Browse files Browse the repository at this point in the history
…e_minecart, item_frame ;)"

This reverts commit f802de5b463e60393aa726ad2741daeddbda74f9.
  • Loading branch information
Hidendra committed Feb 1, 2013
1 parent 586686f commit 0c48fdb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 37 deletions.
19 changes: 0 additions & 19 deletions src/main/java/com/griefcraft/bukkit/EntityBlock.java
Expand Up @@ -39,9 +39,6 @@
import org.bukkit.block.BlockState;
import org.bukkit.block.PistonMoveReaction;
import org.bukkit.entity.Entity;
import org.bukkit.entity.ItemFrame;
import org.bukkit.entity.Painting;
import org.bukkit.entity.StorageMinecart;
import org.bukkit.inventory.ItemStack;
import org.bukkit.metadata.MetadataValue;
import org.bukkit.plugin.Plugin;
Expand Down Expand Up @@ -70,22 +67,6 @@ public EntityBlock(Entity entity) {
this.entity = entity;
}

/**
* The name of these entity block. Used to represent the "material" for configuration, mainly.
* @return
*/
public String getName() {
if (entity instanceof Painting) {
return "painting";
} else if (entity instanceof ItemFrame) {
return "item_frame";
} else if (entity instanceof StorageMinecart) {
return "storage_minecart";
}

return "entity";
}

public int getX() {
return POSITION_OFFSET + entity.getUniqueId().hashCode();
}
Expand Down
19 changes: 1 addition & 18 deletions src/main/java/com/griefcraft/lwc/LWC.java
Expand Up @@ -1135,7 +1135,7 @@ private void removeBlocks(CommandSender sender, List<Block> blocks) {
*/
public boolean isProtectable(Block block) {
if (block instanceof EntityBlock) {
return Boolean.parseBoolean(resolveProtectionConfiguration(((EntityBlock) block).getName(), "enabled"));
return true; // TODO
}

return isProtectable(block.getType());
Expand Down Expand Up @@ -1385,23 +1385,6 @@ public String resolveProtectionConfiguration(Material material, String node) {
return value;
}

/**
* Get the appropriate config value for the block (protections.block.node)
*
* @param name
* @param node
* @return
*/
public String resolveProtectionConfiguration(String name, String node) {
String value = configuration.getString("protections." + node);

if (value == null) {
value = configuration.getString("protections.blocks." + name + "." + node);
}

return value;
}

/**
* Load sqlite (done only when LWC is loaded so memory isn't used unnecessarily)
*/
Expand Down

0 comments on commit 0c48fdb

Please sign in to comment.