mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-09 16:42:03 -07:00
Remap CraftBukkit to Mojang+Yarn Mappings
By: Initial Source <noreply+automated@papermc.io>
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
--- a/net/minecraft/network/FriendlyByteBuf.java
|
||||
+++ b/net/minecraft/network/FriendlyByteBuf.java
|
||||
@@ -139,7 +139,7 @@
|
||||
|
||||
public <T, C extends Collection<T>> C readCollection(IntFunction<C> collectionFactory, StreamDecoder<? super FriendlyByteBuf, T> reader) {
|
||||
int i = this.readVarInt();
|
||||
- C c0 = (Collection) collectionFactory.apply(i);
|
||||
+ C c0 = collectionFactory.apply(i); // CraftBukkit - decompile error
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
c0.add(reader.decode(this));
|
||||
@@ -150,7 +150,7 @@
|
||||
|
||||
public <T> void writeCollection(Collection<T> collection, StreamEncoder<? super FriendlyByteBuf, T> writer) {
|
||||
this.writeVarInt(collection.size());
|
||||
- Iterator iterator = collection.iterator();
|
||||
+ Iterator<T> iterator = collection.iterator(); // CraftBukkit - decompile error
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
T t0 = iterator.next();
|
||||
@@ -177,12 +177,12 @@
|
||||
|
||||
public void writeIntIdList(IntList list) {
|
||||
this.writeVarInt(list.size());
|
||||
- list.forEach(this::writeVarInt);
|
||||
+ list.forEach((java.util.function.IntConsumer) this::writeVarInt); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
public <K, V, M extends Map<K, V>> M readMap(IntFunction<M> mapFactory, StreamDecoder<? super FriendlyByteBuf, K> keyReader, StreamDecoder<? super FriendlyByteBuf, V> valueReader) {
|
||||
int i = this.readVarInt();
|
||||
- M m0 = (Map) mapFactory.apply(i);
|
||||
+ M m0 = mapFactory.apply(i); // CraftBukkit - decompile error
|
||||
|
||||
for (int j = 0; j < i; ++j) {
|
||||
K k0 = keyReader.decode(this);
|
||||
@@ -216,7 +216,7 @@
|
||||
}
|
||||
|
||||
public <E extends Enum<E>> void writeEnumSet(EnumSet<E> enumSet, Class<E> type) {
|
||||
- E[] ae = (Enum[]) type.getEnumConstants();
|
||||
+ E[] ae = type.getEnumConstants(); // CraftBukkit - decompile error
|
||||
BitSet bitset = new BitSet(ae.length);
|
||||
|
||||
for (int i = 0; i < ae.length; ++i) {
|
||||
@@ -227,7 +227,7 @@
|
||||
}
|
||||
|
||||
public <E extends Enum<E>> EnumSet<E> readEnumSet(Class<E> type) {
|
||||
- E[] ae = (Enum[]) type.getEnumConstants();
|
||||
+ E[] ae = type.getEnumConstants(); // CraftBukkit - decompile error
|
||||
BitSet bitset = this.readFixedBitSet(ae.length);
|
||||
EnumSet<E> enumset = EnumSet.noneOf(type);
|
||||
|
||||
@@ -498,7 +498,7 @@
|
||||
}
|
||||
|
||||
public <T extends Enum<T>> T readEnum(Class<T> enumClass) {
|
||||
- return ((Enum[]) enumClass.getEnumConstants())[this.readVarInt()];
|
||||
+ return ((T[]) enumClass.getEnumConstants())[this.readVarInt()]; // CraftBukkit - fix decompile error
|
||||
}
|
||||
|
||||
public FriendlyByteBuf writeEnum(Enum<?> instance) {
|
||||
@@ -565,7 +565,7 @@
|
||||
|
||||
try {
|
||||
NbtIo.writeAnyTag((Tag) nbt, new ByteBufOutputStream(buf));
|
||||
- } catch (IOException ioexception) {
|
||||
+ } catch (Exception ioexception) { // CraftBukkit - IOException -> Exception
|
||||
throw new EncoderException(ioexception);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user