fix more compile issues

This commit is contained in:
Jake Potrebic 2022-12-07 22:11:20 -08:00
parent a0a9b9291a
commit 181b2c7e46
7 changed files with 30 additions and 25 deletions

View file

@ -127,6 +127,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
// CraftBukkit start - fire PlayerKickEvent
if (this.processedDisconnect) {
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
Waitable waitable = new Waitable() {
@Override
protected Object evaluate() {
- ServerGamePacketListenerImpl.this.disconnect(reason); // Paper - adventure
+ ServerGamePacketListenerImpl.this.disconnect(reason, cause); // Paper - adventure, kick event cause
return null;
}
};
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
net.kyori.adventure.text.Component leaveMessage = net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? this.player.getBukkitEntity().displayName() : net.kyori.adventure.text.Component.text(this.player.getScoreboardName())); // Paper - Adventure

View file

@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
+ // Paper start - TNTPrimeEvent
+ org.bukkit.block.Block tntBlock = level.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
+ if(!new com.destroystokyo.paper.event.block.TNTPrimeEvent(tntBlock, com.destroystokyo.paper.event.block.TNTPrimeEvent.PrimeReason.EXPLOSION, explosionSource.getSourceMob().getBukkitEntity()).callEvent())
+ if(!new com.destroystokyo.paper.event.block.TNTPrimeEvent(tntBlock, com.destroystokyo.paper.event.block.TNTPrimeEvent.PrimeReason.EXPLOSION, explosionSource.getIndirectSourceEntity().getBukkitEntity()).callEvent())
+ continue;
+ // Paper end
nmsBlock.wasExploded(level, blockposition, explosionSource);

View file

