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
2d0a321c
Commit
2d0a321c
authored
Dec 24, 2024
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code clean-up, import optimizing, and adding documentation to some classes which were missing it
parent
646c2131
Pipeline
#13202
passed with stages
in 2 minutes 22 seconds
Changes
9
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
31 additions
and
47 deletions
+31
-47
BehaviorParticle.java
src/client/java/com/owlmaddie/particle/BehaviorParticle.java
+4
-1
CreatureParticleFactory.java
.../java/com/owlmaddie/particle/CreatureParticleFactory.java
+4
-0
ChatDataManager.java
src/main/java/com/owlmaddie/chat/ChatDataManager.java
+0
-1
PlayerData.java
src/main/java/com/owlmaddie/chat/PlayerData.java
+4
-0
QuestJson.java
src/main/java/com/owlmaddie/json/QuestJson.java
+0
-44
MixinLivingEntity.java
src/main/java/com/owlmaddie/mixin/MixinLivingEntity.java
+5
-0
MixinVillagerEntity.java
src/main/java/com/owlmaddie/mixin/MixinVillagerEntity.java
+4
-0
ParticleEmitter.java
src/main/java/com/owlmaddie/particle/ParticleEmitter.java
+5
-1
VillagerEntityAccessor.java
...main/java/com/owlmaddie/utils/VillagerEntityAccessor.java
+5
-0
No files found.
src/client/java/com/owlmaddie/particle/BehaviorParticle.java
View file @
2d0a321c
...
...
@@ -4,7 +4,10 @@ import net.minecraft.client.particle.ParticleTextureSheet;
import
net.minecraft.client.particle.SpriteBillboardParticle
;
import
net.minecraft.client.world.ClientWorld
;
/**
* The {@code BehaviorParticle} class defines a custom CreatureChat behavior particle with an initial upward velocity
* that gradually decreases, ensuring it never moves downward.
*/
public
class
BehaviorParticle
extends
SpriteBillboardParticle
{
protected
BehaviorParticle
(
ClientWorld
world
,
double
x
,
double
y
,
double
z
,
double
velocityX
,
double
velocityY
,
double
velocityZ
)
{
super
(
world
,
x
,
y
,
z
,
velocityX
,
velocityY
,
velocityZ
);
...
...
src/client/java/com/owlmaddie/particle/CreatureParticleFactory.java
View file @
2d0a321c
...
...
@@ -5,6 +5,10 @@ import net.minecraft.client.particle.SpriteProvider;
import
net.minecraft.client.world.ClientWorld
;
import
net.minecraft.particle.DefaultParticleType
;
/**
* The {@code CreatureParticleFactory} class is responsible for creating instances of
* {@link BehaviorParticle} with the specified parameters.
*/
public
class
CreatureParticleFactory
implements
ParticleFactory
<
DefaultParticleType
>
{
private
final
SpriteProvider
spriteProvider
;
...
...
src/main/java/com/owlmaddie/chat/ChatDataManager.java
View file @
2d0a321c
...
...
@@ -12,7 +12,6 @@ import java.io.*;
import
java.lang.reflect.Type
;
import
java.nio.charset.StandardCharsets
;
import
java.util.HashMap
;
import
java.util.UUID
;
import
java.util.concurrent.ConcurrentHashMap
;
/**
...
...
src/main/java/com/owlmaddie/chat/PlayerData.java
View file @
2d0a321c
package
com
.
owlmaddie
.
chat
;
/**
* The {@code PlayerData} class represents data associated with a player,
* specifically tracking their friendship level.
*/
public
class
PlayerData
{
public
int
friendship
;
...
...
src/main/java/com/owlmaddie/json/QuestJson.java
deleted
100644 → 0
View file @
646c2131
package
com
.
owlmaddie
.
json
;
import
java.util.List
;
public
class
QuestJson
{
Story
story
;
List
<
Character
>
characters
;
public
static
class
Story
{
String
background
;
String
clue
;
}
public
static
class
Character
{
String
name
;
int
age
;
String
personality
;
String
greeting
;
String
entity_type_key
;
Quest
quest
;
String
choice_question
;
List
<
Choice
>
choices
;
}
public
static
class
Quest
{
List
<
QuestItem
>
quest_items
;
List
<
DropItem
>
drop_items
;
}
public
static
class
QuestItem
{
String
key
;
int
quantity
;
}
public
static
class
DropItem
{
String
key
;
int
quantity
;
}
public
static
class
Choice
{
String
choice
;
String
clue
;
}
}
src/main/java/com/owlmaddie/mixin/MixinLivingEntity.java
View file @
2d0a321c
...
...
@@ -20,6 +20,11 @@ import org.spongepowered.asm.mixin.injection.Inject;
import
org.spongepowered.asm.mixin.injection.callback.CallbackInfo
;
import
org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable
;
/**
* The {@code MixinLivingEntity} class modifies the behavior of {@link LivingEntity} to integrate
* custom friendship, chat, and death message mechanics. It prevents friendly entities from targeting players,
* generates contextual chat messages on attacks, and broadcasts custom death messages for named entities.
*/
@Mixin
(
LivingEntity
.
class
)
public
class
MixinLivingEntity
{
...
...
src/main/java/com/owlmaddie/mixin/MixinVillagerEntity.java
View file @
2d0a321c
...
...
@@ -6,6 +6,10 @@ import net.minecraft.village.VillagerGossips;
import
org.spongepowered.asm.mixin.Mixin
;
import
org.spongepowered.asm.mixin.Shadow
;
/**
* The {@code MixinVillagerEntity} class adds an accessor to expose the gossip system of {@link VillagerEntity}.
* This allows external classes to retrieve and interact with a villager's gossip data.
*/
@Mixin
(
VillagerEntity
.
class
)
public
abstract
class
MixinVillagerEntity
implements
VillagerEntityAccessor
{
...
...
src/main/java/com/owlmaddie/particle/ParticleEmitter.java
View file @
2d0a321c
...
...
@@ -9,8 +9,12 @@ import net.minecraft.util.math.MathHelper;
import
static
com
.
owlmaddie
.
network
.
ServerPackets
.*;
/**
* The {@code ParticleEmitter} class provides utility methods for emitting custom particles and sounds
* around entities in the game. It calculates particle positions based on entity orientation
* and triggers sound effects based on particle type and count.
*/
public
class
ParticleEmitter
{
public
static
void
emitCreatureParticle
(
ServerWorld
world
,
Entity
entity
,
DefaultParticleType
particleType
,
double
spawnSize
,
int
count
)
{
// Calculate the offset for the particle to appear above and in front of the entity
float
yaw
=
entity
.
getHeadYaw
();
...
...
src/main/java/com/owlmaddie/utils/VillagerEntityAccessor.java
View file @
2d0a321c
...
...
@@ -2,6 +2,11 @@ package com.owlmaddie.utils;
import
net.minecraft.village.VillagerGossips
;
/**
* The {@code VillagerEntityAccessor} interface provides a method to access
* the gossip system of a villager. It enables interaction with a villager's
* gossip data for custom behavior or modifications.
*/
public
interface
VillagerEntityAccessor
{
VillagerGossips
getGossip
();
}
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