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

merge from master #8

Merged
merged 14 commits into from
Nov 7, 2021
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
54 changes: 27 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@ buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
name = "gt"
url = "https://gregtech.overminddl1.com/"
}
maven {
name = "jitpack"
url = "https://jitpack.io"
}
}
dependencies {
classpath 'com.github.CDAGaming:ForgeGradle:1c670759c5'
classpath "com.github.GTNH2:ForgeGradle:FG_1.2-SNAPSHOT"
}
}

Expand All @@ -27,37 +24,41 @@ file "build.properties" withReader {
}

version = "${config.minecraft.version}-${config.tgregworks.version}"
group= "vexatos.tgregworks" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
group = "vexatos.tgregworks" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "TGregworks"

repositories {
/*maven {
name 'CB Maven FS'
url "http://chickenbones.net/maven/"
}*/
maven {
name 'Curseforge Maven'
url 'http://minecraft.curseforge.com/api/maven/'
}
maven {
name "DVS1 Maven FS'"
url 'http://dvs1.progwml6.com/files/maven'
}*/

ivy { // GregTech
name = 'gtnh_download_source'
artifactPattern("http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-[revision].[ext]")
}
}

configurations {
provided
embedded
implementation.extendsFrom embedded
compile.extendsFrom provided, embedded
all*.exclude group: "codechicken"
}

dependencies {
//implementation "mantle:Mantle:1.7.10-0.3.1.jenkins176:deobf"
//implementation "codechicken:CodeChickenCore:1.7.10-1.0.2.9:dev"
//implementation "codechicken:NotEnoughItems:1.7.10-1.0.2.15:dev"
//implementation "tconstruct:TConstruct:1.7.10-1.6.0.build638:deobf"
implementation "gregtech:gregtech-${config.gregtech.version}:dev"
//compile "mantle:Mantle:1.7.10-0.3.1.jenkins176:deobf"
//compile "codechicken:CodeChickenCore:1.7.10-1.0.2.9:dev"
//compile "codechicken:NotEnoughItems:1.7.10-1.0.2.15:dev"
compile "tconstruct:TConstruct:1.7.10-1.8.4.build951:deobf"
compile "boni:IguanaTinkerTweaks:1.7.10-2.1.6.164:deobf"
compile "tic-tooltips:TiCTooltips:mc1.7.10:1.2.5"
compile "cofh:CoFHCore:1.7.10R3.0.4:dev"
compile "cofh:CoFHLib:1.7.10R3.0.3:dev"
provided "com.gregoriust.gregtech:gregtech_1.7.10:5.07.07:dev"
}

