Merge branch 'HbmMods:master' into master
@ -1,3 +1,7 @@
|
|||||||
|
## Added
|
||||||
|
* Boxcables
|
||||||
|
* Like boxducts, but for power
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
* Updated meteors
|
* Updated meteors
|
||||||
* Meteors will now punch through weak blocks like leaves instead of getting stuck on trees
|
* Meteors will now punch through weak blocks like leaves instead of getting stuck on trees
|
||||||
@ -5,6 +9,9 @@
|
|||||||
* Falling meteors will produce a sound instead of stealthily blowing people up
|
* Falling meteors will produce a sound instead of stealthily blowing people up
|
||||||
* Fallen meteors will now be placed deeper into the actual crater instead of hovering awkwardly over the hole
|
* Fallen meteors will now be placed deeper into the actual crater instead of hovering awkwardly over the hole
|
||||||
* Addd QMAW pages for the particle accelerator parts along with a PA overview page and a simple step by step construction tutorial
|
* Addd QMAW pages for the particle accelerator parts along with a PA overview page and a simple step by step construction tutorial
|
||||||
|
* Increased the acidizer partitioner's input limit from 9 to 45 slots
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
* Fixed arc furnace only allowing electrodes to be inserted when the lid is down instead of up
|
* Fixed arc furnace only allowing electrodes to be inserted when the lid is down instead of up
|
||||||
|
* Fixed issue where the `amounts` tracker wasn't being used correctly when using a custom acidizer config, preventing the acidizer partitioner from working
|
||||||
|
* Fixed multi fluid ID search potentially not working on systems with a non-latin locale
|
||||||
@ -767,6 +767,7 @@ public class ModBlocks {
|
|||||||
public static Block red_cable_classic;
|
public static Block red_cable_classic;
|
||||||
public static Block red_cable_paintable;
|
public static Block red_cable_paintable;
|
||||||
public static Block red_cable_gauge;
|
public static Block red_cable_gauge;
|
||||||
|
public static Block red_cable_box;
|
||||||
public static Block red_connector;
|
public static Block red_connector;
|
||||||
public static Block red_pylon;
|
public static Block red_pylon;
|
||||||
public static Block red_pylon_medium_wood;
|
public static Block red_pylon_medium_wood;
|
||||||
@ -1905,6 +1906,7 @@ public class ModBlocks {
|
|||||||
red_cable_classic = new BlockCable(Material.iron).setBlockName("red_cable_classic").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_cable_classic");
|
red_cable_classic = new BlockCable(Material.iron).setBlockName("red_cable_classic").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_cable_classic");
|
||||||
red_cable_paintable = new BlockCablePaintable().setBlockName("red_cable_paintable").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
red_cable_paintable = new BlockCablePaintable().setBlockName("red_cable_paintable").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||||
red_cable_gauge = new BlockCableGauge().setBlockName("red_cable_gauge").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
red_cable_gauge = new BlockCableGauge().setBlockName("red_cable_gauge").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||||
|
red_cable_box = new PowerCableBox(Material.iron).setBlockName("red_cable_box").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fluid_duct_box");
|
||||||
red_connector = new ConnectorRedWire(Material.iron).setBlockName("red_connector").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_connector");
|
red_connector = new ConnectorRedWire(Material.iron).setBlockName("red_connector").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_connector");
|
||||||
red_pylon = new PylonRedWire(Material.iron).setBlockName("red_pylon").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_pylon");
|
red_pylon = new PylonRedWire(Material.iron).setBlockName("red_pylon").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_pylon");
|
||||||
red_pylon_medium_wood = new PylonMedium(Material.wood).setBlockName("red_pylon_medium_wood").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_pylon");
|
red_pylon_medium_wood = new PylonMedium(Material.wood).setBlockName("red_pylon_medium_wood").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_pylon");
|
||||||
@ -3193,6 +3195,7 @@ public class ModBlocks {
|
|||||||
GameRegistry.registerBlock(red_cable_classic, red_cable_classic.getUnlocalizedName());
|
GameRegistry.registerBlock(red_cable_classic, red_cable_classic.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(red_cable_paintable, red_cable_paintable.getUnlocalizedName());
|
GameRegistry.registerBlock(red_cable_paintable, red_cable_paintable.getUnlocalizedName());
|
||||||
register(red_cable_gauge);
|
register(red_cable_gauge);
|
||||||
|
register(red_cable_box);
|
||||||
GameRegistry.registerBlock(red_wire_coated, red_wire_coated.getUnlocalizedName());
|
GameRegistry.registerBlock(red_wire_coated, red_wire_coated.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(red_connector, ItemBlockBase.class, red_connector.getUnlocalizedName());
|
GameRegistry.registerBlock(red_connector, ItemBlockBase.class, red_connector.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(red_pylon, ItemBlockBase.class, red_pylon.getUnlocalizedName());
|
GameRegistry.registerBlock(red_pylon, ItemBlockBase.class, red_pylon.getUnlocalizedName());
|
||||||
|
|||||||
@ -79,7 +79,7 @@ public class TritiumLamp extends Block implements ISpotlight {
|
|||||||
private void updateBeam(World world, int x, int y, int z) {
|
private void updateBeam(World world, int x, int y, int z) {
|
||||||
if(!isOn) return;
|
if(!isOn) return;
|
||||||
|
|
||||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) Spotlight.propagateBeam(world, x, y, z, dir, getBeamLength());
|
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) Spotlight.propagateBeam(world, x, y, z, dir, getBeamLength(), getMeta());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -98,6 +98,12 @@ public class TritiumLamp extends Block implements ISpotlight {
|
|||||||
return new ItemStack(getOff());
|
return new ItemStack(getOff());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected int getMeta() {
|
||||||
|
if(this == ModBlocks.lamp_tritium_green_off || this == ModBlocks.lamp_tritium_green_on) return Spotlight.META_GREEN;
|
||||||
|
if(this == ModBlocks.lamp_tritium_blue_off || this == ModBlocks.lamp_tritium_blue_on) return Spotlight.META_BLUE;
|
||||||
|
return Spotlight.META_YELLOW;
|
||||||
|
}
|
||||||
|
|
||||||
protected Block getOff() {
|
protected Block getOff() {
|
||||||
if(this == ModBlocks.lamp_tritium_green_on) return ModBlocks.lamp_tritium_green_off;
|
if(this == ModBlocks.lamp_tritium_green_on) return ModBlocks.lamp_tritium_green_off;
|
||||||
if(this == ModBlocks.lamp_tritium_blue_on) return ModBlocks.lamp_tritium_blue_off;
|
if(this == ModBlocks.lamp_tritium_blue_on) return ModBlocks.lamp_tritium_blue_off;
|
||||||
|
|||||||
@ -28,6 +28,10 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||||||
|
|
||||||
public class Spotlight extends Block implements ISpotlight, INBTBlockTransformable {
|
public class Spotlight extends Block implements ISpotlight, INBTBlockTransformable {
|
||||||
|
|
||||||
|
public static final int META_YELLOW = 0;
|
||||||
|
public static final int META_GREEN = 1;
|
||||||
|
public static final int META_BLUE = 2;
|
||||||
|
|
||||||
public static boolean disableOnGeneration = true;
|
public static boolean disableOnGeneration = true;
|
||||||
|
|
||||||
// I'd be extending the ReinforcedLamp class if it wasn't for the inverted behaviour of these specific lights
|
// I'd be extending the ReinforcedLamp class if it wasn't for the inverted behaviour of these specific lights
|
||||||
@ -223,7 +227,7 @@ public class Spotlight extends Block implements ISpotlight, INBTBlockTransformab
|
|||||||
if(!isOn) return;
|
if(!isOn) return;
|
||||||
|
|
||||||
ForgeDirection dir = getDirection(world, x, y, z);
|
ForgeDirection dir = getDirection(world, x, y, z);
|
||||||
propagateBeam(world, x, y, z, dir, beamLength);
|
propagateBeam(world, x, y, z, dir, beamLength, META_YELLOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ForgeDirection getDirection(IBlockAccess world, int x, int y, int z) {
|
public ForgeDirection getDirection(IBlockAccess world, int x, int y, int z) {
|
||||||
@ -281,7 +285,7 @@ public class Spotlight extends Block implements ISpotlight, INBTBlockTransformab
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Recursively add beam blocks, updating any that already exist with new incoming light directions
|
// Recursively add beam blocks, updating any that already exist with new incoming light directions
|
||||||
public static void propagateBeam(World world, int x, int y, int z, ForgeDirection dir, int distance) {
|
public static void propagateBeam(World world, int x, int y, int z, ForgeDirection dir, int distance, int meta) {
|
||||||
distance--;
|
distance--;
|
||||||
if(distance <= 0)
|
if(distance <= 0)
|
||||||
return;
|
return;
|
||||||
@ -295,7 +299,7 @@ public class Spotlight extends Block implements ISpotlight, INBTBlockTransformab
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if(!(block instanceof SpotlightBeam)) {
|
if(!(block instanceof SpotlightBeam)) {
|
||||||
world.setBlock(x, y, z, ModBlocks.spotlight_beam);
|
world.setBlock(x, y, z, ModBlocks.spotlight_beam, meta, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we encounter an existing beam, add a new INCOMING direction to the
|
// If we encounter an existing beam, add a new INCOMING direction to the
|
||||||
@ -303,7 +307,7 @@ public class Spotlight extends Block implements ISpotlight, INBTBlockTransformab
|
|||||||
if (SpotlightBeam.setDirection(world, x, y, z, dir, true) == 0)
|
if (SpotlightBeam.setDirection(world, x, y, z, dir, true) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
propagateBeam(world, x, y, z, dir, distance);
|
propagateBeam(world, x, y, z, dir, distance, meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recursively delete beam blocks, if they aren't still illuminated from a different direction
|
// Recursively delete beam blocks, if they aren't still illuminated from a different direction
|
||||||
@ -326,7 +330,7 @@ public class Spotlight extends Block implements ISpotlight, INBTBlockTransformab
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Travels back through a beam to the source, and if found, repropagates the beam
|
// Travels back through a beam to the source, and if found, repropagates the beam
|
||||||
public static void backPropagate(World world, int x, int y, int z, ForgeDirection dir) {
|
public static void backPropagate(World world, int x, int y, int z, ForgeDirection dir, int meta) {
|
||||||
x -= dir.offsetX;
|
x -= dir.offsetX;
|
||||||
y -= dir.offsetY;
|
y -= dir.offsetY;
|
||||||
z -= dir.offsetZ;
|
z -= dir.offsetZ;
|
||||||
@ -334,12 +338,12 @@ public class Spotlight extends Block implements ISpotlight, INBTBlockTransformab
|
|||||||
Block block = world.getBlock(x, y, z);
|
Block block = world.getBlock(x, y, z);
|
||||||
if(block instanceof ISpotlight) {
|
if(block instanceof ISpotlight) {
|
||||||
ISpotlight spot = (ISpotlight) block;
|
ISpotlight spot = (ISpotlight) block;
|
||||||
propagateBeam(world, x, y, z, dir, spot.getBeamLength());
|
propagateBeam(world, x, y, z, dir, spot.getBeamLength(), meta);
|
||||||
} else if(!(block instanceof SpotlightBeam)) {
|
} else if(!(block instanceof SpotlightBeam)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
backPropagate(world, x, y, z, dir);
|
backPropagate(world, x, y, z, dir, meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Block getOff() {
|
protected Block getOff() {
|
||||||
|
|||||||
@ -29,8 +29,8 @@ public class SpotlightBeam extends BlockBeamBase {
|
|||||||
if (world.isRemote) return;
|
if (world.isRemote) return;
|
||||||
if (neighborBlock instanceof SpotlightBeam) return;
|
if (neighborBlock instanceof SpotlightBeam) return;
|
||||||
|
|
||||||
for (ForgeDirection dir : getDirections(world, x, y, z)) {
|
for(ForgeDirection dir : getDirections(world, x, y, z)) {
|
||||||
Spotlight.backPropagate(world, x, y, z, dir);
|
Spotlight.backPropagate(world, x, y, z, dir, world.getBlockMetadata(x, y, z));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -139,8 +139,10 @@ public class CranePartitioner extends BlockContainer implements IConveyorBelt, I
|
|||||||
|
|
||||||
public static class TileEntityCranePartitioner extends TileEntityMachineBase {
|
public static class TileEntityCranePartitioner extends TileEntityMachineBase {
|
||||||
|
|
||||||
|
public static final int SLOT_COUNT = 45;
|
||||||
|
|
||||||
public TileEntityCranePartitioner() {
|
public TileEntityCranePartitioner() {
|
||||||
super(18);
|
super(SLOT_COUNT * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public String getName() { return "container.partitioner"; }
|
@Override public String getName() { return "container.partitioner"; }
|
||||||
@ -151,7 +153,7 @@ public class CranePartitioner extends BlockContainer implements IConveyorBelt, I
|
|||||||
if(!worldObj.isRemote) {
|
if(!worldObj.isRemote) {
|
||||||
|
|
||||||
List<ItemStack> stacks = new ArrayList();
|
List<ItemStack> stacks = new ArrayList();
|
||||||
for(int i = 0; i < 9; i++) if(slots[i] != null) stacks.add(slots[i]);
|
for(int i = 0; i < SLOT_COUNT; i++) if(slots[i] != null) stacks.add(slots[i]);
|
||||||
stacks.sort(stackSizeComparator);
|
stacks.sort(stackSizeComparator);
|
||||||
boolean markDirty = false;
|
boolean markDirty = false;
|
||||||
|
|
||||||
@ -168,7 +170,7 @@ public class CranePartitioner extends BlockContainer implements IConveyorBelt, I
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i = 0; i < 9; i++) if(slots[i] != null && slots[i].stackSize <= 0) slots[i] = null;
|
for(int i = 0; i < SLOT_COUNT; i++) if(slots[i] != null && slots[i].stackSize <= 0) slots[i] = null;
|
||||||
if(markDirty) this.markDirty();
|
if(markDirty) this.markDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -183,17 +185,25 @@ public class CranePartitioner extends BlockContainer implements IConveyorBelt, I
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canExtractItem(int slot, ItemStack stack, int side) {
|
public boolean canExtractItem(int slot, ItemStack stack, int side) {
|
||||||
return slot >= 9;
|
return slot >= SLOT_COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||||
return i <= 8 && CrystallizerRecipes.getAmount(stack) >= 1;
|
return i <= (SLOT_COUNT - 1) && CrystallizerRecipes.getAmount(stack) >= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected int[] access;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int[] getAccessibleSlotsFromSide(int side) {
|
public int[] getAccessibleSlotsFromSide(int side) {
|
||||||
return new int[] { 0, 1, 2, 3, 4, 5, 6 ,7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 };
|
|
||||||
|
if(access == null) {
|
||||||
|
access = new int[SLOT_COUNT]; // writing this by hand is for chumps
|
||||||
|
for(int i = 0; i < SLOT_COUNT; i++) access[i] = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
return access;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,10 +4,10 @@ import com.hbm.blocks.IBlockMulti;
|
|||||||
import com.hbm.blocks.ILookOverlay;
|
import com.hbm.blocks.ILookOverlay;
|
||||||
import com.hbm.lib.Library;
|
import com.hbm.lib.Library;
|
||||||
import com.hbm.lib.RefStrings;
|
import com.hbm.lib.RefStrings;
|
||||||
|
import com.hbm.render.block.RenderBoxDuct;
|
||||||
import com.hbm.tileentity.network.TileEntityPipeBaseNT;
|
import com.hbm.tileentity.network.TileEntityPipeBaseNT;
|
||||||
import com.hbm.util.i18n.I18nUtil;
|
import com.hbm.util.i18n.I18nUtil;
|
||||||
|
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
@ -130,11 +130,9 @@ public class FluidDuctBox extends FluidDuctBase implements IBlockMulti, ILookOve
|
|||||||
return meta % 15;
|
return meta % 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRenderType() {
|
public int getRenderType() {
|
||||||
return renderID;
|
return RenderBoxDuct.renderID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
271
src/main/java/com/hbm/blocks/network/PowerCableBox.java
Normal file
@ -0,0 +1,271 @@
|
|||||||
|
package com.hbm.blocks.network;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.blocks.IBlockMulti;
|
||||||
|
import com.hbm.lib.Library;
|
||||||
|
import com.hbm.lib.RefStrings;
|
||||||
|
import com.hbm.render.block.RenderBoxDuct;
|
||||||
|
import com.hbm.tileentity.network.TileEntityCableBaseNT;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.block.BlockContainer;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
public class PowerCableBox extends BlockContainer implements IBlockMulti {
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT) public IIcon iconStraight;
|
||||||
|
@SideOnly(Side.CLIENT) public IIcon[] iconEnd;
|
||||||
|
@SideOnly(Side.CLIENT) public IIcon iconCurveTL;
|
||||||
|
@SideOnly(Side.CLIENT) public IIcon iconCurveTR;
|
||||||
|
@SideOnly(Side.CLIENT) public IIcon iconCurveBL;
|
||||||
|
@SideOnly(Side.CLIENT) public IIcon iconCurveBR;
|
||||||
|
@SideOnly(Side.CLIENT) public IIcon iconJunction;
|
||||||
|
|
||||||
|
public PowerCableBox(Material mat) {
|
||||||
|
super(mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world, int meta) {
|
||||||
|
return new TileEntityCableBaseNT();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||||
|
super.registerBlockIcons(iconRegister);
|
||||||
|
|
||||||
|
iconEnd = new IIcon[5];
|
||||||
|
|
||||||
|
iconStraight = iconRegister.registerIcon(RefStrings.MODID + ":boxduct_" + "cable" + "_straight");
|
||||||
|
for(int i = 0; i < 5; i++) iconEnd[i] = iconRegister.registerIcon(RefStrings.MODID + ":boxduct_" + "cable" + "_end_" + i);
|
||||||
|
iconCurveTL = iconRegister.registerIcon(RefStrings.MODID + ":boxduct_" + "cable" + "_curve_tl");
|
||||||
|
iconCurveTR = iconRegister.registerIcon(RefStrings.MODID + ":boxduct_" + "cable" + "_curve_tr");
|
||||||
|
iconCurveBL = iconRegister.registerIcon(RefStrings.MODID + ":boxduct_" + "cable" + "_curve_bl");
|
||||||
|
iconCurveBR = iconRegister.registerIcon(RefStrings.MODID + ":boxduct_" + "cable" + "_curve_br");
|
||||||
|
iconJunction = iconRegister.registerIcon(RefStrings.MODID + ":boxduct_" + "cable" + "_junction");
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||||
|
|
||||||
|
TileEntity te = world.getTileEntity(x, y, z);
|
||||||
|
|
||||||
|
boolean nX = canConnectTo(world, x, y, z, Library.NEG_X, te);
|
||||||
|
boolean pX = canConnectTo(world, x, y, z, Library.POS_X, te);
|
||||||
|
boolean nY = canConnectTo(world, x, y, z, Library.NEG_Y, te);
|
||||||
|
boolean pY = canConnectTo(world, x, y, z, Library.POS_Y, te);
|
||||||
|
boolean nZ = canConnectTo(world, x, y, z, Library.NEG_Z, te);
|
||||||
|
boolean pZ = canConnectTo(world, x, y, z, Library.POS_Z, te);
|
||||||
|
|
||||||
|
int mask = 0 + (pX ? 32 : 0) + (nX ? 16 : 0) + (pY ? 8 : 0) + (nY ? 4 : 0) + (pZ ? 2 : 0) + (nZ ? 1 : 0);
|
||||||
|
int count = 0 + (pX ? 1 : 0) + (nX ? 1 : 0) + (pY ? 1 : 0) + (nY ? 1 : 0) + (pZ ? 1 : 0) + (nZ ? 1 : 0);
|
||||||
|
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
|
||||||
|
if((mask & 0b001111) == 0 && mask > 0) {
|
||||||
|
return (side == 4 || side == 5) ? iconEnd[meta] : iconStraight;
|
||||||
|
} else if((mask & 0b111100) == 0 && mask > 0) {
|
||||||
|
return (side == 2 || side == 3) ? iconEnd[meta] : iconStraight;
|
||||||
|
} else if((mask & 0b110011) == 0 && mask > 0) {
|
||||||
|
return (side == 0 || side == 1) ? iconEnd[meta] : iconStraight;
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if(side == 0 && nY || side == 1 && pY || side == 2 && nZ || side == 3 && pZ || side == 4 && nX || side == 5 && pX)
|
||||||
|
return iconEnd[meta];
|
||||||
|
|
||||||
|
if(count == 2) {
|
||||||
|
if(side == 1 && nY || side == 0 && pY || side == 3 && nZ || side == 2 && pZ || side == 5 && nX || side == 4 && pX)
|
||||||
|
return iconStraight;
|
||||||
|
|
||||||
|
if(nY && pZ) return side == 4 ? iconCurveBR : iconCurveBL;
|
||||||
|
if(nY && nZ) return side == 5 ? iconCurveBR : iconCurveBL;
|
||||||
|
if(nY && pX) return side == 3 ? iconCurveBR : iconCurveBL;
|
||||||
|
if(nY && nX) return side == 2 ? iconCurveBR : iconCurveBL;
|
||||||
|
if(pY && pZ) return side == 4 ? iconCurveTR : iconCurveTL;
|
||||||
|
if(pY && nZ) return side == 5 ? iconCurveTR : iconCurveTL;
|
||||||
|
if(pY && pX) return side == 3 ? iconCurveTR : iconCurveTL;
|
||||||
|
if(pY && nX) return side == 2 ? iconCurveTR : iconCurveTL;
|
||||||
|
|
||||||
|
if(pX && nZ) return side == 0 ? iconCurveTR : iconCurveTR;
|
||||||
|
if(pX && pZ) return side == 0 ? iconCurveBR : iconCurveBR;
|
||||||
|
if(nX && nZ) return side == 0 ? iconCurveTL : iconCurveTL;
|
||||||
|
if(nX && pZ) return side == 0 ? iconCurveBL : iconCurveBL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return iconJunction;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||||
|
for(int i = 0; i < 5; ++i) {
|
||||||
|
list.add(new ItemStack(item, 1, i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int damageDropped(int meta) {
|
||||||
|
return meta % 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRenderType() {
|
||||||
|
return RenderBoxDuct.renderID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
|
@Override
|
||||||
|
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB entityBounding, List list, Entity entity) {
|
||||||
|
|
||||||
|
List<AxisAlignedBB> bbs = new ArrayList<>();
|
||||||
|
|
||||||
|
TileEntity te = world.getTileEntity(x, y, z);
|
||||||
|
|
||||||
|
double lower = 0.125D;
|
||||||
|
double upper = 0.875D;
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
|
||||||
|
for(int i = 0; i < 5; i++) {
|
||||||
|
|
||||||
|
if(meta > i) {
|
||||||
|
lower += 0.0625D;
|
||||||
|
upper -= 0.0625D;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean nX = canConnectTo(world, x, y, z, Library.NEG_X, te);
|
||||||
|
boolean pX = canConnectTo(world, x, y, z, Library.POS_X, te);
|
||||||
|
boolean nY = canConnectTo(world, x, y, z, Library.NEG_Y, te);
|
||||||
|
boolean pY = canConnectTo(world, x, y, z, Library.POS_Y, te);
|
||||||
|
boolean nZ = canConnectTo(world, x, y, z, Library.NEG_Z, te);
|
||||||
|
boolean pZ = canConnectTo(world, x, y, z, Library.POS_Z, te);
|
||||||
|
int mask = 0 + (pX ? 32 : 0) + (nX ? 16 : 0) + (pY ? 8 : 0) + (nY ? 4 : 0) + (pZ ? 2 : 0) + (nZ ? 1 : 0);
|
||||||
|
|
||||||
|
if(mask == 0) {
|
||||||
|
bbs.add(AxisAlignedBB.getBoundingBox(x + lower, y + lower, z + lower, x + upper, y + upper, z + upper));
|
||||||
|
} else if(mask == 0b100000 || mask == 0b010000 || mask == 0b110000) {
|
||||||
|
bbs.add(AxisAlignedBB.getBoundingBox(x + 0.0D, y + lower, z + lower, x + 1.0D, y + upper, z + upper));
|
||||||
|
} else if(mask == 0b001000 || mask == 0b000100 || mask == 0b001100) {
|
||||||
|
bbs.add(AxisAlignedBB.getBoundingBox(x + lower, y + 0.0D, z + lower, x + upper, y + 1.0D, z + upper));
|
||||||
|
} else if(mask == 0b000010 || mask == 0b000001 || mask == 0b000011) {
|
||||||
|
bbs.add(AxisAlignedBB.getBoundingBox(x + lower, y + lower, z + 0.0D, x + upper, y + upper, z + 1.0D));
|
||||||
|
} else {
|
||||||
|
bbs.add(AxisAlignedBB.getBoundingBox(x + lower, y + lower, z + lower, x + upper, y + upper, z + upper));
|
||||||
|
|
||||||
|
if(pX) bbs.add(AxisAlignedBB.getBoundingBox(x + upper, y + lower, z + lower, x + 1.0D, y + upper, z + upper));
|
||||||
|
if(nX) bbs.add(AxisAlignedBB.getBoundingBox(x + 0.0D, y + lower, z + lower, x + lower, y + upper, z + upper));
|
||||||
|
if(pY) bbs.add(AxisAlignedBB.getBoundingBox(x + lower, y + upper, z + lower, x + upper, y + 1.0D, z + upper));
|
||||||
|
if(nY) bbs.add(AxisAlignedBB.getBoundingBox(x + lower, y + 0.0D, z + lower, x + upper, y + lower, z + upper));
|
||||||
|
if(pZ) bbs.add(AxisAlignedBB.getBoundingBox(x + lower, y + lower, z + upper, x + upper, y + upper, z + 1.0D));
|
||||||
|
if(nZ) bbs.add(AxisAlignedBB.getBoundingBox(x + lower, y + lower, z + 0.0D, x + upper, y + upper, z + lower));
|
||||||
|
}
|
||||||
|
|
||||||
|
for(AxisAlignedBB bb : bbs) {
|
||||||
|
if(entityBounding.intersectsWith(bb)) {
|
||||||
|
list.add(bb);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||||
|
setBlockBoundsBasedOnState(world, x, y, z);
|
||||||
|
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||||
|
setBlockBoundsBasedOnState(world, x, y, z);
|
||||||
|
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||||
|
|
||||||
|
TileEntity te = world.getTileEntity(x, y, z);
|
||||||
|
|
||||||
|
float lower = 0.125F;
|
||||||
|
float upper = 0.875F;
|
||||||
|
int meta = world.getBlockMetadata(x, y, z);
|
||||||
|
|
||||||
|
for(int i = 0; i < 5; i++) {
|
||||||
|
|
||||||
|
if(meta > i) {
|
||||||
|
lower += 0.0625F;
|
||||||
|
upper -= 0.0625F;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean nX = canConnectTo(world, x, y, z, Library.NEG_X, te);
|
||||||
|
boolean pX = canConnectTo(world, x, y, z, Library.POS_X, te);
|
||||||
|
boolean nY = canConnectTo(world, x, y, z, Library.NEG_Y, te);
|
||||||
|
boolean pY = canConnectTo(world, x, y, z, Library.POS_Y, te);
|
||||||
|
boolean nZ = canConnectTo(world, x, y, z, Library.NEG_Z, te);
|
||||||
|
boolean pZ = canConnectTo(world, x, y, z, Library.POS_Z, te);
|
||||||
|
int mask = 0 + (pX ? 32 : 0) + (nX ? 16 : 0) + (pY ? 8 : 0) + (nY ? 4 : 0) + (pZ ? 2 : 0) + (nZ ? 1 : 0);
|
||||||
|
|
||||||
|
if(mask == 0) {
|
||||||
|
this.setBlockBounds(lower, lower, lower, upper, upper, upper);
|
||||||
|
} else if(mask == 0b100000 || mask == 0b010000 || mask == 0b110000) {
|
||||||
|
this.setBlockBounds(0F, lower, lower, 1F, upper, upper);
|
||||||
|
} else if(mask == 0b001000 || mask == 0b000100 || mask == 0b001100) {
|
||||||
|
this.setBlockBounds(lower, 0F, lower, upper, 1F, upper);
|
||||||
|
} else if(mask == 0b000010 || mask == 0b000001 || mask == 0b000011) {
|
||||||
|
this.setBlockBounds(lower, lower, 0F, upper, upper, 1F);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.setBlockBounds(
|
||||||
|
nX ? 0F : lower,
|
||||||
|
nY ? 0F : lower,
|
||||||
|
nZ ? 0F : lower,
|
||||||
|
pX ? 1F : upper,
|
||||||
|
pY ? 1F : upper,
|
||||||
|
pZ ? 1F : upper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean canConnectTo(IBlockAccess world, int x, int y, int z, ForgeDirection dir, TileEntity tile) {
|
||||||
|
if(tile instanceof TileEntityCableBaseNT) {
|
||||||
|
return Library.canConnect(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getSubCount() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -175,7 +175,7 @@ public class GUIScreenFluid extends GuiScreen {
|
|||||||
String subs = this.search.getText().toLowerCase(Locale.US);
|
String subs = this.search.getText().toLowerCase(Locale.US);
|
||||||
|
|
||||||
for(FluidType type : Fluids.getInNiceOrder()) {
|
for(FluidType type : Fluids.getInNiceOrder()) {
|
||||||
String name = type.getLocalizedName().toLowerCase();
|
String name = type.getLocalizedName().toLowerCase(Locale.US);
|
||||||
|
|
||||||
if(name.contains(subs) && !type.hasNoID()) {
|
if(name.contains(subs) && !type.hasNoID()) {
|
||||||
this.searchArray[next] = type;
|
this.searchArray[next] = type;
|
||||||
|
|||||||
@ -383,9 +383,9 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
|||||||
input.stacksize = 1;
|
input.stacksize = 1;
|
||||||
cRecipe.acidAmount = fluid.fill;
|
cRecipe.acidAmount = fluid.fill;
|
||||||
if(input instanceof ComparableStack) {
|
if(input instanceof ComparableStack) {
|
||||||
recipes.put(new Pair(((ComparableStack) input), fluid.type), cRecipe);
|
this.registerRecipe(input, cRecipe, fluid);
|
||||||
} else if(input instanceof OreDictStack) {
|
} else if(input instanceof OreDictStack) {
|
||||||
recipes.put(new Pair(((OreDictStack) input).name, fluid.type), cRecipe);
|
this.registerRecipe(input, cRecipe, fluid);
|
||||||
}
|
}
|
||||||
if(obj.has("productivity")) cRecipe.prod(obj.get("productivity").getAsFloat());
|
if(obj.has("productivity")) cRecipe.prod(obj.get("productivity").getAsFloat());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -568,6 +568,11 @@ public class AnvilRecipes extends SerializableRecipe {
|
|||||||
constructionRecipes.add(new AnvilConstructionRecipe(new AStack[] {new OreDictStack(IRON.plate(), 1), new ComparableStack(ModItems.plate_polymer)}, new AnvilOutput(new ItemStack(ModBlocks.fluid_duct_exhaust, 8, i))).setTier(2).setOverlay(OverlayType.CONSTRUCTION));
|
constructionRecipes.add(new AnvilConstructionRecipe(new AStack[] {new OreDictStack(IRON.plate(), 1), new ComparableStack(ModItems.plate_polymer)}, new AnvilOutput(new ItemStack(ModBlocks.fluid_duct_exhaust, 8, i))).setTier(2).setOverlay(OverlayType.CONSTRUCTION));
|
||||||
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModBlocks.fluid_duct_exhaust, 8, i), new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.plate_iron)), new AnvilOutput(new ItemStack(ModItems.plate_polymer))}).setTier(2));
|
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModBlocks.fluid_duct_exhaust, 8, i), new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.plate_iron)), new AnvilOutput(new ItemStack(ModItems.plate_polymer))}).setTier(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(int i = 0; i < 5; i++) {
|
||||||
|
constructionRecipes.add(new AnvilConstructionRecipe(new AStack[] {new OreDictStack(MINGRADE.ingot(), 8), new ComparableStack(ModItems.plate_polymer)}, new AnvilOutput(new ItemStack(ModBlocks.red_cable_box, 8, i))).setTier(2).setOverlay(OverlayType.CONSTRUCTION));
|
||||||
|
constructionRecipes.add(new AnvilConstructionRecipe(new ComparableStack(ModBlocks.red_cable_box, 8, i), new AnvilOutput[] {new AnvilOutput(new ItemStack(ModItems.ingot_red_copper, 8)), new AnvilOutput(new ItemStack(ModItems.plate_polymer))}).setTier(2));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void registerConstructionAmmo() {
|
public static void registerConstructionAmmo() {
|
||||||
|
|||||||
@ -47,7 +47,10 @@ public class JetpackBreak extends JetpackFueledBase {
|
|||||||
|
|
||||||
if(getFuel(stack) > 0) {
|
if(getFuel(stack) > 0) {
|
||||||
|
|
||||||
if(props.isJetpackActive()) {
|
boolean playerTriesToHover = player.isSneaking() && props.isJetpackActive();
|
||||||
|
boolean playerShouldHover = playerTriesToHover || !player.isSneaking();
|
||||||
|
|
||||||
|
if(props.isJetpackActive() && !playerTriesToHover) {
|
||||||
player.fallDistance = 0;
|
player.fallDistance = 0;
|
||||||
|
|
||||||
if(player.motionY < 0.4D)
|
if(player.motionY < 0.4D)
|
||||||
@ -56,7 +59,7 @@ public class JetpackBreak extends JetpackFueledBase {
|
|||||||
world.playSoundEffect(player.posX, player.posY, player.posZ, "hbm:weapon.flamethrowerShoot", 0.25F, 1.5F);
|
world.playSoundEffect(player.posX, player.posY, player.posZ, "hbm:weapon.flamethrowerShoot", 0.25F, 1.5F);
|
||||||
this.useUpFuel(player, stack, 5);
|
this.useUpFuel(player, stack, 5);
|
||||||
|
|
||||||
} else if(!player.isSneaking() && !player.onGround && props.enableBackpack) {
|
} else if(playerShouldHover && !player.onGround && props.enableBackpack) {
|
||||||
player.fallDistance = 0;
|
player.fallDistance = 0;
|
||||||
|
|
||||||
if(player.motionY < -1)
|
if(player.motionY < -1)
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package com.hbm.render.block;
|
|||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.hbm.blocks.network.FluidDuctBox;
|
import com.hbm.blocks.network.FluidDuctBox;
|
||||||
|
import com.hbm.blocks.network.PowerCableBox;
|
||||||
import com.hbm.inventory.fluid.FluidType;
|
import com.hbm.inventory.fluid.FluidType;
|
||||||
import com.hbm.inventory.fluid.Fluids;
|
import com.hbm.inventory.fluid.Fluids;
|
||||||
import com.hbm.lib.Library;
|
import com.hbm.lib.Library;
|
||||||
@ -11,6 +12,7 @@ import com.hbm.tileentity.network.TileEntityPipeBaseNT;
|
|||||||
import com.hbm.util.ColorUtil;
|
import com.hbm.util.ColorUtil;
|
||||||
|
|
||||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||||
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.RenderBlocks;
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
@ -21,46 +23,78 @@ public class RenderBoxDuct implements ISimpleBlockRenderingHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||||
|
|
||||||
Tessellator tessellator = Tessellator.instance;
|
Tessellator tessellator = Tessellator.instance;
|
||||||
FluidDuctBox duct = (FluidDuctBox) block;
|
|
||||||
int type = duct.rectify(metadata);
|
|
||||||
|
|
||||||
float lower = 0.125F;
|
if(block instanceof FluidDuctBox) {
|
||||||
float upper = 0.875F;
|
FluidDuctBox duct = (FluidDuctBox) block;
|
||||||
|
int type = duct.rectify(metadata);
|
||||||
|
|
||||||
for(int i = 2; i < 13; i += 3) {
|
float lower = 0.125F;
|
||||||
|
float upper = 0.875F;
|
||||||
|
|
||||||
if(metadata > i) {
|
for(int i = 2; i < 13; i += 3) {
|
||||||
lower += 0.0625F;
|
|
||||||
upper -= 0.0625F;
|
if(metadata > i) {
|
||||||
|
lower += 0.0625F;
|
||||||
|
upper -= 0.0625F;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||||
|
|
||||||
|
renderer.setRenderBounds(lower, lower, 0.0F, upper, upper, 1.0F);
|
||||||
|
|
||||||
|
renderer.uvRotateNorth = 1;
|
||||||
|
renderer.uvRotateSouth = 2;
|
||||||
|
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setNormal(0F, 1F, 0F); renderer.renderFaceYPos(block, 0, 0, 0, duct.iconStraight[type]);
|
||||||
|
tessellator.setNormal(0F, -1F, 0F); renderer.renderFaceYNeg(block, 0, 0, 0, duct.iconStraight[type]);
|
||||||
|
tessellator.setNormal(1F, 0F, 0F); renderer.renderFaceXPos(block, 0, 0, 0, duct.iconStraight[type]);
|
||||||
|
tessellator.setNormal(-1F, 0F, 0F); renderer.renderFaceXNeg(block, 0, 0, 0, duct.iconStraight[type]);
|
||||||
|
tessellator.setNormal(0F, 0F, 1F); renderer.renderFaceZPos(block, 0, 0, 0, duct.iconEnd[type]);
|
||||||
|
tessellator.setNormal(0F, 0F, -1F); renderer.renderFaceZNeg(block, 0, 0, 0, duct.iconEnd[type]);
|
||||||
|
tessellator.draw();
|
||||||
|
|
||||||
|
renderer.uvRotateNorth = 0;
|
||||||
|
renderer.uvRotateSouth = 0;
|
||||||
|
} else if(block instanceof PowerCableBox) {
|
||||||
|
PowerCableBox cable = (PowerCableBox) block;
|
||||||
|
|
||||||
|
float lower = 0.125F;
|
||||||
|
float upper = 0.875F;
|
||||||
|
|
||||||
|
for(int i = 0; i < 5; i++) {
|
||||||
|
|
||||||
|
if(metadata > i) {
|
||||||
|
lower += 0.0625F;
|
||||||
|
upper -= 0.0625F;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||||
|
|
||||||
|
renderer.setRenderBounds(lower, lower, 0.0F, upper, upper, 1.0F);
|
||||||
|
|
||||||
|
renderer.uvRotateNorth = 1;
|
||||||
|
renderer.uvRotateSouth = 2;
|
||||||
|
|
||||||
|
tessellator.startDrawingQuads();
|
||||||
|
tessellator.setNormal(0F, 1F, 0F); renderer.renderFaceYPos(block, 0, 0, 0, cable.iconStraight);
|
||||||
|
tessellator.setNormal(0F, -1F, 0F); renderer.renderFaceYNeg(block, 0, 0, 0, cable.iconStraight);
|
||||||
|
tessellator.setNormal(1F, 0F, 0F); renderer.renderFaceXPos(block, 0, 0, 0, cable.iconStraight);
|
||||||
|
tessellator.setNormal(-1F, 0F, 0F); renderer.renderFaceXNeg(block, 0, 0, 0, cable.iconStraight);
|
||||||
|
tessellator.setNormal(0F, 0F, 1F); renderer.renderFaceZPos(block, 0, 0, 0, cable.iconEnd[metadata]);
|
||||||
|
tessellator.setNormal(0F, 0F, -1F); renderer.renderFaceZNeg(block, 0, 0, 0, cable.iconEnd[metadata]);
|
||||||
|
tessellator.draw();
|
||||||
|
|
||||||
|
renderer.uvRotateNorth = 0;
|
||||||
|
renderer.uvRotateSouth = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
|
||||||
|
|
||||||
renderer.setRenderBounds(lower, lower, 0.0F, upper, upper, 1.0F);
|
|
||||||
|
|
||||||
renderer.uvRotateNorth = 1;
|
|
||||||
renderer.uvRotateSouth = 2;
|
|
||||||
|
|
||||||
tessellator.startDrawingQuads();
|
|
||||||
tessellator.setNormal(0F, 1F, 0F); renderer.renderFaceYPos(block, 0, 0, 0, duct.iconStraight[type]);
|
|
||||||
tessellator.setNormal(0F, -1F, 0F); renderer.renderFaceYNeg(block, 0, 0, 0, duct.iconStraight[type]);
|
|
||||||
tessellator.setNormal(1F, 0F, 0F); renderer.renderFaceXPos(block, 0, 0, 0, duct.iconStraight[type]);
|
|
||||||
tessellator.setNormal(-1F, 0F, 0F); renderer.renderFaceXNeg(block, 0, 0, 0, duct.iconStraight[type]);
|
|
||||||
tessellator.setNormal(0F, 0F, 1F); renderer.renderFaceZPos(block, 0, 0, 0, duct.iconEnd[type]);
|
|
||||||
tessellator.setNormal(0F, 0F, -1F); renderer.renderFaceZNeg(block, 0, 0, 0, duct.iconEnd[type]);
|
|
||||||
tessellator.draw();
|
|
||||||
|
|
||||||
renderer.uvRotateNorth = 0;
|
|
||||||
renderer.uvRotateSouth = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||||
FluidType type = Fluids.NONE;
|
|
||||||
|
|
||||||
renderer = RenderBlocksNT.INSTANCE.setWorld(world);
|
renderer = RenderBlocksNT.INSTANCE.setWorld(world);
|
||||||
|
|
||||||
TileEntity te = world.getTileEntity(x, y, z);
|
TileEntity te = world.getTileEntity(x, y, z);
|
||||||
@ -75,42 +109,67 @@ public class RenderBoxDuct implements ISimpleBlockRenderingHandler {
|
|||||||
boolean pZ = false;
|
boolean pZ = false;
|
||||||
boolean nZ = false;
|
boolean nZ = false;
|
||||||
|
|
||||||
FluidDuctBox.cachedColor = 0xffffff;
|
double lower = 0.125D;
|
||||||
FluidDuctBox duct = (FluidDuctBox) block;
|
double upper = 0.875D;
|
||||||
|
double jLower = lower;
|
||||||
|
double jUpper = upper;
|
||||||
|
|
||||||
pX = duct.canConnectTo(world, x, y, z, Library.POS_X, te);
|
if(block instanceof FluidDuctBox) {
|
||||||
nX = duct.canConnectTo(world, x, y, z, Library.NEG_X, te);
|
FluidDuctBox.cachedColor = 0xffffff;
|
||||||
pY = duct.canConnectTo(world, x, y, z, Library.POS_Y, te);
|
FluidDuctBox duct = (FluidDuctBox) block;
|
||||||
nY = duct.canConnectTo(world, x, y, z, Library.NEG_Y, te);
|
|
||||||
pZ = duct.canConnectTo(world, x, y, z, Library.POS_Z, te);
|
|
||||||
nZ = duct.canConnectTo(world, x, y, z, Library.NEG_Z, te);
|
|
||||||
|
|
||||||
if(te instanceof TileEntityPipeBaseNT) {
|
pX = duct.canConnectTo(world, x, y, z, Library.POS_X, te);
|
||||||
TileEntityPipeBaseNT pipe = (TileEntityPipeBaseNT) te;
|
nX = duct.canConnectTo(world, x, y, z, Library.NEG_X, te);
|
||||||
type = pipe.getType();
|
pY = duct.canConnectTo(world, x, y, z, Library.POS_Y, te);
|
||||||
if(meta % 3 == 2) {
|
nY = duct.canConnectTo(world, x, y, z, Library.NEG_Y, te);
|
||||||
FluidDuctBox.cachedColor = ColorUtil.lightenColor(type.getColor(), 0.25D); //making very dark things not vantablack
|
pZ = duct.canConnectTo(world, x, y, z, Library.POS_Z, te);
|
||||||
|
nZ = duct.canConnectTo(world, x, y, z, Library.NEG_Z, te);
|
||||||
|
|
||||||
|
if(te instanceof TileEntityPipeBaseNT) {
|
||||||
|
FluidType type = Fluids.NONE;
|
||||||
|
TileEntityPipeBaseNT pipe = (TileEntityPipeBaseNT) te;
|
||||||
|
type = pipe.getType();
|
||||||
|
if(meta % 3 == 2) {
|
||||||
|
FluidDuctBox.cachedColor = ColorUtil.lightenColor(type.getColor(), 0.25D); //making very dark things not vantablack
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
jLower = 0.0625D;
|
||||||
|
jUpper = 0.9375D;
|
||||||
|
|
||||||
|
for(int i = 2; i < 13; i += 3) {
|
||||||
|
|
||||||
|
if(meta > i) {
|
||||||
|
lower += 0.0625D;
|
||||||
|
upper -= 0.0625D;
|
||||||
|
jLower += 0.0625D;
|
||||||
|
jUpper -= 0.0625D;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
PowerCableBox cable = (PowerCableBox) block;
|
||||||
|
|
||||||
|
pX = cable.canConnectTo(world, x, y, z, Library.POS_X, te);
|
||||||
|
nX = cable.canConnectTo(world, x, y, z, Library.NEG_X, te);
|
||||||
|
pY = cable.canConnectTo(world, x, y, z, Library.POS_Y, te);
|
||||||
|
nY = cable.canConnectTo(world, x, y, z, Library.NEG_Y, te);
|
||||||
|
pZ = cable.canConnectTo(world, x, y, z, Library.POS_Z, te);
|
||||||
|
nZ = cable.canConnectTo(world, x, y, z, Library.NEG_Z, te);
|
||||||
|
|
||||||
|
for(int i = 0; i < 5; i++) {
|
||||||
|
|
||||||
|
if(meta > i) {
|
||||||
|
lower += 0.0625F;
|
||||||
|
upper -= 0.0625F;
|
||||||
|
jLower += 0.0625F;
|
||||||
|
jUpper -= 0.0625F;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int mask = 0 + (pX ? 32 : 0) + (nX ? 16 : 0) + (pY ? 8 : 0) + (nY ? 4 : 0) + (pZ ? 2 : 0) + (nZ ? 1 : 0);
|
int mask = 0 + (pX ? 32 : 0) + (nX ? 16 : 0) + (pY ? 8 : 0) + (nY ? 4 : 0) + (pZ ? 2 : 0) + (nZ ? 1 : 0);
|
||||||
int count = 0 + (pX ? 1 : 0) + (nX ? 1 : 0) + (pY ? 1 : 0) + (nY ? 1 : 0) + (pZ ? 1 : 0) + (nZ ? 1 : 0);
|
int count = 0 + (pX ? 1 : 0) + (nX ? 1 : 0) + (pY ? 1 : 0) + (nY ? 1 : 0) + (pZ ? 1 : 0) + (nZ ? 1 : 0);
|
||||||
|
|
||||||
double lower = 0.125D;
|
|
||||||
double upper = 0.875D;
|
|
||||||
double jLower = 0.0625D;
|
|
||||||
double jUpper = 0.9375D;
|
|
||||||
|
|
||||||
for(int i = 2; i < 13; i += 3) {
|
|
||||||
|
|
||||||
if(meta > i) {
|
|
||||||
lower += 0.0625D;
|
|
||||||
upper -= 0.0625D;
|
|
||||||
jLower += 0.0625D;
|
|
||||||
jUpper -= 0.0625D;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Straight along X
|
//Straight along X
|
||||||
if((mask & 0b001111) == 0 && mask > 0) {
|
if((mask & 0b001111) == 0 && mask > 0) {
|
||||||
renderer.uvRotateTop = 1;
|
renderer.uvRotateTop = 1;
|
||||||
@ -226,8 +285,11 @@ public class RenderBoxDuct implements ISimpleBlockRenderingHandler {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRenderId() {
|
public int getRenderId() {
|
||||||
return FluidDuctBox.renderID;
|
return renderID;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
package com.hbm.tileentity.machine.albion;
|
package com.hbm.tileentity.machine.albion;
|
||||||
|
|
||||||
|
import com.hbm.handler.CompatHandler.OCComponent;
|
||||||
import com.hbm.interfaces.IControlReceiver;
|
import com.hbm.interfaces.IControlReceiver;
|
||||||
import com.hbm.inventory.container.ContainerPADipole;
|
import com.hbm.inventory.container.ContainerPADipole;
|
||||||
import com.hbm.inventory.fluid.FluidType;
|
import com.hbm.inventory.fluid.FluidType;
|
||||||
import com.hbm.inventory.gui.GUIPADipole;
|
import com.hbm.inventory.gui.GUIPADipole;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
import com.hbm.items.machine.ItemPACoil.EnumCoilType;
|
import com.hbm.items.machine.ItemPACoil.EnumCoilType;
|
||||||
|
import com.hbm.items.special.ItemFusionShield;
|
||||||
import com.hbm.lib.Library;
|
import com.hbm.lib.Library;
|
||||||
import com.hbm.tileentity.IGUIProvider;
|
import com.hbm.tileentity.IGUIProvider;
|
||||||
import com.hbm.tileentity.machine.albion.TileEntityPASource.PAState;
|
import com.hbm.tileentity.machine.albion.TileEntityPASource.PAState;
|
||||||
@ -14,9 +16,14 @@ import com.hbm.util.EnumUtil;
|
|||||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.Optional;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
import li.cil.oc.api.machine.Arguments;
|
||||||
|
import li.cil.oc.api.machine.Callback;
|
||||||
|
import li.cil.oc.api.machine.Context;
|
||||||
|
import li.cil.oc.api.network.SimpleComponent;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
@ -25,7 +32,9 @@ import net.minecraft.util.MathHelper;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProvider, IControlReceiver, IParticleUser {
|
@SuppressWarnings("unused")
|
||||||
|
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||||
|
public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProvider, IControlReceiver, IParticleUser, OCComponent, SimpleComponent {
|
||||||
|
|
||||||
public int dirLower;
|
public int dirLower;
|
||||||
public int dirUpper;
|
public int dirUpper;
|
||||||
@ -77,10 +86,10 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
|||||||
if(isInline) mult = 1;
|
if(isInline) mult = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isCool()) particle.crash(PAState.CRASH_NOCOOL);
|
if(!isCool()) particle.crash(PAState.CRASH_NOCOOL);
|
||||||
if(this.power < this.usage * mult) particle.crash(PAState.CRASH_NOPOWER);
|
if(this.power < usage * mult) particle.crash(PAState.CRASH_NOPOWER);
|
||||||
if(type == null) particle.crash(PAState.CRASH_NOCOIL);
|
if(type == null) particle.crash(PAState.CRASH_NOCOIL);
|
||||||
if(type != null && type.diMax < particle.momentum) particle.crash(PAState.CRASH_OVERSPEED);
|
if(type != null && type.diMax < particle.momentum && !isInline) particle.crash(PAState.CRASH_OVERSPEED);
|
||||||
|
|
||||||
if(particle.invalid) return;
|
if(particle.invalid) return;
|
||||||
|
|
||||||
@ -90,7 +99,7 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
|||||||
particle.resetDistance();
|
particle.resetDistance();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.power -= this.usage * mult;
|
this.power -= usage * mult;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -235,4 +244,111 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
|||||||
if(dir == 3) return ForgeDirection.WEST;
|
if(dir == 3) return ForgeDirection.WEST;
|
||||||
return ForgeDirection.NORTH;
|
return ForgeDirection.NORTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String dirToName(int dir) {
|
||||||
|
if(dir == 1) return "east";
|
||||||
|
if(dir == 2) return "south";
|
||||||
|
if(dir == 3) return "west";
|
||||||
|
return "north";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int nameToDir(String name) {
|
||||||
|
if(name.equals("north")) return 0;
|
||||||
|
if(name.equals("east")) return 1;
|
||||||
|
if(name.equals("south")) return 2;
|
||||||
|
if(name.equals("west")) return 3;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getComponentName() {
|
||||||
|
return "ntm_pa_dipole";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getDirLower(Context context, Arguments args) {
|
||||||
|
return new Object[] {dirToName(dirLower)};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getDirUpper(Context context, Arguments args) {
|
||||||
|
return new Object[] {dirToName(dirUpper)};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getDirRedstone(Context context, Arguments args) {
|
||||||
|
return new Object[] {dirToName(dirRedstone)};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getThreshold(Context context, Arguments args) {
|
||||||
|
return new Object[] {threshold};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] setDirLower(Context context, Arguments args) {
|
||||||
|
int dir = nameToDir(args.checkString(0));
|
||||||
|
if(dir >= 0) dirLower = dir;
|
||||||
|
return new Object[] {};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] setDirUpper(Context context, Arguments args) {
|
||||||
|
int dir = nameToDir(args.checkString(0));
|
||||||
|
if(dir >= 0) dirUpper = dir;
|
||||||
|
return new Object[] {};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] setDirRedstone(Context context, Arguments args) {
|
||||||
|
int dir = nameToDir(args.checkString(0));
|
||||||
|
if(dir >= 0) dirRedstone = dir;
|
||||||
|
return new Object[] {};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] setThreshold(Context context, Arguments args) {
|
||||||
|
threshold = MathHelper.clamp_int(args.checkInteger(0), 0, 999_999_999);
|
||||||
|
return new Object[] {};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String[] methods() {
|
||||||
|
return new String[] {
|
||||||
|
"getDirLower",
|
||||||
|
"setDirLower",
|
||||||
|
"getDirUpper",
|
||||||
|
"setDirUpper",
|
||||||
|
"getDirRedstone",
|
||||||
|
"setDirRedstone",
|
||||||
|
"getThreshold",
|
||||||
|
"setThreshold",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||||
|
switch (method) {
|
||||||
|
case "getDirLower": return getDirLower(context, args);
|
||||||
|
case "setDirLower": return setDirLower(context, args);
|
||||||
|
case "getDirUpper": return getDirUpper(context, args);
|
||||||
|
case "setDirUpper": return setDirUpper(context, args);
|
||||||
|
case "getDirRedstone": return getDirRedstone(context, args);
|
||||||
|
case "setDirRedstone": return setDirRedstone(context, args);
|
||||||
|
case "getThreshold": return getThreshold(context, args);
|
||||||
|
case "setThreshold": return setThreshold(context, args);
|
||||||
|
}
|
||||||
|
throw new NoSuchMethodException();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6143,6 +6143,7 @@ tile.reactor_inserter.name=Reactor Fuel Inserter
|
|||||||
tile.rebar.name=Rebar
|
tile.rebar.name=Rebar
|
||||||
tile.red_barrel.name=Explosive Barrel
|
tile.red_barrel.name=Explosive Barrel
|
||||||
tile.red_cable.name=Red Copper Cable
|
tile.red_cable.name=Red Copper Cable
|
||||||
|
tile.red_cable_box.name=Red Copper Boxcable
|
||||||
tile.red_cable_classic.name=Red Copper Cable (Classic)
|
tile.red_cable_classic.name=Red Copper Cable (Classic)
|
||||||
tile.red_cable_gauge.name=Power Gauge
|
tile.red_cable_gauge.name=Power Gauge
|
||||||
tile.red_cable_gauge.desc=Cable that displays how much power$moves within the network per tick.$Split networks connected by energy$storage blocks are considered as one shared network.
|
tile.red_cable_gauge.desc=Cable that displays how much power$moves within the network per tick.$Split networks connected by energy$storage blocks are considered as one shared network.
|
||||||
|
|||||||
|
After Width: | Height: | Size: 229 B |
|
After Width: | Height: | Size: 235 B |
|
After Width: | Height: | Size: 195 B |
|
After Width: | Height: | Size: 241 B |
|
After Width: | Height: | Size: 514 B |
|
After Width: | Height: | Size: 514 B |
|
After Width: | Height: | Size: 500 B |
|
After Width: | Height: | Size: 476 B |
|
After Width: | Height: | Size: 361 B |
|
After Width: | Height: | Size: 338 B |
|
After Width: | Height: | Size: 141 B |
BIN
src/main/resources/assets/hbm/textures/models/fusion/torus.png
Normal file
|
After Width: | Height: | Size: 11 KiB |