mirror of
https://github.com/ViaVersion/ViaAprilFools.git
synced 2024-11-16 10:45:14 +01:00
Merge pull request #16 from FlorianMichael/via-update
Updated Via API usage
This commit is contained in:
commit
0407b1e886
@ -22,8 +22,8 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly "com.viaversion:viaversion:4.8.1"
|
||||
compileOnly("com.viaversion:viabackwards-common:4.8.1") {
|
||||
compileOnly "com.viaversion:viaversion:4.9.0-23w40a-SNAPSHOT"
|
||||
compileOnly("com.viaversion:viabackwards-common:4.9.0-23w40a-SNAPSHOT") {
|
||||
exclude group: "com.viaversion", module: "viaversion"
|
||||
}
|
||||
compileOnly "org.yaml:snakeyaml:2.2"
|
||||
|
@ -17,6 +17,7 @@
|
||||
*/
|
||||
package net.raphimc.viaaprilfools;
|
||||
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.util.Config;
|
||||
|
||||
import java.io.File;
|
||||
@ -29,11 +30,12 @@ public class ViaAprilFoolsConfig extends Config implements net.raphimc.viaaprilf
|
||||
|
||||
public ViaAprilFoolsConfig(final File configFile) {
|
||||
super(configFile);
|
||||
Via.getManager().getConfigurationProvider().register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reloadConfig() {
|
||||
super.reloadConfig();
|
||||
public void reload() {
|
||||
super.reload();
|
||||
this.loadFields();
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,8 @@
|
||||
*/
|
||||
package net.raphimc.viaaprilfools.platform;
|
||||
|
||||
public interface ViaAprilFoolsConfig {
|
||||
import com.viaversion.viaversion.api.configuration.Config;
|
||||
|
||||
public interface ViaAprilFoolsConfig extends Config {
|
||||
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ public interface ViaAprilFoolsPlatform {
|
||||
|
||||
default void init(final File dataFolder) {
|
||||
final ViaAprilFoolsConfig config = new ViaAprilFoolsConfig(new File(dataFolder, "viaaprilfools.yml"));
|
||||
config.reloadConfig();
|
||||
config.reload();
|
||||
ViaAprilFools.init(this, config);
|
||||
Via.getManager().getSubPlatforms().add(ViaAprilFools.IMPL_VERSION);
|
||||
|
||||
|
@ -111,7 +111,7 @@ public class EntityPackets20w14infinite {
|
||||
handler(wrapper -> {
|
||||
wrapper.write(Type.BYTE, (byte) -1); // Previous gamemode, set to none
|
||||
wrapper.write(Type.STRING_ARRAY, WORLD_NAMES); // World list - only used for command completion
|
||||
wrapper.write(Type.NBT, EntityPackets.DIMENSIONS_TAG); // Dimension registry
|
||||
wrapper.write(Type.NAMED_COMPOUND_TAG, EntityPackets.DIMENSIONS_TAG); // Dimension registry
|
||||
});
|
||||
handler(DIMENSION_HANDLER); // Dimension
|
||||
map(Type.LONG); // Seed
|
||||
|
Loading…
Reference in New Issue
Block a user