mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Fix DungeonHooks not returning correct values. Fixes dungeons in world spawning pigs.
This commit is contained in:
1 parent
eb1a9b57c6
commit
54b2c18fcf
2 files changed
+3
-7
No files matched your search
@@ -59,7 +59,7 @@ public class DungeonHooks
|
||||
if (type == mob.type)
|
||||
{
|
||||
itr.remove();
|
||||
rarity = /* mob.weight */ 0 + rarity;
|
||||
rarity = mob.getWeight().asInt() + rarity;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public class DungeonHooks
|
||||
if (name == mob.type)
|
||||
{
|
||||
dungeonMobs.remove(mob);
|
||||
return 0; // mob.weight;
|
||||
return mob.getWeight().asInt();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -95,7 +95,7 @@ public class DungeonHooks
|
||||
public static EntityType<?> getRandomDungeonMob(Random rand)
|
||||
{
|
||||
DungeonMob mob = WeightedRandom.getRandomItem(rand, dungeonMobs).orElseThrow();
|
||||
return null; // mob.type;
|
||||
return mob.type;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,11 +25,9 @@ import java.util.Comparator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -38,12 +36,10 @@ import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
||||
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
|
||||
import net.minecraft.server.packs.repository.RepositorySource;
|
||||
import net.minecraft.server.packs.repository.Pack;
|
||||
import net.minecraft.server.packs.repository.Pack.PackConstructor;
|
||||
import net.minecraft.server.packs.repository.PackRepository;
|
||||
import net.minecraftforge.fml.ModList;
|
||||
import net.minecraftforge.forgespi.language.IModFileInfo;
|
||||
import net.minecraftforge.forgespi.locating.IModFile;
|
||||
import net.minecraftforge.resource.PathResourcePack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
Reference in new issue
Block a user