Skip to content

Commit 13f2475

Browse files
committed
Merge remote-tracking branch 'origin/dev'
2 parents e925a62 + 45d08e9 commit 13f2475

File tree

392 files changed

+6072
-4952
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

392 files changed

+6072
-4952
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ body:
7171
attributes:
7272
label: Additional Server Info
7373
description: |
74-
Do you use a proxy (eg. BungeeCord)? What software do you use and what plugins?
74+
Do you use a proxy (e.g. BungeeCord)? What software do you use and what plugins?
7575
placeholder: |
7676
Example: "I also use BungeeCord with the following plugins: x, y, z"
7777
validations:

api-legacy/src/main/java/us/myles/ViaVersion/api/protocol/ProtocolVersion.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public class ProtocolVersion {
8888
public static final ProtocolVersion v1_19_4 = register(762, "1.19.4");
8989
public static final ProtocolVersion v1_20 = register(763, "1.20/1.20.1", new VersionRange("1.20", 0, 1));
9090
public static final ProtocolVersion v1_20_2 = register(764, "1.20.2");
91+
public static final ProtocolVersion v1_20_3 = register(765, "1.20.3");
9192
public static final ProtocolVersion unknown = register(-1, "UNKNOWN");
9293

9394
public static ProtocolVersion register(int version, String name) {

api/build.gradle.kts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
plugins {
22
id("net.kyori.blossom")
33
id("org.jetbrains.gradle.plugin.idea-ext")
4-
id("via.shadow-conventions")
54
}
65

76
sourceSets {
@@ -22,7 +21,7 @@ dependencies {
2221
api(libs.fastutil)
2322
api(libs.flare)
2423
api(libs.flareFastutil)
25-
api(libs.openNBT)
24+
api(libs.vianbt)
2625
api(libs.gson)
2726

2827
compileOnlyApi(libs.snakeYaml)
@@ -34,3 +33,5 @@ dependencies {
3433
java {
3534
withJavadocJar()
3635
}
36+
37+
publishShadowJar()

api/src/main/java/com/viaversion/viaversion/api/ViaAPI.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ default int majorVersion() {
6363
* @return API version incremented with meaningful API changes
6464
*/
6565
default int apiVersion() {
66-
return 20;
66+
return 22;
6767
}
6868

6969
/**
@@ -117,7 +117,7 @@ default int apiVersion() {
117117
* Sends a raw packet to the player.
118118
*
119119
* @param player the platform's player object, e.g. for Bukkit this is Player
120-
* @param packet the packet; you need a VarInt Id, then the packet contents
120+
* @param packet the packet; you need a VarInt id, then the packet contents
121121
* @throws IllegalArgumentException if the player is not injected by Via
122122
*/
123123
void sendRawPacket(T player, ByteBuf packet);
@@ -126,7 +126,7 @@ default int apiVersion() {
126126
* Sends a raw packet to the player.
127127
*
128128
* @param uuid the uuid from the player to send packet
129-
* @param packet the packet; you need a VarInt Id, then the packet contents
129+
* @param packet the packet; you need a VarInt id, then the packet contents
130130
* @throws IllegalArgumentException if the player is not injected by Via
131131
*/
132132
void sendRawPacket(UUID uuid, ByteBuf packet);

api/src/main/java/com/viaversion/viaversion/api/ViaManager.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
package com.viaversion.viaversion.api;
2424

2525
import com.viaversion.viaversion.api.command.ViaVersionCommand;
26+
import com.viaversion.viaversion.api.configuration.ConfigurationProvider;
2627
import com.viaversion.viaversion.api.connection.ConnectionManager;
2728
import com.viaversion.viaversion.api.debug.DebugHandler;
2829
import com.viaversion.viaversion.api.platform.ViaInjector;
@@ -91,6 +92,13 @@ public interface ViaManager {
9192
*/
9293
Scheduler getScheduler();
9394

95+
/**
96+
* Returns the configuration provider.
97+
*
98+
* @return the configuration provider
99+
*/
100+
ConfigurationProvider getConfigurationProvider();
101+
94102
/**
95103
* If debug is enabled, packets and other otherwise suppressed warnings will be logged.
96104
*
@@ -138,4 +146,5 @@ default void setDebug(boolean debug) {
138146
* @return whether the manager has been initialized
139147
*/
140148
boolean isInitialized();
149+
141150
}

api/src/main/java/com/viaversion/viaversion/api/command/ViaCommandSender.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public interface ViaCommandSender {
2828
/**
2929
* Check if the sender has a permission.
3030
*
31-
* @param permission Permission string eg. viaversion.admin
31+
* @param permission Permission string e.g. viaversion.admin
3232
* @return True if the sender has the permission
3333
*/
3434
boolean hasPermission(String permission);

api/src/main/java/com/viaversion/viaversion/api/command/ViaSubCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public String usage() {
5858
* @return The permission required to use the commands
5959
*/
6060
public String permission() {
61-
return "viaversion.admin";
61+
return "viaversion.admin." + name();
6262
}
6363

6464
/**

api/src/main/java/com/viaversion/viaversion/api/command/ViaVersionCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public interface ViaVersionCommand {
3232
* @param command Your own SubCommand instance to handle it.
3333
* @throws Exception throws an exception when the subcommand already exists or if it's not valid, example: spacee
3434
*/
35-
void registerSubCommand(ViaSubCommand command) throws Exception;
35+
void registerSubCommand(ViaSubCommand command);
3636

3737
/**
3838
* Check if a subcommand is registered.

api/src/main/java/com/viaversion/viaversion/api/type/types/minecraft/BaseChunkType.java renamed to api/src/main/java/com/viaversion/viaversion/api/configuration/Config.java

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,34 @@
2020
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
* SOFTWARE.
2222
*/
23-
package com.viaversion.viaversion.api.type.types.minecraft;
23+
package com.viaversion.viaversion.api.configuration;
2424

25-
import com.viaversion.viaversion.api.minecraft.chunks.Chunk;
26-
import com.viaversion.viaversion.api.type.Type;
25+
import java.util.Map;
2726

28-
public abstract class BaseChunkType extends Type<Chunk> {
27+
public interface Config {
2928

30-
protected BaseChunkType() {
31-
super(Chunk.class);
32-
}
29+
/**
30+
* Reloads the config
31+
*/
32+
void reload();
3333

34-
protected BaseChunkType(String typeName) {
35-
super(typeName, Chunk.class);
36-
}
34+
/**
35+
* Saves the config
36+
*/
37+
void save();
3738

38-
@Override
39-
public Class<? extends Type> getBaseClass() {
40-
return BaseChunkType.class;
41-
}
39+
/**
40+
* Sets the specified path to the given value.
41+
*
42+
* @param path Path of the object to set.
43+
* @param value New value to set the path to
44+
*/
45+
void set(String path, Object value);
46+
47+
/**
48+
* Get all the configuration values
49+
*
50+
* @return Map with key-values
51+
*/
52+
Map<String, Object> getValues();
4253
}

api/src/main/java/com/viaversion/viaversion/api/configuration/ConfigurationProvider.java

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,26 @@
2222
*/
2323
package com.viaversion.viaversion.api.configuration;
2424

25-
import java.util.Map;
25+
import java.util.Collection;
2626

2727
public interface ConfigurationProvider {
2828

2929
/**
30-
* Sets the specified path to the given value.
30+
* Registers a config to be saved or reloaded when {@link #reloadConfigs()} is called.
3131
*
32-
* @param path Path of the object to set.
33-
* @param value New value to set the path to
32+
* @param config the config to register
3433
*/
35-
void set(String path, Object value);
34+
void register(Config config);
3635

3736
/**
38-
* Saves the config
39-
*/
40-
void saveConfig();
41-
42-
/**
43-
* Reloads the config
37+
* Returns all registered configs.
38+
*
39+
* @return unmodifiable collection of all registered configs
4440
*/
45-
void reloadConfig();
41+
Collection<Config> configs();
4642

4743
/**
48-
* Get all the configuration values
49-
*
50-
* @return Map with key-values
44+
* Reloads the configuration files.
5145
*/
52-
Map<String, Object> getValues();
46+
void reloadConfigs();
5347
}

0 commit comments

Comments
 (0)