Move machine casings over and temp gen localization
This commit is contained in:
parent
c77dc683a1
commit
b4ca82a97b
20 changed files with 987 additions and 570 deletions
|
@ -24,8 +24,10 @@
|
|||
|
||||
package techreborn;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
@ -41,6 +43,7 @@ import net.minecraftforge.fml.common.eventhandler.EventPriority;
|
|||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||
import net.minecraftforge.fml.common.registry.EntityRegistry;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.common.registry.VillagerRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
@ -51,12 +54,12 @@ import reborncore.api.recipe.RecipeHandler;
|
|||
import reborncore.common.multiblock.MultiblockEventHandler;
|
||||
import reborncore.common.multiblock.MultiblockServerTickHandler;
|
||||
import reborncore.common.network.RegisterPacketEvent;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import reborncore.common.util.Torus;
|
||||
import techreborn.api.TechRebornAPI;
|
||||
import techreborn.blocks.cable.EnumCableType;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.command.TechRebornDevCommand;
|
||||
import techreborn.utils.BehaviorDispenseScrapbox;
|
||||
import techreborn.entities.EntityNukePrimed;
|
||||
import techreborn.events.BlockBreakHandler;
|
||||
import techreborn.events.TRRecipeHandler;
|
||||
|
@ -65,6 +68,7 @@ import techreborn.init.*;
|
|||
import techreborn.packets.*;
|
||||
import techreborn.proxies.CommonProxy;
|
||||
import techreborn.tiles.fusionReactor.TileFusionControlComputer;
|
||||
import techreborn.utils.BehaviorDispenseScrapbox;
|
||||
import techreborn.utils.StackWIPHandler;
|
||||
import techreborn.world.OilLakeGenerator;
|
||||
import techreborn.world.TechRebornWorldGen;
|
||||
|
@ -182,6 +186,39 @@ public class TechReborn {
|
|||
// RecipeHandler.scanForDupeRecipes();
|
||||
// RecipeConfigManager.save();
|
||||
//recipeCompact.saveMissingItems(configDir);
|
||||
|
||||
|
||||
//todo: remove, gens localization
|
||||
for (Item item : ForgeRegistries.ITEMS.getValues()) {
|
||||
if (item.getRegistryName().getNamespace().equals("techreborn")) {
|
||||
StringBuilder localName = new StringBuilder();
|
||||
String[] words = item.getRegistryName().getPath().split("_|\\.");
|
||||
for (String word : words) {
|
||||
if (!word.contains("techreborn")) {
|
||||
if (localName.length() > 0) {
|
||||
localName.append(" ");
|
||||
}
|
||||
localName.append(StringUtils.toFirstCapital(word));
|
||||
}
|
||||
}
|
||||
System.out.println("item.techreborn." + item.getRegistryName().getPath() + ".name=" + localName);
|
||||
}
|
||||
}
|
||||
for (Block item : ForgeRegistries.BLOCKS.getValues()) {
|
||||
if (item.getRegistryName().getNamespace().equals("techreborn")) {
|
||||
StringBuilder localName = new StringBuilder();
|
||||
String[] words = item.getRegistryName().getPath().split("_|\\.");
|
||||
for (String word : words) {
|
||||
if (!word.contains("techreborn")) {
|
||||
if (localName.length() > 0) {
|
||||
localName.append(" ");
|
||||
}
|
||||
localName.append(StringUtils.toFirstCapital(word));
|
||||
}
|
||||
}
|
||||
System.out.println("tile.techreborn." + item.getRegistryName().getPath() + ".name=" + localName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
|
|
|
@ -27,146 +27,29 @@ package techreborn.blocks;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.api.ToolManager;
|
||||
import reborncore.client.models.ModelCompound;
|
||||
import reborncore.client.models.RebornModelRegistry;
|
||||
import reborncore.common.RebornCoreConfig;
|
||||
import reborncore.common.blocks.BlockWrenchEventHandler;
|
||||
import reborncore.common.items.WrenchHelper;
|
||||
import reborncore.common.multiblock.BlockMultiblockBase;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.tiles.TileMachineCasing;
|
||||
import techreborn.utils.TechRebornCreativeTab;
|
||||
|
||||
public class BlockMachineCasing extends BlockMultiblockBase {
|
||||
|
||||
// public static final String[] types = new String[] { "standard", "reinforced", "advanced" };
|
||||
// public static final PropertyString TYPE = new PropertyString("type", types);
|
||||
// private static final List<String> typesList = Lists.newArrayList(ArrayUtils.arrayToLowercase(types));
|
||||
public final int heatCapacity;
|
||||
|
||||
public BlockMachineCasing() {
|
||||
public BlockMachineCasing(int heatCapacity) {
|
||||
super(Material.IRON);
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
this.heatCapacity = heatCapacity;
|
||||
setHardness(2F);
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/structure"));
|
||||
BlockWrenchEventHandler.wrenableBlocks.add(this);
|
||||
}
|
||||
|
||||
// public static ItemStack getStackByName(String name, int count) {
|
||||
// name = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name);
|
||||
// for (int i = 0; i < types.length; i++) {
|
||||
// if (types[i].equalsIgnoreCase(name)) {
|
||||
// return new ItemStack(ModBlocks.MACHINE_CASINGS, count, i);
|
||||
// }
|
||||
// }
|
||||
// throw new InvalidParameterException("The machine casing " + name + " could not be found.");
|
||||
// }
|
||||
//
|
||||
// public static ItemStack getStackByName(String name) {
|
||||
// return getStackByName(name, 1);
|
||||
// }
|
||||
|
||||
/**
|
||||
* Provides heat info per casing for Industrial Blast Furnace
|
||||
* @param state IBlockstate Blockstate with Machine casing
|
||||
* @return Integer Heat value for casing
|
||||
*/
|
||||
public int getHeatFromState(IBlockState state) {
|
||||
Block casing = state.getBlock();
|
||||
|
||||
if (casing == null ) {
|
||||
public static int getHeatFromState(IBlockState state) {
|
||||
Block block = state.getBlock();
|
||||
if (!(block instanceof BlockMachineCasing)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (casing == ModBlocks.MACHINE_CASINGS_STANDARD) {
|
||||
return 1020 / 25;
|
||||
}
|
||||
else if (casing == ModBlocks.MACHINE_CASINGS_REINFORCED) {
|
||||
return 1700 / 25;
|
||||
}
|
||||
else if (casing == ModBlocks.MACHINE_CASINGS_ADVANCED) {
|
||||
return 2380 / 25;
|
||||
}
|
||||
return 0;
|
||||
BlockMachineCasing casing = (BlockMachineCasing) block;
|
||||
return casing.heatCapacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
if (RebornCoreConfig.wrenchRequired){
|
||||
Block casing = state.getBlock();
|
||||
if (casing == ModBlocks.MACHINE_CASINGS_REINFORCED) {
|
||||
drops.add(new ItemStack(ModBlocks.MACHINE_BLOCK_ADVANCED));
|
||||
}
|
||||
else if (casing == ModBlocks.MACHINE_CASINGS_ADVANCED) {
|
||||
drops.add(new ItemStack(ModBlocks.MACHINE_BLOCK_ELITE));
|
||||
}
|
||||
else {
|
||||
drops.add(new ItemStack(ModBlocks.MACHINE_BLOCK_BASIC));
|
||||
}
|
||||
}
|
||||
else {
|
||||
super.getDrops(drops, world, pos, state, fortune);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand,
|
||||
EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
ItemStack stack = playerIn.getHeldItem(EnumHand.MAIN_HAND);
|
||||
TileEntity tileEntity = worldIn.getTileEntity(pos);
|
||||
|
||||
// We extended BaseTileBlock. Thus we should always have tile entity. I hope.
|
||||
if (tileEntity == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!stack.isEmpty() && ToolManager.INSTANCE.canHandleTool(stack)) {
|
||||
if (WrenchHelper.handleWrench(stack, worldIn, pos, playerIn, side)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return super.onBlockActivated(worldIn, pos, state, playerIn, hand, side, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public IBlockState getStateFromMeta(int meta) {
|
||||
// if (meta > types.length) {
|
||||
// meta = 0;
|
||||
// }
|
||||
// return getBlockState().getBaseState().withProperty(TYPE, typesList.get(meta));
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getMetaFromState(IBlockState state) {
|
||||
// return typesList.indexOf(state.getValue(TYPE));
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected BlockStateContainer createBlockState() {
|
||||
// return new BlockStateContainer(this, TYPE);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Item getItemDropped(IBlockState state, Random rand, int fortune) {
|
||||
// return Item.getItemFromBlock(this);
|
||||
// }
|
||||
|
||||
//
|
||||
// @Override
|
||||
// public int damageDropped(IBlockState state) {
|
||||
// return getMetaFromState(state);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(final World world, final int meta) {
|
||||
|
|
38
src/main/java/techreborn/blocks/BlockMachineFrame.java
Normal file
38
src/main/java/techreborn/blocks/BlockMachineFrame.java
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 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.blocks;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import reborncore.common.BaseBlock;
|
||||
import techreborn.utils.TechRebornCreativeTab;
|
||||
|
||||
public class BlockMachineFrame extends BaseBlock {
|
||||
|
||||
public BlockMachineFrame() {
|
||||
super(Material.IRON);
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setHardness(1f);
|
||||
}
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 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.blocks;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import reborncore.client.models.ModelCompound;
|
||||
import reborncore.client.models.RebornModelRegistry;
|
||||
import reborncore.common.BaseBlock;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.utils.TechRebornCreativeTab;
|
||||
|
||||
public class BlockMachineFrames extends BaseBlock {
|
||||
// public static final String[] types = new String[] { "basic", "advanced", "highly_advanced" };
|
||||
// public static final PropertyString TYPE = new PropertyString("type", types);
|
||||
// private static final List<String> typesList = Lists.newArrayList(ArrayUtils.arrayToLowercase(types));
|
||||
|
||||
public BlockMachineFrames() {
|
||||
super(Material.IRON);
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setHardness(1f);
|
||||
RebornModelRegistry.registerModel(new ModelCompound(TechReborn.MOD_ID, this, "machines/structure"));
|
||||
}
|
||||
|
||||
// public static ItemStack getFrameByName(String name, int count) {
|
||||
// name = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
|
||||
// if (name.equals("machine")) {
|
||||
// return new ItemStack(ModBlocks.MACHINE_FRAMES, count, 0);
|
||||
// }
|
||||
// if (name.equals("advanced_machine")) {
|
||||
// return new ItemStack(ModBlocks.MACHINE_FRAMES, count, 1);
|
||||
// }
|
||||
// if (name.equals("highly_advanced_machine")) {
|
||||
// return new ItemStack(ModBlocks.MACHINE_FRAMES, count, 2);
|
||||
// }
|
||||
//
|
||||
// for (int i = 0; i < types.length; i++) {
|
||||
// if (types[i].equalsIgnoreCase(name)) {
|
||||
// return new ItemStack(ModBlocks.MACHINE_FRAMES, count, i);
|
||||
// }
|
||||
// }
|
||||
// throw new InvalidParameterException("The part " + name + " could not be found.");
|
||||
// }
|
||||
//
|
||||
// public static ItemStack getFrameByName(String name) {
|
||||
// return getFrameByName(name, 1);
|
||||
// }
|
||||
|
||||
|
||||
// @Override
|
||||
// public int damageDropped(IBlockState state) {
|
||||
// return getMetaFromState(state);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public IBlockState getStateFromMeta(int meta) {
|
||||
// if (meta > types.length) {
|
||||
// meta = 0;
|
||||
// }
|
||||
// return getBlockState().getBaseState().withProperty(TYPE, typesList.get(meta));
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getMetaFromState(IBlockState state) {
|
||||
// return typesList.indexOf(state.getValue(TYPE));
|
||||
// }
|
||||
|
||||
// @Override
|
||||
// protected BlockStateContainer createBlockState() {
|
||||
// return new BlockStateContainer(this, TYPE);
|
||||
// }
|
||||
|
||||
}
|
|
@ -51,7 +51,7 @@ import techreborn.itemblocks.*;
|
|||
* Registers all TR blocks
|
||||
*/
|
||||
public class ModBlocks {
|
||||
|
||||
|
||||
// Misc Blocks
|
||||
public static Block CABLE;
|
||||
public static Block COMPUTER_CUBE;
|
||||
|
@ -74,8 +74,8 @@ public class ModBlocks {
|
|||
public static Block RUBBER_SAPLING;
|
||||
|
||||
// Machines - machines
|
||||
public static Block ALLOY_SMELTER;
|
||||
public static Block ASSEMBLY_MACHINE;
|
||||
public static Block ALLOY_SMELTER;
|
||||
public static Block ASSEMBLY_MACHINE;
|
||||
public static Block AUTO_CRAFTING_TABLE;
|
||||
public static Block CHEMICAL_REACTOR;
|
||||
public static Block COMPRESSOR;
|
||||
|
@ -97,7 +97,7 @@ public class ModBlocks {
|
|||
public static Block ROLLING_MACHINE;
|
||||
public static Block SCRAPBOXINATOR;
|
||||
public static Block VACUUM_FREEZER;
|
||||
|
||||
|
||||
// Machines - generators
|
||||
public static Block CREATIVE_SOLAR_PANEL;
|
||||
public static Block DIESEL_GENERATOR;
|
||||
|
@ -110,10 +110,10 @@ public class ModBlocks {
|
|||
public static Block SEMI_FLUID_GENERATOR;
|
||||
public static Block SOLAR_PANEL;
|
||||
public static Block SOLID_FUEL_GENEREATOR;
|
||||
public static Block THERMAL_GENERATOR;
|
||||
public static Block THERMAL_GENERATOR;
|
||||
public static Block WATER_MILL;
|
||||
public static Block WIND_MILL;
|
||||
|
||||
public static Block WIND_MILL;
|
||||
|
||||
// Machines - storage
|
||||
public static Block CREATIVE_QUANTUM_CHEST;
|
||||
public static Block CREATIVE_QUANTUM_TANK;
|
||||
|
@ -133,7 +133,7 @@ public class ModBlocks {
|
|||
public static Block LV_TRANSFORMER;
|
||||
public static Block MV_TRANSFORMER;
|
||||
public static Block HV_TRANSFORMER;
|
||||
|
||||
|
||||
// Machines - misc
|
||||
public static Block ALARM;
|
||||
public static Block CHUNK_LOADER;
|
||||
|
@ -148,41 +148,23 @@ public class ModBlocks {
|
|||
*/
|
||||
public static void init() {
|
||||
TRContent.registerBlocks();
|
||||
|
||||
|
||||
// Misc. blocks
|
||||
COMPUTER_CUBE = new BlockComputerCube();
|
||||
registerBlock(COMPUTER_CUBE, "computer_cube");
|
||||
|
||||
|
||||
CABLE = new BlockCable();
|
||||
registerBlock(CABLE, ItemBlockCable.class, "cable");
|
||||
|
||||
MACHINE_BLOCK_ADVANCED = new BlockMachineFrames();
|
||||
registerBlock(MACHINE_BLOCK_ADVANCED, "machineBlockAdvanced");
|
||||
|
||||
MACHINE_BLOCK_BASIC = new BlockMachineFrames();
|
||||
registerBlock(MACHINE_BLOCK_BASIC, "machineBlockBasic");
|
||||
|
||||
MACHINE_BLOCK_ELITE = new BlockMachineFrames();
|
||||
registerBlock(MACHINE_BLOCK_ELITE, "machineBlockElite");
|
||||
|
||||
MACHINE_CASINGS_ADVANCED = new BlockMachineCasing();
|
||||
registerBlock(MACHINE_CASINGS_ADVANCED, "machineCasingAdvanced");
|
||||
|
||||
MACHINE_CASINGS_REINFORCED = new BlockMachineCasing();
|
||||
registerBlock(MACHINE_CASINGS_REINFORCED, "machineCasingReinforced");
|
||||
|
||||
MACHINE_CASINGS_STANDARD = new BlockMachineCasing();
|
||||
registerBlock(MACHINE_CASINGS_STANDARD, "machineCasingStandard");
|
||||
|
||||
NUKE = new BlockNuke();
|
||||
registerBlock(NUKE, "nuke");
|
||||
|
||||
|
||||
REFINED_IRON_FENCE = new BlockRefinedIronFence();
|
||||
registerBlock(REFINED_IRON_FENCE, "refined_iron_fence");
|
||||
|
||||
REINFORCED_GLASS = new BlockReinforcedGlass();
|
||||
registerBlock(REINFORCED_GLASS, "reinforced_glass");
|
||||
|
||||
|
||||
RUBBER_LEAVES = new BlockRubberLeaves();
|
||||
registerBlock(RUBBER_LEAVES, "rubber_leaves");
|
||||
|
||||
|
@ -197,120 +179,120 @@ public class ModBlocks {
|
|||
|
||||
RUBBER_LOG_STAIR = new BlockRubberPlankStair(RUBBER_LOG.getDefaultState(), "rubber_plank");
|
||||
registerBlock(RUBBER_LOG_STAIR, "rubber_plank_stair");
|
||||
|
||||
|
||||
RUBBER_PLANKS = new BlockRubberPlank();
|
||||
registerBlock(RUBBER_PLANKS, "rubber_planks");
|
||||
|
||||
RUBBER_SAPLING = new BlockRubberSapling();
|
||||
registerBlock(RUBBER_SAPLING, ItemBlockRubberSapling.class, "rubber_sapling");
|
||||
|
||||
|
||||
// Machines - machines
|
||||
ALLOY_SMELTER = new BlockAlloySmelter();
|
||||
registerBlock(ALLOY_SMELTER, "alloy_smelter");
|
||||
|
||||
|
||||
ASSEMBLY_MACHINE = new BlockAssemblingMachine();
|
||||
registerBlock(ASSEMBLY_MACHINE, "assembly_machine");
|
||||
|
||||
|
||||
AUTO_CRAFTING_TABLE = new BlockAutoCraftingTable();
|
||||
registerBlock(AUTO_CRAFTING_TABLE, "auto_crafting_table");
|
||||
|
||||
|
||||
COMPRESSOR = new BlockCompressor();
|
||||
registerBlock(COMPRESSOR, "compressor");
|
||||
|
||||
|
||||
CHEMICAL_REACTOR = new BlockChemicalReactor();
|
||||
registerBlock(CHEMICAL_REACTOR, "chemical_reactor");
|
||||
|
||||
|
||||
DISTILLATION_TOWER = new BlockDistillationTower();
|
||||
registerBlock(DISTILLATION_TOWER, "distillation_tower");
|
||||
|
||||
|
||||
ELECTRIC_FURNACE = new BlockElectricFurnace();
|
||||
registerBlock(ELECTRIC_FURNACE, "electric_furnace");
|
||||
|
||||
|
||||
EXTRACTOR = new BlockExtractor();
|
||||
registerBlock(EXTRACTOR, "extractor");
|
||||
|
||||
|
||||
FLUID_REPLICATOR = new BlockFluidReplicator();
|
||||
registerBlock(FLUID_REPLICATOR, "fluid_replicator");
|
||||
|
||||
|
||||
GRINDER = new BlockGrinder();
|
||||
registerBlock(GRINDER, "grinder");
|
||||
|
||||
|
||||
IMPLOSION_COMPRESSOR = new BlockImplosionCompressor();
|
||||
registerBlock(IMPLOSION_COMPRESSOR, "implosion_compressor");
|
||||
|
||||
|
||||
INDUSTRIAL_BLAST_FURNACE = new BlockIndustrialBlastFurnace();
|
||||
registerBlock(INDUSTRIAL_BLAST_FURNACE, "industrial_blast_furnace");
|
||||
|
||||
|
||||
INDUSTRIAL_CENTRIFUGE = new BlockIndustrialCentrifuge();
|
||||
registerBlock(INDUSTRIAL_CENTRIFUGE, "industrial_centrifuge");
|
||||
|
||||
|
||||
INDUSTRIAL_ELECTROLYZER = new BlockIndustrialElectrolyzer();
|
||||
registerBlock(INDUSTRIAL_ELECTROLYZER, "industrial_electrolyzer");
|
||||
|
||||
|
||||
INDUSTRIAL_GRINDER = new BlockIndustrialGrinder();
|
||||
registerBlock(INDUSTRIAL_GRINDER, "industrial_grinder");
|
||||
|
||||
|
||||
INDUSTRIAL_SAWMILL = new BlockIndustrialSawmill();
|
||||
registerBlock(INDUSTRIAL_SAWMILL, "industrial_sawmill");
|
||||
|
||||
|
||||
IRON_ALLOY_FURNACE = new BlockIronAlloyFurnace();
|
||||
registerBlock(IRON_ALLOY_FURNACE, "iron_alloy_furnace");
|
||||
|
||||
|
||||
IRON_FURNACE = new BlockIronFurnace();
|
||||
registerBlock(IRON_FURNACE, "iron_furnace");
|
||||
|
||||
|
||||
MATTER_FABRICATOR = new BlockMatterFabricator();
|
||||
registerBlock(MATTER_FABRICATOR, "matter_fabricator");
|
||||
|
||||
|
||||
RECYCLER = new BlockRecycler();
|
||||
registerBlock(RECYCLER, "recycler");
|
||||
|
||||
ROLLING_MACHINE = new BlockRollingMachine();
|
||||
registerBlock(ROLLING_MACHINE, "rolling_machine");
|
||||
|
||||
|
||||
SCRAPBOXINATOR = new BlockScrapboxinator();
|
||||
registerBlock(SCRAPBOXINATOR, "scrapboxinator");
|
||||
|
||||
|
||||
VACUUM_FREEZER = new BlockVacuumFreezer();
|
||||
registerBlock(VACUUM_FREEZER, "vacuum_freezer");
|
||||
|
||||
// Machines - generators
|
||||
CREATIVE_SOLAR_PANEL = new BlockCreativeSolarPanel();
|
||||
registerBlock(CREATIVE_SOLAR_PANEL, "creative_solar_panel");
|
||||
|
||||
|
||||
DIESEL_GENERATOR = new BlockDieselGenerator();
|
||||
registerBlock(DIESEL_GENERATOR, "diesel_generator");
|
||||
|
||||
|
||||
DRAGON_EGG_SYPHON = new BlockDragonEggSyphon();
|
||||
registerBlock(DRAGON_EGG_SYPHON, "dragon_egg_syphon");
|
||||
|
||||
|
||||
FUSION_COIL = new BlockFusionCoil();
|
||||
registerBlock(FUSION_COIL, "fusion_coil");
|
||||
|
||||
|
||||
FUSION_CONTROL_COMPUTER = new BlockFusionControlComputer();
|
||||
registerBlock(FUSION_CONTROL_COMPUTER, "fusion_control_computer");
|
||||
|
||||
|
||||
GAS_TURBINE = new BlockGasTurbine();
|
||||
registerBlock(GAS_TURBINE, "gas_turbine");
|
||||
|
||||
|
||||
LIGHTNING_ROD = new BlockLightningRod();
|
||||
registerBlock(LIGHTNING_ROD, "lightning_rod");
|
||||
|
||||
|
||||
PLASMA_GENERATOR = new BlockPlasmaGenerator();
|
||||
registerBlock(PLASMA_GENERATOR, "plasma_generator");
|
||||
|
||||
|
||||
SEMI_FLUID_GENERATOR = new BlockSemiFluidGenerator();
|
||||
registerBlock(SEMI_FLUID_GENERATOR, "semi_fluid_generator");
|
||||
|
||||
|
||||
SOLAR_PANEL = new BlockSolarPanel();
|
||||
registerBlock(SOLAR_PANEL, ItemBlockSolarPanel.class, "solar_panel");
|
||||
|
||||
|
||||
SOLID_FUEL_GENEREATOR = new BlockSolidFuelGenerator();
|
||||
registerBlock(SOLID_FUEL_GENEREATOR, "solid_fuel_generator");
|
||||
|
||||
|
||||
THERMAL_GENERATOR = new BlockThermalGenerator();
|
||||
registerBlock(THERMAL_GENERATOR, "thermal_generator");
|
||||
|
||||
|
||||
WATER_MILL = new BlockWaterMill();
|
||||
registerBlock(WATER_MILL, "water_mill");
|
||||
|
||||
|
@ -320,26 +302,26 @@ public class ModBlocks {
|
|||
// Machines - storage
|
||||
CREATIVE_QUANTUM_CHEST = new BlockCreativeQuantumChest();
|
||||
registerBlock(CREATIVE_QUANTUM_CHEST, ItemBlockQuantumChest.class, "creative_quantum_chest");
|
||||
|
||||
|
||||
CREATIVE_QUANTUM_TANK = new BlockCreativeQuantumTank();
|
||||
registerBlock(CREATIVE_QUANTUM_TANK, ItemBlockQuantumTank.class, "creative_quantum_tank");
|
||||
|
||||
|
||||
DIGITAL_CHEST = new BlockDigitalChest();
|
||||
registerBlock(DIGITAL_CHEST, ItemBlockDigitalChest.class, "digital_chest");
|
||||
|
||||
|
||||
QUANTUM_CHEST = new BlockQuantumChest();
|
||||
registerBlock(QUANTUM_CHEST, ItemBlockQuantumChest.class, "quantum_chest");
|
||||
|
||||
|
||||
QUANTUM_TANK = new BlockQuantumTank();
|
||||
registerBlock(QUANTUM_TANK, ItemBlockQuantumTank.class, "quantum_tank");
|
||||
|
||||
// Machines - energy storage & transformers
|
||||
ADJUSTABLE_SU = new BlockAdjustableSU();
|
||||
registerBlock(ADJUSTABLE_SU, ItemBlockAdjustableSU.class, "adjustable_su");
|
||||
|
||||
|
||||
CHARGE_O_MAT = new BlockChargeOMat();
|
||||
registerBlock(CHARGE_O_MAT, "charge_o_mat");
|
||||
|
||||
|
||||
INTERDIMENSIONAL_SU = new BlockInterdimensionalSU();
|
||||
registerBlock(INTERDIMENSIONAL_SU, "interdimensional_su");
|
||||
|
||||
|
@ -348,7 +330,7 @@ public class ModBlocks {
|
|||
|
||||
LSU_STORAGE = new BlockLSUStorage();
|
||||
registerBlock(LSU_STORAGE, "lsu_storage");
|
||||
|
||||
|
||||
LOW_VOLTAGE_SU = new BlockLowVoltageSU();
|
||||
registerBlock(LOW_VOLTAGE_SU, "low_voltage_su");
|
||||
|
||||
|
@ -357,7 +339,7 @@ public class ModBlocks {
|
|||
|
||||
HIGH_VOLTAGE_SU = new BlockHighVoltageSU();
|
||||
registerBlock(HIGH_VOLTAGE_SU, "high_voltage_su");
|
||||
|
||||
|
||||
LV_TRANSFORMER = new BlockLVTransformer();
|
||||
registerBlock(LV_TRANSFORMER, "lv_transformer");
|
||||
|
||||
|
@ -365,30 +347,30 @@ public class ModBlocks {
|
|||
registerBlock(MV_TRANSFORMER, "mv_transformer");
|
||||
|
||||
HV_TRANSFORMER = new BlockHVTransformer();
|
||||
registerBlock(HV_TRANSFORMER, "hv_transformer");
|
||||
|
||||
registerBlock(HV_TRANSFORMER, "hv_transformer");
|
||||
|
||||
// Machines - misc
|
||||
ALARM = new BlockAlarm();
|
||||
registerBlock(ALARM, "alarm");
|
||||
|
||||
|
||||
CHUNK_LOADER = new BlockChunkLoader();
|
||||
registerBlock(CHUNK_LOADER, "chunk_loader");
|
||||
|
||||
|
||||
LAMP_INCANDESCENT = new BlockLamp( 14, 4, 0.625, 0.25);
|
||||
registerBlock(LAMP_INCANDESCENT, "lamp_incandescent");
|
||||
|
||||
LAMP_LED = new BlockLamp( 15, 1, 0.0625, 0.125);
|
||||
registerBlock(LAMP_LED, "lamp_led");
|
||||
|
||||
|
||||
MAGICAL_ABSORBER = new BlockMagicEnergyAbsorber();
|
||||
registerBlock(MAGICAL_ABSORBER, "magic_energy_absorber");
|
||||
|
||||
|
||||
MAGIC_ENERGY_CONVERTER = new BlockMagicEnergyConverter();
|
||||
registerBlock(MAGIC_ENERGY_CONVERTER, "magic_energy_converter");
|
||||
|
||||
|
||||
PLAYER_DETECTOR = new BlockPlayerDetector();
|
||||
registerBlock(PLAYER_DETECTOR, ItemBlockPlayerDetector.class, "player_detector");
|
||||
|
||||
registerBlock(PLAYER_DETECTOR, ItemBlockPlayerDetector.class, "player_detector");
|
||||
|
||||
|
||||
|
||||
//TODO enable when done
|
||||
|
|
|
@ -6,6 +6,7 @@ import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
|||
import net.minecraft.client.renderer.block.statemap.DefaultStateMapper;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IItemProvider;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
@ -16,8 +17,11 @@ import reborncore.common.powerSystem.TilePowerAcceptor;
|
|||
import reborncore.common.registration.RebornRegister;
|
||||
import reborncore.common.registration.impl.ConfigRegistry;
|
||||
import techreborn.TechReborn;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.blocks.BlockMachineFrame;
|
||||
import techreborn.blocks.BlockOre;
|
||||
import techreborn.blocks.BlockStorage;
|
||||
import techreborn.blocks.tier1.BlockElectricFurnace;
|
||||
import techreborn.items.ItemUpgrade;
|
||||
import techreborn.utils.InitUtils;
|
||||
|
||||
|
@ -29,16 +33,20 @@ public class TRContent {
|
|||
public static void registerBlocks() {
|
||||
Arrays.stream(Ores.values()).forEach(value -> RebornRegistry.registerBlock(value.block));
|
||||
Arrays.stream(StorageBlocks.values()).forEach(value -> RebornRegistry.registerBlock(value.block));
|
||||
Arrays.stream(MachineBlocks.values()).forEach(value -> {
|
||||
RebornRegistry.registerBlock(value.frame);
|
||||
RebornRegistry.registerBlock(value.casing);
|
||||
});
|
||||
}
|
||||
|
||||
public static void registerItems() {
|
||||
Arrays.stream(Dusts.values()).forEach(value -> RebornRegistry.registerItem(value.item));
|
||||
Arrays.stream(SmallDusts.values()).forEach(value -> RebornRegistry.registerItem(value.item));
|
||||
Arrays.stream(Gems.values()).forEach(value -> RebornRegistry.registerItem(value.item));
|
||||
Arrays.stream(Ingots.values()).forEach(value -> RebornRegistry.registerItem(value.item));
|
||||
Arrays.stream(Nuggets.values()).forEach(value -> RebornRegistry.registerItem(value.item));
|
||||
Arrays.stream(Parts.values()).forEach(value -> RebornRegistry.registerItem(value.item));
|
||||
Arrays.stream(Gems.values()).forEach(value -> RebornRegistry.registerItem(value.item));
|
||||
Arrays.stream(Dusts.values()).forEach(value -> RebornRegistry.registerItem(value.item));
|
||||
Arrays.stream(SmallDusts.values()).forEach(value -> RebornRegistry.registerItem(value.item));
|
||||
Arrays.stream(Plates.values()).forEach(value -> RebornRegistry.registerItem(value.item));
|
||||
Arrays.stream(Parts.values()).forEach(value -> RebornRegistry.registerItem(value.item));
|
||||
Arrays.stream(Upgrades.values()).forEach(value -> RebornRegistry.registerItem(value.item));
|
||||
}
|
||||
|
||||
|
@ -94,12 +102,30 @@ public class TRContent {
|
|||
});
|
||||
}
|
||||
|
||||
ResourceLocation machineBlockRL = new ResourceLocation(TechReborn.MOD_ID, "machine_block");
|
||||
for (MachineBlocks value : MachineBlocks.values()) {
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(value.frame), 0, new ModelResourceLocation(machineBlockRL, "type=" + value.name + "_machine_frame"));
|
||||
ModelLoader.setCustomStateMapper(value.frame, new DefaultStateMapper() {
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
|
||||
return new ModelResourceLocation(machineBlockRL, "type=" + value.name + "_machine_frame");
|
||||
}
|
||||
});
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(value.casing), 0, new ModelResourceLocation(machineBlockRL, "type=" + value.name + "_machine_casing"));
|
||||
ModelLoader.setCustomStateMapper(value.casing, new DefaultStateMapper() {
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
|
||||
return new ModelResourceLocation(machineBlockRL, "type=" + value.name + "_machine_casing");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ResourceLocation upgradeRL = new ResourceLocation(TechReborn.MOD_ID, "items/misc/upgrades");
|
||||
Arrays.stream(Upgrades.values()).forEach(value -> ModelLoader.setCustomModelResourceLocation(value.item, 0,
|
||||
new ModelResourceLocation(upgradeRL, "type=" + value.name)));
|
||||
}
|
||||
|
||||
public static enum Ores {
|
||||
public static enum Ores implements IItemProvider {
|
||||
BAUXITE, CINNABAR, COPPER, GALENA, IRIDIUM, LEAD, PERIDOT, PYRITE, RUBY, SAPPHIRE, SHELDONITE, SILVER, SODALITE,
|
||||
SPHALERITE, TIN, TUNGSTEN;
|
||||
|
||||
|
@ -109,11 +135,16 @@ public class TRContent {
|
|||
private Ores() {
|
||||
name = this.toString().toLowerCase();
|
||||
block = new BlockOre();
|
||||
InitUtils.setupIngredient(block, name, "ore");
|
||||
InitUtils.setup(block, name + "_ore");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item asItem() {
|
||||
return Item.getItemFromBlock(block);
|
||||
}
|
||||
}
|
||||
|
||||
public static enum StorageBlocks {
|
||||
public static enum StorageBlocks implements IItemProvider {
|
||||
ALUMINUM, BRASS, BRONZE, CHROME, COPPER, ELECTRUM, INVAR, IRIDIUM, IRIDIUM_REINFORCED_STONE,
|
||||
IRIDIUM_REINFORCED_TUNGSTENSTEEL, LEAD, NICKEL, OSMIUM, PERIDOT, PLATINUM, RED_GARNET, REFINED_IRON, RUBY,
|
||||
SAPPHIRE, SILVER, STEEL, TIN, TITANIUM, TUNGSTEN, TUNGSTENSTEEL, YELLOW_GARNET, ZINC;
|
||||
|
@ -124,11 +155,55 @@ public class TRContent {
|
|||
private StorageBlocks() {
|
||||
name = this.toString().toLowerCase();
|
||||
block = new BlockStorage();
|
||||
InitUtils.setupIngredient(block, name, "storage_block");
|
||||
InitUtils.setup(block, name + "_storage_block");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item asItem() {
|
||||
return Item.getItemFromBlock(block);
|
||||
}
|
||||
}
|
||||
|
||||
public static enum Dusts {
|
||||
public static enum MachineBlocks {
|
||||
BASIC(1020 / 25),
|
||||
ADVANCED(1700 / 25),
|
||||
INDUSTRIAL(2380 / 25);
|
||||
|
||||
public final String name;
|
||||
public final Block frame;
|
||||
public final Block casing;
|
||||
|
||||
private MachineBlocks(int casingHeatCapacity) {
|
||||
name = this.toString().toLowerCase();
|
||||
frame = new BlockMachineFrame();
|
||||
InitUtils.setup(frame, name + "_machine_frame");
|
||||
casing = new BlockMachineCasing(casingHeatCapacity);
|
||||
InitUtils.setup(casing, name + "_machine_casing");
|
||||
}
|
||||
|
||||
public Block getFrame() {
|
||||
return frame;
|
||||
}
|
||||
|
||||
public Block getCasing() {
|
||||
return casing;
|
||||
}
|
||||
}
|
||||
|
||||
public static enum Machine {
|
||||
ELECTRIC_FURNACE(new BlockElectricFurnace());
|
||||
|
||||
public final String name;
|
||||
public final Block block;
|
||||
|
||||
private <B extends Block> Machine(B block) {
|
||||
this.name = this.toString().toLowerCase();
|
||||
this.block = block;
|
||||
InitUtils.setup(block, name);
|
||||
}
|
||||
}
|
||||
|
||||
public static enum Dusts implements IItemProvider {
|
||||
ALMANDINE, ALUMINUM, ANDESITE, ANDRADITE, ASHES, BASALT, BAUXITE, BRASS, BRONZE, CALCITE, CHARCOAL, CHROME,
|
||||
CINNABAR, CLAY, COAL, COPPER, DARK_ASHES, DIAMOND, DIORITE, ELECTRUM, EMERALD, ENDER_EYE, ENDER_PEARL, ENDSTONE,
|
||||
FLINT, GALENA, GOLD, GRANITE, GROSSULAR, INVAR, IRON, LAZURITE, LEAD, MAGNESIUM, MANGANESE, MARBLE, NETHERRACK,
|
||||
|
@ -142,7 +217,7 @@ public class TRContent {
|
|||
private Dusts() {
|
||||
name = this.toString().toLowerCase();
|
||||
item = new Item();
|
||||
InitUtils.setupIngredient(item, name, "dust");
|
||||
InitUtils.setup(item, name + "_dust");
|
||||
}
|
||||
|
||||
public ItemStack getStack() {
|
||||
|
@ -152,9 +227,14 @@ public class TRContent {
|
|||
public ItemStack getStack(int amount) {
|
||||
return new ItemStack(item, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item asItem() {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
public static enum SmallDusts {
|
||||
public static enum SmallDusts implements IItemProvider {
|
||||
ALMANDINE, ALUMINUM, ANDESITE, ANDRADITE, ASHES, BASALT, BAUXITE, BRASS, BRONZE, CALCITE, CHARCOAL, CHROME,
|
||||
CINNABAR, CLAY, COAL, COPPER, DARK_ASHES, DIAMOND, DIORITE, ELECTRUM, EMERALD, ENDER_EYE, ENDER_PEARL, ENDSTONE,
|
||||
FLINT, GALENA, GLOWSTONE, GOLD, GRANITE, GROSSULAR, INVAR, IRON, LAZURITE, LEAD, MAGNESIUM, MANGANESE, MARBLE,
|
||||
|
@ -168,8 +248,7 @@ public class TRContent {
|
|||
private SmallDusts() {
|
||||
name = this.toString().toLowerCase();
|
||||
item = new Item();
|
||||
item.setRegistryName(new ResourceLocation(TechReborn.MOD_ID, name));
|
||||
item.setTranslationKey(TechReborn.MOD_ID + ".small_dust." + this.toString().toLowerCase());
|
||||
InitUtils.setup(item, name + "_small_dust");
|
||||
}
|
||||
|
||||
public ItemStack getStack() {
|
||||
|
@ -179,9 +258,14 @@ public class TRContent {
|
|||
public ItemStack getStack(int amount) {
|
||||
return new ItemStack(item, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item asItem() {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
public static enum Gems {
|
||||
public static enum Gems implements IItemProvider {
|
||||
PERIDOT, RED_GARNET, RUBY, SAPPHIRE, YELLOW_GARNET;
|
||||
|
||||
public final String name;
|
||||
|
@ -190,7 +274,7 @@ public class TRContent {
|
|||
private Gems() {
|
||||
name = this.toString().toLowerCase();
|
||||
item = new Item();
|
||||
InitUtils.setupIngredient(item, name, "gem");
|
||||
InitUtils.setup(item, name + "_gem");
|
||||
}
|
||||
|
||||
public ItemStack getStack() {
|
||||
|
@ -200,9 +284,14 @@ public class TRContent {
|
|||
public ItemStack getStack(int amount) {
|
||||
return new ItemStack(item, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item asItem() {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
public static enum Ingots {
|
||||
public static enum Ingots implements IItemProvider {
|
||||
ADVANCED_ALLOY, ALUMINUM, BRASS, BRONZE, CHROME, COPPER, ELECTRUM, HOT_TUNGSTENSTEEL, INVAR, IRIDIUM_ALLOY, IRIDIUM,
|
||||
LEAD, MIXED_METAL, NICKEL, PLATINUM, REFINED_IRON, SILVER, STEEL, TIN, TITANIUM, TUNGSTEN, TUNGSTENSTEEL, ZINC;
|
||||
|
||||
|
@ -212,7 +301,7 @@ public class TRContent {
|
|||
private Ingots() {
|
||||
name = this.toString().toLowerCase();
|
||||
item = new Item();
|
||||
InitUtils.setupIngredient(item, name, "ingot");
|
||||
InitUtils.setup(item, name + "_ingot");
|
||||
}
|
||||
|
||||
public ItemStack getStack() {
|
||||
|
@ -222,9 +311,14 @@ public class TRContent {
|
|||
public ItemStack getStack(int amount) {
|
||||
return new ItemStack(item, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item asItem() {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
public static enum Nuggets {
|
||||
public static enum Nuggets implements IItemProvider {
|
||||
ALUMINUM, BRASS, BRONZE, CHROME, COPPER, DIAMOND, ELECTRUM, HOT_TUNGSTENSTEEL, INVAR, IRIDIUM, LEAD, NICKEL,
|
||||
PLATINUM, REFINED_IRON, SILVER, STEEL, TIN, TITANIUM, TUNGSTEN, TUNGSTENSTEEL, ZINC;
|
||||
|
||||
|
@ -234,7 +328,7 @@ public class TRContent {
|
|||
private Nuggets() {
|
||||
name = this.toString().toLowerCase();
|
||||
item = new Item();
|
||||
InitUtils.setupIngredient(item, name, "nugget");
|
||||
InitUtils.setup(item, name + "_nugget");
|
||||
}
|
||||
|
||||
public ItemStack getStack() {
|
||||
|
@ -244,9 +338,14 @@ public class TRContent {
|
|||
public ItemStack getStack(int amount) {
|
||||
return new ItemStack(item, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item asItem() {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
public static enum Parts {
|
||||
public static enum Parts implements IItemProvider {
|
||||
CARBON_FIBER,
|
||||
CARBON_MESH,
|
||||
|
||||
|
@ -306,9 +405,14 @@ public class TRContent {
|
|||
public ItemStack getStack(int amount) {
|
||||
return new ItemStack(item, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item asItem() {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
public static enum Plates {
|
||||
public static enum Plates implements IItemProvider {
|
||||
ADVANCED_ALLOY, ALUMINUM, BRASS, BRONZE, CARBON, COAL, COPPER, DIAMOND, ELECTRUM, EMERALD, GOLD, INVAR,
|
||||
IRIDIUM_ALLOY, IRIDIUM, IRON, LAPIS, LAZURITE, LEAD, MAGNALIUM, NICKEL, OBSIDIAN, PERIDOT, PLATINUM, RED_GARNET,
|
||||
REDSTONE, REFINED_IRON, RUBY, SAPPHIRE, SILICON, SILVER, STEEL, TIN, TITANIUM, TUNGSTEN, TUNGSTENSTEEL, WOOD,
|
||||
|
@ -320,7 +424,7 @@ public class TRContent {
|
|||
private Plates() {
|
||||
name = this.toString().toLowerCase();
|
||||
item = new Item();
|
||||
InitUtils.setupIngredient(item, name, "plate");
|
||||
InitUtils.setup(item, name + "_plate");
|
||||
}
|
||||
|
||||
public ItemStack getStack() {
|
||||
|
@ -330,6 +434,11 @@ public class TRContent {
|
|||
public ItemStack getStack(int amount) {
|
||||
return new ItemStack(item, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item asItem() {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
@ConfigRegistry(config = "items", category = "upgrades", key = "overclcoker_speed", comment = "Overclocker behavior speed multipiler")
|
||||
|
@ -341,7 +450,7 @@ public class TRContent {
|
|||
@ConfigRegistry(config = "items", category = "upgrades", key = "energy_storage", comment = "Energy storage behavior extra power")
|
||||
public static double energyStoragePower = 40_000;
|
||||
|
||||
public static enum Upgrades {
|
||||
public static enum Upgrades implements IItemProvider {
|
||||
OVERCLOCKER((tile, handler, stack) -> {
|
||||
TilePowerAcceptor powerAcceptor = null;
|
||||
if (tile instanceof TilePowerAcceptor) {
|
||||
|
@ -379,7 +488,12 @@ public class TRContent {
|
|||
Upgrades(IUpgrade upgrade) {
|
||||
name = this.toString().toLowerCase();
|
||||
item = new ItemUpgrade(name, upgrade);
|
||||
InitUtils.setupIngredient(item, name, "upgrade");
|
||||
InitUtils.setup(item, name + "_upgrade");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item asItem() {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,28 +77,33 @@ public class TRItems {
|
|||
public static Item RED_CELL_BATTERY;
|
||||
|
||||
// Tools
|
||||
public static Item ADVANCED_CHAINSAW;
|
||||
public static Item ADVANCED_DRILL;
|
||||
public static Item ADVANCED_JACKHAMMER;
|
||||
public static Item TREE_TAP;
|
||||
public static Item WRENCH;
|
||||
|
||||
public static Item BASIC_CHAINSAW;
|
||||
public static Item BASIC_DRILL;
|
||||
public static Item BASIC_JACKHAMMER;
|
||||
public static Item DEBUG_TOOL;
|
||||
public static Item ELECTRIC_TREE_TAP;
|
||||
|
||||
public static Item ADVANCED_CHAINSAW;
|
||||
public static Item ADVANCED_DRILL;
|
||||
public static Item ADVANCED_JACKHAMMER;
|
||||
public static Item ROCK_CUTTER;
|
||||
|
||||
public static Item INDUSTRIAL_CHAINSAW;
|
||||
public static Item INDUSTRIAL_DRILL;
|
||||
public static Item INDUSTRIAL_JACKHAMMER;
|
||||
public static Item NANOSABER;
|
||||
public static Item OMNI_TOOL;
|
||||
public static Item ROCK_CUTTER;
|
||||
public static Item TREE_TAP;
|
||||
public static Item WRENCH;
|
||||
|
||||
public static Item DEBUG_TOOL;
|
||||
|
||||
|
||||
// Other
|
||||
public static DynamicCell CELL;
|
||||
public static Item FREQUENCY_TRANSMITTER;
|
||||
public static Item MANUAL;
|
||||
public static Item SCRAP_BOX;
|
||||
public static Item MANUAL;
|
||||
public static DynamicCell CELL;
|
||||
|
||||
// Gem armor & tools
|
||||
@Nullable
|
||||
|
@ -178,44 +183,6 @@ public class TRItems {
|
|||
|
||||
TRContent.registerItems();
|
||||
|
||||
// Battery
|
||||
registerItem(ENERGY_CRYSTAL = InitUtils.setup(new ItemEnergyCrystal(), "energy_crystal"));
|
||||
registerItem(LAPOTRON_CRYSTAL = InitUtils.setup(new ItemLapotronCrystal(), "lapotron_crystal"));
|
||||
registerItem(LAPOTRONIC_ORB = InitUtils.setup(new ItemLapotronicOrb(), "lapotronic_orb"));
|
||||
registerItem(LITHIUM_ION_BATTERY = InitUtils.setup(new ItemLithiumIonBattery(), "lithium_ion_battery"));
|
||||
registerItem(RED_CELL_BATTERY = InitUtils.setup(new ItemRedCellBattery(), "red_cell_battery"));
|
||||
|
||||
// Tools
|
||||
registerItem(ADVANCED_DRILL = InitUtils.setup(new ItemAdvancedDrill(), "advanced_drill"));
|
||||
registerItem(ADVANCED_CHAINSAW = InitUtils.setup(new ItemAdvancedChainsaw(), "advanced_chainsaw"));
|
||||
registerItem(ADVANCED_JACKHAMMER = InitUtils.setup(new ItemAdvancedJackhammer(), "advanced_jackhammer"));
|
||||
registerItem(BASIC_DRILL = InitUtils.setup(new ItemBasicDrill(), "basic_drill"));
|
||||
registerItem(BASIC_CHAINSAW = InitUtils.setup(new ItemBasicChainsaw(), "basic_chainsaw"));
|
||||
registerItem(BASIC_JACKHAMMER = InitUtils.setup(new ItemBasicJackhammer(), "basic_jackhammer"));
|
||||
registerItem(DEBUG_TOOL = InitUtils.setup(new ItemDebugTool(), "debug_tool"));
|
||||
registerItem(ELECTRIC_TREE_TAP = InitUtils.setup(new ItemElectricTreetap(), "electric_treetap"));
|
||||
registerItem(INDUSTRIAL_DRILL = InitUtils.setup(new ItemIndustrialDrill(), "industrial_drill"));
|
||||
registerItem(INDUSTRIAL_CHAINSAW = InitUtils.setup(new ItemIndustrialChainsaw(), "industrial_chainsaw"));
|
||||
registerItem(INDUSTRIAL_JACKHAMMER = InitUtils.setup(new ItemIndustrialJackhammer(), "industrial_jackhammer"));
|
||||
registerItem(NANOSABER = InitUtils.setup(new ItemNanosaber(), "nanosaber"));
|
||||
registerItem(OMNI_TOOL = InitUtils.setup(new ItemOmniTool(), "omni_tool"));
|
||||
registerItem(ROCK_CUTTER = InitUtils.setup(new ItemRockCutter(), "rock_cutter"));
|
||||
registerItem(TREE_TAP = InitUtils.setup(new ItemTreeTap(), "treetap"));
|
||||
registerItem(WRENCH = InitUtils.setup(new ItemWrench(), "wrench"));
|
||||
|
||||
// Armor
|
||||
registerItem(CLOAKING_DEVICE = InitUtils.setup(new ItemCloakingDevice(), "cloaking_device"));
|
||||
registerItem(LAPOTRONIC_ORBPACK = InitUtils.setup(new ItemLapotronicOrbpack(), "lapotronic_orbpack"));
|
||||
registerItem(LITHIUM_ION_BATPACK = InitUtils.setup(new ItemLithiumIonBatpack(), "lithium_ion_batpack"));
|
||||
|
||||
// Other
|
||||
registerItem(CELL = InitUtils.setup(new DynamicCell(), "cell"));
|
||||
MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE);
|
||||
registerItem(FREQUENCY_TRANSMITTER = InitUtils.setup(new ItemFrequencyTransmitter(), "frequency_transmitter"));
|
||||
registerItem(MANUAL = InitUtils.setup(new ItemManual(), "manual"));
|
||||
registerItem(SCRAP_BOX = InitUtils.setup(new ItemScrapBox(), "scrap_box"));
|
||||
|
||||
|
||||
// Gem armor & tools
|
||||
if (ConfigTechReborn.enableGemArmorAndTools) {
|
||||
//Todo: repair with tags
|
||||
|
@ -264,6 +231,47 @@ public class TRItems {
|
|||
registerItem(PERIDOT_BOOTS = InitUtils.setup(new ItemTRArmour(Reference.PERIDOT_ARMOUR, EntityEquipmentSlot.FEET, "gemPeridot"), "peridot_boots"));
|
||||
}
|
||||
|
||||
// Battery
|
||||
registerItem(RED_CELL_BATTERY = InitUtils.setup(new ItemRedCellBattery(), "red_cell_battery"));
|
||||
registerItem(LITHIUM_ION_BATTERY = InitUtils.setup(new ItemLithiumIonBattery(), "lithium_ion_battery"));
|
||||
registerItem(LITHIUM_ION_BATPACK = InitUtils.setup(new ItemLithiumIonBatpack(), "lithium_ion_batpack"));
|
||||
registerItem(ENERGY_CRYSTAL = InitUtils.setup(new ItemEnergyCrystal(), "energy_crystal"));
|
||||
registerItem(LAPOTRON_CRYSTAL = InitUtils.setup(new ItemLapotronCrystal(), "lapotron_crystal"));
|
||||
registerItem(LAPOTRONIC_ORB = InitUtils.setup(new ItemLapotronicOrb(), "lapotronic_orb"));
|
||||
registerItem(LAPOTRONIC_ORBPACK = InitUtils.setup(new ItemLapotronicOrbpack(), "lapotronic_orbpack"));
|
||||
|
||||
// Tools
|
||||
registerItem(TREE_TAP = InitUtils.setup(new ItemTreeTap(), "treetap"));
|
||||
registerItem(WRENCH = InitUtils.setup(new ItemWrench(), "wrench"));
|
||||
|
||||
registerItem(BASIC_DRILL = InitUtils.setup(new ItemBasicDrill(), "basic_drill"));
|
||||
registerItem(BASIC_CHAINSAW = InitUtils.setup(new ItemBasicChainsaw(), "basic_chainsaw"));
|
||||
registerItem(BASIC_JACKHAMMER = InitUtils.setup(new ItemBasicJackhammer(), "basic_jackhammer"));
|
||||
registerItem(ELECTRIC_TREE_TAP = InitUtils.setup(new ItemElectricTreetap(), "electric_treetap"));
|
||||
|
||||
registerItem(ADVANCED_DRILL = InitUtils.setup(new ItemAdvancedDrill(), "advanced_drill"));
|
||||
registerItem(ADVANCED_CHAINSAW = InitUtils.setup(new ItemAdvancedChainsaw(), "advanced_chainsaw"));
|
||||
registerItem(ADVANCED_JACKHAMMER = InitUtils.setup(new ItemAdvancedJackhammer(), "advanced_jackhammer"));
|
||||
registerItem(ROCK_CUTTER = InitUtils.setup(new ItemRockCutter(), "rock_cutter"));
|
||||
|
||||
registerItem(INDUSTRIAL_DRILL = InitUtils.setup(new ItemIndustrialDrill(), "industrial_drill"));
|
||||
registerItem(INDUSTRIAL_CHAINSAW = InitUtils.setup(new ItemIndustrialChainsaw(), "industrial_chainsaw"));
|
||||
registerItem(INDUSTRIAL_JACKHAMMER = InitUtils.setup(new ItemIndustrialJackhammer(), "industrial_jackhammer"));
|
||||
registerItem(NANOSABER = InitUtils.setup(new ItemNanosaber(), "nanosaber"));
|
||||
registerItem(OMNI_TOOL = InitUtils.setup(new ItemOmniTool(), "omni_tool"));
|
||||
|
||||
|
||||
// Armor
|
||||
registerItem(CLOAKING_DEVICE = InitUtils.setup(new ItemCloakingDevice(), "cloaking_device"));
|
||||
|
||||
// Other
|
||||
registerItem(FREQUENCY_TRANSMITTER = InitUtils.setup(new ItemFrequencyTransmitter(), "frequency_transmitter"));
|
||||
registerItem(SCRAP_BOX = InitUtils.setup(new ItemScrapBox(), "scrap_box"));
|
||||
registerItem(MANUAL = InitUtils.setup(new ItemManual(), "manual"));
|
||||
registerItem(DEBUG_TOOL = InitUtils.setup(new ItemDebugTool(), "debug_tool"));
|
||||
registerItem(CELL = InitUtils.setup(new DynamicCell(), "cell"));
|
||||
MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE);
|
||||
|
||||
// TODO: do we need this at all?
|
||||
BlockMachineBase.advancedFrameStack = new ItemStack(ModBlocks.MACHINE_BLOCK_ADVANCED);
|
||||
BlockMachineBase.basicFrameStack = new ItemStack(ModBlocks.MACHINE_BLOCK_BASIC);
|
||||
|
|
|
@ -31,9 +31,6 @@ import net.minecraft.item.crafting.Ingredient;
|
|||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import reborncore.common.util.OreUtil;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.blocks.BlockMachineFrames;
|
||||
import techreborn.blocks.BlockOre;
|
||||
import techreborn.blocks.cable.BlockCable;
|
||||
import techreborn.items.*;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ import reborncore.common.multiblock.MultiblockControllerBase;
|
|||
import reborncore.common.multiblock.MultiblockValidationException;
|
||||
import reborncore.common.multiblock.rectangular.RectangularMultiblockControllerBase;
|
||||
import reborncore.common.multiblock.rectangular.RectangularMultiblockTileEntityBase;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
|
||||
public class MultiBlockCasing extends RectangularMultiblockControllerBase {
|
||||
|
||||
|
@ -335,7 +335,7 @@ public class MultiBlockCasing extends RectangularMultiblockControllerBase {
|
|||
@Override
|
||||
protected void isBlockGoodForFrame(World world, int x, int y, int z) throws MultiblockValidationException {
|
||||
Block block = world.getBlockState(new BlockPos(x, y, z)).getBlock();
|
||||
if (block == ModBlocks.MACHINE_CASINGS_STANDARD || block == ModBlocks.MACHINE_CASINGS_REINFORCED || block == ModBlocks.MACHINE_CASINGS_ADVANCED) {
|
||||
if (block instanceof BlockMachineCasing) {
|
||||
|
||||
} else {
|
||||
super.isBlockGoodForFrame(world, x, y, z);
|
||||
|
|
|
@ -24,17 +24,12 @@
|
|||
|
||||
package techreborn.tiles;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.common.multiblock.MultiblockControllerBase;
|
||||
import reborncore.common.multiblock.rectangular.RectangularMultiblockTileEntityBase;
|
||||
import techreborn.multiblocks.MultiBlockCasing;
|
||||
|
||||
public class TileMachineCasing extends RectangularMultiblockTileEntityBase
|
||||
implements IToolDrop {
|
||||
|
||||
public class TileMachineCasing extends RectangularMultiblockTileEntityBase {
|
||||
|
||||
@Override
|
||||
public void onMachineActivated() {
|
||||
|
||||
|
@ -89,10 +84,4 @@ public class TileMachineCasing extends RectangularMultiblockTileEntityBase
|
|||
public void update() {
|
||||
|
||||
}
|
||||
|
||||
// IToolDrop
|
||||
@Override
|
||||
public ItemStack getToolDrop(EntityPlayer playerIn) {
|
||||
return new ItemStack(Item.getItemFromBlock(world.getBlockState(pos).getBlock()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,24 +13,10 @@ public class InitUtils {
|
|||
return item;
|
||||
}
|
||||
|
||||
public static <I extends Item> I setupIngredient(I item, String name, String type) {
|
||||
item.setRegistryName(new ResourceLocation(TechReborn.MOD_ID, name + "_" + type));
|
||||
item.setTranslationKey(TechReborn.MOD_ID + "." + type + "." + name);
|
||||
item.setCreativeTab(TechReborn.TAB);
|
||||
return item;
|
||||
}
|
||||
|
||||
public static <B extends Block> B setup(B block, String name) {
|
||||
block.setRegistryName(new ResourceLocation(TechReborn.MOD_ID, name));
|
||||
block.setTranslationKey(TechReborn.MOD_ID + "." + name);
|
||||
block.setCreativeTab(TechReborn.TAB);
|
||||
return block;
|
||||
}
|
||||
|
||||
public static <B extends Block> B setupIngredient(B block, String name, String type) {
|
||||
block.setRegistryName(new ResourceLocation(TechReborn.MOD_ID, name + "_" + type));
|
||||
block.setTranslationKey(TechReborn.MOD_ID + "." + type + "." + name);
|
||||
block.setCreativeTab(TechReborn.TAB);
|
||||
return block;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue