Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HV and IV Chainsaw added #266

Merged
merged 2 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/gtexpert/GTExpertMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import gtexpert.api.GTEValues;
import gtexpert.api.util.GTELog;
import gtexpert.api.util.Mods;
import gtexpert.common.items.GTECoverBehaviors;
import gtexpert.common.items.behaviors.GTECoverBehaviors;
import gtexpert.modules.GTEModuleManager;
import gtexpert.modules.GTEModules;

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/gtexpert/common/items/GTEMetaItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import gregtech.api.items.armor.ArmorMetaItem;
import gregtech.api.items.metaitem.MetaItem;

import gtexpert.common.items.armor.GTEMetaArmor;

public final class GTEMetaItems {

private GTEMetaItems() {}
Expand Down
42 changes: 42 additions & 0 deletions src/main/java/gtexpert/common/items/GTEToolItems.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package gtexpert.common.items;

import gregtech.api.GTValues;
import gregtech.api.items.toolitem.*;
import gregtech.common.items.ToolItems;
import gregtech.common.items.tool.*;
import gregtech.core.sound.GTSoundEvents;

public final class GTEToolItems {

private GTEToolItems() {/**/}

public static IGTTool CHAINSAW_HV;
public static IGTTool CHAINSAW_IV;

public static void init() {
CHAINSAW_HV = ToolItems.register(ItemGTTool.Builder.of(GTValues.MODID, "chainsaw_hv")
.toolStats(b -> b.blockBreaking()
.efficiencyMultiplier(3.0F)
.attackDamage(5.0F).attackSpeed(-3.2F)
.brokenStack(ToolHelper.SUPPLY_POWER_UNIT_HV)
.behaviors(HarvestIceBehavior.INSTANCE, DisableShieldBehavior.INSTANCE,
TreeFellingBehavior.INSTANCE))
.oreDict(ToolOreDict.toolAxe)
.secondaryOreDicts(ToolOreDict.toolChainsaw)
.sound(GTSoundEvents.CHAINSAW_TOOL, true)
.toolClasses(ToolClasses.AXE)
.electric(GTValues.HV));
CHAINSAW_IV = ToolItems.register(ItemGTTool.Builder.of(GTValues.MODID, "chainsaw_iv")
.toolStats(b -> b.blockBreaking()
.efficiencyMultiplier(4.0F)
.attackDamage(5.0F).attackSpeed(-3.2F)
.brokenStack(ToolHelper.SUPPLY_POWER_UNIT_IV)
.behaviors(HarvestIceBehavior.INSTANCE, DisableShieldBehavior.INSTANCE,
TreeFellingBehavior.INSTANCE))
.oreDict(ToolOreDict.toolAxe)
.secondaryOreDicts(ToolOreDict.toolChainsaw)
.sound(GTSoundEvents.CHAINSAW_TOOL, true)
.toolClasses(ToolClasses.AXE)
.electric(GTValues.IV));
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package gtexpert.common.items;
package gtexpert.common.items.armor;

import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.EnumRarity;

import gregtech.api.items.armor.ArmorMetaItem;

import gtexpert.common.items.GTEMetaItems;

public class GTEMetaArmor extends ArmorMetaItem<ArmorMetaItem<?>.ArmorMetaValueItem> {

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gtexpert.common.items;
package gtexpert.common.items.armor;

import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gtexpert.common.items;
package gtexpert.common.items.behaviors;

import static gregtech.common.covers.CoverBehaviors.registerBehavior;
import static gtexpert.api.util.GTEUtility.gteId;
Expand All @@ -9,6 +9,7 @@
import gregtech.common.covers.CoverPump;
import gregtech.common.covers.CoverRoboticArm;

import gtexpert.common.items.GTEMetaItems;
import gtexpert.core.GTEConfigHolder;

public class GTECoverBehaviors {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/gtexpert/core/GTECoreModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@
import gtexpert.common.blocks.GTEBlockWireCoil;
import gtexpert.common.blocks.GTEMetaBlocks;
import gtexpert.common.items.GTEMetaItems;
import gtexpert.common.items.GTEToolItems;
import gtexpert.core.loaders.GTEMaterialInfoLoader;
import gtexpert.core.loaders.GTEOreDictionaryLoader;
import gtexpert.core.metatileentities.GTEMetaTileEntities;
import gtexpert.core.recipes.*;
import gtexpert.core.recipes.handlers.GTEToolRecipeHandler;
import gtexpert.modules.GTEModules;

@GTEModule(
Expand Down Expand Up @@ -66,6 +68,7 @@ public void preInit(FMLPreInitializationEvent event) {

GTEMetaBlocks.init();
GTEMetaItems.init();
GTEToolItems.init();

/* Start API Block Registration */
for (GTEBlockWireCoil.GTECoilType type : GTEBlockWireCoil.GTECoilType.values()) {
Expand Down Expand Up @@ -105,6 +108,7 @@ public void registerItems(RegistryEvent.Register<Item> event) {

@Override
public void registerRecipesNormal(RegistryEvent.Register<IRecipe> event) {
GTEToolRecipeHandler.register();
GTEMaterialInfoLoader.init();
GTEOreDictionaryLoader.init();
GTEMetaTileEntities.init();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package gtexpert.core.recipes.handlers;

import static gregtech.api.unification.material.info.MaterialFlags.*;
import static gregtech.loaders.recipe.handlers.ToolRecipeHandler.addElectricToolRecipe;

import gregtech.api.items.toolitem.IGTTool;
import gregtech.api.unification.material.Material;
import gregtech.api.unification.material.properties.PropertyKey;
import gregtech.api.unification.material.properties.ToolProperty;
import gregtech.api.unification.ore.OrePrefix;

import gtexpert.common.items.GTEToolItems;

public class GTEToolRecipeHandler {

public static void register() {
OrePrefix.plate.addProcessingHandler(PropertyKey.TOOL, GTEToolRecipeHandler::processElectricTool);
}

private static void processElectricTool(OrePrefix prefix, Material material, ToolProperty property) {
OrePrefix toolPrefix;

if (material.hasFlag(GENERATE_PLATE)) {
// Chainsaw
toolPrefix = OrePrefix.toolHeadChainsaw;
addElectricToolRecipe(toolPrefix, material, new IGTTool[] {
GTEToolItems.CHAINSAW_HV, GTEToolItems.CHAINSAW_IV
});
}
}
}
10 changes: 10 additions & 0 deletions src/main/resources/assets/gregtech/lang/en_us.lang
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# English by GTModpackTeam


# tool
death.attack.chainsaw_hv=%s was massacred by %s
death.attack.chainsaw_iv=%s was massacred by %s
item.gt.tool.chainsaw_hv.name=%s Chainsaw (HV)
item.gt.tool.chainsaw_hv.tooltip=Additions in GTExpert-Core
item.gt.tool.chainsaw_iv.name=%s Chainsaw (IV)
item.gt.tool.chainsaw_iv.tooltip=Additions in GTExpert-Core
10 changes: 10 additions & 0 deletions src/main/resources/assets/gregtech/lang/ja_jp.lang
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@



# tool
death.attack.chainsaw_hv=%s は %s にチェーンソーを振り回すことは危険だと教えたかった。
death.attack.chainsaw_iv=%s は %s にチェーンソーを振り回すことは危険だと教えたかった。
item.gt.tool.chainsaw_hv.name=HVの%s製チェーンソー
item.gt.tool.chainsaw_hv.tooltip=GTExpert-Coreでの追加物です
item.gt.tool.chainsaw_iv.name=IVの%s製チェーンソー
item.gt.tool.chainsaw_iv.tooltip=GTExpert-Coreでの追加物です
10 changes: 10 additions & 0 deletions src/main/resources/assets/gregtech/lang/zh_cn.lang
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Chinese by GTModpackTeam
# 中文翻译由 Quarri6343 翻译。

# tool
death.attack.chainsaw_hv=%2$s的链锯切碎了%1$s
death.attack.chainsaw_iv=%2$s的链锯切碎了%1$s
item.gt.tool.chainsaw_hv.name=%s链锯(HV)
item.gt.tool.chainsaw_hv.tooltip=GTExpert-Core 中的其他项目
item.gt.tool.chainsaw_iv.name=%s链锯(IV)
item.gt.tool.chainsaw_iv.tooltip=GTExpert-Core 中的其他项目
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "gregtech:items/tools/power_unit_hv",
"layer1": "gregtech:items/tools/chainsaw"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "item/handheld",
"textures": {
"layer0": "gregtech:items/tools/power_unit_iv",
"layer1": "gregtech:items/tools/chainsaw"
}
}
1 change: 1 addition & 0 deletions src/main/resources/assets/gtexpert/lang/ja_jp.lang
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@



# multiblock
gtexpert.machine.sawmill.name=製材機
gtexpert.machine.sawmill.tooltip=うるさいからって電話を伐らないで..
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/assets/gtexpert/lang/zh_cn.lang
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ gregtech.material.void_metal=虚空金属
metaitem.gte_me_fake_component.name=GTExpert ME存储组件
metaitem.matrix_core.name=矩阵核心
metaitem.piston_boots.name=活塞靴子
metaitem.piston_boots.tooltip=Wearer can Step Deeper, Run Faster, and Jump Higher!

# recipemaps
recipemap.sawmill.name=锯木机
Expand Down
Loading