Skip to content

Commit

Permalink
Merge master into b1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
CoPokBl committed Mar 26, 2024
2 parents 16fc97a + c825f3c commit b555f4d
Show file tree
Hide file tree
Showing 16 changed files with 47 additions and 33 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>net.serble.EsTools</groupId>
<artifactId>EsTools</artifactId>
<version>3.3</version>
<version>4.0</version>
<packaging>jar</packaging>

<name>EsTools</name>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/net/serble/estools/CMD.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ public static String[] removeArgs(String[] args, int amount) {
return outp;
}

public static String argsToString(String[] args, int amount) {
public static String argsToString(String[] args, int skipAmount) {
StringBuilder outp = new StringBuilder();

for (int i = amount; i < args.length; i++) {
for (int i = skipAmount; i < args.length; i++) {
outp.append(args[i]);
}

Expand Down
13 changes: 7 additions & 6 deletions src/main/java/net/serble/estools/Commands/Fix.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,17 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
Repair(is);
}

s(sender, "&aRepaired &6%s's &aitem(s)!", getEntityName(p));
return true;
}

private void Repair(ItemStack is) {
if (is == null)
return;
private void Repair(ItemStack is) {
if (is == null)
return;

//noinspection deprecation
is.setDurability((short) 0);
//noinspection deprecation
is.setDurability((short) 0);

}
}

}
10 changes: 6 additions & 4 deletions src/main/java/net/serble/estools/Commands/H.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ public boolean onCommand(CommandSender sender, Command command, String label, St

ItemStack is = Give.getItem(args[0], amount);

if (is != null)
setMainHand(p, is);
else
s(sender, "&cItem &6%s&c not found.", args[0]);
if (is != null) {
setMainHand(p, is);
s(sender, "&aGave &6%s", is.getType().name());
} else {
s(sender, "&cItem &6%s&c not found", args[0]);
}

return true;
}
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/net/serble/estools/Commands/Heal.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
} else {
p = getEntity(sender, args[0]);

if (p == null)
return false;
if (p == null) {
return false;
}

s(sender, "&aHealed &6%s", getEntityName(p));
}
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/net/serble/estools/Commands/I.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ public boolean onCommand(CommandSender sender, Command command, String label, St

ItemStack is = Give.getItem(args[0], amount);

if (is != null)
p.getInventory().addItem(is);
else
s(sender, "&cItem &6%s&c not found.", args[0]);
if (is != null) {
p.getInventory().addItem(is);
s(sender, "&aGave &6%s", is.getType().name());
} else {
s(sender, "&cItem &6%s&c not found", args[0]);
}

return true;
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/serble/estools/Commands/Night.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
return true;

((Player)sender).getWorld().setTime(13000);
s(sender, "&aSet time to &6night");
return true;
}

Expand Down
9 changes: 5 additions & 4 deletions src/main/java/net/serble/estools/Commands/SetHealth.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ public boolean onCommand(CommandSender sender, Command command, String label, St

setHealth(p, health);

if (args.length > 1)
s(sender, "&aSet health for &6%s&a to &6%s", getEntityName(p), String.valueOf(health));
else
s(sender, "&aSet health to &6%s", String.valueOf(health));
if (args.length > 1) {
s(sender, "&aSet health for &6%s&a to &6%s", getEntityName(p), String.valueOf(health));
} else {
s(sender, "&aSet health to &6%s", String.valueOf(health));
}
}
else
s(sender, "&cCannot set health to less than 0");
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/net/serble/estools/Commands/SetStack.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
}

getMainHand(((Player)sender)).setAmount(amount);


s(sender, "&aSet stack size to &6%d", amount);
return true;
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/net/serble/estools/Commands/Smite.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St

}

if (args.length > 0)
s(sender, "&aBAM!");
s(sender, "&aBAM!");
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/serble/estools/Commands/Sudo.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
com = new StringBuilder(com.toString().trim());

Bukkit.dispatchCommand(p, com.toString());

s(sender, "&aExecuted command &6%s&a as &6%s", com.toString(), p.getName());
return true;
}

Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/serble/estools/Commands/Suicide.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
}

setHealth(p, 0);
s(sender, "&aRest in peace");
return true;
}

Expand Down
1 change: 1 addition & 0 deletions src/main/java/net/serble/estools/Commands/Sun.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
return true;

((Player)sender).getWorld().setTime(1000);
s(sender, "&aSet time to &6day");
return true;
}

Expand Down
6 changes: 4 additions & 2 deletions src/main/java/net/serble/estools/Commands/Teleport/TPAll.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package net.serble.estools.Commands.Teleport;

import net.serble.estools.EntityCommand;
import net.serble.estools.Main;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.LivingEntity;
Expand All @@ -22,8 +20,12 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
}

for (LivingEntity t : getOnlinePlayers()) {
assert p != null;
t.teleport(p);
}

assert p != null;
s(sender, "&aTeleported all players to &6%s", getEntityName(p));
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
if (t != null)
t.teleport(p);
}

s(sender, "&aTeleported &6%s&a to &6%s", argsToString(args, 0), getEntityName(p));
return true;
}
}
8 changes: 4 additions & 4 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
main: net.serble.estools.Main
name: EsTools
description: Simple highly compatible general purpose plugin. Written for Bukkit beta 1.7.3
version: b7-4.0
version: '${project.version}'
authors: [Calcilator, CoPokBl]
api-version: 1.13

Expand Down Expand Up @@ -81,23 +81,23 @@ permissions:
estools.getinfo:
description: Lets people get info about a player
default: op

estools.give:
description: Lets people give themselves items
default: op

estools.reload:
description: Lets people reload config files
default: op

estools.fix:
description: Lets people repair items
default: op

estools.editsign:
description: Lets people edit signs
default: op

estools.setstack:
description: Lets people set the amount of itens in a stack
default: op
Expand Down

0 comments on commit b555f4d

Please sign in to comment.