Manatide Bellows. Are you stoked yet?

This commit is contained in:
Vasco Lavos committed 2015-08-28 19:26:02 +01:00
1 parent e4be8f3871
commit 64006a8115
18 files changed
+479 -7

No files matched your search

@@ -60,6 +60,7 @@ import vazkii.botania.client.gui.lexicon.GuiLexiconIndex;
import vazkii.botania.client.integration.nei.NEIGuiHooks;
import vazkii.botania.client.lib.LibRenderIDs;
import vazkii.botania.client.render.block.RenderAltar;
import vazkii.botania.client.render.block.RenderBellows;
import vazkii.botania.client.render.block.RenderBrewery;
import vazkii.botania.client.render.block.RenderCocoon;
import vazkii.botania.client.render.block.RenderCorporeaCrystalCube;
@@ -91,6 +92,7 @@ import vazkii.botania.client.render.item.RenderLexicon;
import vazkii.botania.client.render.item.RenderTransparentItem;
import vazkii.botania.client.render.tile.RenderTileAlfPortal;
import vazkii.botania.client.render.tile.RenderTileAltar;
import vazkii.botania.client.render.tile.RenderTileBellows;
import vazkii.botania.client.render.tile.RenderTileBrewery;
import vazkii.botania.client.render.tile.RenderTileCocoon;
import vazkii.botania.client.render.tile.RenderTileCorporeaCrystalCube;
@@ -133,6 +135,7 @@ import vazkii.botania.common.block.tile.TileTerraPlate;
import vazkii.botania.common.block.tile.TileTinyPotato;
import vazkii.botania.common.block.tile.corporea.TileCorporeaCrystalCube;
import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex;
import vazkii.botania.common.block.tile.mana.TileBellows;
import vazkii.botania.common.block.tile.mana.TilePool;
import vazkii.botania.common.block.tile.mana.TilePrism;
import vazkii.botania.common.block.tile.mana.TilePump;
@@ -237,7 +240,9 @@ public class ClientProxy extends CommonProxy {
LibRenderIDs.idIncensePlate = RenderingRegistry.getNextAvailableRenderId();
LibRenderIDs.idHourglass = RenderingRegistry.getNextAvailableRenderId();
LibRenderIDs.idCocoon = RenderingRegistry.getNextAvailableRenderId();
LibRenderIDs.idLightRelay = RenderingRegistry.getNextAvailableRenderId();
LibRenderIDs.idBellows = RenderingRegistry.getNextAvailableRenderId();
RenderSpecialFlower specialFlowerRender = new RenderSpecialFlower(LibRenderIDs.idSpecialFlower);
RenderingRegistry.registerBlockHandler(new RenderAltar());
RenderingRegistry.registerBlockHandler(specialFlowerRender);
@@ -255,6 +260,7 @@ public class ClientProxy extends CommonProxy {
RenderingRegistry.registerBlockHandler(new RenderIncensePlate());
RenderingRegistry.registerBlockHandler(new RenderHourglass());
RenderingRegistry.registerBlockHandler(new RenderCocoon());
RenderingRegistry.registerBlockHandler(new RenderBellows());
IMultiblockRenderHook.renderHooks.put(ModBlocks.flower, specialFlowerRender);
IMultiblockRenderHook.renderHooks.put(ModBlocks.shinyFlower, specialFlowerRender);
@@ -298,6 +304,7 @@ public class ClientProxy extends CommonProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileSparkChanger.class, new RenderTileSparkChanger());
ClientRegistry.bindTileEntitySpecialRenderer(TileCocoon.class, new RenderTileCocoon());
ClientRegistry.bindTileEntitySpecialRenderer(TileLightRelay.class, new RenderTileLightRelay());
ClientRegistry.bindTileEntitySpecialRenderer(TileBellows.class, new RenderTileBellows());
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySkull.class, new RenderTileSkullOverride());
@@ -29,5 +29,6 @@ public final class LibRenderIDs {
public static int idHourglass = -1;
public static int idCocoon = -1;
public static int idLightRelay = -1;
public static int idBellows = -1;
}
@@ -108,6 +108,7 @@ public final class LibResources {
public static final String MODEL_INCENSE_PLATE = PREFIX_MODEL + "incensePlate.png";
public static final String MODEL_HOURGLASS = PREFIX_MODEL + "hourglass.png";
public static final String MODEL_COCOON = PREFIX_MODEL + "cocoon.png";
public static final String MODEL_BELLOWS = PREFIX_MODEL + "bellows.png";
public static final String MISC_PARTICLES = PREFIX_MISC + "particles.png";
public static final String MISC_WISP_LARGE = PREFIX_MISC + "wispLarge.png";
@@ -0,0 +1,94 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
* File Created @ [Aug 28, 2015, 5:16:17 PM (GMT)]
*/
package vazkii.botania.client.model;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.handler.ClientTickHandler;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelBellows extends ModelBase {
ModelRenderer Base;
ModelRenderer Top;
ModelRenderer Funnel;
ModelRenderer Pipe;
ModelRenderer Handle1;
ModelRenderer Handle2;
ModelRenderer Handle3;
public ModelBellows() {
textureWidth = 64;
textureHeight = 32;
Base = new ModelRenderer(this, 0, 0);
Base.addBox(0F, 0F, 0F, 10, 2, 10);
Base.setRotationPoint(-5F, 22F, -5F);
Base.setTextureSize(64, 32);
Base.mirror = true;
Top = new ModelRenderer(this, 0, 14);
Top.addBox(0F, 0F, 0F, 8, 1, 8);
Top.setRotationPoint(-4F, 14F, -4F);
Top.setTextureSize(64, 32);
Top.mirror = true;
Funnel = new ModelRenderer(this, 34, 14);
Funnel.addBox(0F, 0F, 0F, 6, 7, 6);
Funnel.setRotationPoint(0F, 0F, 0F);
Funnel.setTextureSize(64, 32);
Funnel.mirror = true;
Pipe = new ModelRenderer(this, 43, 1);
Pipe.addBox(0F, 0F, 0F, 2, 2, 3);
Pipe.setRotationPoint(-1F, 22F, -8F);
Pipe.setTextureSize(64, 32);
Pipe.mirror = true;
Handle1 = new ModelRenderer(this, 43, 8);
Handle1.addBox(0F, 0F, -0.5F, 1, 2, 1);
Handle1.setRotationPoint(-2F, 12F, 0F);
Handle1.setTextureSize(64, 32);
Handle1.mirror = true;
Handle2 = new ModelRenderer(this, 48, 8);
Handle2.addBox(1F, 0F, -0.5F, 2, 1, 1);
Handle2.setRotationPoint(-2F, 12F, 0F);
Handle2.setTextureSize(64, 32);
Handle2.mirror = true;
Handle3 = new ModelRenderer(this, 55, 8);
Handle3.addBox(3F, 0F, -0.5F, 1, 2, 1);
Handle3.setRotationPoint(-2F, 12F, 0F);
Handle3.setTextureSize(64, 32);
Handle3.mirror = true;
}
public void render(float fract) {
float f5 = 1F / 16F;
Base.render(f5);
Pipe.render(f5);
//float fract = Math.max(0.1F, (float) (Math.sin(((double) ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) * 0.2) + 1F) * 0.5F);
float mov = (1F - fract) * 0.5F;
GL11.glTranslatef(0F, mov, 0F);
Top.render(f5);
Handle1.render(f5);
Handle2.render(f5);
Handle3.render(f5);
GL11.glTranslatef(0F, -mov, 0F);
GL11.glRotatef(180F, 1F, 0F, 0F);
GL11.glTranslatef(-0.19F, -1.375F, -0.19F);
GL11.glScalef(1F, fract, 1F);
Funnel.render(f5);
GL11.glScalef(1F, 1F / fract, 1F);
}
}
@@ -0,0 +1,51 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
* File Created @ [Aug 28, 2015, 7:13:45 PM (GMT)]
*/
package vazkii.botania.client.render.block;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.lib.LibRenderIDs;
import vazkii.botania.common.block.tile.mana.TileBellows;
import vazkii.botania.common.block.tile.mana.TilePump;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class RenderBellows implements ISimpleBlockRenderingHandler {
@Override
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
GL11.glPushMatrix();
GL11.glTranslatef(-0.5F, -0.3F, -0.5F);
GL11.glScalef(1.2F, 1.2F, 1.2F);
TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileBellows(), 0.0D, 0.0D, 0.0D, 0.0F);
GL11.glPopMatrix();
}
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
return false;
}
@Override
public boolean shouldRender3DInInventory(int modelId) {
return true;
}
@Override
public int getRenderId() {
return LibRenderIDs.idBellows;
}
}
@@ -0,0 +1,57 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
* File Created @ [Aug 28, 2015, 5:30:41 PM (GMT)]
*/
package vazkii.botania.client.render.tile;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelBellows;
import vazkii.botania.client.model.ModelPump;
import vazkii.botania.common.block.tile.mana.TileBellows;
import vazkii.botania.common.block.tile.mana.TilePump;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
public class RenderTileBellows extends TileEntitySpecialRenderer {
private static final float[] ROTATIONS = new float[] {
180F, 0F, 90F, 270F
};
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_BELLOWS);
private static final ModelBellows model = new ModelBellows();
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) {
TileBellows bellows = (TileBellows) tileentity;
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glTranslated(d0, d1, d2);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
int meta = bellows.getWorldObj() != null ? bellows.getBlockMetadata() : 0;
GL11.glTranslatef(0.5F, 1.5F, 0.5F);
GL11.glScalef(1F, -1F, -1F);
GL11.glRotatef(ROTATIONS[Math.max(Math.min(ROTATIONS.length, meta - 2), 0)], 0F, 1F, 0F);
model.render(Math.max(0.1F, 1F - (bellows.movePos + bellows.moving * f + 0.1F)));
GL11.glColor3f(1F, 1F, 1F);
GL11.glScalef(1F, -1F, -1F);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
}
@@ -48,6 +48,7 @@ import vazkii.botania.common.block.dispenser.BehaviourPoolMinecart;
import vazkii.botania.common.block.dispenser.BehaviourSeeds;
import vazkii.botania.common.block.dispenser.BehaviourWand;
import vazkii.botania.common.block.mana.BlockAlchemyCatalyst;
import vazkii.botania.common.block.mana.BlockBellows;
import vazkii.botania.common.block.mana.BlockBrewery;
import vazkii.botania.common.block.mana.BlockConjurationCatalyst;
import vazkii.botania.common.block.mana.BlockDistributor;
@@ -141,6 +142,7 @@ import vazkii.botania.common.block.tile.corporea.TileCorporeaCrystalCube;
import vazkii.botania.common.block.tile.corporea.TileCorporeaFunnel;
import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex;
import vazkii.botania.common.block.tile.corporea.TileCorporeaInterceptor;
import vazkii.botania.common.block.tile.mana.TileBellows;
import vazkii.botania.common.block.tile.mana.TileDistributor;
import vazkii.botania.common.block.tile.mana.TileManaDetector;
import vazkii.botania.common.block.tile.mana.TileManaVoid;
@@ -241,6 +243,7 @@ public final class ModBlocks {
public static Block lightLauncher;
public static Block manaBomb;
public static Block cacophonium;
public static Block bellows;
public static void init() {
flower = new BlockModFlower();
@@ -322,6 +325,7 @@ public final class ModBlocks {
lightLauncher = new BlockLightLauncher();
manaBomb = new BlockManaBomb();
cacophonium = new BlockCacophonium();
bellows = new BlockBellows();
ModFluffBlocks.init();
@@ -417,6 +421,7 @@ public final class ModBlocks {
registerTile(TileCocoon.class, LibBlockNames.COCOON);
registerTile(TileLightRelay.class, LibBlockNames.LIGHT_RELAY);
registerTile(TileCacophonium.class, LibBlockNames.CACOPHONIUM);
registerTile(TileBellows.class, LibBlockNames.BELLOWS);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_PUREDAISY, SubTilePureDaisy.class);
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_MANASTAR, SubTileManastar.class);
@@ -0,0 +1,86 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
* File Created @ [Aug 28, 2015, 5:18:13 PM (GMT)]
*/
package vazkii.botania.common.block.mana;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import vazkii.botania.client.lib.LibRenderIDs;
import vazkii.botania.common.block.BlockModContainer;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.block.tile.mana.TileBellows;
import vazkii.botania.common.entity.EntityDoppleganger;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockBellows extends BlockModContainer {
private static final int[] META_ROTATIONS = new int[] { 3, 4, 2, 5 };
public BlockBellows() {
super(Material.wood);
setHardness(2.0F);
setStepSound(soundTypeWood);
setBlockName(LibBlockNames.BELLOWS);
float f = (1F - 10 / 16F) / 2F;
setBlockBounds(f, 0F, f, 1F - f, 10F / 16F, 1F - f);
}
@Override
public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) {
int l = MathHelper.floor_double(p_149689_5_.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, META_ROTATIONS[l], 2);
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
// NO-OP
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int s, float xs, float ys, float zs) {
if(EntityDoppleganger.isTruePlayer(player))
((TileBellows) world.getTileEntity(x, y, z)).interact();
return true;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public IIcon getIcon(int par1, int par2) {
return ModBlocks.livingwood.getIcon(par1, 0);
}
@Override
public int getRenderType() {
return LibRenderIDs.idBellows;
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileBellows();
}
}
@@ -86,7 +86,7 @@ public class SubTileExoflame extends SubTileFunctional {
sync();
}
public boolean canFurnaceSmelt(TileEntityFurnace furnace){
public static boolean canFurnaceSmelt(TileEntityFurnace furnace){
if(furnace.getStackInSlot(0) == null)
return false;
else {
@@ -0,0 +1,139 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
* File Created @ [Aug 28, 2015, 5:27:43 PM (GMT)]
*/
package vazkii.botania.common.block.tile.mana;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraftforge.common.util.ForgeDirection;
import vazkii.botania.api.internal.VanillaPacketDispatcher;
import vazkii.botania.common.block.subtile.functional.SubTileExoflame;
import vazkii.botania.common.block.tile.TileMod;
public class TileBellows extends TileMod {
private static final String TAG_ACTIVE = "active";
public float movePos;
public boolean active = false;
public float moving = 0F;
public void interact() {
if(moving == 0F)
setActive(true);
}
@Override
public void updateEntity() {
boolean disable = true;
TileEntity tile = getLinkedTile();
if(!active && tile instanceof TilePool) {
TilePool pool = (TilePool) tile;
boolean transfer = pool.isDoingTransfer;
if(transfer) {
if(!active && pool.ticksDoingTransfer >= getBlockMetadata() * 2 - 2)
setActive(true);
disable = false;
}
}
float max = 0.9F;
float min = 0F;
float incr = max / 20F;
if(movePos < max && active && moving >= 0F) {
if(moving == 0F)
worldObj.playSoundEffect(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, "botania:bellows", 0.1F, 3F);
if(tile instanceof TileEntityFurnace) {
TileEntityFurnace furnace = (TileEntityFurnace) tile;
if(SubTileExoflame.canFurnaceSmelt(furnace)) {
furnace.furnaceCookTime = Math.min(199, furnace.furnaceCookTime + 20);
furnace.furnaceBurnTime = Math.max(0, furnace.furnaceBurnTime - 10);
}
if(furnace.getBlockType() == Blocks.lit_furnace) {
// Copypasta from BlockFurnace
int x = furnace.xCoord;
int y = furnace.yCoord;
int z = furnace.zCoord;
int l = worldObj.getBlockMetadata(x, y, z);
float f = (float)x + 0.5F;
float f1 = (float)y + 0.0F + worldObj.rand.nextFloat() * 6.0F / 16.0F;
float f2 = (float)z + 0.5F;
float f3 = 0.52F;
float f4 = worldObj.rand.nextFloat() * 0.6F - 0.3F;
if(l == 4) {
worldObj.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);
} else if(l == 5) {
worldObj.spawnParticle("smoke", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle("flame", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);
} else if(l == 2) {
worldObj.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D);
} else if(l == 3) {
worldObj.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D);
}
}
}
movePos += incr * 3;
moving = incr * 3;
if(movePos >= max) {
movePos = Math.min(max, movePos);
moving = 0F;
if(disable)
setActive(false);
}
} else if(movePos > min) {
movePos -= incr;
moving = -incr;
if(movePos <= min) {
movePos = Math.max(min, movePos);
moving = 0F;
}
}
super.updateEntity();
}
public TileEntity getLinkedTile() {
int meta = getBlockMetadata();
ForgeDirection dir = ForgeDirection.getOrientation(meta);
return worldObj.getTileEntity(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ);
}
@Override
public void writeCustomNBT(NBTTagCompound cmp) {
cmp.setBoolean(TAG_ACTIVE, active);
}
@Override
public void readCustomNBT(NBTTagCompound cmp) {
active = cmp.getBoolean(TAG_ACTIVE);
}
public void setActive(boolean active) {
if(!worldObj.isRemote) {
boolean diff = this.active != active;
this.active = active;
if(diff)
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord);
}
}
}
@@ -25,8 +25,10 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.ForgeDirection;
import org.lwjgl.opengl.GL11;
@@ -54,6 +56,7 @@ import vazkii.botania.common.core.handler.ManaNetworkHandler;
import vazkii.botania.common.core.helper.Vector3;
import vazkii.botania.common.item.ItemManaTablet;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lib.LibMisc;
public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLocked, ISparkAttachable, IThrottledPacket {
@@ -85,13 +88,15 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc
boolean canAccept = true;
boolean canSpare = true;
public boolean fragile = false;
public boolean isDoingTransfer = false;
public int ticksDoingTransfer = 0;
String inputKey = "";
String outputKey = "";
int ticks = 0;
boolean sendPacket = false;
@Override
public boolean isFull() {
Block blockBelow = worldObj.getBlock(xCoord, yCoord - 1, zCoord);
@@ -181,6 +186,8 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc
@Override
public void updateEntity() {
boolean wasDoingTransfer = isDoingTransfer;
isDoingTransfer = false;
if(manaCap == -1)
manaCap = getBlockMetadata() == 2 ? MAX_MANA_DILLUTED : MAX_MANA;
@@ -217,12 +224,21 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc
if(outputting && mana.canReceiveManaFromPool(stack, this) || !outputting && mana.canExportManaToPool(stack, this)) {
boolean didSomething = false;
int bellowCount = 0;
if(outputting)
for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) {
TileEntity tile = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ);
if(tile != null && tile instanceof TileBellows && ((TileBellows) tile).getLinkedTile() == this)
bellowCount++;
}
int transfRate = 1000 * (bellowCount + 1);
if(outputting) {
if(canSpare) {
if(getCurrentMana() > 0 && mana.getMana(stack) < mana.getMaxMana(stack))
didSomething = true;
int manaVal = Math.min(1000, Math.min(getCurrentMana(), mana.getMaxMana(stack) - mana.getMana(stack)));
int manaVal = Math.min(transfRate, Math.min(getCurrentMana(), mana.getMaxMana(stack) - mana.getMana(stack)));
if(!worldObj.isRemote)
mana.addMana(stack, manaVal);
recieveMana(-manaVal);
@@ -232,7 +248,7 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc
if(mana.getMana(stack) > 0 && !isFull())
didSomething = true;
int manaVal = Math.min(1000, Math.min(manaCap - getCurrentMana(), mana.getMana(stack)));
int manaVal = Math.min(transfRate, Math.min(manaCap - getCurrentMana(), mana.getMana(stack)));
if(!worldObj.isRemote)
mana.addMana(stack, -manaVal);
recieveMana(manaVal);
@@ -245,11 +261,20 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc
Vector3 tileVec = Vector3.fromTileEntity(this).add(0.2 + Math.random() * 0.6, 0, 0.2 + Math.random() * 0.6);
LightningHandler.spawnLightningBolt(worldObj, outputting ? tileVec : itemVec, outputting ? itemVec : tileVec, 80, worldObj.rand.nextLong(), 0x4400799c, 0x4400C6FF);
}
isDoingTransfer = outputting;
}
}
}
}
if(isDoingTransfer)
ticksDoingTransfer++;
else {
ticksDoingTransfer = 0;
if(wasDoingTransfer)
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this);
}
ticks++;
}
@@ -90,8 +90,10 @@ public class TilePump extends TileMod {
public void setActive(boolean active) {
if(!worldObj.isRemote) {
boolean diff = this.active != active;
this.active = active;
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord);
if(diff)
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(worldObj, xCoord, yCoord, zCoord);
}
}
@@ -242,6 +242,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
addBlock(ModBlocks.conjurationCatalyst);
addBlock(ModBlocks.distributor);
addBlock(ModBlocks.manaVoid);
addBlock(ModBlocks.bellows);
addBlock(ModBlocks.manaDetector);
addBlock(ModBlocks.manaBomb);
addBlock(ModBlocks.ghostRail);
@@ -94,6 +94,7 @@ public final class LibBlockNames {
public static final String LIGHT_LAUNCHER = "lightLauncher";
public static final String MANA_BOMB = "manaBomb";
public static final String CACOPHONIUM = "cacophoniumBlock";
public static final String BELLOWS = "bellows";
public static final String SUBTILE_PUREDAISY = "puredaisy";
public static final String SUBTILE_MANASTAR = "manastar";