@ -6,20 +6,12 @@ Subject: [PATCH] Add villager reputation API
== AT ==
public net.minecraft.world.entity.ai.gossip.GossipContainer$EntityGossips
public net.minecraft.world.entity.ai.gossip.GossipContainer$EntityGossips <init>()V
public net.minecraft.world.entity.ai.gossip.GossipContainer gossips
diff --git a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java
+++ b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java
@@ -0,0 +0,0 @@ import org.slf4j.Logger;
public class GossipContainer {
private static final Logger LOGGER = LogUtils.getLogger();
public static final int DISCARD_THRESHOLD = 2;
- private final Map<UUID, GossipContainer.EntityGossips> gossips = Maps.newHashMap();
+ private final Map<UUID, GossipContainer.EntityGossips> gossips = Maps.newHashMap(); public Map<UUID, GossipContainer.EntityGossips> getReputations() { return this.gossips; } // Paper - add getter for reputations
@VisibleForDebug
public Map<UUID, Object2IntMap<GossipType>> getGossipEntries() {
@@ -0,0 +0,0 @@ public class GossipContainer {
public void remove(GossipType gossipType) {
this.entries.removeInt(gossipType);
@ -90,7 +82,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - Add villager reputation API
+ @Override
+ public Reputation getReputation(UUID uniqueId) {
+ net.minecraft.world.entity.ai.gossip.GossipContainer.EntityGossips rep = getHandle().getGossips().getReputations().get(uniqueId);
+ net.minecraft.world.entity.ai.gossip.GossipContainer.EntityGossips rep = getHandle().getGossips().gossips.get(uniqueId);
+ if (rep == null) {
+ return new Reputation(new java.util.EnumMap<>(com.destroystokyo.paper.entity.villager.ReputationType.class));
+ }
@ -100,7 +92,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ @Override
+ public Map<UUID, Reputation> getReputations() {
+ return getHandle().getGossips().getReputations().entrySet()
+ return getHandle().getGossips().gossips.entrySet()
+ .stream()
+ .collect(java.util.stream.Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue().getPaperReputation()));
+ }
@ -108,7 +100,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ @Override
+ public void setReputation(UUID uniqueId, Reputation reputation) {
+ net.minecraft.world.entity.ai.gossip.GossipContainer.EntityGossips nmsReputation =
+ getHandle().getGossips().getReputations().computeIfAbsent(
+ getHandle().getGossips().gossips.computeIfAbsent(
+ uniqueId,
+ key -> new net.minecraft.world.entity.ai.gossip.GossipContainer.EntityGossips()
+ );
@ -124,7 +116,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ @Override
+ public void clearReputations() {
+ getHandle().getGossips().getReputations().clear();
+ getHandle().getGossips().gossips.clear();
+ }
+ // Paper end
}

View file

@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
}
+ private static final Predicate<net.minecraft.world.entity.LivingEntity> APPLY_WATER_GET_ENTITIES_PREDICATE = ThrownPotion.WATER_SENSITIVE.or(Axolotl.class::isInstance); // Paper
+ private static final Predicate<net.minecraft.world.entity.LivingEntity> APPLY_WATER_GET_ENTITIES_PREDICATE = ThrownPotion.WATER_SENSITIVE_OR_ON_FIRE.or(Axolotl.class::isInstance); // Paper
private void applyWater() {
AABB axisalignedbb = this.getBoundingBox().inflate(4.0D, 2.0D, 4.0D);
- List<net.minecraft.world.entity.LivingEntity> list = this.level.getEntitiesOfClass(net.minecraft.world.entity.LivingEntity.class, axisalignedbb, ThrownPotion.WATER_SENSITIVE_OR_ON_FIRE);

View file

@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (interaction == ReputationEventType.ZOMBIE_VILLAGER_CURED) {
+ // Paper start - fix MC-181190
+ if (level.paperConfig().fixes.fixCuringZombieVillagerDiscountExploit) {
+ final GossipContainer.EntityGossips playerReputation = this.getGossips().getReputations().get(entity.getUUID());
+ final GossipContainer.EntityGossips playerReputation = this.getGossips().gossips.get(entity.getUUID());
+ if (playerReputation != null) {
+ playerReputation.remove(GossipType.MAJOR_POSITIVE);
+ playerReputation.remove(GossipType.MINOR_POSITIVE);

View file

@ -144,6 +144,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}));
this.byName = Maps.newHashMap(builder.build()); // CraftBukkit
RecipeManager.LOGGER.info("Loaded {} recipes", map1.size());
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
@@ -0,0 +0,0 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
}
private static <T, C extends PalettedContainerRO<T>> Codec<C> codec(IdMap<T> idList, Codec<T> entryCodec, PalettedContainer.Strategy provider, T defaultValue, PalettedContainerRO.Unpacker<T, C> reader) {
- return RecordCodecBuilder.<PalettedContainerRO.PackedData>create((instance) -> {
+ return RecordCodecBuilder.<PalettedContainerRO.PackedData<T>>create((instance) -> { // Paper - decompile fix
return instance.group(entryCodec.mapResult(ExtraCodecs.orElsePartial(defaultValue)).listOf().fieldOf("palette").forGetter(PalettedContainerRO.PackedData::paletteEntries), Codec.LONG_STREAM.optionalFieldOf("data").forGetter(PalettedContainerRO.PackedData::storage)).apply(instance, PalettedContainerRO.PackedData::new);
}).comapFlatMap((serialized) -> {
return reader.read(idList, provider, serialized);
diff --git a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java b/src/main/java/net/minecraft/world/level/entity/EntityLookup.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/entity/EntityLookup.java

View file

@ -8,15 +8,6 @@ diff --git a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java
+++ b/src/main/java/net/minecraft/world/entity/ai/gossip/GossipContainer.java
@@ -0,0 +0,0 @@ import org.slf4j.Logger;
public class GossipContainer {
private static final Logger LOGGER = LogUtils.getLogger();
public static final int DISCARD_THRESHOLD = 2;
- private final Map<UUID, GossipContainer.EntityGossips> gossips = Maps.newHashMap(); public Map<UUID, GossipContainer.EntityGossips> getReputations() { return this.gossips; } // Paper - add getter for reputations
+ private final Map<UUID, GossipContainer.EntityGossips> gossips = Maps.newHashMap();
@VisibleForDebug
public Map<UUID, Object2IntMap<GossipType>> getGossipEntries() {
@@ -0,0 +0,0 @@ public class GossipContainer {
});
}