Skip to content

Commit

Permalink
Merge pull request #553 from JorelAli/release/9.4.1
Browse files Browse the repository at this point in the history
Release/9.4.1
  • Loading branch information
JorelAli committed May 9, 2024
2 parents 5e1b22c + e333007 commit 43d31e0
Show file tree
Hide file tree
Showing 1,060 changed files with 57,369 additions and 3,198 deletions.
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = CommandAPI
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 9.4.0
PROJECT_NUMBER = 9.4.1

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
57 changes: 30 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,25 @@ The list of what version of the CommandAPI you'll need to run on a specific vers
| **1.14.1, 1.14.2** | v2.0 - 5.12, 8.3.0 - 8.8.0 | 8.8.0 | 16 |
| **1.14.3, 1.14.4** | v2.1 - 5.12, 8.3.0 - 8.8.0 | 8.8.0 | 16 |
| **1.15.x** | v2.3a - 5.12, 8.3.0 - 9.3.0 | 9.3.0 | 16 |
| **1.16.1** | v3.0 - 5.12, 8.3.0 - 9.4.0 | 9.4.0 | 16 |
| **1.16.2** | v4.0 - 5.12, 8.3.0 - 9.4.0 | 9.4.0 | 16 |
| **1.16.3** | v4.2 - 5.12, 8.3.0 - 9.4.0 | 9.4.0 | 16 |
| **1.16.4** | v5.2 - 5.12, 8.3.0 - 9.4.0 | 9.4.0 | 16 |
| **1.16.5** | v5.7 - 7.0.0, 8.3.0 - 9.4.0 | 9.4.0 | 16 |
| **1.17** | 6.0.x - 9.4.0 | 9.4.0 | 16 |
| **1.17.1** | 6.1.x - 9.4.0 | 9.4.0 | 16 |
| **1.18, 1.18.1** | 6.5.2 - 9.4.0 | 9.4.0 | 16 |
| **1.18.2** | 6.5.4 - 9.4.0 | 9.4.0 | 16 |
| **1.19** | 8.3.0 - 9.4.0 | 9.4.0 | 16 |
| **1.19.1** | 8.5.0 - 9.4.0 | 9.4.0 | 16 |
| **1.19.2** | 8.5.1 - 9.4.0 | 9.4.0 | 16 |
| **1.19.3** | 8.7.0 - 9.4.0 | 9.4.0 | 16 |
| **1.19.4** | 8.8.0 - 9.4.0 | 9.4.0 | 16 |
| **1.20** | 9.0.2 - 9.4.0 | 9.4.0 | 16 |
| **1.20.1** | 9.0.3 - 9.4.0 | 9.4.0 | 16 |
| **1.20.2** | 9.2.0 - 9.4.0 | 9.4.0 | 16 |
| **1.20.3, 1.20.4** | 9.3.0 - 9.4.0 | 9.4.0 | 16 |
| **1.20.5, 1.20.6** | 9.4.0 | 9.4.0 | 16 |
| **1.16.1** | v3.0 - 5.12, 8.3.0 - 9.4.1 | 9.4.1 | 16 |
| **1.16.2** | v4.0 - 5.12, 8.3.0 - 9.4.1 | 9.4.1 | 16 |
| **1.16.3** | v4.2 - 5.12, 8.3.0 - 9.4.1 | 9.4.1 | 16 |
| **1.16.4** | v5.2 - 5.12, 8.3.0 - 9.4.1 | 9.4.1 | 16 |
| **1.16.5** | v5.7 - 7.0.0, 8.3.0 - 9.4.1 | 9.4.1 | 16 |
| **1.17** | 6.0.x - 9.4.1 | 9.4.1 | 16 |
| **1.17.1** | 6.1.x - 9.4.1 | 9.4.1 | 16 |
| **1.18, 1.18.1** | 6.5.2 - 9.4.1 | 9.4.1 | 16 |
| **1.18.2** | 6.5.4 - 9.4.1 | 9.4.1 | 16 |
| **1.19** | 8.3.0 - 9.4.1 | 9.4.1 | 16 |
| **1.19.1** | 8.5.0 - 9.4.1 | 9.4.1 | 16 |
| **1.19.2** | 8.5.1 - 9.4.1 | 9.4.1 | 16 |
| **1.19.3** | 8.7.0 - 9.4.1 | 9.4.1 | 16 |
| **1.19.4** | 8.8.0 - 9.4.1 | 9.4.1 | 16 |
| **1.20** | 9.0.2 - 9.4.1 | 9.4.1 | 16 |
| **1.20.1** | 9.0.3 - 9.4.1 | 9.4.1 | 16 |
| **1.20.2** | 9.2.0 - 9.4.1 | 9.4.1 | 16 |
| **1.20.3, 1.20.4** | 9.3.0 - 9.4.1 | 9.4.1 | 16 |
| **1.20.5, 1.20.6** | 9.4.0 - 9.4.1 | 9.4.1 | 16 |

