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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ BuildTools is based around simple block breaking and placing as opposed to a sel
commands.
</p>
<p>
Compiling currently requires the latest Bukkit, WorldGuard, GriefPrevention and PlotMe. The plugins
are required for stopping players from building in protected areas using this plugin.</p>
Compiling currently requires the latest Paper API, WorldGuard, GriefPrevention and PlotMe. The plugins
are required for stopping players from building in protected areas using this plugin.</p>
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<modelVersion>4.0.0</modelVersion>
<groupId>au.com.mineauz</groupId>
<artifactId>BuildTools</artifactId>
<version>1.19.2-SNAPSHOT</version>
<version>1.21.7-SNAPSHOT</version>
<name>BuildTools</name>
<properties>
<build.number/>
<plugin.version>${project.version}-${build.number}</plugin.version>
<mainClass>au.com.mineauz.buildtools.BTPlugin</mainClass>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spigot.api.version>1.19</spigot.api.version>
<spigot.version>1.19.2-R0.1-SNAPSHOT</spigot.version>
<paper.api.version>1.21</paper.api.version>
<paper.version>1.21.7-R0.1-SNAPSHOT</paper.version>
</properties>
<licenses>
<license>
Expand Down Expand Up @@ -96,9 +96,9 @@

<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>${spigot.version}</version>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>${paper.version}</version>
<scope>provided</scope>
</dependency>

Expand Down
34 changes: 14 additions & 20 deletions src/main/java/au/com/mineauz/buildtools/BTPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -266,16 +266,13 @@ public void setValue(String value) {
}

@Override
public String getValue() {
String set = null;
if(tSettings.length > 0)
set = "";
for(String s : tSettings)
set += s + " ";
return set;
}
};
}
public String getValue() {
if (tSettings.length == 0)
return null;
return String.join(" ", tSettings);
}
};
}

public void setTSettings(String[] settings){
tSettings = settings;
Expand All @@ -297,16 +294,13 @@ public void setValue(String value) {
}

@Override
public String getValue() {
String set = null;
if(pSettings.length > 0)
set = "";
for(String s : pSettings)
set += s + " ";
return set;
}
};
}
public String getValue() {
if (pSettings.length == 0)
return null;
return String.join(" ", pSettings);
}
};
}

public void setPSettings(String[] settings){
pSettings = settings;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/au/com/mineauz/buildtools/BTPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void onDisable(){

HandlerList.unregisterAll(this);

getLogger().info(" successfully disabled!");
getLogger().info("Successfully disabled!");
}

public PlayerData getPlayerData(){
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/au/com/mineauz/buildtools/Events.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ else if(!pl.canBuild() && pl.hasPoint(event.getBlock().getLocation())){

if(!pdata.getPlayerBlockLimits(pl).contains(event.getBlockPlaced().getType()) ||
pl.hasPermission("buildtools.bypassdisabledblocks")){
Integer[] hl = pdata.getPlayerHightLimits(pl);
Integer[] hl = pdata.getPlayerHeightLimits(pl);
if((event.getBlock().getLocation().getBlockY() <= hl[1] &&
event.getBlock().getLocation().getBlockY() >= hl[0]) ||
pl.hasPermission("buildtools.bypassheightlimit")){
Expand Down Expand Up @@ -149,7 +149,7 @@ else if(!pl.canBuild() && pl.hasPoint(event.getBlock().getLocation())){

if(!pdata.getPlayerBlockLimits(pl).contains(Material.AIR) ||
pl.hasPermission("buildtools.bypassdisabledblocks")){
Integer[] hl = pdata.getPlayerHightLimits(pl);
Integer[] hl = pdata.getPlayerHeightLimits(pl);
if((event.getBlock().getLocation().getBlockY() <= hl[1] &&
event.getBlock().getLocation().getBlockY() >= hl[0]) ||
pl.hasPermission("buildtools.bypassheightlimit")){
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/au/com/mineauz/buildtools/Generator.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ else if(copy != null){
}

if(copy.isReplacing() || state.getBlock().getState().getType() == Material.AIR){
Integer[] lim = BTPlugin.plugin.getPlayerData().getPlayerHightLimits(player);
Integer[] lim = BTPlugin.plugin.getPlayerData().getPlayerHeightLimits(player);
if(state.getLocation().getBlockY() >= lim[0] && state.getLocation().getY() <= lim[1]){
BTUtils.placeBlock(player, state.getLocation(), state.getBlockData(), BuildMode.OVERWRITE, undo);
}
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/au/com/mineauz/buildtools/PlayerData.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ public void saveHeightLimits(){
plugin.saveConfig();
}

public Integer[] getPlayerHightLimits(BTPlayer player){
for(String l : heightLimits.keySet()){
if(player.hasPermission("buildtools.heightlimit." + l)){
return heightLimits.get(l);
}
}
return getHeightLimits("default");
}
public Integer[] getPlayerHeightLimits(BTPlayer player){
for(String l : heightLimits.keySet()){
if(player.hasPermission("buildtools.heightlimit." + l)){
return heightLimits.get(l);
}
}
return getHeightLimits("default");
}

public void addVolumeLimit(String name, int limit) throws DuplicateLimitException{
name = name.toLowerCase();
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ maxVolume:
# Height limits for players to use BuildTools, Min 0, Max 255.
# More groups can be added to allow certain players to build higher/lower.
# First item on list is minimum height, second is maximum.
# Permission for added groups: buildtools.hightlimit.<groupName>
# Permission for added groups: buildtools.heightlimit.<groupName>
heightLimits:
default:
- -63
Expand Down Expand Up @@ -179,4 +179,4 @@ disabledBlocks:
# (Bigger number = faster block generation but more lag,
# smaller number = slower block gereation but less lag)
# 10 milliseconds default.
generatorMaxDelay: 10
generatorMaxDelay: 10
6 changes: 3 additions & 3 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: ${project.name}
main: ${mainClass}
version: ${plugin.version}
api-version: ${spigot.api.version}
api-version: ${paper.api.version}
author: _Razz_
softdepend: [GriefPrevention, WorldGuard, PlotMe]

Expand All @@ -10,7 +10,7 @@ commands:
description: The BuildTools base command.
usage: Invalid command. Type "/buildtools help" for help
permission: buildtools.command
permisison-message: You don't have permission to use this command <permission>
permission-message: You don't have permission to use this command <permission>
aliases: [bt, btm]

permissions:
Expand Down Expand Up @@ -134,4 +134,4 @@ permissions:
buildtools.pattern.random:
default: true
buildtools.pattern.wall:
default: true
default: true