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
15045b4a
Commit
15045b4a
authored
Feb 20, 2025
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Vexes no longer take damage when chat data exists
parent
bb000ace
Pipeline
#13342
passed with stages
in 2 minutes 17 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
0 deletions
+32
-0
CHANGELOG.md
CHANGELOG.md
+1
-0
MixinVexEntity.java
src/main/java/com/owlmaddie/mixin/MixinVexEntity.java
+30
-0
creaturechat.mixins.json
src/main/resources/creaturechat.mixins.json
+1
-0
No files found.
CHANGELOG.md
View file @
15045b4a
...
...
@@ -14,6 +14,7 @@ All notable changes to **CreatureChat** are documented in this file. The format
### Fixed
-
Bees no longer forget their chat data when entering/leaving hives (writeNbt & readNbt modified)
-
Vexes no longer take damage when chat data exists
## [1.3.0] - 2025-01-14
...
...
src/main/java/com/owlmaddie/mixin/MixinVexEntity.java
0 → 100644
View file @
15045b4a
package
com
.
owlmaddie
.
mixin
;
import
com.owlmaddie.chat.ChatDataManager
;
import
com.owlmaddie.chat.EntityChatData
;
import
net.minecraft.entity.mob.VexEntity
;
import
org.spongepowered.asm.mixin.Mixin
;
import
org.spongepowered.asm.mixin.Shadow
;
import
org.spongepowered.asm.mixin.injection.At
;
import
org.spongepowered.asm.mixin.injection.Inject
;
import
org.spongepowered.asm.mixin.injection.callback.CallbackInfo
;
/**
* Mixin to modify Vex behavior by setting `alive = false` if chat data exists.
*/
@Mixin
(
VexEntity
.
class
)
public
abstract
class
MixinVexEntity
{
@Shadow
private
boolean
alive
;
@Inject
(
method
=
"tick"
,
at
=
@At
(
"HEAD"
))
private
void
disableVexIfChatData
(
CallbackInfo
ci
)
{
VexEntity
vex
=
(
VexEntity
)
(
Object
)
this
;
// Get chat data for this Vex
EntityChatData
chatData
=
ChatDataManager
.
getServerInstance
().
getOrCreateChatData
(
vex
.
getUuidAsString
());
if
(
this
.
alive
&&
!
chatData
.
characterSheet
.
isEmpty
())
{
this
.
alive
=
false
;
// Prevents the Vex from ticking and taking damage
}
}
}
src/main/resources/creaturechat.mixins.json
View file @
15045b4a
...
...
@@ -9,6 +9,7 @@
"MixinBucketable"
,
"MixinEntityChatData"
,
"MixinWitherEntity"
,
"MixinVexEntity"
,
"MixinVillagerEntity"
,
"MixinOnChat"
],
...
...
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