Skip to content

Commit 5b02a68

Browse files
committed
chore: rename classes/fields to match
1 parent 17acbc5 commit 5b02a68

18 files changed

+106
-109
lines changed

build.gradle.kts

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@
2222

2323
plugins {
2424
id("fabric-loom") version "0.12-SNAPSHOT" apply false
25-
id("io.github.juuxel.loom-quiltflower") version("1.7.2") apply false
25+
id("io.github.juuxel.loom-quiltflower") version("1.7.3") apply false
2626
id("org.cadixdev.licenser") version "0.6.1" apply false
2727
}
2828

2929
val modGroup = rootProject.property("mod.group").toString()
3030

3131
val minecraft = rootProject.property("minecraft.version").toString()
32-
val yarn = rootProject.property("yarn.build").toString()
3332
val loader = rootProject.property("loader.version").toString()
3433
val fabric = rootProject.property("fabric.version").toString()
3534

@@ -74,7 +73,7 @@ subprojects {
7473
"mappings"(project.extensions.getByType(net.fabricmc.loom.api.LoomGradleExtensionAPI::class).officialMojangMappings())
7574
"modImplementation"("net.fabricmc:fabric-loader:$loader")
7675

77-
val fabricApi = net.fabricmc.loom.configuration.FabricApiExtension(this@subprojects);
76+
val fabricApi = net.fabricmc.loom.configuration.FabricApiExtension(this@subprojects)
7877
fabricModules.forEach {
7978
"modCompileOnly"(fabricApi.module(it, fabric))
8079
}

gradle.properties

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ mod.group=dev.galacticraft
55

66
# Minecraft and Fabric Loader
77
minecraft.version=1.18.2
8-
yarn.build=3
9-
loader.version=0.14.6
8+
loader.version=0.14.8
109

1110
# Mod Dependencies
1211
fabric.version=0.53.4+1.18.2

lib/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx3G
33
# Mod Information
44
mod.id=dynworlds
55
mod.name=Dynamic Worlds
6-
mod.version=0.1.0
6+
mod.version=0.2.0
77

88
# Mod Dependencies
99
fabric.modules=\

lib/src/main/java/dev/galacticraft/dynworlds/api/DynamicWorldRegistry.java lib/src/main/java/dev/galacticraft/dynworlds/api/DynamicLevelRegistry.java

+26-26
Original file line numberDiff line numberDiff line change
@@ -28,60 +28,60 @@
2828
import net.minecraft.world.level.levelgen.WorldGenSettings;
2929

3030
/**
31-
* The registry for dynamic worlds.
31+
* The registry for dynamic levels.
3232
* Cast {@link net.minecraft.server.MinecraftServer} to this class to access the registry.
3333
* It is not possible to access the registry from the client.
3434
*
3535
* @since 0.1.0
3636
*/
37-
public interface DynamicWorldRegistry {
37+
public interface DynamicLevelRegistry {
3838
/**
39-
* Registers a new world and updates all clients with the new world.
40-
* NOTE: The world will not be loaded until the next tick.
39+
* Registers a new level and updates all clients with the new level.
40+
* NOTE: The level will not be loaded until the next tick.
4141
*
42-
* @param id The ID of the world.
42+
* @param id The ID of the level.
4343
* This ID must be unique and unused in the {@link net.minecraft.core.Registry#DIMENSION_TYPE_REGISTRY} registry and the {@link WorldGenSettings#dimensions()} registry.
44-
* @param stem The dimension stem for the world.
45-
* @param type The dimension type of the world.
44+
* @param stem The dimension stem for the level.
45+
* @param type The dimension type of the level.
4646
* @since 0.1.0
4747
*/
48-
void addDynamicWorld(ResourceLocation id, LevelStem stem, DimensionType type);
48+
void addDynamicLevel(ResourceLocation id, LevelStem stem, DimensionType type);
4949

5050
/**
51-
* Tests if a world with the given ID exists.
51+
* Tests if a level with the given ID exists.
5252
*
53-
* @param id The ID of the world.
54-
* @return True if the world exists, false otherwise.
55-
* If the world exists, you should not call {@link #addDynamicWorld(ResourceLocation, LevelStem, DimensionType)} with the same ID.
53+
* @param id The ID of the level.
54+
* @return True if the level exists, false otherwise.
55+
* If the level exists, you should not call {@link #addDynamicLevel(ResourceLocation, LevelStem, DimensionType)} with the same ID.
5656
* @since 0.1.0
5757
*/
58-
boolean worldExists(ResourceLocation id);
58+
boolean levelExists(ResourceLocation id);
5959

6060
/**
61-
* Returns whether a world with the given ID can be created.
61+
* Returns whether a level with the given ID can be created.
6262
*
63-
* @param id The ID of the world.
64-
* @return {@code true} if the world can be created, {@code false} otherwise.
63+
* @param id The ID of the level.
64+
* @return {@code true} if the level can be created, {@code false} otherwise.
6565
* @since 0.1.0
6666
*/
67-
boolean canCreateWorld(ResourceLocation id);
67+
boolean canCreateLevel(ResourceLocation id);
6868

6969
/**
70-
* Returns whether a world with the given ID can be deleted.
70+
* Returns whether a level with the given ID can be deleted.
7171
*
72-
* @param id The ID of the world.
73-
* @return {@code true} if the world can be deleted, {@code false} otherwise.
72+
* @param id The ID of the level.
73+
* @return {@code true} if the level can be deleted, {@code false} otherwise.
7474
* @since 0.1.0
7575
*/
76-
boolean canDestroyWorld(ResourceLocation id);
76+
boolean canDestroyLevel(ResourceLocation id);
7777

7878
/**
79-
* Erases a dynamic world from existence.
80-
* Players will be removed from the world using the provided player remover.
79+
* Erases a dynamic level from existence.
80+
* Players will be removed from the level using the provided player remover.
8181
*
82-
* @param id The ID of the world.
83-
* @param remover The method to remove players from the world.
82+
* @param id The ID of the level.
83+
* @param remover The method to remove players from the level.
8484
* @since 0.1.0
8585
*/
86-
void removeDynamicWorld(ResourceLocation id, PlayerRemover remover);
86+
void removeDynamicLevel(ResourceLocation id, PlayerRemover remover);
8787
}

lib/src/main/java/dev/galacticraft/dynworlds/impl/DynWorldsClient.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
package dev.galacticraft.dynworlds.impl;
2424

2525
import com.mojang.serialization.Lifecycle;
26-
import dev.galacticraft.dynworlds.impl.accessor.DynamicRegistryManagerImmutableImplAccessor;
27-
import dev.galacticraft.dynworlds.impl.mixin.SimpleRegistryAccessor;
26+
import dev.galacticraft.dynworlds.impl.accessor.ImmutableRegistryAccessAccessor;
27+
import dev.galacticraft.dynworlds.impl.mixin.MappedRegistryAccessor;
2828
import net.fabricmc.api.ClientModInitializer;
2929
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
3030
import net.minecraft.core.Registry;
@@ -42,17 +42,17 @@ public void onInitializeClient() {
4242
ResourceLocation id = buf.readResourceLocation();
4343
int rawId = buf.readInt();
4444
DimensionType type = DimensionType.DIRECT_CODEC.decode(NbtOps.INSTANCE, buf.readNbt()).get().orThrow().getFirst();
45-
((DynamicRegistryManagerImmutableImplAccessor) handler.registryAccess()).unfreezeTypes(reg -> reg.registerOrOverride(OptionalInt.of(rawId), ResourceKey.create(Registry.DIMENSION_TYPE_REGISTRY, id), type, Lifecycle.stable()));
45+
((ImmutableRegistryAccessAccessor) handler.registryAccess()).unfreezeTypes(reg -> reg.registerOrOverride(OptionalInt.of(rawId), ResourceKey.create(Registry.DIMENSION_TYPE_REGISTRY, id), type, Lifecycle.stable()));
4646
handler.levels().add(ResourceKey.create(Registry.DIMENSION_REGISTRY, id));
4747
});
4848

4949
ClientPlayNetworking.registerGlobalReceiver(Constant.id("destroy_world"), (client, handler, buf, responseSender) -> {
5050
ResourceLocation id = buf.readResourceLocation();
51-
((DynamicRegistryManagerImmutableImplAccessor) handler.registryAccess()).unfreezeTypes(reg -> {
51+
((ImmutableRegistryAccessAccessor) handler.registryAccess()).unfreezeTypes(reg -> {
5252
DimensionType dimensionType = reg.get(id);
5353
int rawId = reg.getId(dimensionType);
5454
if (dimensionType != null) {
55-
SimpleRegistryAccessor<DimensionType> accessor = (SimpleRegistryAccessor<DimensionType>) reg;
55+
MappedRegistryAccessor<DimensionType> accessor = (MappedRegistryAccessor<DimensionType>) reg;
5656
accessor.getLifecycles().remove(dimensionType);
5757
accessor.getById().remove(rawId);
5858
accessor.getToId().removeInt(dimensionType);

lib/src/main/java/dev/galacticraft/dynworlds/impl/accessor/DynamicRegistryManagerImmutableImplAccessor.java lib/src/main/java/dev/galacticraft/dynworlds/impl/accessor/ImmutableRegistryAccessAccessor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
import dev.galacticraft.dynworlds.impl.util.RegistryAppender;
2626
import net.minecraft.world.level.dimension.DimensionType;
2727

28-
public interface DynamicRegistryManagerImmutableImplAccessor {
28+
public interface ImmutableRegistryAccessAccessor {
2929
/**
30-
* Unfreezes the DimensionType registry for the addition and removal of worlds.
30+
* Unfreezes the {@link DimensionType} registry for the addition and removal of worlds.
3131
*
3232
* @param appender Callback to execute while the registry is unfrozen.
3333
*/

lib/src/main/java/dev/galacticraft/dynworlds/impl/accessor/SavePropertiesAccessor.java lib/src/main/java/dev/galacticraft/dynworlds/impl/accessor/PrimaryLevelDataAccessor.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727

2828
import java.util.Map;
2929

30-
public interface SavePropertiesAccessor {
31-
void addDynamicWorld(ResourceLocation id, LevelStem options);
30+
public interface PrimaryLevelDataAccessor {
31+
void addDynamicLevel(ResourceLocation id, LevelStem stem);
3232

33-
void removeDynamicWorld(ResourceLocation id);
33+
void removeDynamicLevel(ResourceLocation id);
3434

3535
Map<ResourceLocation, LevelStem> getDynamicWorlds();
3636
}

lib/src/main/java/dev/galacticraft/dynworlds/impl/mixin/ThreadedAnvilChunkStorageAccessor.java lib/src/main/java/dev/galacticraft/dynworlds/impl/mixin/ChunkMapAccessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import org.spongepowered.asm.mixin.gen.Accessor;
2828

2929
@Mixin(ChunkMap.class)
30-
public interface ThreadedAnvilChunkStorageAccessor {
30+
public interface ChunkMapAccessor {
3131
@Accessor("viewDistance")
3232
int getViewDistance();
3333
}

lib/src/main/java/dev/galacticraft/dynworlds/impl/mixin/ChunkTicketManagerAccessor.java lib/src/main/java/dev/galacticraft/dynworlds/impl/mixin/DistanceManagerAccessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import org.spongepowered.asm.mixin.gen.Accessor;
2828

2929
@Mixin(DistanceManager.class)
30-
public interface ChunkTicketManagerAccessor {
30+
public interface DistanceManagerAccessor {
3131
@Accessor("simulationDistance")
3232
int getSimulationDistance();
3333
}

lib/src/main/java/dev/galacticraft/dynworlds/impl/mixin/RegistryEntryReferenceInvoker.java lib/src/main/java/dev/galacticraft/dynworlds/impl/mixin/HolderReferenceInvoker.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import org.spongepowered.asm.mixin.gen.Invoker;
2929

3030
@Mixin(Holder.Reference.class)
31-
public interface RegistryEntryReferenceInvoker<T> {
31+
public interface HolderReferenceInvoker<T> {
3232
@Invoker("bind")
3333
void callBind(ResourceKey<T> key, T value);
3434
}

lib/src/main/java/dev/galacticraft/dynworlds/impl/mixin/DynamicRegistryManagerImmutableImplMixin.java lib/src/main/java/dev/galacticraft/dynworlds/impl/mixin/ImmutableRegistryAccessMixin.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
package dev.galacticraft.dynworlds.impl.mixin;
2424

25-
import dev.galacticraft.dynworlds.impl.accessor.DynamicRegistryManagerImmutableImplAccessor;
25+
import dev.galacticraft.dynworlds.impl.accessor.ImmutableRegistryAccessAccessor;
2626
import dev.galacticraft.dynworlds.impl.util.RegistryAppender;
2727
import net.minecraft.core.DefaultedRegistry;
2828
import net.minecraft.core.MappedRegistry;
@@ -38,7 +38,7 @@
3838
import java.util.Map;
3939

4040
@Mixin(RegistryAccess.ImmutableRegistryAccess.class)
41-
public abstract class DynamicRegistryManagerImmutableImplMixin implements DynamicRegistryManagerImmutableImplAccessor {
41+
public abstract class ImmutableRegistryAccessMixin implements ImmutableRegistryAccessAccessor {
4242
@Shadow
4343
@Final
4444
private Map<? extends ResourceKey<? extends Registry<?>>, ? extends Registry<?>> registries;
@@ -50,7 +50,7 @@ public void unfreezeTypes(@NotNull RegistryAppender<DimensionType> appender) {
5050
// if the registry is not a vanilla registry type, we cannot guarantee that unfreezing the registry won't break stuff.
5151
&& (simple.getClass() == MappedRegistry.class || simple.getClass() == DefaultedRegistry.class)
5252
) {
53-
SimpleRegistryAccessor<DimensionType> accessor = ((SimpleRegistryAccessor<DimensionType>) simple);
53+
MappedRegistryAccessor<DimensionType> accessor = ((MappedRegistryAccessor<DimensionType>) simple);
5454
if (accessor.isFrozen()) {
5555
accessor.setFrozen(false); // safe as there should be no new intrusive holders of this registry as it was already frozen
5656
appender.register(simple);

lib/src/main/java/dev/galacticraft/dynworlds/impl/mixin/SimpleRegistryAccessor.java lib/src/main/java/dev/galacticraft/dynworlds/impl/mixin/MappedRegistryAccessor.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import java.util.Map;
3737

3838
@Mixin(MappedRegistry.class)
39-
public interface SimpleRegistryAccessor<T> {
39+
public interface MappedRegistryAccessor<T> {
4040
@Accessor("byId")
4141
ObjectList<Holder.Reference<T>> getById();
4242

0 commit comments

Comments
 (0)