3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 04:20:08 +01:00

SPIGOT-4011: Clear error for plugin misusing ChunkData

Dieser Commit ist enthalten in:
md_5 2018-07-16 09:01:23 +10:00
Ursprung 82ca5c2740
Commit 43eb8f312c

Datei anzeigen

@ -1,5 +1,6 @@
package org.bukkit.craftbukkit.generator; package org.bukkit.craftbukkit.generator;
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import it.unimi.dsi.fastutil.longs.Long2ObjectMap; import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
import it.unimi.dsi.fastutil.longs.Long2ObjectMaps; import it.unimi.dsi.fastutil.longs.Long2ObjectMaps;
@ -57,8 +58,9 @@ public class CustomChunkGenerator extends InternalChunkGenerator<GeneratorSettin
CustomBiomeGrid biomegrid = new CustomBiomeGrid(); CustomBiomeGrid biomegrid = new CustomBiomeGrid();
biomegrid.biome = chunkManager.getBiomeBlock(x << 4, z << 4, 16, 16); biomegrid.biome = chunkManager.getBiomeBlock(x << 4, z << 4, 16, 16);
CraftChunkData data = (CraftChunkData) generator.generateChunkData(this.world.getWorld(), random, x, z, biomegrid); ChunkData data = generator.generateChunkData(this.world.getWorld(), random, x, z, biomegrid);
ChunkSection[] sections = data.getRawChunkData(); Preconditions.checkArgument(data instanceof CraftChunkData, "Plugins must use createChunkData(World) rather than implementing ChunkData: %s", data);
ChunkSection[] sections = ((CraftChunkData) data).getRawChunkData();
ChunkSection[] csect = ichunkaccess.getSections(); ChunkSection[] csect = ichunkaccess.getSections();
int scnt = Math.min(csect.length, sections.length); int scnt = Math.min(csect.length, sections.length);