Merge branch 'HbmMods:master' into master

This commit is contained in:
Vaern 2022-01-28 20:15:17 -08:00 committed by GitHub
commit 6014609f9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
56 changed files with 1464 additions and 668 deletions

View File

@ -0,0 +1,18 @@
package com.hbm.blocks;
import cpw.mods.fml.client.registry.RenderingRegistry;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
public interface IBlockMultiPass {
public int getPasses();
public int getColorFromPass(IBlockAccess world, int x, int y, int z, boolean inv);
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
public static int getRenderType() {
return renderID;
}
}

View File

@ -706,6 +706,7 @@ public class ModBlocks {
public static Block gas_duct_solid;
public static Block gas_duct;
public static Block fluid_duct;
public static Block fluid_duct_solid;
public static Block conveyor;
@ -1674,9 +1675,9 @@ public class ModBlocks {
therm_endo = new BombThermo(Material.iron).setBlockName("therm_endo").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F);
therm_exo = new BombThermo(Material.iron).setBlockName("therm_exo").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F);
emp_bomb = new BombFloat(Material.iron).setBlockName("emp_bomb").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F);
det_cord = new DetCord(Material.iron).setBlockName("det_cord").setCreativeTab(MainRegistry.nukeTab).setHardness(0.1F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":det_cord");
det_charge = new DetCord(Material.iron).setBlockName("det_charge").setCreativeTab(MainRegistry.nukeTab).setHardness(0.1F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":det_charge");
det_nuke = new DetCord(Material.iron).setBlockName("det_nuke").setCreativeTab(MainRegistry.nukeTab).setHardness(0.1F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":det_nuke");
det_cord = new ExplosiveCharge(Material.iron).setBlockName("det_cord").setCreativeTab(MainRegistry.nukeTab).setHardness(0.1F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":det_cord");
det_charge = new ExplosiveCharge(Material.iron).setBlockName("det_charge").setCreativeTab(MainRegistry.nukeTab).setHardness(0.1F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":det_charge");
det_nuke = new ExplosiveCharge(Material.iron).setBlockName("det_nuke").setCreativeTab(MainRegistry.nukeTab).setHardness(0.1F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":det_nuke");
det_miner = new DetMiner(Material.iron, RefStrings.MODID + ":det_miner_top").setBlockName("det_miner").setCreativeTab(MainRegistry.nukeTab).setHardness(0.1F).setResistance(0.0F).setBlockTextureName(RefStrings.MODID + ":det_miner_side");
red_barrel = new RedBarrel(Material.iron).setBlockName("red_barrel").setCreativeTab(MainRegistry.nukeTab).setHardness(0.5F).setResistance(2.5F).setBlockTextureName(RefStrings.MODID + ":barrel_red");
pink_barrel = new RedBarrel(Material.iron).setBlockName("pink_barrel").setCreativeTab(MainRegistry.nukeTab).setHardness(0.5F).setResistance(2.5F).setBlockTextureName(RefStrings.MODID + ":barrel_pink");
@ -1803,6 +1804,7 @@ public class ModBlocks {
gas_duct_solid = new GasDuctSolid(Material.iron).setBlockName("gas_duct_solid").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":gas_duct_solid");
gas_duct = new BlockGasDuct(Material.iron).setBlockName("gas_duct").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":gas_duct_icon");
fluid_duct = new BlockFluidDuct(Material.iron).setBlockName("fluid_duct").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fluid_duct_icon");
fluid_duct_solid = new BlockFluidDuctSolid(Material.iron).setBlockName("fluid_duct_solid").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fluid_duct_solid");
conveyor = new BlockConveyor(Material.iron).setBlockName("conveyor").setHardness(0.0F).setResistance(2.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":conveyor");
chain = new BlockChain(Material.iron).setBlockName("dungeon_chain").setHardness(0.25F).setResistance(2.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":chain");
@ -2884,6 +2886,7 @@ public class ModBlocks {
GameRegistry.registerBlock(gas_duct, gas_duct.getUnlocalizedName());
GameRegistry.registerBlock(gas_duct_solid, gas_duct_solid.getUnlocalizedName());
GameRegistry.registerBlock(fluid_duct, fluid_duct.getUnlocalizedName());
GameRegistry.registerBlock(fluid_duct_solid, fluid_duct_solid.getUnlocalizedName());
GameRegistry.registerBlock(conveyor, conveyor.getUnlocalizedName());
GameRegistry.registerBlock(chain, chain.getUnlocalizedName());

View File

@ -1,88 +1,60 @@
package com.hbm.blocks.bomb;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.BombConfig;
import com.hbm.entity.effect.EntityNukeCloudSmall;
import com.hbm.entity.logic.EntityNukeExplosionMK4;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.explosion.ExplosionNT;
import com.hbm.interfaces.IBomb;
import com.hbm.lib.RefStrings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks;
import net.minecraft.util.IIcon;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
public class DetCord extends Block implements IBomb {
@SideOnly(Side.CLIENT)
private IIcon iconTop;
public DetCord(Material p_i45394_1_) {
super(p_i45394_1_);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
super.registerBlockIcons(iconRegister);
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":det_nuke_top");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
if(this != ModBlocks.det_nuke)
return this.blockIcon;
return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon);
}
@Override
public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion p_149723_5_) {
this.explode(world, x, y, z);
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block p_149695_5_) {
if(world.isBlockIndirectlyGettingPowered(x, y, z)) {
this.explode(world, x, y, z);
}
}
@Override
public BombReturnCode explode(World world, int x, int y, int z) {
if(!world.isRemote) {
world.setBlock(x, y, z, Blocks.air);
if(this == ModBlocks.det_cord) {
world.createExplosion(null, x + 0.5, y + 0.5, z + 0.5, 1.5F, true);
}
if(this == ModBlocks.det_charge) {
new ExplosionNT(world, null, x + 0.5, y + 0.5, z + 0.5, 15).overrideResolution(64).explode();
ExplosionLarge.spawnParticles(world, x, y, z, ExplosionLarge.cloudFunction(15));
}
if(this == ModBlocks.det_nuke) {
world.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(world, BombConfig.missileRadius, x + 0.5, y + 0.5, z + 0.5));
EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(world, 1000, BombConfig.missileRadius * 0.005F);
entity2.posX = x;
entity2.posY = y;
entity2.posZ = z;
world.spawnEntityInWorld(entity2);
}
}
return BombReturnCode.DETONATED;
}
}
package com.hbm.blocks.bomb;
import com.hbm.blocks.ModBlocks;
import com.hbm.interfaces.IBomb.BombReturnCode;
import cpw.mods.fml.client.registry.RenderingRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
public class DetCord extends Block implements IDetConnectible {
protected DetCord(Material p_i45394_1_) {
super(p_i45394_1_);
}
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
@Override
public int getRenderType() {
return renderID;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion p_149723_5_) {
this.explode(world, x, y, z);
}
@Override
public boolean canDropFromExplosion(Explosion explosion) {
return false;
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block p_149695_5_) {
if(world.isBlockIndirectlyGettingPowered(x, y, z)) {
this.explode(world, x, y, z);
}
}
public void explode(World world, int x, int y, int z) {
if(!world.isRemote) {
world.setBlock(x, y, z, Blocks.air);
world.createExplosion(null, x + 0.5, y + 0.5, z + 0.5, 1.5F, true);
}
}
}

View File

@ -0,0 +1,93 @@
package com.hbm.blocks.bomb;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.BombConfig;
import com.hbm.entity.effect.EntityNukeCloudSmall;
import com.hbm.entity.logic.EntityNukeExplosionMK4;
import com.hbm.explosion.ExplosionLarge;
import com.hbm.explosion.ExplosionNT;
import com.hbm.interfaces.IBomb;
import com.hbm.lib.RefStrings;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks;
import net.minecraft.util.IIcon;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
public class ExplosiveCharge extends Block implements IBomb, IDetConnectible {
@SideOnly(Side.CLIENT)
private IIcon iconTop;
public ExplosiveCharge(Material p_i45394_1_) {
super(p_i45394_1_);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
super.registerBlockIcons(iconRegister);
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":det_nuke_top");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
if(this != ModBlocks.det_nuke)
return this.blockIcon;
return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon);
}
@Override
public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion p_149723_5_) {
this.explode(world, x, y, z);
}
@Override
public boolean canDropFromExplosion(Explosion explosion) {
return false;
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block p_149695_5_) {
if(world.isBlockIndirectlyGettingPowered(x, y, z)) {
this.explode(world, x, y, z);
}
}
@Override
public BombReturnCode explode(World world, int x, int y, int z) {
if(!world.isRemote) {
world.setBlock(x, y, z, Blocks.air);
if(this == ModBlocks.det_cord) {
world.createExplosion(null, x + 0.5, y + 0.5, z + 0.5, 1.5F, true);
}
if(this == ModBlocks.det_charge) {
new ExplosionNT(world, null, x + 0.5, y + 0.5, z + 0.5, 15).overrideResolution(64).explode();
ExplosionLarge.spawnParticles(world, x, y, z, ExplosionLarge.cloudFunction(15));
}
if(this == ModBlocks.det_nuke) {
world.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(world, BombConfig.missileRadius, x + 0.5, y + 0.5, z + 0.5));
EntityNukeCloudSmall entity2 = new EntityNukeCloudSmall(world, 1000, BombConfig.missileRadius * 0.005F);
entity2.posX = x;
entity2.posY = y;
entity2.posZ = z;
world.spawnEntityInWorld(entity2);
}
}
return BombReturnCode.DETONATED;
}
}

View File

@ -0,0 +1,21 @@
package com.hbm.blocks.bomb;
import net.minecraft.block.Block;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public interface IDetConnectible {
public default boolean canConnectToDetCord(IBlockAccess world, int x, int y, int z, ForgeDirection dir) {
return true;
}
public static boolean isConnectible(IBlockAccess world, int x, int y, int z, ForgeDirection dir) {
Block b = world.getBlock(x, y, z);
if(b instanceof IDetConnectible) {
return ((IDetConnectible)b).canConnectToDetCord(world, x, y, z, dir);
}
return false;
}
}

View File

@ -0,0 +1,71 @@
package com.hbm.blocks.network;
import com.hbm.blocks.IBlockMultiPass;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.render.block.RenderBlockMultipass;
import com.hbm.tileentity.conductor.TileEntityFluidDuctSimple;
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.init.Blocks;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockFluidDuctSolid extends BlockContainer implements IBlockMultiPass {
public BlockFluidDuctSolid(Material mat) {
super(mat);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityFluidDuctSimple();
}
@SideOnly(Side.CLIENT)
private IIcon overlay;
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_) {
this.blockIcon = p_149651_1_.registerIcon(this.getTextureName());
this.overlay = p_149651_1_.registerIcon(this.getTextureName() + "_overlay");
}
@Override
public int getPasses() {
return 2;
}
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return RenderBlockMultipass.currentPass == 0 ? this.blockIcon : this.overlay;
}
@Override
public int getRenderType(){
return IBlockMultiPass.getRenderType();
}
@Override
public int getColorFromPass(IBlockAccess world, int x, int y, int z, boolean inv) {
if(RenderBlockMultipass.currentPass == 0)
return 0xffffff;
if(inv)
return Fluids.NONE.getColor();
TileEntityFluidDuctSimple te = (TileEntityFluidDuctSimple) world.getTileEntity(x, y, z);
if(te != null) {
return te.getType().getColor();
}
return 0xffffff;
}
}

View File

