Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
CreatureChat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Public
CreatureChat
Commits
8e54c9d0
Commit
8e54c9d0
authored
Jul 16, 2024
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert previous commit, allow interactions with blacklisted entities (if they have chatdata)
parent
d39dd9e8
Pipeline
#12674
passed with stages
in 2 minutes 10 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
33 deletions
+0
-33
MixinLivingEntity.java
src/main/java/com/owlmaddie/mixin/MixinLivingEntity.java
+0
-17
MixinMobEntity.java
src/main/java/com/owlmaddie/mixin/MixinMobEntity.java
+0
-16
No files found.
src/main/java/com/owlmaddie/mixin/MixinLivingEntity.java
View file @
8e54c9d0
...
...
@@ -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
();
...
...
src/main/java/com/owlmaddie/mixin/MixinMobEntity.java
View file @
8e54c9d0
...
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment