Skip to content

Commit

Permalink
pre
Browse files Browse the repository at this point in the history
  • Loading branch information
PinkGoosik committed Mar 10, 2024
1 parent e46f9c8 commit 34bc678
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 16 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies {

modLocalRuntime "maven.modrinth:here-be-no-dragons:1.0.0"
modLocalRuntime "maven.modrinth:limitless-structure-block:1.0"
modLocalRuntime "dev.emi:emi-fabric:1.0.29+1.20.1"
modLocalRuntime "dev.emi:emi-fabric:1.1.2+1.20.1"
modLocalRuntime "com.terraformersmc:modmenu:7.2.2"
modLocalRuntime "io.wispforest:gadget:0.2.2+1.20"
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/artifality/ArtifalityMod.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package artifality;

import artifality.client.particle.ArtifalityParticles;
import artifality.registry.ArtifalityParticles;
import artifality.command.ArtifalityCommands;
import artifality.compat.ArtifalityOwoLibIntegration;
import artifality.data.ArtifalityLootTables;
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/artifality/api/ArtifalityAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry;
import net.fabricmc.fabric.api.client.model.loading.v1.ModelLoadingPlugin;
import net.minecraft.client.util.ModelIdentifier;
import net.minecraft.util.Identifier;

Expand All @@ -15,8 +15,10 @@ public void onInitialize() {

@Override
public void onInitializeClient() {
ModelLoadingRegistry.INSTANCE.registerModelProvider((manager, out) -> TwoModeledItems.ENTRIES.forEach((id, item) ->
out.accept(new ModelIdentifier(new Identifier(id + "_in_hand"), "inventory"))
));
ModelLoadingPlugin.register(context -> {
TwoModeledItems.ENTRIES.forEach((id, item) ->
context.addModels(new ModelIdentifier(new Identifier(id + "_in_hand"), "inventory"))
);
});
}
}
5 changes: 5 additions & 0 deletions src/main/java/artifality/client/ArtifalityClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import artifality.ArtifalityMod;
import artifality.block.CrateBlock;
import artifality.block.base.*;
import artifality.registry.ArtifalityParticles;
import artifality.client.particle.LunarChainParticle;
import artifality.client.render.TradingPedestalHud;
import artifality.client.render.TradingPedestalRenderer;
import artifality.item.base.ArtifactItem;
Expand All @@ -14,6 +16,7 @@
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.fabricmc.fabric.api.client.model.loading.v1.ModelLoadingPlugin;
import net.fabricmc.fabric.api.client.particle.v1.ParticleFactoryRegistry;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.block.entity.BlockEntityRendererFactories;
import net.minecraft.client.util.ModelIdentifier;
Expand All @@ -22,6 +25,8 @@ public class ArtifalityClient implements ClientModInitializer {

@Override
public void onInitializeClient() {
ParticleFactoryRegistry.getInstance().register(ArtifalityParticles.LUNAR_CHAIN, LunarChainParticle.Factory::new);

BlockEntityRendererFactories.register(ArtifalityBlockEntities.TRADING_PEDESTAL, ctx -> new TradingPedestalRenderer<>());

TradingPedestalHud.register();
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/artifality/item/HauntingSoul.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void appendTooltipInfo(ItemStack stack, List<Text> tooltip) {
else if(TiersUtils.getTier(stack) == 3) max = 240;

tooltip.add(Text.literal(TooltipAppender.ofKey("souls").replaceAll("%", getSouls(stack) + "/" + max)).formatted(Formatting.DARK_GREEN));
tooltip.add(Text.literal(TooltipAppender.ofKey("extra_damage").replaceAll("%", Integer.toString(getDamageModifier(stack)))).formatted(Formatting.DARK_GREEN));
tooltip.add(Text.literal(TooltipAppender.ofKey("extra_damage").replaceAll("%", Float.toString(getDamageModifier(stack)))).formatted(Formatting.DARK_GREEN));
}

public static int getSouls(ItemStack stack) {
Expand All @@ -38,15 +38,15 @@ public static int getSouls(ItemStack stack) {
return 0;
}

public static int getDamageModifier(ItemStack stack) {
public static float getDamageModifier(ItemStack stack) {
int max = 120;
if(TiersUtils.getTier(stack) == 2) max = 160;
else if(TiersUtils.getTier(stack) == 3) max = 240;

int souls = getSouls(stack);

if(souls >= max) return max / 40;
else return souls / 40;
if(souls >= max) return (float) max / 40;
else return (float)(souls / 20) * 0.5F;
}

public static void addSoul(ItemStack stack) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/artifality/mixin/common/PlayerMixin.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package artifality.mixin.common;

import artifality.client.particle.ArtifalityParticles;
import artifality.registry.ArtifalityParticles;
import artifality.extension.PlayerExtension;
import artifality.item.HauntingSoul;
import artifality.registry.ArtifalityDimensions;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/artifality/registry/ArtifalityEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import artifality.ArtifalityMod;
import artifality.extension.PlayerExtension;
import artifality.item.HauntingSoul;
import artifality.util.TiersUtils;
import artifality.util.TrinketsUtils;
import net.fabricmc.fabric.api.entity.event.v1.ServerLivingEntityEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
Expand Down Expand Up @@ -60,7 +61,7 @@ public static void init() {
ServerLivingEntityEvents.ALLOW_DEATH.register((entity, damageSource, damageAmount) -> {
if(entity instanceof ServerPlayerEntity player && player instanceof PlayerExtension ex) {
ItemStack artifact = TrinketsUtils.getTrinket(player, ArtifalityItems.HAUNTING_SOUL);
if(!artifact.isEmpty()) {
if(!artifact.isEmpty() && TiersUtils.getTier(artifact) != 3) {
HauntingSoul.setSouls(artifact, 0);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package artifality.client.particle;
package artifality.registry;

import artifality.ArtifalityMod;
import net.fabricmc.fabric.api.client.particle.v1.ParticleFactoryRegistry;
import net.fabricmc.fabric.api.particle.v1.FabricParticleTypes;
import net.minecraft.particle.DefaultParticleType;
import net.minecraft.registry.Registries;
Expand All @@ -11,7 +10,7 @@ public class ArtifalityParticles {
public static final DefaultParticleType LUNAR_CHAIN = add("lunar_chain");

public static void init() {
ParticleFactoryRegistry.getInstance().register(LUNAR_CHAIN, LunarChainParticle.Factory::new);

}

private static DefaultParticleType add(String name) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/artifality/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
"advancements.artifality.upgrader_second.name": "Upgrades!",
"advancements.artifality.upgrader_second.description": "Upgrade the Pedestal of Upgrading to Tier 2",

"advancements.artifality.upgrader_third.name": "I love upgrades!",
"advancements.artifality.upgrader_third.name": "I loooove upgrades!",
"advancements.artifality.upgrader_third.description": "Upgrade the Pedestal of Upgrading to Tier 3",

"advancements.artifality.rethink_life.name": "Why?",
Expand Down

0 comments on commit 34bc678

Please sign in to comment.