@ -10,8 +10,12 @@ import java.util.Map;
import com.hbm.inventory.gui.GUISILEX;
import com.hbm.inventory.recipes.SILEXRecipes;
import com.hbm.inventory.recipes.SILEXRecipes.SILEXRecipe;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemFELCrystal.EnumWavelengths;
import com.hbm.lib.RefStrings;
import com.hbm.util.I18nUtil;
import com.hbm.util.WeightedRandomObject;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
@ -19,7 +23,9 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
public class SILEXRecipeHandler extends TemplateRecipeHandler {
@ -34,6 +40,7 @@ public class SILEXRecipeHandler extends TemplateRecipeHandler {
List<PositionedStack> outputs;
List<Double> chances;
double produced;
EnumWavelengths crystalStrength;
public RecipeSet(Object input, SILEXRecipe recipe) {
@ -41,6 +48,7 @@ public class SILEXRecipeHandler extends TemplateRecipeHandler {
this.outputs = new ArrayList<PositionedStack>();
this.chances = new ArrayList<Double>();
this.produced = recipe.fluidProduced / recipe.fluidConsumed;
this.crystalStrength = EnumWavelengths.values()[recipe.laserStrength];
double weight = 0;
@ -141,7 +149,7 @@ public class SILEXRecipeHandler extends TemplateRecipeHandler {
if(recipe.getKey() instanceof ItemStack) {
if (NEIServerUtils.areStacksSameTypeCrafting(ingredient, (ItemStack)recipe.getKey()))
if (NEIServerUtils.areStacksSameType(ingredient, (ItemStack)recipe.getKey()))
this.arecipes.add(new RecipeSet(recipe.getKey(), recipe.getValue()));
} else if (recipe.getKey() instanceof ArrayList) {
@ -149,7 +157,7 @@ public class SILEXRecipeHandler extends TemplateRecipeHandler {
for(Object o : (ArrayList)recipe.getKey()) {
ItemStack stack = (ItemStack)o;
if (NEIServerUtils.areStacksSameTypeCrafting(ingredient, stack))
if (NEIServerUtils.areStacksSameType(ingredient, stack))
this.arecipes.add(new RecipeSet(stack, recipe.getValue()));
}
}
@ -174,6 +182,12 @@ public class SILEXRecipeHandler extends TemplateRecipeHandler {
RecipeSet rec = (RecipeSet) this.arecipes.get(recipe);
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
/*int index = 0;
for(Double chance : rec.chances) {
fontRenderer.drawString(((int)(chance * 10D) / 10D) + "%", 84, 28 + index * 18 - 9 * ((rec.chances.size() + 1) / 2), 0x404040);
index++;
}*/
for(int i = 0; i < rec.chances.size(); i++) {
@ -186,6 +200,11 @@ public class SILEXRecipeHandler extends TemplateRecipeHandler {
String am = ((int)(rec.produced * 10D) / 10D) + "x";
fontRenderer.drawString(am, 52 - fontRenderer.getStringWidth(am) / 2, 43, 0x404040);
String wavelength = (rec.crystalStrength == EnumWavelengths.NULL) ? EnumChatFormatting.WHITE+"N/A" : rec.crystalStrength.textColor + I18nUtil.resolveKey(rec.crystalStrength.name);
fontRenderer.drawString(wavelength, (33 - fontRenderer.getStringWidth(wavelength) / 2), 8, 0x404040);
}
@Override
@ -197,4 +216,4 @@ public class SILEXRecipeHandler extends TemplateRecipeHandler {
public String getGuiTexture() {
return RefStrings.MODID + ":textures/gui/nei/gui_nei_silex.png";
}
}
}

View File

@ -3,7 +3,8 @@ package com.hbm.interfaces;
import com.hbm.inventory.fluid.FluidType;
public interface IFluidDuct {
public FluidType getType();
public boolean setType(FluidType type);
}

View File

@ -10,71 +10,62 @@ import net.minecraft.item.ItemStack;
public class ContainerNukeMike extends Container {
private TileEntityNukeMike nukeMike;
private TileEntityNukeMike nukeMike;
public ContainerNukeMike(InventoryPlayer invPlayer, TileEntityNukeMike tedf) {
nukeMike = tedf;
this.addSlotToContainer(new Slot(tedf, 0, 26, 17));
this.addSlotToContainer(new Slot(tedf, 1, 62, 17));
this.addSlotToContainer(new Slot(tedf, 2, 26, 53));
this.addSlotToContainer(new Slot(tedf, 3, 62, 53));
this.addSlotToContainer(new Slot(tedf, 4, 44, 35));
this.addSlotToContainer(new Slot(tedf, 5, 80, 35));
this.addSlotToContainer(new Slot(tedf, 6, 98, 35));
this.addSlotToContainer(new Slot(tedf, 7, 116, 35));
for(int i = 0; i < 3; i++)
{
for(int j = 0; j < 9; j++)
{
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
this.addSlotToContainer(new Slot(tedf, 0, 26, 83));
this.addSlotToContainer(new Slot(tedf, 1, 26, 101));
this.addSlotToContainer(new Slot(tedf, 2, 44, 83));
this.addSlotToContainer(new Slot(tedf, 3, 44, 101));
this.addSlotToContainer(new Slot(tedf, 4, 39, 35));
this.addSlotToContainer(new Slot(tedf, 5, 98, 91));
this.addSlotToContainer(new Slot(tedf, 6, 116, 91));
this.addSlotToContainer(new Slot(tedf, 7, 134, 91));
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 135 + i * 18));
}
}
for(int i = 0; i < 9; i++)
{
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
for(int i = 0; i < 9; i++) {
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 193));
}
}
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2)
{
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
ItemStack var3 = null;
Slot var4 = (Slot) this.inventorySlots.get(par2);
if (var4 != null && var4.getHasStack())
{
if(var4 != null && var4.getHasStack()) {
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if (par2 <= 7) {
if (!this.mergeItemStack(var5, 8, this.inventorySlots.size(), true))
{
if(par2 <= 7) {
if(!this.mergeItemStack(var5, 8, this.inventorySlots.size(), true)) {
return null;
}
} else {
return null;
}
if (var5.stackSize == 0)
{
if(var5.stackSize == 0) {
var4.putStack((ItemStack) null);
}
else
{
} else {
var4.onSlotChanged();
}
}
return var3;
}
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return nukeMike.isUseableByPlayer(player);
}
}
}

View File

@ -1,10 +1,11 @@
package com.hbm.inventory.gui;
import org.apache.commons.lang3.math.NumberUtils;
import org.lwjgl.input.Keyboard;
import java.awt.Color;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerFEL;
import com.hbm.items.machine.ItemFELCrystal.EnumWavelengths;
import com.hbm.lib.RefStrings;
import com.hbm.packet.AuxButtonPacket;
import com.hbm.packet.PacketDispatcher;
@ -13,87 +14,54 @@ import com.hbm.tileentity.machine.TileEntityFEL;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
public class GUIFEL extends GuiInfoContainer {
public static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/machine/gui_fel.png");
private TileEntityFEL fel;
private GuiTextField field;
public GUIFEL(InventoryPlayer invPlayer, TileEntityFEL laser) {
super(new ContainerFEL(invPlayer, laser));
this.fel = laser;
this.xSize = 176;
this.ySize = 168;
this.xSize = 203;
this.ySize = 169;
}
@Override
public void initGui() {
super.initGui();
Keyboard.enableRepeatEvents(true);
this.field = new GuiTextField(this.fontRendererObj, guiLeft + 57, guiTop + 57, 29, 12);
this.field.setTextColor(-1);
this.field.setDisabledTextColour(-1);
this.field.setEnableBackgroundDrawing(false);
this.field.setMaxStringLength(3);
this.field.setText(String.valueOf(fel.watts));
}
@Override
public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f);
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 133, guiTop + 16, 18, 9, mouseX, mouseY, new String[] {"Microwave"});
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 133, guiTop + 25, 18, 9, mouseX, mouseY, new String[] {"Infrared"});
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 133, guiTop + 34, 18, 9, mouseX, mouseY, new String[] {"Visible Light"});
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 133, guiTop + 43, 18, 9, mouseX, mouseY, new String[] {"UV"});
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 133, guiTop + 52, 18, 9, mouseX, mouseY, new String[] {"X-Ray"});
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 133, guiTop + 61, 18, 9, mouseX, mouseY, new String[] {"Gamma Ray"});
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 17, 16, 52, fel.power, fel.maxPower);
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 182, guiTop + 27, 16, 113, fel.power, fel.maxPower);
}
protected void mouseClicked(int x, int y, int i) {
super.mouseClicked(x, y, i);
this.field.mouseClicked(x, y, i);
if(guiLeft + 97 <= x && guiLeft + 97 + 18 > x && guiTop + 52 < y && guiTop + 52 + 18 >= y) {
if(NumberUtils.isNumber(field.getText())) {
int j = MathHelper.clamp_int((int) Double.parseDouble(field.getText()), 1, 100);
field.setText(j + "");
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(fel.xCoord, fel.yCoord, fel.zCoord, j, 1));
}
}
if(guiLeft + 97 <= x && guiLeft + 97 + 18 > x && guiTop + 16 < y && guiTop + 16 + 18 >= y) {
if(guiLeft + 142 <= x && guiLeft + 142 + 29 > x && guiTop + 41 < y && guiTop + 41 + 17 >= y) {
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(fel.xCoord, fel.yCoord, fel.zCoord, 0, 2));
}
for(int k = 0; k < 6; k++) {
if(guiLeft + 133 <= x && guiLeft + 133 + 18 > x && guiTop + 16 + k * 9 < y && guiTop + 16 + k * 9 + 9 >= y) {
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(fel.xCoord, fel.yCoord, fel.zCoord, k, 0));
}
}
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.fel.hasCustomInventoryName() ? this.fel.getInventoryName() : I18n.format(this.fel.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(name, 90 + this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 7, 0xffffff);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 98, 4210752);
if(fel.missingValidSilex && fel.isOn) {
this.fontRendererObj.drawString(I18n.format("ERR."), 55 + this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 9, 0xFF0000);
} else if(fel.isOn) {
this.fontRendererObj.drawString(I18n.format("LIVE"), 54 + this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 9, 0x00FF00);
}
}
@Override
@ -101,29 +69,39 @@ public class GUIFEL extends GuiInfoContainer {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if(field.isFocused())
drawTexturedModalRect(guiLeft + 53, guiTop + 53, 210, 4, 34, 16);
if(fel.isOn)
drawTexturedModalRect(guiLeft + 97, guiTop + 16, 192, 0, 18, 18);
drawTexturedModalRect(guiLeft + 142, guiTop + 41, 203, 0, 29, 17);
int mode = fel.mode;
drawTexturedModalRect(guiLeft + 133, guiTop + 16 + mode * 9, 176, 52 + mode * 9, 18, 9);
int k = (int)fel.getPowerScaled(114);
drawTexturedModalRect(guiLeft + 182, guiTop + 27 + 113 - k, 203, 17 + 113 - k, 16, k);
int i = (int) fel.getPowerScaled(52);
drawTexturedModalRect(guiLeft + 8, guiTop + 69 - i, 176, 52 - i, 16, i);
drawTexturedModalRect(guiLeft + 53, guiTop + 45, 210, 0, fel.watts * 34 / 100, 4);
int color = !(fel.mode == EnumWavelengths.VISIBLE) ? fel.mode.guiColor : Color.HSBtoRGB(fel.getWorldObj().getTotalWorldTime() / 50.0F, 0.5F, 1F) & 16777215;
this.field.drawTextBox();
}
@Override
protected void keyTyped(char c, int key) {
if(!this.field.textboxKeyTyped(c, key)) {
super.keyTyped(c, key);
if(fel.power > fel.powerReq * Math.pow(2, fel.mode.ordinal()) && fel.isOn && !(fel.mode == EnumWavelengths.NULL) && fel.distance > 0) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glLineWidth(5F);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawing(1);
tessellator.setColorOpaque_I(color);
tessellator.addVertex(guiLeft + 113, guiTop + 31.5F, this.zLevel);
tessellator.addVertex(guiLeft + 135, guiTop + 31.5F, this.zLevel);
tessellator.draw();
tessellator.startDrawing(1);
tessellator.setColorOpaque_I(color);
tessellator.addVertex(0, guiTop + 31.5F, this.zLevel);
tessellator.addVertex(guiLeft + 4, guiTop + 31.5F, this.zLevel);
tessellator.draw();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glPopMatrix();
}
}
}
}
}

View File

@ -3,6 +3,7 @@ package com.hbm.inventory.gui;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerNukeMike;
import com.hbm.items.ModItems;
import com.hbm.lib.RefStrings;
import com.hbm.tileentity.bomb.TileEntityNukeMike;
@ -22,14 +23,14 @@ public class GUINukeMike extends GuiContainer {
testNuke = tedf;
this.xSize = 176;
this.ySize = 166;
this.ySize = 217;
}
@Override
protected void drawGuiContainerForegroundLayer( int i, int j) {
String name = this.testNuke.hasCustomInventoryName() ? this.testNuke.getInventoryName() : I18n.format(this.testNuke.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 4, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}
@ -41,13 +42,31 @@ public class GUINukeMike extends GuiContainer {
if(testNuke.isReady() && !testNuke.isFilled())
{
drawTexturedModalRect(guiLeft + 142, guiTop + 34, 176, 0, 18, 18);
drawTexturedModalRect(guiLeft + 5, guiTop + 35, 177, 1, 16, 16);
}
if(testNuke.isReady() && testNuke.isFilled())
{
drawTexturedModalRect(guiLeft + 142, guiTop + 34, 176, 18, 18, 18);
drawTexturedModalRect(guiLeft + 5, guiTop + 35, 177, 19, 16, 16);
}
if(testNuke.getStackInSlot(5) != null && testNuke.getStackInSlot(5).getItem() == ModItems.mike_core)
drawTexturedModalRect(guiLeft + 75, guiTop + 25, 176, 49, 80, 36);
if(testNuke.getStackInSlot(6) != null && testNuke.getStackInSlot(6).getItem() == ModItems.mike_deut)
drawTexturedModalRect(guiLeft + 79, guiTop + 30, 180, 88, 58, 26);
if(testNuke.getStackInSlot(7) != null && testNuke.getStackInSlot(7).getItem() == ModItems.mike_cooling_unit)
drawTexturedModalRect(guiLeft + 140, guiTop + 30, 240, 88, 12, 26);
for(int i = 0; i < 4; i++) {
if(testNuke.getStackInSlot(i) != null && testNuke.getStackInSlot(i).getItem() == ModItems.man_explosive8)
switch(i) {
case 0: drawTexturedModalRect(guiLeft + 24, guiTop + 20 , 209, 1, 23, 23); break;
case 2: drawTexturedModalRect(guiLeft + 47, guiTop + 20 , 232, 1, 23, 23); break;
case 1: drawTexturedModalRect(guiLeft + 24, guiTop + 43 , 209, 24, 23, 23); break;
case 3: drawTexturedModalRect(guiLeft + 47, guiTop + 43 , 232, 24, 23, 23); break;
}
}
}
}
}

View File

