Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9de1f3fc5b | ||
|
|
7052b44fcb | ||
|
|
e9bbecd0a3 | ||
|
|
a95f5578fb | ||
|
|
ccff65a05e | ||
|
|
be88258061 |
6 changed files with 131 additions and 11 deletions
7
.gitignore
vendored
7
.gitignore
vendored
|
|
@ -1,5 +1,12 @@
|
||||||
.gradle
|
.gradle
|
||||||
/build/
|
/build/
|
||||||
|
/run/
|
||||||
|
/out/
|
||||||
|
*.DS_STORE
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
*.launch
|
||||||
|
*.iws
|
||||||
|
|
||||||
# Ignore Gradle GUI config
|
# Ignore Gradle GUI config
|
||||||
gradle-app.setting
|
gradle-app.setting
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ repositories {
|
||||||
|
|
||||||
version = mod_version
|
version = mod_version
|
||||||
group= "com.oitsjustjose.tinkers_addons"
|
group= "com.oitsjustjose.tinkers_addons"
|
||||||
archivesBaseName = "Tinkers' Addons-1.10.x"
|
archivesBaseName = "Tinkers' Addons-${minecraft_version}"
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
version = "${minecraft_version}-${forge_version}"
|
version = "${minecraft_version}-${forge_version}"
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,6 @@
|
||||||
|
1.0.6:
|
||||||
|
* Fixed: Recipes being NBT insensitive.
|
||||||
|
|
||||||
1.0.5:
|
1.0.5:
|
||||||
* Added: Modifier Item Tooltips
|
* Added: Modifier Item Tooltips
|
||||||
* Changed: New Textures!!
|
* Changed: New Textures!!
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
mod_version=1.0.5
|
mod_version=1.0.6
|
||||||
minecraft_version=1.10.2
|
minecraft_version=1.10.2
|
||||||
forge_version=12.18.2.2125
|
forge_version=12.18.2.2125
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ public class ModAutoRepair extends Modifier
|
||||||
if (player.dimension == -1)
|
if (player.dimension == -1)
|
||||||
return 10000 + rand;
|
return 10000 + rand;
|
||||||
if (world.canSeeSky(player.getPosition()) && !world.isRaining())
|
if (world.canSeeSky(player.getPosition()) && !world.isRaining())
|
||||||
if (world.getWorldTime() >= 0 && world.getWorldTime() <= 13000)
|
if ((world.getWorldTime() % 24000) >= 0 && (world.getWorldTime() % 24000) <= 13000)
|
||||||
return 12500 + rand;
|
return 12500 + rand;
|
||||||
|
|
||||||
return 15000 + rand;
|
return 15000 + rand;
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,11 @@ import com.oitsjustjose.tinkers_addons.TinkersAddons;
|
||||||
|
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.inventory.InventoryCrafting;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.item.crafting.ShapedRecipes;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
|
||||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||||
import slimeknights.tconstruct.shared.TinkerCommons;
|
import slimeknights.tconstruct.shared.TinkerCommons;
|
||||||
import slimeknights.tconstruct.tools.TinkerMaterials;
|
import slimeknights.tconstruct.tools.TinkerMaterials;
|
||||||
|
|
@ -21,28 +23,136 @@ public class Recipes
|
||||||
|
|
||||||
public void registerBonusModRecipes()
|
public void registerBonusModRecipes()
|
||||||
{
|
{
|
||||||
|
ItemStack plateItem = null;
|
||||||
|
ItemStack centerItem = null;
|
||||||
|
|
||||||
if (TinkersAddons.modConfig.enableAmelioration)
|
if (TinkersAddons.modConfig.enableAmelioration)
|
||||||
{
|
{
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(TinkersAddons.modItems.materials, 1, 0), new Object[] { new ItemStack(TinkerCommons.materials, 1, 19), new ItemStack(TinkerCommons.materials, 1, 19), new ItemStack(TinkerCommons.materials, 1, 19), Items.BOOK }));
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(TinkersAddons.modItems.materials, 1, 0), new Object[] { new ItemStack(TinkerCommons.materials, 1, 19), new ItemStack(TinkerCommons.materials, 1, 19), new ItemStack(TinkerCommons.materials, 1, 19), Items.BOOK }));
|
||||||
}
|
}
|
||||||
if (TinkersAddons.modConfig.enableExtraModifierLvl1)
|
if (TinkersAddons.modConfig.enableExtraModifierLvl1)
|
||||||
{
|
{
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TinkersAddons.modItems.materials, 1, 1), new Object[] { "#S#", "###", '#', TinkerTools.largePlate.getItemstackWithMaterial(TinkerMaterials.iron), 'S', TinkerCommons.blockPigIron }));
|
plateItem = TinkerTools.largePlate.getItemstackWithMaterial(TinkerMaterials.iron);
|
||||||
|
centerItem = TinkerCommons.blockPigIron;
|
||||||
|
GameRegistry.addRecipe(new NBTShapedRecipe(3, 2, new ItemStack[] { plateItem, centerItem, plateItem, plateItem, plateItem, plateItem }, new ItemStack(TinkersAddons.modItems.materials, 1, 1)));
|
||||||
}
|
}
|
||||||
if (TinkersAddons.modConfig.enableExtraModifierLvl2)
|
if (TinkersAddons.modConfig.enableExtraModifierLvl2)
|
||||||
{
|
{
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TinkersAddons.modItems.materials, 1, 2), new Object[] { "#S#", "###", '#', TinkerTools.largePlate.getItemstackWithMaterial(TinkerMaterials.ardite), 'S', Blocks.GOLD_BLOCK }));
|
plateItem = TinkerTools.largePlate.getItemstackWithMaterial(TinkerMaterials.ardite);
|
||||||
|
centerItem = new ItemStack(Blocks.GOLD_BLOCK);
|
||||||
|
GameRegistry.addRecipe(new NBTShapedRecipe(3, 2, new ItemStack[] { plateItem, centerItem, plateItem, plateItem, plateItem, plateItem }, new ItemStack(TinkersAddons.modItems.materials, 1, 2)));
|
||||||
}
|
}
|
||||||
if (TinkersAddons.modConfig.enableExtraModifierLvl3)
|
if (TinkersAddons.modConfig.enableExtraModifierLvl3)
|
||||||
{
|
{
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TinkersAddons.modItems.materials, 1, 3), new Object[] { "#S#", "###", '#', TinkerTools.largePlate.getItemstackWithMaterial(TinkerMaterials.prismarine), 'S', Blocks.DIAMOND_BLOCK }));
|
plateItem = TinkerTools.largePlate.getItemstackWithMaterial(TinkerMaterials.prismarine);
|
||||||
|
centerItem = new ItemStack(Blocks.DIAMOND_BLOCK);
|
||||||
|
GameRegistry.addRecipe(new NBTShapedRecipe(3, 2, new ItemStack[] { plateItem, centerItem, plateItem, plateItem, plateItem, plateItem }, new ItemStack(TinkersAddons.modItems.materials, 1, 3)));
|
||||||
}
|
}
|
||||||
if (TinkersAddons.modConfig.enableExtraModifierLvl4)
|
if (TinkersAddons.modConfig.enableExtraModifierLvl4)
|
||||||
{
|
{
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TinkersAddons.modItems.materials, 1, 4), new Object[] { "#S#", "###", '#', TinkerTools.largePlate.getItemstackWithMaterial(TinkerMaterials.obsidian), 'S', Items.ENDER_PEARL }));
|
plateItem = TinkerTools.largePlate.getItemstackWithMaterial(TinkerMaterials.obsidian);
|
||||||
|
centerItem = new ItemStack(Items.ENDER_PEARL);
|
||||||
|
GameRegistry.addRecipe(new NBTShapedRecipe(3, 2, new ItemStack[] { plateItem, centerItem, plateItem, plateItem, plateItem, plateItem }, new ItemStack(TinkersAddons.modItems.materials, 1, 4)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author BloodWorkXGaming : https://github.com/BloodWorkXGaming
|
||||||
|
*
|
||||||
|
* An inner class for adding NBT-Sensitive recipes. All credit to BloodWorkXGaming for finding and fixing this bug for me. ORIGINAL CLASS: https://github.com/AllTheMods/OreExcavationIntegration/blob/master/src/main/java/atm/bloodworkxgaming/oei/Crafting/NBTShapedRecipe.java
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class NBTShapedRecipe extends ShapedRecipes
|
||||||
|
{
|
||||||
|
|
||||||
|
public NBTShapedRecipe(int width, int height, ItemStack[] IngredientArray, ItemStack output)
|
||||||
|
{
|
||||||
|
super(width, height, IngredientArray, output);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to check if a recipe matches current crafting inventory
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean matches(InventoryCrafting inv, World worldIn)
|
||||||
|
{
|
||||||
|
for (int i = 0; i <= 3 - this.recipeWidth; ++i)
|
||||||
|
{
|
||||||
|
for (int j = 0; j <= 3 - this.recipeHeight; ++j)
|
||||||
|
{
|
||||||
|
if (this.checkMatch(inv, i, j, true))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.checkMatch(inv, i, j, false))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the region of a crafting inventory is match for the recipe.
|
||||||
|
*/
|
||||||
|
private boolean checkMatch(InventoryCrafting inventoryCrafting, int horizontal, int vertical, boolean p_77573_4_)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 3; ++i)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < 3; ++j)
|
||||||
|
{
|
||||||
|
int k = i - horizontal;
|
||||||
|
int l = j - vertical;
|
||||||
|
ItemStack itemStackRecipe = null;
|
||||||
|
|
||||||
|
if (k >= 0 && l >= 0 && k < this.recipeWidth && l < this.recipeHeight)
|
||||||
|
{
|
||||||
|
if (p_77573_4_)
|
||||||
|
{
|
||||||
|
itemStackRecipe = this.recipeItems[this.recipeWidth - k - 1 + l * this.recipeWidth];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
itemStackRecipe = this.recipeItems[k + l * this.recipeWidth];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemStack input = inventoryCrafting.getStackInRowAndColumn(i, j);
|
||||||
|
|
||||||
|
if (input != null || itemStackRecipe != null)
|
||||||
|
{
|
||||||
|
if ((input == null) != (itemStackRecipe == null))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemStackRecipe.getItem() != input.getItem())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemStackRecipe.getMetadata() != 32767 && itemStackRecipe.getMetadata() != input.getMetadata())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemStackRecipe.hasTagCompound() && input.hasTagCompound())
|
||||||
|
{
|
||||||
|
if (!itemStackRecipe.getTagCompound().equals(input.getTagCompound()))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Loading…
Reference in a new issue