Skip to content

Commit

Permalink
25w04a
Browse files Browse the repository at this point in the history
  • Loading branch information
Starexify committed Jan 22, 2025
1 parent 90c83fb commit ef30ae8
Show file tree
Hide file tree
Showing 45 changed files with 401 additions and 304 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true

# Fabric Properties
minecraft_version=25w03a
yarn_mappings=25w03a+build.3
minecraft_version=25w04a
yarn_mappings=25w04a+build.1
loader_version=0.16.10

# Mod Properties
Expand All @@ -13,4 +13,4 @@ maven_group=net.nova.big_swords
mod_id=big_swords

# Dependencies
fabric_version=0.114.4+1.21.5
fabric_version=0.115.1+1.21.5
42 changes: 42 additions & 0 deletions src/client/java/net/nova/big_swords/BSClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.fabricmc.fabric.api.client.item.v1.ItemTooltipCallback;
import net.fabricmc.fabric.api.resource.ResourceManagerHelper;
import net.fabricmc.fabric.api.resource.ResourcePackActivationType;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.component.type.AttributeModifiersComponent;
import net.minecraft.item.Item;
import net.minecraft.screen.ScreenTexts;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.nova.big_swords.init.BSAttributes;
import net.nova.big_swords.init.BSBlocks;
import net.nova.big_swords.init.BSToolMaterial;
import net.nova.big_swords.item.GlaiveItem;

import java.util.List;
import java.util.Optional;

import static net.nova.big_swords.BigSwordsR.MODID;

Expand All @@ -22,8 +34,10 @@ public class BSClient implements ClientModInitializer {

@Override
public void onInitializeClient() {
// RenderLayers
BlockRenderLayerMap.INSTANCE.putBlock(BSBlocks.BIOMASS, RenderLayer.getCutout());

// Resource Packs
for (String packId : RESOURCE_PACKS) {
ResourceManagerHelper.registerBuiltinResourcePack(
BigSwordsR.rl(packId),
Expand All @@ -32,5 +46,33 @@ public void onInitializeClient() {
ResourcePackActivationType.NORMAL
);
}

// Tooltip Stuff
ItemTooltipCallback.EVENT.register((stack, tooltipContext, tooltipType, tooltip) -> {
Item item = stack.getItem();

tooltip.removeIf(text -> text.getString().contains(BSAttributes.MAX_CHARGED_DAMAGE.value().getTranslationKey()));
Optional<Text> toModify = tooltip.stream()
.filter(text -> text.getString().contains(BSAttributes.MIN_CHARGED_DAMAGE.value().getTranslationKey())).findFirst();

if (toModify.isPresent()) {
List<AttributeModifiersComponent.Entry> modifiers = item.getComponents().get(DataComponentTypes.ATTRIBUTE_MODIFIERS).modifiers();
double minChargedDamage = BigSwordsR.getModifierValue(modifiers, BSToolMaterial.MIN_CHARGED_DAMAGE_ID);
double maxChargedDamage = BigSwordsR.getModifierValue(modifiers, BSToolMaterial.MAX_CHARGED_DAMAGE_ID);

int index = tooltip.indexOf(toModify.get());
tooltip.set(index, ScreenTexts.space().append(Text.literal(
AttributeModifiersComponent.DECIMAL_FORMAT.format(minChargedDamage) + "-" +
AttributeModifiersComponent.DECIMAL_FORMAT.format(maxChargedDamage) + " ")
.append(Text.translatable("attribute.name.charged_damage")).formatted(Formatting.DARK_GREEN)
));

if (item instanceof GlaiveItem glaiveItem) {
tooltip.add(index + 1,
ScreenTexts.space().append(AttributeModifiersComponent.DECIMAL_FORMAT.format(glaiveItem.range) + " Charged Range").formatted(Formatting.DARK_GREEN)
);
}
}
});
}
}
9 changes: 6 additions & 3 deletions src/client/java/net/nova/big_swords/data/BSEnchantments.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider;
import net.fabricmc.fabric.api.resource.conditions.v1.ResourceCondition;
import net.minecraft.component.EnchantmentEffectComponentTypes;
import net.minecraft.component.type.AttributeModifierSlot;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentLevelBasedValue;
import net.minecraft.enchantment.effect.EnchantmentEffectTarget;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.RegistryEntryLookup;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.registry.RegistryWrapper;
import net.nova.big_swords.enchantments.effects.SoulStealEffect;
import net.nova.big_swords.init.BSDataComponents;
import net.nova.big_swords.init.BSEnchantmentEffects;
import net.nova.big_swords.init.BSItems;
import net.nova.big_swords.init.Tags;

import java.util.concurrent.CompletableFuture;
Expand All @@ -40,10 +43,10 @@ protected void configure(RegistryWrapper.WrapperLookup wrapperLookup, Entries en
))
.exclusiveSet(registryEntryLookup.getOrThrow(Tags.EnchantmentTags.SCYTHE_EXCLUSIVE))
.addEffect(
EnchantmentEffectComponentTypes.POST_ATTACK,
BSDataComponents.POST_DEATH,
EnchantmentEffectTarget.ATTACKER,
EnchantmentEffectTarget.VICTIM,
new SoulStealEffect(0)
new SoulStealEffect(EnchantmentLevelBasedValue.linear(0.3F), new ItemStack(BSItems.SOUL))
)
);
}
Expand Down
8 changes: 4 additions & 4 deletions src/client/java/net/nova/big_swords/data/BSTrimMaterials.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@
import java.util.concurrent.CompletableFuture;

