mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 19:29:31 +00:00
Finished up the Mana Pump and the cart stuff.
This commit is contained in:
1 parent
ab1706ff2c
commit
02d94f2b11
15 files changed
+362
-26
No files matched your search
@@ -55,6 +55,7 @@ import vazkii.botania.client.render.block.RenderBrewery;
|
||||
import vazkii.botania.client.render.block.RenderCorporeaIndex;
|
||||
import vazkii.botania.client.render.block.RenderFloatingFlower;
|
||||
import vazkii.botania.client.render.block.RenderPool;
|
||||
import vazkii.botania.client.render.block.RenderPump;
|
||||
import vazkii.botania.client.render.block.RenderPylon;
|
||||
import vazkii.botania.client.render.block.RenderSpawnerClaw;
|
||||
import vazkii.botania.client.render.block.RenderSpecialFlower;
|
||||
@@ -78,6 +79,7 @@ import vazkii.botania.client.render.tile.RenderTileEnchanter;
|
||||
import vazkii.botania.client.render.tile.RenderTileFloatingFlower;
|
||||
import vazkii.botania.client.render.tile.RenderTilePool;
|
||||
import vazkii.botania.client.render.tile.RenderTilePrism;
|
||||
import vazkii.botania.client.render.tile.RenderTilePump;
|
||||
import vazkii.botania.client.render.tile.RenderTilePylon;
|
||||
import vazkii.botania.client.render.tile.RenderTileRedString;
|
||||
import vazkii.botania.client.render.tile.RenderTileRuneAltar;
|
||||
@@ -103,6 +105,7 @@ import vazkii.botania.common.block.tile.TileTinyPotato;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex;
|
||||
import vazkii.botania.common.block.tile.mana.TilePool;
|
||||
import vazkii.botania.common.block.tile.mana.TilePrism;
|
||||
import vazkii.botania.common.block.tile.mana.TilePump;
|
||||
import vazkii.botania.common.block.tile.mana.TileSpreader;
|
||||
import vazkii.botania.common.block.tile.string.TileRedString;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
@@ -168,6 +171,7 @@ public class ClientProxy extends CommonProxy {
|
||||
LibRenderIDs.idSpawnerClaw = RenderingRegistry.getNextAvailableRenderId();
|
||||
LibRenderIDs.idBrewery = RenderingRegistry.getNextAvailableRenderId();
|
||||
LibRenderIDs.idCorporeaIndex = RenderingRegistry.getNextAvailableRenderId();
|
||||
LibRenderIDs.idPump = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
RenderingRegistry.registerBlockHandler(new RenderAltar());
|
||||
RenderingRegistry.registerBlockHandler(new RenderSpecialFlower(LibRenderIDs.idSpecialFlower));
|
||||
@@ -179,6 +183,7 @@ public class ClientProxy extends CommonProxy {
|
||||
RenderingRegistry.registerBlockHandler(new RenderSpawnerClaw());
|
||||
RenderingRegistry.registerBlockHandler(new RenderBrewery());
|
||||
RenderingRegistry.registerBlockHandler(new RenderCorporeaIndex());
|
||||
RenderingRegistry.registerBlockHandler(new RenderPump());
|
||||
|
||||
RenderTransparentItem renderTransparentItem = new RenderTransparentItem();
|
||||
RenderFloatingFlowerItem renderFloatingFlower = new RenderFloatingFlowerItem();
|
||||
@@ -212,6 +217,7 @@ public class ClientProxy extends CommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileRedString.class, new RenderTileRedString());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TilePrism.class, new RenderTilePrism());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileCorporeaIndex.class, new RenderTileCorporeaIndex());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TilePump.class, new RenderTilePump());
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySkull.class, new RenderTileSkullOverride());
|
||||
|
||||
|
||||
@@ -22,5 +22,6 @@ public final class LibRenderIDs {
|
||||
public static int idSpawnerClaw = -1;
|
||||
public static int idBrewery = -1;
|
||||
public static int idCorporeaIndex = -1;
|
||||
public static int idPump = -1;
|
||||
|
||||
}
|
||||
@@ -103,7 +103,8 @@ public final class LibResources {
|
||||
public static final String MODEL_UNHOLY_CLOAK = PREFIX_MODEL + "unholyCloak.png";
|
||||
public static final String MODEL_CORPOREA_INDEX = PREFIX_MODEL + "corporeaIndex.png";
|
||||
public static final String MODEL_INVISIBLE_ARMOR = PREFIX_MODEL + "invisibleArmor.png";
|
||||
|
||||
public static final String MODEL_PUMP = PREFIX_MODEL + "pump.png";
|
||||
|
||||
public static final String MODEL_CAPE = "/assets/botania/textures/model/cape.png";
|
||||
|
||||
public static final String MISC_PARTICLES = PREFIX_MISC + "particles.png";
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* This class was created by <wiiv>. 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 @ [? (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
public class ModelPump extends ModelBase{
|
||||
|
||||
private ArrayList<ModelRenderer> parts = new ArrayList<ModelRenderer>();
|
||||
|
||||
private ArrayList<ModelRenderer> innerRing = new ArrayList<ModelRenderer>();
|
||||
private ArrayList<ModelRenderer> outerRing = new ArrayList<ModelRenderer>();
|
||||
|
||||
public ModelPump() {
|
||||
textureWidth = 64;
|
||||
textureHeight = 32;
|
||||
|
||||
ModelRenderer main = new ModelRenderer(this, 0, 0);
|
||||
main.addBox(-2.0F, -2.0F, -7.0F, 4, 4, 14);
|
||||
main.setRotationPoint(0.0F, 4.0F, 0.0F);
|
||||
|
||||
for(float r = 0; r <= Math.PI * 2; r += Math.PI) {
|
||||
ModelRenderer side = new ModelRenderer(this, 22, 0);
|
||||
|
||||
side.addBox(-4.0F, -4.0F, 7.0F, 8, 8, 1);
|
||||
side.setRotationPoint(0.0F, 0.0F, 0.0F);
|
||||
side.rotateAngleY = r;
|
||||
main.addChild(side);
|
||||
}
|
||||
|
||||
for(float r = 0; r <= Math.PI * 2; r += Math.PI / 2) {
|
||||
ModelRenderer innerPlate = new ModelRenderer(this, 0, 18);
|
||||
ModelRenderer outerPlate = new ModelRenderer(this, 22, 18);
|
||||
|
||||
innerPlate.addBox(-3.0F, -3.0F, -7.0F, 5, 1, 6);
|
||||
innerPlate.setRotationPoint(0.0F, 4.0F, 0.0F);
|
||||
innerPlate.rotateAngleZ = r;
|
||||
innerRing.add(innerPlate);
|
||||
parts.add(innerPlate);
|
||||
|
||||
|
||||
outerPlate.addBox(-4.0F, -4.0F, 3.0F, 7, 1, 4);
|
||||
outerPlate.setRotationPoint(0.0F, 4.0F, 0.0F);
|
||||
outerPlate.rotateAngleZ = r;
|
||||
outerRing.add(outerPlate);
|
||||
parts.add(outerPlate);
|
||||
}
|
||||
|
||||
parts.add(main);
|
||||
|
||||
}
|
||||
|
||||
public void render(float ringPos) {
|
||||
for(ModelRenderer iRing : innerRing)
|
||||
iRing.rotationPointZ = ringPos;
|
||||
|
||||
for(ModelRenderer part : parts)
|
||||
part.render(1F / 16F);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* 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 @ [Mar 18, 2015, 4:42:08 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.TilePump;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
|
||||
public class RenderPump implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(-0.5F, -0.25F, -0.5F);
|
||||
TileEntityRendererDispatcher.instance.renderTileEntityAt(new TilePump(), 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.idPump;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* 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 @ [Mar 18, 2015, 3:15:38 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.render.tile;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.model.ModelPump;
|
||||
import vazkii.botania.common.block.tile.mana.TilePump;
|
||||
|
||||
public class RenderTilePump extends TileEntitySpecialRenderer {
|
||||
|
||||
private static final float[] ROTATIONS = new float[] {
|
||||
180F, 0F, 90F, 270F
|
||||
};
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_PUMP);
|
||||
private static final ModelPump model = new ModelPump();
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) {
|
||||
TilePump pump = (TilePump) 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 = pump.getWorldObj() != null ? pump.getBlockMetadata() : 0;
|
||||
|
||||
GL11.glTranslatef(0.5F, 0.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(0F, Math.min(8F, pump.innerRingPos + pump.moving * f)));
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
GL11.glScalef(1F, -1F, -1F);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -130,6 +130,7 @@ import vazkii.botania.common.block.tile.mana.TileManaDetector;
|
||||
import vazkii.botania.common.block.tile.mana.TileManaVoid;
|
||||
import vazkii.botania.common.block.tile.mana.TilePool;
|
||||
import vazkii.botania.common.block.tile.mana.TilePrism;
|
||||
import vazkii.botania.common.block.tile.mana.TilePump;
|
||||
import vazkii.botania.common.block.tile.mana.TileRFGenerator;
|
||||
import vazkii.botania.common.block.tile.mana.TileSpreader;
|
||||
import vazkii.botania.common.block.tile.mana.TileTurntable;
|
||||
@@ -340,6 +341,7 @@ public final class ModBlocks {
|
||||
registerTile(TilePrism.class, LibBlockNames.PRISM);
|
||||
registerTile(TileCorporeaIndex.class, LibBlockNames.CORPOREA_INDEX);
|
||||
registerTile(TileCorporeaFunnel.class, LibBlockNames.CORPOREA_FUNNEL);
|
||||
registerTile(TilePump.class, LibBlockNames.PUMP);
|
||||
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_PUREDAISY, SubTilePureDaisy.class);
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_MANASTAR, SubTileManastar.class);
|
||||
|
||||
@@ -10,55 +10,95 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.mana;
|
||||
|
||||
import net.minecraft.block.BlockPistonBase;
|
||||
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.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.common.util.RotationHelper;
|
||||
import vazkii.botania.api.lexicon.ILexiconable;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
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.TilePump;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class BlockPump extends BlockMod {
|
||||
public class BlockPump extends BlockModContainer implements ILexiconable {
|
||||
|
||||
private static final int[][] ICON_ORIENTATIONS = {
|
||||
{ 4, 3, 1, 2 },
|
||||
{ 3, 4, 2, 1 },
|
||||
{ 2, 1, 4, 3 },
|
||||
{ 1, 2, 3, 4 }
|
||||
};
|
||||
private static final int[] META_ROTATIONS = new int[] { 2, 5, 3, 4 };
|
||||
|
||||
IIcon[] icons = new IIcon[5];
|
||||
|
||||
public BlockPump() {
|
||||
super(Material.rock);
|
||||
setHardness(2.0F);
|
||||
setResistance(10.0F);
|
||||
setStepSound(soundTypeStone);
|
||||
setBlockName(LibBlockNames.PUMP);
|
||||
setBlockBounds(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) {
|
||||
int orientation = Math.max(2, BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase));
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, orientation, 1 | 2);
|
||||
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((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 setBlockBoundsBasedOnState(IBlockAccess w, int x, int y, int z) {
|
||||
setBlockBounds(w.getBlockMetadata(x, y, z) < 4);
|
||||
}
|
||||
|
||||
public void setBlockBounds(boolean horiz) {
|
||||
if(horiz)
|
||||
setBlockBounds(0.25F, 0F, 0F, 0.75F, 0.5F, 1F);
|
||||
else setBlockBounds(0F, 0F, 0.25F, 1F, 0.5F, 0.75F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean rotateBlock(World worldObj, int x, int y, int z, ForgeDirection axis) {
|
||||
return RotationHelper.rotateVanillaBlock(Blocks.furnace, worldObj, x, y, z, axis);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
for(int i = 0; i < icons.length; i++)
|
||||
icons[i] = IconHelper.forBlock(par1IconRegister, this, i);
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int par1, int par2) {
|
||||
return par1 < 2 ? icons[0] : icons[ICON_ORIENTATIONS[Math.max(0, par2 - 2)][par1 - 2]];
|
||||
return ModBlocks.livingrock.getIcon(0, 0);
|
||||
}
|
||||
|
||||
public int getOrientation(World w, int x, int y, int z) {
|
||||
return w.getBlockMetadata(x, y, z);
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return LibRenderIDs.idPump;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
|
||||
return LexiconData.poolCart;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TilePump();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* 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 @ [Mar 18, 2015, 3:16:57 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.block.tile.mana;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import vazkii.botania.common.block.tile.TileMod;
|
||||
|
||||
public class TilePump extends TileMod {
|
||||
|
||||
private static final String TAG_ACTIVE = "active";
|
||||
|
||||
public float innerRingPos;
|
||||
public boolean active = false;
|
||||
public boolean hasCart = false;
|
||||
public float moving = 0F;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
float max = 8F;
|
||||
float min = 0F;
|
||||
|
||||
float incr = max / 10F;
|
||||
|
||||
if(innerRingPos < max && active && moving >= 0F) {
|
||||
innerRingPos += incr;
|
||||
moving = incr;
|
||||
if(innerRingPos >= max) {
|
||||
innerRingPos = Math.min(max, innerRingPos);
|
||||
moving = 0F;
|
||||
}
|
||||
} else if(innerRingPos > min) {
|
||||
innerRingPos -= incr * 2;
|
||||
moving = -incr * 2;
|
||||
if(innerRingPos <= min) {
|
||||
innerRingPos = Math.max(min, innerRingPos);
|
||||
moving = 0F;
|
||||
}
|
||||
}
|
||||
|
||||
if(!hasCart && active)
|
||||
setActive(false);
|
||||
hasCart = false;
|
||||
|
||||
super.updateEntity();
|
||||
}
|
||||
|
||||
@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) {
|
||||
this.active = active;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -242,6 +242,8 @@ public final class ModCraftingRecipes {
|
||||
public static IRecipe recipeSnowHorn;
|
||||
public static IRecipe recipeFlowerBag;
|
||||
public static IRecipe recipePhantomInk;
|
||||
public static IRecipe recipePoolCart;
|
||||
public static IRecipe recipePump;
|
||||
|
||||
public static void init() {
|
||||
// Lexicon Recipe
|
||||
@@ -1605,6 +1607,18 @@ public final class ModCraftingRecipes {
|
||||
addShapelessOreDictRecipe(new ItemStack(ModItems.phantomInk, 4), LibOreDict.MANA_PEARL, new ItemStack(Items.dye), new ItemStack(Blocks.glass), new ItemStack(Items.glass_bottle), new ItemStack(Items.glass_bottle), new ItemStack(Items.glass_bottle), new ItemStack(Items.glass_bottle));
|
||||
recipePhantomInk = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Minecart with Mana Pool Recipe
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.poolMinecart), new ItemStack(Items.minecart), new ItemStack(ModBlocks.pool));
|
||||
recipePoolCart = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Mana Pump Recipe
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.pump),
|
||||
"SSS", "IBI", "SSS",
|
||||
'S', LibOreDict.LIVING_ROCK,
|
||||
'I', LibOreDict.MANA_STEEL,
|
||||
'B', new ItemStack(Items.bucket));
|
||||
recipePump = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Storage Block Recipes
|
||||
addOreDictRecipe(new ItemStack(ModBlocks.storage, 1, 0),
|
||||
"III", "III", "III",
|
||||
|
||||
@@ -21,6 +21,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.botania.api.mana.IManaPool;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.mana.TilePool;
|
||||
import vazkii.botania.common.block.tile.mana.TilePump;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
public class EntityPoolMinecart extends EntityMinecart {
|
||||
@@ -95,13 +96,23 @@ public class EntityPoolMinecart extends EntityMinecart {
|
||||
} else if(pumpDir == dir.getOpposite() && !pool.isFull()) { // Cart -> Pool
|
||||
int cartMana = getMana();
|
||||
int transfer = Math.min(TRANSFER_RATE, cartMana);
|
||||
pool.recieveMana(transfer);
|
||||
setMana(cartMana - transfer);
|
||||
did = true;
|
||||
if(transfer > 0) {
|
||||
pool.recieveMana(transfer);
|
||||
setMana(cartMana - transfer);
|
||||
did = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(did)
|
||||
if(did) {
|
||||
worldObj.markBlockForUpdate(xp_, y, zp_);
|
||||
TileEntity tile_ = worldObj.getTileEntity(xp, y, zp);
|
||||
if(tile_ != null && tile_ instanceof TilePump) {
|
||||
TilePump pump = (TilePump) tile_;
|
||||
pump.hasCart = true;
|
||||
if(!pump.active)
|
||||
pump.setActive(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,8 @@ public final class LexiconData {
|
||||
public static LexiconEntry sparkUpgrades;
|
||||
public static LexiconEntry rfGenerator;
|
||||
public static LexiconEntry prism;
|
||||
|
||||
public static LexiconEntry poolCart;
|
||||
|
||||
public static LexiconEntry functionalIntro;
|
||||
public static LexiconEntry jadedAmaranthus;
|
||||
public static LexiconEntry bellethorne;
|
||||
@@ -371,6 +372,9 @@ public final class LexiconData {
|
||||
prism = new ALexiconEntry(LibLexicon.MANA_PRISM, categoryMana);
|
||||
prism.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipePrism));
|
||||
|
||||
poolCart = new BLexiconEntry(LibLexicon.MANA_POOL_CART, categoryMana);
|
||||
poolCart.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipePoolCart), new PageCraftingRecipe("4", ModCraftingRecipes.recipePump));
|
||||
|
||||
// FUNCTIONAL FLOWERS ENTRIES
|
||||
functionalIntro = new BLexiconEntry(LibLexicon.FFLOWER_INTRO, categoryFunctionalFlowers);
|
||||
functionalIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageCraftingRecipe("4", ModCraftingRecipes.recipeRedstoneRoot)).setIcon(null);;
|
||||
|
||||
@@ -56,6 +56,7 @@ public final class LibLexicon {
|
||||
public static final String MANA_SPARKS = "sparks";
|
||||
public static final String MANA_SPARK_UPGRADES = "sparkUpgrades";
|
||||
public static final String MANA_PRISM = "prism";
|
||||
public static final String MANA_POOL_CART = "poolCart";
|
||||
|
||||
public static final String FFLOWER_INTRO = "fIntro";
|
||||
public static final String FFLOWER_JADED_AMARANTHUS = "jadedAmaranthus";
|
||||
|
||||
Reference in new issue
Block a user