Skip to content

Commit

Permalink
update to 1.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
plusls committed Mar 4, 2022
1 parent 103733e commit 8e41bb1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 26 deletions.
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id('fabric-loom').version('0.10-SNAPSHOT')
id('fabric-loom').version('0.11-SNAPSHOT')
id('maven-publish')
id('org.ajoberstar.grgit').version('4.1.0')
}
Expand Down Expand Up @@ -36,7 +36,9 @@ dependencies {
// fabric-carpet
modImplementation("curse.maven:carpet-349239:${project.carpet_core_version}")
// multiconnect
modImplementation("net.earthcomputer.multiconnect:multiconnect-api:${project.multiconnect_version}")
modImplementation("net.earthcomputer.multiconnect:multiconnect-api:${project.multiconnect_version}") {
transitive = false
}
include("net.earthcomputer.multiconnect:multiconnect-api:${project.multiconnect_version}")
}

Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
org.gradle.jvmargs=-Xmx1G

# Minecraft Properties
minecraft_version=1.18.1
yarn_mappings=11
loader_version=0.12.12
minecraft_version=1.18.2
yarn_mappings=1
loader_version=0.13.3

# Mod Properties
mod_version=0.2.5
Expand All @@ -14,6 +14,6 @@ maven_group=com.plusls
archives_base_name=plusls-carpet-addition

# Dependencies
fabric_version=0.45.0+1.18
carpet_core_version=3542018
multiconnect_version=1.4.16
fabric_version=0.47.9+1.18.2
carpet_core_version=3667635
multiconnect_version=1.5.10
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.plusls.carpet.PcaSettings;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.profiler.Profiler;
import net.minecraft.util.registry.RegistryEntry;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.MutableWorldProperties;
import net.minecraft.world.StructureWorldAccess;
Expand All @@ -16,8 +17,9 @@

@Mixin(ServerWorld.class)
public abstract class MixinServerWorld extends World implements StructureWorldAccess {
protected MixinServerWorld(MutableWorldProperties properties, RegistryKey<World> registryRef, DimensionType dimensionType, Supplier<Profiler> profiler, boolean isClient, boolean debugWorld, long seed) {
super(properties, registryRef, dimensionType, profiler, isClient, debugWorld, seed);

protected MixinServerWorld(MutableWorldProperties properties, RegistryKey<World> registryRef, RegistryEntry<DimensionType> registryEntry, Supplier<Profiler> profiler, boolean isClient, boolean debugWorld, long seed) {
super(properties, registryRef, registryEntry, profiler, isClient, debugWorld, seed);
}

// 根据当前时间设置夜晚和白天
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,32 @@
package com.plusls.carpet.mixin.rule.spawnBiome;

import com.plusls.carpet.PcaSettings;
import net.minecraft.entity.SpawnGroup;
import net.minecraft.util.collection.Pool;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.RegistryEntry;
import net.minecraft.world.SpawnHelper;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.BiomeKeys;
import net.minecraft.world.biome.SpawnSettings;
import net.minecraft.world.gen.StructureAccessor;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.ModifyVariable;

@Mixin(SpawnHelper.class)
public class MixinSpawnHelper {
@Redirect(method = "getSpawnEntries",
at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/gen/chunk/ChunkGenerator;getEntitySpawnList(Lnet/minecraft/world/biome/Biome;Lnet/minecraft/world/gen/StructureAccessor;Lnet/minecraft/entity/SpawnGroup;Lnet/minecraft/util/math/BlockPos;)Lnet/minecraft/util/collection/Pool;"))
private static Pool<SpawnSettings.SpawnEntry> modifyBiome(ChunkGenerator chunkGenerator, Biome biome, StructureAccessor accessor, SpawnGroup group, BlockPos pos) {
@ModifyVariable(method = "getSpawnEntries",
at = @At(value = "HEAD"), ordinal = 0, argsOnly = true)
private static RegistryEntry<Biome> modifyBiome(RegistryEntry<Biome> biomeEntry) {
if (PcaSettings.spawnBiome != PcaSettings.PCA_SPAWN_BIOME.DEFAULT) {
if (PcaSettings.spawnBiome == PcaSettings.PCA_SPAWN_BIOME.DESERT) {
biome = BuiltinRegistries.BIOME.get(BiomeKeys.DESERT);
biomeEntry = RegistryEntry.of(BuiltinRegistries.BIOME.get(BiomeKeys.DESERT));
} else if (PcaSettings.spawnBiome == PcaSettings.PCA_SPAWN_BIOME.PLAINS) {
// BuiltinBiomes
biome = BuiltinRegistries.BIOME.get(BiomeKeys.PLAINS);
biomeEntry = RegistryEntry.of(BuiltinRegistries.BIOME.get(BiomeKeys.PLAINS));
} else if (PcaSettings.spawnBiome == PcaSettings.PCA_SPAWN_BIOME.THE_END) {
biome = BuiltinRegistries.BIOME.get(BiomeKeys.THE_END);
biomeEntry = RegistryEntry.of(BuiltinRegistries.BIOME.get(BiomeKeys.THE_END));
} else if (PcaSettings.spawnBiome == PcaSettings.PCA_SPAWN_BIOME.NETHER_WASTES) {
biome = BuiltinRegistries.BIOME.get(BiomeKeys.NETHER_WASTES);
biomeEntry = RegistryEntry.of(BuiltinRegistries.BIOME.get(BiomeKeys.NETHER_WASTES));
}
}
return chunkGenerator.getEntitySpawnList(biome, accessor, group, pos);
return biomeEntry;
}
}

0 comments on commit 8e41bb1

Please sign in to comment.