geforkt von Mirrors/Paper
732f98a4bf
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 82af5dc6 SPIGOT-7396: Add PlayerSignOpenEvent 3f0281ca SPIGOT-7063, PR-763: Add DragonBattle#initiateRespawn with custom EnderCrystals f83c8df4 PR-873: Add PlayerRecipeBookClickEvent 14560d39 SPIGOT-7435: Add TeleportCause#EXIT_BED 2cc6db92 SPIGOT-7422, PR-887: Add API to set sherds on decorated pots 36022f02 PR-883: Add ItemFactory#getSpawnEgg 12eb5c46 PR-881: Update Scoreboard Javadocs, remove explicit exception throwing f6d8d44a PR-882: Add modern time API methods to ban API 21a7b710 Upgrade some Maven plugins to reduce warnings 11fd1225 PR-886: Deprecate the SmithingRecipe constructor as it now does nothing dbd1761d SPIGOT-7406: Improve documentation for getDragonBattle CraftBukkit Changes: d548daac2 SPIGOT-7446: BlockState#update not updating a spawner's type to null 70e0bc050 SPIGOT-7447: Fix --forceUpgrade 6752f1d63 SPIGOT-7396: Add PlayerSignOpenEvent 847b4cad5 SPIGOT-7063, PR-1071: Add DragonBattle#initiateRespawn with custom EnderCrystals c335a555f PR-1212: Add PlayerRecipeBookClickEvent 4be756ecb SPIGOT-7445: Fix opening smithing inventory db70bd6ed SPIGOT-7441: Fix issue placing certain items in creative/op f7fa6d993 SPIGOT-7435: Add TeleportCause#EXIT_BED b435e8e8d SPIGOT-7349: Player#setDisplayName not working when message/format unmodified a2fafdd1d PR-1232: Re-add fix for player rotation 7cf863de1 PR-1233: Remove some old MC bug fixes now fixed in vanilla 08ec344ad Fix ChunkGenerator#generateCaves never being called 5daeb502a SPIGOT-7422, PR-1228: Add API to set sherds on decorated pots 52faa6b32 PR-1224: Add ItemFactory#getSpawnEgg 01cae71b7 SPIGOT-7429: Fix LEFT_CLICK_AIR not working for passable entities and spectators a94277a18 PR-1223: Remove non-existent scoreboard display name/prefix/suffix limits 36b107660 PR-1225: Add modern time API methods to ban API 59ead25bc Upgrade some Maven plugins to reduce warnings 202fc5c4e Increase outdated build delay ce545de57 SPIGOT-7398: TextDisplay#setInterpolationDuration incorrectly updates the line width Spigot Changes: b41c46db Rebuild patches 3374045a SPIGOT-7431: Fix EntityMountEvent returning opposite entities 0ca4eb66 Rebuild patches
260 Zeilen
17 KiB
Diff
260 Zeilen
17 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Wed, 30 Mar 2016 19:36:20 -0400
|
|
Subject: [PATCH] MC Dev fixes
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/Util.java
|
|
+++ b/src/main/java/net/minecraft/Util.java
|
|
@@ -0,0 +0,0 @@ public class Util {
|
|
}
|
|
|
|
public static <K> Hash.Strategy<K> identityStrategy() {
|
|
- return Util.IdentityStrategy.INSTANCE;
|
|
+ return (Hash.Strategy<K>) Util.IdentityStrategy.INSTANCE; // Paper - decompile fix
|
|
}
|
|
|
|
public static <V> CompletableFuture<List<V>> sequence(List<? extends CompletableFuture<V>> futures) {
|
|
diff --git a/src/main/java/net/minecraft/core/BlockPos.java b/src/main/java/net/minecraft/core/BlockPos.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/core/BlockPos.java
|
|
+++ b/src/main/java/net/minecraft/core/BlockPos.java
|
|
@@ -0,0 +0,0 @@ public class BlockPos extends Vec3i {
|
|
if (this.index == l) {
|
|
return this.endOfData();
|
|
} else {
|
|
- int i = this.index % i;
|
|
- int j = this.index / i;
|
|
- int k = j % j;
|
|
- int l = j / j;
|
|
+ int offsetX = this.index % i; // Paper - decomp fix
|
|
+ int u = this.index / i; // Paper - decomp fix
|
|
+ int offsetY = u % j; // Paper - decomp fix
|
|
+ int offsetZ = u / j; // Paper - decomp fix
|
|
++this.index;
|
|
- return this.cursor.set(startX + i, startY + k, startZ + l);
|
|
+ return this.cursor.set(startX + offsetX, startY + offsetY, startZ + offsetZ); // Paper - decomp fix
|
|
}
|
|
}
|
|
};
|
|
diff --git a/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java b/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java
|
|
+++ b/src/main/java/net/minecraft/core/registries/BuiltInRegistries.java
|
|
@@ -0,0 +0,0 @@ public class BuiltInRegistries {
|
|
LOADERS.put(resourceLocation, () -> {
|
|
return initializer.run(registry);
|
|
});
|
|
- WRITABLE_REGISTRY.register(key, registry, lifecycle);
|
|
+ WRITABLE_REGISTRY.register((ResourceKey) key, registry, lifecycle); // Paper - decompile fix
|
|
return registry;
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/network/ConnectionProtocol.java b/src/main/java/net/minecraft/network/ConnectionProtocol.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/network/ConnectionProtocol.java
|
|
+++ b/src/main/java/net/minecraft/network/ConnectionProtocol.java
|
|
@@ -0,0 +0,0 @@ public enum ConnectionProtocol implements BundlerInfo.Provider {
|
|
|
|
public void listAllPackets(Consumer<Class<? extends Packet<?>>> consumer) {
|
|
this.classToId.keySet().stream().filter((type) -> {
|
|
- return type != BundleDelimiterPacket.class;
|
|
+ return !type.equals(BundleDelimiterPacket.class); // Paper - fix of some kind
|
|
}).forEach(consumer);
|
|
this.extraClasses.forEach(consumer);
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/network/chat/ComponentUtils.java b/src/main/java/net/minecraft/network/chat/ComponentUtils.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/network/chat/ComponentUtils.java
|
|
+++ b/src/main/java/net/minecraft/network/chat/ComponentUtils.java
|
|
@@ -0,0 +0,0 @@ public class ComponentUtils {
|
|
ComponentContents string = text.getContents();
|
|
if (string instanceof TranslatableContents) {
|
|
TranslatableContents translatableContents = (TranslatableContents)string;
|
|
- String string = translatableContents.getKey();
|
|
String string2 = translatableContents.getFallback();
|
|
- return string2 != null || Language.getInstance().has(string);
|
|
+ return string2 != null || Language.getInstance().has(translatableContents.getKey()); // Paper - decompile fix
|
|
}
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/resources/RegistryDataLoader.java b/src/main/java/net/minecraft/resources/RegistryDataLoader.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/resources/RegistryDataLoader.java
|
|
+++ b/src/main/java/net/minecraft/resources/RegistryDataLoader.java
|
|
@@ -0,0 +0,0 @@ public class RegistryDataLoader {
|
|
return new RegistryOps.RegistryInfoLookup() {
|
|
@Override
|
|
public <T> Optional<RegistryOps.RegistryInfo<T>> lookup(ResourceKey<? extends Registry<? extends T>> registryRef) {
|
|
- return Optional.ofNullable(map.get(registryRef));
|
|
+ return Optional.ofNullable((RegistryOps.RegistryInfo<T>) map.get(registryRef)); // Paper - decompile fix
|
|
}
|
|
};
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
@@ -0,0 +0,0 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
PackRepository resourcepackrepository = this.packRepository;
|
|
|
|
Objects.requireNonNull(this.packRepository);
|
|
- return stream.map(resourcepackrepository::getPack).filter(Objects::nonNull).map(Pack::open).collect(ImmutableList.toImmutableList()); // CraftBukkit - decompile error
|
|
+ return stream.<Pack>map(resourcepackrepository::getPack).filter(Objects::nonNull).map(Pack::open).collect(ImmutableList.toImmutableList()); // CraftBukkit - decompile error // Paper - decompile error // todo: is this needed anymore?
|
|
}, this).thenCompose((immutablelist) -> {
|
|
MultiPackResourceManager resourcemanager = new MultiPackResourceManager(PackType.SERVER_DATA, immutablelist);
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/Ticket.java b/src/main/java/net/minecraft/server/level/Ticket.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/server/level/Ticket.java
|
|
+++ b/src/main/java/net/minecraft/server/level/Ticket.java
|
|
@@ -0,0 +0,0 @@ public final class Ticket<T> implements Comparable<Ticket<?>> {
|
|
return i;
|
|
} else {
|
|
int j = Integer.compare(System.identityHashCode(this.type), System.identityHashCode(ticket.type));
|
|
- return j != 0 ? j : this.type.getComparator().compare(this.key, ticket.key);
|
|
+ return j != 0 ? j : this.type.getComparator().compare(this.key, (T)ticket.key); // Paper - decompile fix
|
|
}
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/util/SortedArraySet.java b/src/main/java/net/minecraft/util/SortedArraySet.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/util/SortedArraySet.java
|
|
+++ b/src/main/java/net/minecraft/util/SortedArraySet.java
|
|
@@ -0,0 +0,0 @@ public class SortedArraySet<T> extends AbstractSet<T> {
|
|
}
|
|
|
|
public static <T extends Comparable<T>> SortedArraySet<T> create(int initialCapacity) {
|
|
- return new SortedArraySet<>(initialCapacity, Comparator.naturalOrder());
|
|
+ return new SortedArraySet<>(initialCapacity, Comparator.<T>naturalOrder()); // Paper - decompile fix
|
|
}
|
|
|
|
public static <T> SortedArraySet<T> create(Comparator<T> comparator) {
|
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
|
@@ -0,0 +0,0 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Rider
|
|
@Override
|
|
protected void customServerAiStep() {
|
|
this.level().getProfiler().push("camelBrain");
|
|
- Brain<?> brain = this.getBrain();
|
|
+ Brain<Camel> brain = (Brain<Camel>) this.getBrain(); // Paper - decompile fix
|
|
brain.tick((ServerLevel)this.level(), this);
|
|
this.level().getProfiler().pop();
|
|
this.level().getProfiler().push("camelActivityUpdate");
|
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
|
@@ -0,0 +0,0 @@ public class Frog extends Animal implements VariantHolder<FrogVariant> {
|
|
|
|
@Override
|
|
public Brain<Frog> getBrain() {
|
|
- return super.getBrain();
|
|
+ return (Brain<Frog>) super.getBrain(); // Paper - decompile fix
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java
|
|
@@ -0,0 +0,0 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
|
|
|
|
@Override
|
|
public Brain<Hoglin> getBrain() {
|
|
- return super.getBrain();
|
|
+ return (Brain<Hoglin>) super.getBrain(); // Paper - decompile fix
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
|
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
|
|
@@ -0,0 +0,0 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
|
|
}
|
|
|
|
this.recipes = (Map) map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry1) -> {
|
|
- return (entry1.getValue()); // CraftBukkit
|
|
+ return entry1.getValue(); // CraftBukkit // Paper - decompile fix - *shrugs internally* // todo: is this needed anymore?
|
|
}));
|
|
this.byName = Maps.newHashMap(builder.build()); // CraftBukkit
|
|
RecipeManager.LOGGER.info("Loaded {} recipes", map1.size());
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java b/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java
|
|
@@ -0,0 +0,0 @@ public class CeilingHangingSignBlock extends SignBlock {
|
|
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
|
BlockEntity itemStack = world.getBlockEntity(pos);
|
|
if (itemStack instanceof SignBlockEntity signBlockEntity) {
|
|
- ItemStack itemStack = player.getItemInHand(hand);
|
|
- if (this.shouldTryToChainAnotherHangingSign(player, hit, signBlockEntity, itemStack)) {
|
|
+ // Paper start - decompile fixes
|
|
+ ItemStack itemStack0 = player.getItemInHand(hand);
|
|
+ if (this.shouldTryToChainAnotherHangingSign(player, hit, signBlockEntity, itemStack0)) {
|
|
+ // Paper end - decompile fixes
|
|
return InteractionResult.PASS;
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java b/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java
|
|
+++ b/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java
|
|
@@ -0,0 +0,0 @@ public class WallHangingSignBlock extends SignBlock {
|
|
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
|
BlockEntity itemStack = world.getBlockEntity(pos);
|
|
if (itemStack instanceof SignBlockEntity signBlockEntity) {
|
|
- ItemStack itemStack = player.getItemInHand(hand);
|
|
- if (this.shouldTryToChainAnotherHangingSign(state, player, hit, signBlockEntity, itemStack)) {
|
|
+ // Paper start - decompile fixes
|
|
+ ItemStack itemStack0 = player.getItemInHand(hand);
|
|
+ if (this.shouldTryToChainAnotherHangingSign(state, player, hit, signBlockEntity, itemStack0)) {
|
|
+ // Paper end
|
|
return InteractionResult.PASS;
|
|
}
|
|
}
|
|
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
|
|
+++ b/src/main/java/net/minecraft/world/level/entity/EntityLookup.java
|
|
@@ -0,0 +0,0 @@ public class EntityLookup<T extends EntityAccess> {
|
|
public <U extends T> void getEntities(EntityTypeTest<T, U> filter, AbortableIterationConsumer<U> consumer) {
|
|
for(T entityAccess : this.byId.values()) {
|
|
U entityAccess2 = (U)((EntityAccess)filter.tryCast(entityAccess));
|
|
- if (entityAccess2 != null && consumer.accept((T)entityAccess2).shouldAbort()) {
|
|
+ if (entityAccess2 != null && consumer.accept(entityAccess2).shouldAbort()) { // Paper - decompile fix
|
|
return;
|
|
}
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/world/level/entity/EntitySection.java b/src/main/java/net/minecraft/world/level/entity/EntitySection.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/world/level/entity/EntitySection.java
|
|
+++ b/src/main/java/net/minecraft/world/level/entity/EntitySection.java
|
|
@@ -0,0 +0,0 @@ public class EntitySection<T extends EntityAccess> {
|
|
} else {
|
|
for(T entityAccess : collection) {
|
|
U entityAccess2 = (U)((EntityAccess)type.tryCast(entityAccess));
|
|
- if (entityAccess2 != null && entityAccess.getBoundingBox().intersects(box) && consumer.accept((T)entityAccess2).shouldAbort()) {
|
|
+ if (entityAccess2 != null && entityAccess.getBoundingBox().intersects(box) && consumer.accept(entityAccess2).shouldAbort()) { // Paper - decompile fix
|
|
return AbortableIterationConsumer.Continuation.ABORT;
|
|
}
|
|
}
|