Merge branch '1.12' into feature/solar-panles
Conflicts: build.gradle src/main/java/techreborn/blocks/generator/BlockSolarPanel.java src/main/java/techreborn/blocks/lighting/BlockLamp.java
This commit is contained in:
commit
eab088c094
77 changed files with 948 additions and 967 deletions
|
@ -79,7 +79,7 @@ configurations {
|
|||
compile.extendsFrom shade
|
||||
}
|
||||
|
||||
version = "2.8.0"
|
||||
version = "2.9.1"
|
||||
|
||||
def ENV = System.getenv()
|
||||
if (ENV.BUILD_NUMBER) {
|
||||
|
@ -87,7 +87,7 @@ if (ENV.BUILD_NUMBER) {
|
|||
}
|
||||
|
||||
minecraft {
|
||||
version = "1.12.2-14.23.0.2509"
|
||||
version = "1.12.2-14.23.0.2552"
|
||||
mappings = "snapshot_20170624"
|
||||
replace "@MODVERSION@", project.version
|
||||
useDepAts = true
|
||||
|
@ -122,6 +122,8 @@ dependencies {
|
|||
deobfCompile 'net.industrial-craft:industrialcraft-2:2.8.26-ex112', withoutOldJEI
|
||||
deobfCompile 'cofh:ThermalDynamics:1.12-2.3.5.12:universal', withoutOldJEI
|
||||
deobfCompile 'cofh:ThermalExpansion:1.12-5.3.5.19:universal', withoutOldJEI
|
||||
|
||||
compile name: 'buildcraft', version: '7.99.12', ext: 'jar'
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -37,7 +37,6 @@ import net.minecraftforge.fml.common.network.NetworkRegistry;
|
|||
import net.minecraftforge.fml.common.registry.EntityRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import org.apache.commons.lang3.time.StopWatch;
|
||||
import reborncore.RebornCore;
|
||||
import reborncore.api.recipe.RecipeHandler;
|
||||
import reborncore.common.multiblock.MultiblockEventHandler;
|
||||
|
@ -89,16 +88,14 @@ public class Core {
|
|||
public void preinit(FMLPreInitializationEvent event) throws IllegalAccessException, InstantiationException {
|
||||
event.getModMetadata().version = ModInfo.MOD_VERSION;
|
||||
INSTANCE = this;
|
||||
// FMLCommonHandler.instance().bus().register(this);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
configDir = new File(new File(event.getModConfigurationDirectory(), "teamreborn"), "techreborn");
|
||||
worldGen = new TechRebornWorldGen();
|
||||
worldGen.configFile = (new File(configDir, "ores.json"));
|
||||
|
||||
CommonProxy.isChiselAround = Loader.isModLoaded("ctm");
|
||||
TechRebornAPI.subItemRetriever = new SubItemRetriever();
|
||||
//Recheck here because things break at times
|
||||
|
||||
// Register ModBlocks
|
||||
ModBlocks.init();
|
||||
// Register Fluids
|
||||
|
@ -124,7 +121,7 @@ public class Core {
|
|||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent event) throws IllegalAccessException, InstantiationException {
|
||||
// Registers Chest Loot
|
||||
ModLoot.init();
|
||||
// ModLoot.init();
|
||||
// Multiparts
|
||||
ModParts.init();
|
||||
// Sounds
|
||||
|
@ -133,31 +130,21 @@ public class Core {
|
|||
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
|
||||
compatModule.init(event);
|
||||
}
|
||||
MinecraftForge.EVENT_BUS.register(new StackWIPHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new BlockBreakHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new TRRecipeHandler());
|
||||
|
||||
// Recipes
|
||||
StopWatch watch = new StopWatch();
|
||||
watch.start();
|
||||
logHelper.all(watch + " : main recipes");
|
||||
watch.stop();
|
||||
// Client only init, needs to be done before parts system
|
||||
proxy.init(event);
|
||||
// WorldGen
|
||||
worldGen.load();
|
||||
GameRegistry.registerWorldGenerator(worldGen, 0);
|
||||
|
||||
// DungeonLoot.init();
|
||||
GameRegistry.registerWorldGenerator(new OilLakeGenerator(), 0);
|
||||
// Register Gui Handler
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, new GuiHandler());
|
||||
|
||||
// Multiblock events
|
||||
MinecraftForge.EVENT_BUS.register(new MultiblockEventHandler());
|
||||
// Event busses
|
||||
MinecraftForge.EVENT_BUS.register(new StackWIPHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new BlockBreakHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new TRRecipeHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new MultiblockEventHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new MultiblockServerTickHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new TRTickHandler());
|
||||
GameRegistry.registerWorldGenerator(new OilLakeGenerator(), 0);
|
||||
MinecraftForge.EVENT_BUS.register(worldGen.retroGen);
|
||||
// Scrapbox
|
||||
if (BehaviorDispenseScrapbox.dispenseScrapboxes) {
|
||||
|
@ -178,7 +165,6 @@ public class Core {
|
|||
logHelper.info(RecipeHandler.recipeList.size() + " recipes loaded");
|
||||
|
||||
// RecipeHandler.scanForDupeRecipes();
|
||||
|
||||
// RecipeConfigManager.save();
|
||||
//recipeCompact.saveMissingItems(configDir);
|
||||
}
|
||||
|
|
|
@ -91,6 +91,7 @@ public abstract class BaseRecipe implements IBaseRecipeType, Cloneable {
|
|||
return euPerTick;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public boolean canCraft(TileEntity tile) {
|
||||
if (tile instanceof ITileRecipeHandler) {
|
||||
|
@ -98,7 +99,8 @@ public abstract class BaseRecipe implements IBaseRecipeType, Cloneable {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public boolean onCraft(TileEntity tile) {
|
||||
if (tile instanceof ITileRecipeHandler) {
|
||||
|
|
|
@ -28,6 +28,7 @@ import net.minecraft.tileentity.TileEntity;
|
|||
|
||||
/**
|
||||
* Created by Mark on 03/04/2016.
|
||||
* @param <T> descendant of BaseRecipe
|
||||
*/
|
||||
public interface ITileRecipeHandler<T extends BaseRecipe> {
|
||||
boolean canCraft(TileEntity tile, T recipe);
|
||||
|
|
|
@ -70,6 +70,7 @@ public class BlockFlare extends BlockContainer {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state) {
|
||||
return (state.getValue(COLOR)).getMetadata();
|
||||
}
|
||||
|
@ -81,14 +82,17 @@ public class BlockFlare extends BlockContainer {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(COLOR, EnumDyeColor.byMetadata(meta));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return (state.getValue(COLOR)).getMetadata();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, COLOR);
|
||||
}
|
||||
|
@ -98,6 +102,7 @@ public class BlockFlare extends BlockContainer {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
|
|
|
@ -42,7 +42,6 @@ import prospector.shootingstar.model.ModelCompound;
|
|||
import reborncore.common.blocks.PropertyString;
|
||||
import reborncore.common.multiblock.BlockMultiblockBase;
|
||||
import reborncore.common.util.ArrayUtils;
|
||||
import techreborn.Core;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
@ -64,11 +63,7 @@ public class BlockMachineCasing extends BlockMultiblockBase {
|
|||
setHardness(2F);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(TYPE, "standard"));
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (Core.proxy.isCTMAvailable()) {
|
||||
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, i, "machines/structure/ctm").setInvVariant("type=" + types[i]));
|
||||
} else {
|
||||
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, i, "machines/structure").setInvVariant("type=" + types[i]));
|
||||
}
|
||||
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, i, "machines/structure").setInvVariant("type=" + types[i]));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -99,10 +94,16 @@ public class BlockMachineCasing extends BlockMultiblockBase {
|
|||
return typesList.indexOf(state.getValue(TYPE));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, TYPE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides heat info per casing for Industrial Blast Furnace
|
||||
* @param state Machine casing type
|
||||
* @return Integer Heat value for casing
|
||||
*/
|
||||
public int getHeatFromState(IBlockState state) {
|
||||
switch (getMetaFromState(state)) {
|
||||
case 0:
|
||||
|
|
|
@ -111,6 +111,7 @@ public class BlockMachineFrames extends BaseBlock {
|
|||
return typesList.indexOf(state.getValue(TYPE));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, TYPE);
|
||||
}
|
||||
|
|
|
@ -113,6 +113,7 @@ public class BlockOre extends Block implements IOreNameProvider {
|
|||
return getStateFromMeta(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public ArrayList<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
String variant = state.getValue(VARIANTS);
|
||||
|
@ -230,6 +231,7 @@ public class BlockOre extends Block implements IOreNameProvider {
|
|||
return oreNamesList.indexOf(state.getValue(VARIANTS));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, VARIANTS);
|
||||
}
|
||||
|
|
|
@ -151,6 +151,7 @@ public class BlockOre2 extends Block implements IOreNameProvider {
|
|||
return oreNamesList.indexOf(state.getValue(VARIANTS));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
VARIANTS = new PropertyString("type", oreNamesList);
|
||||
return new BlockStateContainer(this, VARIANTS);
|
||||
|
|
|
@ -163,6 +163,7 @@ public class BlockPlayerDetector extends BlockMachineBase {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
TYPE = new PropertyString("type", types);
|
||||
return new BlockStateContainer(this, TYPE);
|
||||
|
|
|
@ -49,6 +49,7 @@ public class BlockReinforcedGlass extends BlockGlass {
|
|||
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random random) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -58,6 +59,7 @@ public class BlockReinforcedGlass extends BlockGlass {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public BlockRenderLayer getBlockLayer() {
|
||||
return BlockRenderLayer.CUTOUT;
|
||||
|
|
|
@ -77,6 +77,7 @@ public class BlockRubberLog extends Block {
|
|||
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, SAP_SIDE, HAS_SAP);
|
||||
}
|
||||
|
@ -127,6 +128,7 @@ public class BlockRubberLog extends Block {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
|
||||
int i = 4;
|
||||
int j = i + 1;
|
||||
|
|
|
@ -109,6 +109,7 @@ public class BlockStorage extends BaseBlock {
|
|||
return typesList.indexOf(state.getValue(TYPE));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, TYPE);
|
||||
}
|
||||
|
|
|
@ -133,6 +133,7 @@ public class BlockStorage2 extends BaseBlock {
|
|||
return 30F;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, TYPE);
|
||||
}
|
||||
|
|
|
@ -193,6 +193,7 @@ public class BlockCable extends BlockContainer {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
|
||||
state = state.getActualState(source, pos);
|
||||
float minX = state.getValue(WEST) ? 0.0F : 0.3125F;
|
||||
|
|
|
@ -31,7 +31,6 @@ import net.minecraft.util.EnumFacing;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import techreborn.Core;
|
||||
|
||||
public class BlockFluidTechReborn extends BlockFluidBase {
|
||||
|
||||
|
@ -41,7 +40,6 @@ public class BlockFluidTechReborn extends BlockFluidBase {
|
|||
super(fluid, material);
|
||||
setUnlocalizedName(name);
|
||||
this.name = name;
|
||||
Core.proxy.registerFluidBlockRendering(this, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
108
src/main/java/techreborn/blocks/generator/BlockSolarPanel.java
Normal file
108
src/main/java/techreborn/blocks/generator/BlockSolarPanel.java
Normal file
|
@ -0,0 +1,108 @@
|
|||
/*
|
||||
* 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.blocks.generator;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import prospector.shootingstar.ShootingStar;
|
||||
import prospector.shootingstar.model.ModelCompound;
|
||||
import reborncore.common.BaseTileBlock;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.lib.ModInfo;
|
||||
import techreborn.tiles.generator.TileSolarPanel;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 25/02/2016.
|
||||
*/
|
||||
public class BlockSolarPanel extends BaseTileBlock {
|
||||
|
||||
public static PropertyBool ACTIVE = PropertyBool.create("active");
|
||||
|
||||
public BlockSolarPanel() {
|
||||
super(Material.IRON);
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(ACTIVE, false));
|
||||
setHardness(2.0F);
|
||||
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
ACTIVE = PropertyBool.create("active");
|
||||
return new BlockStateContainer(this, ACTIVE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return getDefaultState().withProperty(ACTIVE, meta != 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return state.getValue(ACTIVE) ? 1 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta) {
|
||||
return new TileSolarPanel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block neighborBlock, BlockPos p_189540_5_) {
|
||||
if (worldIn.canBlockSeeSky(pos.up()) && !worldIn.isRaining() && !worldIn.isThundering()
|
||||
&& worldIn.isDaytime()) {
|
||||
worldIn.setBlockState(pos,
|
||||
worldIn.getBlockState(pos).withProperty(BlockSolarPanel.ACTIVE, true));
|
||||
} else {
|
||||
|
||||
worldIn.setBlockState(pos,
|
||||
worldIn.getBlockState(pos).withProperty(BlockSolarPanel.ACTIVE, false));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY,
|
||||
float hitZ, int meta, EntityLivingBase placer) {
|
||||
if (!worldIn.isRemote) {
|
||||
if (worldIn.canBlockSeeSky(pos.up()) && !worldIn.isRaining() && !worldIn.isThundering() && worldIn.isDaytime()) {
|
||||
return this.getDefaultState().withProperty(ACTIVE, true);
|
||||
|
||||
} else {
|
||||
return this.getDefaultState().withProperty(ACTIVE, false);
|
||||
}
|
||||
} else {
|
||||
return this.getDefaultState().withProperty(ACTIVE, false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -78,6 +78,7 @@ public class BlockLamp extends BaseTileBlock {
|
|||
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/lighting"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
FACING = PropertyDirection.create("facing");
|
||||
ACTIVE = PropertyBool.create("active");
|
||||
|
|
|
@ -113,6 +113,7 @@ public abstract class BlockEnergyStorage extends BaseTileBlock {
|
|||
return super.onBlockActivated(world, pos, state, player, hand, side, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
FACING = PropertyDirection.create("facing", Facings.ALL);
|
||||
return new BlockStateContainer(this, FACING);
|
||||
|
@ -220,10 +221,12 @@ public abstract class BlockEnergyStorage extends BaseTileBlock {
|
|||
return aenumfacing[rand.nextInt(aenumfacing.length)];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(EnumFacing p_apply_1_) {
|
||||
return p_apply_1_ != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<EnumFacing> iterator() {
|
||||
return Iterators.forArray(this.facings());
|
||||
}
|
||||
|
|
|
@ -30,53 +30,72 @@ import net.minecraft.block.state.IBlockState;
|
|||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import prospector.shootingstar.ShootingStar;
|
||||
import prospector.shootingstar.model.ModelCompound;
|
||||
import reborncore.common.BaseTileBlock;
|
||||
import techreborn.Core;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.lib.ModInfo;
|
||||
import techreborn.tiles.lesu.TileLSUStorage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Energy storage block for LESU
|
||||
*/
|
||||
public class BlockLSUStorage extends BaseTileBlock {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public BlockLSUStorage() {
|
||||
super(Material.IRON);
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
if (Core.proxy.isCTMAvailable()) {
|
||||
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/energy/ctm"));
|
||||
} else {
|
||||
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/energy"));
|
||||
}
|
||||
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/energy"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by ItemBlocks after a block is set in the world, to allow post-place logic
|
||||
*/
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack itemstack) {
|
||||
super.onBlockPlacedBy(world, pos, state, player, itemstack);
|
||||
if (world.getTileEntity(pos) instanceof TileLSUStorage) {
|
||||
((TileLSUStorage) world.getTileEntity(pos)).rebuildNetwork();
|
||||
TileLSUStorage tile = (TileLSUStorage) world.getTileEntity(pos);
|
||||
if (tile != null) {
|
||||
tile.rebuildNetwork();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called serverside after this block is replaced with another in Chunk, but before the Tile Entity is updated
|
||||
*/
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state) {
|
||||
if (world.getTileEntity(pos) instanceof TileLSUStorage) {
|
||||
((TileLSUStorage) world.getTileEntity(pos)).removeFromNetwork();
|
||||
TileLSUStorage tile = (TileLSUStorage) world.getTileEntity(pos);
|
||||
if (tile != null) {
|
||||
tile.removeFromNetwork();
|
||||
}
|
||||
}
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
|
||||
/**
|
||||
* This gets a complete list of items dropped from this block.
|
||||
*
|
||||
* @param drops add all items this block drops to this drops list
|
||||
* @param world The current world
|
||||
* @param pos Block position in world
|
||||
* @param state Current state
|
||||
* @param fortune Breakers fortune level
|
||||
*/
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
List<ItemStack> items = new ArrayList<>();
|
||||
items.add(new ItemStack(this));
|
||||
return items;
|
||||
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
drops.add(new ItemStack(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -84,7 +103,18 @@ public class BlockLSUStorage extends BaseTileBlock {
|
|||
return new TileLSUStorage();
|
||||
}
|
||||
|
||||
public boolean shouldConnectToBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int meta) {
|
||||
return block == this;
|
||||
/**
|
||||
* Determines if another block can connect to this block
|
||||
*
|
||||
* @param world The current world
|
||||
* @param pos The position of this block
|
||||
* @param facing The side the connecting block is on
|
||||
* @return True to allow another block to connect to this block
|
||||
*/
|
||||
@Override
|
||||
public boolean canBeConnectedTo(IBlockAccess world, BlockPos pos, EnumFacing facing)
|
||||
{
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
return this == block;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,6 +76,7 @@ public abstract class BlockTransformer extends BaseTileBlock {
|
|||
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/energy"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
FACING = PropertyDirection.create("facing", Facings.ALL);
|
||||
return new BlockStateContainer(this, FACING);
|
||||
|
@ -267,10 +268,12 @@ public abstract class BlockTransformer extends BaseTileBlock {
|
|||
return aenumfacing[rand.nextInt(aenumfacing.length)];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(EnumFacing p_apply_1_) {
|
||||
return p_apply_1_ != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<EnumFacing> iterator() {
|
||||
return Iterators.forArray(this.facings());
|
||||
}
|
||||
|
|
|
@ -61,6 +61,7 @@ public class RegisterItemJsons {
|
|||
register(ModItems.MANUAL, "misc/manual");
|
||||
register(ModItems.DEBUG, "misc/debug");
|
||||
register(ModBlocks.RUBBER_SAPLING, "misc/rubber_sapling");
|
||||
register(ModItems.MISSING_RECIPE_PLACEHOLDER, "misc/missing_recipe");
|
||||
|
||||
register(ModItems.STEEL_DRILL, "tool/steel_drill");
|
||||
register(ModItems.DIAMOND_DRILL, "tool/diamond_drill");
|
||||
|
|
|
@ -44,6 +44,8 @@ import reborncore.common.powerSystem.TilePowerAcceptor;
|
|||
import techreborn.Core;
|
||||
import techreborn.client.container.builder.slot.FilteredSlot;
|
||||
import techreborn.client.container.builder.slot.UpgradeSlot;
|
||||
import techreborn.compat.CompatManager;
|
||||
import techreborn.utils.IC2ItemCharger;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.IntConsumer;
|
||||
|
@ -89,7 +91,7 @@ public class ContainerTileInventoryBuilder {
|
|||
public ContainerTileInventoryBuilder energySlot(final int index, final int x, final int y) {
|
||||
this.parent.slots.add(new FilteredSlot(this.tile, index, x, y)
|
||||
.setFilter(stack -> stack.hasCapability(CapabilityEnergy.ENERGY, EnumFacing.UP)
|
||||
|| stack.getItem() instanceof IEnergyInterfaceItem));
|
||||
|| stack.getItem() instanceof IEnergyInterfaceItem || (CompatManager.isIC2Loaded && IC2ItemCharger.isIC2PoweredItem(stack))));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -124,6 +126,7 @@ public class ContainerTileInventoryBuilder {
|
|||
* @param supplier The supplier must supply a variable holding inside a Short, it
|
||||
* will be truncated by force.
|
||||
* @param setter The setter to call when the variable has been updated.
|
||||
* @return ContainerTileInventoryBuilder Inventory which will do the sync
|
||||
*/
|
||||
public ContainerTileInventoryBuilder syncShortValue(final IntSupplier supplier, final IntConsumer setter) {
|
||||
this.parent.shortValues.add(Pair.of(supplier, setter));
|
||||
|
@ -134,6 +137,7 @@ public class ContainerTileInventoryBuilder {
|
|||
* @param supplier The supplier it can supply a variable holding in an Integer it
|
||||
* will be split inside multiples shorts.
|
||||
* @param setter The setter to call when the variable has been updated.
|
||||
* @return ContainerTileInventoryBuilder Inventory which will do the sync
|
||||
*/
|
||||
public ContainerTileInventoryBuilder syncIntegerValue(final IntSupplier supplier, final IntConsumer setter) {
|
||||
this.parent.integerValues.add(Pair.of(supplier, setter));
|
||||
|
|
|
@ -353,6 +353,7 @@ public class TRBuilder extends GuiBuilder {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawSlot(GuiScreen gui, int posX, int posY) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(GUI_SHEET);
|
||||
gui.drawTexturedModalRect(posX, posY, 150, 0, 18, 18);
|
||||
|
@ -387,6 +388,7 @@ public class TRBuilder extends GuiBuilder {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawOutputSlot(GuiScreen gui, int posX, int posY) {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(GUI_SHEET);
|
||||
gui.drawTexturedModalRect(posX, posY, 150, 18, 26, 26);
|
||||
|
|
|
@ -232,6 +232,7 @@ public class GuiAutoCrafting extends GuiBase {
|
|||
this.recipeSlector.slotClicked(slotIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGuiClosed() {
|
||||
this.recipeSlector.removed();
|
||||
super.onGuiClosed();
|
||||
|
|
|
@ -24,11 +24,17 @@
|
|||
|
||||
package techreborn.compat.buildcraft;
|
||||
|
||||
import buildcraft.builders.BCBuildersBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import reborncore.common.util.RebornCraftingHelper;
|
||||
import reborncore.common.util.RecipeRemover;
|
||||
import techreborn.compat.CompatConfigs;
|
||||
import techreborn.compat.ICompatModule;
|
||||
import techreborn.init.ModItems;
|
||||
|
||||
/**
|
||||
* Created by Mark on 02/06/2017.
|
||||
|
@ -47,16 +53,16 @@ public class BuildcraftBuildersCompat implements ICompatModule {
|
|||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
// if (expensiveQuarry) {
|
||||
// RecipeRemover.removeAnyRecipe(new ItemStack(BCBuildersBlocks.quarry));
|
||||
// RebornCraftingHelper.addShapedOreRecipe(new ItemStack(BCBuildersBlocks.quarry),
|
||||
// "IAI", "GIG", "DED",
|
||||
// 'I', "gearIron",
|
||||
// 'G', "gearGold",
|
||||
// 'D', "gearDiamond",
|
||||
// 'A', "circuitAdvanced",
|
||||
// 'E', new ItemStack(ModItems.DIAMOND_DRILL));
|
||||
// }
|
||||
if (CompatConfigs.expensiveQuarry) {
|
||||
RecipeRemover.removeAnyRecipe(new ItemStack(BCBuildersBlocks.quarry));
|
||||
RebornCraftingHelper.addShapedOreRecipe(new ItemStack(BCBuildersBlocks.quarry),
|
||||
"IAI", "GIG", "DED",
|
||||
'I', "gearIron",
|
||||
'G', "gearGold",
|
||||
'D', "gearDiamond",
|
||||
'A', "circuitAdvanced",
|
||||
'E', new ItemStack(ModItems.DIAMOND_DRILL));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -24,10 +24,16 @@
|
|||
|
||||
package techreborn.compat.buildcraft;
|
||||
|
||||
import buildcraft.api.fuels.IFuel;
|
||||
import buildcraft.lib.fluid.FuelRegistry;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import reborncore.common.RebornCoreConfig;
|
||||
import techreborn.api.generator.EFluidGenerator;
|
||||
import techreborn.api.generator.GeneratorRecipeHelper;
|
||||
import techreborn.compat.CompatConfigs;
|
||||
import techreborn.compat.ICompatModule;
|
||||
|
||||
/**
|
||||
|
@ -47,11 +53,11 @@ public class BuildcraftCompat implements ICompatModule {
|
|||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
// if (allowBCFuels) {
|
||||
// for (IFuel fuel : FuelRegistry.INSTANCE.getFuels()) {
|
||||
// FluidPowerManager.fluidPowerValues.put(fuel.getFluid(), (double) fuel.getPowerPerCycle() / RebornCoreConfig.euPerFU);
|
||||
// }
|
||||
// }
|
||||
if (CompatConfigs.allowBCFuels) {
|
||||
for (IFuel fuel : FuelRegistry.INSTANCE.getFuels()) {
|
||||
GeneratorRecipeHelper.registerFluidRecipe(EFluidGenerator.THERMAL, fuel.getFluid().getFluid(), (int) (fuel.getPowerPerCycle() / RebornCoreConfig.euPerFU));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -56,7 +56,7 @@ public class CTScrapbox {
|
|||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
ScrapboxList.stacks.remove(output);
|
||||
ScrapboxList.stacks.remove(CraftTweakerCompat.toStack(output));
|
||||
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public class RecipesIC2 implements ICompatModule {
|
|||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
recipeDuplicateList.add(new RecipeDuplicate(new ItemStack(ModBlocks.MACHINE_FRAMES, 0, 1), IC2Items.getItem("resource", "machine")));
|
||||
recipeDuplicateList.add(new RecipeDuplicate(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 0), IC2Items.getItem("resource", "machine")));
|
||||
|
||||
for (RecipeDuplicate duplicate : recipeDuplicateList) {
|
||||
duplicate.add();
|
||||
|
@ -64,7 +64,6 @@ public class RecipesIC2 implements ICompatModule {
|
|||
public void postInit(FMLPostInitializationEvent event) {
|
||||
RebornCraftingHelper.addShapelessRecipe(ItemParts.getPartByName("rubber"), IC2Items.getItem("crafting", "rubber"));
|
||||
RebornCraftingHelper.addShapelessRecipe(IC2Items.getItem("crafting", "rubber"), ItemParts.getPartByName("rubber"));
|
||||
|
||||
RebornCraftingHelper.addShapelessRecipe(IC2Items.getItem("electric_wrench"), new ItemStack(ModItems.WRENCH), IC2Items.getItem("crafting", "small_power_unit"));
|
||||
}
|
||||
|
||||
|
@ -74,9 +73,7 @@ public class RecipesIC2 implements ICompatModule {
|
|||
}
|
||||
|
||||
public class RecipeDuplicate {
|
||||
|
||||
ItemStack stack1;
|
||||
|
||||
ItemStack stack2;
|
||||
|
||||
public RecipeDuplicate(ItemStack stack1, ItemStack stack2) {
|
||||
|
@ -85,12 +82,8 @@ public class RecipesIC2 implements ICompatModule {
|
|||
}
|
||||
|
||||
public void add() {
|
||||
|
||||
RebornCraftingHelper.addShapelessRecipe(stack2, stack1);
|
||||
RebornCraftingHelper.addShapelessRecipe(stack1, stack2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -38,7 +38,6 @@ import reborncore.common.powerSystem.PowerSystem;
|
|||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.awt.*;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.List;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
|
|
|
@ -32,6 +32,7 @@ import techreborn.compat.jei.RecipeCategoryUids;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class AssemblingMachineRecipeHandler implements IRecipeHandler<AssemblingMachineRecipe> {
|
||||
@Nonnull
|
||||
private final IJeiHelpers jeiHelpers;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
package techreborn.compat.jei.fusionReactor;
|
||||
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import mezz.jei.api.recipe.IRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import techreborn.api.reactor.FusionReactorRecipe;
|
||||
|
@ -34,7 +34,7 @@ import techreborn.compat.jei.RecipeUtil;
|
|||
import javax.annotation.Nonnull;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class FusionReactorRecipeWrapper extends BlankRecipeWrapper {
|
||||
public class FusionReactorRecipeWrapper implements IRecipeWrapper {
|
||||
private final FusionReactorRecipe baseRecipe;
|
||||
|
||||
public FusionReactorRecipeWrapper(FusionReactorRecipe baseRecipe) {
|
||||
|
@ -42,9 +42,7 @@ public class FusionReactorRecipeWrapper extends BlankRecipeWrapper {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void getIngredients(
|
||||
@Nonnull
|
||||
IIngredients ingredients) {
|
||||
public void getIngredients(@Nonnull IIngredients ingredients) {
|
||||
ingredients.setInputs(ItemStack.class, Arrays.asList(baseRecipe.getTopInput(), baseRecipe.getBottomInput()));
|
||||
ingredients.setOutput(ItemStack.class, baseRecipe.getOutput());
|
||||
}
|
||||
|
@ -58,10 +56,7 @@ public class FusionReactorRecipeWrapper extends BlankRecipeWrapper {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void drawInfo(
|
||||
@Nonnull
|
||||
Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
RecipeUtil.drawInfo(minecraft, 0, 67, baseRecipe.getStartEU(), baseRecipe.getEuTick(),
|
||||
baseRecipe.getTickTime());
|
||||
public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
RecipeUtil.drawInfo(minecraft, 0, 67, baseRecipe.getStartEU(), baseRecipe.getEuTick(), baseRecipe.getTickTime());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ import techreborn.compat.jei.RecipeCategoryUids;
|
|||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
@SuppressWarnings({"deprecation" })
|
||||
public class RollingMachineRecipeHandler implements IRecipeHandler<RollingMachineRecipeWrapper> {
|
||||
@Nonnull
|
||||
@Override
|
||||
|
|
|
@ -52,13 +52,13 @@ public class RollingMachineRecipeWrapper implements IRecipeWrapper {
|
|||
IJeiHelpers jeiHelpers, IRecipe baseRecipe) {
|
||||
IRecipeWrapper recipeWrapper;
|
||||
if (baseRecipe instanceof ShapelessRecipes) {
|
||||
recipeWrapper = new ShapelessRecipeWrapper(jeiHelpers, baseRecipe);
|
||||
recipeWrapper = new ShapelessRecipeWrapper<IRecipe>(jeiHelpers, baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapedRecipes) {
|
||||
recipeWrapper = new ShapedRecipesWrapper(jeiHelpers, (ShapedRecipes) baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapedOreRecipe) {
|
||||
recipeWrapper = new ShapedOreRecipeWrapper(jeiHelpers, (ShapedOreRecipe) baseRecipe);
|
||||
} else if (baseRecipe instanceof ShapelessOreRecipe) {
|
||||
recipeWrapper = new ShapelessRecipeWrapper(jeiHelpers, baseRecipe);
|
||||
recipeWrapper = new ShapelessRecipeWrapper<IRecipe>(jeiHelpers, baseRecipe);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
109
src/main/java/techreborn/events/FluidBlockModelHandler.java
Normal file
109
src/main/java/techreborn/events/FluidBlockModelHandler.java
Normal file
|
@ -0,0 +1,109 @@
|
|||
/*
|
||||
* 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.events;
|
||||
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.event.ModelRegistryEvent;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import techreborn.blocks.fluid.BlockFluidTechReborn;
|
||||
import techreborn.init.ModFluids;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
/**
|
||||
* @author drcrazy
|
||||
*
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class FluidBlockModelHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void registerModels(ModelRegistryEvent event) {
|
||||
registerFluidBlockModel(ModFluids.BLOCK_BERYLLIUM);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_CALCIUM);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_CALCIUM_CARBONATE);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_CHLORITE);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_DEUTERIUM);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_GLYCERYL);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_HELIUM);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_HELIUM_3);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_HELIUMPLASMA);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_HYDROGEN);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_LITHIUM);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_MERCURY);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_METHANE);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_NITROCOAL_FUEL);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_NITROFUEL);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_NITROGEN);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_NITROGENDIOXIDE);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_POTASSIUM);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_SILICON);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_SODIUM);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_SODIUMPERSULFATE);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_TRITIUM);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_WOLFRAMIUM);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_CARBON);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_CARBON_FIBER);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_NITRO_CARBON);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_SULFUR);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_SODIUM_SULFIDE);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_DIESEL);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_NITRO_DIESEL);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_OIL);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_SULFURIC_ACID);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_COMPRESSED_AIR);
|
||||
registerFluidBlockModel(ModFluids.BLOCK_ELECTROLYZED_WATER);
|
||||
}
|
||||
|
||||
private static void registerFluidBlockModel(BlockFluidTechReborn block) {
|
||||
String name = block.getUnlocalizedName().substring(5).toLowerCase();
|
||||
Item item = Item.getItemFromBlock(block);
|
||||
ModelResourceLocation location = new ModelResourceLocation(
|
||||
new ResourceLocation(ModInfo.MOD_ID.toLowerCase(), "fluids"), name);
|
||||
|
||||
ModelLoader.registerItemVariants(item);
|
||||
ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition() {
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
return location;
|
||||
}
|
||||
});
|
||||
ModelLoader.setCustomStateMapper(block, new StateMapperBase() {
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
|
||||
return location;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
|
@ -29,7 +29,6 @@ import net.minecraft.block.material.Material;
|
|||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import reborncore.RebornRegistry;
|
||||
import techreborn.blocks.fluid.BlockFluidBase;
|
||||
import techreborn.blocks.fluid.BlockFluidTechReborn;
|
||||
import techreborn.blocks.fluid.TechRebornFluid;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
@ -37,113 +36,113 @@ import techreborn.lib.ModInfo;
|
|||
public class ModFluids {
|
||||
|
||||
public static Fluid BERYLLIUM = new TechRebornFluid("fluidberylium");
|
||||
public static BlockFluidBase BLOCK_BERYLLIUM;
|
||||
public static BlockFluidTechReborn BLOCK_BERYLLIUM;
|
||||
|
||||
public static Fluid CALCIUM = new TechRebornFluid("fluidcalcium");
|
||||
public static BlockFluidBase BLOCK_CALCIUM;
|
||||
public static BlockFluidTechReborn BLOCK_CALCIUM;
|
||||
|
||||
public static Fluid CALCIUM_CARBONATE = new TechRebornFluid("fluidcalciumcarbonate");
|
||||
public static BlockFluidBase BLOCK_CALCIUM_CARBONATE;
|
||||
public static BlockFluidTechReborn BLOCK_CALCIUM_CARBONATE;
|
||||
|
||||
public static Fluid CHLORITE = new TechRebornFluid("fluidchlorite");
|
||||
public static BlockFluidBase BLOCK_CHLORITE;
|
||||
public static BlockFluidTechReborn BLOCK_CHLORITE;
|
||||
|
||||
public static Fluid DEUTERIUM = new TechRebornFluid("fluiddeuterium");
|
||||
public static BlockFluidBase BLOCK_DEUTERIUM;
|
||||
public static BlockFluidTechReborn BLOCK_DEUTERIUM;
|
||||
|
||||
public static Fluid GLYCERYL = new TechRebornFluid("fluidglyceryl");
|
||||
public static BlockFluidBase BLOCK_GLYCERYL;
|
||||
public static BlockFluidTechReborn BLOCK_GLYCERYL;
|
||||
|
||||
public static Fluid HELIUM = new TechRebornFluid("fluidhelium");
|
||||
public static BlockFluidBase BLOCK_HELIUM;
|
||||
public static BlockFluidTechReborn BLOCK_HELIUM;
|
||||
|
||||
public static Fluid HELIUM_3 = new TechRebornFluid("fluidhelium3");
|
||||
public static BlockFluidBase BLOCK_HELIUM_3;
|
||||
public static BlockFluidTechReborn BLOCK_HELIUM_3;
|
||||
|
||||
public static Fluid HELIUMPLASMA = new TechRebornFluid("fluidheliumplasma");
|
||||
public static BlockFluidBase BLOCK_HELIUMPLASMA;
|
||||
public static BlockFluidTechReborn BLOCK_HELIUMPLASMA;
|
||||
|
||||
public static Fluid HYDROGEN = new TechRebornFluid("fluidhydrogen");
|
||||
public static BlockFluidBase BLOCK_HYDROGEN;
|
||||
public static BlockFluidTechReborn BLOCK_HYDROGEN;
|
||||
|
||||
public static Fluid LITHIUM = new TechRebornFluid("fluidlithium");
|
||||
public static BlockFluidBase BLOCK_LITHIUM;
|
||||
public static BlockFluidTechReborn BLOCK_LITHIUM;
|
||||
|
||||
public static Fluid MERCURY = new TechRebornFluid("fluidmercury");
|
||||
public static BlockFluidBase BLOCK_MERCURY;
|
||||
public static BlockFluidTechReborn BLOCK_MERCURY;
|
||||
|
||||
public static Fluid METHANE = new TechRebornFluid("fluidmethane");
|
||||
public static BlockFluidBase BLOCK_METHANE;
|
||||
public static BlockFluidTechReborn BLOCK_METHANE;
|
||||
|
||||
public static Fluid NITROCOAL_FUEL = new TechRebornFluid("fluidnitrocoalfuel");
|
||||
public static BlockFluidBase BLOCK_NITROCOAL_FUEL;
|
||||
public static BlockFluidTechReborn BLOCK_NITROCOAL_FUEL;
|
||||
|
||||
public static Fluid NITROFUEL = new TechRebornFluid("fluidnitrofuel");
|
||||
public static BlockFluidBase BLOCK_NITROFUEL;
|
||||
public static BlockFluidTechReborn BLOCK_NITROFUEL;
|
||||
|
||||
public static Fluid NITROGEN = new TechRebornFluid("fluidnitrogen");
|
||||
public static BlockFluidBase BLOCK_NITROGEN;
|
||||
public static BlockFluidTechReborn BLOCK_NITROGEN;
|
||||
|
||||
public static Fluid NITROGENDIOXIDE = new TechRebornFluid("fluidnitrogendioxide");
|
||||
public static BlockFluidBase BLOCK_NITROGENDIOXIDE;
|
||||
public static BlockFluidTechReborn BLOCK_NITROGENDIOXIDE;
|
||||
|
||||
public static Fluid POTASSIUM = new TechRebornFluid("fluidpotassium");
|
||||
public static BlockFluidBase BLOCK_POTASSIUM;
|
||||
public static BlockFluidTechReborn BLOCK_POTASSIUM;
|
||||
|
||||
public static Fluid SILICON = new TechRebornFluid("fluidsilicon");
|
||||
public static BlockFluidBase BLOCK_SILICON;
|
||||
public static BlockFluidTechReborn BLOCK_SILICON;
|
||||
|
||||
public static Fluid SODIUM = new TechRebornFluid("fluidsodium");
|
||||
public static BlockFluidBase BLOCK_SODIUM;
|
||||
public static BlockFluidTechReborn BLOCK_SODIUM;
|
||||
|
||||
public static Fluid SODIUMPERSULFATE = new TechRebornFluid("fluidsodiumpersulfate");
|
||||
public static BlockFluidBase BLOCK_SODIUMPERSULFATE;
|
||||
public static BlockFluidTechReborn BLOCK_SODIUMPERSULFATE;
|
||||
|
||||
public static Fluid TRITIUM = new TechRebornFluid("fluidtritium");
|
||||
public static BlockFluidBase BLOCK_TRITIUM;
|
||||
public static BlockFluidTechReborn BLOCK_TRITIUM;
|
||||
|
||||
public static Fluid WOLFRAMIUM = new TechRebornFluid("fluidwolframium");
|
||||
public static BlockFluidBase BLOCK_WOLFRAMIUM;
|
||||
public static BlockFluidTechReborn BLOCK_WOLFRAMIUM;
|
||||
|
||||
public static Fluid CARBON = new TechRebornFluid("fluidcarbon");
|
||||
public static BlockFluidBase BLOCK_CARBON;
|
||||
public static BlockFluidTechReborn BLOCK_CARBON;
|
||||
|
||||
public static Fluid CARBON_FIBER = new TechRebornFluid("fluidcarbonfiber");
|
||||
public static BlockFluidBase BLOCK_CARBON_FIBER;
|
||||
public static BlockFluidTechReborn BLOCK_CARBON_FIBER;
|
||||
|
||||
public static Fluid NITRO_CARBON = new TechRebornFluid("fluidnitrocarbon");
|
||||
public static BlockFluidBase BLOCK_NITRO_CARBON;
|
||||
public static BlockFluidTechReborn BLOCK_NITRO_CARBON;
|
||||
|
||||
public static Fluid SULFUR = new TechRebornFluid("fluidSulfur");
|
||||
public static BlockFluidBase BLOCK_SULFUR;
|
||||
public static BlockFluidTechReborn BLOCK_SULFUR;
|
||||
|
||||
public static Fluid SODIUM_SULFIDE = new TechRebornFluid("fluidsodiumSulfide");
|
||||
public static BlockFluidBase BLOCK_SODIUM_SULFIDE;
|
||||
public static BlockFluidTechReborn BLOCK_SODIUM_SULFIDE;
|
||||
|
||||
public static Fluid DIESEL = new TechRebornFluid("fluiddiesel");
|
||||
public static BlockFluidBase BLOCK_DIESEL;
|
||||
public static BlockFluidTechReborn BLOCK_DIESEL;
|
||||
|
||||
public static Fluid NITRO_DIESEL = new TechRebornFluid("fluidnitrodiesel");
|
||||
public static BlockFluidBase BLOCK_NITRO_DIESEL;
|
||||
public static BlockFluidTechReborn BLOCK_NITRO_DIESEL;
|
||||
|
||||
public static Fluid OIL = new TechRebornFluid("fluidoil");
|
||||
public static BlockFluidBase BLOCK_OIL;
|
||||
public static BlockFluidTechReborn BLOCK_OIL;
|
||||
|
||||
public static Fluid SULFURIC_ACID = new TechRebornFluid("fluidsulfuricacid");
|
||||
public static BlockFluidBase BLOCK_SULFURIC_ACID;
|
||||
public static BlockFluidTechReborn BLOCK_SULFURIC_ACID;
|
||||
|
||||
public static Fluid COMPRESSED_AIR = new TechRebornFluid("fluidcompressedair");
|
||||
public static BlockFluidBase BLOCK_COMPRESSED_AIR;
|
||||
public static BlockFluidTechReborn BLOCK_COMPRESSED_AIR;
|
||||
|
||||
public static Fluid ELECTROLYZED_WATER = new TechRebornFluid("fluidelectrolyzedwater");
|
||||
public static BlockFluidBase BLOCK_ELECTROLYZED_WATER;
|
||||
public static BlockFluidTechReborn BLOCK_ELECTROLYZED_WATER;
|
||||
|
||||
public static void init() {
|
||||
FluidRegistry.registerFluid(BERYLLIUM);
|
||||
BLOCK_BERYLLIUM = new BlockFluidTechReborn(BERYLLIUM, Material.WATER, "techreborn.berylium");
|
||||
registerBlock(BLOCK_BERYLLIUM,
|
||||
ModInfo.MOD_ID + "_" + BLOCK_BERYLLIUM.getUnlocalizedName().substring(5));
|
||||
|
||||
registerBlock(BLOCK_BERYLLIUM, ModInfo.MOD_ID + "_" + BLOCK_BERYLLIUM.getUnlocalizedName().substring(5));
|
||||
|
||||
|
||||
FluidRegistry.registerFluid(CALCIUM);
|
||||
BLOCK_CALCIUM = new BlockFluidTechReborn(CALCIUM, Material.WATER, "techreborn.calcium");
|
||||
registerBlock(BLOCK_CALCIUM,
|
||||
|
|
|
@ -329,7 +329,7 @@ public class ModItems {
|
|||
registerItem(CLOAKING_DEVICE, "cloakingdevice");
|
||||
|
||||
MISSING_RECIPE_PLACEHOLDER = new ItemMissingRecipe().setUnlocalizedName("missingRecipe");
|
||||
registerItem(MISSING_RECIPE_PLACEHOLDER, "mssingRecipe");
|
||||
registerItem(MISSING_RECIPE_PLACEHOLDER, "missingRecipe");
|
||||
|
||||
DEBUG = new ItemDebugTool();
|
||||
registerItem(DEBUG, "debug");
|
||||
|
|
|
@ -162,7 +162,7 @@ public class CraftingTableRecipes extends RecipeMethods {
|
|||
registerShaped(getStack(IC2Duplicates.IRON_FURNACE), "III", "I I", "III", 'I', "ingotIron");
|
||||
registerShaped(getStack(IC2Duplicates.IRON_FURNACE), " I ", "I I", "IFI", 'I', "ingotIron", 'F', getStack(Blocks.FURNACE));
|
||||
registerShaped(getStack(IC2Duplicates.EXTRACTOR), "TMT", "TCT", " ", 'T', getStack(ModItems.TREE_TAP, true), 'M', "machineBlockBasic", 'C', "circuitBasic");
|
||||
registerShaped(getStack(IC2Duplicates.GRINDER), "FFF", "SMS", " C ", 'F', Items.FLINT, 'S', getStack(Blocks.COBBLESTONE), 'M', "machineBlockBasic", 'C', "circuitBasic");
|
||||
registerShaped(getStack(IC2Duplicates.GRINDER), "FFF", "SMS", " C ", 'F', Items.FLINT, 'S', getStack(Blocks.COBBLESTONE), 'M', getMaterial("machine", Type.MACHINE_FRAME), 'C', "circuitBasic");
|
||||
registerShaped(getStack(IC2Duplicates.SOLAR_PANEL), "DLD", "LDL", "CGC", 'D', "dustCoal", 'L', "blockGlass", 'G', getStack(IC2Duplicates.GENERATOR), 'C', "circuitBasic");
|
||||
registerShapeless(getStack(IC2Duplicates.FREQ_TRANSMITTER), getStack(IC2Duplicates.CABLE_ICOPPER), "circuitBasic");
|
||||
}
|
||||
|
|
|
@ -39,10 +39,12 @@ public class ItemBlockCable extends ItemBlock {
|
|||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int damage) {
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return super.getUnlocalizedName() + "." + EnumCableType.values()[stack.getItemDamage()].getName();
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@ public class ItemFrequencyTransmitter extends ItemTR {
|
|||
setCreativeTab(TechRebornCreativeTabMisc.instance);
|
||||
setMaxStackSize(1);
|
||||
this.addPropertyOverride(new ResourceLocation("techreborn:coords"), new IItemPropertyGetter() {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -182,21 +182,25 @@ public class ItemLapotronPack extends ItemArmor implements IEnergyItemInfo, IEne
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -204,21 +204,25 @@ public class ItemLithiumBatpack extends ItemArmor implements IEnergyItemInfo, IE
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -57,6 +57,7 @@ public class ItemBattery extends ItemTR implements IEnergyItemInfo, IEnergyInter
|
|||
this.maxEnergy = maxEnergy;
|
||||
this.maxTransfer = maxTransfer;
|
||||
this.addPropertyOverride(new ResourceLocation("techreborn:empty"), new IItemPropertyGetter() {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack stack, @Nullable World worldIn, @Nullable EntityLivingBase entityIn) {
|
||||
if (!stack.isEmpty() && PoweredItem.getEnergy(stack) == 0.0) {
|
||||
|
@ -164,21 +165,25 @@ public class ItemBattery extends ItemTR implements IEnergyItemInfo, IEnergyInter
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -68,6 +68,7 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, IEnergyInt
|
|||
this.unpoweredSpeed = unpoweredSpeed;
|
||||
|
||||
this.addPropertyOverride(new ResourceLocation("techreborn:animated"), new IItemPropertyGetter() {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack stack,
|
||||
@Nullable
|
||||
|
@ -205,21 +206,25 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo, IEnergyInt
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -209,21 +209,25 @@ public class ItemCloakingDevice extends ItemTRArmour implements IEnergyItemInfo,
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -193,21 +193,25 @@ public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo, IEnergyIn
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -190,21 +190,25 @@ public class ItemElectricTreetap extends ItemTR implements IEnergyItemInfo, IEne
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -213,21 +213,25 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, IEne
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -69,6 +69,7 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, IEnergy
|
|||
setMaxStackSize(1);
|
||||
setUnlocalizedName("techreborn.nanosaber");
|
||||
this.addPropertyOverride(new ResourceLocation("techreborn:active"), new IItemPropertyGetter() {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float apply(ItemStack stack,
|
||||
@Nullable
|
||||
|
@ -299,21 +300,25 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, IEnergy
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -237,21 +237,25 @@ public class ItemOmniTool extends ItemPickaxe implements IEnergyItemInfo, IEnerg
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -228,21 +228,25 @@ public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo, IEne
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack));
|
||||
return 1 - charge;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRGBDurabilityForDisplay(ItemStack stack) {
|
||||
return PowerSystem.getDisplayPower().colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack,
|
||||
@Nullable
|
||||
|
|
|
@ -38,6 +38,7 @@ public class ItemTRHoe extends ItemHoe {
|
|||
TRRecipeHandler.hideEntry(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D() {
|
||||
return true;
|
||||
|
|
|
@ -68,6 +68,7 @@ public class ItemWrench extends ItemTR implements IToolHandler {
|
|||
return EnumActionResult.PASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D() {
|
||||
return true;
|
||||
|
|
|
@ -29,7 +29,6 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.common.multiblock.CoordTriplet;
|
||||
import reborncore.common.multiblock.IMultiblockPart;
|
||||
import reborncore.common.multiblock.MultiblockControllerBase;
|
||||
import reborncore.common.multiblock.MultiblockValidationException;
|
||||
|
@ -68,13 +67,13 @@ public class MultiBlockCasing extends RectangularMultiblockControllerBase {
|
|||
throw new MultiblockValidationException("Machine is too small.");
|
||||
}
|
||||
|
||||
CoordTriplet maximumCoord = getMaximumCoord();
|
||||
CoordTriplet minimumCoord = getMinimumCoord();
|
||||
BlockPos maximumCoord = getMaximumCoord();
|
||||
BlockPos minimumCoord = getMinimumCoord();
|
||||
|
||||
// Quickly check for exceeded dimensions
|
||||
int deltaX = maximumCoord.x - minimumCoord.x + 1;
|
||||
int deltaY = maximumCoord.y - minimumCoord.y + 1;
|
||||
int deltaZ = maximumCoord.z - minimumCoord.z + 1;
|
||||
int deltaX = maximumCoord.getX() - minimumCoord.getX() + 1;
|
||||
int deltaY = maximumCoord.getY() - minimumCoord.getY() + 1;
|
||||
int deltaZ = maximumCoord.getZ() - minimumCoord.getZ() + 1;
|
||||
|
||||
int maxX = getMaximumXSize();
|
||||
int maxY = getMaximumYSize();
|
||||
|
@ -127,9 +126,9 @@ public class MultiBlockCasing extends RectangularMultiblockControllerBase {
|
|||
RectangularMultiblockTileEntityBase part;
|
||||
Class<? extends RectangularMultiblockControllerBase> myClass = this.getClass();
|
||||
|
||||
for (int x = minimumCoord.x; x <= maximumCoord.x; x++) {
|
||||
for (int y = minimumCoord.y; y <= maximumCoord.y; y++) {
|
||||
for (int z = minimumCoord.z; z <= maximumCoord.z; z++) {
|
||||
for (int x = minimumCoord.getX(); x <= maximumCoord.getX(); x++) {
|
||||
for (int y = minimumCoord.getY(); y <= maximumCoord.getY(); y++) {
|
||||
for (int z = minimumCoord.getZ(); z <= maximumCoord.getZ(); z++) {
|
||||
// Okay, figure out what sort of block this should be.
|
||||
|
||||
te = this.worldObj.getTileEntity(new BlockPos(x, y, z));
|
||||
|
@ -152,23 +151,23 @@ public class MultiBlockCasing extends RectangularMultiblockControllerBase {
|
|||
// Validate block type against both part-level and
|
||||
// material-level validators.
|
||||
int extremes = 0;
|
||||
if (x == minimumCoord.x) {
|
||||
if (x == minimumCoord.getX()) {
|
||||
extremes++;
|
||||
}
|
||||
if (y == minimumCoord.y) {
|
||||
if (y == minimumCoord.getY()) {
|
||||
extremes++;
|
||||
}
|
||||
if (z == minimumCoord.z) {
|
||||
if (z == minimumCoord.getZ()) {
|
||||
extremes++;
|
||||
}
|
||||
|
||||
if (x == maximumCoord.x) {
|
||||
if (x == maximumCoord.getX()) {
|
||||
extremes++;
|
||||
}
|
||||
if (y == maximumCoord.y) {
|
||||
if (y == maximumCoord.getY()) {
|
||||
extremes++;
|
||||
}
|
||||
if (z == maximumCoord.z) {
|
||||
if (z == maximumCoord.getZ()) {
|
||||
extremes++;
|
||||
}
|
||||
|
||||
|
@ -179,13 +178,13 @@ public class MultiBlockCasing extends RectangularMultiblockControllerBase {
|
|||
isBlockGoodForFrame(this.worldObj, x, y, z);
|
||||
}
|
||||
} else if (extremes == 1) {
|
||||
if (y == maximumCoord.y) {
|
||||
if (y == maximumCoord.getY()) {
|
||||
if (part != null) {
|
||||
part.isGoodForTop();
|
||||
} else {
|
||||
isBlockGoodForTop(this.worldObj, x, y, z);
|
||||
}
|
||||
} else if (y == minimumCoord.y) {
|
||||
} else if (y == minimumCoord.getY()) {
|
||||
if (part != null) {
|
||||
part.isGoodForBottom();
|
||||
} else {
|
||||
|
|
|
@ -24,19 +24,10 @@
|
|||
|
||||
package techreborn.proxies;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.statemap.DefaultStateMapper;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMap;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||
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.util.ResourceLocation;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
@ -59,6 +50,7 @@ import techreborn.client.keybindings.KeyBindings;
|
|||
import techreborn.client.render.ModelDynamicCell;
|
||||
import techreborn.client.render.entitys.RenderNukePrimed;
|
||||
import techreborn.entities.EntityNukePrimed;
|
||||
import techreborn.events.FluidBlockModelHandler;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.items.ItemFrequencyTransmitter;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
@ -67,26 +59,6 @@ public class ClientProxy extends CommonProxy {
|
|||
|
||||
public static MultiblockRenderEvent multiblockRenderEvent;
|
||||
|
||||
public static ResourceLocation getItemLocation(Item item) {
|
||||
Object o = item.getRegistryName();
|
||||
if (o == null) {
|
||||
return null;
|
||||
}
|
||||
return (ResourceLocation) o;
|
||||
}
|
||||
|
||||
private static ResourceLocation registerIt(Item item, final ResourceLocation location) {
|
||||
ModelLoader.setCustomMeshDefinition(item, new ItemMeshDefinition() {
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
return new ModelResourceLocation(location, "inventory");
|
||||
}
|
||||
});
|
||||
ModelLoader.registerItemVariants(item, location);
|
||||
|
||||
return location;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
super.preInit(event);
|
||||
|
@ -96,12 +68,7 @@ public class ClientProxy extends CommonProxy {
|
|||
ModelDynamicCell.init();
|
||||
RegisterItemJsons.registerModels();
|
||||
MinecraftForge.EVENT_BUS.register(new IconSupplier());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerSubItemInventoryLocation(Item item, int meta, String location, String name) {
|
||||
ModelResourceLocation resourceLocation = new ModelResourceLocation(location, name);
|
||||
ModelLoader.setCustomModelResourceLocation(item, meta, resourceLocation);
|
||||
MinecraftForge.EVENT_BUS.register(new FluidBlockModelHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -117,74 +84,6 @@ public class ClientProxy extends CommonProxy {
|
|||
ModelLoader.setCustomStateMapper(ModBlocks.RUBBER_LEAVES, rubberLeavesStateMap);
|
||||
}
|
||||
|
||||
protected void registerItemModel(ItemStack item, String name) {
|
||||
// tell Minecraft which textures it has to load. This is resource-domain sensitive
|
||||
ModelLoader.registerItemVariants(item.getItem(), new ResourceLocation(name));
|
||||
// tell the game which model to use for this item-meta combination
|
||||
ModelLoader.setCustomModelResourceLocation(item.getItem(), item
|
||||
.getMetadata(), new ModelResourceLocation(name, "inventory"));
|
||||
}
|
||||
|
||||
public ResourceLocation registerItemModel(Item item) {
|
||||
ResourceLocation itemLocation = getItemLocation(item);
|
||||
if (itemLocation == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return registerIt(item, itemLocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerFluidBlockRendering(Block block, String name) {
|
||||
name = name.toLowerCase();
|
||||
super.registerFluidBlockRendering(block, name);
|
||||
final ModelResourceLocation fluidLocation = new ModelResourceLocation(ModInfo.MOD_ID.toLowerCase() + ":fluids", name);
|
||||
|
||||
// use a custom state mapper which will ignore the LEVEL property
|
||||
ModelLoader.setCustomStateMapper(block, new StateMapperBase() {
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
|
||||
return fluidLocation;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCustomBlockStateLocation(Block block, String resourceLocation) {
|
||||
resourceLocation = resourceLocation.toLowerCase();
|
||||
super.registerCustomBlockStateLocation(block, resourceLocation);
|
||||
String finalResourceLocation = resourceLocation;
|
||||
ModelLoader.setCustomStateMapper(block, new DefaultStateMapper() {
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
|
||||
String resourceDomain = Block.REGISTRY.getNameForObject(state.getBlock()).getResourceDomain();
|
||||
String propertyString = getPropertyString(state.getProperties());
|
||||
return new ModelResourceLocation(resourceDomain + ':' + finalResourceLocation, propertyString);
|
||||
}
|
||||
});
|
||||
String resourceDomain = Block.REGISTRY.getNameForObject(block).getResourceDomain();
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(resourceDomain + ':' + resourceLocation, "inventory"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCustomBlockStateLocation(Block block, String resourceLocation, boolean item) {
|
||||
resourceLocation = resourceLocation.toLowerCase();
|
||||
super.registerCustomBlockStateLocation(block, resourceLocation, item);
|
||||
String finalResourceLocation = resourceLocation;
|
||||
ModelLoader.setCustomStateMapper(block, new DefaultStateMapper() {
|
||||
@Override
|
||||
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
|
||||
String resourceDomain = Block.REGISTRY.getNameForObject(state.getBlock()).getResourceDomain();
|
||||
String propertyString = getPropertyString(state.getProperties());
|
||||
return new ModelResourceLocation(resourceDomain + ':' + finalResourceLocation, propertyString);
|
||||
}
|
||||
});
|
||||
if (item) {
|
||||
String resourceDomain = Block.REGISTRY.getNameForObject(block).getResourceDomain();
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(resourceDomain + ':' + resourceLocation, "inventory"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCTMAvailable() {
|
||||
return isChiselAround;
|
||||
|
|
|
@ -24,9 +24,6 @@
|
|||
|
||||
package techreborn.proxies;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
@ -39,7 +36,6 @@ public class CommonProxy implements ICompatModule {
|
|||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
isChiselAround = Loader.isModLoaded("chisel");
|
||||
if (isChiselAround) {
|
||||
Core.logHelper.info("Hello chisel, shiny things will be enabled in techreborn");
|
||||
}
|
||||
|
@ -60,26 +56,6 @@ public class CommonProxy implements ICompatModule {
|
|||
|
||||
}
|
||||
|
||||
public void registerFluidBlockRendering(Block block, String name) {
|
||||
|
||||
}
|
||||
|
||||
public void registerCustomBlockStateLocation(Block block, String name) {
|
||||
|
||||
}
|
||||
|
||||
public void registerCustomBlockStateLocation(Block block, String name, boolean item) {
|
||||
|
||||
}
|
||||
|
||||
public void registerSubItemInventoryLocation(Item item, int meta, String location, String name) {
|
||||
|
||||
}
|
||||
|
||||
public void registerSubBlockInventoryLocation(Block block, int meta, String location, String name) {
|
||||
registerSubItemInventoryLocation(Item.getItemFromBlock(block), meta, location, name);
|
||||
}
|
||||
|
||||
public boolean isCTMAvailable() {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -226,41 +226,44 @@ public class TileAutoCraftingTable extends TilePowerAcceptor implements IContain
|
|||
}
|
||||
|
||||
public boolean make(IRecipe recipe) {
|
||||
if (canMake(recipe)) {
|
||||
if (recipe == null && customRecipe) {
|
||||
IRecipe recipe2 = recipe;
|
||||
if (canMake(recipe2)) {
|
||||
if (recipe2 == null && customRecipe) {
|
||||
if (lastCustomRecipe == null) {
|
||||
return false;
|
||||
}//Should be uptodate as we just set it in canMake
|
||||
recipe = lastCustomRecipe;
|
||||
}
|
||||
for (int i = 0; i < recipe.getIngredients().size(); i++) {
|
||||
Ingredient ingredient = recipe.getIngredients().get(i);
|
||||
//Looks for the best slot to take it from
|
||||
ItemStack bestSlot = inventory.getStackInSlot(i);
|
||||
if (ingredient.apply(bestSlot)) {
|
||||
handleContainerItem(bestSlot);
|
||||
bestSlot.shrink(1);
|
||||
} else {
|
||||
for (int j = 0; j < 9; j++) {
|
||||
ItemStack stack = inventory.getStackInSlot(j);
|
||||
if (ingredient.apply(stack)) {
|
||||
handleContainerItem(stack);
|
||||
stack.shrink(1); //TODO is this right? or do I need to use it as an actull crafting grid
|
||||
break;
|
||||
else if (recipe2 != null) {
|
||||
for (int i = 0; i < recipe2.getIngredients().size(); i++) {
|
||||
Ingredient ingredient = recipe2.getIngredients().get(i);
|
||||
//Looks for the best slot to take it from
|
||||
ItemStack bestSlot = inventory.getStackInSlot(i);
|
||||
if (ingredient.apply(bestSlot)) {
|
||||
handleContainerItem(bestSlot);
|
||||
bestSlot.shrink(1);
|
||||
} else {
|
||||
for (int j = 0; j < 9; j++) {
|
||||
ItemStack stack = inventory.getStackInSlot(j);
|
||||
if (ingredient.apply(stack)) {
|
||||
handleContainerItem(stack);
|
||||
stack.shrink(1); //TODO is this right? or do I need to use it as an actull crafting grid
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ItemStack output = inventory.getStackInSlot(9);
|
||||
//TODO fire forge recipe event
|
||||
ItemStack ouputStack = recipe2.getCraftingResult(getCraftingInventory());
|
||||
if (output.isEmpty()) {
|
||||
inventory.setInventorySlotContents(9, ouputStack.copy());
|
||||
} else {
|
||||
//TODO use ouputStack in someway?
|
||||
output.grow(recipe2.getRecipeOutput().getCount());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
ItemStack output = inventory.getStackInSlot(9);
|
||||
//TODO fire forge recipe event
|
||||
ItemStack ouputStack = recipe.getCraftingResult(getCraftingInventory());
|
||||
if (output.isEmpty()) {
|
||||
inventory.setInventorySlotContents(9, ouputStack.copy());
|
||||
} else {
|
||||
//TODO use ouputStack in someway?
|
||||
output.grow(recipe.getRecipeOutput().getCount());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -72,6 +72,8 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase
|
|||
/**
|
||||
* Returns the number of ticks that the supplied fuel item will keep the
|
||||
* furnace burning, or 0 if the item isn't fuel
|
||||
* @param stack Itemstack of fuel
|
||||
* @return Integer Number of ticks
|
||||
*/
|
||||
public static int getItemBurnTime(ItemStack stack) {
|
||||
if (stack.isEmpty()) {
|
||||
|
@ -273,6 +275,7 @@ public class TileIronAlloyFurnace extends TileLegacyMachineBase
|
|||
|
||||
/**
|
||||
* Furnace isBurning
|
||||
* @return Boolean True if furnace is burning
|
||||
*/
|
||||
public boolean isBurning() {
|
||||
return this.burnTime > 0;
|
||||
|
|
|
@ -235,9 +235,9 @@ public class TileIronFurnace extends TileLegacyMachineBase
|
|||
@Override
|
||||
public BuiltContainer createContainer(final EntityPlayer player) {
|
||||
return new ContainerBuilder("ironfurnace").player(player.inventory).inventory(8, 84).hotbar(8, 142)
|
||||
.addInventory().tile(this).slot(0, 56, 17).outputSlot(1, 116, 35).fuelSlot(2, 56, 53)
|
||||
.syncIntegerValue(this::getBurnTime, this::setBurnTime)
|
||||
.syncIntegerValue(this::getProgress, this::setProgress)
|
||||
.syncIntegerValue(this::getTotalBurnTime, this::setTotalBurnTime).addInventory().create(this);
|
||||
.addInventory().tile(this).fuelSlot(2, 56, 53).slot(0, 56, 17).outputSlot(1, 116, 35)
|
||||
.syncIntegerValue(this::getBurnTime, this::setBurnTime)
|
||||
.syncIntegerValue(this::getProgress, this::setProgress)
|
||||
.syncIntegerValue(this::getTotalBurnTime, this::setTotalBurnTime).addInventory().create(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,6 +76,7 @@ public class TileMachineCasing extends RectangularMultiblockTileEntityBase {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public MultiBlockCasing getMultiblockController() {
|
||||
return (MultiBlockCasing) super.getMultiblockController();
|
||||
}
|
||||
|
|
|
@ -143,6 +143,7 @@ public class TilePump extends TilePowerAcceptor {
|
|||
readFromNBTWithoutCoords(tagCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBTWithoutCoords(NBTTagCompound tagCompound) {
|
||||
tank.readFromNBT(tagCompound);
|
||||
}
|
||||
|
@ -154,6 +155,7 @@ public class TilePump extends TilePowerAcceptor {
|
|||
return tagCompound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBTWithoutCoords(NBTTagCompound tagCompound) {
|
||||
tank.writeToNBT(tagCompound);
|
||||
return tagCompound;
|
||||
|
|
|
@ -114,7 +114,7 @@ public class TileRollingMachine extends TilePowerAcceptor
|
|||
boolean hasCrafted = false;
|
||||
if (this.inventory.getStackInSlot(outputSlot) == ItemStack.EMPTY) {
|
||||
this.inventory.setInventorySlotContents(outputSlot, this.currentRecipe);
|
||||
this.tickTime = -1;
|
||||
this.tickTime = 0;
|
||||
hasCrafted = true;
|
||||
} else {
|
||||
if (this.inventory.getStackInSlot(outputSlot).getCount() + this.currentRecipe.getCount() <= this.currentRecipe
|
||||
|
@ -122,7 +122,7 @@ public class TileRollingMachine extends TilePowerAcceptor
|
|||
final ItemStack stack = this.inventory.getStackInSlot(outputSlot);
|
||||
stack.setCount(stack.getCount() + this.currentRecipe.getCount());
|
||||
this.inventory.setInventorySlotContents(outputSlot, stack);
|
||||
this.tickTime = -1;
|
||||
this.tickTime = 0;
|
||||
hasCrafted = true;
|
||||
}
|
||||
}
|
||||
|
@ -136,13 +136,13 @@ public class TileRollingMachine extends TilePowerAcceptor
|
|||
}
|
||||
}
|
||||
if (!this.currentRecipe.isEmpty()) {
|
||||
if (this.canUseEnergy(energyPerTick) && this.tickTime < TileRollingMachine.runTime) {
|
||||
if (this.canUseEnergy(energyPerTick) && this.tickTime < TileRollingMachine.runTime && canMake()) {
|
||||
this.useEnergy(energyPerTick);
|
||||
this.tickTime++;
|
||||
}
|
||||
}
|
||||
if (this.currentRecipe.isEmpty()) {
|
||||
this.tickTime = -1;
|
||||
this.tickTime = 0;
|
||||
}
|
||||
} else {
|
||||
this.currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe(this.craftMatrix, this.world);
|
||||
|
@ -155,7 +155,15 @@ public class TileRollingMachine extends TilePowerAcceptor
|
|||
}
|
||||
|
||||
public boolean canMake() {
|
||||
return RollingMachineRecipe.instance.findMatchingRecipe(this.craftMatrix, this.world) != null;
|
||||
ItemStack stack = RollingMachineRecipe.instance.findMatchingRecipe(this.craftMatrix, this.world);
|
||||
if(stack.isEmpty()){
|
||||
return false;
|
||||
}
|
||||
ItemStack output = getStackInSlot(outputSlot);
|
||||
if(output.isEmpty()){
|
||||
return true;
|
||||
}
|
||||
return ItemUtils.isItemEqual(stack, output, true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -169,6 +169,11 @@ public class TileFusionControlComputer extends TilePowerAcceptor implements IToo
|
|||
private boolean isCoil(final int x, final int y, final int z) {
|
||||
return this.world.getBlockState(new BlockPos(x, y, z)).getBlock() == ModBlocks.FUSION_COIL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
this.checkCoils();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
|
|
|
@ -92,11 +92,13 @@ public class TileInterdimensionalSU extends TileEnergyStorage implements IContai
|
|||
return input <= IDSUManager.getData(world).getStoredPower();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
this.ownerUdid = nbttagcompound.getString("ownerUdid");
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
if (ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) {
|
||||
|
|
|
@ -29,6 +29,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.common.RebornCoreConfig;
|
||||
import reborncore.common.registration.RebornRegistry;
|
||||
import reborncore.common.registration.impl.ConfigRegistry;
|
||||
import techreborn.blocks.storage.BlockLapotronicSU;
|
||||
|
@ -89,7 +90,7 @@ public class TileLapotronicSU extends TileEnergyStorage implements IContainerPro
|
|||
}
|
||||
}
|
||||
}
|
||||
this.maxStorage = ((connectedBlocks + 1) * storagePerBlock);
|
||||
setMaxStorage();
|
||||
this.maxOutput = (connectedBlocks * extraIOPerBlock) + baseOutput;
|
||||
}
|
||||
|
||||
|
@ -110,12 +111,22 @@ public class TileLapotronicSU extends TileEnergyStorage implements IContainerPro
|
|||
this.maxOutput = output;
|
||||
}
|
||||
|
||||
public int getMaxStorage() {
|
||||
return this.maxStorage;
|
||||
public int getConnectedBlocksNum() {
|
||||
return this.connectedBlocks;
|
||||
}
|
||||
|
||||
public void setMaxStorage(int value) {
|
||||
this.maxStorage = value;
|
||||
public void setConnectedBlocksNum(int value) {
|
||||
this.connectedBlocks = value;
|
||||
if (world.isRemote) {
|
||||
setMaxStorage();
|
||||
}
|
||||
}
|
||||
|
||||
public void setMaxStorage(){
|
||||
this.maxStorage = (this.connectedBlocks + 1) * storagePerBlock;
|
||||
if (this.maxStorage < 0 || this.maxStorage > Integer.MAX_VALUE / RebornCoreConfig.euPerFU) {
|
||||
this.maxStorage = Integer.MAX_VALUE / RebornCoreConfig.euPerFU;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -123,6 +134,6 @@ public class TileLapotronicSU extends TileEnergyStorage implements IContainerPro
|
|||
return new ContainerBuilder("lesu").player(player.inventory).inventory().hotbar().armor().complete(8, 18)
|
||||
.addArmor().addInventory().tile(this).energySlot(0, 62, 45).energySlot(1, 98, 45).syncEnergyValue()
|
||||
.syncIntegerValue(this::getOutputRate, this::setOutputRate)
|
||||
.syncIntegerValue(this::getMaxStorage, this::setMaxStorage).addInventory().create(this);
|
||||
.syncIntegerValue(this::getConnectedBlocksNum, this::setConnectedBlocksNum).addInventory().create(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ import reborncore.api.recipe.IRecipeCrafterProvider;
|
|||
import reborncore.api.tile.IInventoryProvider;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.registration.RebornRegistry;
|
||||
import reborncore.common.registration.impl.ConfigRegistry;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.api.Reference;
|
||||
|
@ -44,7 +45,9 @@ import techreborn.client.container.IContainerProvider;
|
|||
import techreborn.client.container.builder.BuiltContainer;
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
@RebornRegistry(modID = ModInfo.MOD_ID)
|
||||
public class TileDistillationTower extends TilePowerAcceptor
|
||||
implements IToolDrop, IRecipeCrafterProvider, IInventoryProvider, IContainerProvider {
|
||||
|
||||
|
|
|
@ -34,15 +34,24 @@ import reborncore.api.tile.IInventoryProvider;
|
|||
import reborncore.api.IToolDrop;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.registration.RebornRegistry;
|
||||
import reborncore.common.registration.impl.ConfigRegistry;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.client.container.IContainerProvider;
|
||||
import techreborn.client.container.builder.BuiltContainer;
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
@RebornRegistry(modID = ModInfo.MOD_ID)
|
||||
public class TileImplosionCompressor extends TilePowerAcceptor
|
||||
implements IToolDrop, IInventoryProvider, IRecipeCrafterProvider, IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "implosion_compressor", key = "ImplosionCompressorMaxInput", comment = "Implosion Compressor Max Input (Value in EU)")
|
||||
public static int maxInput = 64;
|
||||
@ConfigRegistry(config = "machines", category = "implosion_compressor", key = "ImplosionCompressorMaxEnergy", comment = "Implosion Compressor Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 64000;
|
||||
|
||||
public Inventory inventory = new Inventory(5, "TileImplosionCompressor", 64, this);
|
||||
public MultiblockChecker multiblockChecker;
|
||||
|
@ -119,7 +128,7 @@ public class TileImplosionCompressor extends TilePowerAcceptor
|
|||
|
||||
@Override
|
||||
public double getBaseMaxPower() {
|
||||
return 64000;
|
||||
return maxEnergy;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -139,7 +148,7 @@ public class TileImplosionCompressor extends TilePowerAcceptor
|
|||
|
||||
@Override
|
||||
public double getBaseMaxInput() {
|
||||
return 64;
|
||||
return maxInput;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -40,6 +40,8 @@ import reborncore.api.IToolDrop;
|
|||
import reborncore.common.multiblock.IMultiblockPart;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.registration.RebornRegistry;
|
||||
import reborncore.common.registration.impl.ConfigRegistry;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.api.Reference;
|
||||
import techreborn.api.recipe.ITileRecipeHandler;
|
||||
|
@ -49,11 +51,18 @@ import techreborn.client.container.IContainerProvider;
|
|||
import techreborn.client.container.builder.BuiltContainer;
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.ModInfo;
|
||||
import techreborn.multiblocks.MultiBlockCasing;
|
||||
import techreborn.tiles.TileMachineCasing;
|
||||
|
||||
@RebornRegistry(modID = ModInfo.MOD_ID)
|
||||
public class TileIndustrialBlastFurnace extends TilePowerAcceptor implements IToolDrop, IInventoryProvider,
|
||||
ITileRecipeHandler<BlastFurnaceRecipe>, IRecipeCrafterProvider, IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "industrial_furnace", key = "IndustrialFurnaceMaxInput", comment = "Industrial Blast Furnace Max Input (Value in EU)")
|
||||
public static int maxInput = 128;
|
||||
@ConfigRegistry(config = "machines", category = "industrial_furnace", key = "IndustrialFurnaceMaxEnergy", comment = "Industrial Blast Furnace Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 10000;
|
||||
|
||||
public Inventory inventory;
|
||||
public RecipeCrafter crafter;
|
||||
|
@ -62,14 +71,9 @@ public class TileIndustrialBlastFurnace extends TilePowerAcceptor implements ITo
|
|||
|
||||
public TileIndustrialBlastFurnace() {
|
||||
super();
|
||||
// TODO configs
|
||||
this.inventory = new Inventory(5, "TileIndustrialBlastFurnace", 64, this);
|
||||
final int[] inputs = new int[2];
|
||||
inputs[0] = 0;
|
||||
inputs[1] = 1;
|
||||
final int[] outputs = new int[2];
|
||||
outputs[0] = 2;
|
||||
outputs[1] = 3;
|
||||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] { 2, 3 };
|
||||
this.crafter = new RecipeCrafter(Reference.blastFurnaceRecipe, this, 2, 2, this.inventory, inputs, outputs);
|
||||
}
|
||||
|
||||
|
@ -194,7 +198,7 @@ public class TileIndustrialBlastFurnace extends TilePowerAcceptor implements ITo
|
|||
|
||||
@Override
|
||||
public double getBaseMaxPower() {
|
||||
return 10000;
|
||||
return maxEnergy;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -214,7 +218,7 @@ public class TileIndustrialBlastFurnace extends TilePowerAcceptor implements ITo
|
|||
|
||||
@Override
|
||||
public double getBaseMaxInput() {
|
||||
return 128;
|
||||
return maxInput;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -40,6 +40,8 @@ import reborncore.api.tile.IInventoryProvider;
|
|||
import reborncore.api.IToolDrop;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.recipes.RecipeCrafter;
|
||||
import reborncore.common.registration.RebornRegistry;
|
||||
import reborncore.common.registration.impl.ConfigRegistry;
|
||||
import reborncore.common.util.FluidUtils;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.Tank;
|
||||
|
@ -50,11 +52,18 @@ import techreborn.client.container.IContainerProvider;
|
|||
import techreborn.client.container.builder.BuiltContainer;
|
||||
import techreborn.client.container.builder.ContainerBuilder;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
@RebornRegistry(modID = ModInfo.MOD_ID)
|
||||
public class TileIndustrialGrinder extends TilePowerAcceptor implements IToolDrop, IInventoryProvider,
|
||||
ITileRecipeHandler<IndustrialGrinderRecipe>, IRecipeCrafterProvider, IContainerProvider {
|
||||
|
||||
@ConfigRegistry(config = "machines", category = "industrial_grinder", key = "IndustrialGrinderMaxInput", comment = "Industrial Grinder Max Input (Value in EU)")
|
||||
public static int maxInput = 128;
|
||||
@ConfigRegistry(config = "machines", category = "industrial_grinder", key = "IndustrialGrinderMaxEnergy", comment = "Industrial Grinder Max Energy (Value in EU)")
|
||||
public static int maxEnergy = 10000;
|
||||
|
||||
public static final int TANK_CAPACITY = 16000;
|
||||
|
||||
public Inventory inventory;
|
||||
public Tank tank;
|
||||
public RecipeCrafter crafter;
|
||||
|
@ -63,19 +72,11 @@ public class TileIndustrialGrinder extends TilePowerAcceptor implements IToolDro
|
|||
|
||||
public TileIndustrialGrinder() {
|
||||
super();
|
||||
// TODO configs
|
||||
|
||||
tank = new Tank("TileIndustrialGrinder", TileIndustrialGrinder.TANK_CAPACITY, this);
|
||||
inventory = new Inventory(8, "TileIndustrialGrinder", 64, this);
|
||||
ticksSinceLastChange = 0;
|
||||
final int[] inputs = new int[2];
|
||||
inputs[0] = 0;
|
||||
inputs[1] = 1;
|
||||
final int[] outputs = new int[4];
|
||||
outputs[0] = 2;
|
||||
outputs[1] = 3;
|
||||
outputs[2] = 4;
|
||||
outputs[3] = 5;
|
||||
this.tank = new Tank("TileIndustrialGrinder", TileIndustrialGrinder.TANK_CAPACITY, this);
|
||||
this.inventory = new Inventory(8, "TileIndustrialGrinder", 64, this);
|
||||
this.ticksSinceLastChange = 0;
|
||||
final int[] inputs = new int[] { 0, 1 };
|
||||
final int[] outputs = new int[] {2, 3, 4, 5};
|
||||
this.crafter = new RecipeCrafter(Reference.industrialGrinderRecipe, this, 1, 4, this.inventory, inputs,
|
||||
outputs);
|
||||
}
|
||||
|
@ -192,7 +193,7 @@ public class TileIndustrialGrinder extends TilePowerAcceptor implements IToolDro
|
|||
|
||||
@Override
|
||||
public double getBaseMaxPower() {
|
||||
return 10000;
|
||||
return maxEnergy;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -212,7 +213,7 @@ public class TileIndustrialGrinder extends TilePowerAcceptor implements IToolDro
|
|||
|
||||
@Override
|
||||
public double getBaseMaxInput() {
|
||||
return 64;
|
||||
return maxInput;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -69,14 +69,13 @@ public class TileEnergyStorage extends TilePowerAcceptor implements IToolDrop, I
|
|||
super.update();
|
||||
if (!inventory.getStackInSlot(0).isEmpty()) {
|
||||
ItemStack stack = inventory.getStackInSlot(0);
|
||||
if (!(stack.getItem() instanceof IEnergyItemInfo)) {
|
||||
return;
|
||||
}
|
||||
IEnergyItemInfo item = (IEnergyItemInfo) inventory.getStackInSlot(0).getItem();
|
||||
if (PoweredItem.getEnergy(stack) != PoweredItem.getMaxPower(stack)) {
|
||||
if (canUseEnergy(item.getMaxTransfer(stack))) {
|
||||
useEnergy(item.getMaxTransfer(stack));
|
||||
PoweredItem.setEnergy(PoweredItem.getEnergy(stack) + item.getMaxTransfer(stack), stack);
|
||||
if (stack.getItem() instanceof IEnergyItemInfo) {
|
||||
IEnergyItemInfo item = (IEnergyItemInfo) inventory.getStackInSlot(0).getItem();
|
||||
if (PoweredItem.getEnergy(stack) != PoweredItem.getMaxPower(stack)) {
|
||||
if (canUseEnergy(item.getMaxTransfer(stack))) {
|
||||
useEnergy(item.getMaxTransfer(stack));
|
||||
PoweredItem.setEnergy(PoweredItem.getEnergy(stack) + item.getMaxTransfer(stack), stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(CompatManager.isIC2Loaded){
|
||||
|
|
|
@ -34,15 +34,22 @@ import reborncore.api.IListInfoProvider;
|
|||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.api.IToolDrop;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import reborncore.common.registration.RebornRegistry;
|
||||
import reborncore.common.registration.impl.ConfigRegistry;
|
||||
import reborncore.common.util.StringUtils;
|
||||
import techreborn.blocks.transformers.BlockTransformer;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by Rushmead
|
||||
*/
|
||||
@RebornRegistry(modID = ModInfo.MOD_ID)
|
||||
public class TileTransformer extends TilePowerAcceptor implements IToolDrop, ITickable, IListInfoProvider {
|
||||
|
||||
@ConfigRegistry(config = "misc", category = "general", key = "IC2TransformersStyle", comment = "Input from dots side, output from other sides, like in IC2.")
|
||||
public static boolean IC2TransformersStyle = false;
|
||||
|
||||
public String name;
|
||||
public Block wrenchDrop;
|
||||
|
@ -79,7 +86,9 @@ public class TileTransformer extends TilePowerAcceptor implements IToolDrop, ITi
|
|||
|
||||
@Override
|
||||
public boolean canAcceptEnergy(EnumFacing direction) {
|
||||
|
||||
if (IC2TransformersStyle == true){
|
||||
return getFacingEnum() == direction;
|
||||
}
|
||||
return getFacingEnum() != direction;
|
||||
}
|
||||
|
||||
|
@ -94,6 +103,9 @@ public class TileTransformer extends TilePowerAcceptor implements IToolDrop, ITi
|
|||
|
||||
@Override
|
||||
public boolean canProvideEnergy(EnumFacing direction) {
|
||||
if (IC2TransformersStyle == true){
|
||||
return getFacingEnum() != direction;
|
||||
}
|
||||
return getFacing() == direction;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,4 +40,11 @@ public class IC2ItemCharger {
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean isIC2PoweredItem(ItemStack stack){
|
||||
if(stack.isEmpty()){
|
||||
return false;
|
||||
}
|
||||
return stack.getItem() instanceof IElectricItem;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -218,21 +218,27 @@ public class TechRebornWorldGen implements IWorldGenerator {
|
|||
yPos = ore.minYHeight + random.nextInt(ore.maxYHeight - ore.minYHeight);
|
||||
zPos = chunkZ * 16 + random.nextInt(16);
|
||||
BlockPos pos = new BlockPos(xPos, yPos, zPos);
|
||||
if (ore.blockNiceName.equalsIgnoreCase("iridium")) { //Work around for iridium
|
||||
BlockPos iridiumPos = pos.add(8, 0, 8); // standard worldgen offset is added here like in WorldGenMinable#generate
|
||||
IBlockState blockState = world.getBlockState(iridiumPos);
|
||||
if (blockState.getBlock().isReplaceableOreGen(blockState, world, iridiumPos, predicate)) {
|
||||
world.setBlockState(iridiumPos, ore.state, 2);
|
||||
}
|
||||
|
||||
|
||||
if (ore.veinSize < 4){
|
||||
// Workaround for small veins
|
||||
for (int j = 1; j < ore.veinSize; j++) {
|
||||
// standard worldgen offset is added here like in WorldGenMinable#generate
|
||||
BlockPos smallVeinPos = pos.add(8, 0, 8);
|
||||
smallVeinPos.add(random.nextInt(2), random.nextInt(2), random.nextInt(2));
|
||||
IBlockState blockState = world.getBlockState(smallVeinPos);
|
||||
if (blockState.getBlock().isReplaceableOreGen(blockState, world, smallVeinPos, predicate)) {
|
||||
world.setBlockState(smallVeinPos, ore.state, 2);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
worldGenMinable.generate(world, random, pos);
|
||||
} catch (ArrayIndexOutOfBoundsException e) {
|
||||
Core.logHelper.error("Something bad is happening during world gen the ore " + ore.blockNiceName + " caused a crash when generating. Report this to the TechReborn devs with a log");
|
||||
Core.logHelper.error("Something bad is happening during world gen the ore "
|
||||
+ ore.blockNiceName
|
||||
+ " caused a crash when generating. Report this to the TechReborn devs with a log");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -242,8 +248,7 @@ public class TechRebornWorldGen implements IWorldGenerator {
|
|||
boolean isValidSpawn = false;
|
||||
Biome biomeGenBase = world.getBiomeForCoordsBody(new BlockPos(chunkX * 16, 72, chunkZ * 16));
|
||||
if (BiomeDictionary.hasType(biomeGenBase, BiomeDictionary.Type.SWAMP)) {
|
||||
// TODO check the config file for bounds on this, might cause
|
||||
// issues
|
||||
// TODO check the config file for bounds on this, might cause issues
|
||||
chance -= random.nextInt(10) + 10;
|
||||
isValidSpawn = true;
|
||||
}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"variants": {
|
||||
"techreborn.berylium": {
|
||||
"model": "forge:fluid",
|
||||
"custom": {
|
||||
"fluid": "fluidberylium"
|
||||
}
|
||||
},
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "forge:fluid"
|
||||
},
|
||||
"variants": {
|
||||
"techreborn.berylium": [{
|
||||
"custom": { "fluid": "fluidberylium" }
|
||||
}],
|
||||
"techreborn.calcium": {
|
||||
"model": "forge:fluid",
|
||||
"custom": {
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "techreborn:item/techrebornItem",
|
||||
"textures": {
|
||||
"layer0": "techreborn:items/misc/missing_recipe"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"ctm":{
|
||||
"ctm_version": 1,
|
||||
"type":"CTM",
|
||||
"textures":[
|
||||
"techreborn:blocks/machines/energy/ev_multi_side_ctm"
|
||||
]
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue