Skip to content

Commit

Permalink
Start Void compat
Browse files Browse the repository at this point in the history
  • Loading branch information
IcarussOne committed Aug 11, 2024
1 parent d40b279 commit 4ce2298
Show file tree
Hide file tree
Showing 30 changed files with 475 additions and 26 deletions.
5 changes: 5 additions & 0 deletions src/main/java/mod/emt/balkonsexpansion/BEConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ public static class ThaumcraftSettings {
@Config.Comment("Enables support for the Thaumium material [default: true]")
@Config.RequiresWorldRestart
public boolean TC_THAUMIUM_MATERIAL = true;

@Config.Name("Material: Void")
@Config.Comment("Enables support for the Void material [default: true]")
@Config.RequiresWorldRestart
public boolean TC_VOID_MATERIAL = true;
}

@Mod.EventBusSubscriber(modid = BalkonsExpansion.MOD_ID)
Expand Down
49 changes: 23 additions & 26 deletions src/main/java/mod/emt/balkonsexpansion/BEItemBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import ckathode.weaponmod.WMItemBuilder;
import ckathode.weaponmod.item.ItemFlail;
import ckathode.weaponmod.item.ItemMelee;
import ckathode.weaponmod.item.ItemMusket;
import ckathode.weaponmod.item.MeleeCompNone;
import ckathode.weaponmod.item.MeleeComponent;
Expand All @@ -26,113 +23,113 @@ public class BEItemBuilder {
// ==================================================================== //
// Custom builders used to specify a custom attribute amount
// ==================================================================== //
public static ItemMelee createCustomBattleaxe(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, float ignoreArmorAmount) {
public static BEItemMelee createCustomBattleaxe(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, float ignoreArmorAmount) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompBattleaxeCustom(material, knockbackAmount, ignoreArmorAmount), EnumRarity.COMMON);
}

public static ItemMelee createCustomBoomerang(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount) {
public static BEItemMelee createCustomBoomerang(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompBoomerangCustom(material, knockbackAmount), EnumRarity.COMMON);
}

public static ItemMelee createCustomHalberd(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, float reachAmount) {
public static BEItemMelee createCustomHalberd(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, float reachAmount) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompHalberdCustom(material, knockbackAmount, reachAmount), EnumRarity.COMMON);
}

public static ItemMelee createCustomKatana(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount) {
public static BEItemMelee createCustomKatana(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompKatanaCustom(material, knockbackAmount), EnumRarity.COMMON);
}

public static ItemMelee createCustomKnife(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount) {
public static BEItemMelee createCustomKnife(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompKnifeCustom(material, knockbackAmount), EnumRarity.COMMON);
}

public static ItemMusket createCustomMusketBayonet(String id, @Nonnull Item.ToolMaterial material, @Nonnull Item bayonetItem, float knockbackAmount) {
return createCustomItemMusket(BalkonsExpansion.MOD_ID, id, new MeleeCompKnifeCustom(material, knockbackAmount), bayonetItem, EnumRarity.COMMON);
}

public static ItemMelee createCustomSpear(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, float reachAmount) {
public static BEItemMelee createCustomSpear(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, float reachAmount) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompSpearCustom(material, knockbackAmount, reachAmount), EnumRarity.COMMON);
}

public static ItemMelee createCustomWarhammer(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount) {
public static BEItemMelee createCustomWarhammer(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompWarhammerCustom(material, knockbackAmount), EnumRarity.COMMON);
}

// ==================================================================== //
// Same as above except you can customize the rarity
// ==================================================================== //
public static ItemMelee createCustomBattleaxe(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, float ignoreArmorAmount, EnumRarity rarity) {
public static BEItemMelee createCustomBattleaxe(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, float ignoreArmorAmount, EnumRarity rarity) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompBattleaxeCustom(material, knockbackAmount, ignoreArmorAmount), rarity);
}

public static ItemMelee createCustomBoomerang(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, EnumRarity rarity) {
public static BEItemMelee createCustomBoomerang(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, EnumRarity rarity) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompBoomerangCustom(material, knockbackAmount), rarity);
}

