Small cleanup

This commit is contained in:
Nassim Jahnke 2024-12-14 21:42:25 +01:00
parent a546b39e58
commit b0f627d7bb
No known key found for this signature in database
GPG key ID: EF6771C01F6EF02F
2 changed files with 6 additions and 8 deletions

View file

@ -1,13 +1,11 @@
--- a/net/minecraft/network/protocol/common/ServerboundCustomPayloadPacket.java --- a/net/minecraft/network/protocol/common/ServerboundCustomPayloadPacket.java
+++ b/net/minecraft/network/protocol/common/ServerboundCustomPayloadPacket.java +++ b/net/minecraft/network/protocol/common/ServerboundCustomPayloadPacket.java
@@ -14,9 +_,7 @@ @@ -14,7 +_,7 @@
private static final int MAX_PAYLOAD_SIZE = 32767; private static final int MAX_PAYLOAD_SIZE = 32767;
public static final StreamCodec<FriendlyByteBuf, ServerboundCustomPayloadPacket> STREAM_CODEC = CustomPacketPayload.<FriendlyByteBuf>codec( public static final StreamCodec<FriendlyByteBuf, ServerboundCustomPayloadPacket> STREAM_CODEC = CustomPacketPayload.<FriendlyByteBuf>codec(
id -> DiscardedPayload.codec(id, 32767), id -> DiscardedPayload.codec(id, 32767),
- Util.make(Lists.newArrayList(new CustomPacketPayload.TypeAndCodec<>(BrandPayload.TYPE, BrandPayload.STREAM_CODEC)), list -> {}) - Util.make(Lists.newArrayList(new CustomPacketPayload.TypeAndCodec<>(BrandPayload.TYPE, BrandPayload.STREAM_CODEC)), list -> {})
- ) + java.util.Collections.emptyList() // CraftBukkit - treat all packets the same
- .map(ServerboundCustomPayloadPacket::new, ServerboundCustomPayloadPacket::payload); )
+ java.util.Collections.emptyList()).map(ServerboundCustomPayloadPacket::new, ServerboundCustomPayloadPacket::payload); // CraftBukkit - treat all packets the same .map(ServerboundCustomPayloadPacket::new, ServerboundCustomPayloadPacket::payload);
@Override
public PacketType<ServerboundCustomPayloadPacket> type() {

View file

@ -137,14 +137,14 @@
+ } + }
+ +
+ @Override + @Override
+ public void remove(Entity.RemovalReason reason, EntityRemoveEvent.Cause eventCaue) { + public void remove(Entity.RemovalReason reason, EntityRemoveEvent.Cause eventCause) {
+ // CraftBukkit end + // CraftBukkit end
if ((reason == Entity.RemovalReason.KILLED || reason == Entity.RemovalReason.DISCARDED) && this.level() instanceof ServerLevel serverLevel) { if ((reason == Entity.RemovalReason.KILLED || reason == Entity.RemovalReason.DISCARDED) && this.level() instanceof ServerLevel serverLevel) {
this.triggerOnDeathMobEffects(serverLevel, reason); this.triggerOnDeathMobEffects(serverLevel, reason);
} }
- super.remove(reason); - super.remove(reason);
+ super.remove(reason, eventCaue); // CraftBukkit + super.remove(reason, eventCause); // CraftBukkit
this.brain.clearMemories(); this.brain.clearMemories();
} }