File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed
java/world/bentobox/aoneblock Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 1313import org .bukkit .GameMode ;
1414import org .bukkit .block .Biome ;
1515import org .bukkit .entity .EntityType ;
16- import org .bukkit .event .inventory .ClickType ;
1716
1817import com .google .common .base .Enums ;
1918
@@ -120,9 +119,9 @@ public class Settings implements WorldSettings {
120119
121120 @ ConfigComment ("Block identification appearance." )
122121 @ ConfigComment ("Click type that will make particles appear. Options are:" )
123- @ ConfigComment ("LEFT (default) or RIGHT " )
122+ @ ConfigComment ("LEFT (default), RIGHT, or NONE " )
124123 @ ConfigEntry (path = "world.block-id.click-type" )
125- private String clickType = ClickType . LEFT . name () ;
124+ private String clickType = " LEFT" ;
126125
127126 @ ConfigComment ("Size of particles. Default is 0.5. Must be greater than 0." )
128127 @ ConfigEntry (path = "world.block-id.particle-size" )
@@ -2165,7 +2164,8 @@ public void setParticleDensity(Double particleDensity) {
21652164 * @return the clickType
21662165 */
21672166 public String getClickType () {
2168- if (clickType == null || (!clickType .equalsIgnoreCase ("LEFT" ) && !clickType .equalsIgnoreCase ("RIGHT" ))) {
2167+ if (clickType == null || (!clickType .equalsIgnoreCase ("LEFT" ) && !clickType .equalsIgnoreCase ("RIGHT" )
2168+ && !clickType .equalsIgnoreCase ("NONE" ))) {
21692169 clickType = "LEFT" ;
21702170 }
21712171 return clickType ;
Original file line number Diff line number Diff line change @@ -47,12 +47,14 @@ public BlockProtect(AOneBlock addon) {
4747 */
4848 @ EventHandler (priority = EventPriority .NORMAL , ignoreCancelled = true )
4949 public void onBlockDamage (PlayerInteractEvent e ) {
50- if (!addon .inWorld (e .getPlayer ().getWorld ()) || e .getClickedBlock () == null ) {
50+ Action action = e .getAction ();
51+ String clickType = addon .getSettings ().getClickType ();
52+
53+ if (clickType .equalsIgnoreCase ("NONE" ) || !addon .inWorld (e .getPlayer ().getWorld ())
54+ || e .getClickedBlock () == null ) {
5155 return ;
5256 }
5357
54- Action action = e .getAction ();
55- String clickType = addon .getSettings ().getClickType ();
5658 if ((action == Action .LEFT_CLICK_BLOCK && clickType .equalsIgnoreCase ("LEFT" ))
5759 || (action == Action .RIGHT_CLICK_BLOCK && clickType .equalsIgnoreCase ("RIGHT" ))) {
5860
Original file line number Diff line number Diff line change 6464 block-id :
6565 # Block identification appearance.
6666 # Click type that will make particles appear. Options are:
67- # LEFT (default) or RIGHT
67+ # LEFT (default), RIGHT, or NONE
6868 click-type : RIGHT
6969 # Size of particles. Default is 0.7. Must be greater than 0.
7070 particle-size : 0.5
You can’t perform that action at this time.
0 commit comments