Skip to content

Commit

Permalink
Straight port to 1.21 (yes, I will improve/add stuff soonish maybe)
Browse files Browse the repository at this point in the history
  • Loading branch information
Emafire003 committed Jun 15, 2024
1 parent 4ab9781 commit bbe1496
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/develop

minecraft_version=1.20.6
yarn_mappings=1.20.6+build.1
minecraft_version=1.21
yarn_mappings=1.21+build.2
#minecraft_version=1.20.1
#yarn_mappings=1.20.1+build.10
loader_version=0.15.11


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

# Dependencies
fabric_version=0.98.0+1.20.6
cca_version = 6.0.0-rc1
fabric_version=0.100.1+1.21
cca_version = 6.1.0

#Soft Dependencies
fabricperms_version=0.2-SNAPSHOT
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package me.emafire003.dev.coloredglowlib;

import net.minecraft.entity.Entity;
import net.minecraft.util.Identifier;
import org.ladysnake.cca.api.v3.entity.EntityComponentFactoryRegistry;
import org.ladysnake.cca.api.v3.entity.EntityComponentInitializer;
import org.ladysnake.cca.api.v3.entity.RespawnCopyStrategy;
Expand Down Expand Up @@ -63,6 +64,11 @@ public void onInitialize() {
LOGGER.info("Complete!");
}

/**Used (internally) to get an identifier with this mod's namespace*/
public static Identifier getIdentifier(String path){
return Identifier.of(MOD_ID, path);
}

/**
* Use this to get the ColoredGlowLib API instance and
* use the methods to set colors and such
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.emafire003.dev.coloredglowlib.component;

import me.emafire003.dev.coloredglowlib.ColoredGlowLibMod;
import net.minecraft.entity.Entity;
import net.minecraft.registry.RegistryWrapper;
import org.ladysnake.cca.api.v3.component.ComponentKey;
Expand All @@ -8,14 +9,11 @@
import org.ladysnake.cca.api.v3.component.sync.AutoSyncedComponent;
import me.emafire003.dev.coloredglowlib.util.ColorUtils;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.util.Identifier;

import static me.emafire003.dev.coloredglowlib.ColoredGlowLibMod.MOD_ID;

public class ColorComponent implements ComponentV3, AutoSyncedComponent{

public static final ComponentKey<ColorComponent> COLOR_COMPONENT =
ComponentRegistry.getOrCreate(new Identifier(MOD_ID, "color_component"), ColorComponent.class);
ComponentRegistry.getOrCreate(ColoredGlowLibMod.getIdentifier("color_component"), ColorComponent.class);

private final Entity self;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package me.emafire003.dev.coloredglowlib.component;

import me.emafire003.dev.coloredglowlib.ColoredGlowLibMod;
import net.minecraft.registry.RegistryWrapper;
import org.ladysnake.cca.api.v3.component.ComponentKey;
import org.ladysnake.cca.api.v3.component.ComponentRegistry;
Expand All @@ -10,20 +11,17 @@
import net.minecraft.nbt.NbtCompound;
import net.minecraft.scoreboard.Scoreboard;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Optional;

import static me.emafire003.dev.coloredglowlib.ColoredGlowLibMod.MOD_ID;

public class GlobalColorComponent implements ComponentV3, AutoSyncedComponent{

public static final ComponentKey<GlobalColorComponent> GLOBAL_COLOR_COMPONENT =
ComponentRegistry.getOrCreate(new Identifier(MOD_ID, "global_color_component"), GlobalColorComponent.class);
ComponentRegistry.getOrCreate(ColoredGlowLibMod.getIdentifier("global_color_component"), GlobalColorComponent.class);

private final Scoreboard scoreboard;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static void register(){

@Override
public Identifier getFabricId() {
return new Identifier(ColoredGlowLibMod.MOD_ID, RESOURCE_PATH);
return ColoredGlowLibMod.getIdentifier(RESOURCE_PATH);
}

@Override
Expand Down

0 comments on commit bbe1496

Please sign in to comment.