Skip to content

Commit

Permalink
sync with 16
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan-1F committed Feb 26, 2021
1 parent 5f37e24 commit 8abd350
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,19 @@ public class ServerWorldMixin {
private void spawnEntity(Entity entity, CallbackInfoReturnable<Boolean> cir) {
if (IvanCarpetAdditionSettings.mobSpawningRestrictionMode.equals("blacklist")) {
Set<String> blackList = Sets.newLinkedHashSet(Arrays.asList(IvanCarpetAdditionSettings.mobBlackList.split(",")));
if (blackList.contains(entity.getName().getString().toLowerCase())) {
cir.setReturnValue(false);
}
blackList.forEach(name -> {
if (entity.getType().getTranslationKey().contains(name)) {
cir.setReturnValue(false);
}
});
}
if (IvanCarpetAdditionSettings.mobSpawningRestrictionMode.equals("whitelist")) {
Set<String> whitelist = Sets.newLinkedHashSet(Arrays.asList(IvanCarpetAdditionSettings.mobWhiteList.split(",")));
if (!whitelist.contains(entity.getName().getString().toLowerCase())) {
cir.setReturnValue(false);
}
whitelist.forEach(name -> {
if (!entity.getType().getTranslationKey().contains(name)) {
cir.setReturnValue(false);
}
});
}
}
}

0 comments on commit 8abd350

Please sign in to comment.