Compare commits

...
13 Commits
Author SHA1 Message Date
md678685 f7cbb141f8 Release 2.16.0
🎉
2019-01-03 20:47:24 +00:00
md678685 5690952516 Implement missing OfflinePlayer methods 2019-01-03 20:42:03 +00:00
md678685 e94202c55a Use 1.8-friendly User#getItemInHand method in commands 2019-01-03 20:33:08 +00:00
md678685 aa6ad271a0 Remove redundant metricsEnabled field from Settings 2019-01-03 20:33:08 +00:00
md678685 3b41bb47b6 Improve Travis build script (#2338)
I've added a new script at `scripts/buildtools.sh` that is responsible for:
* Checking whether CraftBukkit 1.8 and 1.8.3 are already available in the local Maven repo
* Downloading BuildTools if not already present
* Running BuildTools if necessary

This improves Travis build times as it now doesn't run BuildTools twice for *every single build*, instead running it only if the Travis cache fails and CraftBukkit is missing for some other reason.
2019-01-01 16:13:50 +00:00
md678685 e7bdb7fabc Improve the wording of the README's "Building" section 2019-01-01 15:42:45 +00:00
md678685 110698223d Travis: make build prep script executable 2019-01-01 15:23:35 +00:00
md678685 437be593b9 Add new build preparation script 2019-01-01 15:10:59 +00:00
md678685 502d37b574 Update Lombok to compile on Java 9+ 2018-12-31 17:44:08 +00:00
md678685 df59f9f859 Merge remote-tracking branch 'origin/2.x' into 1.13 2018-12-31 14:59:12 +00:00
md678685 f436fbab6b Remove redundant BuildTools runs 2018-12-31 14:54:59 +00:00
seema84 8404720501 change typos (#2328) @seema84
* change typos

* format text

* remove double color
2018-12-31 13:08:57 +00:00
md678685 246fd03265 Fix typo in README 2018-12-23 23:33:46 +00:00
16 changed files with 91 additions and 37 deletions

No files matched your search

+1
View File
@@ -39,6 +39,7 @@
/jars
/out
.idea/
.buildtools/
*.iml
*.classpath
*.project
+2 -15
View File
@@ -1,23 +1,10 @@
language: java
branches:
only:
- 2.x
- 1.13
cache:
directories:
- .buildtools
- $HOME/.m2
before_install:
- mkdir -p .buildtools
- cd .buildtools
- wget -O BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
- rm -r work/
- java -jar BuildTools.jar --rev 1.8
- java -jar BuildTools.jar --rev 1.8.3
- java -jar BuildTools.jar --rev 1.9
- java -jar BuildTools.jar --rev 1.9.4
- java -jar BuildTools.jar --rev 1.13.1
- cd ..
- chmod +x scripts/buildtools.sh
- scripts/buildtools.sh
@@ -787,6 +787,21 @@ public class OfflinePlayer implements Player {
public void setBedSpawnLocation(Location lctn, boolean force) {
}
@Override
public boolean sleep(Location location, boolean force) {
return false;
}
@Override
public void wakeup(boolean setSpawnLocation) {
}
@Override
public Location getBedLocation() {
return null;
}
@Override
public void playEffect(EntityEffect ee) {
}
@@ -36,7 +36,6 @@ public class Settings implements net.ess3.api.ISettings {
private final transient EssentialsConf config;
private static final Logger logger = Logger.getLogger("Essentials");
private final transient IEssentials ess;
private boolean metricsEnabled = true;
public Settings(IEssentials ess) {
this.ess = ess;
@@ -879,7 +879,7 @@ public class User extends UserData implements Comparable<User>, IMessageRecipien
* Returns the {@link ItemStack} in the main hand or off-hand. If the main hand is empty then the offhand item is returned - also nullable.
*/
public ItemStack getItemInHand() {
if (ReflUtil.getNmsVersionObject().isLowerThan(ReflUtil.V1_9_R1)) {
if (VersionUtil.getServerBukkitVersion().isLowerThan(VersionUtil.v1_9_R01)) {
return getBase().getInventory().getItemInHand();
} else {
PlayerInventory inventory = getBase().getInventory();
@@ -44,7 +44,7 @@ public class Commandfirework extends EssentialsCommand {
@Override
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception {
final ItemStack stack = user.getBase().getInventory().getItemInMainHand();
final ItemStack stack = user.getItemInHand();
if (MaterialUtil.isFirework(stack.getType())) {
if (args.length > 0) {
if (args[0].equalsIgnoreCase("clear")) {
@@ -33,8 +33,8 @@ public class Commandhat extends EssentialsCommand {
user.sendMessage(tl("hatRemoved"));
}
} else {
if (user.getBase().getInventory().getItemInMainHand().getType() != Material.AIR) {
final ItemStack hand = user.getBase().getInventory().getItemInMainHand();
final ItemStack hand = user.getItemInHand();
if (hand != null && hand.getType() != Material.AIR) {
if (hand.getType().getMaxDurability() == 0) {
final PlayerInventory inv = user.getBase().getInventory();
final ItemStack head = inv.getHelmet();
@@ -24,7 +24,7 @@ public class Commanditemdb extends EssentialsCommand {
if (args.length < 1) {
if (sender.isPlayer() && sender.getPlayer() != null) {
itemHeld = true;
itemStack = sender.getPlayer().getInventory().getItemInMainHand();
itemStack = ess.getUser(sender.getPlayer()).getItemInHand();
}
if (itemStack == null) {
throw new NotEnoughArgumentsException();
@@ -16,7 +16,7 @@ public class Commandmore extends EssentialsCommand {
@Override
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception {
final ItemStack stack = user.getBase().getInventory().getItemInMainHand();
final ItemStack stack = user.getItemInHand();
if (stack == null) {
throw new Exception(tl("cantSpawnItem", "Air"));
}
@@ -39,7 +39,7 @@ public class Commandrepair extends EssentialsCommand {
}
public void repairHand(User user) throws Exception {
final ItemStack item = user.getBase().getInventory().getItemInMainHand();
final ItemStack item = user.getItemInHand();
if (item == null || item.getType().isBlock() || item.getDurability() == 0) {
throw new Exception(tl("repairInvalidType"));
}
@@ -36,7 +36,7 @@ public class Commandskull extends EssentialsCommand {
owner = user.getName();
}
ItemStack itemSkull = user.getBase().getInventory().getItemInMainHand();
ItemStack itemSkull = user.getItemInHand();
SkullMeta metaSkull = null;
boolean spawn = false;
@@ -12,6 +12,7 @@ import java.util.regex.Pattern;
public class VersionUtil {
public static final BukkitVersion v1_8_8_R01 = BukkitVersion.fromString("1.8.8-R0.1-SNAPSHOT");
public static final BukkitVersion v1_9_R01 = BukkitVersion.fromString("1.9-R0.1-SNAPSHOT");
public static final BukkitVersion v1_9_4_R01 = BukkitVersion.fromString("1.9.4-R0.1-SNAPSHOT");
public static final BukkitVersion v1_10_2_R01 = BukkitVersion.fromString("1.10.2-R0.1-SNAPSHOT");
public static final BukkitVersion v1_11_2_R01 = BukkitVersion.fromString("1.11.2-R0.1-SNAPSHOT");
+1 -1
View File
@@ -575,7 +575,7 @@ versionOutputVaultMissing=\u00a74Vault ist nicht installiert. Der Chat und die P
versionOutputFine=\u00a76{0} Version: \u00a7a{1}
versionOutputWarn=\u00a76{0} Version: \u00a7c{1}
versionOutputUnsupported=\u00a7d{0} \u00a76Version: \u00a7d{1}
versionOutputUnsupportedPlugins=\u00a76Du verwendest Plugins, die \u00a7nicht unterst\u00fctzt\u00a76 werden.!
versionOutputUnsupportedPlugins=\u00a76Du verwendest Plugins, die \u00A7dnicht \u00a76unterst\u00fctzt werden!
versionMismatch=\u00a74Versionen sind nicht gleich\! Bitte aktualisiere {0}.
versionMismatchAll=\u00a74Versionen sind nicht gleich\! Bitte aktualisiere alle Essentials jar-Dateien auf die gleiche Version.
voiceSilenced=\u00a76Du bist nun stummgeschaltet\!
+10 -10
View File
@@ -16,7 +16,7 @@ The official upstream repository is at https://github.com/Essentials/Essentials.
Why use EssentialsX?
--------
EssentialsX is an unofficial continuation of EssentialsX, updated to support modern Minecraft and Spigot versions. It provides several performance enhancements and fixes that are currently not available in Essentials and Spigot-Essentials. [For more details, see the wiki.](https://essentialsx.github.io/#/Improvements)
EssentialsX is an unofficial continuation of Essentials, updated to support modern Minecraft and Spigot versions. It provides several performance enhancements and fixes that are currently not available in Essentials and Spigot-Essentials. [For more details, see the wiki.](https://essentialsx.github.io/#/Improvements)
EssentialsX is almost a completely drop-in replacement for Essentials. However, it has different requirements:
@@ -24,7 +24,7 @@ EssentialsX is almost a completely drop-in replacement for Essentials. However,
* **If you have an unsupported permissions plugin but still wish to use wildcards, enable `use-bukkit-permissions` in the configuration.** Otherwise, the plugin will fall back to config-based permissions.
* **EssentialsX requires Java 8 or higher.** On older versions, the plugin may not work properly.
* **EssentialsX requires Java 8 or higher.** On older versions, the plugin may not work properly.
* **EssentialsX supports Minecraft versions 1.8.8, 1.9.4, 1.10.2, 1.11.2 and 1.12.2.** Support for 1.13.2 is coming soon.
@@ -41,19 +41,19 @@ Building
--------
EssentialsX builds against the Spigot/CraftBukkit server software for legacy support.
To compile EssentialsX, you first need to run [BuildTools](https://www.spigotmc.org/wiki/buildtools) several times:
```
java -jar BuildTools.jar --rev 1.8
java -jar BuildTools.jar --rev 1.8.3
```
To compile EssentialsX, you first need to run [BuildTools](https://www.spigotmc.org/wiki/buildtools).
This only needs to be done once. There are two ways to do this:
Then, to build with Maven, run the following command:
* Use the provided script at `scripts/buildtools.sh` to automatically download and run BuildTools if needed.
* Download and run BuildTools yourself for versions `1.8` and `1.8.3`.
Next, to build EssentialsX with Maven, run the following command:
```
mvn clean install
```
Each module's jar can be found in `target/` inside each module's directory.
Each module's jar can be found in `target/` inside each module's directory.
Contributing
@@ -64,7 +64,7 @@ Want to help improve EssentialsX? There are numerous ways you can contribute to
If you'd like to make a financial contribution to the project, you can join our [Patreon](https://www.patreon.com/essentialsx/).
If you can't make a donation, don't worry! There's lots of other ways to contribute:
* Do you run a server? Take a look at our ["help wanted" issues](https://github.com/EssentialsX/Essentials/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22help+wanted%22),
* Do you run a server? Take a look at our ["help wanted" issues](https://github.com/EssentialsX/Essentials/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22help+wanted%22),
where you can find issues that need extra testing and investigation. You can also join the [MOSS Discord community](https://discord.gg/casfFyh)
and provide support to others.
* Do you speak multiple languages? If so, we always welcome pull requests to our [language files](https://essentialsx.github.io/#/Locale).
+2 -2
View File
@@ -66,7 +66,7 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.20</version>
<version>1.18.4</version>
<scope>provided</scope>
</dependency>
</dependencies>
@@ -266,7 +266,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- The plugins' release version -->
<release.version>2.16-pre4</release.version>
<release.version>2.16.0</release.version>
<!-- The plugins' build number -->
<build.version>${git.closest.tag.commit.count}</build.version>
+51
View File
@@ -0,0 +1,51 @@
#!/bin/bash
mkdir -p .buildtools
pushd .buildtools
is_installed() {
mvn dependency:get -q -Dartifact=$1 -DremoteRepositories=file://$HOME/.m2/repository 1>/dev/null 2>&1
return $?
}
ensure_buildtools() {
if [ ! -f "BuildTools.jar" ]; then
echo "Downloading BuildTools..."
wget -O BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
fi
}
run_buildtools() {
ensure_buildtools
java -jar BuildTools.jar --rev $1
if [ $? -ne 0 ]; then
echo "Running BuildTools for CB $1 failed! Aborting."
popd
exit 255
else
echo "Successfully built version $1"
fi
}
# Check CB 1.8
is_installed org.bukkit:craftbukkit:1.8-R0.1-SNAPSHOT
is_18=$? # 0 = present, 1 = not present
# Check CB 1.8.3
is_installed org.bukkit:craftbukkit:1.8.3-R0.1-SNAPSHOT
is_183=$?
if [ $is_18 -ne 0 ]; then
echo "Installing CraftBukkit 1.8..."
run_buildtools 1.8
else
echo "CraftBukkit 1.8 installed; skipping BuildTools..."
fi
if [ $is_183 -ne 0 ]; then
echo "Installing CraftBukkit 1.8.3..."
run_buildtools 1.8.3
else
echo "CraftBukkit 1.8.3 installed; skipping BuildTools..."
fi
popd