mirror of
https://github.com/darksaid98/Builders-Utilities.git
synced 2026-12-04 22:15:27 +00:00
1.14+ support & Recode
This commit is contained in:
1 parent
74a4eeb19f
commit
d2f6e0a1c8
65 files changed
+6487
No files matched your search
@@ -0,0 +1,21 @@
|
||||
package com.arcaniax.buildersutilities.commands.aliases;
|
||||
|
||||
import com.arcaniax.buildersutilities.Main;
|
||||
import com.arcaniax.buildersutilities.Settings;
|
||||
import com.arcaniax.buildersutilities.commands.system.ICommand;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class ConvexSelectionAliasCommand implements ICommand {
|
||||
@Override
|
||||
public void execute(Player player, String[] args) {
|
||||
if (!player.hasPermission("builders.util.aliases")) {
|
||||
if (Settings.sendErrorMessages) {
|
||||
player.sendMessage(Main.MSG_ERROR + "You do not have access to this command.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Main.getInstance().getServer().dispatchCommand(player, "/sel convex");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.arcaniax.buildersutilities.commands.aliases;
|
||||
|
||||
import com.arcaniax.buildersutilities.Main;
|
||||
import com.arcaniax.buildersutilities.Settings;
|
||||
import com.arcaniax.buildersutilities.commands.system.ICommand;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class CopyAliasCommand implements ICommand {
|
||||
@Override
|
||||
public void execute(Player player, String[] args) {
|
||||
if (!player.hasPermission("builders.util.aliases")) {
|
||||
if (Settings.sendErrorMessages) {
|
||||
player.sendMessage(Main.MSG_ERROR + "You do not have access to this command.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (args.length != 0) {
|
||||
for (String arg : args) {
|
||||
builder.append(arg).append(" ");
|
||||
}
|
||||
}
|
||||
|
||||
Main.getInstance().getServer().dispatchCommand(player, "/copy " + builder.toString());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.arcaniax.buildersutilities.commands.aliases;
|
||||
|
||||
import com.arcaniax.buildersutilities.Main;
|
||||
import com.arcaniax.buildersutilities.Settings;
|
||||
import com.arcaniax.buildersutilities.commands.system.ICommand;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class CuboidSelectionAliasCommand implements ICommand {
|
||||
@Override
|
||||
public void execute(Player player, String[] args) {
|
||||
if (!player.hasPermission("builders.util.aliases")) {
|
||||
if (Settings.sendErrorMessages) {
|
||||
player.sendMessage(Main.MSG_ERROR + "You do not have access to this command.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Main.getInstance().getServer().dispatchCommand(player, "/sel cuboid");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.arcaniax.buildersutilities.commands.aliases;
|
||||
|
||||
import com.arcaniax.buildersutilities.Main;
|
||||
import com.arcaniax.buildersutilities.Settings;
|
||||
import com.arcaniax.buildersutilities.commands.system.ICommand;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class DeformRotateAliasCommand implements ICommand {
|
||||
private final float radiansPerDegree = 0.0174533f;
|
||||
|
||||
@Override
|
||||
public void execute(Player player, String[] args) {
|
||||
if (!player.hasPermission("builders.util.aliases")) {
|
||||
if (Settings.sendErrorMessages) {
|
||||
player.sendMessage(Main.MSG_ERROR + "You do not have access to this command.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.length != 2) {
|
||||
player.sendMessage(Main.MSG_PREFIX + ChatColor.RED + "//derot [axis] [degrees]");
|
||||
return;
|
||||
}
|
||||
|
||||
int degrees;
|
||||
try {
|
||||
degrees = Integer.parseInt(args[1]);
|
||||
} catch (Exception e) {
|
||||
player.sendMessage(Main.MSG_PREFIX + ChatColor.RED + "//derot [axis] [degrees]");
|
||||
return;
|
||||
}
|
||||
// Old:
|
||||
// float radian = (float) (((float) degrees / (float) 360) * 2 * Math.PI);
|
||||
|
||||
//Use the degree to radian conversion number: "0.0174533" radians per degree
|
||||
float radian = degrees * radiansPerDegree;
|
||||
|
||||
if (args[0].equalsIgnoreCase("x")) {
|
||||
Main.getInstance().getServer().dispatchCommand(player, "/deform rotate(y,z," + radian + ")");
|
||||
} else if (args[0].equalsIgnoreCase("y")) {
|
||||
Main.getInstance().getServer().dispatchCommand(player, "/deform rotate(x,z," + radian + ")");
|
||||
} else if (args[0].equalsIgnoreCase("z")) {
|
||||
Main.getInstance().getServer().dispatchCommand(player, "/deform rotate(x,y," + radian + ")");
|
||||
} else {
|
||||
player.sendMessage(Main.MSG_PREFIX + ChatColor.RED + "//derot [axis] [degrees]");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.arcaniax.buildersutilities.commands.aliases;
|
||||
|
||||
import com.arcaniax.buildersutilities.Main;
|
||||
import com.arcaniax.buildersutilities.Settings;
|
||||
import com.arcaniax.buildersutilities.commands.system.ICommand;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class FlipAliasCommand implements ICommand {
|
||||
@Override
|
||||
public void execute(Player player, String[] args) {
|
||||
if (!player.hasPermission("builders.util.aliases")) {
|
||||
if (Settings.sendErrorMessages) {
|
||||
player.sendMessage(Main.MSG_ERROR + "You do not have access to this command.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (args.length != 0) {
|
||||
for (String arg : args) {
|
||||
builder.append(arg).append(" ");
|
||||
}
|
||||
}
|
||||
|
||||
Main.getInstance().getServer().dispatchCommand(player, "/flip " + builder.toString());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.arcaniax.buildersutilities.commands.aliases;
|
||||
|
||||
import com.arcaniax.buildersutilities.Main;
|
||||
import com.arcaniax.buildersutilities.Settings;
|
||||
import com.arcaniax.buildersutilities.commands.system.ICommand;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class FlySpeedAliasCommand implements ICommand {
|
||||
@Override
|
||||
public void execute(Player player, String[] args) {
|
||||
if (!player.hasPermission("builders.util.aliases")) {
|
||||
if (Settings.sendErrorMessages) {
|
||||
player.sendMessage(Main.MSG_ERROR + "You do not have access to this command.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (args.length != 0) {
|
||||
for (String arg : args) {
|
||||
builder.append(arg).append(" ");
|
||||
}
|
||||
}
|
||||
|
||||
Main.getInstance().getServer().dispatchCommand(player, "speed fly " + builder.toString());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.arcaniax.buildersutilities.commands.aliases;
|
||||
|
||||
import com.arcaniax.buildersutilities.Main;
|
||||
import com.arcaniax.buildersutilities.Settings;
|
||||
import com.arcaniax.buildersutilities.commands.system.ICommand;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PasteAliasCommand implements ICommand {
|
||||
@Override
|
||||
public void execute(Player player, String[] args) {
|
||||
if (!player.hasPermission("builders.util.aliases")) {
|
||||
if (Settings.sendErrorMessages) {
|
||||
player.sendMessage(Main.MSG_ERROR + "You do not have access to this command.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (args.length != 0) {
|
||||
for (String arg : args) {
|
||||
builder.append(arg).append(" ");
|
||||
}
|
||||
}
|
||||
|
||||
Main.getInstance().getServer().dispatchCommand(player, "/paste " + builder.toString());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.arcaniax.buildersutilities.commands.aliases;
|
||||
|
||||
import com.arcaniax.buildersutilities.Main;
|
||||
import com.arcaniax.buildersutilities.Settings;
|
||||
import com.arcaniax.buildersutilities.commands.system.ICommand;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PosOneAliasCommand implements ICommand {
|
||||
@Override
|
||||
public void execute(Player player, String[] args) {
|
||||
if (!player.hasPermission("builders.util.aliases")) {
|
||||
if (Settings.sendErrorMessages) {
|
||||
player.sendMessage(Main.MSG_ERROR + "You do not have access to this command.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Main.getInstance().getServer().dispatchCommand(player, "/pos1");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.arcaniax.buildersutilities.commands.aliases;
|
||||
|
||||
import com.arcaniax.buildersutilities.Main;
|
||||
import com.arcaniax.buildersutilities.Settings;
|
||||
import com.arcaniax.buildersutilities.commands.system.ICommand;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class PosTwoAliasCommand implements ICommand {
|
||||
@Override
|
||||
public void execute(Player player, String[] args) {
|
||||
if (!player.hasPermission("builders.util.aliases")) {
|
||||
if (Settings.sendErrorMessages) {
|
||||
player.sendMessage(Main.MSG_ERROR + "You do not have access to this command.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Main.getInstance().getServer().dispatchCommand(player, "/pos2");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.arcaniax.buildersutilities.commands.aliases;
|
||||
|
||||
import com.arcaniax.buildersutilities.Main;
|
||||
import com.arcaniax.buildersutilities.Settings;
|
||||
import com.arcaniax.buildersutilities.commands.system.ICommand;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class ReplaceAliasCommand implements ICommand {
|
||||
@Override
|
||||
public void execute(Player player, String[] args) {
|
||||
if (!player.hasPermission("builders.util.aliases")) {
|
||||
if (Settings.sendErrorMessages) {
|
||||
player.sendMessage(Main.MSG_ERROR + "You do not have access to this command.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (args.length != 0) {
|
||||
for (String arg : args) {
|
||||
builder.append(arg).append(" ");
|
||||
}
|
||||
}
|
||||
|
||||
Main.getInstance().getServer().dispatchCommand(player, "/replace " + builder.toString());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.arcaniax.buildersutilities.commands.aliases;
|
||||
|
||||
import com.arcaniax.buildersutilities.Main;
|
||||
import com.arcaniax.buildersutilities.Settings;
|
||||
import com.arcaniax.buildersutilities.commands.system.ICommand;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class ScaleAliasCommand implements ICommand {
|
||||
@Override
|
||||
public void execute(Player player, String[] args) {
|
||||
if (!player.hasPermission("builders.util.aliases")) {
|
||||
if (Settings.sendErrorMessages) {
|
||||
player.sendMessage(Main.MSG_ERROR + "You do not have access to this command.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.length != 1) {
|
||||
player.sendMessage(Main.MSG_PREFIX + ChatColor.RED + "//scale [size]");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
double size;
|
||||
try {
|
||||
size = Double.parseDouble(args[0]);
|
||||
} catch (Exception e) {
|
||||
player.sendMessage(Main.MSG_PREFIX + ChatColor.RED + "//scale [size]");
|
||||
return;
|
||||
}
|
||||
|
||||
Main.getInstance().getServer().dispatchCommand(player, "/deform x/=" + size + ";y/=" + size + ";z/=" + size);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.arcaniax.buildersutilities.commands.aliases;
|
||||
|
||||
import com.arcaniax.buildersutilities.Main;
|
||||
import com.arcaniax.buildersutilities.Settings;
|
||||
import com.arcaniax.buildersutilities.commands.system.ICommand;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class SetAliasCommand implements ICommand {
|
||||
@Override
|
||||
public void execute(Player player, String[] args) {
|
||||
if (!player.hasPermission("builders.util.aliases")) {
|
||||
if (Settings.sendErrorMessages) {
|
||||
player.sendMessage(Main.MSG_ERROR + "You do not have access to this command.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (args.length != 0) {
|
||||
for (String arg : args) {
|
||||
builder.append(arg).append(" ");
|
||||
}
|
||||
}
|
||||
|
||||
Main.getInstance().getServer().dispatchCommand(player, "/set " + builder.toString());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.arcaniax.buildersutilities.commands.aliases;
|
||||
|
||||
import com.arcaniax.buildersutilities.Main;
|
||||
import com.arcaniax.buildersutilities.Settings;
|
||||
import com.arcaniax.buildersutilities.commands.system.ICommand;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class TwistAliasCommand implements ICommand {
|
||||
private final float radiansPerDegree = 0.0174533f;
|
||||
|
||||
@Override
|
||||
public void execute(Player player, String[] args) {
|
||||
if (!player.hasPermission("builders.util.aliases")) {
|
||||
if (Settings.sendErrorMessages) {
|
||||
player.sendMessage(Main.MSG_ERROR + "You do not have access to this command.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.length != 2) {
|
||||
player.sendMessage(Main.MSG_PREFIX + ChatColor.RED + "//twist [axis] [degrees]");
|
||||
return;
|
||||
}
|
||||
|
||||
int degrees;
|
||||
try {
|
||||
degrees = Integer.parseInt(args[1]);
|
||||
} catch (Exception e) {
|
||||
player.sendMessage(Main.MSG_PREFIX + ChatColor.RED + "//twist [axis] [degrees]");
|
||||
return;
|
||||
}
|
||||
|
||||
float radian = degrees * radiansPerDegree;
|
||||
|
||||
if (args[0].equalsIgnoreCase("x")) {
|
||||
Main.getInstance().getServer().dispatchCommand(player, "/deform rotate(y,z," + radian / 2 + "*(x+1))");
|
||||
} else if (args[0].equalsIgnoreCase("y")) {
|
||||
Main.getInstance().getServer().dispatchCommand(player, "/deform rotate(x,z," + radian / 2 + "*(y+1))");
|
||||
} else if (args[0].equalsIgnoreCase("z")) {
|
||||
Main.getInstance().getServer().dispatchCommand(player, "/deform rotate(x,y," + radian / 2 + "*(z+1))");
|
||||
} else {
|
||||
player.sendMessage(Main.MSG_PREFIX + ChatColor.RED + "//twist [axis] [degrees]");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.arcaniax.buildersutilities.commands.aliases;
|
||||
|
||||
import com.arcaniax.buildersutilities.Main;
|
||||
import com.arcaniax.buildersutilities.Settings;
|
||||
import com.arcaniax.buildersutilities.commands.system.ICommand;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class WalkSpeedAliasCommand implements ICommand {
|
||||
@Override
|
||||
public void execute(Player player, String[] args) {
|
||||
if (!player.hasPermission("builders.util.aliases")) {
|
||||
if (Settings.sendErrorMessages) {
|
||||
player.sendMessage(Main.MSG_ERROR + "You do not have access to this command.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (args.length != 0) {
|
||||
for (String arg : args) {
|
||||
builder.append(arg).append(" ");
|
||||
}
|
||||
}
|
||||
|
||||
Main.getInstance().getServer().dispatchCommand(player, "speed walk " + builder.toString());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user