public static ItemFlail createCustomFlail(String id, @Nonnull Item.ToolMaterial material, EnumRarity rarity) {
public static BEItemFlail createCustomFlail(String id, @Nonnull Item.ToolMaterial material, EnumRarity rarity) {
return createCustomItemFlail(BalkonsExpansion.MOD_ID, id, new MeleeCompNone(material), rarity);
}

public static ItemMelee createCustomHalberd(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, float reachAmount, EnumRarity rarity) {
public static BEItemMelee createCustomHalberd(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, float reachAmount, EnumRarity rarity) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompHalberdCustom(material, knockbackAmount, reachAmount), rarity);
}

public static ItemMelee createCustomKatana(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, EnumRarity rarity) {
public static BEItemMelee createCustomKatana(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, EnumRarity rarity) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompKatanaCustom(material, knockbackAmount), rarity);
}

public static ItemMelee createCustomKnife(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, EnumRarity rarity) {
public static BEItemMelee createCustomKnife(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, EnumRarity rarity) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompKnifeCustom(material, knockbackAmount), rarity);
}

public static ItemMusket createCustomMusketBayonet(String id, @Nonnull Item.ToolMaterial material, @Nonnull Item bayonetItem, float knockbackAmount, EnumRarity rarity) {
return createCustomItemMusket(BalkonsExpansion.MOD_ID, id, new MeleeCompKnifeCustom(material, knockbackAmount), bayonetItem, rarity);
}

public static ItemMelee createCustomSpear(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, float reachAmount, EnumRarity rarity) {
public static BEItemMelee createCustomSpear(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, float reachAmount, EnumRarity rarity) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompSpearCustom(material, knockbackAmount, reachAmount), rarity);
}

public static ItemMelee createCustomWarhammer(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, EnumRarity rarity) {
public static BEItemMelee createCustomWarhammer(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, EnumRarity rarity) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompWarhammerCustom(material, knockbackAmount), rarity);
}

// ==================================================================== //
// More basic builders that are mainly used to easily register items
// ==================================================================== //
public static ItemMelee createCustomBattleaxe(String id, @Nonnull Item.ToolMaterial material) {
public static BEItemMelee createCustomBattleaxe(String id, @Nonnull Item.ToolMaterial material) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompBattleaxeCustom(material, 0.1F, 1.0F), EnumRarity.COMMON);
}

public static ItemMelee createCustomBoomerang(String id, @Nonnull Item.ToolMaterial material) {
public static BEItemMelee createCustomBoomerang(String id, @Nonnull Item.ToolMaterial material) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompBoomerangCustom(material, 0.0F), EnumRarity.COMMON);
}

public static ItemFlail createCustomFlail(String id, @Nonnull Item.ToolMaterial material) {
public static BEItemFlail createCustomFlail(String id, @Nonnull Item.ToolMaterial material) {
return createCustomItemFlail(BalkonsExpansion.MOD_ID, id, new MeleeCompNone(material), EnumRarity.COMMON);
}

public static ItemMelee createCustomHalberd(String id, @Nonnull Item.ToolMaterial material) {
public static BEItemMelee createCustomHalberd(String id, @Nonnull Item.ToolMaterial material) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompHalberdCustom(material, 0.2F, 1.0F), EnumRarity.COMMON);
}

public static ItemMelee createCustomKatana(String id, @Nonnull Item.ToolMaterial material) {
public static BEItemMelee createCustomKatana(String id, @Nonnull Item.ToolMaterial material) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompKatanaCustom(material, -0.4F), EnumRarity.COMMON);
}

public static ItemMelee createCustomKnife(String id, @Nonnull Item.ToolMaterial material) {
public static BEItemMelee createCustomKnife(String id, @Nonnull Item.ToolMaterial material) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompKnifeCustom(material, -0.2F), EnumRarity.COMMON);
}

public static ItemMusket createCustomMusketBayonet(String id, @Nonnull Item.ToolMaterial material, @Nonnull Item bayonetItem) {
return createCustomItemMusket(BalkonsExpansion.MOD_ID, id, new MeleeCompKnifeCustom(material, -0.2F), bayonetItem, EnumRarity.COMMON);
}

