mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Exclude spawn bonus chests from mimics
This commit is contained in:
parent
fad0e207a0
commit
f33bc26ac7
1 changed files with 3 additions and 1 deletions
|
@ -71,6 +71,7 @@ public class MimicEntity extends PathAwareEntity {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Local difficulty?
|
||||||
int difficulty = world.getDifficulty().ordinal() - 1;
|
int difficulty = world.getDifficulty().ordinal() - 1;
|
||||||
float threshold = 0.35F * ((EnchantmentUtil.getLuck(0, player) / 20F) + 0.5F);
|
float threshold = 0.35F * ((EnchantmentUtil.getLuck(0, player) / 20F) + 0.5F);
|
||||||
return difficulty > 0 && world.random.nextFloat() < (difficulty / 3F) * threshold;
|
return difficulty > 0 && world.random.nextFloat() < (difficulty / 3F) * threshold;
|
||||||
|
@ -103,7 +104,8 @@ public class MimicEntity extends PathAwareEntity {
|
||||||
&& lootTable.getValue().getPath().indexOf("village") == -1
|
&& lootTable.getValue().getPath().indexOf("village") == -1
|
||||||
&& lootTable.getValue().getPath().indexOf("bastion") == -1
|
&& lootTable.getValue().getPath().indexOf("bastion") == -1
|
||||||
&& lootTable.getValue().getPath().indexOf("underwater") == -1
|
&& lootTable.getValue().getPath().indexOf("underwater") == -1
|
||||||
&& lootTable.getValue().getPath().indexOf("shipwreck") == -1;
|
&& lootTable.getValue().getPath().indexOf("shipwreck") == -1
|
||||||
|
&& !LootTables.SPAWN_BONUS_CHEST.equals(lootTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
MimicEntity(EntityType<? extends MimicEntity> type, World world) {
|
MimicEntity(EntityType<? extends MimicEntity> type, World world) {
|
||||||
|
|
Loading…
Reference in a new issue