mappings
This commit is contained in:
1 parent
42ba5a9f03
commit
cf817c2e39
25 files changed
+91
-92
No files matched your search
@@ -1,10 +1,10 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.class_5321;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
@@ -22,7 +22,7 @@ public abstract class Entity_portalSuffocationMixin
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/entity/Entity;getLastNetherPortalDirection()Lnet/minecraft/util/math/Direction;"
|
||||
))
|
||||
private void registerEntityDimensionChange(class_5321<DimensionType> newDimension, CallbackInfoReturnable<Entity> cir)
|
||||
private void registerEntityDimensionChange(RegistryKey<DimensionType> newDimension, CallbackInfoReturnable<Entity> cir)
|
||||
{
|
||||
if (CarpetSettings.portalSuffocationFix)
|
||||
{
|
||||
@@ -44,7 +44,7 @@ public abstract class Entity_portalSuffocationMixin
|
||||
}
|
||||
|
||||
@Inject(method = "changeDimension", at = @At("RETURN"))
|
||||
private void removeEntity(class_5321<DimensionType> newDimension, CallbackInfoReturnable<Entity> cir)
|
||||
private void removeEntity(RegistryKey<DimensionType> newDimension, CallbackInfoReturnable<Entity> cir)
|
||||
{
|
||||
CarpetSettings.currentTelepotingEntityBox = null;
|
||||
CarpetSettings.fixedPosition = null;
|
||||
|
||||
@@ -3,14 +3,14 @@ package carpet.mixins;
|
||||
import carpet.fakes.ServerChunkManagerInterface;
|
||||
import carpet.utils.SpawnReporter;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||
import net.minecraft.class_5217;
|
||||
import net.minecraft.class_5321;
|
||||
import net.minecraft.entity.SpawnGroup;
|
||||
import net.minecraft.server.world.ChunkTicketManager;
|
||||
import net.minecraft.server.world.ServerChunkManager;
|
||||
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.WorldProperties;
|
||||
import net.minecraft.world.chunk.WorldChunk;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraft.world.level.LevelProperties;
|
||||
@@ -48,7 +48,7 @@ public abstract class ServerChunkManagerMixin implements ServerChunkManagerInter
|
||||
private int setupTracking(ChunkTicketManager chunkTicketManager)
|
||||
{
|
||||
int j = chunkTicketManager.getSpawningChunkCount();
|
||||
class_5321<DimensionType> dim = this.world.method_27983(); // getDimensionType;
|
||||
RegistryKey<DimensionType> dim = this.world.method_27983(); // getDimensionType;
|
||||
//((WorldInterface)world).getPrecookedMobs().clear(); not needed because mobs are compared with predefined BBs
|
||||
SpawnReporter.chunkCounts.put(dim, j);
|
||||
|
||||
@@ -72,13 +72,13 @@ public abstract class ServerChunkManagerMixin implements ServerChunkManagerInter
|
||||
@Inject(method = "tickChunks", at = @At("RETURN"))
|
||||
private void onFinishSpawnWorldCycle(CallbackInfo ci)
|
||||
{
|
||||
class_5217 levelProperties_1 = this.world.getLevelProperties(); // levelProperies class
|
||||
WorldProperties levelProperties_1 = this.world.getLevelProperties(); // levelProperies class
|
||||
boolean boolean_3 = levelProperties_1.getTime() % 400L == 0L;
|
||||
if (SpawnReporter.track_spawns > 0L && SpawnReporter.local_spawns != null)
|
||||
{
|
||||
for (SpawnGroup cat: SpawnGroup.values())
|
||||
{
|
||||
class_5321<DimensionType> dim = world.method_27983(); // getDimensionType;
|
||||
RegistryKey<DimensionType> dim = world.method_27983(); // getDimensionType;
|
||||
Pair key = Pair.of(dim, cat);
|
||||
int spawnTries = SpawnReporter.spawn_tries.get(cat);
|
||||
if (!SpawnReporter.local_spawns.containsKey(cat))
|
||||
|
||||
@@ -93,12 +93,12 @@ public abstract class ServerChunkManager_tickMixin
|
||||
value = "INVOKE",
|
||||
//target = "Lnet/minecraft/world/level/LevelProperties;getGeneratorType()Lnet/minecraft/world/level/LevelGeneratorType;"
|
||||
//target = "Lnet/minecraft/class_5217;getGeneratorType()Lnet/minecraft/world/level/LevelGeneratorType;"
|
||||
target = "Lnet/minecraft/server/world/ServerWorld;method_27982()Z" // idDebug
|
||||
target = "Lnet/minecraft/server/world/ServerWorld;isDebugWorld()Z" // idDebug
|
||||
))
|
||||
private boolean skipChunkTicking(ServerWorld serverWorld)
|
||||
{
|
||||
if (!TickSpeed.process_entities) return true;
|
||||
return serverWorld.method_27982(); //isDebug
|
||||
return serverWorld.isDebugWorld();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package carpet.mixins;
|
||||
import carpet.fakes.EntityInterface;
|
||||
import carpet.script.EntityEventsGroup;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.class_5321;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.damage.DamageSource;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -13,6 +12,7 @@ import net.minecraft.stat.Stat;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -89,23 +89,23 @@ public abstract class ServerPlayerEntity_scarpetEventMixin extends PlayerEntity
|
||||
}
|
||||
|
||||
private Vec3d previousLocation;
|
||||
private class_5321<DimensionType> previousDimension;
|
||||
private RegistryKey<DimensionType> previousDimension;
|
||||
|
||||
@Inject(method = "changeDimension", at = @At("HEAD"))
|
||||
private void logPreviousCoordinates(class_5321<DimensionType> newDimension, CallbackInfoReturnable<Entity> cir)
|
||||
private void logPreviousCoordinates(RegistryKey<DimensionType> newDimension, CallbackInfoReturnable<Entity> cir)
|
||||
{
|
||||
previousLocation = getPos();
|
||||
previousDimension = world.method_27983(); //dimension type
|
||||
}
|
||||
|
||||
@Inject(method = "changeDimension", at = @At("RETURN"))
|
||||
private void atChangeDimension(class_5321<DimensionType> newDimension, CallbackInfoReturnable<Entity> cir)
|
||||
private void atChangeDimension(RegistryKey<DimensionType> newDimension, CallbackInfoReturnable<Entity> cir)
|
||||
{
|
||||
if (PLAYER_CHANGES_DIMENSION.isNeeded())
|
||||
{
|
||||
ServerPlayerEntity player = (ServerPlayerEntity) (Object)this;
|
||||
Vec3d to = null;
|
||||
if (!notInAnyWorld || previousDimension != DimensionType.field_24755 || newDimension != DimensionType.field_24753) // end ow
|
||||
if (!notInAnyWorld || previousDimension != DimensionType.THE_END_REGISTRY_KEY || newDimension != DimensionType.OVERWORLD_REGISTRY_KEY) // end ow
|
||||
{
|
||||
to = getPos();
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ package carpet.mixins;
|
||||
|
||||
import carpet.helpers.TickSpeed;
|
||||
import carpet.utils.CarpetProfiler;
|
||||
import net.minecraft.class_5269;
|
||||
import net.minecraft.entity.raid.RaidManager;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.profiler.Profiler;
|
||||
import net.minecraft.world.MutableWorldProperties;
|
||||
import net.minecraft.world.WanderingTraderManager;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.border.WorldBorder;
|
||||
@@ -28,10 +28,9 @@ public abstract class ServerWorld_tickMixin extends World
|
||||
//@Shadow protected abstract void sendBlockActions();
|
||||
|
||||
@Shadow protected abstract void method_29203();
|
||||
|
||||
protected ServerWorld_tickMixin(class_5269 arg, DimensionType dimensionType, Supplier<Profiler> supplier, boolean bl, boolean bl2, long l)
|
||||
protected ServerWorld_tickMixin(MutableWorldProperties mutableWorldProperties, DimensionType dimensionType, Supplier<Profiler> supplier, boolean bl, boolean bl2, long l)
|
||||
{
|
||||
super(arg, dimensionType, supplier, bl, bl2, l);
|
||||
super(mutableWorldProperties, dimensionType, supplier, bl, bl2, l);
|
||||
}
|
||||
|
||||
private CarpetProfiler.ProfilerToken currentSection;
|
||||
@@ -149,13 +148,13 @@ public abstract class ServerWorld_tickMixin extends World
|
||||
|
||||
@Redirect(method = "tick", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/server/world/ServerWorld;method_27982()Z" // isDebug
|
||||
target = "Lnet/minecraft/server/world/ServerWorld;isDebugWorld()Z" // isDebug
|
||||
//target = "Lnet/minecraft/world/level/LevelProperties;getGeneratorType()Lnet/minecraft/world/level/LevelGeneratorType;"
|
||||
))
|
||||
private boolean tickPendingBlocks(ServerWorld serverWorld)
|
||||
{
|
||||
if (!TickSpeed.process_entities) return true;
|
||||
return serverWorld.method_27982(); // isDebug()
|
||||
return serverWorld.isDebugWorld(); // isDebug()
|
||||
}
|
||||
|
||||
@Redirect(method = "tick", at = @At(
|
||||
|
||||
@@ -6,7 +6,6 @@ import carpet.utils.SpawnReporter;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.FenceGateBlock;
|
||||
import net.minecraft.class_5321;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.SpawnGroup;
|
||||
import net.minecraft.entity.EntityData;
|
||||
@@ -20,6 +19,7 @@ import net.minecraft.tag.BlockTags;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.registry.RegistryKey;
|
||||
import net.minecraft.util.shape.VoxelShape;
|
||||
import net.minecraft.util.shape.VoxelShapes;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
@@ -281,7 +281,7 @@ public class SpawnHelperMixin
|
||||
SpawnGroup entityCategory = var6[var8];
|
||||
if ((spawnAnimals || !entityCategory.isPeaceful()) && (spawnMonsters || entityCategory.isPeaceful()) && (shouldSpawnAnimals || !entityCategory.isAnimal()) )
|
||||
{
|
||||
class_5321<DimensionType> dim = world.method_27983(); // getDimensionType;
|
||||
RegistryKey<DimensionType> 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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.class_5294;
|
||||
import net.minecraft.client.render.SkyProperties;
|
||||
import net.minecraft.client.render.WorldRenderer;
|
||||
//import net.minecraft.world.dimension.Dimension;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -13,12 +13,12 @@ public class WorldRenderer_fogOffMixin
|
||||
{
|
||||
@Redirect(method = "render", require = 0, expect = 0, at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/class_5294;method_28110(II)Z" //method_28110 isFogThick
|
||||
target = "Lnet/minecraft/client/render/SkyProperties;useThickFog(II)Z" //method_28110 isFogThick
|
||||
))
|
||||
private boolean isReallyThick(class_5294 class_5294, int x, int z)
|
||||
private boolean isReallyThick(SkyProperties skyProperties, int x, int z)
|
||||
{
|
||||
if (CarpetSettings.fogOff) return false;
|
||||
return class_5294.method_28110(x, z); //isFogThick
|
||||
return skyProperties.useThickFog(x, z); //isFogThick
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,11 +6,11 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockEntityProvider;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.class_5269;
|
||||
import net.minecraft.server.world.ChunkHolder;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.profiler.Profiler;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.MutableWorldProperties;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.EmptyChunk;
|
||||
@@ -27,7 +27,7 @@ public abstract class World_movableTEMixin implements WorldInterface, WorldAcces
|
||||
public boolean isClient;
|
||||
@Shadow
|
||||
@Final
|
||||
protected class_5269 properties; //LevelProperties
|
||||
protected MutableWorldProperties properties; //LevelProperties
|
||||
|
||||
@Shadow
|
||||
public abstract WorldChunk getWorldChunk(BlockPos blockPos_1);
|
||||
@@ -56,7 +56,7 @@ public abstract class World_movableTEMixin implements WorldInterface, WorldAcces
|
||||
|
||||
@Shadow public abstract boolean setBlockState(BlockPos pos, BlockState state, int flags);
|
||||
|
||||
@Shadow public abstract boolean method_27982(); //isDebug()
|
||||
@Shadow public abstract boolean isDebugWorld();
|
||||
|
||||
/**
|
||||
* @author 2No2Name
|
||||
@@ -70,7 +70,7 @@ public abstract class World_movableTEMixin implements WorldInterface, WorldAcces
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (!this.isClient && method_27982())
|
||||
else if (!this.isClient && isDebugWorld())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user