@ -1,16 +1,21 @@
package com.hbm.inventory.gui;
import java.awt.Color;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerSILEX;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.machine.ItemFELCrystal.EnumWavelengths;
import com.hbm.lib.RefStrings;
import com.hbm.packet.AuxButtonPacket;
import com.hbm.packet.PacketDispatcher;
import com.hbm.tileentity.machine.TileEntitySILEX;
import com.hbm.util.I18nUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
@ -19,6 +24,7 @@ public class GUISILEX extends GuiInfoContainer {
public static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_silex.png");
private TileEntitySILEX silex;
int offset = 0;
public GUISILEX(InventoryPlayer invPlayer, TileEntitySILEX laser) {
super(new ContainerSILEX(invPlayer, laser));
@ -32,7 +38,7 @@ public class GUISILEX extends GuiInfoContainer {
public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f);
silex.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 44, guiTop + 54, 52, 7);
silex.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 42, 52, 7);
if(silex.current != null) {
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 27, guiTop + 72, 16, 52, mouseX, mouseY, new String[] { silex.currentFill + "/" + silex.maxFill + "mB", silex.current.toStack().getDisplayName() });
@ -41,6 +47,7 @@ public class GUISILEX extends GuiInfoContainer {
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 10, guiTop + 92, 10, 10, mouseX, mouseY, new String[] { "Void contents" });
}
@Override
protected void mouseClicked(int x, int y, int i) {
super.mouseClicked(x, y, i);
@ -55,22 +62,33 @@ public class GUISILEX extends GuiInfoContainer {
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.silex.hasCustomInventoryName() ? this.silex.getInventoryName() : I18n.format(this.silex.getInventoryName());
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(name, (this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2) - 54, 8, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
if(silex.mode != EnumWavelengths.NULL) {
this.fontRendererObj.drawString(silex.mode.textColor + I18nUtil.resolveKey(silex.mode.name), 100 + (32 - this.fontRendererObj.getStringWidth(I18nUtil.resolveKey(silex.mode.name)) / 2), 16, 0);
}
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if(silex.mode != EnumWavelengths.NULL) {
float freq = 0.1F * (float)Math.pow(2, silex.mode.ordinal());
int color = (silex.mode != EnumWavelengths.VISIBLE) ? silex.mode.guiColor : Color.HSBtoRGB(silex.getWorldObj().getTotalWorldTime() / 50.0F, 0.5F, 1F) & 16777215;
drawWave(81, 46, 16, 84, 0.5F, freq, color, 3F, 1F);
}
if(silex.tank.getFill() > 0) {
if(silex.tank.getTankType() == Fluids.ACID || silex.fluidConversion.containsKey(silex.tank.getTankType())) {
drawTexturedModalRect(guiLeft + 43, guiTop + 53, 176, 118, 54, 9);
drawTexturedModalRect(guiLeft + 7, guiTop + 41, 176, 118, 54, 9);
} else {
drawTexturedModalRect(guiLeft + 43, guiTop + 53, 176, 109, 54, 9);
drawTexturedModalRect(guiLeft + 7, guiTop + 41, 176, 109, 54, 9);
}
}
@ -81,6 +99,40 @@ public class GUISILEX extends GuiInfoContainer {
drawTexturedModalRect(guiLeft + 26, guiTop + 124 - f, 176, 109 - f, 16, f);
int i = silex.getFluidScaled(52);
drawTexturedModalRect(guiLeft + 44, guiTop + 54, 176, silex.tank.getTankType() == Fluids.ACID ? 43 : 50, i, 7);
drawTexturedModalRect(guiLeft + 8, guiTop + 42, 176, silex.tank.getTankType() == Fluids.ACID ? 43 : 50, i, 7);
}
}
private void drawWave(int x, int y, int height, int width, float resolution, float freq, int color, float thickness, float mult) {
float samples = ((float)width) / resolution;
float scale = ((float)height)/2F;
float offset = (float)((float)silex.getWorldObj().getTotalWorldTime() % (4*Math.PI/freq));//((width/3)*Math.PI/3));//(2.05F*width*freq));
for(int i = 1; i < samples; i++) {
double currentX = offset + x + i*resolution;
double nextX = offset + x + (i+1)*resolution;
double currentY = y + scale*Math.sin(freq*currentX);
double nextY = y + scale*Math.sin(freq*nextX);
drawLine(thickness, color, currentX-offset, currentY, nextX-offset, nextY);
}
}
private void drawLine(float width, int color, double x1, double y1, double x2, double y2) {
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glLineWidth(width);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawing(1);
tessellator.setColorOpaque_I(color);
tessellator.addVertex(guiLeft + x1, guiTop + y1, this.zLevel);
tessellator.addVertex(guiLeft + x2, guiTop + y2, this.zLevel);
tessellator.draw();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glPopMatrix();
}
}

View File

@ -738,6 +738,18 @@ public class AssemblerRecipes {
new ComparableStack(ModItems.crystal_diamond, 1)
}, 400);
makeRecipe(new ComparableStack(Item.getItemFromBlock(ModBlocks.machine_fel), 1), new AStack[] {
new ComparableStack(ModBlocks.fusion_conductor, 16),
new ComparableStack(ModBlocks.machine_lithium_battery, 2),
new OreDictStack(STEEL.ingot(), 16),
new OreDictStack(STEEL.plate(), 24),
new OreDictStack(POLYMER.ingot(), 8),
new ComparableStack(ModItems.circuit_red_copper, 4),
new ComparableStack(ModItems.wire_red_copper, 64),
new ComparableStack(ModItems.coil_advanced_torus, 16),
new ComparableStack(ModItems.circuit_gold, 1)
}, 400);
makeRecipe(new ComparableStack(ModBlocks.rbmk_blank, 1), new AStack[] {
new ComparableStack(ModBlocks.concrete_asbestos, 4),
new OreDictStack(STEEL.plate(), 4),

View File

@ -28,68 +28,68 @@ public class SILEXRecipes {
itemTranslation.put(new ComparableStack(ModItems.fluid_icon, 1, Fluids.UF6.getID()), new ComparableStack(ModItems.ingot_uranium));
dictTranslation.put("dustUranium", "ingotUranium");
recipes.put("ingotUranium", new SILEXRecipe(900, 100)
recipes.put("ingotUranium", new SILEXRecipe(900, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u238), 11))
);
recipes.put(new ComparableStack(ModItems.ingot_pu_mix), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.ingot_pu_mix), new SILEXRecipe(900, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu239), 6))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu240), 3))
);
recipes.put(new ComparableStack(ModItems.ingot_am_mix), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.ingot_am_mix), new SILEXRecipe(900, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_am241), 3))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_am242), 6))
);
itemTranslation.put(new ComparableStack(ModItems.fluid_icon, 1, Fluids.PUF6.getID()), new ComparableStack(ModItems.ingot_plutonium));
dictTranslation.put("dustPlutonium", "ingotPlutonium");
recipes.put("ingotPlutonium", new SILEXRecipe(900, 100)
recipes.put("ingotPlutonium", new SILEXRecipe(900, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu238), 3))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu239), 4))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu240), 2))
);
recipes.put(new ComparableStack(ModItems.ingot_schraranium), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.ingot_schraranium), new SILEXRecipe(900, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_schrabidium), 4))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_uranium), 3))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_plutonium), 2))
);
itemTranslation.put(new ComparableStack(ModItems.powder_australium), new ComparableStack(ModItems.ingot_australium));
recipes.put(new ComparableStack(ModItems.ingot_australium), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.ingot_australium), new SILEXRecipe(900, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_australium_lesser), 5))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_australium_greater), 1))
);
recipes.put(new ComparableStack(ModItems.crystal_schraranium), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.crystal_schraranium), new SILEXRecipe(900, 100, 3)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_schrabidium), 5))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_uranium), 2))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_plutonium), 2))
);
itemTranslation.put(new ComparableStack(ModItems.powder_lapis), new ComparableStack(Items.dye, 1, 4));
recipes.put(new ComparableStack(Items.dye, 1, 4), new SILEXRecipe(100, 100)
recipes.put(new ComparableStack(Items.dye, 1, 4), new SILEXRecipe(100, 100 ,1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.sulfur), 4))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_aluminium), 3))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_cobalt), 3))
);
recipes.put(new ComparableStack(ModItems.fluid_icon, 1, Fluids.DEATH.getID()), new SILEXRecipe(1000, 1000)
recipes.put(new ComparableStack(ModItems.fluid_icon, 1, Fluids.DEATH.getID()), new SILEXRecipe(1000, 1000, 4)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_impure_osmiridium), 1))
);
for(int i = 0; i < 5; i++) {
// UEU //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_ueu, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_ueu, 1, i), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u238), 88 - i * 6))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 8 - i * 2))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 2 + 3 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 2 + 5 * i)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_ueu, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_ueu, 1, i + 5), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u238), 88 - i * 6))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 8 - i * 2))
@ -97,116 +97,116 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 1 + 5 * i)) );
// MEU //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_meu, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_meu, 1, i), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_uranium_fuel), 90 - i * 12))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 4 + 5 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 6 + 7 * i)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_meu, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_meu, 1, i + 5), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_uranium_fuel), 89 - i * 12))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 4 + 5 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 6 + 7 * i)) );
// HEU233 //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu233, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu233, 1, i), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u233), 90 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM233.ordinal()), 4 + 8 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM233.ordinal()), 6 + 12 * i)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu233, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu233, 1, i + 5), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u233), 89 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM233.ordinal()), 4 + 8 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM233.ordinal()), 6 + 12 * i)) );
// HEU235 //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu235, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu235, 1, i), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 90 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 4 + 8 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 6 + 12 * i)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu235, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu235, 1, i + 5), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 89 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 4 + 8 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 6 + 12 * i)) );
// TH232 //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_thmeu, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_thmeu, 1, i), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_thorium_fuel), 90 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.THORIUM.ordinal()), 10 + 20 * i)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_thmeu, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_thmeu, 1, i + 5), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_thorium_fuel), 89 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.THORIUM.ordinal()), 10 + 20 * i)) );
// LEP //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_lep, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_lep, 1, i), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_plutonium_fuel), 90 - i * 15))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 7 + 10 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 3 + 5 * i)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_lep, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_lep, 1, i + 5), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_plutonium_fuel), 89 - i * 15))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 7 + 10 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 3 + 5 * i)) );
// MEP //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_mep, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_mep, 1, i), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu_mix), 85 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 10 + 10 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 5 + 5 * i)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_mep, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_mep, 1, i + 5), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu_mix), 84 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 10 + 10 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 5 + 5 * i)) );
// HEP239 //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep239, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep239, 1, i), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu239), 85 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 15 + 20 * i)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep239, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep239, 1, i + 5), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu239), 84 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 15 + 20 * i)) );
// HEP241 //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep241, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep241, 1, i), new SILEXRecipe(600, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 85 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM241.ordinal()), 15 + 20 * i)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep241, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep241, 1, i + 5), new SILEXRecipe(600, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 84 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM241.ordinal()), 15 + 20 * i)) );
// MEN //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_men, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_men, 1, i), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_neptunium_fuel), 90 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.NEPTUNIUM.ordinal()), 4 + 8 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.NEPTUNIUM.ordinal()), 6 + 12 * i)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_men, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_men, 1, i + 5), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_neptunium_fuel), 89 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.NEPTUNIUM.ordinal()), 4 + 8 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.NEPTUNIUM.ordinal()), 6 + 12 * i)) );
// MOX //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_mox, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_mox, 1, i), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_mox_fuel), 90 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 2 + 4 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 3 + 6 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 3 + 7 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 2 + 3 * i)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_mox, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_mox, 1, i + 5), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_mox_fuel), 89 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 2 + 4 * i))
@ -215,26 +215,26 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 2 + 3 * i)) );
// LEAUS //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_leaus, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_leaus, 1, i), new SILEXRecipe(600, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_australium_lesser), 90 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 6 + 12 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pb209), 4 + 8 * i)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_leaus, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_leaus, 1, i + 5), new SILEXRecipe(600, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_australium_lesser), 89 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 6 + 12 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pb209), 4 + 8 * i)) );
// HEAUS //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_heaus, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_heaus, 1, i), new SILEXRecipe(600, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_australium_lesser), 90 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_au198), 5 + 10 * i))
.addOut(new WeightedRandomObject(new ItemStack(Items.gold_nugget), 3 + 6 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pb209), 2 + 4 * i)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_heaus, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_heaus, 1, i + 5), new SILEXRecipe(600, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_australium_lesser), 89 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_au198), 5 + 10 * i))
@ -242,34 +242,34 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pb209), 2 + 4 * i)) );
// BALEFIRE //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire, 1, i), new SILEXRecipe(400, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire, 1, i), new SILEXRecipe(400, 100, 3)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_balefire), 90 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 10 + 20 * i)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire, 1, i + 5), new SILEXRecipe(400, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire, 1, i + 5), new SILEXRecipe(400, 100, 3)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_balefire), 89 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 10 + 20 * i)) );
// FLASHGOLD //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire_gold, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire_gold, 1, i), new SILEXRecipe(600, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_au198), 90 - 20 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_balefire), 10 + 20 * i)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire_gold, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire_gold, 1, i + 5), new SILEXRecipe(600, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_au198), 89 - 20 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_balefire), 10 + 20 * i)) );
// FLASHLEAD //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_flashlead, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_flashlead, 1, i), new SILEXRecipe(600, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_au198), 44 - 10 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pb209), 44 - 10 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_bismuth), 1 + 6 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_mercury), 1 + 6 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_gh336), 10 + 8 * i)) ); //Reimumunch
recipes.put(new ComparableStack(ModItems.rbmk_pellet_flashlead, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_flashlead, 1, i + 5), new SILEXRecipe(600, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 2)) //literal how
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_au198), 43 - 10 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pb209), 43 - 10 * i))
@ -278,13 +278,13 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_gh336), 10 + 8 * i)) );
// POBE //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_po210be, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_po210be, 1, i), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_polonium), 45 - 10 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_beryllium), 45 - 10 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 5 + 10 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_po210be, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_po210be, 1, i + 5), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_polonium), 44 - 10 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_beryllium), 45 - 10 * i))
@ -292,14 +292,14 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i)) );
// PUBE //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_pu238be, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_pu238be, 1, i), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu238), 45 - 10 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_beryllium), 45 - 10 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 3 + 5 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 2 + 5 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_pu238be, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_pu238be, 1, i + 5), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu238), 44 - 10 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_beryllium), 45 - 10 * i))
@ -308,14 +308,14 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i)) );
// RABE //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_ra226be, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_ra226be, 1, i), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_ra226), 45 - 10 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_beryllium), 45 - 10 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 3 + 5 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_polonium), 2 + 5 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_ra226be, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_ra226be, 1, i + 5), new SILEXRecipe(600, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_ra226), 44 - 10 * i))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_beryllium), 45 - 10 * i))
@ -324,7 +324,7 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i)) );
// FLASHGOLD //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_drx, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_drx, 1, i), new SILEXRecipe(600, 100, 4)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1))
@ -332,7 +332,7 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_drx, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_drx, 1, i + 5), new SILEXRecipe(600, 100, 4)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1))
@ -341,13 +341,13 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.undefined), 1)) );
// ZFB BI //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_bismuth, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_bismuth, 1, i), new SILEXRecipe(600, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_uranium), 50 - i * 10))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 50 - i * 10))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_bismuth), 50 + i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 150)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_bismuth, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_bismuth, 1, i + 5), new SILEXRecipe(600, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 3))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_uranium), 50 - i * 10))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 50 - i * 10))
@ -355,13 +355,13 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 147)) );
// ZFB PU-241 //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_pu241, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_pu241, 1, i), new SILEXRecipe(600, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 50 - i * 10))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu240), 50 - i * 10))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 50 + i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 150)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_pu241, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_pu241, 1, i + 5), new SILEXRecipe(600, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 3))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 50 - i * 10))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu240), 50 - i * 10))
@ -369,37 +369,37 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 147)) );
// ZFB RG-AM //
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_am_mix, 1, i), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_am_mix, 1, i), new SILEXRecipe(600, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 100 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_am_mix), 50 + i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 150)) );
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_am_mix, 1, i + 5), new SILEXRecipe(600, 100)
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_am_mix, 1, i + 5), new SILEXRecipe(600, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_xe135_tiny), 3))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 100 - i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_am_mix), 50 + i * 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 147)) );
}
recipes.put(new ComparableStack(ModItems.nuclear_waste_long, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_long, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), new SILEXRecipe(900, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_neptunium), 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu239), 45))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu240), 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_technetium), 15))
);
recipes.put(new ComparableStack(ModItems.nuclear_waste_long_depleted, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_long_depleted, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), new SILEXRecipe(900, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 65))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_bismuth), 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 15))
);
recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), new SILEXRecipe(900, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu238), 12))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_sr90_tiny), 10))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_i131_tiny), 10))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_cs137_tiny), 12))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 56))
);
recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), new SILEXRecipe(900, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 10))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 32))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 22))
@ -408,25 +408,25 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 16))
);
recipes.put(new ComparableStack(ModItems.nuclear_waste_long, 1, ItemWasteLong.WasteClass.URANIUM233.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_long, 1, ItemWasteLong.WasteClass.URANIUM233.ordinal()), new SILEXRecipe(900, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 15))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_neptunium), 25))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu239), 45))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_technetium), 15))
);
recipes.put(new ComparableStack(ModItems.nuclear_waste_long_depleted, 1, ItemWasteLong.WasteClass.URANIUM233.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_long_depleted, 1, ItemWasteLong.WasteClass.URANIUM233.ordinal()), new SILEXRecipe(900, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 60))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_bismuth), 25))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 15))
);
recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.URANIUM233.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.URANIUM233.ordinal()), new SILEXRecipe(900, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu238), 4))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_sr90_tiny), 12))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_i131_tiny), 10))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_cs137_tiny), 14))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 60))
);
recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.URANIUM233.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.URANIUM233.ordinal()), new SILEXRecipe(900, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 12))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 34))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 13))
@ -435,7 +435,7 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 29))
);
recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), new SILEXRecipe(900, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu240), 10))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 25))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_sr90_tiny), 2))
@ -443,7 +443,7 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_cs137_tiny), 6))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 52))
);
recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), new SILEXRecipe(900, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 2))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 16))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 40))
@ -451,7 +451,7 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 39))
);
recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), new SILEXRecipe(900, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu241), 15))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_neptunium), 5))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_sr90_tiny), 2))
@ -459,7 +459,7 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_cs137_tiny), 7))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 66))
);
recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), new SILEXRecipe(900, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 2))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 22))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_bismuth), 20))
@ -468,7 +468,7 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 36))
);
recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.PLUTONIUM241.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.PLUTONIUM241.ordinal()), new SILEXRecipe(900, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_am241), 25))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_am242), 35))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_technetium), 5))
@ -476,46 +476,46 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_cs137_tiny), 7))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 25))
);
recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.PLUTONIUM241.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.PLUTONIUM241.ordinal()), new SILEXRecipe(900, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_bismuth), 60))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 15))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 5))
);
recipes.put(new ComparableStack(ModItems.nuclear_waste_long, 1, ItemWasteLong.WasteClass.THORIUM.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_long, 1, ItemWasteLong.WasteClass.THORIUM.ordinal()), new SILEXRecipe(900, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u233), 40))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u235), 35))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 25))
);
recipes.put(new ComparableStack(ModItems.nuclear_waste_long_depleted, 1, ItemWasteLong.WasteClass.THORIUM.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_long_depleted, 1, ItemWasteLong.WasteClass.THORIUM.ordinal()), new SILEXRecipe(900, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 35))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_bismuth), 40))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 15))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 10))
);
recipes.put(new ComparableStack(ModItems.nuclear_waste_long, 1, ItemWasteLong.WasteClass.NEPTUNIUM.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_long, 1, ItemWasteLong.WasteClass.NEPTUNIUM.ordinal()), new SILEXRecipe(900, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u238), 15))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu239), 40))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu240), 15))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_technetium), 15))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 15))
);
recipes.put(new ComparableStack(ModItems.nuclear_waste_long_depleted, 1, ItemWasteLong.WasteClass.NEPTUNIUM.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_long_depleted, 1, ItemWasteLong.WasteClass.NEPTUNIUM.ordinal()), new SILEXRecipe(900, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u238), 16))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_lead), 55))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 20))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 9))
);
recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.NEPTUNIUM.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.NEPTUNIUM.ordinal()), new SILEXRecipe(900, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_pu238), 40))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_sr90_tiny), 7))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_i131_tiny), 5))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_cs137_tiny), 8))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 40))
);
recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.NEPTUNIUM.ordinal()), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.nuclear_waste_short_depleted, 1, ItemWasteShort.WasteClass.NEPTUNIUM.ordinal()), new SILEXRecipe(900, 100, 1)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_zirconium), 7))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 29))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_u238), 2))
@ -523,7 +523,7 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nuclear_waste_tiny), 17))
);
recipes.put(new ComparableStack(ModItems.fallout, 1), new SILEXRecipe(900, 100)
recipes.put(new ComparableStack(ModItems.fallout, 1), new SILEXRecipe(900, 100, 2)
.addOut(new WeightedRandomObject(new ItemStack(ModItems.dust_tiny), 90))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_co60), 2))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_sr90_tiny), 3))
@ -532,7 +532,7 @@ public class SILEXRecipes {
.addOut(new WeightedRandomObject(new ItemStack(ModItems.nugget_au198), 1))
);
recipes.put(new ComparableStack(Blocks.gravel, 1), new SILEXRecipe(1000, 250)
recipes.put(new ComparableStack(Blocks.gravel, 1), new SILEXRecipe(1000, 250, 0)
.addOut(new WeightedRandomObject(new ItemStack(Items.flint), 80))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_boron), 5))
.addOut(new WeightedRandomObject(new ItemStack(ModItems.powder_lithium), 10))
@ -623,20 +623,22 @@ public class SILEXRecipes {
return recipes;
}
public static class SILEXRecipe {
public static class SILEXRecipe {
public int fluidProduced;
public int fluidConsumed;
public int laserStrength;
public List<WeightedRandomObject> outputs = new ArrayList();
public SILEXRecipe(int fluidProduced, int fluidConsumed) {
public SILEXRecipe(int fluidProduced, int fluidConsumed, int laserStrength) {
this.fluidProduced = fluidProduced;
this.fluidConsumed = fluidConsumed;
this.laserStrength = laserStrength;
}
public SILEXRecipe addOut(WeightedRandomObject entry) {
outputs.add(entry);
return this;
}
}
}
}

