1.21.6 pre 1

This commit is contained in:
gnembon committed 2025-05-28 22:20:19 +02:00
1 parent 9ede99f6da
commit aae9640655
4 files changed
+15 -9

No files matched your search

@@ -3,6 +3,7 @@ package carpet.mixins;
import carpet.fakes.ClientConnectionInterface;
import carpet.logging.logHelpers.PacketCounter;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.util.concurrent.Future;
import io.netty.util.concurrent.GenericFutureListener;
@@ -28,7 +29,7 @@ public abstract class Connection_packetCounterMixin implements ClientConnectionI
// Add to the packet counter whenever a packet is sent.
@Inject(method = "sendPacket", at = @At("HEAD"))
private void packetOutCount(final Packet<?> packet, final PacketSendListener packetSendListener, final boolean bl, final CallbackInfo ci)
private void packetOutCount(Packet<?> packet, ChannelFutureListener channelFutureListener, boolean bl, CallbackInfo ci)
{
PacketCounter.totalOut++;
}
@@ -38,8 +38,8 @@ public abstract class ServerPlayer_scarpetEventMixin extends Player implements S
@Unique
private boolean isInvalidReference = false;
public ServerPlayer_scarpetEventMixin(Level level, BlockPos blockPos, float f, GameProfile gameProfile) {
super(level, blockPos, f, gameProfile);
public ServerPlayer_scarpetEventMixin(Level level, GameProfile gameProfile) {
super(level, gameProfile);
}
//@Shadow protected abstract void completeUsingItem();
@@ -9,6 +9,9 @@ import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import java.util.List;
import java.util.stream.Stream;
@Mixin(StructureBlockEntity.class)
public abstract class StructureBlockEntity_limitsMixin
{
@@ -29,14 +32,16 @@ public abstract class StructureBlockEntity_limitsMixin
}
@ModifyArg(
method = "saveStructure(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/resources/ResourceLocation;Lnet/minecraft/core/BlockPos;Lnet/minecraft/core/Vec3i;ZLjava/lang/String;Z)Z",
method = "saveStructure(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/resources/ResourceLocation;Lnet/minecraft/core/BlockPos;Lnet/minecraft/core/Vec3i;ZLjava/lang/String;ZLjava/util/List;)Z",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate;fillFromWorld(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/core/Vec3i;ZLnet/minecraft/world/level/block/Block;)V"
target = "Lnet/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate;fillFromWorld(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/core/Vec3i;ZLjava/util/List;)V"
),
index = 4
)
private static Block ignoredBlock(Block original) {
return CarpetSettings.structureBlockIgnoredBlock;
private static List<Block> ignoredBlock(List<Block> original) {
if (original.contains(CarpetSettings.structureBlockIgnoredBlock))
return original;
return Stream.concat(original.stream(), Stream.of(CarpetSettings.structureBlockIgnoredBlock)).toList();
}
}