Make sure default level-type
in server-properties
is betterx
This commit is contained in:
parent
e670fea21a
commit
7d3ef6c756
1 changed files with 12 additions and 0 deletions
|
@ -9,6 +9,8 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||||
|
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
@Mixin(DedicatedServerProperties.class)
|
@Mixin(DedicatedServerProperties.class)
|
||||||
public class DedicatedServerPropertiesMixin {
|
public class DedicatedServerPropertiesMixin {
|
||||||
//Make sure the default server properties use our Default World Preset by default (read from "level-type")
|
//Make sure the default server properties use our Default World Preset by default (read from "level-type")
|
||||||
|
@ -20,4 +22,14 @@ public class DedicatedServerPropertiesMixin {
|
||||||
|
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ModifyArg(method = "<init>", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/dedicated/Settings;<init>(Ljava/util/Properties;)V"))
|
||||||
|
private static Properties wt_defaultPreset(Properties property) {
|
||||||
|
//init default value level preset in server.properties
|
||||||
|
property.setProperty(
|
||||||
|
"level-type",
|
||||||
|
property.getProperty("level-type", WorldPresets.getDEFAULT().location().toString())
|
||||||
|
);
|
||||||
|
return property;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue