Commit 8e54c9d0 by Jonathan Thomas

Revert previous commit, allow interactions with blacklisted entities (if they have chatdata)

parent d39dd9e8
Pipeline #12674 passed with stages
in 2 minutes 10 seconds
......@@ -49,23 +49,6 @@ public class MixinLivingEntity implements LivingEntityInterface {
// If PLAYER attacks MOB then
if (attacker instanceof PlayerEntity && thisEntity instanceof MobEntity && !thisEntity.isDead()) {
// Get config (whitelist / blacklist)
ConfigurationHandler.Config config = new ConfigurationHandler(ServerPackets.serverInstance).loadConfig();
List<String> whitelist = config.getWhitelist();
List<String> blacklist = config.getBlacklist();
Identifier entityId = Registries.ENTITY_TYPE.getId(thisEntity.getType());
String entityIdString = entityId.toString();
if (blacklist.contains(entityIdString)) {
// entity is black listed (no interacting)
return;
}
if (!whitelist.isEmpty() && !whitelist.contains(entityIdString)) {
// entity is not white listed (no interacting)
return;
}
// Generate attacked message (only if the previous user message was not an attacked message)
// We don't want to constantly generate messages during a prolonged, multi-damage event
ChatDataManager chatDataManager = ChatDataManager.getServerInstance();
......
......@@ -31,22 +31,6 @@ public class MixinMobEntity {
ItemStack itemStack = player.getStackInHand(hand);
MobEntity thisEntity = (MobEntity) (Object) this;
// Get config (whitelist / blacklist)
ConfigurationHandler.Config config = new ConfigurationHandler(ServerPackets.serverInstance).loadConfig();
List<String> whitelist = config.getWhitelist();
List<String> blacklist = config.getBlacklist();
Identifier entityId = Registries.ENTITY_TYPE.getId(thisEntity.getType());
String entityIdString = entityId.toString();
if (blacklist.contains(entityIdString)) {
// entity is black listed (no interacting)
return;
}
if (!whitelist.isEmpty() && !whitelist.contains(entityIdString)) {
// entity is not white listed (no interacting)
return;
}
// Determine if the item is a bucket
// We don't want to interact on buckets
Item item = itemStack.getItem();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment