This commit is contained in:
gnembon committed 2020-05-29 12:15:51 -03:00
1 parent 61524b1486
commit 3b588e8488
20 files changed
+103 -98

No files matched your search

@@ -66,8 +66,8 @@ public abstract class PistonBlock_movableTEMixin extends FacingBlock
target = "Ljava/util/List;size()I", ordinal = 4),locals = LocalCapture.CAPTURE_FAILHARD)
private void onMove(World world_1, BlockPos blockPos_1, Direction direction_1, boolean boolean_1,
CallbackInfoReturnable<Boolean> cir, BlockPos blockPos_2, PistonHandler pistonHandler_1, Map map_1,
List<BlockPos> list_1, List<BlockState> list_2, List list_3, int int_2, BlockState[] blockStates_1,
Direction direction_2)
List<BlockPos> list_1, List<BlockState> list_2, List list_3, BlockState[] blockStates_1,
Direction direction_2, int int_2)
{
//Get the blockEntities and remove them from the world before any magic starts to happen
if (CarpetSettings.movableBlockEntities)
@@ -95,7 +95,7 @@ public abstract class PistonBlock_movableTEMixin extends FacingBlock
locals = LocalCapture.CAPTURE_FAILHARD)
private void setBlockEntityWithCarried(World world_1, BlockPos blockPos_1, Direction direction_1, boolean boolean_1,
CallbackInfoReturnable<Boolean> cir, BlockPos blockPos_2, PistonHandler pistonHandler_1, Map map_1, List list_1,
List list_2, List list_3, int int_2, BlockState[] blockStates_1, Direction direction_2,
List list_2, List list_3, BlockState[] blockStates_1, Direction direction_2, int int_2,
int int_3, BlockPos blockPos_4, BlockState blockState_1)
{
BlockEntity blockEntityPiston = PistonExtensionBlock.createBlockEntityPiston((BlockState) list_2.get(int_3),
@@ -10,6 +10,7 @@ import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.SpawnHelper;
import net.minecraft.world.World;
import net.minecraft.world.WorldProperties;
import net.minecraft.world.chunk.WorldChunk;
import net.minecraft.world.dimension.DimensionType;
@@ -48,7 +49,7 @@ public abstract class ServerChunkManagerMixin implements ServerChunkManagerInter
private int setupTracking(ChunkTicketManager chunkTicketManager)
{
int j = chunkTicketManager.getSpawningChunkCount();
RegistryKey<DimensionType> dim = this.world.method_27983(); // getDimensionType;
RegistryKey<World> dim = this.world.method_27983(); // getDimensionType;
//((WorldInterface)world).getPrecookedMobs().clear(); not needed because mobs are compared with predefined BBs
SpawnReporter.chunkCounts.put(dim, j);
@@ -78,7 +79,7 @@ public abstract class ServerChunkManagerMixin implements ServerChunkManagerInter
{
for (SpawnGroup cat: SpawnGroup.values())
{
RegistryKey<DimensionType> dim = world.method_27983(); // getDimensionType;
RegistryKey<World> dim = world.method_27983(); // getDimensionType;
Pair key = Pair.of(dim, cat);
int spawnTries = SpawnReporter.spawn_tries.get(cat);
if (!SpawnReporter.local_spawns.containsKey(cat))
@@ -89,7 +89,7 @@ public abstract class ServerPlayerEntity_scarpetEventMixin extends PlayerEntity
}
private Vec3d previousLocation;
private RegistryKey<DimensionType> previousDimension;
private RegistryKey<World> previousDimension;
@Inject(method = "changeDimension", at = @At("HEAD"))
private void logPreviousCoordinates(RegistryKey<DimensionType> newDimension, CallbackInfoReturnable<Entity> cir)
@@ -99,13 +99,13 @@ public abstract class ServerPlayerEntity_scarpetEventMixin extends PlayerEntity
}
@Inject(method = "changeDimension", at = @At("RETURN"))
private void atChangeDimension(RegistryKey<DimensionType> newDimension, CallbackInfoReturnable<Entity> cir)
private void atChangeDimension(RegistryKey<World> newDimension, CallbackInfoReturnable<Entity> cir)
{
if (PLAYER_CHANGES_DIMENSION.isNeeded())
{
ServerPlayerEntity player = (ServerPlayerEntity) (Object)this;
Vec3d to = null;
if (!notInAnyWorld || previousDimension != DimensionType.THE_END_REGISTRY_KEY || newDimension != DimensionType.OVERWORLD_REGISTRY_KEY) // end ow
if (!notInAnyWorld || previousDimension != World.field_25181 || newDimension != World.field_25179) // end ow
{
to = getPos();
}
@@ -5,6 +5,7 @@ import carpet.utils.CarpetProfiler;
import net.minecraft.entity.raid.RaidManager;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.profiler.Profiler;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.MutableWorldProperties;
import net.minecraft.world.WanderingTraderManager;
import net.minecraft.world.World;
@@ -28,9 +29,9 @@ public abstract class ServerWorld_tickMixin extends World
//@Shadow protected abstract void sendBlockActions();
@Shadow protected abstract void method_29203();
protected ServerWorld_tickMixin(MutableWorldProperties mutableWorldProperties, 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, dimensionType, supplier, bl, bl2, l);
super(mutableWorldProperties, registryKey, registryKey2, dimensionType, supplier, bl, bl2, l);
}
private CarpetProfiler.ProfilerToken currentSection;
@@ -281,7 +281,7 @@ public class SpawnHelperMixin
SpawnGroup entityCategory = var6[var8];
if ((spawnAnimals || !entityCategory.isPeaceful()) && (spawnMonsters || entityCategory.isPeaceful()) && (shouldSpawnAnimals || !entityCategory.isAnimal()) )
{
RegistryKey<DimensionType> dim = world.method_27983(); // getDimensionType;
RegistryKey<World> dim = world.method_27983(); // getDimensionType;
int newCap = (int) ((double)entityCategory.getCapacity()*(Math.pow(2.0,(SpawnReporter.mobcap_exponent/4))));
int int_2 = SpawnReporter.chunkCounts.get(dim); // eligible chunks for spawning
int int_3 = newCap * int_2 / CHUNK_AREA; //current spawning limits
@@ -10,20 +10,22 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import java.util.Random;
@Mixin(StructureBlockBlockEntity.class)
public abstract class StructureBlockBlockEntity_fillUpdatesMixin
{
@Redirect(method = "place", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/structure/Structure;place(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;)V"
target = "Lnet/minecraft/structure/Structure;place(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;Ljava/util/Random;)V"
))
private void onStructurePlacen(Structure structure, WorldAccess WorldAccess_1, BlockPos blockPos_1, StructurePlacementData structurePlacementData_1)
private void onStructurePlacen(Structure structure, WorldAccess world, BlockPos pos, StructurePlacementData placementData, Random random)
{
if(!CarpetSettings.fillUpdates)
CarpetSettings.impendingFillSkipUpdates = true;
try
{
structure.place(WorldAccess_1, blockPos_1, structurePlacementData_1);
structure.place(world, pos, placementData, random);
}
finally
{
@@ -66,7 +66,7 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
}
//generator.ge getStructurePositionToReferenceMap(this).computeIfAbsent(chId,
// (x) -> new LongOpenHashSet()).add(chId);
world.getChunk(j, k).addStructureReference(this.getName(), chId); //, ChunkStatus.STRUCTURE_STARTS
world.getChunk(j, k).addStructureReference((StructureFeature) (Object)this, chId); //, ChunkStatus.STRUCTURE_STARTS
BlockBox box = structurestart.getBoundingBox();
if (!wireOnly)
@@ -93,7 +93,7 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
if (box.intersectsXZ(k1<<4, l1<<4, (k1<<4) + 15, (l1<<4) + 15))
{
//generator.getStructurePositionToReferenceMap(this).computeIfAbsent(nbchkid, (__) -> new LongOpenHashSet()).add(chId);
world.getChunk(k1, l1).addStructureReference(this.getName(), chId); //, ChunkStatus.STRUCTURE_STARTS
world.getChunk(k1, l1).addStructureReference((StructureFeature) (Object)this, chId); //, ChunkStatus.STRUCTURE_STARTS
//structurestart. notifyPostProcessAt(new ChunkPos(k1, l1));
}
}
@@ -121,7 +121,7 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
if (ichunk != null)
{
structurestart = ichunk.getStructureStart(this.getName());
structurestart = ichunk.getStructureStart((StructureFeature)(Object)this);
if (structurestart != null && structurestart != StructureStart.DEFAULT)
{
@@ -140,7 +140,7 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
if (structurestart.hasChildren())
{
worldIn.getChunk(chunkpos.x, chunkpos.z).setStructureStart(this.getName(), structurestart);
worldIn.getChunk(chunkpos.x, chunkpos.z).setStructureStart((StructureFeature)(Object)this, structurestart);
}
//long2objectmap.put(packedChunkPos, structurestart);
@@ -13,7 +13,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(Structure.class)
public class Structure_fillUpdatesMixin
{
@Redirect( method = "place(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;I)Z", at = @At(
@Redirect( method = "place(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;Ljava/util/Random;I)Z", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/WorldAccess;updateNeighbors(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;)V"
))
@@ -23,7 +23,7 @@ public class Structure_fillUpdatesMixin
WorldAccess.updateNeighbors(var1, var2);
}
@Redirect(method = "place(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;I)Z", at = @At(
@Redirect(method = "place(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/structure/StructurePlacementData;Ljava/util/Random;I)Z", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/structure/StructurePlacementData;shouldUpdateNeighbors()Z"
))