mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Added recipe and changed function order to make more sense.
This commit is contained in:
parent
b328130edb
commit
155595772c
@ -3,6 +3,7 @@ package com.hbm.blocks.network;
|
|||||||
import api.hbm.block.IToolable;
|
import api.hbm.block.IToolable;
|
||||||
import com.hbm.blocks.IBlockMultiPass;
|
import com.hbm.blocks.IBlockMultiPass;
|
||||||
import com.hbm.blocks.ILookOverlay;
|
import com.hbm.blocks.ILookOverlay;
|
||||||
|
import com.hbm.blocks.network.FluidDuctPaintable.TileEntityPipePaintable;
|
||||||
import com.hbm.interfaces.ICopiable;
|
import com.hbm.interfaces.ICopiable;
|
||||||
import com.hbm.inventory.fluid.Fluids;
|
import com.hbm.inventory.fluid.Fluids;
|
||||||
import com.hbm.lib.Library;
|
import com.hbm.lib.Library;
|
||||||
@ -33,13 +34,13 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class FluidDuctPaintableBlockExhaust extends FluidDuctBase implements IToolable, IBlockMultiPass, ILookOverlay {
|
public class FluidDuctPaintableBlockExhaust extends FluidDuctBase implements IToolable, IBlockMultiPass, ILookOverlay {
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT) protected IIcon overlay;
|
@SideOnly(Side.CLIENT) protected IIcon overlay;
|
||||||
|
|
||||||
public FluidDuctPaintableBlockExhaust() {
|
public FluidDuctPaintableBlockExhaust() {
|
||||||
super(Material.iron);
|
super(Material.iron);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TileEntity createNewTileEntity(World world, int meta) {
|
public TileEntity createNewTileEntity(World world, int meta) {
|
||||||
return new TileEntityPipeExhaustPaintable();
|
return new TileEntityPipeExhaustPaintable();
|
||||||
@ -51,15 +52,6 @@ public class FluidDuctPaintableBlockExhaust extends FluidDuctBase implements ITo
|
|||||||
Library.canConnectFluid(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir, Fluids.SMOKE_POISON);
|
Library.canConnectFluid(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir, Fluids.SMOKE_POISON);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
|
||||||
List<String> text = new ArrayList();
|
|
||||||
text.add(Fluids.SMOKE.getLocalizedName());
|
|
||||||
text.add(Fluids.SMOKE_LEADED.getLocalizedName());
|
|
||||||
text.add(Fluids.SMOKE_POISON.getLocalizedName());
|
|
||||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerBlockIcons(IIconRegister reg) {
|
public void registerBlockIcons(IIconRegister reg) {
|
||||||
@ -87,6 +79,27 @@ public class FluidDuctPaintableBlockExhaust extends FluidDuctBase implements ITo
|
|||||||
return this.blockIcon;
|
return this.blockIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
|
||||||
|
|
||||||
|
if(tool != ToolType.SCREWDRIVER) return false;
|
||||||
|
|
||||||
|
TileEntity tile = world.getTileEntity(x, y, z);
|
||||||
|
|
||||||
|
if(tile instanceof TileEntityPipeExhaustPaintable) {
|
||||||
|
TileEntityPipeExhaustPaintable pipe = (TileEntityPipeExhaustPaintable) tile;
|
||||||
|
|
||||||
|
if(pipe.block != null) {
|
||||||
|
pipe.block = null;
|
||||||
|
world.markBlockForUpdate(x, y, z);
|
||||||
|
pipe.markDirty();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float fX, float fY, float fZ) {
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float fX, float fY, float fZ) {
|
||||||
|
|
||||||
@ -117,27 +130,6 @@ public class FluidDuctPaintableBlockExhaust extends FluidDuctBase implements ITo
|
|||||||
return super.onBlockActivated(world, x, y, z, player, side, fX, fY, fZ);
|
return super.onBlockActivated(world, x, y, z, player, side, fX, fY, fZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
|
|
||||||
|
|
||||||
if(tool != ToolType.SCREWDRIVER) return false;
|
|
||||||
|
|
||||||
TileEntity tile = world.getTileEntity(x, y, z);
|
|
||||||
|
|
||||||
if(tile instanceof TileEntityPipeExhaustPaintable) {
|
|
||||||
TileEntityPipeExhaustPaintable pipe = (TileEntityPipeExhaustPaintable) tile;
|
|
||||||
|
|
||||||
if(pipe.block != null) {
|
|
||||||
pipe.block = null;
|
|
||||||
world.markBlockForUpdate(x, y, z);
|
|
||||||
pipe.markDirty();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getPasses() {
|
public int getPasses() {
|
||||||
return 2;
|
return 2;
|
||||||
@ -148,6 +140,15 @@ public class FluidDuctPaintableBlockExhaust extends FluidDuctBase implements ITo
|
|||||||
return IBlockMultiPass.getRenderType();
|
return IBlockMultiPass.getRenderType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||||
|
List<String> text = new ArrayList();
|
||||||
|
text.add(Fluids.SMOKE.getLocalizedName());
|
||||||
|
text.add(Fluids.SMOKE_LEADED.getLocalizedName());
|
||||||
|
text.add(Fluids.SMOKE_POISON.getLocalizedName());
|
||||||
|
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||||
|
}
|
||||||
|
|
||||||
public static class TileEntityPipeExhaustPaintable extends TileEntityPipeExhaust implements ICopiable {
|
public static class TileEntityPipeExhaustPaintable extends TileEntityPipeExhaust implements ICopiable {
|
||||||
|
|
||||||
private Block block;
|
private Block block;
|
||||||
|
|||||||
@ -604,6 +604,7 @@ public class CraftingManager {
|
|||||||
addRecipeAuto(new ItemStack(ModBlocks.fluid_duct_neo, 8, 1), new Object[] { "IAI", " ", "IAI", 'I', IRON.plate(), 'A', AL.plate() });
|
addRecipeAuto(new ItemStack(ModBlocks.fluid_duct_neo, 8, 1), new Object[] { "IAI", " ", "IAI", 'I', IRON.plate(), 'A', AL.plate() });
|
||||||
addRecipeAuto(new ItemStack(ModBlocks.fluid_duct_neo, 8, 2), new Object[] { "ASA", " ", "ASA", 'S', STEEL.plate(), 'A', AL.plate() });
|
addRecipeAuto(new ItemStack(ModBlocks.fluid_duct_neo, 8, 2), new Object[] { "ASA", " ", "ASA", 'S', STEEL.plate(), 'A', AL.plate() });
|
||||||
addRecipeAuto(new ItemStack(ModBlocks.fluid_duct_paintable, 8), new Object[] { "SAS", "A A", "SAS", 'S', STEEL.ingot(), 'A', AL.plate() });
|
addRecipeAuto(new ItemStack(ModBlocks.fluid_duct_paintable, 8), new Object[] { "SAS", "A A", "SAS", 'S', STEEL.ingot(), 'A', AL.plate() });
|
||||||
|
addRecipeAuto(new ItemStack(ModBlocks.fluid_duct_paintable_block_exhaust, 8), new Object[] { "SAS", "A A", "SAS", 'S', IRON.ingot(), 'A', ModItems.plate_polymer});
|
||||||
addShapelessAuto(new ItemStack(ModBlocks.fluid_duct_gauge), new Object[] { ModBlocks.fluid_duct_paintable, STEEL.ingot(), DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC) });
|
addShapelessAuto(new ItemStack(ModBlocks.fluid_duct_gauge), new Object[] { ModBlocks.fluid_duct_paintable, STEEL.ingot(), DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC) });
|
||||||
addRecipeAuto(new ItemStack(ModBlocks.fluid_valve, 1), new Object[] { "S", "W", 'S', Blocks.lever, 'W', ModBlocks.fluid_duct_paintable });
|
addRecipeAuto(new ItemStack(ModBlocks.fluid_valve, 1), new Object[] { "S", "W", 'S', Blocks.lever, 'W', ModBlocks.fluid_duct_paintable });
|
||||||
addRecipeAuto(new ItemStack(ModBlocks.fluid_switch, 1), new Object[] { "S", "W", 'S', REDSTONE.dust(), 'W', ModBlocks.fluid_duct_paintable });
|
addRecipeAuto(new ItemStack(ModBlocks.fluid_switch, 1), new Object[] { "S", "W", 'S', REDSTONE.dust(), 'W', ModBlocks.fluid_duct_paintable });
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user