Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions About 0.0.4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
About 0.0.4

Sorry for my English, i'm french. Also, i never used GitHub before.

I made 2 modifications for this 0.0.4.

- Bug fix : when one or more protect plugins handled by QuickSignReloaded (WorldGuard, Residence, Regios, LWC or ChestShop) are load on the server but NOT all of them, the selection was forbidden unless player has the quicksign.freeuse permission.

- Also, I add a rules for allow the sign selection : it must don't contain a line with a '[]' expression ! This allow to protect a lot of sign created by some plugins that QuickSign don't handled.
A permission was created to bypass this protection : quicksign.selbracketssign.

It was Compiled against Bukkit 1.5.2 like 0.0.3 version, but it works perfectly in 1.6.2 !

Gemil01, I let you, if you want, update QuickSignReloaded at http://dev.bukkit.org.

I only update/change 4 files :
-handler/SelectionHandler.java
-permission/permission.java
-util/BlackList.java
-This ReadMe.
39 changes: 30 additions & 9 deletions src/de/cubecontinuum/Quicksign/handler/SelectionHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,13 @@ public boolean checkForSelectionRights(Player player, Block block) {

if (wg == null && !residence && regiosAPI == null && lwc == null && !chestShop) {

return plugin.hasPermissions(player, Permission.USE);
return plugin.hasPermissions(player, Permission.USE);

}

if (plugin.hasPermissions(player, Permission.FREE_USE)) {

return true;
return true;

}

Expand All @@ -300,10 +300,15 @@ && checkForWGOwnership(player, location, world)) {
} else if (plugin.hasPermissions(player, Permission.WG_CAN_BUILD)
&& checkForWGBuildPermissions(player, location, world)) {

wgPerm = true;
wgPerm = true;

}
}
} else {

wgPerm = true;

}


if (residence) {

Expand All @@ -318,7 +323,11 @@ && checkForResidencePerms(world, location, player, false)) {
residencePerm = true;

}
}
} else {

residencePerm = true;

}

if (regiosAPI != null) {

Expand All @@ -333,7 +342,11 @@ && checkForRegiosPerms(player, false)) {
regiosPerm = true;

}
}
} else {

regiosPerm = true;

}

if (lwc != null) {

Expand All @@ -348,7 +361,11 @@ && checkForLWCPerms(player, block, false)) {
lwcPerm = true;

}
}
} else {

lwcPerm = true;

}

if (chestShop) {

Expand All @@ -361,8 +378,12 @@ && chekForChestShopPerms(player, (Sign) block.getState())) {

}
}
}

} else {

chestShopPerm = true;

}

return wgPerm && residencePerm && regiosPerm && lwcPerm && chestShopPerm;

}
Expand Down
1 change: 1 addition & 0 deletions src/de/cubecontinuum/Quicksign/permission/Permission.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public enum Permission {
PLACE_CONSOLE_COMMAND_SIGNS("quicksign.placeconcommandsigns"),
USE_SPOUT("quicksign.usespout"),
IGNORE_BLACK_LIST("quicksign.ignoreblacklist"),
SEL_BRACKETS_SIGN("quicksign.selbracketssign"),
CHESTSHOP_EDIT("quicksign.editchestshopsigns");
//
private final String nodeString;
Expand Down
40 changes: 40 additions & 0 deletions src/de/cubecontinuum/Quicksign/util/BlackList.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import de.cubecontinuum.Quicksign.QuickSign;
import de.cubecontinuum.Quicksign.permission.Permission;

import org.bukkit.block.Sign;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -69,6 +71,16 @@ public boolean allows(String line, Player player) {

}
}

if (!plugin.hasPermissions(player,
Permission.SEL_BRACKETS_SIGN)) {

if (checkForBRACKETS(line)) {

return false;

}
}

if (!plugin.hasPermissions(player,
Permission.ALLOW_ICS)) {
Expand Down Expand Up @@ -98,6 +110,19 @@ public boolean allows(String[] lines, Player player) {
}
}
}

if (!plugin.hasPermissions(player,
Permission.SEL_BRACKETS_SIGN)) {

for (String line : lines) {

if (checkForBRACKETS(line)) {

return false;

}
}
}

if (!plugin.hasPermissions(player,
Permission.ALLOW_ICS)) {
Expand Down Expand Up @@ -138,4 +163,19 @@ private boolean checkForIC(String txt) {
return false;

}

private boolean checkForBRACKETS(String txt) {
//[]
if (txt.length() >= 2) {

if (txt.charAt(0) == '[' && txt.charAt(txt.length()-1) == ']') {

return true;

}
}

return false;

}
}
6 changes: 5 additions & 1 deletion src/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: QuickSignReloaded
main: de.cubecontinuum.Quicksign.QuickSign
version: 0.0.3
version: 0.0.4
commands:
qs:
description: Toggles QuickSign.
Expand Down Expand Up @@ -62,5 +62,9 @@ permissions:
description: Allows to place console command signs
quicksign.usespout:
description: Allows to use Spout GUI
quicksign.ignoreblacklist:
description: Bypass Black_list.yml
quicksign.selbracketssign:
description: Allows to select signs that contains square brackets
quicksign.editchestshopsigns:
description: Allows to edit signs that are designated ChestShop signs (dangerous)