-----

Expand Down Expand Up @@ -319,14 +319,6 @@ plugins-to-convert:

-----

## Dependencies

Bukkit plugin (shaded) dependencies:

- [Item-NBT-API](https://github.com/tr7zw/Item-NBT-API) (MIT License)

-----

## Building the CommandAPI

The CommandAPI is built using the Maven build tool - if you don't have it, you can download it [here](https://maven.apache.org/download.cgi).
Expand Down Expand Up @@ -415,6 +407,17 @@ This is the current roadmap for the CommandAPI (as of 30th April 2024):
</tr>
</thead>
<tbody>
<tr>
<td valign="top"><b>9.4.1</b></td>
<td valign="top">May 2024</td>
<td valign="top">
<b>CommandAPI Changes:</b>
<ul>
<li>https://github.com/JorelAli/CommandAPI/issues/551 Fixes mojang-mapped versions of the CommandAPI causing errors in certain Minecraft versions</li>
<li>https://github.com/JorelAli/CommandAPI/issues/552 Adds a configuration option to disable datapack reloading on server load</li>
</ul>
</td>
</tr>
<tr>
<td valign="top"><b>9.4.0</b></td>
<td valign="top">April 2024</td>
Expand Down
2 changes: 1 addition & 1 deletion commandapi-annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<groupId>dev.jorel</groupId>
<artifactId>commandapi</artifactId>
<version>9.4.0</version>
<version>9.4.1</version>
</parent>

<artifactId>commandapi-annotations</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion commandapi-codecov/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>dev.jorel</groupId>
<artifactId>commandapi</artifactId>
<version>9.4.0</version>
<version>9.4.1</version>
</parent>

<artifactId>commandapi-codecov</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion commandapi-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<artifactId>commandapi</artifactId>
<groupId>dev.jorel</groupId>
<version>9.4.0</version>
<version>9.4.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/**
* This file handles loading the correct platform implementation. The CommandAPIVersionHandler
* file within the commandapi-core module is NOT used at run time. Instead, the platform modules
* replace this class with their own version that handles loads the correct class for their version
* replace this class with their own version that handles loads the correct class for their version.
*/
public interface CommandAPIVersionHandler {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package dev.jorel.commandapi;

/**
* This file handles loading the correct mappings information. The MojangMappedVersionHandler
* file within the commandapi-core module may not be used at run time. Instead, if a platform module
* wants to be mojang-mapped, they can replace this class with one where {@link #isMojangMapped()} returns {@code true}.
*/
public interface MojangMappedVersionHandler {
static boolean isMojangMapped() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public class SafeVarHandle<Type, FieldType> {

public static boolean USING_MOJANG_MAPPINGS = false; // This should only be set to true in testing.
public static boolean USING_MOJANG_MAPPINGS = MojangMappedVersionHandler.isMojangMapped();

private VarHandle handle;

Expand Down
2 changes: 1 addition & 1 deletion commandapi-documentation-code/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>commandapi</artifactId>
<groupId>dev.jorel</groupId>
<version>9.4.0</version>
<version>9.4.1</version>
</parent>

<artifactId>commandapi-documentation-code</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion commandapi-documentation-velocity-code/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>dev.jorel</groupId>
<artifactId>commandapi</artifactId>
<version>9.4.0</version>
<version>9.4.1</version>
</parent>

<artifactId>commandapi-documentation-velocity-code</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion commandapi-kotlin/commandapi-bukkit-kotlin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>dev.jorel</groupId>
<artifactId>commandapi-kotlin</artifactId>
<version>9.4.0</version>
<version>9.4.1</version>
</parent>

<artifactId>commandapi-bukkit-kotlin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion commandapi-kotlin/commandapi-core-kotlin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>dev.jorel</groupId>
<artifactId>commandapi-kotlin</artifactId>
<version>9.4.0</version>
<version>9.4.1</version>
</parent>

<artifactId>commandapi-core-kotlin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion commandapi-kotlin/commandapi-velocity-kotlin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>dev.jorel</groupId>
<artifactId>commandapi-kotlin</artifactId>
<version>9.4.0</version>
<version>9.4.1</version>
</parent>

<artifactId>commandapi-velocity-kotlin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion commandapi-kotlin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>dev.jorel</groupId>
<artifactId>commandapi</artifactId>
<version>9.4.0</version>
<version>9.4.1</version>
</parent>

<artifactId>commandapi-kotlin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>commandapi-bukkit</artifactId>
<groupId>dev.jorel</groupId>
<version>9.4.0</version>
<version>9.4.1</version>
</parent>
<artifactId>commandapi-bukkit-core</artifactId>
<repositories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,6 @@ public static InternalBukkitConfig getConfiguration() {
@Override
public void onLoad(CommandAPIConfig<?> config) {
if(config instanceof CommandAPIBukkitConfig bukkitConfig) {
// A little unconventional, but we really don't need to implement mojang mapping flags
// all over the place, we want it to have as minimal interaction as possible so it can
// be used by the test framework as a global static flag. Also, we want to set this
// as early as possible in the CommandAPI's loading sequence!
if (bukkitConfig.shouldUseMojangMappings) {
SafeVarHandle.USING_MOJANG_MAPPINGS = true;
}

CommandAPIBukkit.setInternalConfig(new InternalBukkitConfig(bukkitConfig));
} else {
CommandAPI.logError("CommandAPIBukkit was loaded with non-Bukkit config!");
Expand Down Expand Up @@ -225,7 +217,9 @@ public void onEnable() {
if (paper.isFoliaPresent()) {
CommandAPI.logNormal("Skipping initial datapack reloading because Folia was detected");
} else {
reloadDataPacks();
if (!getConfiguration().skipReloadDatapacks()) {
reloadDataPacks();
}
}
updateHelpForCommands(CommandAPI.getRegisteredCommands());
}, 0L);
Expand Down Expand Up @@ -422,7 +416,7 @@ void updateHelpForCommands(List<RegisteredCommand> commands) {
aliases.add(command.commandName());
aliases.remove(alias);

currentAliasSb.append(ChatColor.WHITE).append(String.join(", ", aliases));
currentAliasSb.append(String.join(", ", aliases));

// Don't override the plugin help topic
commandPrefix = generateCommandHelpPrefix(alias);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import io.papermc.paper.event.server.ServerResourcesReloadedEvent;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.regex.Pattern;

/**
* A class that contains information needed to configure the CommandAPI on Bukkit-based servers.
*/
Expand All @@ -14,7 +12,7 @@ public class CommandAPIBukkitConfig extends CommandAPIConfig<CommandAPIBukkitCon

// Default configuration
boolean shouldHookPaperReload = true;
boolean shouldUseMojangMappings = false;
boolean skipReloadDatapacks = false;

/**
* Creates a new CommandAPIBukkitConfig object. Variables in this
Expand All @@ -41,15 +39,34 @@ public CommandAPIBukkitConfig shouldHookPaperReload(boolean hooked) {
return this;
}

/**
* Sets whether the CommandAPI should skip its datapack reload step after the server
* has finished loading. This does not skip reloading of datapacks when invoked manually
* when {@link #shouldHookPaperReload(boolean)} is set.
* @param skip whether the CommandAPI should skip reloading datapacks when the server has finished loading
* @return this CommandAPIBukkitConfig
*/
public CommandAPIBukkitConfig skipReloadDatapacks(boolean skip) {
this.skipReloadDatapacks = skip;
return this;
}

/**
* Sets whether the CommandAPI should use Mojang mappings as opposed to Spigot's mappings
* for internal calls. If set to true, the CommandAPI will use Mojang mappings.
*
* @param useMojangMappings whether the CommandAPI should use Mojang mappings for internal calls
* @return this CommandAPIBukkitConfig
* @deprecated Use the `commandapi-bukkit-shade-mojang-mapped` depdendency instead of `commandapi-bukkit-shade` if you want to use mojang mappings.
*/
@Deprecated(since = "9.4.1", forRemoval = true)
public CommandAPIBukkitConfig useMojangMappings(boolean useMojangMappings) {
this.shouldUseMojangMappings = useMojangMappings;
// A little unconventional, but we really don't need to implement mojang mapping flags
// all over the place, we want it to have as minimal interaction as possible so it can
// be used by the test framework as a global static flag. Also, we want to set this
// as early as possible in the CommandAPI's loading sequence, including before loading
// an NMS class, which setup reflection based on `USING_MOJANG_MAPPINGS`.
SafeVarHandle.USING_MOJANG_MAPPINGS = useMojangMappings;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public class InternalBukkitConfig extends InternalConfig {

// Whether to hook into paper's reload event to reload datapacks when /minecraft:reload is run
private final boolean shouldHookPaperReload;

private final boolean skipReloadDatapacks;

/**
* Creates an {@link InternalBukkitConfig} from a {@link CommandAPIBukkitConfig}
Expand All @@ -24,6 +26,7 @@ public InternalBukkitConfig(CommandAPIBukkitConfig config) {
super(config);
this.plugin = config.plugin;
this.shouldHookPaperReload = config.shouldHookPaperReload;
this.skipReloadDatapacks = config.skipReloadDatapacks;
}

/**
Expand All @@ -41,4 +44,13 @@ public JavaPlugin getPlugin() {
public boolean shouldHookPaperReload() {
return shouldHookPaperReload;
}



/**
* @return Whether the CommandAPI should skip reloading datapacks when the server has finished loading
*/
public boolean skipReloadDatapacks() {
return skipReloadDatapacks;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2018, 2021 Jorel Ali (Skepter) - MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>commandapi-bukkit</artifactId>
<groupId>dev.jorel</groupId>
<version>9.4.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>commandapi-bukkit-mojang-mapped</artifactId>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package dev.jorel.commandapi;

/**
* This file handles loading the correct mappings information. The MojangMappedVersionHandler
* file within the commandapi-core module may not be used at run time. Instead, if a platform module
* wants to be mojang-mapped, they can replace it with this class where {@link #isMojangMapped()} returns {@code true}.
*/
public interface MojangMappedVersionHandler {
static boolean isMojangMapped() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>commandapi-bukkit-nms</artifactId>
<groupId>dev.jorel</groupId>
<version>9.4.0</version>
<version>9.4.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<artifactId>commandapi-bukkit-nms</artifactId>
<groupId>dev.jorel</groupId>
<version>9.4.0</version>
<version>9.4.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down

0 comments on commit 43d31e0

Please sign in to comment.