mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-05 18:27:17 +01:00
Add mc-dev imports
By: md_5 <git@md-5.net>
This commit is contained in:
parent
0352f0e143
commit
97cd7810a3
21 changed files with 308 additions and 0 deletions
|
@ -0,0 +1,7 @@
|
|||
--- a/net/minecraft/nbt/NBTCompressedStreamTools.java
|
||||
+++ b/net/minecraft/nbt/NBTCompressedStreamTools.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.nbt;
|
||||
|
||||
import java.io.BufferedInputStream;
|
|
@ -0,0 +1,7 @@
|
|||
--- a/net/minecraft/nbt/NBTTagByteArray.java
|
||||
+++ b/net/minecraft/nbt/NBTTagByteArray.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.nbt;
|
||||
|
||||
import java.io.DataInput;
|
|
@ -0,0 +1,7 @@
|
|||
--- a/net/minecraft/nbt/NBTTagIntArray.java
|
||||
+++ b/net/minecraft/nbt/NBTTagIntArray.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.nbt;
|
||||
|
||||
import java.io.DataInput;
|
|
@ -0,0 +1,7 @@
|
|||
--- a/net/minecraft/network/protocol/game/PacketPlayInBlockPlace.java
|
||||
+++ b/net/minecraft/network/protocol/game/PacketPlayInBlockPlace.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.network.protocol.game;
|
||||
|
||||
import java.io.IOException;
|
|
@ -0,0 +1,7 @@
|
|||
--- a/net/minecraft/network/protocol/game/PacketPlayInChat.java
|
||||
+++ b/net/minecraft/network/protocol/game/PacketPlayInChat.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.network.protocol.game;
|
||||
|
||||
import java.io.IOException;
|
|
@ -0,0 +1,7 @@
|
|||
--- a/net/minecraft/network/protocol/game/PacketPlayInUseItem.java
|
||||
+++ b/net/minecraft/network/protocol/game/PacketPlayInUseItem.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.network.protocol.game;
|
||||
|
||||
import java.io.IOException;
|
|
@ -0,0 +1,7 @@
|
|||
--- a/net/minecraft/network/protocol/game/PacketPlayOutChat.java
|
||||
+++ b/net/minecraft/network/protocol/game/PacketPlayOutChat.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.network.protocol.game;
|
||||
|
||||
import java.io.IOException;
|
|
@ -0,0 +1,7 @@
|
|||
--- a/net/minecraft/network/protocol/handshake/PacketHandshakingInSetProtocol.java
|
||||
+++ b/net/minecraft/network/protocol/handshake/PacketHandshakingInSetProtocol.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.network.protocol.handshake;
|
||||
|
||||
import java.io.IOException;
|
|
@ -0,0 +1,7 @@
|
|||
--- a/net/minecraft/server/AdvancementDataWorld.java
|
||||
+++ b/net/minecraft/server/AdvancementDataWorld.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.server;
|
||||
|
||||
import com.google.common.collect.Maps;
|
|
@ -0,0 +1,7 @@
|
|||
--- a/net/minecraft/server/players/GameProfileBanEntry.java
|
||||
+++ b/net/minecraft/server/players/GameProfileBanEntry.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.server.players;
|
||||
|
||||
import com.google.gson.JsonObject;
|
|
@ -0,0 +1,16 @@
|
|||
--- a/net/minecraft/server/players/UserCache.java
|
||||
+++ b/net/minecraft/server/players/UserCache.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.server.players;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
@@ -83,7 +84,7 @@
|
||||
}
|
||||
|
||||
public void onProfileLookupFailed(GameProfile gameprofile, Exception exception) {
|
||||
- atomicreference.set((Object) null);
|
||||
+ atomicreference.set(null); // CraftBukkit - decompile error
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
--- a/net/minecraft/stats/ServerStatisticManager.java
|
||||
+++ b/net/minecraft/stats/ServerStatisticManager.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.stats;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
@@ -158,13 +159,12 @@
|
||||
}
|
||||
|
||||
private <T> Optional<Statistic<T>> a(StatisticWrapper<T> statisticwrapper, String s) {
|
||||
- Optional optional = Optional.ofNullable(MinecraftKey.a(s));
|
||||
- IRegistry iregistry = statisticwrapper.getRegistry();
|
||||
+ // CraftBukkit - decompile error start
|
||||
+ Optional<MinecraftKey> optional = Optional.ofNullable(MinecraftKey.a(s));
|
||||
+ IRegistry<T> iregistry = statisticwrapper.getRegistry();
|
||||
|
||||
- iregistry.getClass();
|
||||
- optional = optional.flatMap(iregistry::getOptional);
|
||||
- statisticwrapper.getClass();
|
||||
- return optional.map(statisticwrapper::b);
|
||||
+ return optional.flatMap(iregistry::getOptional).map(statisticwrapper::b);
|
||||
+ // CraftBukkit - decompile error end
|
||||
}
|
||||
|
||||
private static NBTTagCompound a(JsonObject jsonobject) {
|
|
@ -0,0 +1,15 @@
|
|||
--- a/net/minecraft/world/entity/ai/attributes/GenericAttributes.java
|
||||
+++ b/net/minecraft/world/entity/ai/attributes/GenericAttributes.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.world.entity.ai.attributes;
|
||||
|
||||
import net.minecraft.core.IRegistry;
|
||||
@@ -19,6 +20,6 @@
|
||||
public static final AttributeBase JUMP_STRENGTH = a("horse.jump_strength", (new AttributeRanged("attribute.name.horse.jump_strength", 0.7D, 0.0D, 2.0D)).a(true));
|
||||
|
||||
private static AttributeBase a(String s, AttributeBase attributebase) {
|
||||
- return (AttributeBase) IRegistry.a(IRegistry.ATTRIBUTE, s, (Object) attributebase);
|
||||
+ return (AttributeBase) IRegistry.a(IRegistry.ATTRIBUTE, s, attributebase); // CraftBukkit - decompile error
|
||||
}
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
--- a/net/minecraft/world/entity/animal/EntitySquid.java
|
||||
+++ b/net/minecraft/world/entity/animal/EntitySquid.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.world.entity.animal;
|
||||
|
||||
import java.util.Random;
|
|
@ -0,0 +1,16 @@
|
|||
--- a/net/minecraft/world/item/ItemDebugStick.java
|
||||
+++ b/net/minecraft/world/item/ItemDebugStick.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.world.item;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -91,7 +92,7 @@
|
||||
}
|
||||
|
||||
private static <T extends Comparable<T>> IBlockData a(IBlockData iblockdata, IBlockState<T> iblockstate, boolean flag) {
|
||||
- return (IBlockData) iblockdata.set(iblockstate, (Comparable) a((Iterable) iblockstate.getValues(), (Object) iblockdata.get(iblockstate), flag));
|
||||
+ return (IBlockData) iblockdata.set(iblockstate, a(iblockstate.getValues(), iblockdata.get(iblockstate), flag)); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
private static <T> T a(Iterable<T> iterable, @Nullable T t0, boolean flag) {
|
|
@ -0,0 +1,7 @@
|
|||
--- a/net/minecraft/world/level/StructureManager.java
|
||||
+++ b/net/minecraft/world/level/StructureManager.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.world.level;
|
||||
|
||||
import com.mojang.datafixers.DataFixUtils;
|
|
@ -0,0 +1,7 @@
|
|||
--- a/net/minecraft/world/level/block/entity/TileEntitySkull.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntitySkull.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.world.level.block.entity;
|
||||
|
||||
import com.google.common.collect.Iterables;
|
|
@ -0,0 +1,7 @@
|
|||
--- a/net/minecraft/world/level/block/state/BlockBase.java
|
||||
+++ b/net/minecraft/world/level/block/state/BlockBase.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.world.level.block.state;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
|
@ -0,0 +1,7 @@
|
|||
--- a/net/minecraft/world/level/chunk/NibbleArray.java
|
||||
+++ b/net/minecraft/world/level/chunk/NibbleArray.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.world.level.chunk;
|
||||
|
||||
import javax.annotation.Nullable;
|
|
@ -0,0 +1,81 @@
|
|||
--- a/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||
+++ b/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.world.level.chunk.storage;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
@@ -51,8 +52,8 @@
|
||||
} else {
|
||||
this.e = path1;
|
||||
this.h = this.g.asIntBuffer();
|
||||
- this.h.limit(1024);
|
||||
- this.g.position(4096);
|
||||
+ ((java.nio.Buffer) this.h).limit(1024); // CraftBukkit - decompile error
|
||||
+ ((java.nio.Buffer) this.g).position(4096); // CraftBukkit - decompile error
|
||||
this.i = this.g.asIntBuffer();
|
||||
if (flag) {
|
||||
this.dataFile = FileChannel.open(path, StandardOpenOption.CREATE, StandardOpenOption.READ, StandardOpenOption.WRITE, StandardOpenOption.DSYNC);
|
||||
@@ -61,7 +62,7 @@
|
||||
}
|
||||
|
||||
this.freeSectors.a(0, 2);
|
||||
- this.g.position(0);
|
||||
+ ((java.nio.Buffer) this.g).position(0); // CraftBukkit - decompile error
|
||||
int i = this.dataFile.read(this.g, 0L);
|
||||
|
||||
if (i != -1) {
|
||||
@@ -116,7 +117,7 @@
|
||||
ByteBuffer bytebuffer = ByteBuffer.allocate(l);
|
||||
|
||||
this.dataFile.read(bytebuffer, (long) (j * 4096));
|
||||
- bytebuffer.flip();
|
||||
+ ((java.nio.Buffer) bytebuffer).flip(); // CraftBukkit - decompile error
|
||||
if (bytebuffer.remaining() < 5) {
|
||||
RegionFile.LOGGER.error("Chunk {} header is truncated: expected {} but read {}", chunkcoordintpair, l, bytebuffer.remaining());
|
||||
return null;
|
||||
@@ -214,7 +215,7 @@
|
||||
|
||||
try {
|
||||
this.dataFile.read(bytebuffer, (long) (j * 4096));
|
||||
- bytebuffer.flip();
|
||||
+ ((java.nio.Buffer) bytebuffer).flip(); // CraftBukkit - decompile error
|
||||
if (bytebuffer.remaining() != 5) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -306,7 +307,7 @@
|
||||
|
||||
bytebuffer.putInt(1);
|
||||
bytebuffer.put((byte) (this.f.a() | 128));
|
||||
- bytebuffer.flip();
|
||||
+ ((java.nio.Buffer) bytebuffer).flip(); // CraftBukkit - decompile error
|
||||
return bytebuffer;
|
||||
}
|
||||
|
||||
@@ -316,7 +317,7 @@
|
||||
Throwable throwable = null;
|
||||
|
||||
try {
|
||||
- bytebuffer.position(5);
|
||||
+ ((java.nio.Buffer) bytebuffer).position(5); // CraftBukkit - decompile error
|
||||
filechannel.write(bytebuffer);
|
||||
} catch (Throwable throwable1) {
|
||||
throwable = throwable1;
|
||||
@@ -342,7 +343,7 @@
|
||||
}
|
||||
|
||||
private void c() throws IOException {
|
||||
- this.g.position(0);
|
||||
+ ((java.nio.Buffer) this.g).position(0); // CraftBukkit - decompile error
|
||||
this.dataFile.write(this.g, 0L);
|
||||
}
|
||||
|
||||
@@ -378,7 +379,7 @@
|
||||
if (i != j) {
|
||||
ByteBuffer bytebuffer = RegionFile.c.duplicate();
|
||||
|
||||
- bytebuffer.position(0);
|
||||
+ ((java.nio.Buffer) bytebuffer).position(0); // CraftBukkit - decompile error
|
||||
this.dataFile.write(bytebuffer, (long) (j - 1));
|
||||
}
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
--- a/net/minecraft/world/level/levelgen/StructureSettings.java
|
||||
+++ b/net/minecraft/world/level/levelgen/StructureSettings.java
|
||||
@@ -1,3 +1,4 @@
|
||||
+// mc-dev import
|
||||
package net.minecraft.world.level.levelgen;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
@@ -22,14 +23,15 @@
|
||||
return structuresettings.d;
|
||||
})).apply(instance, StructureSettings::new);
|
||||
});
|
||||
- public static final ImmutableMap<StructureGenerator<?>, StructureSettingsFeature> b = ImmutableMap.builder().put(StructureGenerator.VILLAGE, new StructureSettingsFeature(32, 8, 10387312)).put(StructureGenerator.DESERT_PYRAMID, new StructureSettingsFeature(32, 8, 14357617)).put(StructureGenerator.IGLOO, new StructureSettingsFeature(32, 8, 14357618)).put(StructureGenerator.JUNGLE_PYRAMID, new StructureSettingsFeature(32, 8, 14357619)).put(StructureGenerator.SWAMP_HUT, new StructureSettingsFeature(32, 8, 14357620)).put(StructureGenerator.PILLAGER_OUTPOST, new StructureSettingsFeature(32, 8, 165745296)).put(StructureGenerator.STRONGHOLD, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.MONUMENT, new StructureSettingsFeature(32, 5, 10387313)).put(StructureGenerator.ENDCITY, new StructureSettingsFeature(20, 11, 10387313)).put(StructureGenerator.MANSION, new StructureSettingsFeature(80, 20, 10387319)).put(StructureGenerator.BURIED_TREASURE, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.MINESHAFT, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.RUINED_PORTAL, new StructureSettingsFeature(40, 15, 34222645)).put(StructureGenerator.SHIPWRECK, new StructureSettingsFeature(24, 4, 165745295)).put(StructureGenerator.OCEAN_RUIN, new StructureSettingsFeature(20, 8, 14357621)).put(StructureGenerator.BASTION_REMNANT, new StructureSettingsFeature(27, 4, 30084232)).put(StructureGenerator.FORTRESS, new StructureSettingsFeature(27, 4, 30084232)).put(StructureGenerator.NETHER_FOSSIL, new StructureSettingsFeature(2, 1, 14357921)).build();
|
||||
+ // CraftBukkit - decompile error
|
||||
+ public static final ImmutableMap<StructureGenerator<?>, StructureSettingsFeature> b = ImmutableMap.<StructureGenerator<?>, StructureSettingsFeature>builder().put(StructureGenerator.VILLAGE, new StructureSettingsFeature(32, 8, 10387312)).put(StructureGenerator.DESERT_PYRAMID, new StructureSettingsFeature(32, 8, 14357617)).put(StructureGenerator.IGLOO, new StructureSettingsFeature(32, 8, 14357618)).put(StructureGenerator.JUNGLE_PYRAMID, new StructureSettingsFeature(32, 8, 14357619)).put(StructureGenerator.SWAMP_HUT, new StructureSettingsFeature(32, 8, 14357620)).put(StructureGenerator.PILLAGER_OUTPOST, new StructureSettingsFeature(32, 8, 165745296)).put(StructureGenerator.STRONGHOLD, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.MONUMENT, new StructureSettingsFeature(32, 5, 10387313)).put(StructureGenerator.ENDCITY, new StructureSettingsFeature(20, 11, 10387313)).put(StructureGenerator.MANSION, new StructureSettingsFeature(80, 20, 10387319)).put(StructureGenerator.BURIED_TREASURE, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.MINESHAFT, new StructureSettingsFeature(1, 0, 0)).put(StructureGenerator.RUINED_PORTAL, new StructureSettingsFeature(40, 15, 34222645)).put(StructureGenerator.SHIPWRECK, new StructureSettingsFeature(24, 4, 165745295)).put(StructureGenerator.OCEAN_RUIN, new StructureSettingsFeature(20, 8, 14357621)).put(StructureGenerator.BASTION_REMNANT, new StructureSettingsFeature(27, 4, 30084232)).put(StructureGenerator.FORTRESS, new StructureSettingsFeature(27, 4, 30084232)).put(StructureGenerator.NETHER_FOSSIL, new StructureSettingsFeature(2, 1, 14357921)).build();
|
||||
public static final StructureSettingsStronghold c;
|
||||
private final Map<StructureGenerator<?>, StructureSettingsFeature> d;
|
||||
@Nullable
|
||||
private final StructureSettingsStronghold e;
|
||||
|
||||
public StructureSettings(Optional<StructureSettingsStronghold> optional, Map<StructureGenerator<?>, StructureSettingsFeature> map) {
|
||||
- this.e = (StructureSettingsStronghold) optional.orElse((Object) null);
|
||||
+ this.e = (StructureSettingsStronghold) optional.orElse(null); // CraftBukkit - decompile error
|
||||
this.d = map;
|
||||
}
|
||||
|
||||
@@ -53,6 +55,15 @@
|
||||
}
|
||||
|
||||
static {
|
||||
+ // CraftBukkit - decompile error start
|
||||
+ c = new StructureSettingsStronghold(32, 3, 128);
|
||||
+
|
||||
+ for (StructureGenerator<?> structuregenerator : IRegistry.STRUCTURE_FEATURE) {
|
||||
+ if (!StructureSettings.b.containsKey(structuregenerator)) {
|
||||
+ throw new IllegalStateException("Structure feature without default settings: " + IRegistry.STRUCTURE_FEATURE.getKey(structuregenerator));
|
||||
+ }
|
||||
+ }
|
||||
+ /*
|
||||
Iterator iterator = IRegistry.STRUCTURE_FEATURE.iterator();
|
||||
|
||||
StructureGenerator structuregenerator;
|
||||
@@ -67,5 +78,7 @@
|
||||
} while (StructureSettings.b.containsKey(structuregenerator));
|
||||
|
||||
throw new IllegalStateException("Structure feature without default settings: " + IRegistry.STRUCTURE_FEATURE.getKey(structuregenerator));
|
||||
+ */
|
||||
+ // CraftBukkit - decompile error end
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue