Change sit-block-settings to sit-blocks
This commit is contained in:
parent
665b1be623
commit
adde90b9eb
@ -252,25 +252,20 @@ public class Chairs extends JavaPlugin {
|
|||||||
msgReloaded = ChatColor.translateAlternateColorCodes('&',config.getString("messages.reloaded"));
|
msgReloaded = ChatColor.translateAlternateColorCodes('&',config.getString("messages.reloaded"));
|
||||||
|
|
||||||
allowedBlocks = new ArrayList<ChairBlock>();
|
allowedBlocks = new ArrayList<ChairBlock>();
|
||||||
for (String s : config.getStringList("sit-block-settings")) {
|
for (String s : config.getStringList("sit-blocks")) {
|
||||||
String type;
|
String type;
|
||||||
double sh = 0.7;
|
double sh = 0.7;
|
||||||
String tmp[] = s.split("[:]");
|
String tmp[] = s.split("[:]");
|
||||||
type = tmp[0];
|
type = tmp[0];
|
||||||
if (tmp.length == 2) {
|
if (tmp.length == 2) {
|
||||||
sh = Double.parseDouble(tmp[1]);
|
sh = Double.parseDouble(tmp[1]);
|
||||||
}
|
}
|
||||||
try {
|
Material mat = Material.matchMaterial(type);
|
||||||
Material mat = Material.matchMaterial(type);
|
if (mat != null) {
|
||||||
if (mat != null) {
|
logInfo("Allowed block: " + mat.toString() + " => " + sh);
|
||||||
logInfo("Allowed block: " + mat.toString() + " => " + sh);
|
allowedBlocks.add(new ChairBlock(mat,sh));
|
||||||
allowedBlocks.add(new ChairBlock(mat,sh));
|
} else {
|
||||||
} else {
|
logError("Invalid block: " + type);
|
||||||
logError("Invalid block: " + type);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
logError(e.getMessage());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# ------
|
# ------
|
||||||
# A list of all compatible block and item names: http://bit.ly/AmJgMb.
|
# A list of all compatible block and item names: http://bit.ly/AmJgMb.
|
||||||
# ------
|
# ------
|
||||||
# sit-block-settings: Set the blocks you want to be able to sit down on and sitting height. Use material_name:sitting_height
|
# sit-blocks: Set the blocks you want to be able to sit down on and sitting height. Use material_name:sitting_height
|
||||||
# valid-signs: Valid sign materials for sign check
|
# valid-signs: Valid sign materials for sign check
|
||||||
# auto-rotate: If set to true, you are automatically rotated to the descending face of the stairs-block when sitting down.
|
# auto-rotate: If set to true, you are automatically rotated to the descending face of the stairs-block when sitting down.
|
||||||
# max-chair-width: Define how many blocks a chair can be long (set to number <= 0 for unlimited width).
|
# max-chair-width: Define how many blocks a chair can be long (set to number <= 0 for unlimited width).
|
||||||
@ -14,7 +14,7 @@
|
|||||||
# ignore-if-item-in-hand: Set this true disable sititng if player is holding an item in hand.
|
# ignore-if-item-in-hand: Set this true disable sititng if player is holding an item in hand.
|
||||||
# disabledWGRegions: You won't be able to sit in this regions
|
# disabledWGRegions: You won't be able to sit in this regions
|
||||||
# ------
|
# ------
|
||||||
sit-block-settings:
|
sit-blocks:
|
||||||
- WOOD_STAIRS:0.7
|
- WOOD_STAIRS:0.7
|
||||||
- SPRUCE_WOOD_STAIRS:0.7
|
- SPRUCE_WOOD_STAIRS:0.7
|
||||||
- JUNGLE_WOOD_STAIRS:0.7
|
- JUNGLE_WOOD_STAIRS:0.7
|
||||||
|
Loading…
Reference in New Issue
Block a user