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

@@ -2,7 +2,6 @@ package carpet.mixins;
import carpet.CarpetSettings;
//import net.minecraft.block.Blocks;
import net.minecraft.class_5311;
import net.minecraft.entity.SpawnGroup;
import net.minecraft.util.math.BlockPos;
//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.FlatChunkGeneratorConfig;
//import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.chunk.StructuresConfig;
import net.minecraft.world.gen.feature.StructureFeature;
import org.spongepowered.asm.mixin.Mixin;
@@ -23,9 +23,9 @@ import java.util.List;
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
@@ -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));
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;
if (int_1 > 0 && list_1.size() > int_1 - 1 && this.random.nextInt(4) == 0) {
int_2 = 0;
@@ -28,7 +28,7 @@ public abstract class ServerWorld_tickMixin extends World
@Shadow protected abstract void processSyncedBlockEvents();
//@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)
{
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(
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)
{
if (TickSpeed.process_entities) this.method_29203();
if (TickSpeed.process_entities) tickTime();
}
@Redirect(method = "tick", at = @At(
@@ -36,8 +36,8 @@ public class SummonCommandMixin
{
ServerWorld world = (ServerWorld) entity.getEntityWorld();
BlockPos at = entity.getBlockPos();
LocalDifficulty localDifficulty_1 = world.getLocalDifficulty(at);
boolean boolean_2 = world.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && world.random.nextDouble() < (double)localDifficulty_1.getLocalDifficulty() * 0.01D;
LocalDifficulty localDifficulty_1 = world.getLocalDifficulty(at); //DO MOB SPAWNING
boolean boolean_2 = world.getGameRules().getBoolean(GameRules.field_19390) && world.random.nextDouble() < (double)localDifficulty_1.getLocalDifficulty() * 0.01D;
if (boolean_2) {
SkeletonHorseEntity skeletonHorseEntity_1 = (SkeletonHorseEntity) EntityType.SKELETON_HORSE.create(world);
skeletonHorseEntity_1.setTrapped(true);
@@ -1,13 +1,13 @@
package carpet.mixins;
import carpet.CarpetSettings;
import net.minecraft.class_5311;
import net.minecraft.entity.SpawnGroup;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.source.BiomeSource;
import net.minecraft.world.gen.StructureAccessor;
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.feature.Feature;
import net.minecraft.world.gen.feature.StructureFeature;
@@ -21,10 +21,9 @@ import java.util.List;
@Mixin(SurfaceChunkGenerator.class)
public abstract class SurfaceChunkGenerator_husksSpawnMixin extends ChunkGenerator
{
public SurfaceChunkGenerator_husksSpawnMixin(BiomeSource biomeSource, class_5311 arg)
public SurfaceChunkGenerator_husksSpawnMixin(BiomeSource biomeSource, StructuresConfig structuresConfig)
{
super(biomeSource, arg);
super(biomeSource, structuresConfig);
}
@Inject(method = "getEntitySpawnList", at = @At("HEAD"), cancellable = true)