This commit is contained in:
modmuss50 2017-06-11 21:22:07 +01:00
parent b6cf2a2c59
commit 29cf9fa90b
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
68 changed files with 220 additions and 222 deletions

View file

@ -1,5 +1,5 @@
minecraftVersion="1.11.2,1.11"
name="TechReborn-1.11.2"
minecraftVersion="1.12"
name="TechReborn-1.12"
curseID="233564"
child-project="reborncore"
child-type="requiredLibrary"

View file

@ -18,7 +18,7 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
classpath "gradle.plugin.net.minecrell:licenser:0.2.1"
}
}
@ -81,7 +81,7 @@ configurations {
compile.extendsFrom shade
}
version = "2.3.3"
version = "2.4.0"
def ENV = System.getenv()
if (ENV.BUILD_NUMBER) {
@ -89,7 +89,7 @@ if (ENV.BUILD_NUMBER) {
}
minecraft {
version = "1.11.2-13.20.0.2311"
version = "1.12-14.21.0.2321"
mappings = "snapshot_20161220"
replace "@MODVERSION@", project.version
// makeObfSourceJar = false
@ -107,10 +107,10 @@ group = 'TechReborn'
dependencies {
deobfCompile('RebornCore:RebornCore-1.11.2:+:universal') {
deobfCompile('RebornCore:RebornCore-1.12:+:universal') {
transitive = false
}
deobfCompile "mezz.jei:jei_1.11.2:+"
deobfCompile "mezz.jei:jei_1.12:+"
compile "mcp.mobius.waila:Hwyla:+"
compile "net.darkhax.tesla:Tesla:1.11-1.3.0.51:deobf"

View file

@ -52,7 +52,7 @@ import techreborn.compat.CompatManager;
import techreborn.compat.ICompatModule;
import techreborn.config.ConfigTechReborn;
import techreborn.dispenser.BehaviorDispenseScrapbox;
import techreborn.entitys.EntityNukePrimed;
import techreborn.entities.EntityNukePrimed;
import techreborn.events.BlockBreakHandler;
import techreborn.events.OreUnifier;
import techreborn.events.TRTickHandler;
@ -69,7 +69,7 @@ import techreborn.world.VeinWorldGenerator;
import java.io.File;
@Mod(modid = ModInfo.MOD_ID, name = ModInfo.MOD_NAME, version = ModInfo.MOD_VERSION, dependencies = ModInfo.MOD_DEPENDENCIES, guiFactory = ModInfo.GUI_FACTORY_CLASS, acceptedMinecraftVersions = "[1.11]", certificateFingerprint = "8727a3141c8ec7f173b87aa78b9b9807867c4e6b")
@Mod(modid = ModInfo.MOD_ID, name = ModInfo.MOD_NAME, version = ModInfo.MOD_VERSION, dependencies = ModInfo.MOD_DEPENDENCIES, guiFactory = ModInfo.GUI_FACTORY_CLASS, acceptedMinecraftVersions = "[1.12]", certificateFingerprint = "8727a3141c8ec7f173b87aa78b9b9807867c4e6b")
public class Core {
public static ConfigTechReborn config;

View file

@ -29,12 +29,16 @@ import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.item.crafting.ShapedRecipes;
import net.minecraft.item.crafting.ShapelessRecipes;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import org.apache.commons.lang3.Validate;
import reborncore.common.util.CraftingHelper;
import java.util.ArrayList;
import java.util.HashMap;
@ -43,27 +47,27 @@ import java.util.List;
public class RollingMachineRecipe {
public static final RollingMachineRecipe instance = new RollingMachineRecipe();
private final List<IRecipe> recipes = new ArrayList<>();
private final HashMap<ResourceLocation, IRecipe> recipes = new HashMap<>();
public void addShapedOreRecipe(ItemStack outputItemStack, Object... objectInputs) {
Validate.notNull(outputItemStack);
Validate.notNull(outputItemStack.getItem());
if (objectInputs.length == 0) {
Validate.notNull(null); //Quick way to crash
}
recipes.add(new ShapedOreRecipe(outputItemStack, objectInputs));
public void addShapedOreRecipe(ResourceLocation resourceLocation, ItemStack outputItemStack, Object... objectInputs) {
// Validate.notNull(outputItemStack);
// Validate.notNull(outputItemStack.getItem());
// if (objectInputs.length == 0) {
// Validate.notNull(null); //Quick way to crash
// }
// recipes.put(resourceLocation, new ShapedOreRecipe(resourceLocation, outputItemStack, objectInputs));
}
public void addShapelessOreRecipe(ItemStack outputItemStack, Object... objectInputs) {
Validate.notNull(outputItemStack);
Validate.notNull(outputItemStack.getItem());
if (objectInputs.length == 0) {
Validate.notNull(null); //Quick way to crash
}
recipes.add(new ShapelessOreRecipe(outputItemStack, objectInputs));
public void addShapelessOreRecipe(ResourceLocation resourceLocation, ItemStack outputItemStack, Object... objectInputs) {
// Validate.notNull(outputItemStack);
// Validate.notNull(outputItemStack.getItem());
// if (objectInputs.length == 0) {
// Validate.notNull(null); //Quick way to crash
// }
// recipes.put(resourceLocation, new ShapelessOreRecipe(resourceLocation, outputItemStack, objectInputs));
}
public void addRecipe(ItemStack output, Object... components) {
public void addRecipe(ResourceLocation resourceLocation, ItemStack output, Object... components) {
String s = "";
int i = 0;
int j = 0;
@ -98,39 +102,25 @@ public class RollingMachineRecipe {
hashmap.put(character, itemstack1);
}
ItemStack recipeArray[] = new ItemStack[j * k];
NonNullList<Ingredient> recipeArray = NonNullList.create();
for (int i1 = 0; i1 < j * k; i1++) {
char c = s.charAt(i1);
if (hashmap.containsKey(c)) {
recipeArray[i1] = ((ItemStack) hashmap.get(c)).copy();
recipeArray.set(i1, CraftingHelper.toIngredient(((ItemStack) hashmap.get(c)).copy()));
} else {
recipeArray[i1] = null;
recipeArray.set(i1, CraftingHelper.toIngredient(ItemStack.EMPTY));
}
}
recipes.add(new ShapedRecipes(j, k, recipeArray, output));
recipes.put(resourceLocation, new ShapedRecipes("", j, k, recipeArray, output));
}
public void addShapelessRecipe(ItemStack output, Object... components) {
List<ItemStack> ingredients = new ArrayList<>();
public void addShapelessRecipe(ResourceLocation resourceLocation,ItemStack output, Object... components) {
NonNullList<Ingredient> ingredients = NonNullList.create();
for (int j = 0; j < components.length; j++) {
Object obj = components[j];
if (obj instanceof ItemStack) {
ingredients.add(((ItemStack) obj).copy());
continue;
ingredients.add(CraftingHelper.toIngredient(components[j]));
}
if (obj instanceof Item) {
ingredients.add(new ItemStack((Item) obj));
continue;
}
if (obj instanceof Block) {
ingredients.add(new ItemStack((Block) obj));
} else {
throw new RuntimeException("Invalid shapeless recipe!");
}
}
recipes.add(new ShapelessRecipes(output, ingredients));
recipes.put(resourceLocation, new ShapelessRecipes("", output, ingredients));
}
public ItemStack findMatchingRecipe(InventoryCrafting inv, World world) {
@ -144,7 +134,7 @@ public class RollingMachineRecipe {
return null;
}
public List<IRecipe> getRecipeList() {
public HashMap<ResourceLocation, IRecipe> getRecipeList() {
return recipes;
}

View file

@ -27,6 +27,7 @@ package techreborn.api;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import techreborn.api.recipe.IRecipeCompact;
public final class TechRebornAPI {
@ -38,20 +39,20 @@ public final class TechRebornAPI {
public static ISubItemRetriever subItemRetriever;
public static void addRollingOreMachinceRecipe(ItemStack output, Object... components) {
RollingMachineRecipe.instance.addShapedOreRecipe(output, components);
public static void addRollingOreMachinceRecipe(ResourceLocation resourceLocation, ItemStack output, Object... components) {
RollingMachineRecipe.instance.addShapedOreRecipe(resourceLocation, output, components);
}
public static void addShapelessOreRollingMachinceRecipe(ItemStack output, Object... components) {
RollingMachineRecipe.instance.addShapelessOreRecipe(output, components);
public static void addShapelessOreRollingMachinceRecipe(ResourceLocation resourceLocation, ItemStack output, Object... components) {
RollingMachineRecipe.instance.addShapelessOreRecipe(resourceLocation,output, components);
}
public static void addRollingMachinceRecipe(ItemStack output, Object... components) {
RollingMachineRecipe.instance.addRecipe(output, components);
public static void addRollingMachinceRecipe(ResourceLocation resourceLocation, ItemStack output, Object... components) {
RollingMachineRecipe.instance.addRecipe(resourceLocation,output, components);
}
public static void addShapelessRollingMachinceRecipe(ItemStack output, Object... components) {
RollingMachineRecipe.instance.addShapelessRecipe(output, components);
public static void addShapelessRollingMachinceRecipe(ResourceLocation resourceLocation, ItemStack output, Object... components) {
RollingMachineRecipe.instance.addShapelessRecipe(resourceLocation,output, components);
}
/**

View file

@ -82,10 +82,6 @@ public class BlockFlare extends BlockContainer {
}
}
public MapColor getMapColor(IBlockState state) {
return (state.getValue(COLOR)).getMapColor();
}
public IBlockState getStateFromMeta(int meta) {
return this.getDefaultState().withProperty(COLOR, EnumDyeColor.byMetadata(meta));
}

View file

@ -105,9 +105,9 @@ public class BlockMachineCasing extends BlockMultiblockBase {
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs creativeTabs, NonNullList<ItemStack> list) {
public void getSubBlocks(CreativeTabs creativeTabs, NonNullList<ItemStack> list) {
for (int meta = 0; meta < types.length; meta++) {
list.add(new ItemStack(item, 1, meta));
list.add(new ItemStack(this, 1, meta));
}
}

View file

@ -69,9 +69,9 @@ public class BlockMachineFrame extends BaseBlock {
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs creativeTabs, NonNullList<ItemStack> list) {
public void getSubBlocks(CreativeTabs creativeTabs, NonNullList<ItemStack> list) {
for (int meta = 0; meta < types.length; meta++) {
list.add(new ItemStack(item, 1, meta));
list.add(new ItemStack(this, 1, meta));
}
}

View file

@ -42,7 +42,7 @@ import net.minecraft.world.World;
import reborncore.RebornCore;
import reborncore.common.BaseBlock;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.entitys.EntityNukePrimed;
import techreborn.entities.EntityNukePrimed;
/**
* Created by Mark on 13/03/2016.

View file

@ -174,9 +174,9 @@ public class BlockOre extends Block implements IOreNameProvider {
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs creativeTabs, NonNullList<ItemStack> list) {
public void getSubBlocks(CreativeTabs creativeTabs, NonNullList<ItemStack> list) {
for (int meta = 0; meta < ores.length; meta++) {
list.add(new ItemStack(item, 1, meta));
list.add(new ItemStack(this, 1, meta));
}
}

View file

@ -98,9 +98,9 @@ public class BlockOre2 extends Block implements IOreNameProvider {
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs creativeTabs, NonNullList<ItemStack> list) {
public void getSubBlocks(CreativeTabs creativeTabs, NonNullList<ItemStack> list) {
for (int meta = 0; meta < ores.length; meta++) {
list.add(new ItemStack(item, 1, meta));
list.add(new ItemStack(this, 1, meta));
}
}

View file

@ -78,9 +78,9 @@ public class BlockPlayerDetector extends BlockMachineBase implements ITexturedBl
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs creativeTabs, NonNullList<ItemStack> list) {
public void getSubBlocks(CreativeTabs creativeTabs, NonNullList<ItemStack> list) {
for (int meta = 0; meta < types.length; meta++) {
list.add(new ItemStack(item, 1, meta));
list.add(new ItemStack(this, 1, meta));
}
}

View file

@ -63,7 +63,7 @@ public class BlockRubberSapling extends BlockSapling {
}
@Override
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list) {
list.add(new ItemStack(itemIn, 1, 0));
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
list.add(new ItemStack(this, 1, 0));
}
}

View file

@ -76,9 +76,9 @@ public class BlockStorage extends BaseBlock implements ITexturedBlock {
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs creativeTabs, NonNullList list) {
public void getSubBlocks(CreativeTabs creativeTabs, NonNullList list) {
for (int meta = 0; meta < types.length; meta++) {
list.add(new ItemStack(item, 1, meta));
list.add(new ItemStack(this, 1, meta));
}
}

View file

@ -74,9 +74,9 @@ public class BlockStorage2 extends BaseBlock implements ITexturedBlock {
@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs creativeTabs, NonNullList list) {
public void getSubBlocks(CreativeTabs creativeTabs, NonNullList list) {
for (int meta = 0; meta < types.length; meta++) {
list.add(new ItemStack(item, 1, meta));
list.add(new ItemStack(this, 1, meta));
}
}

View file

@ -107,7 +107,7 @@ public class BlockCable extends BlockContainer {
}
@Override
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list) {
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> list) {
for(EnumCableType cableType : EnumCableType.values()){
list.add(new ItemStack(this, 1, cableType.ordinal()));
}

View file

@ -25,6 +25,7 @@
package techreborn.blocks.generator;
import net.minecraft.block.material.Material;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@ -73,7 +74,7 @@ public class BlockDragonEggSiphoner extends BlockMachineBase implements IAdvance
}
@Override
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
tooltip.add(TextFormatting.RED + "WIP Coming Soon");
//TODO Finish Dragon Egg Siphoner and add recipe
//Remember to remove WIP override and imports once complete

View file

@ -25,6 +25,7 @@
package techreborn.blocks.generator;
import net.minecraft.block.material.Material;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@ -73,7 +74,7 @@ public class BlockHeatGenerator extends BlockMachineBase implements IAdvancedRot
}
@Override
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
tooltip.add(TextFormatting.RED + "WIP Coming Soon");
//TODO Finish Heat Generator and add recipe + texture
//Remember to remove WIP override and imports once complete

View file

@ -25,6 +25,7 @@
package techreborn.blocks.machine;
import net.minecraft.block.material.Material;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@ -91,7 +92,7 @@ public class BlockScrapboxinator extends BlockMachineBase implements IRotationTe
}
@Override
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
tooltip.add(TextFormatting.RED + "WIP Coming Soon");
//TODO Finish Scrapboxinator and add recipe
//Remember to remove WIP override and imports once complete

View file

@ -112,7 +112,7 @@ public class ContainerLESU extends RebornContainer {
} else if (id == 4) {
this.euStorage = value;
}
this.euStorage = ((connectedBlocks + 1) * ConfigTechReborn.LesuStoragePerBlock);
this.euStorage = ((connectedBlocks + 1) * TileLesu.storagePerBlock);
}
}

View file

@ -67,9 +67,4 @@ public class GuiButtonHologram extends GuiButton {
public void drawButtonForegroundLayer(int mouseX, int mouseY) {
}
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
}
}

View file

@ -62,9 +62,4 @@ public class GuiButtonPowerBar extends GuiButton {
public void drawButtonForegroundLayer(int mouseX, int mouseY) {
}
@Override
public void drawButton(Minecraft mc, int mouseX, int mouseY) {
}
}

View file

@ -33,7 +33,7 @@ import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import techreborn.blocks.BlockNuke;
import techreborn.entitys.EntityNukePrimed;
import techreborn.entities.EntityNukePrimed;
import techreborn.init.ModBlocks;
/**
@ -63,7 +63,7 @@ public class RenderNukePrimed extends Render<EntityNukePrimed> {
this.bindEntityTexture(entity);
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(ModBlocks.NUKE.getDefaultState(),
entity.getBrightness(partialTicks));
entity.getBrightness());
GlStateManager.translate(0.0F, 0.0F, 1.0F);
if (entity.fuse / 5 % 2 == 0) {
GlStateManager.disableLighting();

View file

@ -30,6 +30,7 @@ import minetweaker.api.item.IItemStack;
import minetweaker.api.oredict.IOreDictEntry;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.ResourceLocation;
import reborncore.common.util.ItemUtils;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
@ -38,29 +39,34 @@ import techreborn.api.TechRebornAPI;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ZenClass("mods.techreborn.rollingMachine")
public class CTRollingMachine {
@ZenMethod
public static void addShaped(IItemStack output, IIngredient[][] ingredients) {
TechRebornAPI.addRollingOreMachinceRecipe(toStack(output), toShapedObjects(ingredients));
}
@ZenMethod
public static void addShapeless(IItemStack output, IIngredient[] ingredients) {
TechRebornAPI.addShapelessOreRollingMachinceRecipe(toStack(output), toObjects(ingredients));
}
//TODO 1.12 Crafttweaker
// @ZenMethod
// public static void addShaped(IItemStack output, IIngredient[][] ingredients) {
// TechRebornAPI.addRollingOreMachinceRecipe(toStack(output), toShapedObjects(ingredients));
// }
// @ZenMethod
// public static void addShapeless(IItemStack output, IIngredient[] ingredients) {
// TechRebornAPI.addShapelessOreRollingMachinceRecipe(toStack(output), toObjects(ingredients));
// }
@ZenMethod
public static void removeRecipe(IItemStack output) {
List<IRecipe> toRemove = new ArrayList<>();
for (IRecipe recipe : RollingMachineRecipe.instance.getRecipeList()) {
if (ItemUtils.isItemEqual(recipe.getRecipeOutput(), CraftTweakerCompat.toStack(output), true, false)) {
toRemove.add(recipe);
List<ResourceLocation> toRemove = new ArrayList<>();
for (Map.Entry<ResourceLocation, IRecipe> recipe : RollingMachineRecipe.instance.getRecipeList().entrySet()) {
if (ItemUtils.isItemEqual(recipe.getValue().getRecipeOutput(), CraftTweakerCompat.toStack(output), true, false)) {
toRemove.add(recipe.getKey());
}
}
RollingMachineRecipe.instance.getRecipeList().removeAll(toRemove);
for(ResourceLocation resourceLocation : toRemove){
RollingMachineRecipe.instance.getRecipeList().remove(resourceLocation);
}
}
public static ItemStack toStack(IItemStack iStack) {

View file

@ -26,11 +26,13 @@ package techreborn.compat.jei.rollingMachine;
import mezz.jei.api.IJeiHelpers;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.ResourceLocation;
import techreborn.api.RollingMachineRecipe;
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class RollingMachineRecipeMaker {
private RollingMachineRecipeMaker() {
@ -41,8 +43,8 @@ public class RollingMachineRecipeMaker {
@Nonnull
IJeiHelpers jeiHelpers) {
List<Object> recipes = new ArrayList<>();
for (IRecipe recipe : RollingMachineRecipe.instance.getRecipeList()) {
RollingMachineRecipeWrapper recipeWrapper = RollingMachineRecipeWrapper.create(jeiHelpers, recipe);
for (Map.Entry<ResourceLocation, IRecipe> recipe : RollingMachineRecipe.instance.getRecipeList().entrySet()) {
RollingMachineRecipeWrapper recipeWrapper = RollingMachineRecipeWrapper.create(jeiHelpers, recipe.getValue());
if (recipeWrapper != null) {
recipes.add(recipeWrapper);
}

View file

@ -22,7 +22,7 @@
* SOFTWARE.
*/
package techreborn.entitys;
package techreborn.entities;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.MoverType;

View file

@ -87,9 +87,7 @@ public class IndustrialSawmillRecipes extends RecipeMethods {
@Nonnull
public static ItemStack findMatchingRecipe(InventoryCrafting inv) {
IRecipe recipe;
for (int i = 0; i < CraftingManager.getInstance().getRecipeList().size(); i++) {
recipe = CraftingManager.getInstance().getRecipeList().get(i);
for(IRecipe recipe : CraftingManager.field_193380_a){
if (recipe.matches(inv, null)) {
return recipe.getCraftingResult(inv);
}

View file

@ -27,35 +27,37 @@ package techreborn.init.recipes;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import techreborn.api.TechRebornAPI;
import techreborn.lib.ModInfo;
/**
* Created by Prospector
*/
public class RollingMachineRecipes extends RecipeMethods {
public static void init() {
register(getMaterial("cupronickel_heating_coil", 3, Type.PART), "NCN", "C C", "NCN", 'N', "ingotNickel", 'C', "ingotCopper");
register(getMaterial("nichrome_heating_coil", 2, Type.PART), " N ", "NCN", " N ", 'N', "ingotNickel", 'C', "ingotChrome");
register(new ResourceLocation(ModInfo.MOD_ID, "cupronickel_heating_coil"), getMaterial("cupronickel_heating_coil", 3, Type.PART), "NCN", "C C", "NCN", 'N', "ingotNickel", 'C', "ingotCopper");
register(new ResourceLocation(ModInfo.MOD_ID, "nichrome_heating_coil"),getMaterial("nichrome_heating_coil", 2, Type.PART), " N ", "NCN", " N ", 'N', "ingotNickel", 'C', "ingotChrome");
if (oresExist("ingotAluminum")) {
register(getMaterial("kanthal_heating_coil", 3, Type.PART), "RRR", "CAA", "CCA", 'R', "ingotRefinedIron", 'C', "ingotChrome", 'A', "ingotAluminum");
register(new ResourceLocation(ModInfo.MOD_ID, "kanthal_heating_coil"),getMaterial("kanthal_heating_coil", 3, Type.PART), "RRR", "CAA", "CCA", 'R', "ingotRefinedIron", 'C', "ingotChrome", 'A', "ingotAluminum");
}
if (oresExist("ingotAluminium")) {
register(getMaterial("kanthal_heating_coil", 3, Type.PART), "RRR", "CAA", "CCA", 'R', "ingotRefinedIron", 'C', "ingotChrome", 'A', "ingotAluminium");
register(new ResourceLocation(ModInfo.MOD_ID, "kanthal_heating_coil2"),getMaterial("kanthal_heating_coil", 3, Type.PART), "RRR", "CAA", "CCA", 'R', "ingotRefinedIron", 'C', "ingotChrome", 'A', "ingotAluminium");
}
register(getStack(Blocks.RAIL, 24), "I I", "ISI", "I I", 'I', "ingotIron", 'S', "stickWood");
register(getStack(Blocks.GOLDEN_RAIL, 8), "I I", "ISI", "IRI", 'I', "ingotGold", 'S', "stickWood", 'R', "dustRedstone");
register(getStack(Blocks.DETECTOR_RAIL, 8), "I I", "IPI", "IRI", 'I', "ingotIron", 'P', getStack(Blocks.STONE_PRESSURE_PLATE), 'R', "dustRedstone");
register(getStack(Blocks.ACTIVATOR_RAIL, 8), "ISI", "IRI", "ISI", 'I', "ingotIron", 'S', "stickWood", 'R', getStack(Blocks.REDSTONE_TORCH));
register(getStack(Blocks.IRON_BARS, 24), "III", "III", 'I', "ingotIron");
register(getStack(Items.IRON_DOOR, 4), "II ", "II ", "II ", 'I', "ingotIron");
register(getStack(Items.MINECART, 2), "I I", "III", 'I', "ingotIron");
register(getStack(Items.BUCKET, 2), "I I", "I I", " I ", 'I', "ingotIron");
register(getStack(Blocks.TRIPWIRE_HOOK, 4), " I ", " S ", " W ", 'I', "ingotIron", 'S', "stickWood", 'W', "plankWood");
register(getStack(Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE, 2), "II ", 'I', "ingotIron");
register(getStack(Blocks.LIGHT_WEIGHTED_PRESSURE_PLATE, 2), "GG ", 'G', "ingotGold");
register(new ResourceLocation(ModInfo.MOD_ID, "rail"),getStack(Blocks.RAIL, 24), "I I", "ISI", "I I", 'I', "ingotIron", 'S', "stickWood");
register(new ResourceLocation(ModInfo.MOD_ID, "gold_rail"),getStack(Blocks.GOLDEN_RAIL, 8), "I I", "ISI", "IRI", 'I', "ingotGold", 'S', "stickWood", 'R', "dustRedstone");
register(new ResourceLocation(ModInfo.MOD_ID, "detector_rail"),getStack(Blocks.DETECTOR_RAIL, 8), "I I", "IPI", "IRI", 'I', "ingotIron", 'P', getStack(Blocks.STONE_PRESSURE_PLATE), 'R', "dustRedstone");
register(new ResourceLocation(ModInfo.MOD_ID, "activator_rail"),getStack(Blocks.ACTIVATOR_RAIL, 8), "ISI", "IRI", "ISI", 'I', "ingotIron", 'S', "stickWood", 'R', getStack(Blocks.REDSTONE_TORCH));
register(new ResourceLocation(ModInfo.MOD_ID, "iron_bars"),getStack(Blocks.IRON_BARS, 24), "III", "III", 'I', "ingotIron");
register(new ResourceLocation(ModInfo.MOD_ID, "iron_door"),getStack(Items.IRON_DOOR, 4), "II ", "II ", "II ", 'I', "ingotIron");
register(new ResourceLocation(ModInfo.MOD_ID, "minecart"),getStack(Items.MINECART, 2), "I I", "III", 'I', "ingotIron");
register(new ResourceLocation(ModInfo.MOD_ID, "bucket"),getStack(Items.BUCKET, 2), "I I", "I I", " I ", 'I', "ingotIron");
register(new ResourceLocation(ModInfo.MOD_ID, "tripwire_hook"),getStack(Blocks.TRIPWIRE_HOOK, 4), " I ", " S ", " W ", 'I', "ingotIron", 'S', "stickWood", 'W', "plankWood");
register(new ResourceLocation(ModInfo.MOD_ID, "heavy_pressure_plate"),getStack(Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE, 2), "II ", 'I', "ingotIron");
register(new ResourceLocation(ModInfo.MOD_ID, "light_pressure_plate"),getStack(Blocks.LIGHT_WEIGHTED_PRESSURE_PLATE, 2), "GG ", 'G', "ingotGold");
}
static void register(ItemStack output, Object... componentsObjects) {
TechRebornAPI.addRollingOreMachinceRecipe(output, componentsObjects);
static void register(ResourceLocation resourceLocation, ItemStack output, Object... componentsObjects) {
TechRebornAPI.addRollingOreMachinceRecipe(resourceLocation, output, componentsObjects);
}
}

View file

@ -26,6 +26,7 @@ package techreborn.itemblocks;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@ -52,7 +53,7 @@ public class ItemBlockAesu extends ItemBlock {
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
public void addInformation(ItemStack stack, World world, List list, ITooltipFlag flag) {
if (stack != ItemStack.EMPTY && stack.hasTagCompound()) {
if (stack.getTagCompound().getCompoundTag("tileEntity") != null)
list.add(PowerSystem

View file

@ -26,6 +26,7 @@ package techreborn.itemblocks;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
@ -47,7 +48,7 @@ public class ItemBlockDigitalChest extends ItemBlock {
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
public void addInformation(ItemStack stack, World world, List list, ITooltipFlag flag) {
if (stack != ItemStack.EMPTY && stack.hasTagCompound()) {
if (stack.getTagCompound().getCompoundTag("tileEntity") != null)
list.add(stack.getTagCompound().getCompoundTag("tileEntity").getInteger("storedQuantity") + " items");

View file

@ -26,6 +26,7 @@ package techreborn.itemblocks;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
@ -47,7 +48,7 @@ public class ItemBlockQuantumChest extends ItemBlock {
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
public void addInformation(ItemStack stack, World world, List list, ITooltipFlag flag) {
if (stack != ItemStack.EMPTY && stack.hasTagCompound()) {
if (stack.getTagCompound().getCompoundTag("tileEntity") != null)
list.add(stack.getTagCompound().getCompoundTag("tileEntity").getInteger("storedQuantity") + " items");

View file

@ -130,7 +130,7 @@ public class DynamicCell extends Item {
}
@Override
public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> subItems) {
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> subItems) {
subItems.add(getEmptyCell(1));
for (Fluid fluid : FluidRegistry.getRegisteredFluids().values()) {
subItems.add(getCellWithFluid(fluid));

View file

@ -91,10 +91,10 @@ public class ItemDusts extends ItemTRNoDestroy {
// Adds Dusts SubItems To Creative Tab
@Override
public void getSubItems(Item item, CreativeTabs creativeTabs, NonNullList list) {
public void getSubItems(CreativeTabs creativeTabs, NonNullList list) {
for (int meta = 0; meta < types.length; ++meta) {
if (!types[meta].equals(ModItems.META_PLACEHOLDER)) {
list.add(new ItemStack(item, 1, meta));
list.add(new ItemStack(this, 1, meta));
}
}
}

View file

@ -79,10 +79,11 @@ public class ItemIngots extends ItemTRNoDestroy {
}
// Adds Dusts SubItems To Creative Tab
public void getSubItems(Item item, CreativeTabs creativeTabs, NonNullList list) {
@Override
public void getSubItems(CreativeTabs creativeTabs, NonNullList list) {
for (int meta = 0; meta < types.length; ++meta) {
if (!types[meta].equals(ModItems.META_PLACEHOLDER)) {
list.add(new ItemStack(item, 1, meta));
list.add(new ItemStack(this, 1, meta));
}
}
}

View file

@ -74,10 +74,10 @@ public class ItemNuggets extends ItemTRNoDestroy {
// Adds Dusts SubItems To Creative Tab
@Override
public void getSubItems(Item item, CreativeTabs creativeTabs, NonNullList list) {
public void getSubItems(CreativeTabs creativeTabs, NonNullList list) {
for (int meta = 0; meta < types.length; ++meta) {
if (!types[meta].equals(ModItems.META_PLACEHOLDER)) {
list.add(new ItemStack(item, 1, meta));
list.add(new ItemStack(this, 1, meta));
}
}
}

View file

@ -98,10 +98,10 @@ public class ItemParts extends ItemTRNoDestroy {
// Adds Dusts SubItems To Creative Tab
@Override
public void getSubItems(final Item item, final CreativeTabs creativeTabs, final NonNullList list) {
public void getSubItems(final CreativeTabs creativeTabs, final NonNullList list) {
for (int meta = 0; meta < ItemParts.types.length; ++meta) {
if (!ItemParts.types[meta].equals(ModItems.META_PLACEHOLDER)) {
list.add(new ItemStack(item, 1, meta));
list.add(new ItemStack(this, 1, meta));
}
}
}

View file

@ -25,6 +25,7 @@
package techreborn.items;
import net.minecraft.client.Minecraft;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
@ -34,6 +35,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.NonNullList;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.CapabilityItemHandler;
@ -94,15 +96,15 @@ public class ItemUpgrades extends ItemTRNoDestroy implements IUpgrade {
// Adds Dusts SubItems To Creative Tab
@Override
public void getSubItems(Item item, CreativeTabs creativeTabs, NonNullList list) {
public void getSubItems(CreativeTabs creativeTabs, NonNullList list) {
for (int meta = 0; meta < types.length; ++meta) {
list.add(new ItemStack(item, 1, meta));
list.add(new ItemStack(this, 1, meta));
}
}
@Override
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
super.addInformation(stack, playerIn, tooltip, advanced);
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
super.addInformation(stack, world, tooltip, flag);
if(stack.getItemDamage() == 4 || stack.getItemDamage() == 5){
tooltip.add("Facing: " + getFacing(stack).getName());
String text = Core.proxy.getUpgradeConfigText();

View file

@ -106,7 +106,8 @@ public class ItemLithiumBatpack extends ItemArmor implements IEnergyItemInfo {
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
@Override
public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack uncharged = new ItemStack(ModItems.LITHIUM_BATTERY_PACK);
ItemStack charged = new ItemStack(ModItems.LITHIUM_BATTERY_PACK);

View file

@ -41,8 +41,8 @@ public class ItemEnergyCrystal extends ItemBattery {
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
CreativeTabs par2CreativeTabs, NonNullList itemList) {
@Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack stack = new ItemStack(ModItems.ENERGY_CRYSTAL);
ItemStack uncharged = stack.copy();
ItemStack charged = stack.copy();

View file

@ -41,7 +41,8 @@ public class ItemLapotronCrystal extends ItemBattery {
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
@Override
public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack stack = new ItemStack(ModItems.LAPOTRONIC_CRYSTAL);
ItemStack uncharged = stack.copy();

View file

@ -42,7 +42,8 @@ public class ItemLapotronicOrb extends ItemBattery {
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
@Override
public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack stack = new ItemStack(ModItems.LAPOTRONIC_ORB);
ItemStack uncharged = stack.copy();

View file

@ -41,7 +41,8 @@ public class ItemLithiumBattery extends ItemBattery {
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
@Override
public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack stack = new ItemStack(ModItems.LITHIUM_BATTERY);
ItemStack uncharged = stack.copy();

View file

@ -41,7 +41,8 @@ public class ItemReBattery extends ItemBattery {
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
@Override
public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack stack = new ItemStack(ModItems.RE_BATTERY);
ItemStack uncharged = stack.copy();

View file

@ -46,7 +46,8 @@ public class ItemAdvancedChainsaw extends ItemChainsaw {
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
@Override
public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack stack = new ItemStack(ModItems.ADVANCED_CHAINSAW);
ItemStack uncharged = stack.copy();

View file

@ -58,8 +58,8 @@ public class ItemAdvancedDrill extends ItemDrill {
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
CreativeTabs par2CreativeTabs, NonNullList itemList) {
@Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack stack = new ItemStack(ModItems.ADVANCED_DRILL);
ItemStack uncharged = stack.copy();
ItemStack charged = stack.copy();

View file

@ -45,7 +45,8 @@ public class ItemAdvancedJackhammer extends ItemJackhammer {
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
@Override
public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack stack = new ItemStack(ModItems.ADVANCED_JACKHAMMER);
ItemStack uncharged = stack.copy();

View file

@ -105,7 +105,8 @@ public class ItemCloakingDevice extends ItemTRNoDestroy implements IEnergyItemIn
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
@Override
public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack uncharged = new ItemStack(ModItems.CLOAKING_DEVICE);
ItemStack charged = new ItemStack(ModItems.CLOAKING_DEVICE);

View file

@ -46,7 +46,8 @@ public class ItemDiamondChainsaw extends ItemChainsaw {
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
@Override
public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack stack = new ItemStack(ModItems.DIAMOND_CHAINSAW);
ItemStack uncharged = stack.copy();

View file

@ -46,7 +46,8 @@ public class ItemDiamondDrill extends ItemDrill {
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
@Override
public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack stack = new ItemStack(ModItems.DIAMOND_DRILL);
ItemStack uncharged = stack.copy();

View file

@ -45,8 +45,8 @@ public class ItemDiamondJackhammer extends ItemJackhammer {
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
CreativeTabs par2CreativeTabs, NonNullList itemList) {
@Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack stack = new ItemStack(ModItems.DIAMOND_JACKHAMMER);
ItemStack uncharged = stack.copy();
ItemStack charged = stack.copy();

View file

@ -101,8 +101,8 @@ public class ItemElectricTreetap extends ItemTRNoDestroy implements IEnergyItemI
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
CreativeTabs par2CreativeTabs, NonNullList itemList) {
@Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack uncharged = new ItemStack(ModItems.ELECTRIC_TREE_TAP);
ItemStack charged = new ItemStack(ModItems.ELECTRIC_TREE_TAP);
PoweredItem.setEnergy(getMaxPower(charged), charged);

View file

@ -34,6 +34,7 @@ import net.minecraft.init.Enchantments;
import net.minecraft.item.Item;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
@ -128,7 +129,8 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo {
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
@Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {
ItemStack itemStack = new ItemStack(this, 1);
itemList.add(itemStack);
@ -136,5 +138,4 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo {
PoweredItem.setEnergy(getMaxPower(charged), charged);
itemList.add(charged);
}
}

View file

@ -88,7 +88,7 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
ItemStack stack) {
Multimap<String, AttributeModifier> multimap = HashMultimap.<String, AttributeModifier>create();
int modifier = 0;
if (!stack.isEmpty() && stack.getTagCompound().getBoolean("isActive"))
if (!stack.isEmpty() && stack.getTagCompound() != null && stack.getTagCompound().getBoolean("isActive"))
modifier = 9;
if (slot == EntityEquipmentSlot.MAINHAND) {
@ -113,7 +113,8 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
@Override
public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack inactiveUncharged = new ItemStack(ModItems.NANOSABER);
inactiveUncharged.setTagCompound(new NBTTagCompound());

View file

@ -25,6 +25,7 @@
package techreborn.items.tools;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@ -143,7 +144,8 @@ public class ItemOmniTool extends ItemPickaxe implements IEnergyItemInfo {
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
@Override
public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack uncharged = new ItemStack(ModItems.OMNI_TOOL);
ItemStack charged = new ItemStack(ModItems.OMNI_TOOL);
@ -155,7 +157,7 @@ public class ItemOmniTool extends ItemPickaxe implements IEnergyItemInfo {
@Override
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
tooltip.add(TextFormatting.RED + "WIP Coming Soon");
}
}

View file

@ -141,7 +141,8 @@ public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo {
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
@Override
public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack uncharged = new ItemStack(ModItems.ROCK_CUTTER);
ItemStack charged = new ItemStack(ModItems.ROCK_CUTTER);

View file

@ -46,7 +46,8 @@ public class ItemSteelChainsaw extends ItemChainsaw {
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
@Override
public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack stack = new ItemStack(ModItems.STEEL_CHAINSAW);
ItemStack uncharged = stack.copy();

View file

@ -46,7 +46,8 @@ public class ItemSteelDrill extends ItemDrill {
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
@Override
public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack stack = new ItemStack(ModItems.STEEL_DRILL);
ItemStack uncharged = stack.copy();

View file

@ -45,7 +45,8 @@ public class ItemSteelJackhammer extends ItemJackhammer {
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
public void getSubItems(Item item,
@Override
public void getSubItems(
CreativeTabs par2CreativeTabs, NonNullList itemList) {
ItemStack stack = new ItemStack(ModItems.STEEL_JACKHAMMER);
ItemStack uncharged = stack.copy();

View file

@ -24,6 +24,7 @@
package techreborn.items.tools;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
@ -57,7 +58,7 @@ public class ItemTechManual extends ItemTRNoDestroy {
}
@Override
public void addInformation(final ItemStack stack, final EntityPlayer playerIn, final List<String> tooltip, final boolean advanced) {
public void addInformation(final ItemStack stack, final World world, final List<String> tooltip, ITooltipFlag flag) {
tooltip.add(TextFormatting.RED + I18n.translateToLocal("tooltip.wip"));
}
}

View file

@ -24,6 +24,7 @@
package techreborn.manual.pages;
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
@ -34,8 +35,10 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.*;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.oredict.OreDictionary;
@ -213,10 +216,10 @@ public class CraftingInfoPage extends TitledPage {
protected void drawItemStackTooltip(ItemStack stack, int x, int y) {
final Minecraft mc = Minecraft.getMinecraft();
FontRenderer font = Objects.firstNonNull(stack.getItem().getFontRenderer(stack), mc.fontRendererObj);
FontRenderer font = MoreObjects.firstNonNull(stack.getItem().getFontRenderer(stack), mc.fontRendererObj);
@SuppressWarnings("unchecked")
List<String> list = stack.getTooltip(mc.player, mc.gameSettings.advancedItemTooltips);
List<String> list = stack.getTooltip(mc.player, mc.gameSettings.advancedItemTooltips ? ITooltipFlag.TooltipFlags.ADVANCED : ITooltipFlag.TooltipFlags.NORMAL);
List<String> colored = Lists.newArrayListWithCapacity(list.size());
colored.add(stack.getRarity().rarityColor + list.get(0));
@ -259,7 +262,7 @@ public class CraftingInfoPage extends TitledPage {
@SuppressWarnings("unchecked")
private ItemStack[] getFirstRecipeForItem(ItemStack resultingItem) {
ItemStack[] recipeItems = new ItemStack[9];
for (IRecipe recipe : CraftingManager.getInstance().getRecipeList()) {
for (IRecipe recipe : CraftingManager.field_193380_a) {
if (recipe == null)
continue;
@ -267,12 +270,12 @@ public class CraftingInfoPage extends TitledPage {
if (result == ItemStack.EMPTY || !result.isItemEqual(resultingItem))
continue;
Object[] input = getRecipeInput(recipe);
if (input == null)
NonNullList<Ingredient> input = recipe.func_192400_c();
if (input.isEmpty())
continue;
for (int i = 0; i < input.length; i++)
recipeItems[i] = convertToStack(input[i]);
for (int i = 0; i < input.size(); i++)
recipeItems[i] = convertToStack(input.get(i));
break;
}
@ -291,18 +294,10 @@ public class CraftingInfoPage extends TitledPage {
return recipeItems;
}
protected ItemStack convertToStack(Object obj) {
ItemStack entry = null;
if (obj instanceof ItemStack) {
entry = (ItemStack) obj;
} else if (obj instanceof List) {
@SuppressWarnings("unchecked")
List<ItemStack> list = (List<ItemStack>) obj;
if (list.size() > 0)
entry = list.get(0);
}
if (entry == null)
protected ItemStack convertToStack(Ingredient ingredient) {
ItemStack entry = ItemStack.EMPTY;
entry = ingredient.func_193365_a()[0];
if (entry == null || entry.isEmpty())
return null;
entry = entry.copy();
if (entry.getItemDamage() == OreDictionary.WILDCARD_VALUE)
@ -310,31 +305,18 @@ public class CraftingInfoPage extends TitledPage {
return entry;
}
@SuppressWarnings("unchecked")
private Object[] getRecipeInput(IRecipe recipe) {
if (recipe instanceof ShapelessOreRecipe)
return ((ShapelessOreRecipe) recipe).getInput().toArray();
else if (recipe instanceof ShapedOreRecipe)
return getShapedOreRecipe((ShapedOreRecipe) recipe);
else if (recipe instanceof ShapedRecipes)
return ((ShapedRecipes) recipe).recipeItems;
else if (recipe instanceof ShapelessRecipes)
return ((ShapelessRecipes) recipe).recipeItems.toArray(new ItemStack[0]);
return null;
}
private Object[] getShapedOreRecipe(ShapedOreRecipe recipe) {
try {
Field field = ShapedOreRecipe.class.getDeclaredField("width");
if (field != null) {
field.setAccessible(true);
int width = field.getInt(recipe);
Object[] input = recipe.getInput();
NonNullList<Ingredient> input = recipe.func_192400_c();
Object[] grid = new Object[9];
for (int i = 0, offset = 0, y = 0; y < 3; y++) {
for (int x = 0; x < 3; x++, i++) {
if (x < width && offset < input.length) {
grid[i] = input[offset];
if (x < width && offset < input.size()) {
grid[i] = input.get(offset);
offset++;
} else {
grid[i] = null;

View file

@ -37,7 +37,7 @@ public class GuiButtonAHeight extends GuiButton {
}
@Override
public void drawButton(Minecraft minecraft, int mouseX, int mouseY) {
public void func_191745_a(Minecraft minecraft, int mouseX, int mouseY, float ticks) {
if (this.visible) {
FontRenderer fontrenderer = minecraft.fontRendererObj;
minecraft.getTextureManager().bindTexture(BUTTON_TEXTURES);

View file

@ -45,7 +45,7 @@ public class GuiButtonTextOnly extends GuiButton {
}
@Override
public void drawButton(Minecraft minecraft, int mouseX, int mouseY) {
public void func_191745_a(Minecraft minecraft, int mouseX, int mouseY, float partialTicks) {
if (this.visible) {
FontRenderer fontrenderer = minecraft.fontRendererObj;
minecraft.getTextureManager().bindTexture(BUTTON_TEXTURES);

View file

@ -26,6 +26,7 @@ package techreborn.parts.powerCables;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@ -87,9 +88,9 @@ public class ItemCables extends ItemMultiPart implements ITexturedItem {
}
@Override
public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> subItems) {
public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> subItems) {
for (int meta = 0; meta < EnumCableType.values().length; ++meta) {
subItems.add(new ItemStack(itemIn, 1, meta));
subItems.add(new ItemStack(this, 1, meta));
}
}
@ -110,7 +111,7 @@ public class ItemCables extends ItemMultiPart implements ITexturedItem {
}
@Override
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
EnumCableType type = EnumCableType.values()[stack.getItemDamage()];
tooltip.add(TextFormatting.GRAY + I18n.translateToLocal("desc.transfer") + " " + TextFormatting.GOLD + PowerSystem.getLocaliszedPowerFormatted(type.transferRate));
tooltip.add(TextFormatting.GRAY + I18n.translateToLocal("desc.tier") + " " + TextFormatting.GOLD + StringUtils.toFirstCapitalAllLowercase(type.tier.toString()));

View file

@ -24,11 +24,13 @@
package techreborn.parts.powerCables;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import reborncore.RebornCore;
import techreborn.client.TechRebornCreativeTab;
import techreborn.items.ItemTextureBase;
@ -103,7 +105,7 @@ public class ItemStandaloneCables extends ItemTextureBase {
// }
@Override
public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
EnumStandaloneCableType type = EnumStandaloneCableType.values()[stack.getItemDamage()];
tooltip.add(TextFormatting.GREEN + "EU Transfer: " + TextFormatting.LIGHT_PURPLE + type.transferRate);
if (type.canKill) {

View file

@ -36,7 +36,6 @@ import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.client.model.ModelLoader;
@ -63,7 +62,7 @@ import techreborn.client.gui.GuiBase;
import techreborn.client.keybindings.KeyBindings;
import techreborn.client.render.ModelDynamicCell;
import techreborn.client.render.entitys.RenderNukePrimed;
import techreborn.entitys.EntityNukePrimed;
import techreborn.entities.EntityNukePrimed;
import techreborn.init.ModBlocks;
import techreborn.items.ItemFrequencyTransmitter;
import techreborn.lib.ModInfo;

View file

@ -24,6 +24,7 @@
package techreborn.world;
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.collect.Sets;
import net.minecraft.world.World;
@ -100,6 +101,6 @@ public class TechRebornRetroGen {
@Override
public String toString() {
return Objects.toStringHelper(this).add("chunksToRetroGen", chunksToRetroGen).toString();
return MoreObjects.toStringHelper(this).add("chunksToRetroGen", chunksToRetroGen).toString();
}
}

View file

@ -34,8 +34,8 @@ import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.IChunkGenerator;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.IChunkGenerator;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.fml.common.IWorldGenerator;

View file

@ -28,8 +28,8 @@ import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkGenerator;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.IChunkGenerator;
import net.minecraftforge.fml.common.IWorldGenerator;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;