mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
removable scraps, better textures, outlet redstone control
This commit is contained in:
parent
46f11acb9b
commit
19e5cf36c4
@ -1825,7 +1825,7 @@ public class ModBlocks {
|
||||
machine_stirling = new MachineStirling().setBlockName("machine_stirling").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_stirling_steel = new MachineStirling().setBlockName("machine_stirling_steel").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_sawmill = new MachineSawmill().setBlockName("machine_sawmill").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_crucible = new MachineCrucible().setBlockName("machine_crucible").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_crucible");
|
||||
machine_crucible = new MachineCrucible().setBlockName("machine_crucible").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_fire");
|
||||
|
||||
foundry_mold = new FoundryMold().setBlockName("foundry_mold").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_fire");
|
||||
foundry_basin = new FoundryBasin().setBlockName("foundry_basin").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_fire");
|
||||
|
||||
@ -8,6 +8,7 @@ import com.hbm.inventory.material.Mats.MaterialStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemMold;
|
||||
import com.hbm.items.machine.ItemMold.Mold;
|
||||
import com.hbm.items.machine.ItemScraps;
|
||||
import com.hbm.tileentity.machine.TileEntityFoundryCastingBase;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
@ -19,6 +20,8 @@ import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@ -104,6 +107,23 @@ public abstract class FoundryCastingBase extends BlockContainer implements ICruc
|
||||
}
|
||||
}
|
||||
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemTool && ((ItemTool) player.getHeldItem().getItem()).getToolClasses(player.getHeldItem()).contains("shovel")) {
|
||||
if(cast.amount > 0) {
|
||||
ItemStack scrap = ItemScraps.create(new MaterialStack(cast.type, cast.amount));
|
||||
if(!player.inventory.addItemStackToInventory(scrap)) {
|
||||
EntityItem item = new EntityItem(world, x + 0.5, y + this.maxY, z + 0.5, scrap);
|
||||
world.spawnEntityInWorld(item);
|
||||
} else {
|
||||
player.inventoryContainer.detectAndSendChanges();
|
||||
}
|
||||
cast.amount = 0;
|
||||
cast.type = null;
|
||||
cast.markDirty();
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.material.Mats.MaterialStack;
|
||||
import com.hbm.items.machine.ItemScraps;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityFoundryChannel;
|
||||
@ -18,6 +19,10 @@ import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
@ -145,4 +150,32 @@ public class FoundryChannel extends BlockContainer implements ICrucibleAcceptor
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
}
|
||||
|
||||
TileEntityFoundryChannel cast = (TileEntityFoundryChannel) world.getTileEntity(x, y, z);
|
||||
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemTool && ((ItemTool) player.getHeldItem().getItem()).getToolClasses(player.getHeldItem()).contains("shovel")) {
|
||||
if(cast.amount > 0) {
|
||||
ItemStack scrap = ItemScraps.create(new MaterialStack(cast.type, cast.amount));
|
||||
if(!player.inventory.addItemStackToInventory(scrap)) {
|
||||
EntityItem item = new EntityItem(world, x + 0.5, y + this.maxY, z + 0.5, scrap);
|
||||
world.spawnEntityInWorld(item);
|
||||
} else {
|
||||
player.inventoryContainer.detectAndSendChanges();
|
||||
}
|
||||
cast.amount = 0;
|
||||
cast.type = null;
|
||||
cast.markDirty();
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.inventory.material.Mats.MaterialStack;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityFoundryOutlet;
|
||||
|
||||
|
||||
@ -11,6 +11,8 @@ import java.util.Map.Entry;
|
||||
import com.hbm.inventory.OreDictManager.DictFrame;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.material.NTMMaterial.SmeltingBehavior;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemScraps;
|
||||
import com.hbm.util.ItemStackUtil;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -53,8 +55,8 @@ public class Mats {
|
||||
public static final NTMMaterial MAT_GRAPHITE = makeAdditive( 1420, GRAPHITE, 0);
|
||||
public static final NTMMaterial MAT_IRON = makeSmeltable(2600, IRON, 0xFFA259).omitAutoGen();
|
||||
public static final NTMMaterial MAT_GOLD = makeSmeltable(7900, GOLD, 0xE8D754).omitAutoGen();
|
||||
public static final NTMMaterial MAT_REDSTONE = makeSmeltable(_VS + 01, REDSTONE, 0x7A0300).omitAutoGen();
|
||||
public static final NTMMaterial MAT_OBSIDIAN = makeSmeltable(_VS + 02, df("Obsidian"), 0x4D2F23).omitAutoGen();
|
||||
public static final NTMMaterial MAT_REDSTONE = makeSmeltable(_VS + 01, REDSTONE, 0xFF1000).omitAutoGen();
|
||||
public static final NTMMaterial MAT_OBSIDIAN = makeSmeltable(_VS + 02, df("Obsidian"), 0x3D234D).omitAutoGen();
|
||||
|
||||
//Radioactive
|
||||
public static final NTMMaterial MAT_URANIUM = makeSmeltable(9200, U, 0).setShapes(NUGGET, BILLET, INGOT, DUST, BLOCK);
|
||||
@ -78,9 +80,9 @@ public class Mats {
|
||||
public static final NTMMaterial MAT_BORON = makeSmeltable(500, B, 0).setShapes(DUSTTINY, INGOT, DUST, BLOCK);
|
||||
|
||||
//Alloys
|
||||
public static final NTMMaterial MAT_STEEL = makeSmeltable(_AS + 0, STEEL, 0).setShapes(DUSTTINY, INGOT, DUST, PLATE, BLOCK);
|
||||
public static final NTMMaterial MAT_MINGRADE = makeSmeltable(_AS + 1, MINGRADE, 0).setShapes(WIRE, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_ALLOY = makeSmeltable(_AS + 2, ALLOY, 0).setShapes(WIRE, INGOT, DUST, PLATE, BLOCK);
|
||||
public static final NTMMaterial MAT_STEEL = makeSmeltable(_AS + 0, STEEL, 0x4A4A4A).setShapes(DUSTTINY, INGOT, DUST, PLATE, BLOCK);
|
||||
public static final NTMMaterial MAT_MINGRADE = makeSmeltable(_AS + 1, MINGRADE, 0xE44C0F).setShapes(WIRE, INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_ALLOY = makeSmeltable(_AS + 2, ALLOY, 0xFF7318).setShapes(WIRE, INGOT, DUST, PLATE, BLOCK);
|
||||
public static final NTMMaterial MAT_DURA = makeSmeltable(_AS + 3, DURA, 0).setShapes(INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_SATURN = makeSmeltable(_AS + 4, BIGMT, 0).setShapes(INGOT, DUST, BLOCK);
|
||||
public static final NTMMaterial MAT_STAR = makeSmeltable(_AS + 5, STAR, 0).setShapes(INGOT, DUST, BLOCK);
|
||||
@ -142,6 +144,10 @@ public class Mats {
|
||||
list.addAll(entries);
|
||||
}
|
||||
|
||||
if(stack.getItem() == ModItems.scraps) {
|
||||
list.add(ItemScraps.getMats(stack));
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@ -176,7 +176,9 @@ public class ItemMold extends Item {
|
||||
String od = shape.name().toLowerCase() + name;
|
||||
List<ItemStack> ores = OreDictionary.getOres(od);
|
||||
if(!ores.isEmpty()) {
|
||||
return ores.get(0);
|
||||
ItemStack copy = ores.get(0);
|
||||
copy.stackSize = this.amount;
|
||||
return copy;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ public class ItemScraps extends Item {
|
||||
}
|
||||
|
||||
public static ItemStack create(MaterialStack stack) {
|
||||
ItemStack scrap = new ItemStack(ModItems.scrap, 1, stack.material.id);
|
||||
ItemStack scrap = new ItemStack(ModItems.scraps, 1, stack.material.id);
|
||||
scrap.stackTagCompound = new NBTTagCompound();
|
||||
scrap.stackTagCompound.setInteger("amount", stack.amount);
|
||||
return scrap;
|
||||
|
||||
@ -634,7 +634,8 @@ public class ModEventHandlerClient {
|
||||
list.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey("cannery.f1"));
|
||||
}
|
||||
|
||||
List<MaterialStack> materials = Mats.getMaterialsFromItem(new ComparableStack(stack).makeSingular().toStack());
|
||||
ItemStack copy = stack.copy();
|
||||
List<MaterialStack> materials = Mats.getMaterialsFromItem(copy);
|
||||
|
||||
if(!materials.isEmpty()) {
|
||||
for(MaterialStack mat : materials) {
|
||||
|
||||
@ -202,6 +202,15 @@ public class RenderChannel implements ISimpleBlockRenderingHandler {
|
||||
boolean doRender = tile != null ? (tile.amount > 0 && tile.type != null) : false;
|
||||
double level = doRender ? tile.amount * 0.25D / tile.getCapacity() : 0;
|
||||
Color color = doRender ? new Color(tile.type.moltenColor).brighter() : null;
|
||||
|
||||
if(color != null) {
|
||||
double brightener = 0.7D;
|
||||
int nr = (int) (255D - (255D - color.getRed()) * brightener);
|
||||
int ng = (int) (255D - (255D - color.getGreen()) * brightener);
|
||||
int nb = (int) (255D - (255D - color.getBlue()) * brightener);
|
||||
|
||||
color = new Color(nr, ng, nb);
|
||||
}
|
||||
|
||||
boolean posX = channel.canConnectTo(world, x, y, z, Library.POS_X);
|
||||
boolean negX = channel.canConnectTo(world, x, y, z, Library.NEG_X);
|
||||
|
||||
@ -4,15 +4,23 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.material.Mats.MaterialStack;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
import com.hbm.tileentity.machine.TileEntityCrucible;
|
||||
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class RenderCrucible extends TileEntitySpecialRenderer implements IItemRendererProvider {
|
||||
|
||||
public static final ResourceLocation lava = new ResourceLocation(RefStrings.MODID, "textures/models/machines/lava.png");
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
|
||||
@ -31,6 +39,38 @@ public class RenderCrucible extends TileEntitySpecialRenderer implements IItemRe
|
||||
bindTexture(ResourceManager.crucible_tex);
|
||||
ResourceManager.crucible_heat.renderAll();
|
||||
|
||||
TileEntityCrucible crucible = (TileEntityCrucible) tile;
|
||||
|
||||
if(!crucible.recipeStack.isEmpty() || !crucible.wasteStack.isEmpty()) {
|
||||
int totalCap = crucible.recipeCapacity + crucible.wasteCapacity;
|
||||
int totalMass = 0;
|
||||
|
||||
for(MaterialStack stack : crucible.recipeStack) totalMass += stack.amount;
|
||||
for(MaterialStack stack : crucible.wasteStack) totalMass += stack.amount;
|
||||
|
||||
double level = ((double) totalMass / (double) totalCap) * 0.875D;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
|
||||
|
||||
bindTexture(lava);
|
||||
Tessellator tess = Tessellator.instance;
|
||||
tess.setNormal(0F, 1F, 0F);
|
||||
tess.startDrawingQuads();
|
||||
tess.addVertexWithUV(-1, 0.5 + level, -1, 0, 0);
|
||||
tess.addVertexWithUV(-1, 0.5 + level, 1, 0, 1);
|
||||
tess.addVertexWithUV(1, 0.5 + level, 1, 1, 1);
|
||||
tess.addVertexWithUV(1, 0.5 + level, -1, 1, 0);
|
||||
tess.draw();
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
@ -9,7 +9,6 @@ import com.hbm.tileentity.machine.IRenderFoundry;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
|
||||
@ -21,6 +21,7 @@ import api.hbm.tile.IHeatSource;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
@ -28,6 +29,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@ -78,6 +80,8 @@ public class TileEntityCrucible extends TileEntityMachineBase implements IGUIPro
|
||||
|
||||
if(stack.stackSize == 1) {
|
||||
slots[i] = stack.copy();
|
||||
item.setDead();
|
||||
break;
|
||||
} else {
|
||||
slots[i] = stack.copy();
|
||||
slots[i].stackSize = 1;
|
||||
@ -90,6 +94,20 @@ public class TileEntityCrucible extends TileEntityMachineBase implements IGUIPro
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int totalCap = recipeCapacity + wasteCapacity;
|
||||
int totalMass = 0;
|
||||
|
||||
for(MaterialStack stack : recipeStack) totalMass += stack.amount;
|
||||
for(MaterialStack stack : wasteStack) totalMass += stack.amount;
|
||||
|
||||
double level = ((double) totalMass / (double) totalCap) * 0.875D;
|
||||
|
||||
List<EntityLivingBase> living = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, xCoord + 0.5, yCoord + 0.5 + level, zCoord + 0.5).expand(1, 0, 1));
|
||||
for(EntityLivingBase entity : living) {
|
||||
entity.attackEntityFrom(DamageSource.lava, 5F);
|
||||
entity.setFire(5);
|
||||
}
|
||||
|
||||
/* smelt items from buffer */
|
||||
if(!trySmelt()) {
|
||||
@ -243,12 +261,13 @@ public class TileEntityCrucible extends TileEntityMachineBase implements IGUIPro
|
||||
stack.amount -= getQuantaFromType(recipe.input, stack.material);
|
||||
}
|
||||
|
||||
outer:
|
||||
for(MaterialStack out : recipe.output) {
|
||||
|
||||
for(MaterialStack stack : this.recipeStack) {
|
||||
if(stack.material == out.material) {
|
||||
stack.amount += out.amount;
|
||||
break;
|
||||
continue outer;
|
||||
}
|
||||
}
|
||||
|
||||
@ -351,7 +370,7 @@ public class TileEntityCrucible extends TileEntityMachineBase implements IGUIPro
|
||||
return stack.amount;
|
||||
}
|
||||
if(mat == null) {
|
||||
return sum += stack.amount;
|
||||
sum += stack.amount;
|
||||
}
|
||||
}
|
||||
return sum;
|
||||
|
||||
@ -91,7 +91,7 @@ public abstract class TileEntityFoundryBase extends TileEntity implements ICruci
|
||||
* - amount being at max<br>
|
||||
*/
|
||||
public boolean standardCheck(World world, int x, int y, int z, ForgeDirection side, MaterialStack stack) {
|
||||
if(this.type != null && this.type != stack.material) return false; //reject if there's already a different material
|
||||
if(this.type != null && this.type != stack.material && this.amount > 0) return false; //reject if there's already a different material
|
||||
if(this.amount >= this.getCapacity()) return false; //reject if the buffer is already full
|
||||
return true;
|
||||
}
|
||||
@ -103,10 +103,7 @@ public abstract class TileEntityFoundryBase extends TileEntity implements ICruci
|
||||
* - returns the amount that cannot be added
|
||||
*/
|
||||
public MaterialStack standardAdd(World world, int x, int y, int z, ForgeDirection side, MaterialStack stack) {
|
||||
|
||||
if(this.type == null) {
|
||||
this.type = stack.material;
|
||||
}
|
||||
this.type = stack.material;
|
||||
|
||||
if(stack.amount + this.amount <= this.getCapacity()) {
|
||||
this.amount += stack.amount;
|
||||
|
||||
@ -6,7 +6,6 @@ import com.hbm.items.machine.ItemMold;
|
||||
import com.hbm.items.machine.ItemMold.Mold;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@ -52,14 +51,19 @@ public abstract class TileEntityFoundryCastingBase extends TileEntityFoundryBase
|
||||
slots[1] = out.copy();
|
||||
}
|
||||
|
||||
cooloff = 100;
|
||||
cooloff = 200;
|
||||
}
|
||||
|
||||
} else {
|
||||
cooloff = 100;
|
||||
cooloff = 200;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldClientReRender() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Checks slot 0 to see what mold type is installed. Returns null if no mold is found or an incorrect size was used. */
|
||||
public Mold getInstalledMold() {
|
||||
|
||||
@ -30,7 +30,7 @@ public class TileEntityFoundryChannel extends TileEntityFoundryBase {
|
||||
|
||||
if(nextUpdate <= 0 && this.amount > 0 && this.type != null) {
|
||||
|
||||
nextUpdate = worldObj.rand.nextInt(6) + 10;
|
||||
nextUpdate = worldObj.rand.nextInt(6) + 5;
|
||||
|
||||
List<Integer> ints = new ArrayList() {{ add(2); add(3); add(4); add(5); }};
|
||||
Collections.shuffle(ints);
|
||||
@ -62,7 +62,7 @@ public class TileEntityFoundryChannel extends TileEntityFoundryBase {
|
||||
if(b instanceof TileEntityFoundryChannel) {
|
||||
TileEntityFoundryChannel acc = (TileEntityFoundryChannel) b;
|
||||
|
||||
if(acc.type == null || acc.type == this.type) {
|
||||
if(acc.type == null || acc.type == this.type || acc.amount == 0) {
|
||||
acc.type = this.type;
|
||||
|
||||
if(worldObj.rand.nextInt(5) == 0) {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.inventory.material.Mats.MaterialStack;
|
||||
import com.hbm.inventory.material.NTMMaterial;
|
||||
import com.hbm.util.CrucibleUtil;
|
||||
|
||||
import api.hbm.block.ICrucibleAcceptor;
|
||||
@ -10,6 +11,15 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityFoundryOutlet extends TileEntityFoundryBase {
|
||||
|
||||
public NTMMaterial filter = null;
|
||||
/** inverts redstone behavior, i.e. when TRUE, the outlet will be blocked by default and only open with redstone */
|
||||
public boolean invertRedstone = false;
|
||||
|
||||
/** if TRUE, prevents all fluids from flowing through the outlet and renders a small barrier */
|
||||
public boolean isClosed() {
|
||||
return invertRedstone ^ this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
@Override public boolean canAcceptPartialPour(World world, int x, int y, int z, double dX, double dY, double dZ, ForgeDirection side, MaterialStack stack) { return false; }
|
||||
@Override public MaterialStack pour(World world, int x, int y, int z, double dX, double dY, double dZ, ForgeDirection side, MaterialStack stack) { return stack; }
|
||||
@ -17,6 +27,9 @@ public class TileEntityFoundryOutlet extends TileEntityFoundryBase {
|
||||
@Override
|
||||
public boolean canAcceptPartialFlow(World world, int x, int y, int z, ForgeDirection side, MaterialStack stack) {
|
||||
|
||||
if(filter != null && filter != stack.material) return false;
|
||||
if(isClosed()) return false;
|
||||
|
||||
Vec3 start = Vec3.createVectorHelper(x + 0.5, y - 0.125, z + 0.5);
|
||||
Vec3 end = Vec3.createVectorHelper(x + 0.5, y + 0.125 - 4, z + 0.5);
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 170 B |
Binary file not shown.
|
After Width: | Height: | Size: 173 B |
Binary file not shown.
|
Before Width: | Height: | Size: 262 B After Width: | Height: | Size: 272 B |
Loading…
x
Reference in New Issue
Block a user