Skip to content

Commit

Permalink
v1.8 - Hatchet Integrations
Browse files Browse the repository at this point in the history
  • Loading branch information
DakotaPride committed May 28, 2024
1 parent 66694d4 commit a792401
Show file tree
Hide file tree
Showing 66 changed files with 829 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/main/java/net/dakotapride/garnished/GarnishedUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ public abstract class GarnishedUtils implements LevelReader {
public enum IDs {
MYTHIC_UPGRADES("mythicupgrades"),
DEEPER_AND_DARKER("deeperdarker"),
ADDITIONAL_ADDITIONS("additionaladditions");
ADDITIONAL_ADDITIONS("additionaladditions"),
AE2("ae2"),
BETTER_END("betterend"),
BETTER_NETHER("betternether");

final String getID;

Expand All @@ -29,6 +32,9 @@ public static String getIDFromEnum(String id) {
public static String mythicUpgradesID = IDs.MYTHIC_UPGRADES.getID;
public static String deeperAndDarkerID = IDs.DEEPER_AND_DARKER.getID;
public static String additionalAdditionsID = IDs.ADDITIONAL_ADDITIONS.getID;
public static String ae2ID = IDs.AE2.getID;
public static String betterEndID = IDs.BETTER_END.getID;
public static String betterNetherID = IDs.BETTER_NETHER.getID;

public static String mythicUpgrades() {
return getIDFromEnum(mythicUpgradesID);
Expand All @@ -42,6 +48,18 @@ public static String additionalAdditions() {
return getIDFromEnum(additionalAdditionsID);
}

public static String ae2() {
return getIDFromEnum(ae2ID);
}

public static String betterEnd() {
return getIDFromEnum(betterEndID);
}

public static String betterNether() {
return getIDFromEnum(betterNetherID);
}

public static DamageSource createType(Level world, ResourceKey<DamageType> key) {
return new DamageSource(world.registryAccess().registry(Registries.DAMAGE_TYPE).orElseThrow().getHolderOrThrow(key));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,36 @@ public enum IntegratedMaterials implements Tier {
}),
AQUAMARINE(Tiers.NETHERITE.getLevel(), 2106, 9.0f, 4.0f, 18, () -> {
return Ingredient.of(GarnishedTags.AQUAMARINE_GEMS);
}),
NETHER_RUBY(3, 2561, 7.1F, 3.1F, 18, () -> {
return Ingredient.of(GarnishedTags.NETHER_RUBIES);
}),
FLAMING_RUBY(4, 2861, 10.4F, 6.0F, 32, () -> {
return Ingredient.of(Items.SCULK_CATALYST);
}),
CINCINNASITE(2, 512, 6.2F, 2.5F, 16, () -> {
return Ingredient.of(GarnishedTags.CINCINNASITE_INGOTS);
}),
CINCINNASITE_DIAMOND(2061, 2031, 8.2F, 3.7F, 14, () -> {
return Ingredient.of(Items.DIAMOND);
}),
THALLASIUM(Tiers.IRON.getLevel(), 320, 7.0F, 1.5F, 12, () -> {
return Ingredient.of(GarnishedTags.THALLASIUM_INGOTS);
}),
TERMINITE(Tiers.DIAMOND.getLevel(), 1230, 8.5F, 2.0F, 14, () -> {
return Ingredient.of(GarnishedTags.TERMINITE_INGOTS);
}),
AETERNIUM(5, 2196, 10.0F, 4.5F, 18, () -> {
return Ingredient.of(GarnishedTags.AETERNIUM_INGOTS);
}),
NETHER_QUARTZ(Tiers.IRON.getLevel(), Tiers.IRON.getUses(), Tiers.IRON.getSpeed(), Tiers.IRON.getAttackDamageBonus(), Tiers.IRON.getEnchantmentValue(), () -> {
return Ingredient.of(Items.QUARTZ);
}),
CERTUS_QUARTZ(Tiers.IRON.getLevel(), Tiers.IRON.getUses(), Tiers.IRON.getSpeed(), Tiers.IRON.getAttackDamageBonus(), Tiers.IRON.getEnchantmentValue(), () -> {
return Ingredient.of(GarnishedTags.CERTUS_QUARTZ);
}),
FLUIX(4, Tiers.IRON.getUses() * 3, Tiers.IRON.getUses() * 1.2F, Tiers.IRON.getAttackDamageBonus() * 1.2F, Tiers.IRON.getEnchantmentValue(), () -> {
return Ingredient.of(GarnishedTags.FLUIX_CRYSTALS);
});

private final int level;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package net.dakotapride.garnished.item.hatchet.tier.integrated;

import net.dakotapride.garnished.GarnishedUtils;
import net.dakotapride.garnished.item.hatchet.IntegratedHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.IntegratedMaterials;

public class AeterniumHatchetToolItem extends IntegratedHatchetToolItem {
public AeterniumHatchetToolItem(Properties properties) {
super(GarnishedUtils.betterEnd(), IntegratedMaterials.AETERNIUM, IntegratedMaterials.AETERNIUM.getAttackDamageBonus(), IntegratedMaterials.AETERNIUM.getSpeed(), properties);
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package net.dakotapride.garnished.item.hatchet.tier.integrated;

import net.dakotapride.garnished.GarnishedUtils;
import net.dakotapride.garnished.item.hatchet.IntegratedHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.IntegratedMaterials;

public class CincinnasiteDiamondHatchetToolItem extends IntegratedHatchetToolItem {
public CincinnasiteDiamondHatchetToolItem(Properties properties) {
super(GarnishedUtils.betterNether(), IntegratedMaterials.CINCINNASITE_DIAMOND, IntegratedMaterials.CINCINNASITE_DIAMOND.getAttackDamageBonus(), IntegratedMaterials.CINCINNASITE_DIAMOND.getSpeed(), properties);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package net.dakotapride.garnished.item.hatchet.tier.integrated;

import net.dakotapride.garnished.GarnishedUtils;
import net.dakotapride.garnished.item.hatchet.IntegratedHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.IntegratedMaterials;

public class CincinnasiteHatchetToolItem extends IntegratedHatchetToolItem {
public CincinnasiteHatchetToolItem(Properties properties) {
super(GarnishedUtils.betterNether(), IntegratedMaterials.CINCINNASITE, IntegratedMaterials.CINCINNASITE.getAttackDamageBonus(), IntegratedMaterials.CINCINNASITE.getSpeed(), properties);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package net.dakotapride.garnished.item.hatchet.tier.integrated;

import net.dakotapride.garnished.GarnishedUtils;
import net.dakotapride.garnished.item.hatchet.IntegratedHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.IntegratedMaterials;

public class FlamingRubyHatchetToolItem extends IntegratedHatchetToolItem {
public FlamingRubyHatchetToolItem(Properties properties) {
super(GarnishedUtils.betterNether(), IntegratedMaterials.FLAMING_RUBY, IntegratedMaterials.FLAMING_RUBY.getAttackDamageBonus(), IntegratedMaterials.FLAMING_RUBY.getSpeed(), properties);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package net.dakotapride.garnished.item.hatchet.tier.integrated;

import java.util.List;

import org.jetbrains.annotations.Nullable;

import net.dakotapride.garnished.GarnishedUtils;
import net.dakotapride.garnished.item.hatchet.IntegratedHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.IntegratedMaterials;
import net.dakotapride.garnished.registry.GarnishedEnchantments;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.level.Level;

public class FluixHatchetToolItem extends IntegratedHatchetToolItem {
public FluixHatchetToolItem(Properties properties) {
super(GarnishedUtils.ae2(), IntegratedMaterials.FLUIX, 6.0F, -3.1F, properties);
}

public int getIntrinsicEnchantLevel(ItemStack stack, Enchantment enchantment) {
return enchantment == GarnishedEnchantments.STRIKING.get() ? 1 : 0;
}

@Override
public void appendHoverText(ItemStack stack, @Nullable Level level, List<Component> components, TooltipFlag tooltipFlag) {
components.add(Component.literal("Always has at least §7Striking 1"));
super.appendHoverText(stack, level, components, tooltipFlag);

// components.add(GuiText.IntrinsicEnchant.text(Enchantments.BLOCK_FORTUNE.getFullname(1)));
}

@Override
public boolean isFoil(ItemStack stack) {
return true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package net.dakotapride.garnished.item.hatchet.tier.integrated;

import net.dakotapride.garnished.GarnishedUtils;
import net.dakotapride.garnished.item.hatchet.IntegratedHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.IntegratedMaterials;

public class NetherRubyHatchetToolItem extends IntegratedHatchetToolItem {
public NetherRubyHatchetToolItem(Properties properties) {
super(GarnishedUtils.betterNether(), IntegratedMaterials.NETHER_RUBY, IntegratedMaterials.NETHER_RUBY.getAttackDamageBonus(), IntegratedMaterials.NETHER_RUBY.getSpeed(), properties);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package net.dakotapride.garnished.item.hatchet.tier.integrated;

import net.dakotapride.garnished.GarnishedUtils;
import net.dakotapride.garnished.item.hatchet.IntegratedHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.IntegratedMaterials;

public class QuartzHatchetToolItem extends IntegratedHatchetToolItem {
public QuartzHatchetToolItem(Properties properties) {
super(GarnishedUtils.ae2(), IntegratedMaterials.NETHER_QUARTZ, 6.0F, -3.1F, properties);
}

public static class CertusQuartzHatchetToolItem extends IntegratedHatchetToolItem {
public CertusQuartzHatchetToolItem(Properties properties) {
super(GarnishedUtils.ae2(), IntegratedMaterials.CERTUS_QUARTZ, 6.0F, -3.1F, properties);
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package net.dakotapride.garnished.item.hatchet.tier.integrated;

import net.dakotapride.garnished.GarnishedUtils;
import net.dakotapride.garnished.item.hatchet.IntegratedHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.IntegratedMaterials;

public class TerminiteHatchetToolItem extends IntegratedHatchetToolItem {
public TerminiteHatchetToolItem(Properties properties) {
super(GarnishedUtils.betterEnd(), IntegratedMaterials.TERMINITE, IntegratedMaterials.TERMINITE.getAttackDamageBonus(), IntegratedMaterials.TERMINITE.getSpeed(), properties);
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package net.dakotapride.garnished.item.hatchet.tier.integrated;

import net.dakotapride.garnished.GarnishedUtils;
import net.dakotapride.garnished.item.hatchet.IntegratedHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.IntegratedMaterials;

public class ThallasiumHatchetToolItem extends IntegratedHatchetToolItem {
public ThallasiumHatchetToolItem(Properties properties) {
super(GarnishedUtils.betterEnd(), IntegratedMaterials.THALLASIUM, IntegratedMaterials.THALLASIUM.getAttackDamageBonus(), IntegratedMaterials.THALLASIUM.getSpeed(), properties);
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package net.dakotapride.garnished.item.hatchet.tier.integrated.head;

import net.dakotapride.garnished.GarnishedUtils;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Tier;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.Level;

import org.jetbrains.annotations.Nullable;

import java.util.List;

public class IntegratedToolHeadItem extends Item {
String integratedModID;

public IntegratedToolHeadItem(Properties properties) {
super(properties);
this.integratedModID = GarnishedUtils.betterEnd();
}

@Override
public void appendHoverText(ItemStack stack, @Nullable Level level, List<Component> components, TooltipFlag tooltipFlag) {
if (!(FabricLoader.getInstance().isModLoaded(integratedModID))) {
components.add(Component.translatable("text.garnished.integration." + integratedModID + ".missing").withStyle(ChatFormatting.GRAY));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,19 @@
import net.dakotapride.garnished.item.hatchet.tier.NetheriteHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.StoneHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.WoodenHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.AeterniumHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.CincinnasiteDiamondHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.CincinnasiteHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.FlamingRubyHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.FluixHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.GildedNetheriteHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.NetherRubyHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.QuartzHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.RoseGoldHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.TerminiteHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.ThallasiumHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.WardenHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.head.IntegratedToolHeadItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.mythicupgrades.AmetrineHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.mythicupgrades.AquamarineHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.mythicupgrades.JadeHatchetToolItem;
Expand Down Expand Up @@ -781,6 +791,36 @@ public class GarnishedItems {
public static final ItemEntry<GildedNetheriteHatchetToolItem> GILDED_NETHERITE_HATCHET =
REGISTRATE.item("gilded_netherite_hatchet", GildedNetheriteHatchetToolItem::new).register();

public static final ItemEntry<NetherRubyHatchetToolItem> NETHER_RUBY_HATCHET =
REGISTRATE.item("nether_ruby_hatchet", NetherRubyHatchetToolItem::new).register();
public static final ItemEntry<FlamingRubyHatchetToolItem> FLAMING_RUBY_HATCHET =
REGISTRATE.item("flaming_ruby_hatchet", FlamingRubyHatchetToolItem::new).register();
public static final ItemEntry<CincinnasiteHatchetToolItem> CINCINNASITE_HATCHET =
REGISTRATE.item("cincinnasite_hatchet", CincinnasiteHatchetToolItem::new).register();
public static final ItemEntry<CincinnasiteDiamondHatchetToolItem> CINCINNASITE_DIAMOND_HATCHET =
REGISTRATE.item("cincinnasite_diamond_hatchet", CincinnasiteDiamondHatchetToolItem::new).register();

public static final ItemEntry<IntegratedToolHeadItem> THALLASIUM_HATCHET_HEAD =
REGISTRATE.item("thallasium_hatchet_head", IntegratedToolHeadItem::new).register();
public static final ItemEntry<IntegratedToolHeadItem> TERMINITE_HATCHET_HEAD =
REGISTRATE.item("terminite_hatchet_head", IntegratedToolHeadItem::new).register();
public static final ItemEntry<IntegratedToolHeadItem> AETERNIUM_HATCHET_HEAD =
REGISTRATE.item("aeternium_hatchet_head", IntegratedToolHeadItem::new).register();

public static final ItemEntry<ThallasiumHatchetToolItem> THALLASIUM_HATCHET =
REGISTRATE.item("thallasium_hatchet", ThallasiumHatchetToolItem::new).register();
public static final ItemEntry<TerminiteHatchetToolItem> TERMINITE_HATCHET =
REGISTRATE.item("terminite_hatchet", TerminiteHatchetToolItem::new).register();
public static final ItemEntry<AeterniumHatchetToolItem> AETERNIUM_HATCHET =
REGISTRATE.item("aeternium_hatchet", AeterniumHatchetToolItem::new).register();

public static final ItemEntry<QuartzHatchetToolItem> NETHER_QUARTZ_HATCHET =
REGISTRATE.item("nether_quartz_hatchet", QuartzHatchetToolItem::new).register();
public static final ItemEntry<QuartzHatchetToolItem.CertusQuartzHatchetToolItem> CERTUS_QUARTZ_HATCHET =
REGISTRATE.item("certus_quartz_hatchet", QuartzHatchetToolItem.CertusQuartzHatchetToolItem::new).register();
public static final ItemEntry<FluixHatchetToolItem> FLUIX_HATCHET =
REGISTRATE.item("fluix_hatchet", FluixHatchetToolItem::new).register();


public static void setRegister() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

import java.util.function.Supplier;

import com.tterrag.registrate.util.entry.ItemEntry;

import net.dakotapride.garnished.item.hatchet.tier.integrated.GildedNetheriteHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.RoseGoldHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.WardenHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.mythicupgrades.AmetrineHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.mythicupgrades.AquamarineHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.mythicupgrades.JadeHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.mythicupgrades.RubyHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.mythicupgrades.SapphireHatchetToolItem;
import net.dakotapride.garnished.item.hatchet.tier.integrated.mythicupgrades.TopazHatchetToolItem;
import net.minecraft.world.item.Rarity;

import org.jetbrains.annotations.NotNull;

import com.simibubi.create.AllCreativeModeTabs;
Expand Down Expand Up @@ -378,6 +391,29 @@ public void accept(CreativeModeTab.@NotNull ItemDisplayParameters parameters, Cr
output.accept(GarnishedItems.GOLDEN_HATCHET.asStack());
output.accept(GarnishedItems.DIAMOND_HATCHET.asStack());
output.accept(GarnishedItems.NETHERITE_HATCHET.asStack());

output.accept(GarnishedItems.JADE_HATCHET.asStack());
output.accept(GarnishedItems.TOPAZ_HATCHET.asStack());
output.accept(GarnishedItems.SAPPHIRE_HATCHET.asStack());
output.accept(GarnishedItems.RUBY_HATCHET.asStack());
output.accept(GarnishedItems.AMETRINE_HATCHET.asStack());
output.accept(GarnishedItems.AQUAMARINE_HATCHET.asStack());
output.accept(GarnishedItems.WARDEN_HATCHET.asStack());
output.accept(GarnishedItems.ROSE_GOLD_HATCHET.asStack());
output.accept(GarnishedItems.GILDED_NETHERITE_HATCHET.asStack());
output.accept(GarnishedItems.NETHER_RUBY_HATCHET.asStack());
output.accept(GarnishedItems.FLAMING_RUBY_HATCHET.asStack());
output.accept(GarnishedItems.CINCINNASITE_HATCHET.asStack());
output.accept(GarnishedItems.CINCINNASITE_DIAMOND_HATCHET.asStack());
output.accept(GarnishedItems.THALLASIUM_HATCHET.asStack());
output.accept(GarnishedItems.TERMINITE_HATCHET.asStack());
output.accept(GarnishedItems.AETERNIUM_HATCHET.asStack());
output.accept(GarnishedItems.THALLASIUM_HATCHET_HEAD.asStack());
output.accept(GarnishedItems.TERMINITE_HATCHET_HEAD.asStack());
output.accept(GarnishedItems.AETERNIUM_HATCHET_HEAD.asStack());
output.accept(GarnishedItems.NETHER_QUARTZ_HATCHET.asStack());
output.accept(GarnishedItems.CERTUS_QUARTZ_HATCHET.asStack());
output.accept(GarnishedItems.FLUIX_HATCHET.asStack());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ public class GarnishedTags {
public static final TagKey<Item> RUBY_GEMS = commonTag("ingots/ruby", BuiltInRegistries.ITEM);
public static final TagKey<Item> AMETRINE_GEMS = commonTag("ingots/ametrine", BuiltInRegistries.ITEM);

public static TagKey<Item> NETHER_RUBIES = commonTag("rubies/nether", BuiltInRegistries.ITEM);
public static TagKey<Item> CINCINNASITE_INGOTS = commonTag("ingots/cincinnasite", BuiltInRegistries.ITEM);

public static TagKey<Item> CERTUS_QUARTZ = commonTag("gems/certus_quartz", BuiltInRegistries.ITEM);
public static TagKey<Item> FLUIX_CRYSTALS = commonTag("gems/fluix", BuiltInRegistries.ITEM);

public static TagKey<Item> THALLASIUM_INGOTS = commonTag("ingots/thallasium", BuiltInRegistries.ITEM);
public static TagKey<Item> TERMINITE_INGOTS = commonTag("ingots/terminite", BuiltInRegistries.ITEM);
public static TagKey<Item> AETERNIUM_INGOTS = commonTag("ingots/aeternium", BuiltInRegistries.ITEM);

private static <T> TagKey<T> garnishedTag(String name, DefaultedRegistry<T> registry) {
return TagKey.create(registry.key(), new ResourceLocation(CreateGarnished.ID, name));
}
Expand Down
Loading

0 comments on commit a792401

Please sign in to comment.