Add mc-dev imports

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-04-07 15:03:29 +10:00
parent 0352f0e143
commit 97cd7810a3
21 changed files with 308 additions and 0 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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));
}

View File

@@ -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
}
}