updated to 1.14.3 pre 2, still issues with fabric spawn tracking mappings

This commit is contained in:
gnembon committed 2019-06-07 11:51:11 -03:00
1 parent a5d83a0c53
commit f3da8b2576
31 files changed
+180 -173

No files matched your search

@@ -6,6 +6,7 @@ import net.minecraft.entity.EntityType;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.predicate.entity.EntityPredicates;
import net.minecraft.world.GameRules;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@@ -32,7 +33,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().getInteger("maxEntityCramming");
int int_1 = this.world.getGameRules().getInteger(GameRules.MAX_ENTITY_CRAMMING);
int int_2;
if (int_1 > 0 && list_1.size() > int_1 - 1 && this.random.nextInt(4) == 0) {
int_2 = 0;
@@ -1,7 +1,7 @@
package carpet.mixins;
import net.minecraft.client.network.packet.PlayerListHeaderS2CPacket;
import net.minecraft.network.chat.Component;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@@ -9,8 +9,8 @@ import org.spongepowered.asm.mixin.gen.Accessor;
public interface PlayerListHeaderS2CPacketMixin
{
@Accessor("header")
void setHeader(Component header);
void setHeader(Text header);
@Accessor("footer")
void setFooter(Component footer);
void setFooter(Text footer);
}
@@ -1,16 +1,16 @@
package carpet.mixins;
import carpet.fakes.PlayerListHudInterface;
import net.minecraft.client.gui.hud.PlayerListHud;
import net.minecraft.network.chat.Component;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
@Mixin(PlayerListHud.class)
public abstract class PlayerListHudMixin implements PlayerListHudInterface
{
@Shadow private Component footer;
@Shadow private Text footer;
@Shadow private Component header;
@Shadow private Text header;
public boolean hasFooterOrHeader()
{
@@ -3,7 +3,7 @@ package carpet.mixins;
import com.mojang.authlib.GameProfile;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.ClientConnection;
import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.text.TranslatableText;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.PlayerManager;
import net.minecraft.server.network.ServerPlayNetworkHandler;
@@ -72,7 +72,7 @@ public abstract class PlayerManagerMixin
serverPlayerEntity_3.kill();
continue;
}
serverPlayerEntity_3.networkHandler.disconnect(new TranslatableComponent("multiplayer.disconnect.duplicate_login", new Object[0]));
serverPlayerEntity_3.networkHandler.disconnect(new TranslatableText("multiplayer.disconnect.duplicate_login", new Object[0]));
}
}
@@ -36,7 +36,7 @@ public abstract class ServerChunkManagerMixin
locals = LocalCapture.CAPTURE_FAILHARD,
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/server/world/ThreadedAnvilChunkStorage;entryIterator()Lit/unimi/dsi/fastutil/objects/ObjectBidirectionalIterator;",
target = "Lnet/minecraft/server/world/ThreadedAnvilChunkStorage;entryIterator()Ljava/lang/Iterable;",
shift = At.Shift.AFTER,
ordinal = 0
@@ -75,6 +75,7 @@ public abstract class ServerChunkManagerMixin
}
}
/* problems in 1.14.3 pre 2 with mappings, I think // gnembon
@Redirect(method = "tickChunks", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/SpawnHelper;spawnEntitiesInChunk(Lnet/minecraft/entity/EntityCategory;Lnet/minecraft/world/World;Lnet/minecraft/world/chunk/WorldChunk;Lnet/minecraft/util/math/BlockPos;)V"
@@ -174,4 +175,7 @@ public abstract class ServerChunkManagerMixin
SpawnReporter.local_spawns = null;
}
*/
}
@@ -8,7 +8,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.mob.MobEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BoundingBox;
import net.minecraft.util.math.Box;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.SpawnHelper;
@@ -22,13 +22,14 @@ import java.util.Map;
@Mixin(SpawnHelper.class)
public class SpawnHelperMixin
{
// in World: private static Map<EntityType, Entity> precookedMobs= new HashMap<>();
@Redirect(method = "spawnEntitiesInChunk", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/World;doesNotCollide(Lnet/minecraft/util/math/BoundingBox;)Z"
target = "Lnet/minecraft/world/World;doesNotCollide(Lnet/minecraft/util/math/Box;)Z"
))
private static boolean doesNotCollide(World world, BoundingBox bb)
private static boolean doesNotCollide(World world, Box bb)
{
//.doesNotCollide is VERY expensive. On the other side - most worlds are not made of trapdoors in
// various configurations, but solid and 'passable' blocks, like air, water grass, etc.
@@ -5,13 +5,14 @@ import net.minecraft.entity.EntityType;
import net.minecraft.entity.LightningEntity;
import net.minecraft.entity.mob.SkeletonHorseEntity;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.text.TranslatableText;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.command.SummonCommand;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.GameRules;
import net.minecraft.world.LocalDifficulty;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@@ -35,7 +36,7 @@ public class SummonCommandMixin
ServerWorld world = source.getWorld();
BlockPos at = new BlockPos(vec3d_1);
LocalDifficulty localDifficulty_1 = source.getWorld().getLocalDifficulty(at);
boolean boolean_2 = world.getGameRules().getBoolean("doMobSpawning") && world.random.nextDouble() < (double)localDifficulty_1.getLocalDifficulty() * 0.01D;
boolean boolean_2 = world.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && 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);
@@ -44,7 +45,7 @@ public class SummonCommandMixin
world.spawnEntity(skeletonHorseEntity_1);
}
world.addLightning(lightningEntity_1);
source.sendFeedback(new TranslatableComponent("commands.summon.success", new Object[]{lightningEntity_1.getDisplayName()}), true);
source.sendFeedback(new TranslatableText("commands.summon.success", new Object[]{lightningEntity_1.getDisplayName()}), true);
cir.setReturnValue(1);
cir.cancel();