View File

@ -13,6 +13,7 @@ import com.hbm.items.armor.*;
import com.hbm.items.bomb.*;
import com.hbm.items.food.*;
import com.hbm.items.machine.*;
import com.hbm.items.machine.ItemFELCrystal.EnumWavelengths;
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
import com.hbm.items.machine.ItemPlateFuel.FunctionEnum;
import com.hbm.items.machine.ItemRBMKRod.EnumBurnFunc;
@ -718,6 +719,12 @@ public class ModItems {
public static Item part_carbon;
public static Item part_copper;
public static Item part_plutonium;
public static Item laser_crystal_co2;
public static Item laser_crystal_bismuth;
public static Item laser_crystal_cmb;
public static Item laser_crystal_dnt;
public static Item laser_crystal_digamma;
public static Item thermo_element;
public static Item limiter;
@ -3230,6 +3237,12 @@ public class ModItems {
part_copper = new Item().setUnlocalizedName("part_copper").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":part_copper");
part_plutonium = new Item().setUnlocalizedName("part_plutonium").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":part_plutonium");
laser_crystal_co2 = new ItemFELCrystal(EnumWavelengths.IR).setUnlocalizedName("laser_crystal_co2").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":laser_crystal_co2");
laser_crystal_bismuth = new ItemFELCrystal(EnumWavelengths.VISIBLE).setUnlocalizedName("laser_crystal_bismuth").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":laser_crystal_bismuth");
laser_crystal_cmb = new ItemFELCrystal(EnumWavelengths.UV).setUnlocalizedName("laser_crystal_cmb").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":laser_crystal_cmb");
laser_crystal_dnt = new ItemFELCrystal(EnumWavelengths.GAMMA).setUnlocalizedName("laser_crystal_dnt").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":laser_crystal_dnt");
laser_crystal_digamma = new ItemFELCrystal(EnumWavelengths.DRX).setUnlocalizedName("laser_crystal_digamma").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":laser_crystal_digamma");
thermo_element = new Item().setUnlocalizedName("thermo_element").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":thermo_element");
limiter = new Item().setUnlocalizedName("limiter").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":limiter");
@ -6446,6 +6459,13 @@ public class ModItems {
GameRegistry.registerItem(part_copper, part_copper.getUnlocalizedName());
GameRegistry.registerItem(part_plutonium, part_plutonium.getUnlocalizedName());
//FEL laser crystals
GameRegistry.registerItem(laser_crystal_co2, laser_crystal_co2.getUnlocalizedName());
GameRegistry.registerItem(laser_crystal_bismuth, laser_crystal_bismuth.getUnlocalizedName());
GameRegistry.registerItem(laser_crystal_cmb, laser_crystal_cmb.getUnlocalizedName());
GameRegistry.registerItem(laser_crystal_dnt, laser_crystal_dnt.getUnlocalizedName());
GameRegistry.registerItem(laser_crystal_digamma, laser_crystal_digamma.getUnlocalizedName());
//Recycled Units
GameRegistry.registerItem(recycled_ground, recycled_ground.getUnlocalizedName());
GameRegistry.registerItem(recycled_rock, recycled_rock.getUnlocalizedName());

View File

@ -0,0 +1,56 @@
package com.hbm.items.machine;
import java.util.List;
import com.hbm.items.ModItems;
import com.hbm.util.I18nUtil;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
public class ItemFELCrystal extends Item {
public EnumWavelengths wavelength = EnumWavelengths.NULL;
public ItemFELCrystal(EnumWavelengths wavelength)
{
this.wavelength = wavelength;
this.setMaxStackSize(1);
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
String desc = (stack.getItem() == ModItems.laser_crystal_digamma) ? (EnumChatFormatting.OBFUSCATED + "THERADIANCEOFATHOUSANDSUNS") : (this.getUnlocalizedNameInefficiently(stack) + ".desc");
list.add(I18nUtil.resolveKey(desc));
list.add(wavelength.textColor + I18nUtil.resolveKey(wavelength.name) + " - " + wavelength.textColor + I18nUtil.resolveKey(this.wavelength.wavelengthRange));
}
public static enum EnumWavelengths{
NULL("la creatura", "6 dollar", 0x010101, 0x010101, EnumChatFormatting.WHITE),
IR("wavelengths.name.ir", "wavelengths.waveRange.ir", 0xBB1010, 0xCC4040, EnumChatFormatting.RED),
VISIBLE("wavelengths.name.visible", "wavelengths.waveRange.visible", 0, 0, EnumChatFormatting.GREEN),
UV("wavelengths.name.uv", "wavelengths.waveRange.uv", 0x0A1FC4, 0x00EFFF, EnumChatFormatting.AQUA),
GAMMA("wavelengths.name.gamma", "wavelengths.waveRange.gamma", 0x150560, 0xEF00FF, EnumChatFormatting.LIGHT_PURPLE),
DRX("wavelengths.name.drx", "wavelengths.waveRange.drx", 0xFF0000, 0xFF0000, EnumChatFormatting.DARK_RED);
public String name = "";
public String wavelengthRange = "";
public int renderedBeamColor;
public int guiColor;
public EnumChatFormatting textColor;
private EnumWavelengths(String name, String wavelength, int color, int guiColor, EnumChatFormatting textColor) {
this.name = name;
this.wavelengthRange = wavelength;
this.renderedBeamColor = color;
this.guiColor = guiColor;
this.textColor = textColor;
}
}
}

View File

@ -123,7 +123,7 @@ public class ItemFluidDuct extends Item {
world.setBlock(x, y, z, ModBlocks.fluid_duct);
if(world.getTileEntity(x, y, z) instanceof TileEntityFluidDuct) {
((TileEntityFluidDuct) world.getTileEntity(x, y, z)).type = Fluids.fromID(stack.getItemDamage());
((TileEntityFluidDuct) world.getTileEntity(x, y, z)).setType(Fluids.fromID(stack.getItemDamage()));
}
world.playSoundEffect(x, y, z, "hbm:block.pipePlaced", 1.0F, 0.65F + world.rand.nextFloat() * 0.2F);

View File

@ -9,6 +9,7 @@ import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.ModItems;
import com.hbm.tileentity.conductor.TileEntityFluidDuct;
import com.hbm.tileentity.conductor.TileEntityFluidDuctSimple;
import com.hbm.util.I18nUtil;
import cpw.mods.fml.relauncher.Side;
@ -83,13 +84,20 @@ public class ItemFluidIdentifier extends Item {
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int i, float f1, float f2, float f3) {
TileEntity te = world.getTileEntity(x, y, z);
if(te instanceof TileEntityFluidDuct) {
if(te instanceof TileEntityFluidDuctSimple) {
if(!world.isRemote) {
TileEntityFluidDuct duct = (TileEntityFluidDuct) te;
TileEntityFluidDuctSimple duct = (TileEntityFluidDuctSimple) te;
FluidType type = Fluids.fromID(stack.getItemDamage());
if (player.isSneaking()) markDuctsRecursively(world, x, y, z, type);
else duct.type = type;
if (player.isSneaking()) {
markDuctsRecursively(world, x, y, z, type);
} else {
duct.setType(type);
}
}
world.markBlockForUpdate(x, y, z);
player.swingItem();
}
@ -102,27 +110,40 @@ public class ItemFluidIdentifier extends Item {
private void markDuctsRecursively(World world, int x, int y, int z, FluidType type, int maxRecursion) {
TileEntity start = world.getTileEntity(x, y, z);
if (!(start instanceof TileEntityFluidDuct)) return;
TileEntityFluidDuct startDuct = (TileEntityFluidDuct) start;
FluidType oldType = startDuct.type;
if (oldType == type) return; // prevent infinite loops
startDuct.type = type;
if (!(start instanceof TileEntityFluidDuctSimple))
return;
TileEntityFluidDuctSimple startDuct = (TileEntityFluidDuctSimple) start;
FluidType oldType = startDuct.getType();
if (oldType == type)
return; // prevent infinite loops
startDuct.setType(type);
directionLoop: for (ForgeDirection direction : ForgeDirection.values()) {
for (int currentRecursion = 1; currentRecursion <= maxRecursion; currentRecursion++) {
int nextX = x + direction.offsetX * currentRecursion;
int nextY = y + direction.offsetY * currentRecursion;
int nextZ = z + direction.offsetZ * currentRecursion;
TileEntity te = world.getTileEntity(nextX, nextY, nextZ);
if (te instanceof IFluidDuct && ((IFluidDuct) te).getType() == oldType) {
if (te instanceof TileEntityFluidDuctSimple && ((TileEntityFluidDuctSimple) te).getType() == oldType) {
TileEntityFluidDuct nextDuct = (TileEntityFluidDuct) te;
long connectionsCount = Arrays.stream(nextDuct.connections).filter(Objects::nonNull).count();
if (connectionsCount > 1) {
markDuctsRecursively(world, nextX, nextY, nextZ, type, maxRecursion - currentRecursion);
continue directionLoop;
} else nextDuct.type = type;
} else break;
} else {
nextDuct.setType(type);
}
} else {
break;
}
}
}
}

View File

@ -5,6 +5,7 @@ import java.util.List;
import com.hbm.blocks.BlockDummyable;
import com.hbm.lib.Library;
import com.hbm.tileentity.conductor.TileEntityFluidDuct;
import com.hbm.tileentity.conductor.TileEntityFluidDuctSimple;
import api.hbm.energy.IEnergyConductor;
import net.minecraft.block.Block;
@ -47,10 +48,10 @@ public class ItemWandD extends Item {
player.addChatComponentMessage(new ChatComponentText("" + con.getPowerNet()));
}*/
if(te instanceof TileEntityFluidDuct) {
if(te instanceof TileEntityFluidDuctSimple) {
player.addChatComponentMessage(new ChatComponentText("" + ((TileEntityFluidDuct)te).type.getUnlocalizedName()));
player.addChatComponentMessage(new ChatComponentText("" + ((TileEntityFluidDuct)te).type.getID()));
player.addChatComponentMessage(new ChatComponentText("" + ((TileEntityFluidDuctSimple)te).getType().getUnlocalizedName()));
player.addChatComponentMessage(new ChatComponentText("" + ((TileEntityFluidDuctSimple)te).getType().getID()));
}
//CellularDungeonFactory.meteor.generate(world, x, y, z, world.rand);

View File

@ -728,6 +728,34 @@ public class ItemAmmo extends Item {
if(this == ModItems.ammo_folly_du) {
list.add(EnumChatFormatting.BLUE + "+ Howitzer 17kg U238 shell");
}
//STINGER
if(this == ModItems.ammo_stinger_rocket) {
list.add(EnumChatFormatting.BLUE + "+ Homing");
}
if(this == ModItems.ammo_stinger_rocket_he) {
list.add(EnumChatFormatting.BLUE + "+ Homing");
list.add(EnumChatFormatting.BLUE + "+ Increased Blast Radius");
list.add(EnumChatFormatting.RED + "- Increased Wear");
}
if(this == ModItems.ammo_stinger_rocket_incendiary) {
list.add(EnumChatFormatting.BLUE + "+ Homing");
list.add(EnumChatFormatting.BLUE + "+ Incendiary explosion");
list.add(EnumChatFormatting.RED + "- Slightly Increased wear");
}
if(this == ModItems.ammo_stinger_rocket_nuclear) {
list.add(EnumChatFormatting.BLUE + "+ Homing");
list.add(EnumChatFormatting.BLUE + "+ Nuclear");
list.add(EnumChatFormatting.RED + "- Highly Increased wear");
}
if(this == ModItems.ammo_stinger_rocket_bones) {
list.add(EnumChatFormatting.BLUE + "+ Homing");
list.add(EnumChatFormatting.YELLOW + "* RATTLE ME BONES");
list.add(EnumChatFormatting.YELLOW + "* WELCOME ABOARD MATEYS!");
list.add(EnumChatFormatting.YELLOW + "* RATTLE ME BONES");
list.add(EnumChatFormatting.YELLOW + "* RATTLE ME BONES");
list.add(EnumChatFormatting.YELLOW + "* SPIN THE WHEEL FOR THE TREASURE TO TAKE");
}
}
}

View File

@ -495,7 +495,7 @@ public class Library {
if(tileentity instanceof IFluidDuct)
{
if(tileentity instanceof TileEntityFluidDuct && ((TileEntityFluidDuct)tileentity).type.name().equals(type.name()))
if(tileentity instanceof TileEntityFluidDuct && ((TileEntityFluidDuct)tileentity).getType() == type)
{
if(Library.checkUnionListForFluids(((TileEntityFluidDuct)tileentity).uoteab, that))
{

View File

@ -634,6 +634,8 @@ public class ClientProxy extends ServerProxy {
RenderingRegistry.registerBlockHandler(new RenderCrystal());
RenderingRegistry.registerBlockHandler(new RenderTestCable());
RenderingRegistry.registerBlockHandler(new RenderBlockCT());
RenderingRegistry.registerBlockHandler(new RenderDetCord());
RenderingRegistry.registerBlockHandler(new RenderBlockMultipass());
RenderingRegistry.registerBlockHandler(new RenderBlockRotated(ModBlocks.charge_dynamite.getRenderType(), ResourceManager.charge_dynamite));

View File

@ -313,6 +313,12 @@ public class CraftingManager {
addRecipeAuto(new ItemStack(ModItems.blades_advanced_alloy, 1), new Object[] { "PIP", 'P', ALLOY.plate(), 'I', new ItemStack(ModItems.blades_advanced_alloy, 1, OreDictionary.WILDCARD_VALUE) });
addRecipeAuto(new ItemStack(ModItems.blades_combine_steel, 1), new Object[] { "PIP", 'P', CMB.plate(), 'I', new ItemStack(ModItems.blades_combine_steel, 1, OreDictionary.WILDCARD_VALUE) });
addRecipeAuto(new ItemStack(ModItems.blades_schrabidium, 1), new Object[] { "PIP", 'P', SA326.plate(), 'I', new ItemStack(ModItems.blades_schrabidium, 1, OreDictionary.WILDCARD_VALUE) });
addRecipeAuto(new ItemStack(ModItems.laser_crystal_co2, 1), new Object[] { "QDQ", "NCN", "QDQ", 'Q', ModBlocks.glass_quartz, 'D', DESH.ingot(), 'N', ND.ingot(), 'C', new ItemStack(ModItems.fluid_tank_full, 1, Fluids.CARBONDIOXIDE.getID()) });
addRecipeAuto(new ItemStack(ModItems.laser_crystal_bismuth, 1), new Object[] {"QUQ", "BCB", "QTQ", 'Q', ModBlocks.glass_quartz, 'U', U.ingot(), 'T', TH232.ingot(), 'B', ModItems.nugget_bismuth, 'C', ModItems.crystal_rare });
addRecipeAuto(new ItemStack(ModItems.laser_crystal_cmb, 1), new Object[] {"QBQ", "CSC", "QBQ", 'Q', ModBlocks.glass_quartz, 'B', CMB.ingot(), 'C', SBD.ingot(), 'S', ModItems.cell_anti_schrabidium });
addRecipeAuto(new ItemStack(ModItems.laser_crystal_dnt, 1), new Object[] {"QDQ", "SBS", "QDQ", 'Q', ModBlocks.glass_quartz, 'D', DNT.ingot(), 'B', ModItems.egg_balefire, 'S', ModItems.powder_spark_mix });
addRecipeAuto(new ItemStack(ModItems.laser_crystal_digamma, 1), new Object[] {"QUQ", "UEU", "QUQ", 'Q', ModBlocks.glass_quartz, 'U', ModItems.undefined, 'E', ModItems.ingot_electronium } );
Item[] bricks = new Item[] {Items.brick, Items.netherbrick};

View File

@ -958,6 +958,9 @@ public class MainRegistry {
TileEntityMachineReactorLarge.registerAll();
proxy.registerMissileItems();
//expand for the largest entity we have (currently Quackos who is 17.5m in diameter, that's one fat duck)
World.MAX_ENTITY_RADIUS = Math.max(World.MAX_ENTITY_RADIUS, 8.75);
}
@EventHandler

View File

@ -41,7 +41,8 @@ import com.hbm.render.util.RenderAccessoryUtility;
import com.hbm.render.util.RenderOverhead;
import com.hbm.render.util.RenderScreenOverlay;
import com.hbm.render.util.SoyuzPronter;
import com.hbm.render.world.RenderNTMSkybox;
import com.hbm.render.world.RenderNTMSkyboxChainloader;
import com.hbm.render.world.RenderNTMSkyboxImpact;
import com.hbm.sound.MovingSoundChopper;
import com.hbm.sound.MovingSoundChopperMine;
import com.hbm.sound.MovingSoundCrashing;
@ -688,8 +689,17 @@ public class ModEventHandlerClient {
if(world != null && world.provider instanceof WorldProviderSurface) {
IRenderHandler sky = world.provider.getSkyRenderer();
if(!(sky instanceof RenderNTMSkybox)) {
world.provider.setSkyRenderer(new RenderNTMSkybox());
if(ModEventHandler.dust > 0 || ModEventHandler.fire > 0) {
if(!(sky instanceof RenderNTMSkyboxImpact)) {
world.provider.setSkyRenderer(new RenderNTMSkyboxImpact());
}
} else {
if(!(sky instanceof RenderNTMSkyboxChainloader)) {
world.provider.setSkyRenderer(new RenderNTMSkyboxChainloader(sky));
}
}
}
}

View File

@ -27,8 +27,6 @@ public class PacketDispatcher {
wrapper.registerMessage(TEDrillSoundPacket.Handler.class, TEDrillSoundPacket.class, i++, Side.CLIENT);
//Assembler cog rotation for rendering
wrapper.registerMessage(TEAssemblerPacket.Handler.class, TEAssemblerPacket.class, i++, Side.CLIENT);
//Fluid type for pipe rendering
wrapper.registerMessage(TEFluidPipePacket.Handler.class, TEFluidPipePacket.class, i++, Side.CLIENT);
//Missile type for rendering
wrapper.registerMessage(TEMissilePacket.Handler.class, TEMissilePacket.class, i++, Side.CLIENT);
//Fluid packet for GUI

View File

@ -1,68 +0,0 @@
package com.hbm.packet;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.tileentity.conductor.TileEntityFluidDuct;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.tileentity.TileEntity;
public class TEFluidPipePacket implements IMessage {
int x;
int y;
int z;
FluidType type;
public TEFluidPipePacket()
{
}
public TEFluidPipePacket(int x, int y, int z, FluidType type)
{
this.x = x;
this.y = y;
this.z = z;
this.type = type;
}
@Override
public void fromBytes(ByteBuf buf) {
x = buf.readInt();
y = buf.readInt();
z = buf.readInt();
type = Fluids.fromID(buf.readInt());
}
@Override
public void toBytes(ByteBuf buf) {
buf.writeInt(x);
buf.writeInt(y);
buf.writeInt(z);
buf.writeInt(type.getID());
}
public static class Handler implements IMessageHandler<TEFluidPipePacket, IMessage> {
@Override
public IMessage onMessage(TEFluidPipePacket m, MessageContext ctx) {
try {
TileEntity te = Minecraft.getMinecraft().theWorld.getTileEntity(m.x, m.y, m.z);
if (te != null && te instanceof TileEntityFluidDuct) {
TileEntityFluidDuct duct = (TileEntityFluidDuct) te;
duct.type = m.type;
}
return null;
} catch(Exception ex) {
return null;
}
}
}
}

View File

@ -0,0 +1,68 @@
package com.hbm.render.block;
import com.hbm.blocks.IBlockMultiPass;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.IBlockAccess;
public class RenderBlockMultipass implements ISimpleBlockRenderingHandler {
/**
* First I wanted to pass the current render pass in the methods for getting color and icon, but the later one would have to work with
* texture overrides which would either break sided textures or force me to implement renderStandardBlock myself, so that's a big nono.
* So I made a static variable for the current render pass so that Block.getIcon could use it while still minding sides. Great, I put it
* into IBlockMultiPass because that's the only logical place I could put it since I intend to use IBlockMultiPass for more rendering
* handlers than just this one and BOOM, primitive fields in interfaces are implicitly final. Why? Because "functionality in interfaces
* bad", or so the HeckOverflow people are trying to tell me. Mh-hm, holding a single static value is "functionality" now, and functionality
* in interfaces is very very bad in a language that allows interfaces to define a default behavior that is LITERALLY FULLY FUNCTIONAL
* METHODS. Statistically speaking I, the individual, should be wrong and many people who - supposedly - know what they're talking about
* should be right, but if you ask me there's something off about this whole ordeal. I don't know.
*/
public static int currentPass = 0;
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { }
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
Tessellator tessellator = Tessellator.instance;
int meta = world.getBlockMetadata(x, y, z);
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
if(!(block instanceof IBlockMultiPass)) {
renderer.renderStandardBlock(block, x, y, z);
return true;
}
IBlockMultiPass multi = (IBlockMultiPass) block;
renderer.setRenderBounds(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
int passes = multi.getPasses();
for(int i = 0; i < passes; i++) {
currentPass = i;
System.out.println(multi.getColorFromPass(world, x, y, z, false));
tessellator.setColorOpaque_I(multi.getColorFromPass(world, x, y, z, false));
renderer.renderStandardBlock(block, x, y, z);
}
currentPass = 0;
return true;
}
@Override
public boolean shouldRender3DInInventory(int modelId) {
return false;
}
@Override
public int getRenderId() {
return IBlockMultiPass.getRenderType();
}
}

View File

@ -12,107 +12,104 @@ import net.minecraft.world.IBlockAccess;
public class RenderChain implements ISimpleBlockRenderingHandler {
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { }
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
Tessellator tessellator = Tessellator.instance;
IIcon iicon = block.getIcon(world, x, y, z, 0);
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
double d0 = (double)iicon.getMinU();
double d1 = (double)iicon.getMinV();
double d2 = (double)iicon.getMaxU();
double d3 = (double)iicon.getMaxV();
int l = world.getBlockMetadata(x, y, z);
double d4 = 0.0D;
double d5 = 0.05D;
if(l == 0) {
Tessellator tessellator = Tessellator.instance;
IIcon iicon = block.getIcon(world, x, y, z, 0);
double minU = (double)iicon.getMinU();
double minV = (double)iicon.getMinV();
double maxU = (double)iicon.getMaxU();
double maxV = (double)iicon.getMaxV();
double d8 = x;
double d9 = x + 1;
double p_147765_4_ = y;
double p_147765_8_ = 1;
double d10 = z + 0;
double d11 = z + 1;
tessellator.addVertexWithUV(d8, p_147765_4_ + (double)p_147765_8_, d10, minU, minV);
tessellator.addVertexWithUV(d8, p_147765_4_ + 0.0D, d10, minU, maxV);
tessellator.addVertexWithUV(d9, p_147765_4_ + 0.0D, d11, maxU, maxV);
tessellator.addVertexWithUV(d9, p_147765_4_ + (double)p_147765_8_, d11, maxU, minV);
tessellator.addVertexWithUV(d9, p_147765_4_ + (double)p_147765_8_, d11, minU, minV);
tessellator.addVertexWithUV(d9, p_147765_4_ + 0.0D, d11, minU, maxV);
tessellator.addVertexWithUV(d8, p_147765_4_ + 0.0D, d10, maxU, maxV);
tessellator.addVertexWithUV(d8, p_147765_4_ + (double)p_147765_8_, d10, maxU, minV);
tessellator.addVertexWithUV(d8, p_147765_4_ + (double)p_147765_8_, d11, minU, minV);
tessellator.addVertexWithUV(d8, p_147765_4_ + 0.0D, d11, minU, maxV);
tessellator.addVertexWithUV(d9, p_147765_4_ + 0.0D, d10, maxU, maxV);
tessellator.addVertexWithUV(d9, p_147765_4_ + (double)p_147765_8_, d10, maxU, minV);
tessellator.addVertexWithUV(d9, p_147765_4_ + (double)p_147765_8_, d10, minU, minV);
tessellator.addVertexWithUV(d9, p_147765_4_ + 0.0D, d10, minU, maxV);
tessellator.addVertexWithUV(d8, p_147765_4_ + 0.0D, d11, maxU, maxV);
tessellator.addVertexWithUV(d8, p_147765_4_ + (double)p_147765_8_, d11, maxU, minV);
}
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
double d0 = (double) iicon.getMinU();
double d1 = (double) iicon.getMinV();
double d2 = (double) iicon.getMaxU();
double d3 = (double) iicon.getMaxV();
int l = world.getBlockMetadata(x, y, z);
double scale = 0.0D;
double wallOffset = 0.05D;
if (l == 5)
{
tessellator.addVertexWithUV((double)x + d5, (double)(y + 1) + d4, (double)(z + 1) + d4, d0, d1);
tessellator.addVertexWithUV((double)x + d5, (double)(y + 0) - d4, (double)(z + 1) + d4, d0, d3);
tessellator.addVertexWithUV((double)x + d5, (double)(y + 0) - d4, (double)(z + 0) - d4, d2, d3);
tessellator.addVertexWithUV((double)x + d5, (double)(y + 1) + d4, (double)(z + 0) - d4, d2, d1);
if(l == 0) {
tessellator.addVertexWithUV((double)x + d5, (double)(y + 0) - d4, (double)(z + 1) + d4, d0, d3);
tessellator.addVertexWithUV((double)x + d5, (double)(y + 1) + d4, (double)(z + 1) + d4, d0, d1);
tessellator.addVertexWithUV((double)x + d5, (double)(y + 1) + d4, (double)(z + 0) - d4, d2, d1);
tessellator.addVertexWithUV((double)x + d5, (double)(y + 0) - d4, (double)(z + 0) - d4, d2, d3);
}
double minU = (double) iicon.getMinU();
double minV = (double) iicon.getMinV();
double maxU = (double) iicon.getMaxU();
double maxV = (double) iicon.getMaxV();
double minX = x;
double maxX = x + 1;
double minY = y;
double ySize = 1;
double minZ = z + 0;
double maxZ = z + 1;
tessellator.addVertexWithUV(minX, minY + (double) ySize, minZ, minU, minV);
tessellator.addVertexWithUV(minX, minY + 0.0D, minZ, minU, maxV);
tessellator.addVertexWithUV(maxX, minY + 0.0D, maxZ, maxU, maxV);
tessellator.addVertexWithUV(maxX, minY + (double) ySize, maxZ, maxU, minV);
tessellator.addVertexWithUV(maxX, minY + (double) ySize, maxZ, minU, minV);
tessellator.addVertexWithUV(maxX, minY + 0.0D, maxZ, minU, maxV);
tessellator.addVertexWithUV(minX, minY + 0.0D, minZ, maxU, maxV);
tessellator.addVertexWithUV(minX, minY + (double) ySize, minZ, maxU, minV);
tessellator.addVertexWithUV(minX, minY + (double) ySize, maxZ, minU, minV);
tessellator.addVertexWithUV(minX, minY + 0.0D, maxZ, minU, maxV);
tessellator.addVertexWithUV(maxX, minY + 0.0D, minZ, maxU, maxV);
tessellator.addVertexWithUV(maxX, minY + (double) ySize, minZ, maxU, minV);
tessellator.addVertexWithUV(maxX, minY + (double) ySize, minZ, minU, minV);
tessellator.addVertexWithUV(maxX, minY + 0.0D, minZ, minU, maxV);
tessellator.addVertexWithUV(minX, minY + 0.0D, maxZ, maxU, maxV);
tessellator.addVertexWithUV(minX, minY + (double) ySize, maxZ, maxU, minV);
}
if (l == 4)
{
tessellator.addVertexWithUV((double)(x + 1) - d5, (double)(y + 0) - d4, (double)(z + 1) + d4, d2, d3);
tessellator.addVertexWithUV((double)(x + 1) - d5, (double)(y + 1) + d4, (double)(z + 1) + d4, d2, d1);
tessellator.addVertexWithUV((double)(x + 1) - d5, (double)(y + 1) + d4, (double)(z + 0) - d4, d0, d1);
tessellator.addVertexWithUV((double)(x + 1) - d5, (double)(y + 0) - d4, (double)(z + 0) - d4, d0, d3);
tessellator.addVertexWithUV((double)(x + 1) - d5, (double)(y + 1) + d4, (double)(z + 1) + d4, d2, d1);
tessellator.addVertexWithUV((double)(x + 1) - d5, (double)(y + 0) - d4, (double)(z + 1) + d4, d2, d3);
tessellator.addVertexWithUV((double)(x + 1) - d5, (double)(y + 0) - d4, (double)(z + 0) - d4, d0, d3);
tessellator.addVertexWithUV((double)(x + 1) - d5, (double)(y + 1) + d4, (double)(z + 0) - d4, d0, d1);
}
if(l == 5) {
tessellator.addVertexWithUV((double) x + wallOffset, (double) (y + 1) + scale, (double) (z + 1) + scale, d0, d1);
tessellator.addVertexWithUV((double) x + wallOffset, (double) (y + 0) - scale, (double) (z + 1) + scale, d0, d3);
tessellator.addVertexWithUV((double) x + wallOffset, (double) (y + 0) - scale, (double) (z + 0) - scale, d2, d3);
tessellator.addVertexWithUV((double) x + wallOffset, (double) (y + 1) + scale, (double) (z + 0) - scale, d2, d1);
if (l == 3)
{
tessellator.addVertexWithUV((double)(x + 1) + d4, (double)(y + 0) - d4, (double)z + d5, d2, d3);
tessellator.addVertexWithUV((double)(x + 1) + d4, (double)(y + 1) + d4, (double)z + d5, d2, d1);
tessellator.addVertexWithUV((double)(x + 0) - d4, (double)(y + 1) + d4, (double)z + d5, d0, d1);
tessellator.addVertexWithUV((double)(x + 0) - d4, (double)(y + 0) - d4, (double)z + d5, d0, d3);
tessellator.addVertexWithUV((double)(x + 1) + d4, (double)(y + 1) + d4, (double)z + d5, d2, d1);
tessellator.addVertexWithUV((double)(x + 1) + d4, (double)(y + 0) - d4, (double)z + d5, d2, d3);
tessellator.addVertexWithUV((double)(x + 0) - d4, (double)(y + 0) - d4, (double)z + d5, d0, d3);
tessellator.addVertexWithUV((double)(x + 0) - d4, (double)(y + 1) + d4, (double)z + d5, d0, d1);
}
tessellator.addVertexWithUV((double) x + wallOffset, (double) (y + 0) - scale, (double) (z + 1) + scale, d0, d3);
tessellator.addVertexWithUV((double) x + wallOffset, (double) (y + 1) + scale, (double) (z + 1) + scale, d0, d1);
tessellator.addVertexWithUV((double) x + wallOffset, (double) (y + 1) + scale, (double) (z + 0) - scale, d2, d1);
tessellator.addVertexWithUV((double) x + wallOffset, (double) (y + 0) - scale, (double) (z + 0) - scale, d2, d3);
}
if (l == 2)
{
tessellator.addVertexWithUV((double)(x + 1) + d4, (double)(y + 1) + d4, (double)(z + 1) - d5, d0, d1);
tessellator.addVertexWithUV((double)(x + 1) + d4, (double)(y + 0) - d4, (double)(z + 1) - d5, d0, d3);
tessellator.addVertexWithUV((double)(x + 0) - d4, (double)(y + 0) - d4, (double)(z + 1) - d5, d2, d3);
tessellator.addVertexWithUV((double)(x + 0) - d4, (double)(y + 1) + d4, (double)(z + 1) - d5, d2, d1);
if(l == 4) {
tessellator.addVertexWithUV((double) (x + 1) - wallOffset, (double) (y + 0) - scale, (double) (z + 1) + scale, d2, d3);
tessellator.addVertexWithUV((double) (x + 1) - wallOffset, (double) (y + 1) + scale, (double) (z + 1) + scale, d2, d1);
tessellator.addVertexWithUV((double) (x + 1) - wallOffset, (double) (y + 1) + scale, (double) (z + 0) - scale, d0, d1);
tessellator.addVertexWithUV((double) (x + 1) - wallOffset, (double) (y + 0) - scale, (double) (z + 0) - scale, d0, d3);
tessellator.addVertexWithUV((double)(x + 1) + d4, (double)(y + 0) - d4, (double)(z + 1) - d5, d0, d3);
tessellator.addVertexWithUV((double)(x + 1) + d4, (double)(y + 1) + d4, (double)(z + 1) - d5, d0, d1);
tessellator.addVertexWithUV((double)(x + 0) - d4, (double)(y + 1) + d4, (double)(z + 1) - d5, d2, d1);
tessellator.addVertexWithUV((double)(x + 0) - d4, (double)(y + 0) - d4, (double)(z + 1) - d5, d2, d3);
}
tessellator.addVertexWithUV((double) (x + 1) - wallOffset, (double) (y + 1) + scale, (double) (z + 1) + scale, d2, d1);
tessellator.addVertexWithUV((double) (x + 1) - wallOffset, (double) (y + 0) - scale, (double) (z + 1) + scale, d2, d3);
tessellator.addVertexWithUV((double) (x + 1) - wallOffset, (double) (y + 0) - scale, (double) (z + 0) - scale, d0, d3);
tessellator.addVertexWithUV((double) (x + 1) - wallOffset, (double) (y + 1) + scale, (double) (z + 0) - scale, d0, d1);
}
return true;
if(l == 3) {
tessellator.addVertexWithUV((double) (x + 1) + scale, (double) (y + 0) - scale, (double) z + wallOffset, d2, d3);
tessellator.addVertexWithUV((double) (x + 1) + scale, (double) (y + 1) + scale, (double) z + wallOffset, d2, d1);
tessellator.addVertexWithUV((double) (x + 0) - scale, (double) (y + 1) + scale, (double) z + wallOffset, d0, d1);
tessellator.addVertexWithUV((double) (x + 0) - scale, (double) (y + 0) - scale, (double) z + wallOffset, d0, d3);
tessellator.addVertexWithUV((double) (x + 1) + scale, (double) (y + 1) + scale, (double) z + wallOffset, d2, d1);
tessellator.addVertexWithUV((double) (x + 1) + scale, (double) (y + 0) - scale, (double) z + wallOffset, d2, d3);
tessellator.addVertexWithUV((double) (x + 0) - scale, (double) (y + 0) - scale, (double) z + wallOffset, d0, d3);
tessellator.addVertexWithUV((double) (x + 0) - scale, (double) (y + 1) + scale, (double) z + wallOffset, d0, d1);
}
if(l == 2) {
tessellator.addVertexWithUV((double) (x + 1) + scale, (double) (y + 1) + scale, (double) (z + 1) - wallOffset, d0, d1);
tessellator.addVertexWithUV((double) (x + 1) + scale, (double) (y + 0) - scale, (double) (z + 1) - wallOffset, d0, d3);
tessellator.addVertexWithUV((double) (x + 0) - scale, (double) (y + 0) - scale, (double) (z + 1) - wallOffset, d2, d3);
tessellator.addVertexWithUV((double) (x + 0) - scale, (double) (y + 1) + scale, (double) (z + 1) - wallOffset, d2, d1);
tessellator.addVertexWithUV((double) (x + 1) + scale, (double) (y + 0) - scale, (double) (z + 1) - wallOffset, d0, d3);
tessellator.addVertexWithUV((double) (x + 1) + scale, (double) (y + 1) + scale, (double) (z + 1) - wallOffset, d0, d1);
tessellator.addVertexWithUV((double) (x + 0) - scale, (double) (y + 1) + scale, (double) (z + 1) - wallOffset, d2, d1);
tessellator.addVertexWithUV((double) (x + 0) - scale, (double) (y + 0) - scale, (double) (z + 1) - wallOffset, d2, d3);
}
return true;
}
@Override

View File

@ -0,0 +1,96 @@
package com.hbm.render.block;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.bomb.IDetConnectible;
import com.hbm.blocks.test.TestConductor;
import com.hbm.lib.Library;
import com.hbm.main.ResourceManager;
import com.hbm.render.util.ObjUtil;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.client.model.obj.WavefrontObject;
public class RenderDetCord implements ISimpleBlockRenderingHandler {
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
GL11.glPushMatrix();
Tessellator tessellator = Tessellator.instance;
IIcon iicon = block.getIcon(0, 0);
tessellator.setColorOpaque_F(1, 1, 1);
if(renderer.hasOverrideBlockTexture()) {
iicon = renderer.overrideBlockTexture;
}
GL11.glRotated(180, 0, 1, 0);
GL11.glScaled(1.25D, 1.25D, 1.25D);
tessellator.startDrawingQuads();
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "CX", iicon, tessellator, 0, false);
tessellator.draw();
GL11.glPopMatrix();
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
Tessellator tessellator = Tessellator.instance;
IIcon iicon = block.getIcon(0, 0);
tessellator.setColorOpaque_F(1, 1, 1);
if(renderer.hasOverrideBlockTexture()) {
iicon = renderer.overrideBlockTexture;
}
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
tessellator.setColorOpaque_F(1, 1, 1);
boolean pX = IDetConnectible.isConnectible(world, x + 1, y, z, Library.NEG_X);
boolean nX = IDetConnectible.isConnectible(world, x - 1, y, z, Library.POS_X);
boolean pY = IDetConnectible.isConnectible(world, x, y + 1, z, Library.NEG_Y);
boolean nY = IDetConnectible.isConnectible(world, x, y - 1, z, Library.POS_Y);
boolean pZ = IDetConnectible.isConnectible(world, x, y, z + 1, Library.NEG_Z);
boolean nZ = IDetConnectible.isConnectible(world, x, y, z - 1, Library.POS_Z);
tessellator.addTranslation(x + 0.5F, y + 0.5F, z + 0.5F);
if(pX && nX && !pY && !nY && !pZ && !nZ)
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "CX", iicon, tessellator, 0, true);
else if(!pX && !nX && pY && nY && !pZ && !nZ)
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "CY", iicon, tessellator, 0, true);
else if(!pX && !nX && !pY && !nY && pZ && nZ)
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "CZ", iicon, tessellator, 0, true);
else {
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "Core", iicon, tessellator, 0, true);
if(pX) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "posX", iicon, tessellator, 0, true);
if(nX) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "negX", iicon, tessellator, 0, true);
if(pY) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "posY", iicon, tessellator, 0, true);
if(nY) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "negY", iicon, tessellator, 0, true);
if(nZ) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "posZ", iicon, tessellator, 0, true);
if(pZ) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.cable_neo, "negZ", iicon, tessellator, 0, true);
}
tessellator.addTranslation(-x - 0.5F, -y - 0.5F, -z - 0.5F);
return true;
}
@Override
public boolean shouldRender3DInInventory(int modelId) {
return true;
}
@Override
public int getRenderId() {
return TestConductor.renderID;
}
}

