Skip to content

Commit

Permalink
one ring to rule them all. (#31)
Browse files Browse the repository at this point in the history
* reorganize some stuff

* one ring to rule them all.

* One Ring to find them.

---------

Co-authored-by: Ghostipedia <46772882+Ghostipedia@users.noreply.github.com>
  • Loading branch information
screret and Ghostipedia authored Sep 26, 2024
1 parent 24509b7 commit 44d1b32
Show file tree
Hide file tree
Showing 32 changed files with 510 additions and 89 deletions.
22 changes: 15 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,8 @@ repositories {
url = "https://maven.theillusivec4.top/"
}
maven {
url "https://cursemaven.com/"
content {
includeGroup "curse.maven"
}
} // Curse Forge File
url = "https://maven.shadowsoffire.dev/releases"
}
maven {
name = 'GeckoLib'
url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/'
Expand All @@ -119,6 +116,12 @@ repositories {
url "https://maven.tterrag.com/"
}
maven { url = "https://api.modrinth.com/maven" }
maven {
url "https://cursemaven.com/"
content {
includeGroup "curse.maven"
}
} // Curse Forge File
}

dependencies {
Expand All @@ -134,7 +137,7 @@ dependencies {
modCompileOnly("mezz.jei:jei-${project.minecraft_version}-forge-api:${project.jei_version}") { transitive = false }
modCompileOnly("mezz.jei:jei-${project.minecraft_version}-common-api:${project.jei_version}") { transitive = false }

modImplementation("com.gregtechceu.gtceu:gtceu-${project.minecraft_version}:${project.gtceu_version}") { transitive = false }
modImplementation("com.gregtechceu.gtceu:gtceu-${project.minecraft_version}:${project.gtceu_version}:slim") { transitive = false }
modImplementation("com.lowdragmc.ldlib:ldlib-forge-${project.minecraft_version}:${project.ldlib_version}") { transitive = false }
modImplementation("com.tterrag.registrate:Registrate:${project.registrate_version}")
modImplementation("dev.latvian.mods:kubejs-forge:${project.kubejs_version}")
Expand All @@ -160,9 +163,14 @@ dependencies {
modCompileOnly("curse.maven:new-thin-air-878379:4848005")
modImplementation("curse.maven:puzzles-lib-495476:4924184")

modImplementation("dev.shadowsoffire:Apotheosis:${project.minecraft_version}-7.4.2")
modImplementation("dev.shadowsoffire:Placebo:${project.minecraft_version}-8.6.2")
modImplementation("dev.shadowsoffire:ApothicAttributes:${project.minecraft_version}-1.3.5")


modRuntimeOnly("curse.maven:jade-324717:4973483")
modRuntimeOnly("vazkii.patchouli:Patchouli:${project.minecraft_version}-${project.patchouli_version}-FORGE")
modRuntimeOnly("top.theillusivec4.curios:curios-forge:${project.curios_version}+${project.minecraft_version}")
modImplementation("top.theillusivec4.curios:curios-forge:${project.curios_version}+${project.minecraft_version}")
modRuntimeOnly("dev.toma.configuration:configuration-forge-${project.minecraft_version}:${project.configuration_version}")
modRuntimeOnly("mezz.jei:jei-${project.minecraft_version}-forge:${project.jei_version}") { transitive = false }

Expand Down
5 changes: 4 additions & 1 deletion src/generated/resources/assets/cosmiccore/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@
"item.cosmiccore.space_advanced_quarktech_chestplate": "ǝʇɐןdʇsǝɥƆ ǝʇınS ǝɔɐdS ™ɥɔǝ⟘ʞɹɐnὉ pǝɔuɐʌpⱯ",
"item.cosmiccore.space_nanomuscle_chestplate": "ǝʇɐןdʇsǝɥƆ ǝʇınS ǝɔɐdS ™ǝןɔsnWouɐN",
"item.cosmiccore.space_quarktech_chestplate": "ǝʇɐןdʇsǝɥƆ ǝʇınS ǝɔɐdS ™ɥɔǝ⟘ʞɹɐnὉ",
"item.cosmiccore.the_one_ring": "buıᴚ ǝuO ǝɥ⟘",
"item.cosmiccore.the_one_ring.tooltip.0": "ɹ§˙ɯǝɥʇ puıq ssǝuʞɹɐp ǝɥʇ uı puɐ ןןɐ ɯǝɥʇ buıɹq oʇ buıᴚ ǝuO 'ɯǝɥʇ puıɟ oʇ buıᴚ ǝuO 'ןןɐ ɯǝɥʇ ǝןnɹ oʇ buıᴚ ǝuOo§9§",
"item.cosmiccore.the_one_ring.tooltip.1": "˙ɟɟo ǝʞɐʇ oʇ pɹɐɥ ʇı puıɟ ʇɥbıɯ noʎ",
"item.cosmiccore.thermal_chain_agent": "ʇuǝbⱯ uıɐɥƆ ןɐɯɹǝɥ⟘",
"item.cosmiccore.unsealed_crystal_cpu": "∩ԀƆ ןɐʇsʎɹƆ pǝןɐǝsu∩",
"item.cosmiccore.void_blood_orb": "qɹO pooןᗺ ʇuɐpuǝɔsⱯ",
Expand Down Expand Up @@ -252,4 +255,4 @@
"tooltip.cosmiccore.soul_hatch.input": "%s 9§:ɟ§ʇnduI ǝdıɔǝᴚ xɐWɔ§",
"tooltip.cosmiccore.soul_hatch.output": "%s 9§:ɟ§ʎʇıɔɐdɐƆ ʞɹoʍʇǝN ןnoS xɐWɔ§",
"tooltip.cosmiccore.thermia_hatch_limit": "ʞ%s :ʇıɯıꞀ ˙dɯǝ⟘ɔ§"
}
}
5 changes: 4 additions & 1 deletion src/generated/resources/assets/cosmiccore/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@
"item.cosmiccore.space_advanced_quarktech_chestplate": "Advanced QuarkTech™ Space Suite Chestplate",
"item.cosmiccore.space_nanomuscle_chestplate": "NanoMuscle™ Space Suite Chestplate",
"item.cosmiccore.space_quarktech_chestplate": "QuarkTech™ Space Suite Chestplate",
"item.cosmiccore.the_one_ring": "The One Ring",
"item.cosmiccore.the_one_ring.tooltip.0": "§6§oOne Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.§r",
"item.cosmiccore.the_one_ring.tooltip.1": "You might find it hard to take off.",
"item.cosmiccore.thermal_chain_agent": "Thermal Chain Agent",
"item.cosmiccore.unsealed_crystal_cpu": "Unsealed Crystal CPU",
"item.cosmiccore.void_blood_orb": "Ascendant Blood Orb",
Expand Down Expand Up @@ -252,4 +255,4 @@
"tooltip.cosmiccore.soul_hatch.input": "§cMax Recipe Input§f:§6 %s",
"tooltip.cosmiccore.soul_hatch.output": "§cMax Soul Network Capacity§f:§6 %s",
"tooltip.cosmiccore.thermia_hatch_limit": "§cTemp. Limit: %sK"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "cosmiccore:item/the_one_ring"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,18 @@
"cosmiccore:programable_matter_coil_block",
"cosmiccore:shimmering_neutronium_coil_block",
"cosmiccore:causal_fabric_coil_block",
"cosmiccore:dyson_solar_cell",
"cosmiccore:naquadah_pressure_resistant_casing",
"cosmiccore:resonantly_tuned_virtue_meld_casing",
"cosmiccore:alternator_flux_coiling",
"cosmiccore:plated_aerocloud",
"cosmiccore:high_powered_magnet",
"cosmiccore:fusion_grade_magnet"
"cosmiccore:fusion_grade_magnet",
"cosmiccore:high_temperature_fission_casing",
"cosmiccore:vomahine_certified_chemically_resistant_casing",
"cosmiccore:vomahine_certified_chemically_resistant_pipe",
"cosmiccore:vomahine_certified_interstellar_grade_casing",
"cosmiccore:vomahine_ultra_powered_casing",
"cosmiccore:highly_conductive_fission_casing"
]
}
8 changes: 8 additions & 0 deletions src/main/java/com/ghostipedia/cosmiccore/CosmicCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.gregtechceu.gtceu.api.data.chemical.material.registry.MaterialRegistry;
import com.gregtechceu.gtceu.api.machine.MachineDefinition;
import com.gregtechceu.gtceu.api.recipe.GTRecipeType;
import com.gregtechceu.gtceu.api.sound.SoundEntry;
import com.gregtechceu.gtceu.common.block.CoilBlock;
import com.gregtechceu.gtceu.config.ConfigHolder;
import com.lowdragmc.lowdraglib.Platform;
Expand Down Expand Up @@ -45,6 +46,9 @@ public CosmicCore() {
// bus.addGenericListener(Class.class, this::registerRecipeConditions);
// bus.addGenericListener(MachineDefinition.class, this::registerMachines);
bus.addGenericListener(MachineDefinition.class, this::registerMachines);
bus.addGenericListener(SoundEntry.class, this::registerSounds);

CosmicLootModifiers.register(bus);

if (Platform.isClient()) {
bus.register(CosmicCoreClient.class);
Expand Down Expand Up @@ -97,6 +101,10 @@ public void registerMachines(GTCEuAPI.RegisterEvent<ResourceLocation, MachineDef

}

public void registerSounds(GTCEuAPI.RegisterEvent<ResourceLocation, SoundEntry> event) {
CosmicSounds.init();
}

@SubscribeEvent
public void registerCapabilities(RegisterCapabilitiesEvent event) {
CosmicCapabilities.register(event);
Expand Down
41 changes: 41 additions & 0 deletions src/main/java/com/ghostipedia/cosmiccore/CosmicUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.ghostipedia.cosmiccore;

import com.ghostipedia.cosmiccore.common.data.CosmicItems;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.common.util.LazyOptional;
import org.jetbrains.annotations.Nullable;
import top.theillusivec4.curios.api.CuriosApi;
import top.theillusivec4.curios.api.type.capability.ICuriosItemHandler;
import top.theillusivec4.curios.api.type.inventory.ICurioStacksHandler;
import top.theillusivec4.curios.api.type.inventory.IDynamicStackHandler;

import java.util.Optional;

public class CosmicUtils {

public static boolean hasRing(@Nullable Entity entity) {
if (!(entity instanceof LivingEntity living)) {
return false;
}

LazyOptional<ICuriosItemHandler> cap = CuriosApi.getCuriosInventory(living);
if (cap.isPresent()) {
ICuriosItemHandler curioHandler = cap.resolve().get();
Optional<ICurioStacksHandler> handler = curioHandler.getStacksHandler("ring");
if (handler.isPresent()) {
IDynamicStackHandler stackHandler = handler.get().getStacks();
for (int i = 0; i < stackHandler.getSlots(); i++) {
ItemStack stack = stackHandler.getStackInSlot(i);
if (stack.is(CosmicItems.THE_ONE_RING.get())) {
return true;
}
}
}
}
return false;

}

}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,26 +1,53 @@
package com.ghostipedia.cosmiccore.client;

import com.ghostipedia.cosmiccore.CosmicCore;
import com.ghostipedia.cosmiccore.CosmicUtils;
import com.ghostipedia.cosmiccore.client.renderer.StructureBoundingBox;
import com.mojang.blaze3d.shaders.FogShape;
import net.minecraft.client.renderer.FogRenderer;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.event.RenderLevelStageEvent;
import net.minecraftforge.client.event.ViewportEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

@Mod.EventBusSubscriber(
modid = CosmicCore.MOD_ID,
bus = Mod.EventBusSubscriber.Bus.FORGE,
value = Dist.CLIENT)
@OnlyIn(Dist.CLIENT)
@SuppressWarnings("unused")
@Mod.EventBusSubscriber(modid = CosmicCore.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT)
public class ForgeClientEventHandler {

@SubscribeEvent
public static void onRenderWorldLast(RenderLevelStageEvent event) {
var stage = event.getStage();
if (stage == RenderLevelStageEvent.Stage.AFTER_TRIPWIRE_BLOCKS) {
StructureBoundingBox.renderStructureSelect(event.getPoseStack(), event.getCamera());
}
}

@SubscribeEvent
public static void onRenderFog(ViewportEvent.RenderFog event) {
if (CosmicUtils.hasRing(event.getCamera().getEntity())) {
event.setFogShape(FogShape.SPHERE);

// Shrink the fog to be very close
if (event.getMode() == FogRenderer.FogMode.FOG_SKY) {
event.setFarPlaneDistance(16.0F);
event.setNearPlaneDistance(0.0F);
} else {
event.setFarPlaneDistance(10.0F);
event.setNearPlaneDistance(3.0F);
}
event.setCanceled(true);
}
}

@SubscribeEvent
public static void onComputeFogColor(ViewportEvent.ComputeFogColor event) {
if (CosmicUtils.hasRing(event.getCamera().getEntity())) {
// and make the fog a blue mist.
// #7CBADA
event.setRed(0.671F);
event.setGreen(0.792F);
event.setBlue(0.855F);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.ghostipedia.cosmiccore.client.renderer;

import com.ghostipedia.cosmiccore.api.data.DebugBlockPattern;
import com.ghostipedia.cosmiccore.common.data.StructureWriteBehavior;
import com.ghostipedia.cosmiccore.common.item.behavior.StructureWriteBehavior;
import com.lowdragmc.lowdraglib.client.utils.RenderBufferUtils;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
Expand All @@ -16,7 +16,7 @@
import org.joml.Matrix3f;
import org.joml.Matrix4f;

import static com.ghostipedia.cosmiccore.common.data.StructureWriteBehavior.getDir;
import static com.ghostipedia.cosmiccore.common.item.behavior.StructureWriteBehavior.getDir;

public class StructureBoundingBox {
public static void renderStructureSelect(PoseStack poseStack, Camera camera) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,40 @@
import com.ghostipedia.cosmiccore.api.item.armor.*;
import com.ghostipedia.cosmiccore.api.registries.CosmicRegistration;
import com.ghostipedia.cosmiccore.common.data.tag.item.CosmicItemTags;
import com.ghostipedia.cosmiccore.common.item.behavior.EffectApplicationBehavior;
import com.ghostipedia.cosmiccore.common.item.behavior.StructureWriteBehavior;
import com.gregtechceu.gtceu.api.item.ComponentItem;
import com.gregtechceu.gtceu.api.item.armor.ArmorComponentItem;
import com.gregtechceu.gtceu.api.item.component.IItemComponent;
import com.gregtechceu.gtceu.common.data.GTCompassSections;
import com.gregtechceu.gtceu.common.item.TooltipBehavior;
import com.gregtechceu.gtceu.common.item.armor.GTArmorMaterials;
import com.gregtechceu.gtceu.common.item.armor.QuarkTechSuite;
import com.gregtechceu.gtceu.common.registry.GTRegistration;
import com.gregtechceu.gtceu.config.ConfigHolder;
import com.gregtechceu.gtceu.data.recipe.CustomTags;
import com.gregtechceu.gtceu.integration.jade.GTJadePlugin;
import com.tterrag.registrate.util.entry.ItemEntry;
import com.tterrag.registrate.util.nullness.NonNullConsumer;
import earth.terrarium.adastra.common.tags.ModItemTags;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.DamageTypeTags;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.damagesource.DamageTypes;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ArmorItem;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.level.Level;
import wayoftime.bloodmagic.common.item.BloodOrb;
import wayoftime.bloodmagic.common.item.ItemBloodOrb;
import wayoftime.bloodmagic.common.registration.impl.BloodOrbDeferredRegister;
import wayoftime.bloodmagic.common.registration.impl.BloodOrbRegistryObject;

import static com.ghostipedia.cosmiccore.api.registries.CosmicRegistration.REGISTRATE;
import static wayoftime.bloodmagic.common.item.BloodMagicItems.BLOOD_ORBS;


@SuppressWarnings("Convert2MethodRef")
@SuppressWarnings({ "unused" })
public class CosmicItems {
public static final BloodOrbRegistryObject<BloodOrb> ORB_ASCENDANT;
public static final BloodOrbRegistryObject<BloodOrb> ORB_VOIDSENT;
Expand Down Expand Up @@ -134,14 +140,6 @@ public class CosmicItems {
.defaultModel()
.register();

// public static ItemEntry<SpaceArmorComponentItem> SPACE_NANO_CHESTPLATE = REGISTRATE.item("space_nanomuscle_chestplate", (p) -> new SpaceArmorComponentItem(GTArmorMaterials.ARMOR, ArmorItem.Type.CHESTPLATE, 5000, p)
// .setArmorLogic(new NanoMuscleSpaceSuite(ArmorItem.Type.CHESTPLATE, 512,
// 6_400_000L * (long) Math.max(1, Math.pow(4, ConfigHolder.INSTANCE.tools.voltageTierNanoSuit - 3)),
// ConfigHolder.INSTANCE.tools.voltageTierNanoSuit)))
// .tag(CosmicItemTags.NANOMUSCLE_SPACE_SUITE, ModItemTags.SPACE_SUITS, ModItemTags.FREEZE_RESISTANT_ARMOR, ModItemTags.HEAT_RESISTANT_ARMOR)
// .lang("NanoMuscle™ Space Suite Chestplate")
// .properties(p -> p.rarity(Rarity.RARE))
// .register();
public static final ItemEntry<ComponentItem> THERMAL_CHAIN_AGENT = REGISTRATE.item("thermal_chain_agent", ComponentItem::create)
.lang("Thermal Chain Agent")
.properties(p -> p.stacksTo(64))
Expand Down Expand Up @@ -181,6 +179,40 @@ public class CosmicItems {
})))
.defaultModel()
.register();

public static ItemEntry<ComponentItem> THE_ONE_RING = REGISTRATE
.item("the_one_ring", p -> (ComponentItem) new ComponentItem(p) {
@Override
public boolean canBeHurtBy(DamageSource damageSource) {
return damageSource.is(DamageTypes.LAVA);
}

@Override
public int getEntityLifespan(ItemStack itemStack, Level level) {
return Short.MIN_VALUE;
}

@Override
public boolean onDroppedByPlayer(ItemStack item, Player player) {
return false;
}

@Override
public boolean isFoil(ItemStack stack) {
return true;
}
})
.lang("The One Ring")
.properties(p -> p.stacksTo(1).fireResistant())
.onRegister(attach(new EffectApplicationBehavior()
.addEffect(() -> new MobEffectInstance(MobEffects.INVISIBILITY, 10), 1.0F)
.addEffect(() -> new MobEffectInstance(MobEffects.UNLUCK, 10, 5), 1.0F)
.addEffect(() -> new MobEffectInstance(MobEffects.MOVEMENT_SPEED, 10, 1), 1.0F),
new TooltipBehavior(list -> {
list.add(Component.translatable("item.cosmiccore.the_one_ring.tooltip.0"));
list.add(Component.translatable("item.cosmiccore.the_one_ring.tooltip.1"));
})))
.register();
// public static final ItemEntry<ComponentItem> PARADOX_ECHOS = REGISTRATE.item("paradox_echos", ComponentItem::create)
// .lang("Paradox Echos")
// .properties(p -> p.stacksTo(64))
Expand Down Expand Up @@ -355,7 +387,7 @@ public class CosmicItems {
.item("debug_structure_writer", ComponentItem::create)
.lang("Debug Structure Writer")
.properties(p -> p.stacksTo(1))
.onRegister( attach(StructureWriteBehavior.INSTANCE))
.onRegister(attach(StructureWriteBehavior.INSTANCE))
.register();

// Space Suite
Expand Down Expand Up @@ -572,4 +604,4 @@ public static <T extends ComponentItem> NonNullConsumer<T> attach(IItemComponent
public static void init() {

}
}
}
Loading

0 comments on commit 44d1b32

Please sign in to comment.