This commit is contained in:
gnembon committed 2020-06-10 02:10:40 -03:00
1 parent 40255457c5
commit 54eeab8bce
7 files changed
+15 -16

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx1G
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
# or better: https://modmuss50.me/fabric.html # or better: https://modmuss50.me/fabric.html
minecraft_version=1.16-pre2 minecraft_version=1.16-pre2
yarn_mappings=1.16-pre2+build.1 yarn_mappings=1.16-pre2+build.29
loader_version=0.8.7+build.201 loader_version=0.8.7+build.201
# Mod Properties # Mod Properties
@@ -6,7 +6,6 @@ import carpet.fakes.StructureFeatureInterface;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.class_5314;
import net.minecraft.server.world.ServerWorld; import net.minecraft.server.world.ServerWorld;
import net.minecraft.structure.StructureManager; import net.minecraft.structure.StructureManager;
import net.minecraft.structure.StructureStart; import net.minecraft.structure.StructureStart;
@@ -17,6 +16,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos; import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biomes; import net.minecraft.world.biome.Biomes;
import net.minecraft.world.gen.chunk.StructureConfig;
import net.minecraft.world.gen.feature.DefaultBiomeFeatures; import net.minecraft.world.gen.feature.DefaultBiomeFeatures;
import net.minecraft.world.biome.source.BiomeAccess; import net.minecraft.world.biome.source.BiomeAccess;
//import net.minecraft.world.biome.source.BiomeSource; //import net.minecraft.world.biome.source.BiomeSource;
@@ -128,7 +128,7 @@ public class FeatureGenerator
{ {
long seed = world.getSeed(); long seed = world.getSeed();
ChunkGenerator generator = world.getChunkManager().getChunkGenerator(); ChunkGenerator generator = world.getChunkManager().getChunkGenerator();
class_5314 params = generator.getConfig().method_28600(structure); StructureConfig params = generator.getConfig().method_28600(structure);
if (!generator.getBiomeSource().hasStructureFeature(structure)) if (!generator.getBiomeSource().hasStructureFeature(structure))
return null; return null;
BiomeAccess biomeAccess = world.getBiomeAccess().withSource(generator.getBiomeSource()); BiomeAccess biomeAccess = world.getBiomeAccess().withSource(generator.getBiomeSource());
@@ -2,7 +2,6 @@ package carpet.mixins;
import carpet.CarpetSettings; import carpet.CarpetSettings;
//import net.minecraft.block.Blocks; //import net.minecraft.block.Blocks;
import net.minecraft.class_5311;
import net.minecraft.entity.SpawnGroup; import net.minecraft.entity.SpawnGroup;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
//import net.minecraft.world.WorldAccess; //import net.minecraft.world.WorldAccess;
@@ -14,6 +13,7 @@ import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.chunk.FlatChunkGenerator; import net.minecraft.world.gen.chunk.FlatChunkGenerator;
//import net.minecraft.world.gen.chunk.FlatChunkGeneratorConfig; //import net.minecraft.world.gen.chunk.FlatChunkGeneratorConfig;
//import net.minecraft.world.gen.feature.Feature; //import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.chunk.StructuresConfig;
import net.minecraft.world.gen.feature.StructureFeature; import net.minecraft.world.gen.feature.StructureFeature;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
@@ -23,9 +23,9 @@ import java.util.List;
public abstract class FlatChunkGeneratorMixin extends ChunkGenerator public abstract class FlatChunkGeneratorMixin extends ChunkGenerator
{ {
public FlatChunkGeneratorMixin(BiomeSource biomeSource, class_5311 arg) public FlatChunkGeneratorMixin(BiomeSource biomeSource, StructuresConfig structuresConfig)
{ {
super(biomeSource, arg); super(biomeSource, structuresConfig);
} }
@Override @Override
@@ -32,7 +32,7 @@ public abstract class LivingEntity_maxCollisionsMixin extends Entity
{ {
List<Entity> list_1 = this.world.getEntities((Entity)this, this.getBoundingBox(), EntityPredicates.canBePushedBy(this)); List<Entity> list_1 = this.world.getEntities((Entity)this, this.getBoundingBox(), EntityPredicates.canBePushedBy(this));
if (!list_1.isEmpty()) { if (!list_1.isEmpty()) {
int int_1 = this.world.getGameRules().getInt(GameRules.MAX_ENTITY_CRAMMING); int int_1 = this.world.getGameRules().getInt(GameRules.field_19405);//max entity cramming
int int_2; int int_2;
if (int_1 > 0 && list_1.size() > int_1 - 1 && this.random.nextInt(4) == 0) { if (int_1 > 0 && list_1.size() > int_1 - 1 && this.random.nextInt(4) == 0) {
int_2 = 0; int_2 = 0;
@@ -28,7 +28,7 @@ public abstract class ServerWorld_tickMixin extends World
@Shadow protected abstract void processSyncedBlockEvents(); @Shadow protected abstract void processSyncedBlockEvents();
//@Shadow protected abstract void sendBlockActions(); //@Shadow protected abstract void sendBlockActions();
@Shadow protected abstract void method_29203(); @Shadow protected abstract void tickTime();
protected ServerWorld_tickMixin(MutableWorldProperties mutableWorldProperties, RegistryKey<World> registryKey, RegistryKey<DimensionType> registryKey2, DimensionType dimensionType, Supplier<Profiler> supplier, boolean bl, boolean bl2, long l) protected ServerWorld_tickMixin(MutableWorldProperties mutableWorldProperties, RegistryKey<World> registryKey, RegistryKey<DimensionType> registryKey2, DimensionType dimensionType, Supplier<Profiler> supplier, boolean bl, boolean bl2, long l)
{ {
super(mutableWorldProperties, registryKey, registryKey2, dimensionType, supplier, bl, bl2, l); super(mutableWorldProperties, registryKey, registryKey2, dimensionType, supplier, bl, bl2, l);
@@ -140,11 +140,11 @@ public abstract class ServerWorld_tickMixin extends World
@Redirect(method = "tick", at = @At( @Redirect(method = "tick", at = @At(
value = "INVOKE", value = "INVOKE",
target = "Lnet/minecraft/server/world/ServerWorld;method_29203()V" //tickTime() // right before chunk source target = "Lnet/minecraft/server/world/ServerWorld;tickTime()V" // right before chunk source
)) ))
private void tickTimeConditionally(ServerWorld serverWorld) private void tickTimeConditionally(ServerWorld serverWorld)
{ {
if (TickSpeed.process_entities) this.method_29203(); if (TickSpeed.process_entities) tickTime();
} }
@Redirect(method = "tick", at = @At( @Redirect(method = "tick", at = @At(
@@ -36,8 +36,8 @@ public class SummonCommandMixin
{ {
ServerWorld world = (ServerWorld) entity.getEntityWorld(); ServerWorld world = (ServerWorld) entity.getEntityWorld();
BlockPos at = entity.getBlockPos(); BlockPos at = entity.getBlockPos();
LocalDifficulty localDifficulty_1 = world.getLocalDifficulty(at); LocalDifficulty localDifficulty_1 = world.getLocalDifficulty(at); //DO MOB SPAWNING
boolean boolean_2 = world.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && world.random.nextDouble() < (double)localDifficulty_1.getLocalDifficulty() * 0.01D; boolean boolean_2 = world.getGameRules().getBoolean(GameRules.field_19390) && world.random.nextDouble() < (double)localDifficulty_1.getLocalDifficulty() * 0.01D;
if (boolean_2) { if (boolean_2) {
SkeletonHorseEntity skeletonHorseEntity_1 = (SkeletonHorseEntity) EntityType.SKELETON_HORSE.create(world); SkeletonHorseEntity skeletonHorseEntity_1 = (SkeletonHorseEntity) EntityType.SKELETON_HORSE.create(world);
skeletonHorseEntity_1.setTrapped(true); skeletonHorseEntity_1.setTrapped(true);
@@ -1,13 +1,13 @@
package carpet.mixins; package carpet.mixins;
import carpet.CarpetSettings; import carpet.CarpetSettings;
import net.minecraft.class_5311;
import net.minecraft.entity.SpawnGroup; import net.minecraft.entity.SpawnGroup;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.source.BiomeSource; import net.minecraft.world.biome.source.BiomeSource;
import net.minecraft.world.gen.StructureAccessor; import net.minecraft.world.gen.StructureAccessor;
import net.minecraft.world.gen.chunk.ChunkGenerator; import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.chunk.StructuresConfig;
import net.minecraft.world.gen.chunk.SurfaceChunkGenerator; import net.minecraft.world.gen.chunk.SurfaceChunkGenerator;
//import net.minecraft.world.gen.feature.Feature; //import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.StructureFeature; import net.minecraft.world.gen.feature.StructureFeature;
@@ -21,10 +21,9 @@ import java.util.List;
@Mixin(SurfaceChunkGenerator.class) @Mixin(SurfaceChunkGenerator.class)
public abstract class SurfaceChunkGenerator_husksSpawnMixin extends ChunkGenerator public abstract class SurfaceChunkGenerator_husksSpawnMixin extends ChunkGenerator
{ {
public SurfaceChunkGenerator_husksSpawnMixin(BiomeSource biomeSource, StructuresConfig structuresConfig)
public SurfaceChunkGenerator_husksSpawnMixin(BiomeSource biomeSource, class_5311 arg)
{ {
super(biomeSource, arg); super(biomeSource, structuresConfig);
} }
@Inject(method = "getEntitySpawnList", at = @At("HEAD"), cancellable = true) @Inject(method = "getEntitySpawnList", at = @At("HEAD"), cancellable = true)