Skip to content

Commit

Permalink
add ender knight armor and remove entity
Browse files Browse the repository at this point in the history
  • Loading branch information
IAFEnvoy committed Oct 21, 2024
1 parent ba45f61 commit 4d49723
Show file tree
Hide file tree
Showing 31 changed files with 123 additions and 117 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Setup JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'microsoft'

- name: Setup Gradle 8.10
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: "8.10"

- name: Run build
run: gradle build

- name: Copy Jars
run: gradle copyJars

- name: Upload files
uses: actions/upload-artifact@v4
with:
name: build and source jars
path: build/libs/*.jar
retention-days: 7
2 changes: 1 addition & 1 deletion common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies {
// Remove the next line if you don't want to depend on the API
modApi "dev.architectury:architectury:${rootProject.architectury_version}"
// Neptune cross-platform library
modImplementation "maven.modrinth:neptune:zMTlhkbC"
modImplementation "maven.modrinth:neptune:EtKuwNMX"

modImplementation "maven.modrinth:jupiter:elRfRGl9"

Expand Down
5 changes: 5 additions & 0 deletions common/src/main/java/com/iafenvoy/sow/SongsOfWarClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@

import com.iafenvoy.sow.data.BeaconData;
import com.iafenvoy.sow.registry.SowRenderers;
import com.iafenvoy.sow.render.util.ArdoniMarkerReloader;
import com.iafenvoy.sow.screen.BeaconTeleportScreen;
import dev.architectury.networking.NetworkManager;
import dev.architectury.registry.ReloadListenerRegistry;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.MinecraftClient;
import net.minecraft.resource.ResourceType;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;

@Environment(EnvType.CLIENT)
Expand All @@ -17,6 +21,7 @@ public static void init() {

public static void process() {
SowRenderers.registerSkull();
ReloadListenerRegistry.register(ResourceType.CLIENT_RESOURCES, new ArdoniMarkerReloader(), new Identifier(SongsOfWar.MOD_ID, "ardoni_marker"));
NetworkManager.registerReceiver(NetworkManager.Side.S2C, Static.BEACON_TELEPORT, (buf, context) -> {
BlockPos pos = buf.readBlockPos();
BeaconData data = BeaconData.readNbt(buf.readNbt());
Expand Down
101 changes: 0 additions & 101 deletions common/src/main/java/com/iafenvoy/sow/entity/EnderKnightEntity.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.iafenvoy.sow.item;

import com.iafenvoy.neptune.render.armor.IArmorTextureProvider;
import com.iafenvoy.sow.SongsOfWar;
import com.iafenvoy.sow.registry.SowItemGroups;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterials;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Identifier;

public class EnderKnightArmorItem extends ArmorItem implements IArmorTextureProvider {
public EnderKnightArmorItem(Type type) {
super(ArmorMaterials.NETHERITE, type, new Settings().fireproof().arch$tab(SowItemGroups.ITEMS));
}

@Override
public Identifier getArmorTexture(ItemStack itemStack, Entity entity, EquipmentSlot equipmentSlot, String s) {
return new Identifier(SongsOfWar.MOD_ID, "textures/models/armor/ender_knight_layer_" + (equipmentSlot == EquipmentSlot.LEGS ? 2 : 1) + ".png");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.iafenvoy.neptune.util.EntityBuildHelper;
import com.iafenvoy.sow.SongsOfWar;
import com.iafenvoy.sow.entity.EnderKnightEntity;
import com.iafenvoy.sow.entity.GrimEntity;
import com.iafenvoy.sow.entity.ardoni.*;
import com.iafenvoy.sow.entity.ardoni.random.*;
Expand Down Expand Up @@ -41,7 +40,6 @@ public final class SowEntities {
public static final RegistrySupplier<EntityType<NestorisArdoniEntity>> NESTORIS_ARDONI = build("nestoris_ardoni", NestorisArdoniEntity::new, SpawnGroup.CREATURE, 64, 3, false, EntityBuildHelper.PLAYER.scale(1.1f));
public static final RegistrySupplier<EntityType<SendarisArdoniEntity>> SENDARIS_ARDONI = build("sendaris_ardoni", SendarisArdoniEntity::new, SpawnGroup.CREATURE, 64, 3, false, EntityBuildHelper.PLAYER.scale(1.1f));
public static final RegistrySupplier<EntityType<VoltarisArdoniEntity>> VOLTARIS_ARDONI = build("voltaris_ardoni", VoltarisArdoniEntity::new, SpawnGroup.CREATURE, 64, 3, false, EntityBuildHelper.PLAYER.scale(1.1f));
public static final RegistrySupplier<EntityType<EnderKnightEntity>> ENDER_KNIGHT = build("ender_knight", EnderKnightEntity::new, SpawnGroup.CREATURE, 64, 3, false, EntityBuildHelper.PLAYER);
public static final RegistrySupplier<EntityType<GrimEntity>> GRIM = build("grim", GrimEntity::new, SpawnGroup.CREATURE, 64, 3, false, EntityBuildHelper.PLAYER);
//Ardoni
public static final RegistrySupplier<EntityType<TideSingerEntity>> TIDE_SINGER = build("tide_singer", TideSingerEntity::new, SpawnGroup.CREATURE, 64, 3, false, EntityBuildHelper.PLAYER.scale(1.1f));
Expand Down Expand Up @@ -151,7 +149,6 @@ public static void init() {
EntityAttributeRegistry.register(NESTORIS_ARDONI, NestorisArdoniEntity::createAttributes);
EntityAttributeRegistry.register(SENDARIS_ARDONI, SendarisArdoniEntity::createAttributes);
EntityAttributeRegistry.register(VOLTARIS_ARDONI, VoltarisArdoniEntity::createAttributes);
EntityAttributeRegistry.register(ENDER_KNIGHT, EnderKnightEntity::createAttributes);
EntityAttributeRegistry.register(GRIM, GrimEntity::createAttributes);

EntityAttributeRegistry.register(TIDE_SINGER, TideSingerEntity::createAttributes);
Expand Down
8 changes: 7 additions & 1 deletion common/src/main/java/com/iafenvoy/sow/registry/SowItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
import com.iafenvoy.sow.data.ArdoniType;
import com.iafenvoy.sow.data.EnchantmentFragmentInfo;
import com.iafenvoy.sow.item.EnchantmentFragmentItem;
import com.iafenvoy.sow.item.EnderKnightArmorItem;
import com.iafenvoy.sow.item.SowSpawnEggItem;
import dev.architectury.registry.CreativeTabRegistry;
import dev.architectury.registry.registries.DeferredRegister;
import dev.architectury.registry.registries.RegistrySupplier;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.Item;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Rarity;
Expand All @@ -28,6 +30,11 @@ public final class SowItems {
public static final RegistrySupplier<Item> ENCHANTMENT_FRAGMENT_AQUA = REGISTRY.register("enchantment_fragment_aqua", () -> new EnchantmentFragmentItem(EnchantmentFragmentInfo.of(GlintManager.AQUA, 1).kb(1).luck(2)));

public static final RegistrySupplier<Item> WITHER_STAFF = REGISTRY.register("wither_staff", () -> new Item(new Item.Settings().fireproof().rarity(Rarity.UNCOMMON).arch$tab(SowItemGroups.ITEMS)));

public static final RegistrySupplier<Item> ENDER_KNIGHT_HELMET = REGISTRY.register("ender_knight_helmet", () -> new EnderKnightArmorItem(ArmorItem.Type.HELMET));
public static final RegistrySupplier<Item> ENDER_KNIGHT_CHESTPLATE = REGISTRY.register("ender_knight_chestplate", () -> new EnderKnightArmorItem(ArmorItem.Type.CHESTPLATE));
public static final RegistrySupplier<Item> ENDER_KNIGHT_LEGGINGS = REGISTRY.register("ender_knight_leggings", () -> new EnderKnightArmorItem(ArmorItem.Type.LEGGINGS));
public static final RegistrySupplier<Item> ENDER_KNIGHT_BOOTS = REGISTRY.register("ender_knight_boots", () -> new EnderKnightArmorItem(ArmorItem.Type.BOOTS));
//Spawn Egg
//Misc
public static final RegistrySupplier<Item> NONE_TYPE_ARDONI_SPAWN_EGG = REGISTRY.register("none_type_ardoni_spawn_egg", () -> ArdoniType.NONE.createSpawnEgg(SowEntities.NONE_TYPE_ARDONI));
Expand All @@ -36,7 +43,6 @@ public final class SowItems {
public static final RegistrySupplier<Item> NESTORIS_ARDONI_SPAWN_EGG = REGISTRY.register("nestoris_ardoni_spawn_egg", () -> ArdoniType.NESTORIS.createSpawnEgg(SowEntities.NESTORIS_ARDONI));
public static final RegistrySupplier<Item> KALTARIS_ARDONI_SPAWN_EGG = REGISTRY.register("kaltaris_ardoni_spawn_egg", () -> ArdoniType.KALTARIS.createSpawnEgg(SowEntities.KALTARIS_ARDONI));
public static final RegistrySupplier<Item> MENDORIS_ARDONI_SPAWN_EGG = REGISTRY.register("mendoris_ardoni_spawn_egg", () -> ArdoniType.MENDORIS.createSpawnEgg(SowEntities.MENDORIS_ARDONI));
public static final RegistrySupplier<Item> ENDER_KNIGHT_SPAWN_EGG = REGISTRY.register("ender_knight_spawn_egg", SowSpawnEggItem.create(SowEntities.ENDER_KNIGHT, 0xFF000000, 0xFF800080));
public static final RegistrySupplier<Item> GRIM_SPAWN_EGG = REGISTRY.register("grim_spawn_egg", SowSpawnEggItem.create(SowEntities.GRIM, 0xFF444444, 0xFF00FFFF));
//Ardoni
public static final RegistrySupplier<Item> TIDE_SINGER_SPAWN_EGG = REGISTRY.register("tide_singer_spawn_egg", SowSpawnEggItem.create(SowEntities.TIDE_SINGER, 0xFF888888, 0xFFFFFF00));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.iafenvoy.neptune.render.SkullRenderRegistry;
import com.iafenvoy.sow.entity.GrimEntity;
import com.iafenvoy.sow.entity.ardoni.*;
import com.iafenvoy.sow.entity.author.PixelZnimationEntity;
import com.iafenvoy.sow.entity.felina.*;
import com.iafenvoy.sow.entity.human.*;
import com.iafenvoy.sow.entity.magnorite.IgneousEntity;
Expand All @@ -27,7 +26,6 @@ public static void registerEntityRenderers() {
EntityRendererRegistry.register(SowEntities.MENDORIS_ARDONI, ArdoniEntityRenderer::new);
EntityRendererRegistry.register(SowEntities.NESTORIS_ARDONI, ArdoniEntityRenderer::new);
EntityRendererRegistry.register(SowEntities.KALTARIS_ARDONI, ArdoniEntityRenderer::new);
EntityRendererRegistry.register(SowEntities.ENDER_KNIGHT, CommonPlayerLikeEntityRenderer::new);
EntityRendererRegistry.register(SowEntities.GRIM, CommonPlayerLikeEntityRenderer::new);

EntityRendererRegistry.register(SowEntities.TIDE_SINGER, ArdoniEntityRenderer::new);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public static ArdoniMarkerGenerator getOrCreate(long seed) {
return GENERATOR.get(seed);
}

public static void resetAll() {
GENERATOR.values().forEach(ArdoniMarkerGenerator::reset);
}

private static int generateColor(Random random) {
int r = random.nextInt(0xC0, 0x100);
return 0xFF << 24 | r << 16 | r << 8 | r;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.iafenvoy.sow.render.util;

import net.minecraft.resource.ResourceManager;
import net.minecraft.resource.SynchronousResourceReloader;

public class ArdoniMarkerReloader implements SynchronousResourceReloader {
@Override
public void reload(ResourceManager manager) {
ArdoniMarkerGenerator.resetAll();
}
}
6 changes: 4 additions & 2 deletions common/src/main/resources/assets/sow/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
"entity.sow.death_singer": "Ingresssus",
"entity.sow.denny": "Denny",
"entity.sow.eddy": "Eddy",
"entity.sow.ender_knight": "Ender Knight",
"entity.sow.etherea_guard": "Etherea Guard",
"entity.sow.etherea_soldier": "Etherea Soldier",
"entity.sow.farmer_folk": "Farmer Folk",
Expand Down Expand Up @@ -213,7 +212,10 @@
"item.sow.enchantment_fragment.white": "White",
"item.sow.enchantment_fragment.yellow": "Yellow",
"item.sow.ender_blade": "Ender Blade",
"item.sow.ender_knight_spawn_egg": "Ender Knight Spawn Egg",
"item.sow.ender_knight_boots": "Ender Knight Boots",
"item.sow.ender_knight_chestplate": "Ender Knight Chestplate",
"item.sow.ender_knight_helmet": "Ender Knight Helmet",
"item.sow.ender_knight_leggings": "Ender Knight Leggings",
"item.sow.ender_sword": "Ender Sword",
"item.sow.etherea_guard_spawn_egg": "Etherea Guard Spawn Egg",
"item.sow.etherea_soldier_spawn_egg": "Etherea Soldier Spawn Egg",
Expand Down
6 changes: 4 additions & 2 deletions common/src/main/resources/assets/sow/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
"entity.sow.death_singer": "英格拉西斯",
"entity.sow.denny": "丹尼",
"entity.sow.eddy": "艾迪",
"entity.sow.ender_knight": "末影骑士",
"entity.sow.etherea_guard": "埃希里亚守卫",
"entity.sow.etherea_soldier": "埃希里亚士兵",
"entity.sow.farmer_folk": "农民",
Expand Down Expand Up @@ -213,7 +212,10 @@
"item.sow.enchantment_fragment.white": "白色",
"item.sow.enchantment_fragment.yellow": "黄色",
"item.sow.ender_blade": "末影之刃",
"item.sow.ender_knight_spawn_egg": "末影骑士刷怪蛋",
"item.sow.ender_knight_boots": "末影骑士靴",
"item.sow.ender_knight_chestplate": "末影骑士胸甲",
"item.sow.ender_knight_helmet": "魔影骑士头盔",
"item.sow.ender_knight_leggings": "末影骑士护腿",
"item.sow.ender_sword": "末影之剑",
"item.sow.etherea_guard_spawn_egg": "埃希里亚守卫刷怪蛋",
"item.sow.etherea_soldier_spawn_egg": "埃希里亚士兵刷怪蛋",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "sow:item/armor/ender_knight_boots"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "sow:item/armor/ender_knight_chestplate"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "sow:item/armor/ender_knight_helmet"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "sow:item/armor/ender_knight_leggings"
}
}

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {
// Don't need this. Trinkets has embedded version 5.2.0.

// Neptune cross-platform library
modImplementation "maven.modrinth:neptune:zMTlhkbC"
modImplementation "maven.modrinth:neptune:EtKuwNMX"

modImplementation "maven.modrinth:jupiter:elRfRGl9"

Expand Down
2 changes: 1 addition & 1 deletion forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies {
modImplementation "top.theillusivec4.curios:curios-forge:${curios_version}"

// Neptune cross-platform library
modImplementation "maven.modrinth:neptune:aI22NA1F"
modImplementation "maven.modrinth:neptune:gC9SvvIC"

modImplementation "maven.modrinth:jupiter:5WrVm4v6"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import net.minecraft.text.Text;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.ConfigScreenHandler;
import net.minecraftforge.client.event.ClientPlayerNetworkEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
Expand Down

0 comments on commit 4d49723

Please sign in to comment.