From f1b61f2ba8152250489bfd09f5af882cc078f70f Mon Sep 17 00:00:00 2001 From: northernlimit Date: Wed, 4 Sep 2024 19:16:51 +0200 Subject: [PATCH] Ayo server thingy fixed --- .../java/net/limit/cubliminal/Cubliminal.java | 1 - .../limit/cubliminal/CubliminalClient.java | 6 +- .../client/render/SkyboxRenderer.java | 1 + .../cubliminal/init/CubliminalBiomes.java | 2 +- .../init/CubliminalModelRenderers.java | 3 + .../cubliminal/init/CubliminalRegistrar.java | 97 ------------------- .../cubliminal/init/CubliminalWorlds.java | 15 +-- .../limit/cubliminal/mixin/EntityMixin.java | 4 +- 8 files changed, 14 insertions(+), 115 deletions(-) delete mode 100644 src/main/java/net/limit/cubliminal/init/CubliminalRegistrar.java diff --git a/src/main/java/net/limit/cubliminal/Cubliminal.java b/src/main/java/net/limit/cubliminal/Cubliminal.java index 9a3ef81..b2774f2 100644 --- a/src/main/java/net/limit/cubliminal/Cubliminal.java +++ b/src/main/java/net/limit/cubliminal/Cubliminal.java @@ -43,7 +43,6 @@ public void onInitialize() { CubliminalSounds.init(); CubliminalEntities.init(); CubliminalEffects.init(); - CubliminalModelRenderers.init(); FabricDefaultAttributeRegistry.register(CubliminalEntities.BACTERIA, BacteriaEntity.createBacteriaAttributes()); CubliminalBlockEntities.init(); CubliminalPackets.registerC2SPackets(); diff --git a/src/main/java/net/limit/cubliminal/CubliminalClient.java b/src/main/java/net/limit/cubliminal/CubliminalClient.java index 8abf1ce..658b616 100644 --- a/src/main/java/net/limit/cubliminal/CubliminalClient.java +++ b/src/main/java/net/limit/cubliminal/CubliminalClient.java @@ -13,10 +13,7 @@ import net.limit.cubliminal.entity.client.BacteriaRenderer; import net.limit.cubliminal.entity.client.SeatRenderer; import net.limit.cubliminal.event.KeyInputHandler; -import net.limit.cubliminal.init.CubliminalBlocks; -import net.limit.cubliminal.init.CubliminalEntities; -import net.limit.cubliminal.init.CubliminalModelLayers; -import net.limit.cubliminal.init.CubliminalPackets; +import net.limit.cubliminal.init.*; import net.minecraft.client.render.RenderLayer; @Environment(EnvType.CLIENT) @@ -27,6 +24,7 @@ public void onInitializeClient() { BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getTranslucent(), CubliminalBlocks.EMERGENCY_EXIT_DOOR_0, CubliminalBlocks.MOLD); KeyInputHandler.register(); + CubliminalModelRenderers.init(); EntityRendererRegistry .register(CubliminalEntities.BACTERIA, BacteriaRenderer::new); diff --git a/src/main/java/net/limit/cubliminal/client/render/SkyboxRenderer.java b/src/main/java/net/limit/cubliminal/client/render/SkyboxRenderer.java index 01562f6..28db0d9 100644 --- a/src/main/java/net/limit/cubliminal/client/render/SkyboxRenderer.java +++ b/src/main/java/net/limit/cubliminal/client/render/SkyboxRenderer.java @@ -20,6 +20,7 @@ import net.minecraft.util.math.Vec2f; import org.joml.Matrix4f; +@Environment(EnvType.CLIENT) public class SkyboxRenderer extends SpecialModelRenderer { private final String id; diff --git a/src/main/java/net/limit/cubliminal/init/CubliminalBiomes.java b/src/main/java/net/limit/cubliminal/init/CubliminalBiomes.java index c96286d..abd355e 100644 --- a/src/main/java/net/limit/cubliminal/init/CubliminalBiomes.java +++ b/src/main/java/net/limit/cubliminal/init/CubliminalBiomes.java @@ -24,7 +24,7 @@ public class CubliminalBiomes { public static void init() { getChunkGenerator("the_lobby_chunk_generator", LevelZeroChunkGenerator.CODEC); - //getBiomeSource("the_lobby_biome_source", LevelZeroBiomeSource.CODEC); + getBiomeSource("the_lobby_biome_source", LevelZeroBiomeSource.CODEC); } public static > D getChunkGenerator(String id, D chunkGeneratorCodec) { diff --git a/src/main/java/net/limit/cubliminal/init/CubliminalModelRenderers.java b/src/main/java/net/limit/cubliminal/init/CubliminalModelRenderers.java index 3453ea1..d5621cd 100644 --- a/src/main/java/net/limit/cubliminal/init/CubliminalModelRenderers.java +++ b/src/main/java/net/limit/cubliminal/init/CubliminalModelRenderers.java @@ -1,10 +1,13 @@ package net.limit.cubliminal.init; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.limit.cubliminal.Cubliminal; import net.limit.cubliminal.client.render.SkyboxRenderer; import net.ludocrypt.specialmodels.api.SpecialModelRenderer; import net.minecraft.registry.Registry; +@Environment(EnvType.CLIENT) public class CubliminalModelRenderers { public static final SpecialModelRenderer MANILA_SKYBOX_RENDERER = diff --git a/src/main/java/net/limit/cubliminal/init/CubliminalRegistrar.java b/src/main/java/net/limit/cubliminal/init/CubliminalRegistrar.java deleted file mode 100644 index 2d2259b..0000000 --- a/src/main/java/net/limit/cubliminal/init/CubliminalRegistrar.java +++ /dev/null @@ -1,97 +0,0 @@ -package net.limit.cubliminal.init; - -import com.mojang.serialization.Lifecycle; -import net.limit.cubliminal.Cubliminal; -import net.limit.cubliminal.world.biome.level_0.PillarBiome; -import net.limit.cubliminal.world.biome.level_0.RedroomsBiome; -import net.limit.cubliminal.world.biome.level_0.TheLobbyBiome; -import net.limit.cubliminal.world.chunk.LevelZeroChunkGenerator; -import net.ludocrypt.limlib.api.LimlibRegistrar; -import net.ludocrypt.limlib.api.LimlibRegistryHooks; -import net.ludocrypt.limlib.api.LimlibWorld; -import net.ludocrypt.limlib.api.effects.post.PostEffect; -import net.ludocrypt.limlib.api.effects.sky.LDimensionEffects; -import net.ludocrypt.limlib.api.effects.sky.StaticDimensionEffects; -import net.ludocrypt.limlib.api.effects.sound.SoundEffects; -import net.ludocrypt.limlib.api.effects.sound.reverb.StaticReverbEffect; -import net.ludocrypt.limlib.api.skybox.Skybox; -import net.minecraft.client.render.DimensionEffects; -import net.minecraft.registry.RegistryEntryLookup; -import net.minecraft.registry.RegistryKey; -import net.minecraft.registry.RegistryKeys; -import net.minecraft.registry.tag.TagKey; -import net.minecraft.util.Identifier; -import net.minecraft.util.math.intprovider.ConstantIntProvider; -import net.minecraft.world.World; -import net.minecraft.world.biome.source.FixedBiomeSource; -import net.minecraft.world.dimension.DimensionOptions; -import net.minecraft.world.dimension.DimensionType; -import net.minecraft.world.gen.carver.ConfiguredCarver; -import net.minecraft.world.gen.feature.PlacedFeature; - -import java.util.Optional; -import java.util.OptionalLong; - -public class CubliminalRegistrar implements LimlibRegistrar { - public static final Identifier THE_LOBBY_ID = Cubliminal.id("the_lobby"); - - public static final SoundEffects THE_LOBBY_SOUND_EFFECTS = new SoundEffects( - Optional.of(new StaticReverbEffect.Builder().setDecayTime(2.15f).setDensity(0.0725f).build()), - Optional.empty(), Optional.empty()); - - public static final LDimensionEffects THE_LOBBY_EFFECTS = new StaticDimensionEffects( - Optional.empty(), false, "NONE", false, - true, false, 0f); - - public static final LimlibWorld THE_LOBBY = - new LimlibWorld( - () -> new DimensionType(OptionalLong.of(15500), false, false, false, false, 1.0, false, false, 0, 384, 384, - TagKey.of(RegistryKeys.BLOCK, THE_LOBBY_ID), THE_LOBBY_ID, - 0f, new DimensionType.MonsterSettings(false, false, ConstantIntProvider.ZERO, 0)), - (registry) -> - new DimensionOptions( - registry.get(RegistryKeys.DIMENSION_TYPE) - .getOptional(RegistryKey.of(RegistryKeys.DIMENSION_TYPE, THE_LOBBY_ID)).get(), - new LevelZeroChunkGenerator( - new FixedBiomeSource(registry.get(RegistryKeys.BIOME) - .getOptional(CubliminalBiomes.THE_LOBBY_BIOME).get()), - LevelZeroChunkGenerator.createGroup(), 3 - ))); - - public static final RegistryKey THE_LOBBY_KEY = RegistryKey.of(RegistryKeys.WORLD, THE_LOBBY_ID); - - - @Override - public void registerHooks() { - LimlibWorld.LIMLIB_WORLD.add( - RegistryKey.of(LimlibWorld.LIMLIB_WORLD_KEY, THE_LOBBY_ID), THE_LOBBY, Lifecycle.stable() - ); - - LimlibRegistryHooks.hook(SoundEffects.SOUND_EFFECTS_KEY, - (infoLookup, registryKey, registry) -> registry.add( - RegistryKey.of(SoundEffects.SOUND_EFFECTS_KEY, Cubliminal.id("the_lobby_sound_effects")), - THE_LOBBY_SOUND_EFFECTS, - Lifecycle.stable())); - - LimlibRegistryHooks.hook(LDimensionEffects.DIMENSION_EFFECTS_KEY, - (infoLookup, registryKey, registry) -> registry.add( - RegistryKey.of(LDimensionEffects.DIMENSION_EFFECTS_KEY, Cubliminal.id("the_lobby_effects")), - THE_LOBBY_EFFECTS, - Lifecycle.stable())); - - - LimlibRegistryHooks.hook(RegistryKeys.BIOME, (infoLookup, registryKey, registry) -> { - RegistryEntryLookup features = infoLookup.getRegistryInfo(RegistryKeys.PLACED_FEATURE).get().entryLookup(); - RegistryEntryLookup> carvers = infoLookup.getRegistryInfo(RegistryKeys.CONFIGURED_CARVER).get().entryLookup(); - - registry.add(CubliminalBiomes.THE_LOBBY_BIOME, TheLobbyBiome.create(features, carvers), - Lifecycle.stable()); - - registry.add(CubliminalBiomes.PILLAR_BIOME, PillarBiome.create(features, carvers), - Lifecycle.stable()); - - registry.add(CubliminalBiomes.REDROOMS_BIOME, RedroomsBiome.create(features, carvers), - Lifecycle.stable()); - }); - } -} diff --git a/src/main/java/net/limit/cubliminal/init/CubliminalWorlds.java b/src/main/java/net/limit/cubliminal/init/CubliminalWorlds.java index ba66309..fd6cfe9 100644 --- a/src/main/java/net/limit/cubliminal/init/CubliminalWorlds.java +++ b/src/main/java/net/limit/cubliminal/init/CubliminalWorlds.java @@ -21,11 +21,9 @@ import net.minecraft.registry.RegistryEntryLookup; import net.minecraft.registry.RegistryKey; import net.minecraft.registry.RegistryKeys; -import net.minecraft.registry.SimpleRegistry; import net.minecraft.registry.tag.TagKey; import net.minecraft.util.math.intprovider.ConstantIntProvider; import net.minecraft.world.World; -import net.minecraft.world.biome.source.FixedBiomeSource; import net.minecraft.world.dimension.DimensionOptions; import net.minecraft.world.dimension.DimensionType; import net.minecraft.world.dimension.DimensionType.MonsterSettings; @@ -68,14 +66,10 @@ public void registerHooks() { .getOptional(RegistryKey.of(RegistryKeys.DIMENSION_TYPE, Cubliminal.id(THE_LOBBY))) .get(), new LevelZeroChunkGenerator( - new FixedBiomeSource(registry.get(RegistryKeys.BIOME).getOptional(CubliminalBiomes.THE_LOBBY_BIOME).get()) - /* new LevelZeroBiomeSource( registry.get(RegistryKeys.BIOME).getOptional(CubliminalBiomes.THE_LOBBY_BIOME).get(), registry.get(RegistryKeys.BIOME).getOptional(CubliminalBiomes.PILLAR_BIOME).get(), - registry.get(RegistryKeys.BIOME).getOptional(CubliminalBiomes.REDROOMS_BIOME).get()) - */ - , + registry.get(RegistryKeys.BIOME).getOptional(CubliminalBiomes.REDROOMS_BIOME).get()), LevelZeroChunkGenerator.createGroup(), 3)))); @@ -85,21 +79,20 @@ public void registerHooks() { LimlibRegistryHooks .hook(SoundEffects.SOUND_EFFECTS_KEY, (infoLookup, registryKey, registry) -> SOUND_EFFECTS .forEach((pair) -> registry.add(pair.getFirst(), pair.getSecond(), Lifecycle.stable()))); - /* + LimlibRegistryHooks .hook(Skybox.SKYBOX_KEY, (infoLookup, registryKey, registry) -> SKYBOXES .forEach((pair) -> registry.add(pair.getFirst(), pair.getSecond(), Lifecycle.stable()))); - */ LimlibRegistryHooks .hook(LDimensionEffects.DIMENSION_EFFECTS_KEY, (infoLookup, registryKey, registry) -> DIMENSION_EFFECTS .forEach((pair) -> registry.add(pair.getFirst(), pair.getSecond(), Lifecycle.stable()))); - /* + LimlibRegistryHooks .hook(PostEffect.POST_EFFECT_KEY, (infoLookup, registryKey, registry) -> POST_EFFECTS .forEach((pair) -> registry.add(pair.getFirst(), pair.getSecond(), Lifecycle.stable()))); - */ + LimlibRegistryHooks.hook(RegistryKeys.BIOME, (infoLookup, registryKey, registry) -> { RegistryEntryLookup features = infoLookup.getRegistryInfo(RegistryKeys.PLACED_FEATURE).get().entryLookup(); RegistryEntryLookup> carvers = infoLookup.getRegistryInfo(RegistryKeys.CONFIGURED_CARVER).get().entryLookup(); diff --git a/src/main/java/net/limit/cubliminal/mixin/EntityMixin.java b/src/main/java/net/limit/cubliminal/mixin/EntityMixin.java index 8c006bf..0cf4dba 100644 --- a/src/main/java/net/limit/cubliminal/mixin/EntityMixin.java +++ b/src/main/java/net/limit/cubliminal/mixin/EntityMixin.java @@ -28,9 +28,11 @@ private void onTryTickInVoid(CallbackInfo ci) { private void isImmuneToFire(CallbackInfoReturnable cir) { if (NoClipEngine.isNoClipping(this)) cir.setReturnValue(true); } - + /* @Inject(method = "move", at = @At("HEAD"), cancellable = true) private void suppressMovement(MovementType movementType, Vec3d movement, CallbackInfo ci) { if (!ParalyzingEntries.PARALYZING_ENTRIES.isEmpty()) ci.cancel(); } + + */ }