Begin the Great Refactor of Mid-2017

This commit is contained in:
Prospector 2017-06-13 16:49:52 -07:00
parent a4a4042eb1
commit 1fa9f1cf52
97 changed files with 328 additions and 1713 deletions

View file

@ -24,24 +24,21 @@
package techreborn.items;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;
import reborncore.RebornCore;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTabMisc;
public class ItemDestructopack extends ItemTextureBase implements ITexturedItem {
public class ItemDestructopack extends ItemTR {
public ItemDestructopack() {
this.setUnlocalizedName("techreborn.destructopack");
this.setCreativeTab(TechRebornCreativeTabMisc.instance);
RebornCore.jsonDestroyer.registerObject(this);
}
@Override
@ -51,14 +48,4 @@ public class ItemDestructopack extends ItemTextureBase implements ITexturedItem
(int) player.posY);
return new ActionResult<>(EnumActionResult.SUCCESS, player.getHeldItem(hand));
}
@Override
public int getMaxMeta() {
return 1;
}
@Override
public String getTextureName(final int arg0) {
return "techreborn:items/misc/destructopack";
}
}

View file

@ -34,7 +34,7 @@ import techreborn.init.ModItems;
import java.security.InvalidParameterException;
public class ItemDusts extends ItemTRNoDestroy {
public class ItemDusts extends ItemTR {
public static final String[] types = new String[] { "almandine", "aluminum", "andradite", "ashes", "basalt",
"bauxite", "brass", "bronze", "calcite", "charcoal", "chrome", "cinnabar", "clay", "coal", "copper",
"dark_ashes", "diamond", "electrum", "emerald", "ender_eye", "ender_pearl", "endstone", "flint", "galena",

View file

@ -33,7 +33,7 @@ import techreborn.init.ModItems;
import java.security.InvalidParameterException;
public class ItemDustsSmall extends ItemTRNoDestroy {
public class ItemDustsSmall extends ItemTR {
public static final String[] types = new String[] { "almandine", "aluminum", "andradite", "ashes", "basalt",
"bauxite", "brass", "bronze", "calcite", "charcoal", "chrome", "cinnabar", "clay", "coal", "copper",

View file

@ -48,7 +48,7 @@ import techreborn.lib.MessageIDs;
import javax.annotation.Nullable;
import java.util.List;
public class ItemFrequencyTransmitter extends ItemTRNoDestroy {
public class ItemFrequencyTransmitter extends ItemTR {
public ItemFrequencyTransmitter() {
setUnlocalizedName("techreborn.frequencyTransmitter");

View file

@ -33,7 +33,7 @@ import techreborn.init.ModItems;
import java.security.InvalidParameterException;
public class ItemGems extends ItemTRNoDestroy {
public class ItemGems extends ItemTR {
public static final String[] types = new String[] { "ruby", "sapphire", "peridot", "red_garnet", "yellow_garnet" };

View file

@ -34,7 +34,7 @@ import techreborn.init.ModItems;
import java.security.InvalidParameterException;
public class ItemIngots extends ItemTRNoDestroy {
public class ItemIngots extends ItemTR {
public static final String[] types = new String[] { "aluminum", "brass", "bronze", "chrome", "copper", "electrum",
"invar", "iridium", "lead", "nickel", "platinum", "silver", "steel", "tin", "titanium", "tungsten",
"hot_tungstensteel", "tungstensteel", "zinc", "refined_iron", "advanced_alloy", "mixed_metal",
@ -80,7 +80,7 @@ public class ItemIngots extends ItemTRNoDestroy {
// Adds Dusts SubItems To Creative Tab
@Override
public void getSubItems(CreativeTabs creativeTabs, NonNullList list) {
if(!isInCreativeTab(creativeTabs)){
if (!isInCreativeTab(creativeTabs)) {
return;
}
for (int meta = 0; meta < types.length; ++meta) {

View file

@ -24,22 +24,11 @@
package techreborn.items;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import techreborn.client.TechRebornCreativeTabMisc;
public class ItemMissingRecipe extends ItemTextureBase implements ITexturedItem {
public class ItemMissingRecipe extends ItemTR {
public ItemMissingRecipe() {
setCreativeTab(TechRebornCreativeTabMisc.instance);
setUnlocalizedName("techreborn.missingrecipe");
}
@Override
public String getTextureName(int damage) {
return "techreborn:items/misc/missing_recipe";
}
@Override
public int getMaxMeta() {
return 1;
}
}

View file

@ -33,7 +33,7 @@ import techreborn.init.ModItems;
import java.security.InvalidParameterException;
public class ItemNuggets extends ItemTRNoDestroy {
public class ItemNuggets extends ItemTR {
public static final String[] types = new String[] { "aluminum", "brass", "bronze", "chrome", "copper", "electrum",
"invar", "iridium", "lead", "nickel", "platinum", "silver", "steel", "tin", "titanium", "tungsten",

View file

@ -37,7 +37,7 @@ import techreborn.init.ModItems;
import java.security.InvalidParameterException;
public class ItemParts extends ItemTRNoDestroy {
public class ItemParts extends ItemTR {
public static final String[] types = new String[] { "energy_flow_circuit", "data_control_circuit", "data_storage_circuit",
"data_orb", "diamond_grinding_head", "diamond_saw_blade", "tungsten_grinding_head", "helium_coolant_simple",
"helium_coolant_triple", "helium_coolant_six", "nak_coolant_simple", "nak_coolant_triple", "nak_coolant_six",

View file

@ -34,7 +34,7 @@ import techreborn.init.ModItems;
import java.security.InvalidParameterException;
public class ItemPlates extends ItemTRNoDestroy {
public class ItemPlates extends ItemTR {
//Vanilla plates or plates not from ingots or gems
public static String[] types = new String[] {

View file

@ -31,16 +31,14 @@ import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.world.World;
import reborncore.RebornCore;
import techreborn.api.ScrapboxList;
import techreborn.client.TechRebornCreativeTabMisc;
public class ItemScrapBox extends ItemTRNoDestroy {
public class ItemScrapBox extends ItemTR {
public ItemScrapBox() {
setUnlocalizedName("techreborn.scrapbox");
setCreativeTab(TechRebornCreativeTabMisc.instance);
RebornCore.jsonDestroyer.registerObject(this);
}
@Override

View file

@ -33,7 +33,6 @@ public class ItemTR extends Item {
public ItemTR() {
setNoRepair();
setCreativeTab(TechRebornCreativeTab.instance);
RebornCore.jsonDestroyer.registerObject(this);
}
}

View file

@ -1,37 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2017 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.items;
import net.minecraft.item.Item;
import techreborn.client.TechRebornCreativeTab;
public class ItemTRNoDestroy extends Item {
public ItemTRNoDestroy() {
setNoRepair();
setCreativeTab(TechRebornCreativeTab.instance);
}
}

View file

@ -1,39 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2017 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.items;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import techreborn.lib.ModInfo;
public abstract class ItemTextureBase extends ItemTR implements ITexturedItem {
@Override
public ModelResourceLocation getModel(ItemStack stack, EntityPlayer player, int useRemaining) {
return new ModelResourceLocation(ModInfo.MOD_ID + ":" + getUnlocalizedName(stack).substring(5).toLowerCase(), "inventory");
}
}

View file

@ -26,7 +26,7 @@ package techreborn.items;
import techreborn.client.TechRebornCreativeTabMisc;
public class ItemUUmatter extends ItemTRNoDestroy {
public class ItemUUmatter extends ItemTR {
public ItemUUmatter() {
setCreativeTab(TechRebornCreativeTabMisc.instance);

View file

@ -58,7 +58,7 @@ import javax.annotation.Nullable;
import java.security.InvalidParameterException;
import java.util.List;
public class ItemUpgrades extends ItemTRNoDestroy implements IUpgrade {
public class ItemUpgrades extends ItemTR implements IUpgrade {
public static final String[] types = new String[] { "overclock", "transformer", "energy_storage", "range", "ejection", "injection" };

View file

@ -33,11 +33,11 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.api.power.IEnergyItemInfo;
import reborncore.common.powerSystem.PoweredItem;
import techreborn.items.ItemTRNoDestroy;
import techreborn.items.ItemTR;
import javax.annotation.Nullable;
public class ItemBattery extends ItemTRNoDestroy implements IEnergyItemInfo {
public class ItemBattery extends ItemTR implements IEnergyItemInfo {
String name;
int maxEnergy = 0;

View file

@ -40,11 +40,11 @@ import reborncore.common.registration.impl.ConfigRegistry;
import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn;
import techreborn.init.ModItems;
import techreborn.items.ItemTRNoDestroy;
import techreborn.items.ItemTR;
import techreborn.lib.ModInfo;
@RebornRegistry(modID = ModInfo.MOD_ID)
public class ItemCloakingDevice extends ItemTRNoDestroy implements IEnergyItemInfo {
public class ItemCloakingDevice extends ItemTR implements IEnergyItemInfo {
@ConfigRegistry(config = "items", category = "cloacking_device", key = "ClockingDeviceEnergyUsage", comment = "Cloacking device energy usesage (Value in EU)")
public static int usage = 10;

View file

@ -36,12 +36,12 @@ import net.minecraft.world.World;
import reborncore.api.power.IEnergyInterfaceTile;
import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.items.ItemTRNoDestroy;
import techreborn.items.ItemTR;
/**
* Created by Mark on 20/03/2016.
*/
public class ItemDebugTool extends ItemTRNoDestroy {
public class ItemDebugTool extends ItemTR {
public ItemDebugTool() {
setCreativeTab(TechRebornCreativeTabMisc.instance);

View file

@ -43,12 +43,12 @@ import reborncore.common.powerSystem.PoweredItem;
import techreborn.client.TechRebornCreativeTab;
import techreborn.compat.CompatManager;
import techreborn.init.ModItems;
import techreborn.items.ItemTRNoDestroy;
import techreborn.items.ItemTR;
/**
* Created by modmuss50 on 05/11/2016.
*/
public class ItemElectricTreetap extends ItemTRNoDestroy implements IEnergyItemInfo {
public class ItemElectricTreetap extends ItemTR implements IEnergyItemInfo {
public static final int maxCharge = 5120;
public static final int tier = 1;

View file

@ -36,11 +36,11 @@ import net.minecraft.world.World;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.items.ItemTRNoDestroy;
import techreborn.items.ItemTR;
import java.util.List;
public class ItemTechManual extends ItemTRNoDestroy {
public class ItemTechManual extends ItemTR {
public ItemTechManual() {
this.setCreativeTab(TechRebornCreativeTab.instance);

View file

@ -36,9 +36,9 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import techreborn.client.TechRebornCreativeTab;
import techreborn.compat.CompatManager;
import techreborn.items.ItemTRNoDestroy;
import techreborn.items.ItemTR;
public class ItemTreeTap extends ItemTRNoDestroy {
public class ItemTreeTap extends ItemTR {
public ItemTreeTap() {
setMaxStackSize(1);

View file

@ -53,7 +53,7 @@ import techreborn.blocks.storage.BlockEnergyStorage;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.compat.CompatManager;
import techreborn.init.ModSounds;
import techreborn.items.ItemTRNoDestroy;
import techreborn.items.ItemTR;
import techreborn.utils.IC2WrenchHelper;
import java.util.ArrayList;
@ -63,7 +63,7 @@ import java.util.Random;
/**
* Created by modmuss50 on 26/02/2016.
*/
public class ItemWrench extends ItemTRNoDestroy {
public class ItemWrench extends ItemTR {
public ItemWrench() {
setCreativeTab(TechRebornCreativeTabMisc.instance);