minecraft {
Expand All @@ -70,31 +71,31 @@ minecraft {

sourceSets {
main {
output.resourcesDir = 'build/classes/java/main'
output.resourcesDir = 'build/classes/main'
}
}

apply plugin: 'idea'
idea {
module {
outputDir = file('build/classes/java/main')
scopes.PROVIDED.plus += [configurations.provided]
outputDir = file('build/classes/main')
}
}

processResources
{
processResources {
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version

// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'

// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}

// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
Expand Down Expand Up @@ -128,5 +129,4 @@ task makeJars {
makeJars.dependsOn clean, build, deobfJar, apiZip
build.shouldRunAfter clean
deobfJar.shouldRunAfter build
apiZip.shouldRunAfter deobfJar

apiZip.shouldRunAfter deobfJar
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
minecraft.version=1.7.10
forge.version=10.13.4.1614-1.7.10

tgregworks.version=GTNH-1.0.19
tgregworks.version=GTNH-1.0.21

gregtech.version=5.09.33.52
10 changes: 6 additions & 4 deletions src/main/java/vexatos/tgregworks/TGregworks.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@
import tconstruct.TConstruct;
import tconstruct.library.TConstructCreativeTab;
import tconstruct.library.crafting.ModifyBuilder;
import tconstruct.tools.items.Pattern;
import vexatos.tgregworks.integration.TGregRecipeRegistry;
import vexatos.tgregworks.integration.TGregRegistry;
import vexatos.tgregworks.integration.TGregRepairRegistry;
import vexatos.tgregworks.integration.iguanatweakstconstruct.IntegrationITT;
import vexatos.tgregworks.integration.modifiers.ModTGregRepair;
import vexatos.tgregworks.integration.smeltery.CastLegacy;
import vexatos.tgregworks.integration.tictooltips.IntegrationTiCTooltips;
import vexatos.tgregworks.item.ShardPattern;
import vexatos.tgregworks.proxy.CommonProxy;
import vexatos.tgregworks.reference.Config;
import vexatos.tgregworks.reference.Mods;
Expand Down Expand Up @@ -55,7 +57,7 @@ public class TGregworks {
public static TGregRecipeRegistry recipes;
public static TGregRepairRegistry repair;

public static Item shardCast;
public static ShardPattern shardCast;

public static IntegrationTiCTooltips ticTooltips;
public static IntegrationITT iguanatweakstconstruct;
Expand Down Expand Up @@ -98,10 +100,10 @@ public void preInit(FMLPreInitializationEvent event) {
config.setCategoryComment(Config.onMaterial(Config.ArrowMass), "Values between 0.0 and 10000.0 are allowed. Will be directly multiplied with the internally calculated value.");
config.setCategoryComment(Config.onMaterial(Config.ArrowBreakChance), "Values between 0.0 and 10000.0 are allowed. Determines the break chance of arrows.");

shardCast = new Item().setCreativeTab(tab).setUnlocalizedName("tgregworks.shardcast").setTextureName("tgregworks:cast_shard")
.setMaxDamage(0).setHasSubtypes(false).setMaxStackSize(1);
shardCast = new ShardPattern(tab);
shardCast.setCreativeTab(tab).setUnlocalizedName("tgregworks.shardcast").setTextureName("tgregworks:cast_shard").setMaxDamage(0).setHasSubtypes(false).setMaxStackSize(1);
GameRegistry.registerItem(shardCast, "tgregworks.shardcast");

//shardCast = new Item().setCreativeTab(tab).setUnlocalizedName("tgregworks.shardcast").setTextureName("tgregworks:cast_shard").setMaxDamage(0).setHasSubtypes(false).setMaxStackSize(1);
if(!TConstruct.pulsar.isPulseLoaded("Tinkers' Smeltery")) {
CastLegacy.preInit();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void registerToolParts() {
for(Materials m : toolMaterials) {
toolMaterialNames.add(m.mDefaultLocalName);
int matID = getMaterialID(m);
TConstructRegistry.addToolMaterial(matID, m.name(), m.mLocalizedName, m.mToolQuality,
TConstructRegistry.addToolMaterial(matID, m.name(), m.mDefaultLocalName, m.mToolQuality,
(int) (m.mDurability * getGlobalMultiplier(Config.Durability) * getMultiplier(m, Config.Durability)), // Durability
(int) (m.mToolSpeed * 100F * getGlobalMultiplier(Config.MiningSpeed) * getMultiplier(m, Config.MiningSpeed)), // Mining speed
(int) (m.mToolQuality * getGlobalMultiplier(Config.Attack) * getMultiplier(m, Config.Attack)), // Attack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import tconstruct.library.crafting.ToolBuilder;
import tconstruct.library.crafting.ToolRecipe;
import tconstruct.library.modifier.ItemModifier;
import tconstruct.library.tools.DualMaterialToolPart;
import tconstruct.library.tools.ToolCore;
import tconstruct.library.util.IToolPart;
import tconstruct.tools.TinkerTools;
Expand Down Expand Up @@ -53,7 +54,7 @@ protected boolean canModify(ItemStack itemStack, ItemStack[] parts) {
}

// check if any of the tools parts contain stone. we have to prevent exchanging that with disabled stone tools
// because otherwise the replacement-logic would not be able to obtain neccessary information and crash.
// because otherwise the replacement-logic would not be able to obtain necessary information and crash.
if(Config.disableStoneTools) {
if(tool.getHeadItem() != null && getToolPartMaterial(tags, HEAD) == 1) {
return false;
Expand Down Expand Up @@ -154,6 +155,7 @@ protected boolean canModify(ItemStack itemStack, ItemStack[] parts) {
}

// do we have enough modifiers left if we exchange this part?
// This probably doesn't work right for bolts (which replace two parts at a time).
if(hasExtraModifier(oldMatId)) // paper or thaumium. sadly hardcoded.
{
modifiers--;
Expand All @@ -166,8 +168,20 @@ protected boolean canModify(ItemStack itemStack, ItemStack[] parts) {
}

// is it the same material as the one we want to replace?
return newMatId != oldMatId;
if (newMatId == oldMatId) {
// Special case for bolts, which have two materials.
if (tool == TinkerWeaponry.boltAmmo && replacementPartItem instanceof DualMaterialToolPart) {
int newHeadMatId =
((DualMaterialToolPart) replacementPartItem).getMaterialID2(parts[partIndex]);
int oldHeadMatId = getToolPartMaterial(tags, HEAD);

return newHeadMatId != oldHeadMatId;
}

return false;
}

return true;
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/vexatos/tgregworks/item/ItemTGregPart.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public String getItemStackDisplayName(ItemStack stack) {
if(!data.hasKey("material") || Materials.get(data.getString("material")) == Materials._NULL) {
matName = StatCollector.translateToLocal("tgregworks.materials.unknown");
} else {
matName = Materials.get(data.getString("material")).mLocalizedName;
matName = Materials.get(data.getString("material")).mDefaultLocalName;
}

String name = StatCollector.translateToLocal("tgregworks.toolpart." + type.getPartName().replace(" ", "_").toLowerCase());
Expand Down Expand Up @@ -151,7 +151,7 @@ public void onUpdate(ItemStack stack, World world, Entity entity, int par4, bool
Materials m = Materials.get(data.getString("material"));
if(m != null) {
Integer matID = TGregworks.registry.matIDs.get(m);
if(matID != stack.getItemDamage()) {
if(matID != null && matID != stack.getItemDamage()) {
stack.setItemDamage(matID);
}
}
Expand Down
37 changes: 37 additions & 0 deletions src/main/java/vexatos/tgregworks/item/ShardPattern.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package vexatos.tgregworks.item;

import mantle.items.abstracts.CraftingItem;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import tconstruct.library.crafting.PatternBuilder;
import tconstruct.library.util.IPattern;

public class ShardPattern extends CraftingItem implements IPattern
{
public ShardPattern(CreativeTabs tab) {
this(getPatternNames(), getPatternNames(), "", "tgregworks", tab);
}
public ShardPattern(String[] names, String[] tex, String folder, String modTexturePrefix, CreativeTabs tab)
{
super(names, tex, folder, modTexturePrefix, tab);
}

protected static String[] getPatternNames ()
{
String[] names = new String[1];
names[0] = "cast_shard";
return names;
}

@Override
public int getPatternCost(ItemStack pattern)
{
return 1;
}

@Override
public ItemStack getPatternOutput(ItemStack pattern, ItemStack input, PatternBuilder.MaterialSet set)
{
return null;
}
}
1 change: 1 addition & 0 deletions src/main/resources/assets/tgregworks/lang/de_DE.lang
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
itemGroup.tabTGregworks=Tinkers' Gregworks

item.tgregworks.shardcast.name=Shard Cast
item.tgregworks.shardcast.cast_shard.name=Shard Cast
1 change: 1 addition & 0 deletions src/main/resources/assets/tgregworks/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
itemGroup.tabTGregworks=Tinkers' Gregworks

item.tgregworks.shardcast.name=Shard Cast
item.tgregworks.shardcast.cast_shard.name=Shard Cast

tgregworks.toolpart.pickaxe_head=%%material Pickaxe Head
tgregworks.toolpart.shovel_head=%%material Shovel Head
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/tgregworks/lang/fr_FR.lang
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
itemGroup.tabTGregworks=Tinkers' Gregworks

item.tgregworks.shardcast.name=Moule d'éclat
item.tgregworks.shardcast.cast_shard.name=Moule d'éclat
65 changes: 33 additions & 32 deletions src/main/resources/assets/tgregworks/lang/zh_CN.lang
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
# English lang file
itemGroup.tabTGregworks=Tinkers' Gregworks
# Chinese lang file
itemGroup.tabTGregworks=匠魂|GT材料

item.tgregworks.shardcast.name=碎片铸模
item.tgregworks.shardcast.cast_shard.name=碎片铸件
item.tgregworks.shardcast.name=碎片铸件

tgregworks.toolpart.pickaxe_head=%%material镐头
tgregworks.toolpart.shovel_head=%%material铲头
tgregworks.toolpart.axe_head=%%material斧刃
tgregworks.toolpart.tool_binding=%%material绑定结
tgregworks.toolpart.tough_binding=%%material坚韧绑定结
tgregworks.toolpart.tool_rod=%%material手柄
tgregworks.toolpart.tough_tool_rod=%%material坚韧手柄
tgregworks.toolpart.large_plate=%%material大板
tgregworks.toolpart.sword_blade=%%material剑刃
tgregworks.toolpart.wide_guard=%%material宽护手
tgregworks.toolpart.hand_guard=%%material护手
tgregworks.toolpart.crossbar=%%material十字柄
tgregworks.toolpart.knife_blade=%%material刀刃
tgregworks.toolpart.full_guard=%%material大型护手
tgregworks.toolpart.pan=%%material盘
tgregworks.toolpart.sign_head=%%material牌板
tgregworks.toolpart.chisel_head=%%material凿刃
tgregworks.toolpart.scythe_head=%%material镰刀刀刃
tgregworks.toolpart.broad_axe_head=%%material宽斧刃
tgregworks.toolpart.excavator_head=%%material开掘铲头
tgregworks.toolpart.large_sword_blade=%%material大剑刃
tgregworks.toolpart.hammer_head=%%material锤头
tgregworks.toolpart.shard=%%material碎片
tgregworks.toolpart.arrow_head=%%material箭头
tgregworks.toolpart.shuriken=%%material回旋镖
tgregworks.toolpart.crossbow_limb=%%material弩臂
tgregworks.toolpart.crossbow_body=%%material弩身
tgregworks.toolpart.bow_limb=%%material弓臂
tgregworks.toolpart.pickaxe_head=%%material 镐头
tgregworks.toolpart.shovel_head=%%material 铲头
tgregworks.toolpart.axe_head=%%material 斧刃
tgregworks.toolpart.tool_binding=%%material 绑定结
tgregworks.toolpart.tough_binding=%%material 坚韧绑定结
tgregworks.toolpart.tool_rod=%%material 手柄
tgregworks.toolpart.tough_tool_rod=%%material 坚韧手柄
tgregworks.toolpart.large_plate=%%material 大板
tgregworks.toolpart.sword_blade=%%material 剑刃
tgregworks.toolpart.wide_guard=%%material 宽护手
tgregworks.toolpart.hand_guard=%%material 护手
tgregworks.toolpart.crossbar=%%material 十字柄
tgregworks.toolpart.knife_blade=%%material 刀刃
tgregworks.toolpart.full_guard=%%material 大型护手
tgregworks.toolpart.pan=%%material 盘
tgregworks.toolpart.sign_head=%%material 牌板
tgregworks.toolpart.chisel_head=%%material 凿刃
tgregworks.toolpart.scythe_head=%%material 镰刀刀刃
tgregworks.toolpart.broad_axe_head=%%material 宽斧刃
tgregworks.toolpart.excavator_head=%%material 开掘铲头
tgregworks.toolpart.large_sword_blade=%%material 宽剑刃
tgregworks.toolpart.hammer_head=%%material 锤头
tgregworks.toolpart.shard=%%material 碎片
tgregworks.toolpart.arrow_head=%%material 箭头
tgregworks.toolpart.shuriken=%%material 回旋镖
tgregworks.toolpart.crossbow_limb=%%material 弩臂
tgregworks.toolpart.crossbow_body=%%material 弩身
tgregworks.toolpart.bow_limb=%%material 弓壁

tgregworks.tool.deprecated= (损坏的)
tgregworks.tool.deprecated= (不推荐使用)

tgregworks.materials.unknown=未知