View File

@ -5,6 +5,7 @@ import java.awt.Color;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.BlockDummyable;
import com.hbm.items.machine.ItemFELCrystal.EnumWavelengths;
import com.hbm.main.ResourceManager;
import com.hbm.render.util.BeamPronter;
import com.hbm.render.util.BeamPronter.EnumBeamType;
@ -38,23 +39,20 @@ public class RenderFEL extends TileEntitySpecialRenderer {
GL11.glShadeModel(GL11.GL_FLAT);
TileEntityFEL fel = (TileEntityFEL) tileEntity;
int color = 0xff0000;
int color = 0xffffff;
switch(fel.mode) {
case 0: color = 0x303000; break;
case 1: color = 0xFF1010; break;
case 2: color = Color.HSBtoRGB(fel.getWorldObj().getTotalWorldTime() / 50.0F, 1F, 0.3F) & 16777215; break;
case 3: color = 0x150560; break;
case 4: color = 0x054005; break;
case 5: color = 0x156015; break;
if(fel.mode.renderedBeamColor == 0) {
color = Color.HSBtoRGB(fel.getWorldObj().getTotalWorldTime() / 50.0F, 0.5F, 0.1F) & 16777215;
} else {
color = fel.mode.renderedBeamColor;
}
int length = fel.distance - 3;
GL11.glTranslated(0, 1.5, -1.5);
if(fel.power > fel.powerReq * Math.pow(2, fel.mode.ordinal()) && fel.isOn && !(fel.mode == EnumWavelengths.NULL) && length > 0) {
BeamPronter.prontBeam(Vec3.createVectorHelper(0, 0, -length - 1), EnumWaveType.SPIRAL, EnumBeamType.SOLID, color, color, 0, 1, 0F, 2, 0.0625F);
BeamPronter.prontBeam(Vec3.createVectorHelper(0, 0, -length - 1), EnumWaveType.RANDOM, EnumBeamType.SOLID, color, color, (int)(tileEntity.getWorldObj().getTotalWorldTime() % 1000 / 2), (length / 2) + 1, 0.0625F, 2, 0.0625F);
}
int length = 25;
GL11.glTranslated(0, 1.5, -1.5);
BeamPronter.prontBeam(Vec3.createVectorHelper(0, 0, -length - 1), EnumWaveType.SPIRAL, EnumBeamType.SOLID, color, color, 0, 1, 0F, 2, 0.0625F);
BeamPronter.prontBeam(Vec3.createVectorHelper(0, 0, -length - 1), EnumWaveType.RANDOM, EnumBeamType.SOLID, color, color, (int)(tileEntity.getWorldObj().getTotalWorldTime() % 1000 / 2), (length / 2) + 1, 0.0625F, 2, 0.0625F);
GL11.glPopMatrix();
}
}
}