public static ItemMelee createCustomSpear(String id, @Nonnull Item.ToolMaterial material) {
public static BEItemMelee createCustomSpear(String id, @Nonnull Item.ToolMaterial material) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompSpearCustom(material, -0.2F, 1.0F), EnumRarity.COMMON);
}

public static ItemMelee createCustomWarhammer(String id, @Nonnull Item.ToolMaterial material) {
public static BEItemMelee createCustomWarhammer(String id, @Nonnull Item.ToolMaterial material) {
return createCustomItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompWarhammerCustom(material, 0.3F), EnumRarity.COMMON);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package mod.emt.balkonsexpansion.compat.thaumcraft;

import javax.annotation.Nonnull;
import ckathode.weaponmod.item.MeleeCompNone;
import ckathode.weaponmod.item.MeleeComponent;
import mod.emt.balkonsexpansion.BalkonsExpansion;
import mod.emt.balkonsexpansion.compat.thaumcraft.item.BEItemFlailVoid;
import mod.emt.balkonsexpansion.compat.thaumcraft.item.BEItemMeleeVoid;
import mod.emt.balkonsexpansion.item.MeleeCompBattleaxeCustom;
import mod.emt.balkonsexpansion.item.MeleeCompBoomerangCustom;
import mod.emt.balkonsexpansion.item.MeleeCompHalberdCustom;
import mod.emt.balkonsexpansion.item.MeleeCompKatanaCustom;
import mod.emt.balkonsexpansion.item.MeleeCompKnifeCustom;
import mod.emt.balkonsexpansion.item.MeleeCompSpearCustom;
import mod.emt.balkonsexpansion.item.MeleeCompWarhammerCustom;
import net.minecraft.item.Item;

public class ThaumcraftItemBuilder {
// ==================================================================== //
// Custom builders used for void weapons
// ==================================================================== //
public static BEItemMeleeVoid createVoidBattleaxe(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, float ignoreArmorAmount) {
return createVoidItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompBattleaxeCustom(material, knockbackAmount, ignoreArmorAmount));
}

public static BEItemMeleeVoid createVoidBoomerang(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount) {
return createVoidItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompBoomerangCustom(material, knockbackAmount));
}

public static BEItemFlailVoid createVoidFlail(String id, @Nonnull Item.ToolMaterial material) {
return createVoidItemFlail(BalkonsExpansion.MOD_ID, id, new MeleeCompNone(material));
}

public static BEItemMeleeVoid createVoidHalberd(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, float reachAmount) {
return createVoidItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompHalberdCustom(material, knockbackAmount, reachAmount));
}

public static BEItemMeleeVoid createVoidKatana(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount) {
return createVoidItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompKatanaCustom(material, knockbackAmount));
}

public static BEItemMeleeVoid createVoidKnife(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount) {
return createVoidItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompKnifeCustom(material, knockbackAmount));
}

/*public static ItemMusket createCustomMusketBayonet(String id, @Nonnull Item.ToolMaterial material, @Nonnull Item bayonetItem, float knockbackAmount) {
return createVoidItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompKnifeCustom(material, knockbackAmount), bayonetItem, EnumRarity.COMMON);
}*/

public static BEItemMeleeVoid createVoidSpear(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount, float reachAmount) {
return createVoidItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompSpearCustom(material, knockbackAmount, reachAmount));
}

public static BEItemMeleeVoid createVoidWarhammer(String id, @Nonnull Item.ToolMaterial material, float knockbackAmount) {
return createVoidItemMelee(BalkonsExpansion.MOD_ID, id, new MeleeCompWarhammerCustom(material, knockbackAmount));
}

// ==================================================================== //
// Custom ItemClass Builders for void weapons
// ==================================================================== //

public static BEItemFlailVoid createVoidItemFlail(String modId, String id, MeleeComponent meleeComponent) {
return new BEItemFlailVoid(modId, id, meleeComponent);
}

public static BEItemMeleeVoid createVoidItemMelee(String modId, String id, MeleeComponent meleeComponent) {
return new BEItemMeleeVoid(modId, id, meleeComponent);
}
}
Loading

0 comments on commit 4ce2298

Please sign in to comment.