public class BSTrimMaterials extends FabricDynamicRegistryProvider {
public static RegistryKey<ArmorTrimMaterial> LIVINGMETAL = of("livingmetal");
//public static RegistryKey<ArmorTrimMaterial> LIVINGMETAL = of("livingmetal");

public BSTrimMaterials(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
super(output, registriesFuture);
}

@Override
protected void configure(RegistryWrapper.WrapperLookup wrapperLookup, Entries entries) {
register(entries, LIVINGMETAL, BSItems.LIVINGMETAL_INGOT, Style.EMPTY.withColor(TextColor.parse("#e0f9ff").getOrThrow()), Map.of(BSEquipmentAssets.LIVINGMETAL, "livingmetal_darker"));
//register(entries, LIVINGMETAL, BSItems.LIVINGMETAL_INGOT, Style.EMPTY.withColor(TextColor.parse("#e0f9ff").getOrThrow()), Map.of(BSEquipmentAssets.LIVINGMETAL, "livingmetal_darker"));
}

public static void register(Entries entries, RegistryKey<ArmorTrimMaterial> materialKey, Item ingredient, Style style) {
/* public static void register(Entries entries, RegistryKey<ArmorTrimMaterial> materialKey, Item ingredient, Style style) {
register(entries, materialKey, ingredient, style, Map.of());
}
Expand All @@ -45,7 +45,7 @@ public static void register(Entries entries, RegistryKey<ArmorTrimMaterial> mate
public static RegistryKey<ArmorTrimMaterial> of(String id) {
return RegistryKey.of(RegistryKeys.TRIM_MATERIAL, BigSwordsR.rl(id));
}
}*/

@Override
public String getName() {
Expand Down
3 changes: 3 additions & 0 deletions src/client/java/net/nova/big_swords/data/LangProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,9 @@ public void generateTranslations(RegistryWrapper.WrapperLookup wrapperLookup, Tr
// Enchantments
translationBuilder.add("enchantment.big_swords.soul_stealer", "Soul Stealer");

// Attributes
translationBuilder.add("attribute.name.charged_damage", "Charged Damage");

// Resourcepacks
translationBuilder.add(BSClient.RP_16x_NAME, "Big Swords R 16x");
translationBuilder.add(BSClient.RP_16x_DESC, "16x textures for Big Swords");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import static net.nova.big_swords.BigSwordsR.MODID;

public class BigSwordsAdvancements implements AdvancementTabGenerator {

@Override
public void accept(RegistryWrapper.WrapperLookup registries, Consumer<AdvancementEntry> exporter) {
RegistryEntryLookup<Block> blockGetter = registries.getOrThrow(RegistryKeys.BLOCK);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import it.unimi.dsi.fastutil.ints.Int2ObjectFunction;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.client.data.*;
Expand All @@ -17,7 +15,6 @@
import java.util.function.BiConsumer;
import java.util.function.Consumer;

@Environment(EnvType.CLIENT)
public class BSBlockModelGenerator extends BlockStateModelGenerator {
public BSBlockModelGenerator(Consumer<BlockStateSupplier> blockStateCollector, ItemModelOutput itemModelOutput, BiConsumer<Identifier, ModelSupplier> modelCollector) {
super(blockStateCollector, itemModelOutput, modelCollector);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@
import net.nova.big_swords.BigSwordsR;
import net.nova.big_swords.data.BSTrimMaterials;
import net.nova.big_swords.equipment.BSEquipmentAssets;
import net.nova.big_swords.init.BSDataComponentTypes;
import net.nova.big_swords.init.BSDataComponents;
import net.nova.big_swords.init.BSItems;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.function.BiConsumer;

@Environment(EnvType.CLIENT)
public class BSItemModelGenerator extends ItemModelGenerator {
public static final List<BSItemModelGenerator.TrimMaterial> TRIM_MATERIALS = List.of(
new BSItemModelGenerator.TrimMaterial("quartz", ArmorTrimMaterials.QUARTZ, Map.of()),
Expand All @@ -42,8 +41,8 @@ public class BSItemModelGenerator extends ItemModelGenerator {
new BSItemModelGenerator.TrimMaterial("diamond", ArmorTrimMaterials.DIAMOND, Map.of(EquipmentAssetKeys.DIAMOND, "diamond_darker")),
new BSItemModelGenerator.TrimMaterial("lapis", ArmorTrimMaterials.LAPIS, Map.of()),
new BSItemModelGenerator.TrimMaterial("amethyst", ArmorTrimMaterials.AMETHYST, Map.of()),
new BSItemModelGenerator.TrimMaterial("resin", ArmorTrimMaterials.RESIN, Map.of()),
new BSItemModelGenerator.TrimMaterial("livingmetal", BSTrimMaterials.LIVINGMETAL, Map.of(BSEquipmentAssets.LIVINGMETAL, "livingmetal_darker"))
new BSItemModelGenerator.TrimMaterial("resin", ArmorTrimMaterials.RESIN, Map.of())
//new BSItemModelGenerator.TrimMaterial("livingmetal", BSTrimMaterials.LIVINGMETAL, Map.of(BSEquipmentAssets.LIVINGMETAL, "livingmetal_darker"))
);

public BSItemModelGenerator(ItemModelOutput output, BiConsumer<Identifier, ModelSupplier> modelCollector) {
Expand Down Expand Up @@ -168,7 +167,7 @@ public void registerBloodVial(Item item) {
));
list.add(ItemModels.switchCase(i, bloodModel));
}
output.accept(item, ItemModels.select(new ComponentProperty<>(BSDataComponentTypes.BLOOD_LEVEL), basicModel, list));
output.accept(item, ItemModels.select(new ComponentProperty<>(BSDataComponents.BLOOD_LEVEL), basicModel, list));
}

public Identifier registerSubModelWith(Item item, String suffix, Model model) {
Expand Down
7 changes: 0 additions & 7 deletions src/main/generated/assets/big_swords/items/biomass_boots.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@
"model": "big_swords:item/biomass_boots_resin_trim"
},
"when": "minecraft:resin"
},
{
"model": {
"type": "minecraft:model",
"model": "big_swords:item/biomass_boots_livingmetal_trim"
},
"when": "big_swords:livingmetal"
}
],
"fallback": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@
"model": "big_swords:item/biomass_chestplate_resin_trim"
},
"when": "minecraft:resin"
},
{
"model": {
"type": "minecraft:model",
"model": "big_swords:item/biomass_chestplate_livingmetal_trim"
},
"when": "big_swords:livingmetal"
}
],
"fallback": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@
"model": "big_swords:item/biomass_helmet_resin_trim"
},
"when": "minecraft:resin"
},
{
"model": {
"type": "minecraft:model",
"model": "big_swords:item/biomass_helmet_livingmetal_trim"
},
"when": "big_swords:livingmetal"
}
],
"fallback": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@
"model": "big_swords:item/biomass_leggings_resin_trim"
},
"when": "minecraft:resin"
},
{
"model": {
"type": "minecraft:model",
"model": "big_swords:item/biomass_leggings_livingmetal_trim"
},
"when": "big_swords:livingmetal"
}
],
"fallback": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@
"model": "big_swords:item/livingmetal_boots_resin_trim"
},
"when": "minecraft:resin"
},
{
"model": {
"type": "minecraft:model",
"model": "big_swords:item/livingmetal_boots_livingmetal_trim"
},
"when": "big_swords:livingmetal"
}
],
"fallback": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@
"model": "big_swords:item/livingmetal_chestplate_resin_trim"
},
"when": "minecraft:resin"
},
{
"model": {
"type": "minecraft:model",
"model": "big_swords:item/livingmetal_chestplate_livingmetal_trim"
},
"when": "big_swords:livingmetal"
}
],
"fallback": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@
"model": "big_swords:item/livingmetal_helmet_resin_trim"
},
"when": "minecraft:resin"
},
{
"model": {
"type": "minecraft:model",
"model": "big_swords:item/livingmetal_helmet_livingmetal_trim"
},
"when": "big_swords:livingmetal"
}
],
"fallback": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,6 @@
"model": "big_swords:item/livingmetal_leggings_resin_trim"
},
"when": "minecraft:resin"
},
{
"model": {
"type": "minecraft:model",
"model": "big_swords:item/livingmetal_leggings_livingmetal_trim"
},
"when": "big_swords:livingmetal"
}
],
"fallback": {
Expand Down
1 change: 1 addition & 0 deletions src/main/generated/assets/big_swords/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"advancements.big_swords.soul_harvesting.title": "Soul Harvesting",
"advancements.big_swords.till_creep.description": "Use a Glaive on Creep Blocks to till them and start your biomass farm",
"advancements.big_swords.till_creep.title": "Till Creep Blocks",
"attribute.name.charged_damage": "Charged Damage",
"big_swords:biomass_shield.perk": "Special Perk: Vitality Transfer",
"big_swords:biomass_shield.weakness": "Weakness: Life Leech",
"big_swords:diamond_shield.perk": "Special Perk: Counter Reflect",
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit ef30ae8

Please sign in to comment.