View File

@ -28,7 +28,7 @@ public class RenderFluidDuct extends TileEntitySpecialRenderer {
{
if(cable.connections[i] != null)
{
drawConnection(cable.connections[i], cable.type.getColor());
drawConnection(cable.connections[i], cable.getType().getColor());
}
}
GL11.glTranslated(-offsetX, -offsetY, -offsetZ);

View File

@ -0,0 +1,121 @@
package com.hbm.render.world;
import org.lwjgl.opengl.GL11;
import com.hbm.extprop.HbmLivingProps;
import cpw.mods.fml.client.FMLClientHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderGlobal;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraftforge.client.IRenderHandler;
public class RenderNTMSkyboxChainloader extends IRenderHandler { //why an abstract class uses the I-prefix is beyond me but ok, alright, whatever
/*
* To get the terrain render order right, making a sky rendering handler is absolutely necessary. Turns out MC can only handle one of these, so what do we do?
* We make out own renderer, grab any existing renderers that are already occupying the slot, doing what is effectively chainloading while adding our own garbage.
* If somebody does the exact same thing as we do we might be screwed due to increasingly long recursive loops but we can fix that too, no worries.
*/
private IRenderHandler parent;
private static final ResourceLocation digammaStar = new ResourceLocation("hbm:textures/misc/star_digamma.png");
private static final ResourceLocation bobmazonSat = new ResourceLocation("hbm:textures/misc/sat_bobmazon.png");
/*
* If the skybox was rendered successfully in the last tick (even from other mods' skyboxes chainloading this one) then we don't need to add it again
*/
public static boolean didLastRender = false;
public RenderNTMSkyboxChainloader(IRenderHandler parent) {
this.parent = parent;
}
@Override
public void render(float partialTicks, WorldClient world, Minecraft mc) {
if(parent != null) {
//basically a recursion-brake to prevent endless rendering loops from other mods' chainloaders.
//do other mods' skyboxes even employ chainloading?
if(!didLastRender) {
didLastRender = true;
parent.render(partialTicks, world, mc);
didLastRender = false;
}
} else{
RenderGlobal rg = Minecraft.getMinecraft().renderGlobal;
world.provider.setSkyRenderer(null);
rg.renderSky(partialTicks);
world.provider.setSkyRenderer(this);
}
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glDisable(GL11.GL_FOG);
OpenGlHelper.glBlendFunc(770, 1, 1, 0);
float brightness = (float) Math.sin(world.getCelestialAngle(partialTicks) * Math.PI);
brightness *= brightness;
GL11.glColor4f(brightness, brightness, brightness, 1.0F);
GL11.glPushMatrix();
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(140.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(-40.0F, 0.0F, 0.0F, 1.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(digammaStar);
float digamma = HbmLivingProps.getDigamma(Minecraft.getMinecraft().thePlayer);
float var12 = 1F * (1 + digamma * 0.25F);
double dist = 100D - digamma * 2.5;
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(-var12, dist, -var12, 0.0D, 0.0D);
tessellator.addVertexWithUV(var12, dist, -var12, 0.0D, 1.0D);
tessellator.addVertexWithUV(var12, dist, var12, 1.0D, 1.0D);
tessellator.addVertexWithUV(-var12, dist, var12, 1.0D, 0.0D);
tessellator.draw();
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glRotatef(-40.0F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef((System.currentTimeMillis() % (360 * 1000) / 1000F), 0.0F, 1.0F, 0.0F);
GL11.glRotatef((System.currentTimeMillis() % (360 * 100) / 100F), 1.0F, 0.0F, 0.0F);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(bobmazonSat);
var12 = 0.5F;
dist = 100D;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(-var12, dist, -var12, 0.0D, 0.0D);
tessellator.addVertexWithUV(var12, dist, -var12, 0.0D, 1.0D);
tessellator.addVertexWithUV(var12, dist, var12, 1.0D, 1.0D);
tessellator.addVertexWithUV(-var12, dist, var12, 1.0D, 0.0D);
tessellator.draw();
GL11.glPopMatrix();
GL11.glDepthMask(true);
GL11.glEnable(GL11.GL_FOG);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPopMatrix();
}
}

View File

@ -24,7 +24,7 @@ import com.hbm.main.ModEventHandler;
import java.util.Random;
public class RenderNTMSkybox extends IRenderHandler {
public class RenderNTMSkyboxImpact extends IRenderHandler {
private static final ResourceLocation sunTexture = new ResourceLocation("textures/environment/sun.png");
private static final ResourceLocation moonTexture = new ResourceLocation("textures/environment/moon_phases.png");
@ -42,7 +42,7 @@ public class RenderNTMSkybox extends IRenderHandler {
/// I had to break your compat feature for other mods' skyboxes in order to
/// make the skybox render correctly after Tom. Sorry about that. -Pu
public RenderNTMSkybox() {
public RenderNTMSkyboxImpact() {
GL11.glPushMatrix();
GL11.glNewList(this.starGLCallList, GL11.GL_COMPILE);
this.renderStars();
@ -171,7 +171,7 @@ public class RenderNTMSkybox extends IRenderHandler {
{
GL11.glColor4d(1, 1, 1, rain);
f10 = 20.0F;
FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderNTMSkybox.moonTexture);
FMLClientHandler.instance().getClient().renderEngine.bindTexture(RenderNTMSkyboxImpact.moonTexture);
float sinphi = FMLClientHandler.instance().getClient().theWorld.getMoonPhase();
final int cosphi = (int) (sinphi % 4);
final int var29 = (int) (sinphi / 4 % 2);

View File

@ -76,6 +76,7 @@ public class TileMappings {
put(TileEntityStructureMarker.class, "tileentity_structure_marker");
put(TileEntityMachineMiningDrill.class, "tileentity_mining_drill");
put(TileEntityMachineAssembler.class, "tileentity_assembly_machine");
put(TileEntityFluidDuctSimple.class, "tileentity_universal_duct_simple");
put(TileEntityFluidDuct.class, "tileentity_universal_duct");
put(TileEntityMachineChemplant.class, "tileentity_chemical_plant");
put(TileEntityMachineFluidTank.class, "tileentity_fluid_tank");

View File

@ -10,31 +10,25 @@ import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.lib.Library;
import com.hbm.packet.PacketDispatcher;
import com.hbm.packet.TEFluidPipePacket;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityFluidDuct extends TileEntity implements IFluidDuct {
public class TileEntityFluidDuct extends TileEntityFluidDuctSimple {
public ForgeDirection[] connections = new ForgeDirection[6];
public FluidType type = Fluids.NONE;
public List<UnionOfTileEntitiesAndBooleansForFluids> uoteab = new ArrayList<UnionOfTileEntitiesAndBooleansForFluids>();
public TileEntityFluidDuct() {
}
public TileEntityFluidDuct() { }
@Override
public void updateEntity() {
if(!worldObj.isRemote)
PacketDispatcher.wrapper.sendToAllAround(new TEFluidPipePacket(xCoord, yCoord, zCoord, type), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 25));
this.updateConnections();
}
@ -57,28 +51,10 @@ public class TileEntityFluidDuct extends TileEntity implements IFluidDuct {
if(Library.checkFluidConnectables(this.worldObj, xCoord - 1, yCoord, zCoord, type)) connections[5] = ForgeDirection.WEST;
else connections[5] = null;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
type = Fluids.fromID(nbt.getInteger("fluid"));
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setInteger("fluid", type.getID());
}
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared()
{
public double getMaxRenderDistanceSquared() {
return 65536.0D;
}
@Override
public FluidType getType() {
return type;
}
}

View File

@ -0,0 +1,67 @@
package com.hbm.tileentity.conductor;
import java.util.ArrayList;
import java.util.List;
import com.hbm.calc.UnionOfTileEntitiesAndBooleansForFluids;
import com.hbm.interfaces.IFluidDuct;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.WorldServer;
public class TileEntityFluidDuctSimple extends TileEntity implements IFluidDuct {
protected FluidType type = Fluids.NONE;
public List<UnionOfTileEntitiesAndBooleansForFluids> uoteab = new ArrayList<UnionOfTileEntitiesAndBooleansForFluids>();
@Override
public Packet getDescriptionPacket() {
NBTTagCompound nbt = new NBTTagCompound();
this.writeToNBT(nbt);
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbt);
}
@Override
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
this.readFromNBT(pkt.func_148857_g());
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
type = Fluids.fromID(nbt.getInteger("fluid"));
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setInteger("fluid", type.getID());
}
public boolean setType(FluidType type) {
if(this.type == type)
return true;
this.type = type;
this.markDirty();
if(worldObj instanceof WorldServer) {
WorldServer world = (WorldServer) worldObj;
world.getPlayerManager().markBlockForUpdate(xCoord, yCoord, zCoord);
}
return true;
}
@Override
public FluidType getType() {
return type;
}
}

View File

@ -79,4 +79,9 @@ public class TileEntityGasDuct extends TileEntity implements IFluidDuct {
public FluidType getType() {
return type;
}
@Override
public boolean setType(FluidType type) {
return false;
}
}

View File

@ -20,4 +20,8 @@ public class TileEntityGasDuctSolid extends TileEntity implements IFluidDuct {
return type;
}
@Override
public boolean setType(FluidType type) {
return false;
}
}

View File

@ -78,4 +78,9 @@ public class TileEntityOilDuct extends TileEntity implements IFluidDuct {
public FluidType getType() {
return type;
}
@Override
public boolean setType(FluidType type) {
return false;
}
}

View File

@ -20,4 +20,8 @@ public class TileEntityOilDuctSolid extends TileEntity implements IFluidDuct {
return type;
}
@Override
public boolean setType(FluidType type) {
return false;
}
}

View File

@ -1,29 +1,59 @@
package com.hbm.tileentity.machine;
import java.util.ArrayList;
import java.util.List;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.generic.BlockHazard;
import com.hbm.blocks.generic.BlockHazardFalling;
import com.hbm.blocks.machine.MachineSILEX;
import com.hbm.extprop.HbmLivingProps;
import com.hbm.handler.radiation.ChunkRadiationManager;
import com.hbm.interfaces.Spaghetti;
import com.hbm.items.machine.ItemFELCrystal;
import com.hbm.items.machine.ItemFELCrystal.EnumWavelengths;
import com.hbm.lib.Library;
import com.hbm.main.MainRegistry;
import com.hbm.packet.AuxElectricityPacket;
import com.hbm.packet.PacketDispatcher;
import com.hbm.tileentity.TileEntityMachineBase;
import api.hbm.energy.IEnergyUser;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockTNT;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityFEL extends TileEntityMachineBase {
public class TileEntityFEL extends TileEntityMachineBase implements IEnergyUser {
public long power;
public static final long maxPower = 1000000;
public int watts;
public int mode = 0;
public static final long maxPower = 20000000;
public static final int powerReq = 1250;
public EnumWavelengths mode = EnumWavelengths.NULL;
public boolean isOn;
public boolean missingValidSilex = true ;
public int distance;
public List<EntityLivingBase> entities = new ArrayList();
public TileEntityFEL() {
super(1);
super(2);
}
@Override
@ -32,70 +62,146 @@ public class TileEntityFEL extends TileEntityMachineBase {
}
@Override
@Spaghetti ("What the fuck were you thinking")
public void updateEntity() {
if(!worldObj.isRemote) {
//this.trySubscribe(world, x, y, z, dir); TODO
this.power = Library.chargeTEFromItems(slots, 0, power, maxPower);
int range = 50;
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
int length = 5;
if(this.isOn && !(this.slots[1] == null)) {
if(this.slots[1].getItem() instanceof ItemFELCrystal) {
ItemFELCrystal crystal = (ItemFELCrystal) this.slots[1].getItem();
this.mode = crystal.wavelength;
} else { this.mode = EnumWavelengths.NULL; }
} else { this.mode = EnumWavelengths.NULL; }
for(int i = 5; i < range; i++) {
int range = 24;
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
int length = 3;
boolean silexSpacing = false;
if(this.isOn && power >= powerReq * Math.pow(3, mode.ordinal()) && this.mode != EnumWavelengths.NULL) {
length = i;
int x = xCoord + dir.offsetX * i;
int y = yCoord + 1;
int z = zCoord + dir.offsetZ * i;
int distance = this.distance-1;
double blx = Math.min(xCoord, xCoord + dir.offsetX * distance) + 0.2;
double bux = Math.max(xCoord, xCoord + dir.offsetX * distance) + 0.8;
double bly = Math.min(yCoord, 1 + yCoord + dir.offsetY * distance) + 0.2;
double buy = Math.max(yCoord, 1 + yCoord + dir.offsetY * distance) + 0.8;
double blz = Math.min(zCoord, zCoord + dir.offsetZ * distance) + 0.2;
double buz = Math.max(zCoord, zCoord + dir.offsetZ * distance) + 0.8;
Block b = worldObj.getBlock(x, y, z);
List<EntityLivingBase> list = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(blx, bly, blz, bux, buy, buz));
if(b.getMaterial().isOpaque())
continue;
if(b == ModBlocks.machine_silex) {
TileEntity te = worldObj.getTileEntity(x + dir.offsetX, yCoord, z + dir.offsetZ);
if(te instanceof TileEntitySILEX) {
TileEntitySILEX silex = (TileEntitySILEX) te;
silex.laser += this.watts;
for(EntityLivingBase entity : list) {
switch(this.mode) {
case VISIBLE: entity.addPotionEffect(new PotionEffect(Potion.blindness.id, 60 * 60 * 65536, 0));
case IR:
case UV: entity.setFire(65535); break;
case GAMMA: HbmLivingProps.incrementRadiation(entity, 25); break;
case DRX: HbmLivingProps.incrementDigamma(entity, 0.1F); break;
}
}
break;
power -= powerReq * ((mode.ordinal() == 0) ? 0 : Math.pow(3, mode.ordinal()));
for(int i = 3; i < range; i++) {
length = i;
int x = xCoord + dir.offsetX * i;
int y = yCoord + 1;
int z = zCoord + dir.offsetZ * i;
Block b = worldObj.getBlock(x, y, z);
if(!(b.getMaterial().isOpaque()) && b != Blocks.tnt) {
this.distance = range;
silexSpacing = false;
continue;
}
if(b == ModBlocks.machine_silex) {
TileEntity te = worldObj.getTileEntity(x + dir.offsetX, yCoord, z + dir.offsetZ);
if(te instanceof TileEntitySILEX) {
TileEntitySILEX silex = (TileEntitySILEX) te;
int meta = silex.getBlockMetadata() - BlockDummyable.offset;
if(rotationIsValid(meta, this.getBlockMetadata() - BlockDummyable.offset) && i >= 5 && silexSpacing == false ) {
if(silex.mode != this.mode) {
silex.mode = this.mode;
this.missingValidSilex = false;
silexSpacing = true;
continue;
}
} else {
MachineSILEX silexBlock = (MachineSILEX)silex.getBlockType();
silexBlock.breakBlock(worldObj, silex.xCoord, silex.yCoord, silex.zCoord, silexBlock, 0);
worldObj.spawnEntityInWorld(new EntityItem(worldObj, x + 0.5, y + 0.5, z + 0.5, new ItemStack(Item.getItemFromBlock(ModBlocks.machine_silex))));
}
}
} else if(b.getMaterial().isOpaque() || b == Blocks.tnt) {
this.distance = i;
if(b.getMaterial().isLiquid()) {
worldObj.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "random.fizz", 1.0F, 1.0F);
worldObj.setBlockToAir(x, y, z);
break;
}
float hardness = b.getExplosionResistance(null);
if(hardness < 2400 && worldObj.rand.nextInt(5) == 0) {
worldObj.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "random.fizz", 1.0F, 1.0F);
Block block = (this.mode != EnumWavelengths.DRX) ? Blocks.fire : (MainRegistry.polaroidID == 11) ? ModBlocks.digamma_matter : ModBlocks.fire_digamma;
worldObj.setBlock(x, y, z, block);
if(this.mode == EnumWavelengths.DRX)
worldObj.setBlock(x, y-1, z, ModBlocks.ash_digamma);
}
break;
}
}
}
NBTTagCompound data = new NBTTagCompound();
data.setLong("power", power);
data.setByte("mode", (byte)mode);
data.setByte("watts", (byte)watts);
data.setString("mode", mode.toString());
data.setBoolean("isOn", isOn);
data.setBoolean("valid", missingValidSilex);
data.setInteger("distance", distance);
this.networkPack(data, 250);
PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
}
}
public boolean rotationIsValid(int silexMeta, int felMeta) {
ForgeDirection silexDir = ForgeDirection.getOrientation(silexMeta);
ForgeDirection felDir = ForgeDirection.getOrientation(felMeta);
if(silexDir == felDir || silexDir == felDir.getOpposite()) {
return true;
}
return false;
}
@Override
public void networkUnpack(NBTTagCompound nbt) {
this.power = nbt.getLong("power");
this.mode = nbt.getByte("mode");
this.watts = nbt.getByte("watts");
this.mode = EnumWavelengths.valueOf(nbt.getString("mode"));
this.isOn = nbt.getBoolean("isOn");
this.distance = nbt.getInteger("distance");
this.missingValidSilex = nbt.getBoolean("valid");
}
@Override
public void handleButtonPacket(int value, int meta) {
if(meta == 0) {
this.mode = Math.abs(value) % 6;
}
if(meta == 1){
this.watts = MathHelper.clamp_int(value, 1, 100);
}
if(meta == 2){
this.isOn = !this.isOn;
}
@ -105,18 +211,15 @@ public class TileEntityFEL extends TileEntityMachineBase {
return (power * i) / maxPower;
}
public int getWattsScaled(int i) {
return (watts * i) / 100;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
power = nbt.getLong("power");
watts = nbt.getInteger("watts");
mode = nbt.getInteger("mode");
mode = EnumWavelengths.valueOf(nbt.getString("mode"));
isOn = nbt.getBoolean("isOn");
missingValidSilex = nbt.getBoolean("valid");
distance = nbt.getInteger("distance");
}
@Override
@ -124,21 +227,15 @@ public class TileEntityFEL extends TileEntityMachineBase {
super.writeToNBT(nbt);
nbt.setLong("power", power);
nbt.setInteger("watts", watts);
nbt.setInteger("mode", mode);
nbt.setString("mode", mode.toString());
nbt.setBoolean("isOn", isOn);
nbt.setBoolean("valid", missingValidSilex);
nbt.setInteger("distance", distance);
}
@Override
public AxisAlignedBB getRenderBoundingBox() {
return AxisAlignedBB.getBoundingBox(
xCoord - 4,
yCoord,
zCoord - 4,
xCoord + 5,
yCoord + 3,
zCoord + 5
);
return INFINITE_EXTENT_AABB;
}
@Override
@ -146,4 +243,19 @@ public class TileEntityFEL extends TileEntityMachineBase {
public double getMaxRenderDistanceSquared() {
return 65536.0D;
}
}
@Override
public void setPower(long i) {
power = i;
}
@Override
public long getPower() {
return power;
}
@Override
public long getMaxPower() {
return maxPower;
}
}

View File

@ -12,6 +12,7 @@ import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.recipes.SILEXRecipes;
import com.hbm.inventory.recipes.SILEXRecipes.SILEXRecipe;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemFELCrystal.EnumWavelengths;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.util.InventoryUtil;
import com.hbm.util.WeightedRandomObject;
@ -25,20 +26,21 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.WeightedRandom;
public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcceptor {
public int laser = 0;
public EnumWavelengths mode = EnumWavelengths.NULL;
public boolean hasLaser;
public FluidTank tank;
public ComparableStack current;
public int currentFill;
public static final int maxFill = 16000;
public int progress;
public final int processTime = 100;
//0: Input
//1: Fluid ID
//2-3: Fluid Containers
//4: Output
//5-10: Queue
// 0: Input
// 1: Fluid ID
// 2-3: Fluid Containers
// 4: Output
// 5-10: Queue
public TileEntitySILEX() {
super(11);
@ -52,28 +54,29 @@ public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcce
@Override
public void updateEntity() {
if(!worldObj.isRemote) {
tank.setType(1, 1, slots);
tank.loadTank(2, 3, slots);
loadFluid();
if(!process()) {
this.progress = 0;
}
dequeue();
if(currentFill <= 0) {
current = null;
}
NBTTagCompound data = new NBTTagCompound();
data.setInteger("fill", currentFill);
data.setInteger("progress", progress);
data.setString("mode", mode.toString());
if(this.current != null) {
data.setInteger("item", Item.getIdFromItem(this.current.item));
data.setInteger("meta", this.current.meta);
@ -81,85 +84,88 @@ public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcce
tank.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
this.networkPack(data, 50);
this.mode = EnumWavelengths.NULL;
}
}
public void networkUnpack(NBTTagCompound nbt) {
this.currentFill = nbt.getInteger("fill");
this.progress = nbt.getInteger("progress");
this.mode = EnumWavelengths.valueOf(nbt.getString("mode"));
if(this.currentFill > 0) {
this.current = new ComparableStack(Item.getItemById(nbt.getInteger("item")), 1, nbt.getInteger("meta"));
} else {
this.current = null;
}
}
public void handleButtonPacket(int value, int meta) {
this.currentFill = 0;
this.current = null;
}
public int getProgressScaled(int i) {
return (progress * i) / processTime;
}
public int getFluidScaled(int i) {
return (tank.getFill() * i) / tank.getMaxFill();
}
public int getFillScaled(int i) {
return (currentFill * i) / maxFill;
}
public static final HashMap<FluidType, ComparableStack> fluidConversion = new HashMap();
static {
putFluid(Fluids.UF6);
putFluid(Fluids.PUF6);
putFluid(Fluids.DEATH);
}
private static void putFluid(FluidType fluid) {
fluidConversion.put(fluid, new ComparableStack(ModItems.fluid_icon, 1, fluid.getID()));
}
int loadDelay;
public void loadFluid() {
ComparableStack conv = fluidConversion.get(tank.getTankType());
if(conv != null) {
if(currentFill == 0) {
current = (ComparableStack) conv.copy();
}
if(current != null && current.equals(conv)) {
int toFill = Math.min(10, Math.min(maxFill - currentFill, tank.getFill()));
currentFill += toFill;
tank.setFill(tank.getFill() - toFill);
}
}
loadDelay++;
if(loadDelay > 20)
loadDelay = 0;
if(loadDelay == 0 && slots[0] != null && tank.getTankType() == Fluids.ACID && (this.current == null || this.current.equals(new ComparableStack(slots[0]).makeSingular()))) {
SILEXRecipe recipe = SILEXRecipes.getOutput(slots[0]);
if(recipe == null)
return;
int load = recipe.fluidProduced;
if(load <= this.maxFill - this.currentFill && load <= tank.getFill()) {
this.currentFill += load;
this.current = new ComparableStack(slots[0]).makeSingular();
@ -168,53 +174,58 @@ public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcce
}
}
}
private boolean process() {
if(current == null || currentFill <= 0)
return false;
SILEXRecipe recipe = SILEXRecipes.getOutput(current.toStack());
if(recipe == null)
return false;
if(recipe.laserStrength > this.mode.ordinal())
return false;
if(currentFill < recipe.fluidConsumed)
return false;
if(slots[4] != null)
return false;
progress++;
int progressSpeed = (int) Math.pow(2, this.mode.ordinal() - recipe.laserStrength + 1) / 2;
progress += progressSpeed;
if(progress >= processTime) {
currentFill -= recipe.fluidConsumed;
ItemStack out = ((WeightedRandomObject)WeightedRandom.getRandomItem(worldObj.rand, recipe.outputs)).asStack();
ItemStack out = ((WeightedRandomObject) WeightedRandom.getRandomItem(worldObj.rand, recipe.outputs)).asStack();
slots[4] = out.copy();
progress = 0;
this.markDirty();
}
return true;
}
private void dequeue() {
if(slots[4] != null) {
for(int i = 5; i < 11; i++) {
if(slots[i] != null && slots[i].stackSize < slots[i].getMaxStackSize() && InventoryUtil.doesStackDataMatch(slots[4], slots[i])) {
slots[i].stackSize++;
this.decrStackSize(4, 1);
return;
}
}
for(int i = 5; i < 11; i++) {
if(slots[i] == null) {
slots[i] = slots[4].copy();
slots[4] = null;
@ -231,9 +242,10 @@ public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcce
@Override
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
if(i == 0) return SILEXRecipes.getOutput(itemStack) != null;
if(i == 0)
return SILEXRecipes.getOutput(itemStack) != null;
return false;
}
@ -241,46 +253,40 @@ public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcce
public boolean canExtractItem(int slot, ItemStack itemStack, int side) {
return slot >= 5;
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
this.tank.readFromNBT(nbt, "tank");
this.currentFill = nbt.getInteger("fill");
this.mode = EnumWavelengths.valueOf(nbt.getString("mode"));
if(this.currentFill > 0) {
this.current = new ComparableStack(Item.getItemById(nbt.getInteger("item")), 1, nbt.getInteger("meta"));
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
this.tank.writeToNBT(nbt, "tank");
nbt.setInteger("fill", this.currentFill);
nbt.setString("mode", mode.toString());
if(this.current != null) {
nbt.setInteger("item", Item.getIdFromItem(this.current.item));
nbt.setInteger("meta", this.current.meta);
}
}
@Override
public AxisAlignedBB getRenderBoundingBox() {
return AxisAlignedBB.getBoundingBox(
xCoord - 1,
yCoord,
zCoord - 1,
xCoord + 2,
yCoord + 3,
zCoord + 2
);
return AxisAlignedBB.getBoundingBox(xCoord - 1, yCoord, zCoord - 1, xCoord + 2, yCoord + 3, zCoord + 2);
}
@Override
@SideOnly(Side.CLIENT)
public double getMaxRenderDistanceSquared()
{
public double getMaxRenderDistanceSquared() {
return 65536.0D;
}
@ -291,7 +297,7 @@ public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcce
@Override
public void setFluidFill(int fill, FluidType type) {
if(type == tank.getTankType())
tank.setFill(fill);
}
@ -303,24 +309,28 @@ public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcce
@Override
public List<FluidTank> getTanks() {
return new ArrayList() {{ add(tank); }};
return new ArrayList() {
{
add(tank);
}
};
}
@Override
public int getFluidFill(FluidType type) {
if(type == tank.getTankType())
return tank.getFill();
return 0;
}
@Override
public int getMaxFluidFill(FluidType type) {
if(type == tank.getTankType())
return tank.getMaxFill();
return 0;
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 B

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 756 B

After

Width:  |  Height:  |  Size: 797 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 485 B

View File

@ -0,0 +1,3 @@
{
"animation": { }
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B