Some renaming
This commit is contained in:
parent
9b537683ea
commit
44a008bcf0
3 changed files with 12 additions and 12 deletions
|
@ -34,7 +34,7 @@ public class CreateWorldScreenMixin {
|
||||||
public WorldGenSettingsComponent worldGenSettingsComponent;
|
public WorldGenSettingsComponent worldGenSettingsComponent;
|
||||||
|
|
||||||
@Inject(method = "<init>", at = @At("TAIL"))
|
@Inject(method = "<init>", at = @At("TAIL"))
|
||||||
private void bcl_init(
|
private void wt_init(
|
||||||
Screen screen,
|
Screen screen,
|
||||||
DataPackConfig dataPackConfig,
|
DataPackConfig dataPackConfig,
|
||||||
WorldGenSettingsComponent worldGenSettingsComponent,
|
WorldGenSettingsComponent worldGenSettingsComponent,
|
||||||
|
@ -45,13 +45,13 @@ public class CreateWorldScreenMixin {
|
||||||
|
|
||||||
//Change the WorldPreset that is selected by default on the Create World Screen
|
//Change the WorldPreset that is selected by default on the Create World Screen
|
||||||
@ModifyArg(method = "openFresh", index = 1, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screens/worldselection/WorldGenSettingsComponent;<init>(Lnet/minecraft/client/gui/screens/worldselection/WorldCreationContext;Ljava/util/Optional;Ljava/util/OptionalLong;)V"))
|
@ModifyArg(method = "openFresh", index = 1, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screens/worldselection/WorldGenSettingsComponent;<init>(Lnet/minecraft/client/gui/screens/worldselection/WorldCreationContext;Ljava/util/Optional;Ljava/util/OptionalLong;)V"))
|
||||||
private static Optional<ResourceKey<WorldPreset>> bcl_NewDefault(Optional<ResourceKey<WorldPreset>> preset) {
|
private static Optional<ResourceKey<WorldPreset>> wt_NewDefault(Optional<ResourceKey<WorldPreset>> preset) {
|
||||||
return Optional.of(WorldPresets.getDEFAULT());
|
return Optional.of(WorldPresets.getDEFAULT());
|
||||||
}
|
}
|
||||||
|
|
||||||
//Make sure the WorldGenSettings used to populate the create screen match the default WorldPreset
|
//Make sure the WorldGenSettings used to populate the create screen match the default WorldPreset
|
||||||
@ModifyArg(method = "openFresh", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/WorldLoader;load(Lnet/minecraft/server/WorldLoader$InitConfig;Lnet/minecraft/server/WorldLoader$WorldDataSupplier;Lnet/minecraft/server/WorldLoader$ResultFactory;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;"))
|
@ModifyArg(method = "openFresh", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/WorldLoader;load(Lnet/minecraft/server/WorldLoader$InitConfig;Lnet/minecraft/server/WorldLoader$WorldDataSupplier;Lnet/minecraft/server/WorldLoader$ResultFactory;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;)Ljava/util/concurrent/CompletableFuture;"))
|
||||||
private static WorldLoader.WorldDataSupplier<WorldGenSettings> bcl_NewDefaultSettings(WorldLoader.WorldDataSupplier<WorldGenSettings> worldDataSupplier) {
|
private static WorldLoader.WorldDataSupplier<WorldGenSettings> wt_NewDefaultSettings(WorldLoader.WorldDataSupplier<WorldGenSettings> worldDataSupplier) {
|
||||||
return (resourceManager, dataPackConfig) -> {
|
return (resourceManager, dataPackConfig) -> {
|
||||||
Pair<WorldGenSettings, RegistryAccess.Frozen> res = worldDataSupplier.get(resourceManager, dataPackConfig);
|
Pair<WorldGenSettings, RegistryAccess.Frozen> res = worldDataSupplier.get(resourceManager, dataPackConfig);
|
||||||
return WorldGenUtil.defaultWorldDataSupplier(res.getSecond());
|
return WorldGenUtil.defaultWorldDataSupplier(res.getSecond());
|
||||||
|
@ -60,7 +60,7 @@ public class CreateWorldScreenMixin {
|
||||||
|
|
||||||
//this is called when a new world is first created
|
//this is called when a new world is first created
|
||||||
@Inject(method = "createNewWorldDirectory", at = @At("RETURN"))
|
@Inject(method = "createNewWorldDirectory", at = @At("RETURN"))
|
||||||
void bcl_createNewWorld(CallbackInfoReturnable<Optional<LevelStorageSource.LevelStorageAccess>> cir) {
|
void wt_createNewWorld(CallbackInfoReturnable<Optional<LevelStorageSource.LevelStorageAccess>> cir) {
|
||||||
WorldBootstrap.InGUI.registryReadyOnNewWorld(this.worldGenSettingsComponent);
|
WorldBootstrap.InGUI.registryReadyOnNewWorld(this.worldGenSettingsComponent);
|
||||||
WorldBootstrap.InGUI.setupNewWorld(cir.getReturnValue(), this.worldGenSettingsComponent);
|
WorldBootstrap.InGUI.setupNewWorld(cir.getReturnValue(), this.worldGenSettingsComponent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ public abstract class WorldOpenFlowsMixin {
|
||||||
protected abstract void doLoadLevel(Screen screen, String levelID, boolean safeMode, boolean canAskForBackup);
|
protected abstract void doLoadLevel(Screen screen, String levelID, boolean safeMode, boolean canAskForBackup);
|
||||||
|
|
||||||
@Inject(method = "loadLevel", cancellable = true, at = @At("HEAD"))
|
@Inject(method = "loadLevel", cancellable = true, at = @At("HEAD"))
|
||||||
private void bcl_callFixerOnLoad(Screen screen, String levelID, CallbackInfo ci) {
|
private void wt_callFixerOnLoad(Screen screen, String levelID, CallbackInfo ci) {
|
||||||
WorldBootstrap.InGUI.setupLoadedWorld(levelID, this.levelSource);
|
WorldBootstrap.InGUI.setupLoadedWorld(levelID, this.levelSource);
|
||||||
|
|
||||||
//if (DataFixerAPI.fixData(this.levelSource, levelID, true, (appliedFixes) -> {
|
//if (DataFixerAPI.fixData(this.levelSource, levelID, true, (appliedFixes) -> {
|
||||||
|
@ -53,7 +53,7 @@ public abstract class WorldOpenFlowsMixin {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "createFreshLevel", at = @At("HEAD"))
|
@Inject(method = "createFreshLevel", at = @At("HEAD"))
|
||||||
public void bcl_createFreshLevel(
|
public void wt_createFreshLevel(
|
||||||
String levelID,
|
String levelID,
|
||||||
LevelSettings levelSettings,
|
LevelSettings levelSettings,
|
||||||
RegistryAccess registryAccess,
|
RegistryAccess registryAccess,
|
||||||
|
@ -64,7 +64,7 @@ public abstract class WorldOpenFlowsMixin {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "createLevelFromExistingSettings", at = @At("HEAD"))
|
@Inject(method = "createLevelFromExistingSettings", at = @At("HEAD"))
|
||||||
public void bcl_createLevelFromExistingSettings(
|
public void wt_createLevelFromExistingSettings(
|
||||||
LevelStorageSource.LevelStorageAccess levelStorageAccess,
|
LevelStorageSource.LevelStorageAccess levelStorageAccess,
|
||||||
ReloadableServerResources reloadableServerResources,
|
ReloadableServerResources reloadableServerResources,
|
||||||
RegistryAccess.Frozen frozen,
|
RegistryAccess.Frozen frozen,
|
||||||
|
|
|
@ -12,14 +12,14 @@ import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||||
|
|
||||||
@Mixin(DedicatedServerProperties.WorldGenProperties.class)
|
@Mixin(DedicatedServerProperties.WorldGenProperties.class)
|
||||||
public class WorldGenPropertiesMixin {
|
public class WorldGenPropertiesMixin {
|
||||||
@ModifyArg(method = "create", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/levelgen/presets/WorldPreset;createWorldGenSettings(JZZ)Lnet/minecraft/world/level/levelgen/WorldGenSettings;"))
|
// @ModifyArg(method = "create", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/levelgen/presets/WorldPreset;createWorldGenSettings(JZZ)Lnet/minecraft/world/level/levelgen/WorldGenSettings;"))
|
||||||
public long bcl_create(long seed) {
|
// public long wt_getSeed(long seed) {
|
||||||
return seed;
|
// return seed;
|
||||||
}
|
// }
|
||||||
|
|
||||||
//Make sure Servers use our Default World Preset
|
//Make sure Servers use our Default World Preset
|
||||||
@ModifyArg(method = "create", at = @At(value = "INVOKE", ordinal = 0, target = "Lnet/minecraft/core/Registry;getHolder(Lnet/minecraft/resources/ResourceKey;)Ljava/util/Optional;"))
|
@ModifyArg(method = "create", at = @At(value = "INVOKE", ordinal = 0, target = "Lnet/minecraft/core/Registry;getHolder(Lnet/minecraft/resources/ResourceKey;)Ljava/util/Optional;"))
|
||||||
private ResourceKey<WorldPreset> bcl_foo(ResourceKey<WorldPreset> resourceKey) {
|
private ResourceKey<WorldPreset> wt_returnDefault(ResourceKey<WorldPreset> resourceKey) {
|
||||||
return WorldPresets.getDEFAULT();
|
return WorldPresets.getDEFAULT();
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue