Update to Minecraft 1.18-pre5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-11-22 09:00:00 +11:00
parent a852b81a69
commit 43702a9e10
700 changed files with 10286 additions and 10098 deletions

View File

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/storage/Convertable.java
+++ b/net/minecraft/world/level/storage/Convertable.java
@@ -61,6 +61,10 @@
@@ -56,6 +56,10 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -11,64 +11,33 @@
public class Convertable {
static final Logger LOGGER = LogManager.getLogger();
@@ -106,26 +110,26 @@
Logger logger = Convertable.LOGGER;
Objects.requireNonNull(logger);
- return Pair.of((GeneratorSettings) dataresult.resultOrPartial(SystemUtils.a("WorldGenSettings: ", logger::error)).orElseGet(() -> {
+ return Pair.of(dataresult.resultOrPartial(SystemUtils.a("WorldGenSettings: ", (java.util.function.Consumer<String>) logger::error)).orElseGet(() -> { // CraftBukkit - decompile error
DataResult dataresult1 = RegistryLookupCodec.a(IRegistry.DIMENSION_TYPE_REGISTRY).codec().parse(dynamic2);
Logger logger1 = Convertable.LOGGER;
Objects.requireNonNull(logger1);
- IRegistry<DimensionManager> iregistry = (IRegistry) dataresult1.resultOrPartial(SystemUtils.a("Dimension type registry: ", logger1::error)).orElseThrow(() -> {
+ IRegistry<DimensionManager> iregistry = (IRegistry) ((DataResult<IRegistry<DimensionManager>>) dataresult1).resultOrPartial(SystemUtils.a("Dimension type registry: ", (java.util.function.Consumer<String>) logger1::error)).orElseThrow(() -> { // CraftBukkit - decompile error
return new IllegalStateException("Failed to get dimension registry");
});
dataresult1 = RegistryLookupCodec.a(IRegistry.BIOME_REGISTRY).codec().parse(dynamic2);
logger1 = Convertable.LOGGER;
Objects.requireNonNull(logger1);
- IRegistry<BiomeBase> iregistry1 = (IRegistry) dataresult1.resultOrPartial(SystemUtils.a("Biome registry: ", logger1::error)).orElseThrow(() -> {
+ IRegistry<BiomeBase> iregistry1 = (IRegistry) ((DataResult<IRegistry<BiomeBase>>) dataresult1).resultOrPartial(SystemUtils.a("Biome registry: ", (java.util.function.Consumer<String>) logger1::error)).orElseThrow(() -> { // CraftBukkit - decompile error
return new IllegalStateException("Failed to get biome registry");
});
dataresult1 = RegistryLookupCodec.a(IRegistry.NOISE_GENERATOR_SETTINGS_REGISTRY).codec().parse(dynamic2);
logger1 = Convertable.LOGGER;
Objects.requireNonNull(logger1);
- IRegistry<GeneratorSettingBase> iregistry2 = (IRegistry) dataresult1.resultOrPartial(SystemUtils.a("Noise settings registry: ", logger1::error)).orElseThrow(() -> {
+ IRegistry<GeneratorSettingBase> iregistry2 = (IRegistry) ((DataResult<IRegistry<GeneratorSettingBase>>) dataresult1).resultOrPartial(SystemUtils.a("Noise settings registry: ", (java.util.function.Consumer<String>) logger1::error)).orElseThrow(() -> { // CraftBukkit - decompile error
return new IllegalStateException("Failed to get noise settings registry");
});
@@ -302,9 +306,23 @@
@@ -277,9 +281,23 @@
return this.backupDir;
}
- public Convertable.ConversionSession c(String s) throws IOException {
- public Convertable.ConversionSession createAccess(String s) throws IOException {
- return new Convertable.ConversionSession(s);
+ // CraftBukkit start
+ public Convertable.ConversionSession c(String s, ResourceKey<WorldDimension> dimensionType) throws IOException {
+ public Convertable.ConversionSession createAccess(String s, ResourceKey<WorldDimension> dimensionType) throws IOException {
+ return new Convertable.ConversionSession(s, dimensionType);
+ }
+
+ public static File getFolder(File file, ResourceKey<WorldDimension> dimensionType) {
+ public static Path getStorageFolder(Path path, ResourceKey<WorldDimension> dimensionType) {
+ if (dimensionType == WorldDimension.OVERWORLD) {
+ return file;
+ return path;
+ } else if (dimensionType == WorldDimension.NETHER) {
+ return new File(file, "DIM-1");
+ return path.resolve("DIM-1");
+ } else if (dimensionType == WorldDimension.END) {
+ return new File(file, "DIM1");
+ return path.resolve("DIM1");
+ } else {
+ return new File(file, "dimensions/" + dimensionType.a().getNamespace() + "/" + dimensionType.a().getKey());
+ return path.resolve("dimensions").resolve(dimensionType.location().getNamespace()).resolve(dimensionType.location().getPath());
+ }
}
+ // CraftBukkit end
public class ConversionSession implements AutoCloseable {
@@ -312,8 +330,12 @@
@@ -287,8 +305,12 @@
public final Path levelPath;
private final String levelId;
private final Map<SavedFile, Path> resources = Maps.newHashMap();
@@ -81,13 +50,13 @@
+ // CraftBukkit end
this.levelId = s;
this.levelPath = Convertable.this.baseDir.resolve(s);
this.lock = SessionLock.a(this.levelPath);
@@ -330,7 +352,7 @@
this.lock = SessionLock.create(this.levelPath);
@@ -305,7 +327,7 @@
}
public File a(ResourceKey<World> resourcekey) {
- return DimensionManager.a(resourcekey, this.levelPath.toFile());
+ return getFolder(this.levelPath.toFile(), this.dimensionType); // CraftBukkit
public Path getDimensionPath(ResourceKey<World> resourcekey) {
- return DimensionManager.getStorageFolder(resourcekey, this.levelPath);
+ return getStorageFolder(this.levelPath, this.dimensionType); // CraftBukkit
}
private void checkSession() {
private void checkLock() {

View File

@@ -28,44 +28,39 @@
return (NBTBase) dynamic.get("DimensionData").get("1").get("DragonFight").orElseEmptyMap().getValue();
});
- return new WorldDataServer(datafixer, i, nbttagcompound, dynamic.get("WasModded").asBoolean(false), dynamic.get("SpawnX").asInt(0), dynamic.get("SpawnY").asInt(0), dynamic.get("SpawnZ").asInt(0), dynamic.get("SpawnAngle").asFloat(0.0F), j, dynamic.get("DayTime").asLong(j), levelversion.a(), dynamic.get("clearWeatherTime").asInt(0), dynamic.get("rainTime").asInt(0), dynamic.get("raining").asBoolean(false), dynamic.get("thunderTime").asInt(0), dynamic.get("thundering").asBoolean(false), dynamic.get("initialized").asBoolean(true), dynamic.get("DifficultyLocked").asBoolean(false), WorldBorder.c.a(dynamic, WorldBorder.DEFAULT_SETTINGS), dynamic.get("WanderingTraderSpawnDelay").asInt(0), dynamic.get("WanderingTraderSpawnChance").asInt(0), (UUID) dynamic.get("WanderingTraderId").read(MinecraftSerializableUUID.CODEC).result().orElse((Object) null), (Set) dynamic.get("ServerBrands").asStream().flatMap((dynamic1) -> {
- return new WorldDataServer(datafixer, i, nbttagcompound, dynamic.get("WasModded").asBoolean(false), dynamic.get("SpawnX").asInt(0), dynamic.get("SpawnY").asInt(0), dynamic.get("SpawnZ").asInt(0), dynamic.get("SpawnAngle").asFloat(0.0F), j, dynamic.get("DayTime").asLong(j), levelversion.levelDataVersion(), dynamic.get("clearWeatherTime").asInt(0), dynamic.get("rainTime").asInt(0), dynamic.get("raining").asBoolean(false), dynamic.get("thunderTime").asInt(0), dynamic.get("thundering").asBoolean(false), dynamic.get("initialized").asBoolean(true), dynamic.get("DifficultyLocked").asBoolean(false), WorldBorder.c.read(dynamic, WorldBorder.DEFAULT_SETTINGS), dynamic.get("WanderingTraderSpawnDelay").asInt(0), dynamic.get("WanderingTraderSpawnChance").asInt(0), (UUID) dynamic.get("WanderingTraderId").read(MinecraftSerializableUUID.CODEC).result().orElse((Object) null), (Set) dynamic.get("ServerBrands").asStream().flatMap((dynamic1) -> {
+ // CraftBukkit - decompile error
+ return new WorldDataServer(datafixer, i, nbttagcompound, dynamic.get("WasModded").asBoolean(false), dynamic.get("SpawnX").asInt(0), dynamic.get("SpawnY").asInt(0), dynamic.get("SpawnZ").asInt(0), dynamic.get("SpawnAngle").asFloat(0.0F), j, dynamic.get("DayTime").asLong(j), levelversion.a(), dynamic.get("clearWeatherTime").asInt(0), dynamic.get("rainTime").asInt(0), dynamic.get("raining").asBoolean(false), dynamic.get("thunderTime").asInt(0), dynamic.get("thundering").asBoolean(false), dynamic.get("initialized").asBoolean(true), dynamic.get("DifficultyLocked").asBoolean(false), WorldBorder.c.a(dynamic, WorldBorder.DEFAULT_SETTINGS), dynamic.get("WanderingTraderSpawnDelay").asInt(0), dynamic.get("WanderingTraderSpawnChance").asInt(0), (UUID) dynamic.get("WanderingTraderId").read(MinecraftSerializableUUID.CODEC).result().orElse(null), (Set) dynamic.get("ServerBrands").asStream().flatMap((dynamic1) -> {
return SystemUtils.a(dynamic1.asString().result());
+ return new WorldDataServer(datafixer, i, nbttagcompound, dynamic.get("WasModded").asBoolean(false), dynamic.get("SpawnX").asInt(0), dynamic.get("SpawnY").asInt(0), dynamic.get("SpawnZ").asInt(0), dynamic.get("SpawnAngle").asFloat(0.0F), j, dynamic.get("DayTime").asLong(j), levelversion.levelDataVersion(), dynamic.get("clearWeatherTime").asInt(0), dynamic.get("rainTime").asInt(0), dynamic.get("raining").asBoolean(false), dynamic.get("thunderTime").asInt(0), dynamic.get("thundering").asBoolean(false), dynamic.get("initialized").asBoolean(true), dynamic.get("DifficultyLocked").asBoolean(false), WorldBorder.c.read(dynamic, WorldBorder.DEFAULT_SETTINGS), dynamic.get("WanderingTraderSpawnDelay").asInt(0), dynamic.get("WanderingTraderSpawnChance").asInt(0), (UUID) dynamic.get("WanderingTraderId").read(MinecraftSerializableUUID.CODEC).result().orElse(null), (Set) dynamic.get("ServerBrands").asStream().flatMap((dynamic1) -> {
return SystemUtils.toStream(dynamic1.asString().result());
}).collect(Collectors.toCollection(Sets::newLinkedHashSet)), new CustomFunctionCallbackTimerQueue<>(CustomFunctionCallbackTimers.SERVER_CALLBACKS, dynamic.get("ScheduledEvents").asStream()), (NBTTagCompound) dynamic.get("CustomBossEvents").orElseEmptyMap().getValue(), nbttagcompound1, worldsettings, generatorsettings, lifecycle);
}
@@ -141,7 +152,7 @@
private void a(IRegistryCustom iregistrycustom, NBTTagCompound nbttagcompound, @Nullable NBTTagCompound nbttagcompound1) {
private void setTagData(IRegistryCustom iregistrycustom, NBTTagCompound nbttagcompound, @Nullable NBTTagCompound nbttagcompound1) {
NBTTagList nbttaglist = new NBTTagList();
- Stream stream = this.knownServerBrands.stream().map(NBTTagString::a);
+ Stream<NBTTagString> stream = this.knownServerBrands.stream().map(NBTTagString::a); // CraftBukkit - decompile error
- Stream stream = this.knownServerBrands.stream().map(NBTTagString::valueOf);
+ Stream<NBTTagString> stream = this.knownServerBrands.stream().map(NBTTagString::valueOf); // CraftBukkit - decompile error
Objects.requireNonNull(nbttaglist);
stream.forEach(nbttaglist::add);
@@ -155,11 +166,11 @@
nbttagcompound.set("Version", nbttagcompound2);
nbttagcompound.setInt("DataVersion", SharedConstants.getGameVersion().getWorldVersion());
RegistryWriteOps<NBTBase> registrywriteops = RegistryWriteOps.a(DynamicOpsNBT.INSTANCE, iregistrycustom);
@@ -156,7 +167,7 @@
nbttagcompound.put("Version", nbttagcompound2);
nbttagcompound.putInt("DataVersion", SharedConstants.getCurrentVersion().getWorldVersion());
RegistryWriteOps<NBTBase> registrywriteops = RegistryWriteOps.create(DynamicOpsNBT.INSTANCE, iregistrycustom);
- DataResult dataresult = GeneratorSettings.CODEC.encodeStart(registrywriteops, this.worldGenSettings);
+ DataResult<NBTBase> dataresult = GeneratorSettings.CODEC.encodeStart(registrywriteops, this.worldGenSettings); // CraftBukkit - decompile error
Logger logger = WorldDataServer.LOGGER;
Objects.requireNonNull(logger);
- dataresult.resultOrPartial(SystemUtils.a("WorldGenSettings: ", logger::error)).ifPresent((nbtbase) -> {
+ dataresult.resultOrPartial(SystemUtils.a("WorldGenSettings: ", (java.util.function.Consumer<String>) logger::error)).ifPresent((nbtbase) -> { // CraftBukkit - decompile error
nbttagcompound.set("WorldGenSettings", nbtbase);
});
nbttagcompound.setInt("GameType", this.settings.getGameType().getId());
@@ -203,6 +214,7 @@
nbttagcompound.a("WanderingTraderId", this.wanderingTraderId);
@@ -204,6 +215,7 @@
nbttagcompound.putUUID("WanderingTraderId", this.wanderingTraderId);
}
+ nbttagcompound.setString("Bukkit.Version", Bukkit.getName() + "/" + Bukkit.getVersion() + "/" + Bukkit.getBukkitVersion()); // CraftBukkit
+ nbttagcompound.putString("Bukkit.Version", Bukkit.getName() + "/" + Bukkit.getVersion() + "/" + Bukkit.getBukkitVersion()); // CraftBukkit
}
@Override
@@ -320,6 +332,20 @@
@@ -321,6 +333,20 @@
@Override
public void setThundering(boolean flag) {
@@ -74,7 +69,7 @@
+ return;
+ }
+
+ org.bukkit.World world = Bukkit.getWorld(getName());
+ org.bukkit.World world = Bukkit.getWorld(getLevelName());
+ if (world != null) {
+ ThunderChangeEvent thunder = new ThunderChangeEvent(world, flag);
+ Bukkit.getServer().getPluginManager().callEvent(thunder);
@@ -86,16 +81,16 @@
this.thundering = flag;
}
@@ -340,6 +366,20 @@
@@ -341,6 +367,20 @@
@Override
public void setStorm(boolean flag) {
public void setRaining(boolean flag) {
+ // CraftBukkit start
+ if (this.raining == flag) {
+ return;
+ }
+
+ org.bukkit.World world = Bukkit.getWorld(getName());
+ org.bukkit.World world = Bukkit.getWorld(getLevelName());
+ if (world != null) {
+ WeatherChangeEvent weather = new WeatherChangeEvent(world, flag);
+ Bukkit.getServer().getPluginManager().callEvent(weather);
@@ -107,22 +102,22 @@
this.raining = flag;
}
@@ -406,6 +446,12 @@
@@ -407,6 +447,12 @@
@Override
public void setDifficulty(EnumDifficulty enumdifficulty) {
this.settings = this.settings.a(enumdifficulty);
this.settings = this.settings.withDifficulty(enumdifficulty);
+ // CraftBukkit start
+ PacketPlayOutServerDifficulty packet = new PacketPlayOutServerDifficulty(this.getDifficulty(), this.isDifficultyLocked());
+ for (EntityPlayer player : (java.util.List<EntityPlayer>) (java.util.List) world.getPlayers()) {
+ player.connection.sendPacket(packet);
+ for (EntityPlayer player : (java.util.List<EntityPlayer>) (java.util.List) world.players()) {
+ player.connection.send(packet);
+ }
+ // CraftBukkit end
}
@Override
@@ -526,4 +572,12 @@
public WorldSettings I() {
return this.settings.h();
@@ -527,4 +573,12 @@
public WorldSettings getLevelSettings() {
return this.settings.copy();
}
+
+ // CraftBukkit start - Check if the name stored in NBT is the correct one

View File

@@ -22,15 +22,15 @@
+ if (entityhuman instanceof EntityPlayer) {
+ CraftPlayer player = (CraftPlayer) entityhuman.getBukkitEntity();
+ // Only update first played if it is older than the one we have
+ long modified = new File(this.playerDir, entityhuman.getUniqueID().toString() + ".dat").lastModified();
+ long modified = new File(this.playerDir, entityhuman.getUUID().toString() + ".dat").lastModified();
+ if (modified < player.getFirstPlayed()) {
+ player.setFirstPlayed(modified);
+ }
+ }
+ // CraftBukkit end
int i = nbttagcompound.hasKeyOfType("DataVersion", 3) ? nbttagcompound.getInt("DataVersion") : -1;
int i = nbttagcompound.contains("DataVersion", 3) ? nbttagcompound.getInt("DataVersion") : -1;
entityhuman.load(GameProfileSerializer.a(this.fixerUpper, DataFixTypes.PLAYER, nbttagcompound, i));
entityhuman.load(GameProfileSerializer.update(this.fixerUpper, DataFixTypes.PLAYER, nbttagcompound, i));
@@ -63,6 +80,22 @@
return nbttagcompound;
}
@@ -41,7 +41,7 @@
+ File file1 = new File(this.playerDir, s + ".dat");
+
+ if (file1.exists()) {
+ return NBTCompressedStreamTools.a((InputStream) (new FileInputStream(file1)));
+ return NBTCompressedStreamTools.readCompressed((InputStream) (new FileInputStream(file1)));
+ }
+ } catch (Exception exception) {
+ LOGGER.warn("Failed to load player data for " + s);

View File

@@ -17,15 +17,15 @@
@@ -115,8 +122,21 @@
}
public void fillInventory(IInventory iinventory, LootTableInfo loottableinfo) {
public void fill(IInventory iinventory, LootTableInfo loottableinfo) {
+ // CraftBukkit start
+ this.fillInventory(iinventory, loottableinfo, false);
+ }
+
+ public void fillInventory(IInventory iinventory, LootTableInfo loottableinfo, boolean plugin) {
+ // CraftBukkit end
List<ItemStack> list = this.populateLoot(loottableinfo);
Random random = loottableinfo.a();
List<ItemStack> list = this.getRandomItems(loottableinfo);
Random random = loottableinfo.getRandom();
+ // CraftBukkit start
+ LootGenerateEvent event = CraftEventFactory.callLootGenerateEvent(iinventory, this, loottableinfo, list, plugin);
+ if (event.isCancelled()) {
@@ -33,6 +33,6 @@
+ }
+ list = event.getLoot().stream().map(CraftItemStack::asNMSCopy).collect(Collectors.toList());
+ // CraftBukkit end
List<Integer> list1 = this.a(iinventory, random);
List<Integer> list1 = this.getAvailableSlots(iinventory, random);
this.a(list, list1.size(), random);
this.shuffleAndSplitItems(list, list1.size(), random);

View File

@@ -2,7 +2,7 @@
+++ b/net/minecraft/world/level/storage/loot/LootTableRegistry.java
@@ -22,6 +22,7 @@
private static final Logger LOGGER = LogManager.getLogger();
private static final Gson GSON = LootSerialization.c().create();
private static final Gson GSON = LootSerialization.createLootTableSerializer().create();
private Map<MinecraftKey, LootTable> tables = ImmutableMap.of();
+ public Map<LootTable, MinecraftKey> lootTableToKey = ImmutableMap.of(); // CraftBukkit
private final LootPredicateManager predicateManager;
@@ -12,8 +12,8 @@
LootPredicateManager lootpredicatemanager = this.predicateManager;
Objects.requireNonNull(this.predicateManager);
- Function function = lootpredicatemanager::a;
+ Function<MinecraftKey, net.minecraft.world.level.storage.loot.predicates.LootItemCondition> function = lootpredicatemanager::a; // CraftBukkit - decompile error
- Function function = lootpredicatemanager::get;
+ Function<MinecraftKey, net.minecraft.world.level.storage.loot.predicates.LootItemCondition> function = lootpredicatemanager::get; // CraftBukkit - decompile error
Objects.requireNonNull(immutablemap);
LootCollector lootcollector = new LootCollector(lootcontextparameterset, function, immutablemap::get);
@@ -28,4 +28,4 @@
+ // CraftBukkit end
}
public static void a(LootCollector lootcollector, MinecraftKey minecraftkey, LootTable loottable) {
public static void validate(LootCollector lootcollector, MinecraftKey minecraftkey, LootTable loottable) {

View File

@@ -3,10 +3,10 @@
@@ -49,8 +49,13 @@
if (entity instanceof EntityLiving) {
int i = EnchantmentManager.g((EntityLiving) entity);
int i = EnchantmentManager.getMobLooting((EntityLiving) entity);
+ // CraftBukkit start - use lootingModifier if set by plugin
+ if (loottableinfo.hasContextParameter(LootContextParameters.LOOTING_MOD)) {
+ i = loottableinfo.getContextParameter(LootContextParameters.LOOTING_MOD);
+ if (loottableinfo.hasParam(LootContextParameters.LOOTING_MOD)) {
+ i = loottableinfo.getParamOrNull(LootContextParameters.LOOTING_MOD);
+ }
+ // CraftBukkit end
@@ -18,9 +18,9 @@
@@ -99,7 +104,7 @@
public b() {}
public void a(JsonObject jsonobject, LootEnchantFunction lootenchantfunction, JsonSerializationContext jsonserializationcontext) {
- super.a(jsonobject, (LootItemFunctionConditional) lootenchantfunction, jsonserializationcontext);
+ super.a(jsonobject, lootenchantfunction, jsonserializationcontext); // CraftBukkit - decompile error
public void serialize(JsonObject jsonobject, LootEnchantFunction lootenchantfunction, JsonSerializationContext jsonserializationcontext) {
- super.serialize(jsonobject, (LootItemFunctionConditional) lootenchantfunction, jsonserializationcontext);
+ super.serialize(jsonobject, lootenchantfunction, jsonserializationcontext); // CraftBukkit - decompile error
jsonobject.add("count", jsonserializationcontext.serialize(lootenchantfunction.value));
if (lootenchantfunction.c()) {
if (lootenchantfunction.hasLimit()) {
jsonobject.add("limit", jsonserializationcontext.serialize(lootenchantfunction.limit));

View File

@@ -1,9 +1,9 @@
--- a/net/minecraft/world/level/storage/loot/parameters/LootContextParameters.java
+++ b/net/minecraft/world/level/storage/loot/parameters/LootContextParameters.java
@@ -21,6 +21,7 @@
public static final LootContextParameter<TileEntity> BLOCK_ENTITY = a("block_entity");
public static final LootContextParameter<ItemStack> TOOL = a("tool");
public static final LootContextParameter<Float> EXPLOSION_RADIUS = a("explosion_radius");
public static final LootContextParameter<TileEntity> BLOCK_ENTITY = create("block_entity");
public static final LootContextParameter<ItemStack> TOOL = create("tool");
public static final LootContextParameter<Float> EXPLOSION_RADIUS = create("explosion_radius");
+ public static final LootContextParameter<Integer> LOOTING_MOD = new LootContextParameter<>(new MinecraftKey("bukkit:looting_mod")); // CraftBukkit
public LootContextParameters() {}

View File

@@ -2,13 +2,13 @@
+++ b/net/minecraft/world/level/storage/loot/predicates/LootItemConditionRandomChanceWithLooting.java
@@ -41,6 +41,11 @@
if (entity instanceof EntityLiving) {
i = EnchantmentManager.g((EntityLiving) entity);
i = EnchantmentManager.getMobLooting((EntityLiving) entity);
}
+ // CraftBukkit start - only use lootingModifier if set by Bukkit
+ if (loottableinfo.hasContextParameter(LootContextParameters.LOOTING_MOD)) {
+ i = loottableinfo.getContextParameter(LootContextParameters.LOOTING_MOD);
+ if (loottableinfo.hasParam(LootContextParameters.LOOTING_MOD)) {
+ i = loottableinfo.getParamOrNull(LootContextParameters.LOOTING_MOD);
+ }
+ // CraftBukkit end
return loottableinfo.a().nextFloat() < this.percent + (float) i * this.lootingMultiplier;
return loottableinfo.getRandom().nextFloat() < this.percent + (float) i * this.lootingMultiplier;
}

View File

@@ -1,7 +1,7 @@
--- a/net/minecraft/world/level/storage/loot/predicates/LootItemConditionSurvivesExplosion.java
+++ b/net/minecraft/world/level/storage/loot/predicates/LootItemConditionSurvivesExplosion.java
@@ -34,7 +34,8 @@
Random random = loottableinfo.a();
Random random = loottableinfo.getRandom();
float f = 1.0F / ofloat;
- return random.nextFloat() <= f;