mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
256k tank fixes, DFC funnies, bedrock ore work
This commit is contained in:
parent
5baaf48293
commit
4c85ee6616
@ -19,6 +19,7 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@ -79,6 +79,7 @@ public class ModBlocks {
|
||||
public static Block ore_alexandrite;
|
||||
|
||||
public static Block ore_random;
|
||||
public static Block ore_bedrock;
|
||||
|
||||
public static Block ore_bedrock_coltan;
|
||||
|
||||
@ -1397,6 +1398,7 @@ public class ModBlocks {
|
||||
ore_alexandrite = new BlockDepthOre().setBlockName("ore_alexandrite").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ore_alexandrite");
|
||||
|
||||
ore_random = new BlockMotherOfAllOres().setBlockName("ore_random").setCreativeTab(MainRegistry.blockTab);
|
||||
ore_bedrock = new BlockBedrockOreTE().setBlockName("ore_bedrock").setCreativeTab(null);
|
||||
|
||||
depth_brick = new BlockDepth().setBlockName("depth_brick").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":depth_brick");
|
||||
depth_tiles = new BlockDepth().setBlockName("depth_tiles").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":depth_tiles");
|
||||
@ -2531,6 +2533,9 @@ public class ModBlocks {
|
||||
//It's a meme you dip
|
||||
GameRegistry.registerBlock(ore_random, ItemRandomOreBlock.class, ore_random.getUnlocalizedName());
|
||||
|
||||
//Bedrock ore
|
||||
register(ore_bedrock);
|
||||
|
||||
//Crystals
|
||||
GameRegistry.registerBlock(crystal_power, crystal_power.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(crystal_energy, crystal_energy.getUnlocalizedName());
|
||||
|
||||
217
src/main/java/com/hbm/blocks/generic/BlockBedrockOreTE.java
Normal file
217
src/main/java/com/hbm/blocks/generic/BlockBedrockOreTE.java
Normal file
@ -0,0 +1,217 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.IBlockMultiPass;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.render.block.RenderBlockMultipass;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
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.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
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.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
|
||||
public class BlockBedrockOreTE extends BlockContainer implements ILookOverlay, IBlockMultiPass {
|
||||
|
||||
public BlockBedrockOreTE() {
|
||||
super(Material.rock);
|
||||
this.setBlockTextureName("bedrock");
|
||||
this.setBlockUnbreakable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityBedrockOre();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rand, int fortune) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) {
|
||||
super.onBlockPlacedBy(world, x, y, z, entity, stack);
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return IBlockMultiPass.getRenderType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPasses() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
private IIcon[] overlays = new IIcon[10];
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
|
||||
this.blockIcon = reg.registerIcon("bedrock");
|
||||
for(int i = 0; i < overlays.length; i++) {
|
||||
overlays[i] = reg.registerIcon(RefStrings.MODID + ":ore_random_" + (i + 1));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
|
||||
if(RenderBlockMultipass.currentPass == 0)
|
||||
return Blocks.bedrock.getIcon(0, 0);
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(te instanceof TileEntityBedrockOre) {
|
||||
TileEntityBedrockOre ore = (TileEntityBedrockOre) te;
|
||||
int index = ore.shape % overlays.length;
|
||||
return overlays[index];
|
||||
}
|
||||
|
||||
return Blocks.bedrock.getIcon(0, 0);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
|
||||
if(RenderBlockMultipass.currentPass == 0)
|
||||
return Blocks.bedrock.getIcon(0, 0);
|
||||
|
||||
int index = meta % overlays.length;
|
||||
return overlays[index];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
|
||||
|
||||
if(RenderBlockMultipass.currentPass == 0)
|
||||
return 0xffffff;
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(te instanceof TileEntityBedrockOre) {
|
||||
TileEntityBedrockOre ore = (TileEntityBedrockOre) te;
|
||||
return ore.color;
|
||||
}
|
||||
|
||||
return super.colorMultiplier(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(!(te instanceof TileEntityBedrockOre))
|
||||
return;
|
||||
|
||||
TileEntityBedrockOre ore = (TileEntityBedrockOre) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
|
||||
if(ore.resource != null) {
|
||||
text.add(ore.resource.getDisplayName());
|
||||
}
|
||||
|
||||
if(ore.acidRequirement != null) {
|
||||
text.add("Requires: " + ore.acidRequirement.fill + "mB " + I18nUtil.resolveKey(ore.acidRequirement.type.getUnlocalizedName()));
|
||||
}
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
|
||||
public static class TileEntityBedrockOre extends TileEntity {
|
||||
|
||||
public ItemStack resource;
|
||||
public FluidStack acidRequirement;
|
||||
public int color;
|
||||
public int shape;
|
||||
|
||||
public TileEntityBedrockOre setStyle(int color, int shape) {
|
||||
this.color = color;
|
||||
this.shape = shape;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
this.resource = new ItemStack(Item.getItemById(nbt.getInteger("0id")), nbt.getByte("size"), nbt.getShort("meta"));
|
||||
|
||||
if(this.resource.getItem() == null) this.resource = new ItemStack(ModItems.powder_iron);
|
||||
|
||||
FluidType type = Fluids.fromID(nbt.getInteger("fluid"));
|
||||
|
||||
if(type != Fluids.NONE) {
|
||||
this.acidRequirement = new FluidStack(type, nbt.getInteger("amount"));
|
||||
}
|
||||
|
||||
this.color = nbt.getInteger("color");
|
||||
this.shape = nbt.getInteger("shape");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
if(this.resource != null) {
|
||||
nbt.setInteger("0id", Item.getIdFromItem(this.resource.getItem()));
|
||||
nbt.setByte("size", (byte) this.resource.stackSize);
|
||||
nbt.setShort("meta", (short) this.resource.getItemDamage());
|
||||
}
|
||||
|
||||
if(this.acidRequirement != null) {
|
||||
nbt.setInteger("fluid", this.acidRequirement.type.getID());
|
||||
nbt.setInteger("amount", this.acidRequirement.fill);
|
||||
}
|
||||
|
||||
nbt.setInteger("color", this.color);
|
||||
nbt.setInteger("shape", this.shape);
|
||||
}
|
||||
|
||||
@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());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -40,9 +40,9 @@ public class MachineFluidTank extends BlockDummyable implements IPersistentInfoP
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12)
|
||||
return new TileEntityMachineFluidTank();
|
||||
return new TileEntityProxyCombo().fluid();
|
||||
if(meta >= 12) return new TileEntityMachineFluidTank();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -80,13 +80,11 @@ public class MachineFluidTank extends BlockDummyable implements IPersistentInfoP
|
||||
@Override
|
||||
protected void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
this.makeExtra(world, x + rot.offsetX, y, z + rot.offsetZ);
|
||||
this.makeExtra(world, x - rot.offsetX, y, z - rot.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX + rot.offsetX, y, z - dir.offsetZ + rot.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX - rot.offsetX, y, z - dir.offsetZ - rot.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX + 1, y, z - dir.offsetZ + 1);
|
||||
this.makeExtra(world, x - dir.offsetX + 1, y, z - dir.offsetZ - 1);
|
||||
this.makeExtra(world, x - dir.offsetX - 1, y, z - dir.offsetZ + 1);
|
||||
this.makeExtra(world, x - dir.offsetX - 1, y, z - dir.offsetZ - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -264,10 +264,10 @@ public class EntityNukeExplosionMK3 extends Entity {
|
||||
}
|
||||
|
||||
public static class ATEntry {
|
||||
int dim;
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
public int dim;
|
||||
public int x;
|
||||
public int y;
|
||||
public int z;
|
||||
|
||||
public ATEntry(int dim, int x, int y, int z) {
|
||||
this.dim = dim;
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.gui.GUIMixer;
|
||||
import com.hbm.inventory.recipes.MixerRecipes;
|
||||
|
||||
public class MixerHandler extends NEIUniversalHandler {
|
||||
@ -13,4 +16,12 @@ public class MixerHandler extends NEIUniversalHandler {
|
||||
public String getKey() {
|
||||
return "ntmMixer";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
super.loadTransferRects();
|
||||
transferRectsGui.add(new RecipeTransferRect(new Rectangle(57, 25, 52, 44), "ntmMixer"));
|
||||
guiGui.add(GUIMixer.class);
|
||||
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,6 +27,16 @@ public class ContainerMixer extends Container {
|
||||
//Upgrades
|
||||
this.addSlotToContainer(new Slot(mixer, 3, 137, 24));
|
||||
this.addSlotToContainer(new Slot(mixer, 4, 137, 42));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(player, j + i * 9 + 9, 8 + j * 18, 122 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(player, i, 8 + i * 18, 180));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -51,6 +51,11 @@ public class GUIMixer extends GuiInfoContainer {
|
||||
|
||||
int i = (int) (mixer.getPower() * 53 / mixer.getMaxPower());
|
||||
drawTexturedModalRect(guiLeft + 23, guiTop + 75 - i, 176, 52 - i, 16, i);
|
||||
|
||||
if(mixer.processTime > 0 && mixer.progress > 0) {
|
||||
int j = mixer.progress * 53 / mixer.processTime;
|
||||
drawTexturedModalRect(guiLeft + 62, guiTop + 36, 192, 0, j, 44);
|
||||
}
|
||||
|
||||
mixer.tanks[0].renderTank(guiLeft + 43, guiTop + 75, this.zLevel, 7, 52);
|
||||
mixer.tanks[1].renderTank(guiLeft + 52, guiTop + 75, this.zLevel, 7, 52);
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.items.tool;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.generic.BlockBedrockOreTE.TileEntityBedrockOre;
|
||||
import com.hbm.entity.effect.EntityNukeTorex;
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK5;
|
||||
import com.hbm.entity.logic.EntityTomBlast;
|
||||
@ -74,19 +75,32 @@ public class ItemWandD extends Item {
|
||||
|
||||
/*OilSpot.generateOilSpot(world, pos.blockX, pos.blockZ, 20, 500);*/
|
||||
|
||||
EntityNukeTorex torex = new EntityNukeTorex(world);
|
||||
/*EntityNukeTorex torex = new EntityNukeTorex(world);
|
||||
torex.setPositionAndRotation(pos.blockX, pos.blockY + 1, pos.blockZ, 0, 0);
|
||||
torex.getDataWatcher().updateObject(10, 1.5F);
|
||||
world.spawnEntityInWorld(torex);
|
||||
EntityTracker entitytracker = ((WorldServer) world).getEntityTracker();
|
||||
IntHashMap map = ReflectionHelper.getPrivateValue(EntityTracker.class, entitytracker, "trackedEntityIDs", "field_72794_c");
|
||||
EntityTrackerEntry entry = (EntityTrackerEntry) map.lookup(torex.getEntityId());
|
||||
entry.blocksDistanceThreshold = 1000;
|
||||
world.spawnEntityInWorld(EntityNukeExplosionMK5.statFacNoRad(world, 150, pos.blockX, pos.blockY + 1, pos.blockZ));*/
|
||||
|
||||
EntityTracker entitytracker = ((WorldServer)world).getEntityTracker();
|
||||
//ReflectionHelper.setPrivateValue(EntityTracker.class, entitytracker, 1000, "entityViewDistance");
|
||||
|
||||
IntHashMap map = ReflectionHelper.getPrivateValue(EntityTracker.class, entitytracker, "trackedEntityIDs", "field_72794_c");
|
||||
EntityTrackerEntry entry = (EntityTrackerEntry) map.lookup(torex.getEntityId());
|
||||
entry.blocksDistanceThreshold = 1000;
|
||||
int x = pos.blockX;
|
||||
int z = pos.blockZ;
|
||||
int type = world.rand.nextInt(10);
|
||||
|
||||
world.spawnEntityInWorld(EntityNukeExplosionMK5.statFacNoRad(world, 150, pos.blockX, pos.blockY + 1, pos.blockZ));
|
||||
for(int i = 0; i < 1; i++) {
|
||||
int ix = (int) Math.floor(x + world.rand.nextGaussian() * 0);
|
||||
int iz = (int) Math.floor(z + world.rand.nextGaussian() * 0);
|
||||
|
||||
world.setBlock(ix, 0, iz, ModBlocks.ore_bedrock);
|
||||
TileEntityBedrockOre ore = (TileEntityBedrockOre) world.getTileEntity(ix, 0, iz);
|
||||
ore.resource = new ItemStack(ModBlocks.stone_resource, 1, 2);
|
||||
ore.color = 0xCF6722;
|
||||
ore.shape = type;
|
||||
world.markBlockForUpdate(ix, 0, iz);
|
||||
world.markTileEntityChunkModified(ix, 0, iz, ore);
|
||||
}
|
||||
|
||||
/*EntitySiegeTunneler tunneler = new EntitySiegeTunneler(world);
|
||||
tunneler.setPosition(pos.blockX, pos.blockY + 1, pos.blockZ);
|
||||
|
||||
@ -305,6 +305,7 @@ public class CraftingManager {
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_fraction_tower), new Object[] { "SHS", "SGS", "SHS", 'S', STEEL.plate(), 'H', ModItems.hull_big_steel, 'G', ModBlocks.steel_grate });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.fraction_spacer), new Object[] { "BHB", 'H', ModItems.hull_big_steel, 'B', Blocks.iron_bars });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.furnace_iron), new Object[] { "III", "IFI", "BBB", 'I', IRON.ingot(), 'F', Blocks.furnace, 'B', Blocks.stonebrick });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_mixer), new Object[] { "PIP", "GCG", "PMP", 'P', STEEL.plate(), 'I', DURA.ingot(), 'G', KEY_ANYPANE, 'C', ModItems.circuit_copper, 'M', ModItems.motor });
|
||||
|
||||
addRecipeAuto(new ItemStack(ModBlocks.muffler, 1), new Object[] { "III", "IWI", "III", 'I', ModItems.plate_polymer, 'W', Blocks.wool });
|
||||
|
||||
|
||||
@ -6,6 +6,8 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.entity.item.EntityMovingItem;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
@ -29,7 +31,7 @@ public class RenderMovingItem extends Render {
|
||||
EntityMovingItem item = (EntityMovingItem) entity;
|
||||
ItemStack stack = item.getItemStack().copy();
|
||||
|
||||
if(!(stack.getItem() instanceof ItemBlock)) {
|
||||
if(!(stack.getItemSpriteNumber() == 0 && stack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(stack.getItem()).getRenderType()))) {
|
||||
GL11.glRotatef(90F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glTranslated(0.0, -0.1875, 0.0);
|
||||
|
||||
|
||||
@ -9,10 +9,9 @@ import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.util.RenderSparks;
|
||||
import com.hbm.tileentity.machine.TileEntityCore;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@ -36,12 +35,13 @@ public class RenderCore extends TileEntitySpecialRenderer {
|
||||
} else {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x, y, z);
|
||||
/*GL11.glRotatef(-RenderManager.instance.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(RenderManager.instance.playerViewX - 90, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glTranslated(-0.5, -0.5, -0.5);*/
|
||||
|
||||
renderOrb(core, 0, 0, 0);
|
||||
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
|
||||
|
||||
if(core.meltdownTick)
|
||||
renderFlare(core);
|
||||
else
|
||||
renderOrb(core, 0, 0, 0);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@ -129,12 +129,84 @@ public class RenderCore extends TileEntitySpecialRenderer {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void renderFlare(TileEntityCore core) {
|
||||
|
||||
int color = core.color;
|
||||
float r = ((color & 0xFF0000) >> 16) / 255F;
|
||||
float g = ((color & 0x00FF00) >> 8) / 255F;
|
||||
float b = ((color & 0x0000FF) >> 0) / 255F;
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
float f1 = (core.getWorldObj().getTotalWorldTime()) / 200.0F;
|
||||
float f2 = 0.0F;
|
||||
|
||||
Random random = new Random(432L);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.0F);
|
||||
GL11.glDepthMask(false);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glPushMatrix();
|
||||
|
||||
double ix = (core.getWorldObj().getTotalWorldTime() * 0.2D) % (Math.PI * 2D);
|
||||
double t = 0.8F;
|
||||
float pulse = (float) ((1D / t) * Math.atan((t * Math.sin(ix)) / (1 - t * Math.cos(ix))));
|
||||
|
||||
pulse += 1D;
|
||||
pulse /= 2D;
|
||||
|
||||
float s = 0.875F;
|
||||
s += pulse * 0.125F;
|
||||
|
||||
GL11.glScalef(s, s, s);
|
||||
|
||||
int count = 150;
|
||||
for(int i = 0; i < count; i++) {
|
||||
GL11.glRotatef(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(random.nextFloat() * 360.0F + f1 * 90.0F, 0.0F, 0.0F, 1.0F);
|
||||
tessellator.startDrawing(6);
|
||||
float f3 = random.nextFloat() * 2.0F + 5.0F + f2 * 10F;
|
||||
float f4 = random.nextFloat() * 1.0F + 1.0F + f2 * 2.0F;
|
||||
tessellator.setColorRGBA_F(r, g, b, 1F);
|
||||
tessellator.addVertex(0.0D, 0.0D, 0.0D);
|
||||
tessellator.setColorRGBA_F(r, g, b, 0F);
|
||||
tessellator.addVertex(-0.866D * f4, f3, -0.5F * f4);
|
||||
tessellator.addVertex(0.866D * f4, f3, -0.5F * f4);
|
||||
tessellator.addVertex(0.0D, f3, 1.0F * f4);
|
||||
tessellator.addVertex(-0.866D * f4, f3, -0.5F * f4);
|
||||
GL11.glScalef(0.999F, 0.999F, 0.999F);
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
public void renderVoid(TileEntity tile, double x, double y, double z) {
|
||||
|
||||
TileEntityCore core = (TileEntityCore)tile;
|
||||
|
||||
@ -55,9 +55,9 @@ public class RenderCoreComponent extends TileEntitySpecialRenderer {
|
||||
int range = ((TileEntityCoreEmitter)tileEntity).beam;
|
||||
|
||||
if(range > 0) {
|
||||
BeamPronter.prontBeam(Vec3.createVectorHelper(0, 0, range), EnumWaveType.SPIRAL, EnumBeamType.SOLID, 0x404000, 0x404000, 0, 1, 0F, 2, 0.0625F);
|
||||
BeamPronter.prontBeam(Vec3.createVectorHelper(0, 0, range), EnumWaveType.RANDOM, EnumBeamType.SOLID, 0x401500, 0x401500, (int)tileEntity.getWorldObj().getTotalWorldTime() % 1000, range * 2, 0.125F, 4, 0.0625F);
|
||||
BeamPronter.prontBeam(Vec3.createVectorHelper(0, 0, range), EnumWaveType.RANDOM, EnumBeamType.SOLID, 0x401500, 0x401500, (int)tileEntity.getWorldObj().getTotalWorldTime() % 1000 + 1, range * 2, 0.125F, 4, 0.0625F);
|
||||
BeamPronter.prontBeamwithDepth(Vec3.createVectorHelper(0, 0, range), EnumWaveType.SPIRAL, EnumBeamType.SOLID, 0x404000, 0x404000, 0, 1, 0F, 2, 0.0625F);
|
||||
BeamPronter.prontBeamwithDepth(Vec3.createVectorHelper(0, 0, range), EnumWaveType.RANDOM, EnumBeamType.SOLID, 0x401500, 0x401500, (int)tileEntity.getWorldObj().getTotalWorldTime() % 1000, range * 2, 0.125F, 4, 0.0625F);
|
||||
BeamPronter.prontBeamwithDepth(Vec3.createVectorHelper(0, 0, range), EnumWaveType.RANDOM, EnumBeamType.SOLID, 0x401500, 0x401500, (int)tileEntity.getWorldObj().getTotalWorldTime() % 1000 + 1, range * 2, 0.125F, 4, 0.0625F);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,14 +1,23 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineMixer;
|
||||
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class RenderMixer extends TileEntitySpecialRenderer {
|
||||
public class RenderMixer extends TileEntitySpecialRenderer implements IItemRendererProvider {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float interp) {
|
||||
@ -24,18 +33,69 @@ public class RenderMixer extends TileEntitySpecialRenderer {
|
||||
TileEntityMachineMixer mixer = (TileEntityMachineMixer) tile;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(mixer.prevRotation + (mixer.rotation - mixer.prevRotation) * interp, 0, 1, 0);
|
||||
GL11.glRotatef(mixer.prevRotation + (mixer.rotation - mixer.prevRotation) * interp, 0, -1, 0);
|
||||
ResourceManager.mixer.renderPart("Mixer");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
int totalFill = 0;
|
||||
int totalMax = 0;
|
||||
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
ResourceManager.mixer.renderPart("Fluid");
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
for(FluidTank tank : mixer.tanks) {
|
||||
if(tank.getTankType() != Fluids.NONE) {
|
||||
totalFill += tank.getFill();
|
||||
totalMax += tank.getMaxFill();
|
||||
}
|
||||
}
|
||||
|
||||
if(totalFill > 0) {
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
|
||||
Color color = new Color(mixer.tanks[2].getTankType().getColor());
|
||||
GL11.glColor4f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 0.75F);
|
||||
GL11.glTranslated(0, 1, 0);
|
||||
|
||||
GL11.glScaled(1, (double) totalFill / (double) totalMax, 1);
|
||||
GL11.glTranslated(0, -1, 0);
|
||||
ResourceManager.mixer.renderPart("Fluid");
|
||||
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
}
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemForRenderer() {
|
||||
return Item.getItemFromBlock(ModBlocks.machine_mixer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemRenderer getRenderer() {
|
||||
return new ItemRenderBase( ) {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -5, 0);
|
||||
GL11.glScaled(5, 5, 5);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glRotated(180, 0, 1, 0);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.mixer_tex);
|
||||
ResourceManager.mixer.renderPart("Main");
|
||||
ResourceManager.mixer.renderPart("Mixer");
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.bomb.BlockVolcano.TileEntityVolcanoCore;
|
||||
import com.hbm.blocks.generic.BlockBedrockOreTE.TileEntityBedrockOre;
|
||||
import com.hbm.blocks.generic.BlockBobble.TileEntityBobble;
|
||||
import com.hbm.blocks.generic.BlockEmitter.TileEntityEmitter;
|
||||
import com.hbm.blocks.generic.BlockLoot.TileEntityLoot;
|
||||
@ -201,6 +202,7 @@ public class TileMappings {
|
||||
put(TileEntityProxyConductor.class, "tileentity_proxy_conductor");
|
||||
|
||||
put(TileEntityRandomOre.class, "tileentity_mother_of_all_ores");
|
||||
put(TileEntityBedrockOre.class, "tileentity_bedrock_ore");
|
||||
|
||||
putNetwork();
|
||||
putBombs();
|
||||
|
||||
@ -1,9 +1,14 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.config.BombConfig;
|
||||
import com.hbm.entity.effect.EntityCloudFleijaRainbow;
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK3;
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK3.ATEntry;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
@ -20,6 +25,7 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class TileEntityCore extends TileEntityMachineBase {
|
||||
|
||||
@ -28,6 +34,7 @@ public class TileEntityCore extends TileEntityMachineBase {
|
||||
public int color;
|
||||
public FluidTank[] tanks;
|
||||
private boolean lastTickValid = false;
|
||||
public boolean meltdownTick = false;
|
||||
|
||||
public TileEntityCore() {
|
||||
super(3);
|
||||
@ -49,6 +56,8 @@ public class TileEntityCore extends TileEntityMachineBase {
|
||||
int chunkX = xCoord >> 4;
|
||||
int chunkZ = zCoord >> 4;
|
||||
|
||||
meltdownTick = false;
|
||||
|
||||
lastTickValid = worldObj.getChunkProvider().chunkExists(chunkX, chunkZ) &&
|
||||
worldObj.getChunkProvider().chunkExists(chunkX + 1, chunkZ + 1) &&
|
||||
worldObj.getChunkProvider().chunkExists(chunkX + 1, chunkZ - 1) &&
|
||||
@ -63,17 +72,46 @@ public class TileEntityCore extends TileEntityMachineBase {
|
||||
|
||||
int size = Math.max(Math.min(fill * mod / max, 1000), 50);
|
||||
|
||||
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, size);
|
||||
boolean canExplode = true;
|
||||
Iterator<Entry<ATEntry, Long>> it = EntityNukeExplosionMK3.at.entrySet().iterator();
|
||||
while(it.hasNext()) {
|
||||
Entry<ATEntry, Long> next = it.next();
|
||||
if(next.getValue() < worldObj.getTotalWorldTime()) {
|
||||
it.remove();
|
||||
continue;
|
||||
}
|
||||
ATEntry entry = next.getKey();
|
||||
if(entry.dim != worldObj.provider.dimensionId) continue;
|
||||
Vec3 vec = Vec3.createVectorHelper(xCoord + 0.5 - entry.x, yCoord + 0.5 - entry.y, zCoord + 0.5 - entry.z);
|
||||
if(vec.lengthVector() < 300) {
|
||||
canExplode = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!ex.isDead) {
|
||||
worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.explode", 100000.0F, 1.0F);
|
||||
if(canExplode) {
|
||||
|
||||
EntityNukeExplosionMK3 ex = new EntityNukeExplosionMK3(worldObj);
|
||||
ex.posX = xCoord + 0.5;
|
||||
ex.posY = yCoord + 0.5;
|
||||
ex.posZ = zCoord + 0.5;
|
||||
ex.destructionRange = size;
|
||||
ex.speed = BombConfig.blastSpeed;
|
||||
ex.coefficient = 1.0F;
|
||||
ex.waste = false;
|
||||
worldObj.spawnEntityInWorld(ex);
|
||||
|
||||
worldObj.playSoundEffect(xCoord, yCoord, zCoord, "random.explode", 100000.0F, 1.0F);
|
||||
|
||||
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(worldObj, size);
|
||||
cloud.posX = xCoord;
|
||||
cloud.posY = yCoord;
|
||||
cloud.posZ = zCoord;
|
||||
worldObj.spawnEntityInWorld(cloud);
|
||||
|
||||
} else {
|
||||
meltdownTick = true;
|
||||
ChunkRadiationManager.proxy.incrementRad(worldObj, xCoord, yCoord, zCoord, 100);
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,6 +134,7 @@ public class TileEntityCore extends TileEntityMachineBase {
|
||||
data.setInteger("field", field);
|
||||
data.setInteger("heat", heat);
|
||||
data.setInteger("color", color);
|
||||
data.setBoolean("melt", meltdownTick);
|
||||
networkPack(data, 250);
|
||||
|
||||
heat = 0;
|
||||
@ -121,13 +160,15 @@ public class TileEntityCore extends TileEntityMachineBase {
|
||||
field = data.getInteger("field");
|
||||
heat = data.getInteger("heat");
|
||||
color = data.getInteger("color");
|
||||
meltdownTick = data.getBoolean("melt");
|
||||
}
|
||||
|
||||
private void radiation() {
|
||||
|
||||
double scale = 2;
|
||||
double scale = this.meltdownTick ? 5 : 3;
|
||||
double range = this.meltdownTick ? 50 : 10;
|
||||
|
||||
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(xCoord - 10 + 0.5, yCoord - 10 + 0.5 + 6, zCoord - 10 + 0.5, xCoord + 10 + 0.5, yCoord + 10 + 0.5 + 6, zCoord + 10 + 0.5));
|
||||
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5).expand(range, range, range));
|
||||
|
||||
for(Entity e : list) {
|
||||
if(!(e instanceof EntityPlayer && ArmorUtil.checkForHazmat((EntityPlayer)e)))
|
||||
@ -137,7 +178,7 @@ public class TileEntityCore extends TileEntityMachineBase {
|
||||
}
|
||||
}
|
||||
|
||||
List<Entity> list2 = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(xCoord - scale + 0.5, yCoord - scale + 0.5 + 6, zCoord - scale + 0.5, xCoord + scale + 0.5, yCoord + scale + 0.5 + 6, zCoord + scale + 0.5));
|
||||
List<Entity> list2 =worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5).expand(scale, scale, scale));
|
||||
|
||||
for(Entity e : list2) {
|
||||
if(!(e instanceof EntityPlayer && ArmorUtil.checkForHaz2((EntityPlayer)e)))
|
||||
|
||||
@ -211,6 +211,7 @@ public class TileEntityMachineExcavator extends TileEntityMachineBase implements
|
||||
|
||||
boolean ignoreAll = true;
|
||||
float combinedHardness = 0F;
|
||||
BlockPos bedrockOre = null;
|
||||
|
||||
for(int x = xCoord - ring; x <= xCoord + ring; x++) {
|
||||
for(int z = zCoord - ring; z <= zCoord + ring; z++) {
|
||||
@ -224,6 +225,12 @@ public class TileEntityMachineExcavator extends TileEntityMachineBase implements
|
||||
|
||||
ignoreAll = false;
|
||||
|
||||
if(b == ModBlocks.ore_bedrock) {
|
||||
combinedHardness = 60 * 20;
|
||||
bedrockOre = new BlockPos(x, y, z);
|
||||
break;
|
||||
}
|
||||
|
||||
combinedHardness += b.getBlockHardness(worldObj, x, y, z);
|
||||
}
|
||||
}
|
||||
@ -235,9 +242,14 @@ public class TileEntityMachineExcavator extends TileEntityMachineBase implements
|
||||
int ticksToWork = (int) Math.ceil(combinedHardness / this.speed);
|
||||
|
||||
if(ticksWorked >= ticksToWork) {
|
||||
breakBlocks(ring);
|
||||
buildWall(ring + 1, ring == radius && this.enableWalling);
|
||||
tryCollect(radius);
|
||||
|
||||
if(bedrockOre != null) {
|
||||
breakBlocks(ring);
|
||||
buildWall(ring + 1, ring == radius && this.enableWalling);
|
||||
tryCollect(radius);
|
||||
} else {
|
||||
//collectBedrock(bedrockOre);
|
||||
}
|
||||
ticksWorked = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.container.ContainerMixer;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUIMixer;
|
||||
import com.hbm.inventory.recipes.MixerRecipes;
|
||||
import com.hbm.inventory.recipes.MixerRecipes.MixerRecipe;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
@ -19,6 +21,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
@ -26,13 +29,15 @@ import net.minecraft.world.World;
|
||||
public class TileEntityMachineMixer extends TileEntityMachineBase implements INBTPacketReceiver, IGUIProvider, IEnergyUser, IFluidStandardTransceiver {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100_000;
|
||||
public static final long maxPower = 10_000;
|
||||
public int progress;
|
||||
public int processTime;
|
||||
|
||||
public float rotation;
|
||||
public float prevRotation;
|
||||
public boolean wasOn = false;
|
||||
|
||||
private int consumption = 50;
|
||||
|
||||
public FluidTank[] tanks;
|
||||
|
||||
@ -56,6 +61,17 @@ public class TileEntityMachineMixer extends TileEntityMachineBase implements INB
|
||||
|
||||
tanks[2].setType(2, slots);
|
||||
|
||||
UpgradeManager.eval(slots, 3, 4);
|
||||
int speedLevel = Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 3);
|
||||
int powerLevel = Math.min(UpgradeManager.getLevel(UpgradeType.POWER), 3);
|
||||
int overLevel = UpgradeManager.getLevel(UpgradeType.OVERDRIVE);
|
||||
|
||||
this.consumption = 50;
|
||||
|
||||
this.consumption += speedLevel * 150;
|
||||
this.consumption -= this.consumption * powerLevel * 0.25;
|
||||
this.consumption *= (overLevel * 3 + 1);
|
||||
|
||||
for(DirPos pos : getConPos()) {
|
||||
this.trySubscribe(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
if(tanks[0].getTankType() != Fluids.NONE) this.trySubscribe(tanks[0].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
@ -66,6 +82,12 @@ public class TileEntityMachineMixer extends TileEntityMachineBase implements INB
|
||||
|
||||
if(this.wasOn) {
|
||||
this.progress++;
|
||||
this.power -= this.getConsumption();
|
||||
|
||||
this.processTime -= this.processTime * speedLevel / 4;
|
||||
this.processTime /= (overLevel + 1);
|
||||
|
||||
if(processTime <= 0) this.processTime = 1;
|
||||
|
||||
if(this.progress >= this.processTime) {
|
||||
this.process();
|
||||
@ -97,12 +119,17 @@ public class TileEntityMachineMixer extends TileEntityMachineBase implements INB
|
||||
if(this.wasOn) {
|
||||
this.rotation += 20F;
|
||||
}
|
||||
|
||||
if(this.rotation >= 360) {
|
||||
this.rotation -= 360;
|
||||
this.prevRotation -= 360;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
this.power = nbt.getLong("powe");
|
||||
this.power = nbt.getLong("power");
|
||||
this.processTime = nbt.getInteger("processTime");
|
||||
this.progress = nbt.getInteger("progress");
|
||||
this.wasOn = nbt.getBoolean("wasOn");
|
||||
@ -162,7 +189,7 @@ public class TileEntityMachineMixer extends TileEntityMachineBase implements INB
|
||||
}
|
||||
|
||||
public int getConsumption() {
|
||||
return 50;
|
||||
return consumption;
|
||||
}
|
||||
|
||||
protected DirPos[] getConPos() {
|
||||
@ -174,6 +201,41 @@ public class TileEntityMachineMixer extends TileEntityMachineBase implements INB
|
||||
new DirPos(xCoord, yCoord, zCoord - 1, Library.POS_Z),
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int meta) {
|
||||
return new int[] { 1 };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
|
||||
MixerRecipe recipe = MixerRecipes.getOutput(tanks[2].getTankType());
|
||||
|
||||
if(recipe == null || recipe.solidInput == null) return false;
|
||||
|
||||
return recipe.solidInput.matchesRecipe(itemStack, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
this.power = nbt.getLong("power");
|
||||
this.progress = nbt.getInteger("progress");
|
||||
this.processTime = nbt.getInteger("processTime");
|
||||
for(int i = 0; i < 3; i++) this.tanks[i].readFromNBT(nbt, i + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
nbt.setLong("power", power);
|
||||
nbt.setInteger("progress", progress);
|
||||
nbt.setInteger("processTime", processTime);
|
||||
for(int i = 0; i < 3; i++) this.tanks[i].writeToNBT(nbt, i + "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPower() {
|
||||
|
||||
@ -38,6 +38,7 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc
|
||||
public static final short modes = 4;
|
||||
public int age = 0;
|
||||
public List<IFluidAcceptor> list = new ArrayList();
|
||||
protected boolean sendingBrake = false;
|
||||
|
||||
public TileEntityBarrel() {
|
||||
super(6);
|
||||
@ -64,17 +65,9 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc
|
||||
tank.unloadTank(4, 5, slots);
|
||||
tank.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
|
||||
/*if(this.mode == 1 || this.mode == 2) {
|
||||
this.sendFluidToAll(tank.getTankType(), this);
|
||||
}
|
||||
|
||||
if(this.mode == 0 || this.mode == 1) {
|
||||
this.subscribeToAllAround(tank.getTankType(), worldObj, xCoord, yCoord, zCoord);
|
||||
} else {
|
||||
this.unsubscribeToAllAround(tank.getTankType(), worldObj, xCoord, yCoord, zCoord);
|
||||
}*/
|
||||
|
||||
this.sendingBrake = true;
|
||||
tank.setFill(transmitFluidFairly(worldObj, tank.getTankType(), this, tank.getFill(), this.mode == 0 || this.mode == 1, this.mode == 1 || this.mode == 2, getConPos()));
|
||||
this.sendingBrake = false;
|
||||
|
||||
age++;
|
||||
if(age >= 20)
|
||||
@ -126,6 +119,8 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc
|
||||
consumers.add((IFluidConnector) te);
|
||||
}
|
||||
}
|
||||
|
||||
consumers.remove(that);
|
||||
|
||||
if(fill > 0 && send) {
|
||||
List<IFluidConnector> con = new ArrayList();
|
||||
@ -312,7 +307,7 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return (mode == 0 || mode == 1) ? new FluidTank[] {tank} : new FluidTank[0];
|
||||
return (mode == 0 || mode == 1) && !sendingBrake ? new FluidTank[] {tank} : new FluidTank[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -55,6 +55,7 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
|
||||
public short mode = 0;
|
||||
public static final short modes = 4;
|
||||
public boolean hasExploded = false;
|
||||
protected boolean sendingBrake = false;
|
||||
|
||||
public Explosion lastExplosion = null;
|
||||
|
||||
@ -98,7 +99,9 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
|
||||
if(age >= 20)
|
||||
age = 0;
|
||||
|
||||
this.sendingBrake = true;
|
||||
tank.setFill(TileEntityBarrel.transmitFluidFairly(worldObj, tank.getTankType(), this, tank.getFill(), this.mode == 0 || this.mode == 1, this.mode == 1 || this.mode == 2, getConPos()));
|
||||
this.sendingBrake = false;
|
||||
|
||||
if((mode == 1 || mode == 2) && (age == 9 || age == 19))
|
||||
fillFluidInit(tank.getTankType());
|
||||
@ -254,7 +257,7 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
|
||||
if(mode == 2 || mode == 3)
|
||||
if(mode == 2 || mode == 3 || this.sendingBrake)
|
||||
return 0;
|
||||
|
||||
return type.name().equals(this.tank.getTankType().name()) ? tank.getMaxFill() : 0;
|
||||
@ -333,7 +336,7 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
|
||||
@Override
|
||||
public long getDemand(FluidType type) {
|
||||
|
||||
if(this.mode == 2 || this.mode == 3)
|
||||
if(this.mode == 2 || this.mode == 3 || this.sendingBrake)
|
||||
return 0;
|
||||
|
||||
return type == tank.getTankType() ? tank.getMaxFill() - tank.getFill() : 0;
|
||||
@ -370,7 +373,7 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
if(this.hasExploded) return new FluidTank[0];
|
||||
if(this.hasExploded || this.sendingBrake) return new FluidTank[0];
|
||||
return (mode == 0 || mode == 1) ? new FluidTank[] {tank} : new FluidTank[0];
|
||||
}
|
||||
|
||||
|
||||
@ -6,9 +6,7 @@ import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineOrbus extends TileEntityBarrel {
|
||||
|
||||
@ -137,7 +137,10 @@ public class ArmorUtil {
|
||||
|
||||
if(checkArmor(player, ModItems.hazmat_paa_helmet, ModItems.hazmat_paa_plate, ModItems.hazmat_paa_legs, ModItems.hazmat_paa_boots) ||
|
||||
checkArmor(player, ModItems.liquidator_helmet, ModItems.liquidator_plate, ModItems.liquidator_legs, ModItems.liquidator_boots) ||
|
||||
checkArmor(player, ModItems.euphemium_helmet, ModItems.euphemium_plate, ModItems.euphemium_legs, ModItems.euphemium_boots))
|
||||
checkArmor(player, ModItems.euphemium_helmet, ModItems.euphemium_plate, ModItems.euphemium_legs, ModItems.euphemium_boots) ||
|
||||
checkArmor(player, ModItems.rpa_helmet, ModItems.rpa_plate, ModItems.rpa_legs, ModItems.rpa_boots) ||
|
||||
checkArmor(player, ModItems.fau_helmet, ModItems.fau_plate, ModItems.fau_legs, ModItems.fau_boots) ||
|
||||
checkArmor(player, ModItems.dns_helmet, ModItems.dns_plate, ModItems.dns_legs, ModItems.dns_boots))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -324,6 +324,7 @@ container.machineFEL=FEL
|
||||
container.machineITER=Kernfusionsreaktor
|
||||
container.machineLargeTurbine=Industrielle Dampfturbine
|
||||
container.machineLiquefactor=Verflüssiger
|
||||
container.machineMixer=Industrieller Mixer
|
||||
container.machineRefinery=Ölraffinerie
|
||||
container.machineSelenium=Hochleistungs-Sternmotor
|
||||
container.machineShredder=Brecher
|
||||
@ -3234,9 +3235,6 @@ tile.block_corium_cobble.name=Corebblestone
|
||||
tile.block_daffergon.name=Daffergonblock
|
||||
tile.block_desh.name=Verstärketer Deshblock
|
||||
tile.block_dineutronium.name=Dineutroniumblock
|
||||
tile.door_bunker.name=Bunkertür
|
||||
tile.door_metal.name=Metalltür
|
||||
tile.door_office.name=Bürotür
|
||||
tile.block_dura_steel.name=Verstärketer Schnellarbeitsstahlblock
|
||||
tile.block_electrical_scrap.name=Elektroschrottblock
|
||||
tile.block_euphemium.name=Euphemiumblock
|
||||
@ -3498,6 +3496,9 @@ tile.dfc_stabilizer.name=DFC-Stabilisator
|
||||
tile.dirt_dead.name=Tote Erde
|
||||
tile.dirt_oily.name=Ölige Erde
|
||||
tile.drill_pipe.name=Bohrgestänge
|
||||
tile.door_bunker.name=Bunkertür
|
||||
tile.door_metal.name=Metalltür
|
||||
tile.door_office.name=Bürotür
|
||||
tile.ducrete.name=Ducretefliese
|
||||
tile.ducrete_stairs.name=Ducretefliesentreppe
|
||||
tile.ducrete_smooth.name=Ducrete
|
||||
@ -3712,6 +3713,7 @@ tile.machine_microwave.name=Mikrowelle
|
||||
tile.machine_mining_laser.name=Bergbaulaser
|
||||
tile.machine_minirtg.name=Radioisotopenzelle
|
||||
tile.machine_missile_assembly.name=Raketenmontagestation
|
||||
tile.machine_mixer.name=Industrieller Mixer
|
||||
tile.machine_nuke_furnace_off.name=Atombetriebener Ofen
|
||||
tile.machine_nuke_furnace_on.name=Atombetriebener Ofen
|
||||
tile.machine_orbus.name=Schwerer Magnetischer Lagerbehälter
|
||||
|
||||
@ -644,6 +644,7 @@ container.machineFEL=FEL
|
||||
container.machineITER=Fusion Reactor
|
||||
container.machineLargeTurbine=Industrial Steam Turbine
|
||||
container.machineLiquefactor=Liquefactor
|
||||
container.machineMixer=Industrial Mixer
|
||||
container.machineRefinery=Oil Refinery
|
||||
container.machineSelenium=Radial Performance Engine
|
||||
container.machineShredder=Shredder
|
||||
@ -4292,6 +4293,7 @@ tile.machine_microwave.name=Microwave
|
||||
tile.machine_mining_laser.name=Mining Laser
|
||||
tile.machine_minirtg.name=Radio Isotope Cell
|
||||
tile.machine_missile_assembly.name=Missile Assembly Station
|
||||
tile.machine_mixer.name=Industrial Mixer
|
||||
tile.machine_nuke_furnace_off.name=Nuclear Furnace
|
||||
tile.machine_nuke_furnace_on.name=Nuclear Furnace
|
||||
tile.machine_orbus.name=Heavy Magnetic Storage Tank
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user