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
af668eda
Commit
af668eda
authored
8 months ago
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatically tame best friends (who are tameable) and un-tame worst enemies!
parent
0c61d35a
Pipeline
#12719
passed with stages
in 2 minutes 19 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
CHANGELOG.md
CHANGELOG.md
+1
-0
ChatDataManager.java
src/main/java/com/owlmaddie/chat/ChatDataManager.java
+11
-0
No files found.
CHANGELOG.md
View file @
af668eda
...
...
@@ -10,6 +10,7 @@ All notable changes to **CreatureChat** are documented in this file. The format
-
New LEAD behavior, to guide a player to a random location (and show message when destination is reached)
-
Best friends are now rideable! Right click with an empty hand. Excludes tameable entities (dogs, cats, etc...)
-
Villager trades are now affected by friendship! Be nice!
-
Automatically tame best friends (who are tameable) and un-tame worst enemies!
### Changed
-
Large refactor of how MobEntity avoids targeting players when friendship > 0
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/owlmaddie/chat/ChatDataManager.java
View file @
af668eda
...
...
@@ -16,6 +16,7 @@ import com.owlmaddie.utils.ServerEntityFinder;
import
com.owlmaddie.utils.VillagerEntityAccessor
;
import
net.minecraft.entity.boss.dragon.EnderDragonEntity
;
import
net.minecraft.entity.mob.MobEntity
;
import
net.minecraft.entity.passive.TameableEntity
;
import
net.minecraft.entity.passive.VillagerEntity
;
import
net.minecraft.item.ItemStack
;
import
net.minecraft.server.MinecraftServer
;
...
...
@@ -367,6 +368,16 @@ public class ChatDataManager {
}
}
// Tame best friends and un-tame worst enemies
if
(
entity
instanceof
TameableEntity
&&
this
.
friendship
!=
new_friendship
)
{
TameableEntity
tamableEntity
=
(
TameableEntity
)
entity
;
if
(
new_friendship
==
3
&&
!
tamableEntity
.
isTamed
())
{
tamableEntity
.
setOwner
(
player
);
}
else
if
(
new_friendship
==
-
3
&&
tamableEntity
.
isTamed
())
{
tamableEntity
.
setTamed
(
false
);
}
}
this
.
friendship
=
new_friendship
;
}
}
...
...
This diff is collapsed.
Click to expand it.
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