Skip to content

Commit

Permalink
Fixed a weird NPE (hopefully)
Browse files Browse the repository at this point in the history
  • Loading branch information
Emafire003 committed May 27, 2024
1 parent dc0de73 commit d02a2d4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
10 changes: 6 additions & 4 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Probably recode everything from scratch. Use just the hex string and store values with Cardinal Components, then
use architectury to multiplatform
Coloredglowlib: Visible by aggiungere un nuovo component che contiene sia il color che il target che può essere un player specifico, un team, o un party e simili.
Per le entity type e global probabilmente devo fare un'altro component dentro al component che ha il corrsipettivo target, emitter e colore.

Also fare un sistema di chace per non leggere sempre dall'nbt? Forse?

Add DataDriven animation and maybe triggers, like names or team or whatever. Like a sequence of blue red white that with white staing on for 3 seconds and the other ones for 1 etc.
They would work like "rainbow" and "random"
Also splittare in vari moduli magari tipo solo la API e la API extension
per questa roba qua forse? Oddio un po' complesso siccome sarebbe un mixin
del mixin
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ loader_version=0.15.11


# Mod Properties
mod_version = 3.1.0+fabric_1.20.6
mod_version = 3.1.1+fabric_1.20.6
maven_group = me.emafire003.dev
archives_base_name = coloredglowlib

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
@Environment(EnvType.CLIENT)
@Mixin(Entity.class)
public abstract class EntityColorMixin {
@Unique
private final Entity entity = ((Entity)(Object)this);

/*public int nameSpecificColor(Entity entity){
Maybe i'll add it maybe not
Expand Down Expand Up @@ -85,6 +83,7 @@ private int getRainbowColor(){

@Unique
private int randomColor(){
Entity entity = ((Entity)(Object)this);
Random r = entity.getWorld().getRandom();
if(random_delay_counter == 10){
random_delay_counter = 0;
Expand All @@ -97,13 +96,19 @@ private int randomColor(){

@Inject(method = "getTeamColorValue", at = @At("RETURN"), cancellable = true)
public void injectChangeColorValue(CallbackInfoReturnable<Integer> cir){
Entity entity = ((Entity)(Object)this);
ColoredGlowLibAPI cgl = ColoredGlowLibMod.getAPI();

if(cgl == null){
LOGGER.warn("The ColoredGlowLib API instance is null!");
return;
}

if(entity == null){
LOGGER.warn("The entity is null! Can't display the custom color!");
return;
}

if(entity.getScoreboardTeam() == null || cgl.getOverrideTeamColors()) {

/**Checks if it's april 1st for jokes*/
Expand Down

0 comments on commit d02a2d4

Please sign in to comment.