Pass a cleanup...

This commit is contained in:
Vasco Lavos committed 2014-04-27 22:24:46 +01:00
1 parent b67a452346
commit da52e52d17
90 files changed
+416 -479

No files matched your search

@@ -21,5 +21,5 @@ import net.minecraft.world.World;
public interface IWireframeAABBProvider {
public AxisAlignedBB getWireframeAABB(World world, int x, int y, int z);
}
@@ -63,7 +63,7 @@ public interface IInternalMethodHandler {
public IIcon getSubTileIconForName(String name);
public IInventory getBaublesInventory(EntityPlayer player);
@SideOnly(Side.CLIENT)
public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res);
+1 -3
View File
@@ -12,8 +12,6 @@
package vazkii.botania.api.mana;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import vazkii.botania.api.internal.IManaBurst;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -30,7 +28,7 @@ public interface ILens extends ILensEffect {
* for both the ILens instance of ItemStack.getItem() of sourceLens and compositeLens.
*/
public boolean canCombineLenses(ItemStack sourceLens, ItemStack compositeLens);
/**
* Gets the composite lens in the stack passed in, return null for none.
*/
@@ -45,5 +45,5 @@ public interface ILensEffect {
* do any particles.
*/
public boolean doParticles(IManaBurst burst, ItemStack stack);
}
@@ -12,7 +12,6 @@
package vazkii.botania.api.mana;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@@ -35,7 +34,7 @@ public final class ManaItemHandler {
IInventory mainInv = player.inventory;
IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player);
List<ItemStack> stacks = new ArrayList();
new ArrayList();
int invSize = mainInv.getSizeInventory();
int size = invSize;
if(baublesInv != null)
@@ -81,7 +80,7 @@ public final class ManaItemHandler {
IInventory mainInv = player.inventory;
IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player);
List<ItemStack> stacks = new ArrayList();
new ArrayList();
int invSize = mainInv.getSizeInventory();
int size = invSize;
if(baublesInv != null)
@@ -110,7 +109,7 @@ public final class ManaItemHandler {
return false;
}
/**
* Dispatches mana to items in a given player's inventory. Note that this method
* does not automatically remove mana from the item which is exporting.
@@ -124,8 +123,8 @@ public final class ManaItemHandler {
IInventory mainInv = player.inventory;
IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player);
List<ItemStack> stacks = new ArrayList();
new ArrayList();
int invSize = mainInv.getSizeInventory();
int size = invSize;
if(baublesInv != null)
@@ -140,16 +139,16 @@ public final class ManaItemHandler {
if(stackInSlot != null && stackInSlot.getItem() instanceof IManaItem) {
IManaItem manaItemSlot = (IManaItem) stackInSlot.getItem();
if(manaItemSlot.canReceiveManaFromItem(stackInSlot, stack)) {
if(stack.getItem() instanceof IManaItem && !((IManaItem) stack.getItem()).canExportManaToItem(stack, stackInSlot))
continue;
int received = 0;
if(manaItemSlot.getMana(stackInSlot) + manaToSend <= manaItemSlot.getMaxMana(stackInSlot))
received = manaToSend;
else received = manaToSend - (manaItemSlot.getMana(stackInSlot) + manaToSend - manaItemSlot.getMaxMana(stackInSlot));
if(add)
manaItemSlot.addMana(stackInSlot, manaToSend);
@@ -161,7 +160,7 @@ public final class ManaItemHandler {
return 0;
}
/**
* Dispatches an exact amount of mana to items in a given player's inventory. Note that this method
* does not automatically remove mana from the item which is exporting.
@@ -175,8 +174,8 @@ public final class ManaItemHandler {
IInventory mainInv = player.inventory;
IInventory baublesInv = BotaniaAPI.internalHandler.getBaublesInventory(player);
List<ItemStack> stacks = new ArrayList();
new ArrayList();
int invSize = mainInv.getSizeInventory();
int size = invSize;
if(baublesInv != null)
@@ -61,9 +61,9 @@ public class SubTileEntity {
public void readFromPacketNBT(NBTTagCompound cmp) { }
public void sync() {
supertile.getWorldObj().markBlockForUpdate(supertile.xCoord, supertile.yCoord, supertile.zCoord);
supertile.getWorldObj().markBlockForUpdate(supertile.xCoord, supertile.yCoord, supertile.zCoord);
}
public String getUnlocalizedName() {
return BotaniaAPI.getSubTileStringMapping(getClass());
}
@@ -42,7 +42,7 @@ public class CapeHandler {
if(Loader.isModLoaded("shadersmod"))
return;
if(event.entityPlayer instanceof AbstractClientPlayer && (event.entityPlayer.getCommandSenderName().equals("Vazkii"))) {
if(event.entityPlayer instanceof AbstractClientPlayer && event.entityPlayer.getCommandSenderName().equals("Vazkii")) {
AbstractClientPlayer abstractClientPlayer = (AbstractClientPlayer) event.entityPlayer;
if (!capePlayers.contains(abstractClientPlayer)) {
@@ -12,7 +12,6 @@
package vazkii.botania.client.core.handler;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import net.minecraft.client.Minecraft;
@@ -25,7 +24,6 @@ import vazkii.botania.client.core.handler.LightningHandler.LightningBolt;
import vazkii.botania.client.gui.GuiLexicon;
import vazkii.botania.common.core.handler.ManaNetworkHandler;
import vazkii.botania.common.item.ItemTwigWand;
import vazkii.botania.common.lib.LibMisc;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
@@ -48,7 +46,7 @@ public class ClientTickHandler {
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
if(gui == null || !gui.doesGuiPauseGame()) {
ticksInGame++;
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
if(player != null) {
ItemStack stack = player.getCurrentEquippedItem();
@@ -35,10 +35,10 @@ import net.minecraftforge.client.event.RenderWorldLastEvent;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import vazkii.botania.client.core.handler.LightningHandler.LightningBolt.Segment;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.core.helper.Vector3;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class LightningHandler {
@@ -27,7 +27,6 @@ import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.core.handler.ConfigHandler;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
public final class ShaderHelper {
@@ -41,7 +40,7 @@ public final class ShaderHelper {
public static void initShaders() {
if(!useShaders())
return;
pylonGlow = createProgram(null, LibResources.SHADER_PYLON_GLOW_FRAG);
enchanterRune = createProgram(null, LibResources.SHADER_ENCHANTER_RUNE_FRAG);
manaPool = createProgram(null, LibResources.SHADER_MANA_POOL_FRAG);
@@ -50,9 +49,9 @@ public final class ShaderHelper {
public static void useShader(int shader) {
if(!useShaders())
return;
ARBShaderObjects.glUseProgramObjectARB(shader);
if(shader != 0) {
int time = ARBShaderObjects.glGetUniformLocationARB(shader, "time");
ARBShaderObjects.glUniform1iARB(time, ClientTickHandler.ticksInGame);
@@ -62,11 +61,11 @@ public final class ShaderHelper {
public static void releaseShader() {
useShader(0);
}
public static boolean useShaders() {
return ConfigHandler.useShaders && OpenGlHelper.shadersSupported;
}
// Most of the code taken from the LWJGL wiki
// http://lwjgl.org/wiki/index.php?title=GLSL_Shaders_with_LWJGL
@@ -91,13 +90,13 @@ public final class ShaderHelper {
FMLLog.log(Level.ERROR, getLogInfo(program));
return 0;
}
ARBShaderObjects.glValidateProgramARB(program);
if (ARBShaderObjects.glGetObjectParameteriARB(program, ARBShaderObjects.GL_OBJECT_VALIDATE_STATUS_ARB) == GL11.GL_FALSE) {
FMLLog.log(Level.ERROR, getLogInfo(program));
return 0;
}
return program;
}
@@ -136,7 +135,7 @@ public final class ShaderHelper {
if(in == null)
return "";
try {
reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
@@ -55,7 +55,6 @@ import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.relauncher.Side;
public class ClientProxy extends CommonProxy {
@@ -96,7 +95,7 @@ public class ClientProxy extends CommonProxy {
ClientRegistry.bindTileEntitySpecialRenderer(TileRuneAltar.class, new RenderTileRuneAltar());
ClientRegistry.bindTileEntitySpecialRenderer(TilePylon.class, new RenderTilePylon());
ClientRegistry.bindTileEntitySpecialRenderer(TileEnchanter.class, new RenderTileEnchanter());
ShaderHelper.initShaders();
}
@@ -23,7 +23,7 @@ public final class LibResources {
public static final String PREFIX_MODEL = PREFIX_MOD + "textures/model/";
public static final String PREFIX_MISC = PREFIX_MOD + "textures/misc/";
public static final String PREFIX_OBJ_MODEL = PREFIX_MOD + "model/";
public static final String EMTPY_TEXTURE = "emptyTexture";
public static final String GUI_MANA_HUD = PREFIX_GUI + "manaHud.png";
@@ -57,7 +57,7 @@ public final class LibResources {
public static final String MODEL_MANASTEEL_1 = PREFIX_MODEL + "manasteel1.png";
public static final String MODEL_TERRASTEEL_0 = PREFIX_MODEL + "terrasteel0.png";
public static final String MODEL_TERRASTEEL_1 = PREFIX_MODEL + "terrasteel1.png";
public static final String MODEL_CAPE = "/assets/botania/textures/model/cape.png";
public static final String MISC_PARTICLES = PREFIX_MISC + "particles.png";
@@ -65,7 +65,7 @@ public final class LibResources {
public static final String MISC_WISP_SMALL = PREFIX_MISC + "wispSmall.png";
public static final String OBJ_MODEL_PYLON = PREFIX_OBJ_MODEL + "pylon.obj";
public static final String SHADER_PYLON_GLOW_FRAG = PREFIX_SHADER + "pylon_glow.frag";
public static final String SHADER_ENCHANTER_RUNE_FRAG = PREFIX_SHADER + "enchanter_rune.frag";
public static final String SHADER_MANA_POOL_FRAG = PREFIX_SHADER + "mana_pool.frag";
@@ -16,5 +16,5 @@ public interface IPylonModel {
public void renderCrystal();
public void renderRing();
public void renderGems();
}
@@ -14,18 +14,16 @@ package vazkii.botania.client.model;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import net.minecraftforge.client.model.obj.GroupObject;
import net.minecraftforge.client.model.obj.WavefrontObject;
import vazkii.botania.client.lib.LibResources;
public class ModelPylon implements IPylonModel {
private IModelCustom model;
public ModelPylon() {
model = AdvancedModelLoader.loadModel(new ResourceLocation(LibResources.OBJ_MODEL_PYLON));
}
@Override
public void renderCrystal() {
model.renderPart("Crystal");
@@ -35,7 +33,7 @@ public class ModelPylon implements IPylonModel {
public void renderRing() {
model.renderAllExcept("Crystal", "Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04");
}
@Override
public void renderGems() {
for(int i = 1; i < 5; i++)
@@ -15,7 +15,6 @@ import java.awt.Color;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.item.ItemStack;
@@ -13,7 +13,6 @@ package vazkii.botania.client.render.tile;
import java.awt.Color;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.Tessellator;
@@ -28,7 +28,6 @@ import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.helper.ShaderHelper;
import vazkii.botania.common.block.BlockEnchanter;
import vazkii.botania.common.block.tile.TileEnchanter;
import vazkii.botania.common.core.handler.ConfigHandler;
public class RenderTileEnchanter extends TileEntitySpecialRenderer {
@@ -98,7 +97,7 @@ public class RenderTileEnchanter extends TileEntitySpecialRenderer {
ShaderHelper.useShader(ShaderHelper.enchanterRune);
renderIcon(0, 0, BlockEnchanter.overlay, 5, 5, 240);
ShaderHelper.releaseShader();
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glDisable(GL11.GL_BLEND);
GL11.glColor4f(1F, 1F, 1F, 1F);
@@ -36,7 +36,7 @@ public class RenderTilePool extends TileEntitySpecialRenderer {
private static final ModelPool model = new ModelPool();
RenderItem renderItem = new RenderItem();
public static boolean forceAllMana = false;
@Override
@@ -48,7 +48,7 @@ public class RenderTilePool extends TileEntitySpecialRenderer {
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glTranslated(d0, d1, d2);
boolean inf = tileentity.getWorldObj() == null ? forceAllMana : tileentity.getBlockMetadata() == 1;
Minecraft.getMinecraft().renderEngine.bindTexture(inf ? textureInf : texture);
GL11.glTranslatef(0.5F, 1.5F, 0.5F);
@@ -90,7 +90,7 @@ public class RenderTilePool extends TileEntitySpecialRenderer {
tessellator.addVertexWithUV(par1 + par4, par2 + par5, zLevel, par3Icon.getMaxU(), par3Icon.getMaxV());
tessellator.addVertexWithUV(par1 + par4, par2 + 0, zLevel, par3Icon.getMaxU(), par3Icon.getMinV());
tessellator.addVertexWithUV(par1 + 0, par2 + 0, zLevel, par3Icon.getMinU(), par3Icon.getMinV());
ShaderHelper.useShader(ShaderHelper.manaPool);
tessellator.draw();
ShaderHelper.releaseShader();
@@ -49,7 +49,7 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
random = new Random();
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
// NO-OP
@@ -66,7 +66,7 @@ public class BlockEnchanter extends BlockModContainer implements IWandable, ILex
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
return Item.getItemFromBlock(Blocks.lapis_block);
}
@Override
public boolean isOpaqueCube() {
return false;
@@ -13,8 +13,6 @@ package vazkii.botania.common.block;
import java.util.List;
import javax.swing.Icon;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -14,8 +14,6 @@ package vazkii.botania.common.block;
import java.util.List;
import java.util.Random;
import javax.swing.Icon;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFlower;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -13,7 +13,6 @@ package vazkii.botania.common.block;
import java.util.ArrayList;
import java.util.Collection;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -13,7 +13,6 @@ package vazkii.botania.common.block;
import java.util.List;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
@@ -35,9 +34,9 @@ import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.client.lib.LibRenderIDs;
import vazkii.botania.common.block.tile.TilePool;
import vazkii.botania.common.item.block.ItemBlockPool;
import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import cpw.mods.fml.common.registry.GameRegistry;
public class BlockPool extends BlockModContainer implements IWandHUD, IWandable, ILexiconable {
@@ -49,7 +48,7 @@ public class BlockPool extends BlockModContainer implements IWandHUD, IWandable,
setBlockName(LibBlockNames.POOL);
setBlockBounds(0F, 0F, 0F, 1F, 0.5F, 1F);
}
@Override
protected boolean shouldRegisterInNameSet() {
return false;
@@ -60,12 +59,12 @@ public class BlockPool extends BlockModContainer implements IWandHUD, IWandable,
GameRegistry.registerBlock(this, ItemBlockPool.class, par1Str);
return super.setBlockName(par1Str);
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
// NO-OP
}
@Override
public void getSubBlocks(Item par1, CreativeTabs par2, List par3) {
for(int i = 0; i < 2; i++)
@@ -37,7 +37,7 @@ public class BlockPylon extends BlockModContainer implements ILexiconable {
float f = 1F / 16F * 2F;
setBlockBounds(f, 0F, f, 1F - f, 1F / 16F * 21F, 1F - f);
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
// NO-OP
@@ -48,7 +48,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvider, ISpecialFlower, IWandable, ILexiconable, IWandHUD {
public static Map<String, IIcon> icons = new HashMap();
private static String[] subtypes = {
// Misc
LibBlockNames.SUBTILE_PUREDAISY,
@@ -14,7 +14,6 @@ package vazkii.botania.common.block;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.BlockPistonBase;
import net.minecraft.block.material.Material;
@@ -25,7 +24,6 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -44,6 +42,7 @@ import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import cpw.mods.fml.common.registry.GameRegistry;
public class BlockSpreader extends BlockModContainer implements IWandable, IWandHUD, ILexiconable {
@@ -57,7 +56,7 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand
random = new Random();
}
@Override
protected boolean shouldRegisterInNameSet() {
return false;
@@ -73,19 +72,19 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand
public void registerBlockIcons(IIconRegister par1IconRegister) {
// NO-OP
}
@Override
public void getSubBlocks(Item par1, CreativeTabs par2, List par3) {
for(int i = 0; i < 2; i++)
par3.add(new ItemStack(par1, 1, i));
}
@Override
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) {
int orientation = BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase);
TileSpreader spreader = (TileSpreader) par1World.getTileEntity(par2, par3, par4);
par1World.setBlockMetadataWithNotify(par2, par3, par4, par6ItemStack.getItemDamage() & 1, 1 | 2);
switch(orientation) {
case 0:
spreader.rotationY = -90F;
@@ -106,12 +105,12 @@ public class BlockSpreader extends BlockModContainer implements IWandable, IWand
break;
}
}
@Override
public int damageDropped(int par1) {
return par1;
}
@Override
public boolean isOpaqueCube() {
return false;
@@ -12,7 +12,6 @@
package vazkii.botania.common.block;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.api.BotaniaAPI;
@@ -168,7 +168,7 @@ public class SubTileHopperhock extends SubTileFunctional {
if(player.isSneaking()) {
filterType = filterType == 2 ? 0 : filterType + 1;
sync();
return true;
}
else return super.onWanded(player, wand);
@@ -47,7 +47,7 @@ public class SubTileJadedAmaranthus extends SubTileFunctional {
mana -= COST;
sync();
cooldown = 30;
break;
}
@@ -11,17 +11,7 @@
*/
package vazkii.botania.common.block.subtile.functional;
import java.util.List;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.subtile.SubTileFunctional;
import vazkii.botania.common.Botania;
import vazkii.botania.common.core.helper.MathHelper;
import vazkii.botania.common.core.helper.Vector3;
import vazkii.botania.common.lexicon.LexiconData;
public class SubTileJiyuulia extends SubTileTangleberrie {
@@ -30,25 +20,25 @@ public class SubTileJiyuulia extends SubTileTangleberrie {
double getMaxDistance() {
return 0;
}
@Override
double getRange() {
return 8;
}
@Override
float getMotionVelocity() {
return -super.getMotionVelocity() * 2;
}
@Override
public int getColor() {
return 0xBD9ACA;
}
@Override
public LexiconEntry getEntry() {
return LexiconData.jiyuulia;
}
}
@@ -16,7 +16,6 @@ import java.util.List;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.subtile.SubTileFunctional;
import vazkii.botania.common.Botania;
@@ -37,56 +36,56 @@ public class SubTileTangleberrie extends SubTileFunctional {
double maxDist = getMaxDistance();
double range = getRange();
AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(x1 - range, y1 - range, z1 - range, x1 + range, y1 + range, z1 + range);
List<EntityLivingBase> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, boundingBox);
for(EntityLivingBase entity : entities) {
if(entity instanceof EntityPlayer)
continue;
double x2 = entity.posX;
double y2 = entity.posY;
double z2 = entity.posZ;
float distance = MathHelper.pointDistanceSpace(x1, y1, z1, x2, y2, z2);
if(distance > maxDist && distance < range) {
MathHelper.setEntityMotionFromVector(entity, new Vector3(x1, y1, z1), getMotionVelocity());
if(supertile.getWorldObj().rand.nextInt(3) == 0)
Botania.proxy.sparkleFX(supertile.getWorldObj(), x2 + Math.random() * entity.width, y2 + Math.random() * entity.height, z2 + Math.random() * entity.width, 0.5F, 0.5F, 0.5F, 1F, 3);
}
}
if(supertile.getWorldObj().getTotalWorldTime() % 4 == 0) {
mana--;
sync();
}
}
}
double getMaxDistance() {
return 6;
}
double getRange() {
return 7;
}
float getMotionVelocity() {
return 0.05F;
}
@Override
public int getColor() {
return 0x4B797C;
}
@Override
public int getMaxMana() {
return 20;
}
@Override
public LexiconEntry getEntry() {
return LexiconData.tangleberrie;
@@ -17,7 +17,6 @@ import java.util.List;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Items;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
@@ -82,7 +82,7 @@ public class TileEnchanter extends TileMod implements IManaReceiver {
if(item.getItem() == Items.enchanted_book) {
NBTTagList enchants = Items.enchanted_book.func_92110_g(item);
if(enchants != null && enchants.tagCount() > 0) {
NBTTagCompound enchant = (NBTTagCompound) enchants.getCompoundTagAt(0);
NBTTagCompound enchant = enchants.getCompoundTagAt(0);
short id = enchant.getShort("id");
if(isEnchantmentValid(id)) {
advanceStage();
@@ -125,7 +125,7 @@ public class TileEnchanter extends TileMod implements IManaReceiver {
if(item.getItem() == Items.enchanted_book) {
NBTTagList enchants = Items.enchanted_book.func_92110_g(item);
if(enchants != null && enchants.tagCount() > 0) {
NBTTagCompound enchant = (NBTTagCompound) enchants.getCompoundTagAt(0);
NBTTagCompound enchant = enchants.getCompoundTagAt(0);
short enchantId = enchant.getShort("id");
short enchantLvl = enchant.getShort("lvl");
if(!hasEnchantAlready(enchantId)) {
@@ -11,8 +11,6 @@
*/
package vazkii.botania.common.block.tile;
import ibxm.Player;
import java.awt.Color;
import java.util.List;
@@ -12,7 +12,6 @@
package vazkii.botania.common.block.tile;
import java.util.List;
import java.util.concurrent.Callable;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
@@ -36,7 +35,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
int manaToGet = 0;
int mana = 0;
public boolean addItem(EntityPlayer player, ItemStack stack) {
if(stack.getItem() == ModItems.twigWand || stack.getItem() == ModItems.lexicon || manaToGet != 0)
return false;
@@ -26,7 +26,7 @@ public abstract class TileSimpleInventory extends TileMod implements IInventory
NBTTagList var2 = par1NBTTagCompound.getTagList("Items", 10);
inventorySlots = new ItemStack[getSizeInventory()];
for (int var3 = 0; var3 < var2.tagCount(); ++var3) {
NBTTagCompound var4 = (NBTTagCompound) var2.getCompoundTagAt(var3);
NBTTagCompound var4 = var2.getCompoundTagAt(var3);
byte var5 = var4.getByte("Slot");
if (var5 >= 0 && var5 < inventorySlots.length)
inventorySlots[var5] = ItemStack.loadItemStackFromNBT(var4);
@@ -11,7 +11,6 @@
*/
package vazkii.botania.common.block.tile;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.entity.player.EntityPlayer;
@@ -16,7 +16,7 @@ import vazkii.botania.common.Botania;
public class TileSpiritShrine extends TileMod {
int ticks;
@Override
public void updateEntity() {
if(worldObj.isRemote) {
@@ -29,14 +29,14 @@ public class TileSpiritShrine extends TileMod {
{ 1F, 0.25F, 1F },
{ 0.25F, 1F, 1F }
};
int totalSpiritCount = 6;
double tickIncrement = 360D / totalSpiritCount;
int liftTicks = 40 * (totalSpiritCount + 1);
int existTicks = liftTicks * 2;
int lowerTicks = existTicks + liftTicks;
if(ticks < lowerTicks) {
int speed = 5;
double wticks = ticks * speed - tickIncrement;
@@ -45,7 +45,7 @@ public class TileSpiritShrine extends TileMod {
for(int i = 0; i < totalSpiritCount; i++) {
double x = xCoord + Math.sin(wticks * Math.PI / 180) * r + 0.5;
double y = yCoord + ((ticks > existTicks ? 40 - (double) (ticks - existTicks) : Math.min(80 + 40 * i, ticks) - 40 * (i + 1)) * 0.1);
double y = yCoord + (ticks > existTicks ? 40 - (double) (ticks - existTicks) : Math.min(80 + 40 * i, ticks) - 40 * (i + 1)) * 0.1;
double z = zCoord + Math.cos(wticks * Math.PI / 180) * r + 0.5;
wticks += tickIncrement;
@@ -55,9 +55,9 @@ public class TileSpiritShrine extends TileMod {
}
}
}
++ticks;
}
}
}
@@ -58,7 +58,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
private static final String TAG_ROTATION_Y = "rotationY";
public static boolean staticRedstone = false;
int mana;
int knownMana = -1;
public float rotationX, rotationY;
@@ -68,13 +68,13 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
IManaReceiver receiver = null;
boolean redstoneLastTick = false;
boolean redstoneLastTick = false;
public boolean canShootBurst = true;
public int lastBurstDeathTick = -1;
public int burstParticleTick = 0;
List<PositionProperties> lastTentativeBurst;
@Override
public boolean isFull() {
return mana >= MAX_MANA;
@@ -128,13 +128,13 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
checkForReceiver();
boolean shouldShoot = !redstone;
if(isRedstone())
shouldShoot = redstone && !redstoneLastTick;
if(shouldShoot)
tryShootBurst();
redstoneLastTick = redstone;
}
@@ -158,7 +158,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
if(cmp.hasKey(TAG_KNOWN_MANA))
knownMana = cmp.getInteger(TAG_KNOWN_MANA);
if(worldObj != null && worldObj.isRemote)
hasReceivedInitialPacket = true;
}
@@ -213,7 +213,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
private boolean needsNewBurstSimulation() {
if(worldObj.isRemote && !hasReceivedInitialPacket)
return false;
if(lastTentativeBurst == null)
return true;
@@ -231,7 +231,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
public void tryShootBurst() {
if(receiver != null || isRedstone()) {
if(canShootBurst && (isRedstone() || (receiver.canRecieveManaFromBursts() && !receiver.isFull()))) {
if(canShootBurst && (isRedstone() || receiver.canRecieveManaFromBursts() && !receiver.isFull())) {
EntityManaBurst burst = getBurst(false);
if(burst != null) {
if(!worldObj.isRemote) {
@@ -245,7 +245,7 @@ public class TileSpreader extends TileSimpleInventory implements IManaCollector,
}
}
}
public boolean isRedstone() {
return worldObj == null ? staticRedstone : (getBlockMetadata() & 1) == 1;
}
@@ -34,7 +34,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
public ItemStack getIconItemStack() {
return new ItemStack(ModBlocks.flower);
}
@Override
public Item getTabIconItem() {
return getIconItemStack().getItem();
@@ -72,7 +72,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
addBlock(ModBlocks.unstableBlock);
addBlock(ModBlocks.manaBeacon);
addItem(ModItems.signalFlare);
addItem(ModItems.manasteelPick);
addItem(ModItems.manasteelShovel);
addItem(ModItems.manasteelAxe);
@@ -87,7 +87,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
addItem(ModItems.terrasteelChest);
addItem(ModItems.terrasteelLegs);
addItem(ModItems.terrasteelBoots);
addItem(ModItems.tinyPlanet);
addItem(ModItems.manaRing);
addItem(ModItems.auraRing);
@@ -11,7 +11,6 @@
*/
package vazkii.botania.common.core.handler;
import net.minecraft.block.Block;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType;
import vazkii.botania.common.block.ModBlocks;
@@ -36,7 +36,7 @@ public final class CommonTickHandler {
TerrasteelCraftingHandler.onEntityUpdate((EntityItem) entity);
}
}
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onTick(ClientTickEvent event) {
@@ -51,5 +51,5 @@ public final class CommonTickHandler {
}
}
}
@@ -37,13 +37,13 @@ public final class ConfigHandler {
config.load();
String desc;
desc = "Set to false to disable the use of shaders for some of the mod's renders.";
useShaders = loadPropBool("shaders.enabled", desc, useShaders);
desc = "Set to false to disable the rotating items in the petal and rune entries in the Lexica Botania.";
lexiconRotatingItems = loadPropBool("lexicon.enable.rotatingItems", desc, lexiconRotatingItems);
desc = "Set to true to set the power system's particles to be a lot more subtle. Good for low-end systems, if the particles are causing lag.";
subtlePowerSystem = loadPropBool("powerSystem.subtle", desc, subtlePowerSystem);
@@ -58,13 +58,13 @@ public final class ConfigHandler {
desc = "Set to true to use the old (non-.obj, pre beta18) pylon model";
oldPylonModel = loadPropBool("pylonModel.old", desc, oldPylonModel);
desc = "The frequency in which particles spawn from normal (worldgen) mystical flowers";
flowerParticleFrequency = loadPropDouble("flowerParticles.frequency", desc, flowerParticleFrequency);
flowerQuantity = loadPropInt("worldgen.flower.quantity", null, 3);
flowerDensity = loadPropInt("worldgen.flower.density", null, 32);
config.save();
}
@@ -73,13 +73,13 @@ public final class ConfigHandler {
prop.comment = desc;
return prop.getInt(default_);
}
public static double loadPropDouble(String propName, String desc, double default_) {
Property prop = config.get(Configuration.CATEGORY_GENERAL, propName, default_);
prop.comment = desc;
return prop.getDouble(default_);
}
public static boolean loadPropBool(String propName, String desc, boolean default_) {
Property prop = config.get(Configuration.CATEGORY_GENERAL, propName, default_);
prop.comment = desc;
@@ -107,7 +107,7 @@ public class InternalMethodHandler implements IInternalMethodHandler {
public IManaNetwork getManaNetworkInstance() {
return ManaNetworkHandler.instance;
}
@Override
public IInventory getBaublesInventory(EntityPlayer player) {
return PlayerHandler.getPlayerBaubles(player);
@@ -16,24 +16,20 @@ import java.util.List;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityBeacon;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.event.entity.EntityEvent;
import vazkii.botania.api.mana.IManaPool;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.tile.TilePool;
import vazkii.botania.common.core.helper.ItemNBTHelper;
import vazkii.botania.common.item.ModItems;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public final class TerrasteelCraftingHandler {
private static final String TAG_TIME = "Botania-CraftingTime";
private static final int TIME = 100;
private static final int MANA_PER_TICK = (int) ((TilePool.MAX_MANA / 2 / TIME) * 0.9);
private static final int MANA_PER_TICK = (int) (TilePool.MAX_MANA / 2 / TIME * 0.9);
public static void onEntityUpdate(EntityItem item) {
ItemStack stack = item.getEntityItem();
@@ -81,7 +77,7 @@ public final class TerrasteelCraftingHandler {
if(beacon.getLevels() <= 0)
return -1;
List<EntityItem> items = item.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1));
List<EntityItem> items = item.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1));
EntityItem diamond = null;
EntityItem pearl = null;
@@ -95,7 +91,7 @@ public final class TerrasteelCraftingHandler {
int meta = stack.getItemDamage();
if(meta == 1) {
if(pearl == null) {
pearl = otherItem;
pearl = otherItem;
continue;
} else return -1;
} else if(meta == 2) {
@@ -142,7 +138,7 @@ public final class TerrasteelCraftingHandler {
int speed = 5;
double wticks = ticks * speed - tickIncrement;
double r = Math.sin((double) (ticks - TIME) / 10D) * 2;
double r = Math.sin((ticks - TIME) / 10D) * 2;
double g = Math.sin(wticks * Math.PI / 180 * 0.55);
for(int i = 0; i < totalSpiritCount; i++) {
@@ -179,7 +175,7 @@ public final class TerrasteelCraftingHandler {
int y = (int) item.posY;
int z = (int) item.posZ;
List<EntityItem> items = item.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1));
List<EntityItem> items = item.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1));
for(EntityItem otherItem : items)
if(otherItem != item)
otherItem.setDead();
@@ -273,7 +273,7 @@ public class InventoryHelper {
NBTTagList nbttaglist = tag.getTagList("Items", 10);
inventoryContents = new ItemStack[slotsCount];
for(int i = 0; i < nbttaglist.tagCount(); i++) {
NBTTagCompound stacktag = (NBTTagCompound)nbttaglist.getCompoundTagAt(i);
NBTTagCompound stacktag = nbttaglist.getCompoundTagAt(i);
int j = stacktag.getByte("Slot");
if(j >= 0 && j < inventoryContents.length)
inventoryContents[j] = ItemStack.loadItemStackFromNBT(stacktag);
@@ -30,5 +30,5 @@ public final class MathHelper {
entity.motionY = finalVector.y * modifier;
entity.motionZ = finalVector.z * modifier;
}
}
@@ -23,7 +23,6 @@ import vazkii.botania.common.core.handler.CommonTickHandler;
import vazkii.botania.common.core.handler.ConfigHandler;
import vazkii.botania.common.core.handler.InternalMethodHandler;
import vazkii.botania.common.core.handler.ManaNetworkHandler;
import vazkii.botania.common.core.handler.TerrasteelCraftingHandler;
import vazkii.botania.common.core.helper.Vector3;
import vazkii.botania.common.crafting.ModCrafingRecipes;
import vazkii.botania.common.crafting.ModManaInfusionRecipes;
@@ -63,7 +62,7 @@ public class CommonProxy {
MinecraftForge.TERRAIN_GEN_BUS.register(new BiomeDecorationHandler());
MinecraftForge.EVENT_BUS.register(ManaNetworkHandler.instance);
FMLCommonHandler.instance().bus().register(new CommonTickHandler());
}
@@ -98,7 +97,7 @@ public class CommonProxy {
public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size, float gravity) {
wispFX(world, x, y, z, r, gravity, b, size, gravity, 1F);
}
public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size, float gravity, float maxAgeMul) {
wispFX(world, x, y, z, r, g, b, size, 0, -gravity, 0, maxAgeMul);
}
@@ -106,7 +105,7 @@ public class CommonProxy {
public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size, float motionx, float motiony, float motionz) {
wispFX(world, x, y, z, r, g, b, size, motionx, motiony, motionz, 1F);
}
public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size, float motionx, float motiony, float motionz, float maxAgeMul) {
// NO-OP
}
@@ -13,11 +13,8 @@ package vazkii.botania.common.crafting;
import java.util.List;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
@@ -30,6 +27,7 @@ import vazkii.botania.common.item.ItemSignalFlare;
import vazkii.botania.common.item.ItemTwigWand;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lib.LibOreDict;
import cpw.mods.fml.common.registry.GameRegistry;
public final class ModCrafingRecipes {
@@ -347,29 +345,29 @@ public final class ModCrafingRecipes {
'W', LibOreDict.LIVING_WOOD,
'P', Blocks.sticky_piston);
recipeTurntable = BotaniaAPI.getLatestAddedRecipe();
// Fertilizer Recipes
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.fertilizer), new ItemStack(Items.dye, 1, 15), new ItemStack(ModItems.dye, 1, -1), new ItemStack(ModItems.dye, 1, -1), new ItemStack(ModItems.dye, 1, -1), new ItemStack(ModItems.dye, 1, -1));
recipeFertilizerPowder = BotaniaAPI.getLatestAddedRecipe();
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.fertilizer), new ItemStack(Items.dye, 1, 15), new ItemStack(Items.dye, 1, 11), new ItemStack(Items.dye, 1, 11), new ItemStack(Items.dye, 1, 1), new ItemStack(Items.dye, 1, 1));
recipeFerilizerDye = BotaniaAPI.getLatestAddedRecipe();
// Livingwood Twig Recipe
addOreDictRecipe(new ItemStack(ModItems.manaResource, 1, 3),
addOreDictRecipe(new ItemStack(ModItems.manaResource, 1, 3),
"W", "W",
'W', LibOreDict.LIVING_WOOD);
recipeLivingwoodTwig = BotaniaAPI.getLatestAddedRecipe();
// Rod of the Lands Recipe
addOreDictRecipe(new ItemStack(ModItems.dirtRod),
addOreDictRecipe(new ItemStack(ModItems.dirtRod),
" D", " T ", "E ",
'D', new ItemStack(Blocks.dirt),
'T', LibOreDict.LIVINGWOOD_TWIG,
'E', LibOreDict.RUNE[2]);
recipeDirtRod = BotaniaAPI.getLatestAddedRecipe();
// Terra Firma Rod Recipe
addOreDictRecipe(new ItemStack(ModItems.terraformRod),
addOreDictRecipe(new ItemStack(ModItems.terraformRod),
" WT", "ARS", "GM ",
'T', LibOreDict.TERRA_STEEL,
'R', new ItemStack(ModItems.dirtRod),
@@ -379,14 +377,14 @@ public final class ModCrafingRecipes {
'M', LibOreDict.RUNE[5],
'A', LibOreDict.RUNE[6]);
recipeTerraformRod = BotaniaAPI.getLatestAddedRecipe();
// Redstone Mana Spreader Recipe
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.spreader, 1, 1),
GameRegistry.addShapelessRecipe(new ItemStack(ModBlocks.spreader, 1, 1),
new ItemStack(ModBlocks.spreader), new ItemStack(Items.redstone));
recipeRedstoneSpreader = BotaniaAPI.getLatestAddedRecipe();
// Mana Miror Recipe
addOreDictRecipe(new ItemStack(ModItems.manaMirror),
addOreDictRecipe(new ItemStack(ModItems.manaMirror),
" PR", " SI", "T ",
'P', LibOreDict.MANA_PEARL,
'R', LibOreDict.LIVING_ROCK,
@@ -394,126 +392,126 @@ public final class ModCrafingRecipes {
'I', LibOreDict.TERRA_STEEL,
'T', new ItemStack(ModItems.manaTablet, 1, -1));
recipeManaMirror = BotaniaAPI.getLatestAddedRecipe();
// Mana Armor & Tools Recipes
addOreDictRecipe(new ItemStack(ModItems.manasteelHelm),
addOreDictRecipe(new ItemStack(ModItems.manasteelHelm),
"SSS", "S S",
'S', LibOreDict.MANA_STEEL);
recipeManasteelHelm = BotaniaAPI.getLatestAddedRecipe();
addOreDictRecipe(new ItemStack(ModItems.manasteelChest),
addOreDictRecipe(new ItemStack(ModItems.manasteelChest),
"S S", "SSS", "SSS",
'S', LibOreDict.MANA_STEEL);
recipeManasteelChest = BotaniaAPI.getLatestAddedRecipe();
addOreDictRecipe(new ItemStack(ModItems.manasteelLegs),
addOreDictRecipe(new ItemStack(ModItems.manasteelLegs),
"SSS", "S S", "S S",
'S', LibOreDict.MANA_STEEL);
recipeManasteelLegs = BotaniaAPI.getLatestAddedRecipe();
addOreDictRecipe(new ItemStack(ModItems.manasteelBoots),
addOreDictRecipe(new ItemStack(ModItems.manasteelBoots),
"S S", "S S",
'S', LibOreDict.MANA_STEEL);
recipeManasteelBoots = BotaniaAPI.getLatestAddedRecipe();
addOreDictRecipe(new ItemStack(ModItems.manasteelPick),
addOreDictRecipe(new ItemStack(ModItems.manasteelPick),
"SSS", " T ", " T ",
'S', LibOreDict.MANA_STEEL,
'T', LibOreDict.LIVINGWOOD_TWIG);
recipeManasteelPick = BotaniaAPI.getLatestAddedRecipe();
addOreDictRecipe(new ItemStack(ModItems.manasteelShovel),
addOreDictRecipe(new ItemStack(ModItems.manasteelShovel),
"S", "T", "T",
'S', LibOreDict.MANA_STEEL,
'T', LibOreDict.LIVINGWOOD_TWIG);
recipeManasteelShovel = BotaniaAPI.getLatestAddedRecipe();
addOreDictRecipe(new ItemStack(ModItems.manasteelAxe),
addOreDictRecipe(new ItemStack(ModItems.manasteelAxe),
"SS", "TS", "T ",
'S', LibOreDict.MANA_STEEL,
'T', LibOreDict.LIVINGWOOD_TWIG);
recipeManasteelAxe = BotaniaAPI.getLatestAddedRecipe();
addOreDictRecipe(new ItemStack(ModItems.manasteelSword),
addOreDictRecipe(new ItemStack(ModItems.manasteelSword),
"S", "S", "T",
'S', LibOreDict.MANA_STEEL,
'T', LibOreDict.LIVINGWOOD_TWIG);
recipeManasteelSword = BotaniaAPI.getLatestAddedRecipe();
addOreDictRecipe(new ItemStack(ModItems.manasteelShears),
addOreDictRecipe(new ItemStack(ModItems.manasteelShears),
"S ", " S",
'S', LibOreDict.MANA_STEEL);
recipeManasteelShears = BotaniaAPI.getLatestAddedRecipe();
// Horn of the Wild Recipe
addOreDictRecipe(new ItemStack(ModItems.grassHorn),
addOreDictRecipe(new ItemStack(ModItems.grassHorn),
" W ", "WSW", "WW ",
'W', LibOreDict.LIVING_WOOD,
'S', new ItemStack(ModItems.grassSeeds));
recipeGrassHorn = BotaniaAPI.getLatestAddedRecipe();
// Terrasteel Armor Recipes
addOreDictRecipe(new ItemStack(ModItems.terrasteelHelm),
addOreDictRecipe(new ItemStack(ModItems.terrasteelHelm),
"SSS", "S S",
'S', LibOreDict.TERRA_STEEL);
recipeTerrasteelHelm = BotaniaAPI.getLatestAddedRecipe();
addOreDictRecipe(new ItemStack(ModItems.terrasteelChest),
addOreDictRecipe(new ItemStack(ModItems.terrasteelChest),
"S S", "SSS", "SSS",
'S', LibOreDict.TERRA_STEEL);
recipeTerrasteelChest = BotaniaAPI.getLatestAddedRecipe();
addOreDictRecipe(new ItemStack(ModItems.terrasteelLegs),
addOreDictRecipe(new ItemStack(ModItems.terrasteelLegs),
"SSS", "S S", "S S",
'S', LibOreDict.TERRA_STEEL);
recipeTerrasteelLegs = BotaniaAPI.getLatestAddedRecipe();
addOreDictRecipe(new ItemStack(ModItems.terrasteelBoots),
addOreDictRecipe(new ItemStack(ModItems.terrasteelBoots),
"S S", "S S",
'S', LibOreDict.TERRA_STEEL);
recipeTerrasteelBoots = BotaniaAPI.getLatestAddedRecipe();
// Terra Blade Recipe
addOreDictRecipe(new ItemStack(ModItems.terraSword),
addOreDictRecipe(new ItemStack(ModItems.terraSword),
"I", "I", "S",
'I', LibOreDict.TERRA_STEEL,
'S', LibOreDict.LIVINGWOOD_TWIG);
recipeTerraSword = BotaniaAPI.getLatestAddedRecipe();
// Tiny Planet Recipe
addOreDictRecipe(new ItemStack(ModItems.tinyPlanet),
addOreDictRecipe(new ItemStack(ModItems.tinyPlanet),
"LSL", "SPS", "LSL",
'S', "stone",
'L', LibOreDict.LIVING_ROCK,
'P', LibOreDict.MANA_PEARL);
recipeTinyPlanet = BotaniaAPI.getLatestAddedRecipe();
// Mana Band Recipe
addOreDictRecipe(new ItemStack(ModItems.manaRing),
addOreDictRecipe(new ItemStack(ModItems.manaRing),
"TI ", "I I", " I ",
'T', new ItemStack(ModItems.manaTablet),
'I', LibOreDict.MANA_STEEL);
recipeManaRing = BotaniaAPI.getLatestAddedRecipe();
// Aura Band Recipe
addOreDictRecipe(new ItemStack(ModItems.auraRing),
addOreDictRecipe(new ItemStack(ModItems.auraRing),
"RI ", "I I", " I ",
'R', LibOreDict.RUNE[8],
'I', LibOreDict.MANA_STEEL);
recipeAuraRing = BotaniaAPI.getLatestAddedRecipe();
// Greater Mana Band Recipe
addOreDictRecipe(new ItemStack(ModItems.manaRingGreater),
addOreDictRecipe(new ItemStack(ModItems.manaRingGreater),
"IRI",
'I', LibOreDict.TERRA_STEEL,
'R', new ItemStack(ModItems.manaRing));
recipeGreaterManaRing = BotaniaAPI.getLatestAddedRecipe();
// Greater Aura Band Recipe
addOreDictRecipe(new ItemStack(ModItems.auraRingGreater),
addOreDictRecipe(new ItemStack(ModItems.auraRingGreater),
"IRI",
'I', LibOreDict.TERRA_STEEL,
'R', new ItemStack(ModItems.auraRing));
recipeGreaterAuraRing = BotaniaAPI.getLatestAddedRecipe();
// Soujourner's Belt Recipe
addOreDictRecipe(new ItemStack(ModItems.travelBelt),
addOreDictRecipe(new ItemStack(ModItems.travelBelt),
"EL ", "L L", "SLA",
'E', LibOreDict.RUNE[2],
'A', LibOreDict.RUNE[3],
'S', LibOreDict.MANA_STEEL,
'L', new ItemStack(Items.leather));
recipeTravelBelt = BotaniaAPI.getLatestAddedRecipe();
// Tectonic Girdle Recipe
addOreDictRecipe(new ItemStack(ModItems.knockbackBelt),
"AL ", "L L", "SLE",
@@ -522,31 +520,31 @@ public final class ModCrafingRecipes {
'S', LibOreDict.MANA_STEEL,
'L', new ItemStack(Items.leather));
recipeKnocbackBelt = BotaniaAPI.getLatestAddedRecipe();
// Snowflake Pendant Recipe
addOreDictRecipe(new ItemStack(ModItems.icePendant),
addOreDictRecipe(new ItemStack(ModItems.icePendant),
"WS ", "S S", "MSR",
'S', new ItemStack(Items.string),
'M', LibOreDict.MANA_STEEL,
'R', LibOreDict.RUNE[0],
'W', LibOreDict.RUNE[7]);
recipeIcePendant = BotaniaAPI.getLatestAddedRecipe();
// Pyroclast Pendant Recipe
addOreDictRecipe(new ItemStack(ModItems.lavaPendant),
addOreDictRecipe(new ItemStack(ModItems.lavaPendant),
"MS ", "S S", "DSF",
'S', new ItemStack(Items.string),
'D', LibOreDict.MANA_DIAMOND,
'M', LibOreDict.RUNE[5],
'F', LibOreDict.RUNE[1]);
recipeLavaPendant = BotaniaAPI.getLatestAddedRecipe();
// Essence of Eternal Life Recipe
addShapelessOreDictRecipe(new ItemStack(ModItems.manaResource, 12, 5), LibOreDict.TERRA_STEEL, new ItemStack(Items.nether_star), new ItemStack(Items.blaze_powder));
recipeLifeEssence = BotaniaAPI.getLatestAddedRecipe();
// Golden Laurel Crown Recipe
addOreDictRecipe(new ItemStack(ModItems.goldLaurel),
addOreDictRecipe(new ItemStack(ModItems.goldLaurel),
"G G", "LEL", "LLL",
'G', "ingotGold",
'L', "treeLeaves",
@@ -16,7 +16,6 @@ import java.util.List;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.recipe.RecipeManaInfusion;
@@ -49,7 +48,7 @@ public final class ModManaInfusionRecipes {
manaCookieRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaCookie), new ItemStack(Items.cookie), 20000);
grassSeedsRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.grassSeeds), new ItemStack(Blocks.tallgrass, 1, 1), 2500);
podzolSeedsRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.grassSeeds, 1, 1), new ItemStack(Blocks.tallgrass), 2500);
mycelSeedsRecipes = new ArrayList();
mycelSeedsRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.grassSeeds, 1, 2), new ItemStack(Blocks.red_mushroom), 6500));
mycelSeedsRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.grassSeeds, 1, 2), new ItemStack(Blocks.brown_mushroom), 6500));
@@ -14,10 +14,8 @@ package vazkii.botania.common.crafting;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.recipe.RecipeRuneAltar;
@@ -495,7 +495,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
TileEntity tile = worldObj.getTileEntity(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ);
Block block = worldObj.getBlock(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ);
if((tile instanceof IManaCollisionGhost && ((IManaCollisionGhost) tile).isGhost()) || block instanceof BlockBush)
if(tile instanceof IManaCollisionGhost && ((IManaCollisionGhost) tile).isGhost() || block instanceof BlockBush)
return;
ChunkCoordinates coords = getBurstSourceChunkCoordinates();
@@ -718,7 +718,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
public static class PositionProperties {
public final ChunkCoordinates coords;
public final Block block;
public final Block block;
public final int meta;
public PositionProperties(Entity entity) {
@@ -13,7 +13,6 @@ package vazkii.botania.common.item;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@@ -24,19 +23,19 @@ import vazkii.botania.common.lib.LibItemNames;
public class ItemDirtRod extends ItemMod {
private static final int COST = 75;
public ItemDirtRod() {
super();
setMaxStackSize(1);
setUnlocalizedName(LibItemNames.DIRT_ROD);
}
@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
if(ManaItemHandler.requestManaExact(par1ItemStack, par2EntityPlayer, COST, false)) {
ItemStack stackToPlace = new ItemStack(Blocks.dirt);
stackToPlace.tryPlaceItemIntoWorld(par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
if(stackToPlace.stackSize == 0) {
ManaItemHandler.requestManaExact(par1ItemStack, par2EntityPlayer, COST, true);
ForgeDirection dir = ForgeDirection.getOrientation(par7);
@@ -46,11 +45,11 @@ public class ItemDirtRod extends ItemMod {
}
return true;
}
@Override
public boolean isFull3D() {
return true;
}
}
@@ -14,7 +14,6 @@ package vazkii.botania.common.item;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChunkCoordinates;
@@ -29,13 +28,13 @@ public class ItemFertilizer extends ItemMod {
super();
setUnlocalizedName(LibItemNames.FERTILIZER);
}
@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
final int range = 3;
if(!par3World.isRemote) {
List<ChunkCoordinates> validCoords = new ArrayList();
for(int i = -range - 1; i < range; i++)
for(int j = -range - 1; j < range; j++) {
for(int k = 2; k >= -2; k--) {
@@ -46,7 +45,7 @@ public class ItemFertilizer extends ItemMod {
validCoords.add(new ChunkCoordinates(x, y, z));
}
}
int flowerCount = Math.min(validCoords.size(), par3World.rand.nextBoolean() ? 2 : 3);
for(int i = 0; i < flowerCount; i++) {
ChunkCoordinates coords = validCoords.get(par3World.rand.nextInt(validCoords.size()));
@@ -65,7 +64,7 @@ public class ItemFertilizer extends ItemMod {
Botania.proxy.wispFX(par3World, x, y, z, red, green, blue, 0.15F + (float) Math.random() * 0.25F, -(float) Math.random() * 0.1F - 0.05F);
}
}
return true;
}
}
@@ -40,23 +40,23 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ItemGrassSeeds extends ItemMod {
private static Map<Integer, List<BlockSwapper>> blockSwappers = new HashMap();
private static final int types = 3;
IIcon[] icons;
public ItemGrassSeeds() {
super();
setUnlocalizedName(LibItemNames.GRASS_SEEDS);
setHasSubtypes(true);
FMLCommonHandler.instance().bus().register(this);
}
@Override
public void getSubItems(Item par1, CreativeTabs par2, List par3) {
for(int i = 0; i < types; i++)
par3.add(new ItemStack(par1, 1, i));
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister) {
@@ -70,25 +70,25 @@ public class ItemGrassSeeds extends ItemMod {
public IIcon getIconFromDamage(int par1) {
return icons[Math.min(icons.length - 1, par1)];
}
@Override
public String getUnlocalizedName(ItemStack stack) {
return super.getUnlocalizedName() + stack.getItemDamage();
}
@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
Block block = par3World.getBlock(par4, par5, par6);
int bmeta = par3World.getBlockMetadata(par4, par5, par6);
if(block == Blocks.dirt && bmeta == 0) {
int meta = par1ItemStack.getItemDamage();
BlockSwapper swapper = addBlockSwapper(par3World, par4, par5, par6, meta);
par3World.setBlock(par4, par5, par6, swapper.blockToSet, swapper.metaToSet, 1 | 2);
for(int i = 0; i < 50; i++) {
double x = (Math.random() - 0.5) * 3;
double y = (Math.random() - 0.5) + 1;
double y = Math.random() - 0.5 + 1;
double z = (Math.random() - 0.5) * 3;
float r = 0F;
@@ -103,7 +103,7 @@ public class ItemGrassSeeds extends ItemMod {
g = 0F;
b = 0.33F;
}
float velMul = 0.025F;
Botania.proxy.wispFX(par3World, par4 + 0.5 + x, par5 + 0.5 + y, par6 + 0.5 + z, r, g, b, (float) Math.random() * 0.15F + 0.15F, (float) -x * velMul, (float) -y * velMul, (float) -z * velMul);
@@ -111,10 +111,10 @@ public class ItemGrassSeeds extends ItemMod {
par1ItemStack.stackSize--;
}
return true;
}
@SubscribeEvent
public void onTickEnd(TickEvent.WorldTickEvent event) {
if(event.phase == Phase.END) {
@@ -122,7 +122,7 @@ public class ItemGrassSeeds extends ItemMod {
if(blockSwappers.containsKey(dim)) {
List<BlockSwapper> swappers = blockSwappers.get(dim);
List<BlockSwapper> swappersSafe = new ArrayList(swappers);
for(BlockSwapper s : swappersSafe)
s.tick(swappers);
}
@@ -131,25 +131,25 @@ public class ItemGrassSeeds extends ItemMod {
private static BlockSwapper addBlockSwapper(World world, int x, int y, int z, int meta) {
BlockSwapper swapper = swapperFromMeta(world, x, y, z, meta);
int dim = world.provider.dimensionId;
if(!blockSwappers.containsKey(dim))
blockSwappers.put(dim, new ArrayList());
blockSwappers.get(dim).add(swapper);
return swapper;
}
private static BlockSwapper swapperFromMeta(World world, int x, int y, int z, int meta) {
switch(meta) {
case 1 : return new BlockSwapper(world, new ChunkCoordinates(x, y, z), Blocks.dirt, 2);
case 2 : return new BlockSwapper(world, new ChunkCoordinates(x, y, z), Blocks.mycelium, 0);
default : return new BlockSwapper(world, new ChunkCoordinates(x, y, z), Blocks.grass, 0);
case 1 : return new BlockSwapper(world, new ChunkCoordinates(x, y, z), Blocks.dirt, 2);
case 2 : return new BlockSwapper(world, new ChunkCoordinates(x, y, z), Blocks.mycelium, 0);
default : return new BlockSwapper(world, new ChunkCoordinates(x, y, z), Blocks.grass, 0);
}
}
private static class BlockSwapper {
final World world;
final Random rand;
final Block blockToSet;
@@ -157,7 +157,7 @@ public class ItemGrassSeeds extends ItemMod {
ChunkCoordinates startCoords;
int ticksExisted = 0;
BlockSwapper(World world, ChunkCoordinates coords, Block block, int meta) {
this.world = world;
blockToSet = block;
@@ -165,10 +165,10 @@ public class ItemGrassSeeds extends ItemMod {
rand = new Random(coords.posX ^ coords.posY ^ coords.posZ);
startCoords = coords;
}
void tick(List<BlockSwapper> list) {
++ticksExisted;
int range = 3;
for(int i = -range; i < range + 1; i++)
for(int j = -range; j < range + 1; j++) {
@@ -177,7 +177,7 @@ public class ItemGrassSeeds extends ItemMod {
int z = startCoords.posZ + j;
Block block = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
if(block == blockToSet && meta == metaToSet) {
if(ticksExisted % 20 == 0) {
List<ChunkCoordinates> validCoords = new ArrayList();
@@ -190,7 +190,7 @@ public class ItemGrassSeeds extends ItemMod {
if(block1 == Blocks.dirt && meta1 == 0)
validCoords.add(new ChunkCoordinates(x1, y, z1));
}
if(!validCoords.isEmpty() && !world.isRemote) {
ChunkCoordinates coords = validCoords.get(rand.nextInt(validCoords.size()));
world.setBlock(coords.posX, coords.posY, coords.posZ, blockToSet, metaToSet, 1 | 2);
@@ -203,5 +203,5 @@ public class ItemGrassSeeds extends ItemMod {
list.remove(this);
}
}
}
@@ -22,7 +22,6 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import vazkii.botania.api.mana.IManaItem;
import vazkii.botania.api.mana.IManaPool;
@@ -76,7 +75,7 @@ public class ItemManaMirror extends ItemMod implements IManaItem {
public IIcon getIcon(ItemStack stack, int pass) {
return icons[Math.min(1, pass)];
}
@Override
public boolean isFull3D() {
return true;
@@ -92,7 +91,7 @@ public class ItemManaMirror extends ItemMod implements IManaItem {
} else setManaForDisplay(par1ItemStack, pool.getCurrentMana());
}
}
@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
if(par2EntityPlayer.isSneaking() && !par3World.isRemote) {
@@ -103,10 +102,10 @@ public class ItemManaMirror extends ItemMod implements IManaItem {
return true;
}
}
return false;
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
ChunkCoordinates coords = getPoolCoords(par1ItemStack);
@@ -127,11 +126,11 @@ public class ItemManaMirror extends ItemMod implements IManaItem {
IManaPool pool = getManaPool(stack);
return pool == null ? 0 : pool.getCurrentMana();
}
public int getManaForDisplay(ItemStack stack) {
return ItemNBTHelper.getInt(stack, TAG_MANA_VISUAL, 0);
}
public void setManaForDisplay(ItemStack stack, int mana) {
ItemNBTHelper.setInt(stack, TAG_MANA_VISUAL, mana);
}
@@ -147,41 +146,41 @@ public class ItemManaMirror extends ItemMod implements IManaItem {
if(pool != null)
pool.recieveMana(mana);
}
public void bindPool(ItemStack stack, TileEntity pool) {
ItemNBTHelper.setInt(stack, TAG_POS_X, pool == null ? 0 : pool.xCoord);
ItemNBTHelper.setInt(stack, TAG_POS_Y, pool == null ? -1 : pool.yCoord);
ItemNBTHelper.setInt(stack, TAG_POS_Z, pool == null ? 0 : pool.zCoord);
ItemNBTHelper.setInt(stack, TAG_DIM, pool == null ? 0 : pool.getWorldObj().provider.dimensionId);
}
public ChunkCoordinates getPoolCoords(ItemStack stack) {
int x = ItemNBTHelper.getInt(stack, TAG_POS_X, 0);
int y = ItemNBTHelper.getInt(stack, TAG_POS_Y, -1);
int z = ItemNBTHelper.getInt(stack, TAG_POS_Z, 0);
return new ChunkCoordinates(x, y, z);
}
public int getDimension(ItemStack stack) {
return ItemNBTHelper.getInt(stack, TAG_DIM, 0);
}
public IManaPool getManaPool(ItemStack stack) {
MinecraftServer server = MinecraftServer.getServer();
if(server == null)
return new DummyPool();
ChunkCoordinates coords = getPoolCoords(stack);
if(coords.posY == -1)
return null;
int dim = getDimension(stack);
if(server.worldServers.length > dim && server.worldServers[dim] != null) {
TileEntity tile = server.worldServers[dim].getTileEntity(coords.posX, coords.posY, coords.posZ);
if(tile != null && tile instanceof IManaPool)
return (IManaPool) tile;
}
return null;
}
@@ -204,7 +203,7 @@ public class ItemManaMirror extends ItemMod implements IManaItem {
public boolean canExportManaToItem(ItemStack stack, ItemStack otherStack) {
return true;
}
private static class DummyPool implements IManaPool {
@Override
@@ -231,7 +230,7 @@ public class ItemManaMirror extends ItemMod implements IManaItem {
public boolean isOutputtingPower() {
return false;
}
}
}
@@ -11,10 +11,8 @@
*/
package vazkii.botania.common.item;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import vazkii.botania.api.recipe.IFlowerComponent;
import vazkii.botania.common.lib.LibItemNames;
@@ -22,7 +22,7 @@ public class ItemPestleAndMortar extends ItemMod {
setContainerItem(this);
setUnlocalizedName(LibItemNames.PESTLE_AND_MORTAR);
}
@Override
public boolean doesContainerItemLeaveCraftingGrid(ItemStack par1ItemStack) {
return false;
@@ -32,7 +32,9 @@ public class ItemTerraformRod extends ItemMod {
private static final int COST_PER = 55;
static final List<Block> validBlocks = new ArrayList() {{
static final List<Block> validBlocks = new ArrayList() {private static final long serialVersionUID = 1378413169035169782L;
{
add(Blocks.stone);
add(Blocks.dirt);
add(Blocks.grass);
@@ -43,7 +45,7 @@ public class ItemTerraformRod extends ItemMod {
add(Blocks.mycelium);
add(Blocks.sandstone);
}};
public ItemTerraformRod() {
super();
setMaxStackSize(1);
@@ -93,7 +95,7 @@ public class ItemTerraformRod extends ItemMod {
int x = xCenter + i;
int y = yStart + k;
int z = zCenter + j;
Block block = par2World.getBlock(x, y, z);
if(validBlocks.contains(block)) {
boolean hasAir = false;
@@ -108,8 +110,8 @@ public class ItemTerraformRod extends ItemMod {
int y_ = y + dir.offsetY;
int z_ = z + dir.offsetZ;
Block block_ = par2World.getBlock(x_, y_, z_);
if(block_.isAir(par2World, x_, y_, z_) || block_.isReplaceable(par2World, x_, y_, z_) || (block_ instanceof BlockFlower && !(block_ instanceof ISpecialFlower)) || block_ == Blocks.double_plant) {
Block block_ = par2World.getBlock(x_, y_, z_);
if(block_.isAir(par2World, x_, y_, z_) || block_.isReplaceable(par2World, x_, y_, z_) || block_ instanceof BlockFlower && !(block_ instanceof ISpecialFlower) || block_ == Blocks.double_plant) {
airBlocks.add(new ChunkCoordinates(x_, y_, z_));
hasAir = true;
}
@@ -144,7 +146,7 @@ public class ItemTerraformRod extends ItemMod {
}
}
}
@Override
public boolean isFull3D() {
return true;
@@ -131,7 +131,7 @@ public final class ModItems {
icePendant = new ItemIcePendant();
lavaPendant = new ItemLavaPendant();
goldLaurel = new ItemGoldenLaurel();
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
for(int i = 0; i < 16; i++) {
OreDictionary.registerOre(LibOreDict.PETAL[i], new ItemStack(petal, 1, i));
@@ -23,7 +23,7 @@ public class ItemBlockPool extends ItemBlockWithMetadataAndName {
public ItemBlockPool(Block par2Block) {
super(par2Block);
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
if(par1ItemStack.getItemDamage() == 1)
@@ -11,16 +11,6 @@
*/
package vazkii.botania.common.item.equipment.armor;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.mana.ManaItemHandler;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.core.BotaniaCreativeTab;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.item.equipment.tool.ManasteelToolCommons;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -30,8 +20,15 @@ import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraftforge.common.ISpecialArmor;
import net.minecraftforge.common.ISpecialArmor.ArmorProperties;
import net.minecraftforge.common.util.EnumHelper;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.core.BotaniaCreativeTab;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.item.equipment.tool.ManasteelToolCommons;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor {
@@ -29,23 +29,23 @@ public class ItemTerrasteeelArmor extends ItemManasteelArmor {
public ItemTerrasteeelArmor(int type, String name) {
super(type, name, BotaniaAPI.terrasteelArmorMaterial);
}
int getHealthBoost() {
return 0;
}
@Override
public Multimap getItemAttributeModifiers() {
Multimap map = HashMultimap.create();
map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(171328 /** Random number **/, armorType), "Armor modifier" + armorType, getHealthBoost(), 0));
return map;
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {
return slot == 2 ? LibResources.MODEL_TERRASTEEL_1 : LibResources.MODEL_TERRASTEEL_0;
}
@Override
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) {
return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 4 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
@@ -18,7 +18,7 @@ public class ItemTerrasteelHelm extends ItemTerrasteeelArmor {
public ItemTerrasteelHelm() {
super(0, LibItemNames.TERRASTEEL_HELM);
}
@Override
int getHealthBoost() {
return 5;
@@ -23,5 +23,5 @@ public class ItemTerrasteelLegs extends ItemTerrasteeelArmor {
int getHealthBoost() {
return 5;
}
}
@@ -23,7 +23,7 @@ public class ItemAuraRing extends ItemBauble {
public ItemAuraRing() {
super(LibItemNames.AURA_RING);
}
@Override
public void onWornTick(ItemStack stack, EntityLivingBase player) {
super.onWornTick(stack, player);
@@ -12,7 +12,6 @@
package vazkii.botania.common.item.equipment.bauble;
import java.util.List;
import java.util.Set;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
@@ -33,83 +32,83 @@ import baubles.common.lib.PlayerHandler;
public abstract class ItemBauble extends ItemMod implements IBauble {
public ItemBauble(String name) {
super();
setMaxStackSize(1);
setUnlocalizedName(name);
}
public ItemBauble(String name) {
super();
setMaxStackSize(1);
setUnlocalizedName(name);
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
if(!par2World.isRemote) {
InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(par3EntityPlayer);
for(int i = 0; i < baubles.getSizeInventory(); i++)
if(baubles.getStackInSlot(i) == null && baubles.isItemValidForSlot(i, par1ItemStack)) {
baubles.setInventorySlotContents(i, par1ItemStack.copy());
if(!par3EntityPlayer.capabilities.isCreativeMode)
par3EntityPlayer.inventory.setInventorySlotContents(par3EntityPlayer.inventory.currentItem, null);
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
if(!par2World.isRemote) {
InventoryBaubles baubles = PlayerHandler.getPlayerBaubles(par3EntityPlayer);
for(int i = 0; i < baubles.getSizeInventory(); i++)
if(baubles.getStackInSlot(i) == null && baubles.isItemValidForSlot(i, par1ItemStack)) {
baubles.setInventorySlotContents(i, par1ItemStack.copy());
if(!par3EntityPlayer.capabilities.isCreativeMode)
par3EntityPlayer.inventory.setInventorySlotContents(par3EntityPlayer.inventory.currentItem, null);
onEquipped(par1ItemStack, par3EntityPlayer);
break;
}
}
onEquipped(par1ItemStack, par3EntityPlayer);
break;
}
}
return par1ItemStack;
}
return par1ItemStack;
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
BaubleType type = getBaubleType(par1ItemStack);
if(GuiScreen.isShiftKeyDown()) {
addStringToTooltip(StatCollector.translateToLocal("botania.baubletype." + type.name().toLowerCase()), par3List);
KeyBinding key = null;
KeyBinding[] keys = Minecraft.getMinecraft().gameSettings.keyBindings;
for(KeyBinding otherKey : keys)
if(otherKey.getKeyDescription().equals("Baubles Inventory")) {
key = otherKey;
break;
}
if(key != null)
addStringToTooltip(StatCollector.translateToLocal("botania.baubletooltip").replaceAll("%key%", Keyboard.getKeyName(key.getKeyCode())), par3List);
} else addStringToTooltip(StatCollector.translateToLocal("botania.baubleinfo"), par3List);
}
private void addStringToTooltip(String s, List<String> tooltip) {
tooltip.add(s.replaceAll("&", "\u00a7"));
}
@Override
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
BaubleType type = getBaubleType(par1ItemStack);
if(GuiScreen.isShiftKeyDown()) {
addStringToTooltip(StatCollector.translateToLocal("botania.baubletype." + type.name().toLowerCase()), par3List);
@Override
public boolean canEquip(ItemStack stack, EntityLivingBase player) {
return true;
}
KeyBinding key = null;
KeyBinding[] keys = Minecraft.getMinecraft().gameSettings.keyBindings;
for(KeyBinding otherKey : keys)
if(otherKey.getKeyDescription().equals("Baubles Inventory")) {
key = otherKey;
break;
}
@Override
public boolean canUnequip(ItemStack stack, EntityLivingBase player) {
return true;
}
if(key != null)
addStringToTooltip(StatCollector.translateToLocal("botania.baubletooltip").replaceAll("%key%", Keyboard.getKeyName(key.getKeyCode())), par3List);
} else addStringToTooltip(StatCollector.translateToLocal("botania.baubleinfo"), par3List);
}
@Override
public void onWornTick(ItemStack stack, EntityLivingBase player) {
private void addStringToTooltip(String s, List<String> tooltip) {
tooltip.add(s.replaceAll("&", "\u00a7"));
}
@Override
public boolean canEquip(ItemStack stack, EntityLivingBase player) {
return true;
}
@Override
public boolean canUnequip(ItemStack stack, EntityLivingBase player) {
return true;
}
@Override
public void onWornTick(ItemStack stack, EntityLivingBase player) {
if(player.ticksExisted == 1)
onEquippedOrLoadedIntoWorld(stack, player);
}
@Override
public void onEquipped(ItemStack stack, EntityLivingBase player) {
if(!player.worldObj.isRemote)
player.worldObj.playSoundAtEntity(player, "random.orb", 0.1F, 1.3F);
onEquippedOrLoadedIntoWorld(stack, player);
}
public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) {
// NO-OP
}
}
@Override
public void onUnequipped(ItemStack stack, EntityLivingBase player) {
// NO-OP
}
@Override
public void onEquipped(ItemStack stack, EntityLivingBase player) {
if(!player.worldObj.isRemote)
player.worldObj.playSoundAtEntity(player, "random.orb", 0.1F, 1.3F);
onEquippedOrLoadedIntoWorld(stack, player);
}
public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) {
// NO-OP
}
@Override
public void onUnequipped(ItemStack stack, EntityLivingBase player) {
// NO-OP
}
}
@@ -11,10 +11,7 @@
*/
package vazkii.botania.common.item.equipment.bauble;
import java.util.UUID;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.item.ItemStack;
@@ -29,17 +26,17 @@ public abstract class ItemBaubleModifier extends ItemBauble {
super(name);
fillModifiers(attributes);
}
@Override
public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) {
player.getAttributeMap().applyAttributeModifiers(attributes);
}
@Override
public void onUnequipped(ItemStack stack, EntityLivingBase player) {
player.getAttributeMap().removeAttributeModifiers(attributes);
}
abstract void fillModifiers(Multimap<String, AttributeModifier> attributes);
}
@@ -30,7 +30,7 @@ public class ItemGoldenLaurel extends ItemBauble {
super(LibItemNames.GOLDEN_LAUREL);
MinecraftForge.EVENT_BUS.register(this);
}
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onPlayerDeath(LivingDeathEvent event) {
if(event.entity instanceof EntityPlayer) {
@@ -23,7 +23,7 @@ public class ItemGreaterAuraRing extends ItemBauble {
public ItemGreaterAuraRing() {
super(LibItemNames.AURA_RING_GREATER);
}
@Override
public void onWornTick(ItemStack stack, EntityLivingBase player) {
super.onWornTick(stack, player);
@@ -17,14 +17,14 @@ import vazkii.botania.common.lib.LibItemNames;
public class ItemGreaterManaRing extends ItemManaRing {
private static final int MAX_MANA = ItemManaRing.MAX_MANA * 4;
public ItemGreaterManaRing() {
super(LibItemNames.MANA_RING_GREATER);
}
@Override
public int getMaxMana(ItemStack stack) {
return MAX_MANA;
}
}
@@ -42,24 +42,24 @@ public class ItemIcePendant extends ItemBauble {
@Override
public void onWornTick(ItemStack stack, EntityLivingBase entity) {
super.onWornTick(stack, entity);
if(entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) entity;
if(!player.worldObj.isRemote)
tickIceRemovers(player);
if(!player.isSneaking() && !player.isInsideOfMaterial(Material.water)) {
int x = (int) player.posX;
int y = (int) player.posY - (player.isInWater() ? 0 : 1) - (player.worldObj.isRemote ? 1 : 0);
int z = (int) player.posZ;
int range = 3;
for(int i = -range - 1; i < range; i++)
for(int j = -range; j < range + 1; j++) {
int x1 = x + i;
int z1 = z + j;
addIceBlock(player, new ChunkCoordinates(x1, y, z1));
}
}
@@ -74,7 +74,7 @@ public class ItemIcePendant extends ItemBauble {
List<IceRemover> ice = playerIceBlocks.get(user);
if(player.worldObj.getBlock(coords.posX, coords.posY, coords.posZ) == Blocks.water) {
player.worldObj.setBlock(coords.posX, coords.posY, coords.posZ, Blocks.ice);
if(!player.worldObj.isRemote)
ice.add(new IceRemover(coords));
}
@@ -91,7 +91,7 @@ public class ItemIcePendant extends ItemBauble {
}
class IceRemover {
int time = 30;
final ChunkCoordinates coords;
@@ -13,14 +13,12 @@ package vazkii.botania.common.item.equipment.bauble;
import java.util.UUID;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.item.ItemStack;
import vazkii.botania.common.lib.LibItemNames;
import baubles.api.BaubleType;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
public class ItemKnockbackBelt extends ItemBaubleModifier {
@@ -24,17 +24,17 @@ public class ItemLavaPendant extends ItemBauble {
public ItemLavaPendant() {
super(LibItemNames.LAVA_PENDANT);
}
@Override
public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) {
setImmunity(player, true);
}
@Override
public void onUnequipped(ItemStack stack, EntityLivingBase player) {
setImmunity(player, false);
}
private void setImmunity(Entity entity, boolean immune) {
ReflectionHelper.setPrivateValue(Entity.class, entity, immune, LibObfuscation.IS_IMMUNE_TO_FIRE);
}
@@ -27,12 +27,12 @@ public class ItemManaRing extends ItemBauble implements IManaItem {
protected static final int MAX_MANA = 500000;
private static final String TAG_MANA = "mana";
public ItemManaRing() {
this(LibItemNames.MANA_RING);
setMaxDamage(1000);
}
public ItemManaRing(String name) {
super(name);
setMaxDamage(1000);
@@ -42,12 +42,12 @@ public class ItemManaRing extends ItemBauble implements IManaItem {
public BaubleType getBaubleType(ItemStack itemstack) {
return BaubleType.RING;
}
@Override
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
par3List.add(new ItemStack(par1, 1, 10000));
}
@Override
public int getDamage(ItemStack stack) {
float mana = getMana(stack);
@@ -58,7 +58,7 @@ public class ItemManaRing extends ItemBauble implements IManaItem {
public int getDisplayDamage(ItemStack stack) {
return getDamage(stack);
}
public static void setMana(ItemStack stack, int mana) {
ItemNBTHelper.setInt(stack, TAG_MANA, mana);
}
@@ -18,7 +18,6 @@ import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MovementInput;
import vazkii.botania.api.internal.IManaBurst;
import vazkii.botania.common.core.helper.Vector3;
import vazkii.botania.common.lib.LibItemNames;
@@ -27,7 +26,7 @@ import baubles.api.BaubleType;
public class ItemTinyPlanet extends ItemBauble {
private static final String TAG_ORBIT = "orbit";
public ItemTinyPlanet() {
super(LibItemNames.TINY_PLANET);
}
@@ -36,7 +35,7 @@ public class ItemTinyPlanet extends ItemBauble {
public BaubleType getBaubleType(ItemStack itemstack) {
return BaubleType.AMULET;
}
@Override
public void onWornTick(ItemStack stack, EntityLivingBase player) {
super.onWornTick(stack, player);
@@ -47,33 +46,33 @@ public class ItemTinyPlanet extends ItemBauble {
int orbitTime = getEntityOrbitTime(entity);
if(orbitTime == 0)
burst.setMinManaLoss(burst.getMinManaLoss() * 3);
float radius = (float) (Math.max(40, orbitTime) - 40) / 40F + 1.5F;
float radius = (Math.max(40, orbitTime) - 40) / 40F + 1.5F;
int angle = orbitTime % 360;
float xTarget = (float) (player.posX + Math.cos((angle * 10) * Math.PI / 180F) * radius);
float xTarget = (float) (player.posX + Math.cos(angle * 10 * Math.PI / 180F) * radius);
float yTarget = (float) player.posY + 1.2F;
float zTarget = (float) (player.posZ + Math.sin((angle * 10) * Math.PI / 180F) * radius);
float zTarget = (float) (player.posZ + Math.sin(angle * 10 * Math.PI / 180F) * radius);
if(player.worldObj.isRemote)
yTarget -= 1.62F;
Vector3 targetVec = new Vector3(xTarget, yTarget, zTarget);
Vector3 currentVec = new Vector3(entity.posX, entity.posY, entity.posZ);
Vector3 moveVector = targetVec.copy().sub(currentVec);
burst.setMotion(moveVector.x, moveVector.y, moveVector.z);
incrementOrbitTime(entity);
}
}
public int getEntityOrbitTime(Entity entity) {
NBTTagCompound cmp = entity.getEntityData();
if(cmp.hasKey(TAG_ORBIT))
return cmp.getInteger(TAG_ORBIT);
else return 0;
}
public void incrementOrbitTime(Entity entity) {
NBTTagCompound cmp = entity.getEntityData();
int time = getEntityOrbitTime(entity);
@@ -32,7 +32,7 @@ public class ItemTravelBelt extends ItemBauble {
public BaubleType getBaubleType(ItemStack itemstack) {
return BaubleType.BELT;
}
@Override
public void onWornTick(ItemStack stack, EntityLivingBase entity) {
super.onWornTick(stack, entity);
@@ -40,14 +40,14 @@ public class ItemTravelBelt extends ItemBauble {
EntityPlayer player = (EntityPlayer) entity;
if((player.onGround || player.capabilities.isFlying) && player.moveForward > 0F)
player.moveFlying(0F, 1F, player.capabilities.isFlying ? 0.035F : 0.07F);
if(player.isSneaking())
player.stepHeight = 0.50001F; // Not 0.5F because that is the default
else if(player.stepHeight == 0.50001F)
player.stepHeight = 1F;
}
}
@SubscribeEvent
public void onPlayerJump(LivingJumpEvent event) {
if(event.entityLiving instanceof EntityPlayer) {
@@ -55,17 +55,17 @@ public class ItemTravelBelt extends ItemBauble {
ItemStack belt = PlayerHandler.getPlayerBaubles(player).getStackInSlot(3);
if(belt != null && belt.getItem() == this) {
player.motionY += 0.2;
player.fallDistance = -1F;
player.motionY += 0.2;
player.fallDistance = -1F;
}
}
}
@Override
public void onEquippedOrLoadedIntoWorld(ItemStack stack, EntityLivingBase player) {
player.stepHeight = 1F;
}
@Override
public void onUnequipped(ItemStack stack, EntityLivingBase player) {
player.stepHeight = 0.5F;
@@ -30,7 +30,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ItemManasteelAxe extends ItemAxe {
private static final int MANA_PER_DAMAGE = 60;
public ItemManasteelAxe() {
super(BotaniaAPI.manasteelToolMaterial);
setCreativeTab(BotaniaCreativeTab.INSTANCE);
@@ -62,10 +62,10 @@ public class ItemManasteelAxe extends ItemAxe {
return true;
}
@Override
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) {
return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 0 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
}
@@ -30,7 +30,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ItemManasteelPick extends ItemPickaxe {
private static final int MANA_PER_DAMAGE = 60;
public ItemManasteelPick() {
super(BotaniaAPI.manasteelToolMaterial);
setCreativeTab(BotaniaCreativeTab.INSTANCE);
@@ -62,10 +62,10 @@ public class ItemManasteelPick extends ItemPickaxe {
return true;
}
@Override
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) {
return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 0 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
}
@@ -14,13 +14,6 @@ package vazkii.botania.common.item.equipment.tool;
import java.util.ArrayList;
import java.util.Random;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.common.core.BotaniaCreativeTab;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lib.LibItemNames;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.enchantment.Enchantment;
@@ -33,11 +26,18 @@ import net.minecraft.item.ItemShears;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.StatList;
import net.minecraftforge.common.IShearable;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.common.core.BotaniaCreativeTab;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lib.LibItemNames;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemManasteelShears extends ItemShears {
private static final int MANA_PER_DAMAGE = 30;
public ItemManasteelShears() {
setCreativeTab(BotaniaCreativeTab.INSTANCE);
setUnlocalizedName(LibItemNames.MANASTEEL_SHEARS);
@@ -54,12 +54,12 @@ public class ItemManasteelShears extends ItemShears {
public void registerIcons(IIconRegister par1IconRegister) {
itemIcon = IconHelper.forItem(par1IconRegister, this);
}
@Override
public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity) {
if(entity.worldObj.isRemote)
return false;
if(entity instanceof IShearable) {
IShearable target = (IShearable)entity;
if(target.isShearable(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) {
@@ -72,13 +72,13 @@ public class ItemManasteelShears extends ItemShears {
ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
ent.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
}
ManasteelToolCommons.damageItem(itemstack, 1, player, MANA_PER_DAMAGE);
}
return true;
}
return false;
}
@@ -99,7 +99,7 @@ public class ItemManasteelShears extends ItemShears {
double d = rand.nextFloat() * f + (1D - f) * 0.5;
double d1 = rand.nextFloat() * f + (1D - f) * 0.5;
double d2 = rand.nextFloat() * f + (1D - f) * 0.5;
EntityItem entityitem = new EntityItem(player.worldObj, x + d, y + d1, z + d2, stack);
entityitem.delayBeforeCanPickup = 10;
player.worldObj.spawnEntityInWorld(entityitem);
@@ -109,7 +109,7 @@ public class ItemManasteelShears extends ItemShears {
player.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(block)], 1);
}
}
return false;
}
@@ -30,7 +30,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ItemManasteelShovel extends ItemSpade {
private static final int MANA_PER_DAMAGE = 60;
public ItemManasteelShovel() {
super(BotaniaAPI.manasteelToolMaterial);
setCreativeTab(BotaniaCreativeTab.INSTANCE);
@@ -62,10 +62,10 @@ public class ItemManasteelShovel extends ItemSpade {
return true;
}
@Override
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) {
return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 0 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
}
@@ -37,7 +37,7 @@ public class ItemManasteelSword extends ItemSword {
public ItemManasteelSword() {
this(BotaniaAPI.manasteelToolMaterial, LibItemNames.MANASTEEL_SWORD);
}
public ItemManasteelSword(ToolMaterial mat, String name) {
super(mat);
setCreativeTab(BotaniaCreativeTab.INSTANCE);
@@ -67,7 +67,7 @@ public class ItemManasteelSword extends ItemSword {
public IIcon getIconIndex(ItemStack par1ItemStack) {
return par1ItemStack.getDisplayName().equals("The Elucidator") ? elucidatorIcon : super.getIconIndex(par1ItemStack);
}
@Override
public IIcon getIcon(ItemStack stack, int pass) {
return getIconIndex(stack);
@@ -80,7 +80,7 @@ public class ItemManasteelSword extends ItemSword {
return true;
}
@Override
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) {
return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 0 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
@@ -21,9 +21,7 @@ import net.minecraft.world.World;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.internal.IManaBurst;
import vazkii.botania.api.mana.BurstProperties;
import vazkii.botania.api.mana.ILens;
import vazkii.botania.api.mana.ILensEffect;
import vazkii.botania.api.mana.ManaItemHandler;
import vazkii.botania.common.entity.EntityManaBurst;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lib.LibItemNames;
@@ -51,7 +49,7 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect {
EntityManaBurst burst = new EntityManaBurst(player);
float motionModifier = 5F;
burst.setColor(0x20FF20);
burst.setMana(MANA_PER_DAMAGE);
burst.setStartingMana(MANA_PER_DAMAGE);
@@ -97,7 +95,7 @@ public class ItemTerraSword extends ItemManasteelSword implements ILensEffect {
public boolean doParticles(IManaBurst burst, ItemStack stack) {
return true;
}
@Override
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) {
return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 4 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
@@ -17,14 +17,14 @@ import net.minecraft.item.ItemStack;
import vazkii.botania.api.mana.ManaItemHandler;
public final class ManasteelToolCommons {
public static void damageItem(ItemStack stack, int dmg, EntityLivingBase entity, int manaPerDamage) {
int manaToRequest = dmg * manaPerDamage;
int manaRequested = entity instanceof EntityPlayer ? ManaItemHandler.requestMana(stack, (EntityPlayer) entity, manaToRequest, true) : 0;
int finalDamage = dmg - manaRequested / manaPerDamage;
if(finalDamage > 0)
stack.damageItem(finalDamage, entity);
}
}
@@ -155,7 +155,7 @@ public final class LexiconData {
terrasteel = new BLexiconEntry(LibLexicon.BASICS_TERRASTEEL, categoryBasics);
terrasteel.setLexiconPages(new PageText("0"), new PageTerrasteel("1"), new PageText("2"), new PageCraftingRecipe("3", ModCrafingRecipes.recipeLifeEssence));
// MANA ENTRIES
manaIntro = new BLexiconEntry(LibLexicon.MANA_INTRO, categoryMana);
manaIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"));
@@ -217,7 +217,7 @@ public final class LexiconData {
redstoneSpreader = new BLexiconEntry(LibLexicon.MANA_REDSTONE_SPREADER, categoryMana);
redstoneSpreader.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeRedstoneSpreader));
// FUNCTIONAL FLOWERS ENTRIES
functionalIntro = new BLexiconEntry(LibLexicon.FFLOWER_INTRO, categoryFunctionalFlowers);
functionalIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"));
@@ -298,55 +298,55 @@ public final class LexiconData {
grassSeeds = new BLexiconEntry(LibLexicon.TOOL_GRASS_SEEDS, categoryTools);
grassSeeds.setLexiconPages(new PageText("0"), new PageManaInfusionRecipe("1", ModManaInfusionRecipes.grassSeedsRecipe), new PageManaInfusionRecipe("2", ModManaInfusionRecipes.podzolSeedsRecipe), new PageManaInfusionRecipe("3", ModManaInfusionRecipes.mycelSeedsRecipes));
dirtRod = new BLexiconEntry(LibLexicon.TOOL_DIRT_ROD, categoryTools);
dirtRod.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeDirtRod));
terraformRod = new BLexiconEntry(LibLexicon.TOOL_TERRAFORM_ROD, categoryTools);
terraformRod.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCrafingRecipes.recipeTerraformRod));
manasteelGear = new BLexiconEntry(LibLexicon.TOOL_MANASTEEL_GEAR, categoryTools);
manasteelGear.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeManasteelPick), new PageCraftingRecipe("2", ModCrafingRecipes.recipeManasteelShovel), new PageCraftingRecipe("3", ModCrafingRecipes.recipeManasteelAxe),
manasteelGear.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeManasteelPick), new PageCraftingRecipe("2", ModCrafingRecipes.recipeManasteelShovel), new PageCraftingRecipe("3", ModCrafingRecipes.recipeManasteelAxe),
new PageCraftingRecipe("4", ModCrafingRecipes.recipeManasteelShears), new PageCraftingRecipe("5", ModCrafingRecipes.recipeManasteelSword),
new PageCraftingRecipe("6", ModCrafingRecipes.recipeManasteelHelm), new PageCraftingRecipe("7", ModCrafingRecipes.recipeManasteelChest), new PageCraftingRecipe("8", ModCrafingRecipes.recipeManasteelLegs), new PageCraftingRecipe("9", ModCrafingRecipes.recipeManasteelBoots));
terrasteelArmor = new BLexiconEntry(LibLexicon.TOOL_TERRASTEEL_ARMOR, categoryTools);
terrasteelArmor.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeTerrasteelHelm), new PageCraftingRecipe("2", ModCrafingRecipes.recipeTerrasteelChest), new PageCraftingRecipe("3", ModCrafingRecipes.recipeTerrasteelLegs), new PageCraftingRecipe("4", ModCrafingRecipes.recipeTerrasteelBoots));
grassHorn = new BLexiconEntry(LibLexicon.TOOL_GRASS_HORN, categoryTools);
grassHorn.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeGrassHorn));
terraBlade = new BLexiconEntry(LibLexicon.TOOL_TERRA_SWORD, categoryTools);
terraBlade.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeTerraSword));
// BAUBLES ENTRIES
baublesIntro = new BLexiconEntry(LibLexicon.BAUBLE_INTRO, categoryBaubles);
baublesIntro.setPriority().setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_BAUBLES), new PageText("2"));
tinyPlanet = new BLexiconEntry(LibLexicon.BAUBLE_TINY_PLANET, categoryBaubles);
tinyPlanet.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeTinyPlanet));
manaRing = new BLexiconEntry(LibLexicon.BAUBLE_MANA_RING, categoryBaubles);
manaRing.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeManaRing), new PageCraftingRecipe("2", ModCrafingRecipes.recipeGreaterManaRing));
auraRing = new BLexiconEntry(LibLexicon.BAUBLE_AURA_RING, categoryBaubles);
auraRing.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeAuraRing), new PageCraftingRecipe("2", ModCrafingRecipes.recipeGreaterAuraRing));
travelBelt = new BLexiconEntry(LibLexicon.BAUBLE_TRAVEL_BELT, categoryBaubles);
travelBelt.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeTravelBelt));
knockbacklBelt = new BLexiconEntry(LibLexicon.BAUBLE_KNOCKBACK_BELT, categoryBaubles);
knockbacklBelt.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeKnocbackBelt));
icePendant = new BLexiconEntry(LibLexicon.BAUBLE_ICE_PENDANT, categoryBaubles);
icePendant.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeIcePendant));
lavaPendant = new BLexiconEntry(LibLexicon.BAUBLE_LAVA_PENDANT, categoryBaubles);
lavaPendant.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeLavaPendant));
goldLaurel = new BLexiconEntry(LibLexicon.BAUBLE_GOLDEN_LAUREL, categoryBaubles);
goldLaurel.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCrafingRecipes.recipeGoldenLaurel));
// MISCLENAEOUS ENTRIES
unstableBlocks = new BLexiconEntry(LibLexicon.MISC_UNSTABLE_BLOCKS, categoryMisc);
unstableBlocks.setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_UNSTABLE_BLOCK), new PageCraftingRecipe("2", ModCrafingRecipes.recipesUnstableBlocks), new PageText("3"), new PageImage("4", LibResources.ENTRY_UNSTABLE_BEACON), new PageCraftingRecipe("5", ModCrafingRecipes.recipesManaBeacons), new PageText("6"), new PageCraftingRecipe("7", ModCrafingRecipes.recipesSignalFlares));
@@ -45,7 +45,7 @@ public class PageRecipe extends LexiconPage {
boolean tooltipEntry;
static boolean mouseDownLastTick = false;
public PageRecipe(String unlocalizedName) {
super(unlocalizedName);
}
@@ -68,7 +68,7 @@ public class PageRecipe extends LexiconPage {
List<String> tooltipData = tooltipStack.getTooltip(Minecraft.getMinecraft().thePlayer, false);
List<String> parsedTooltip = new ArrayList();
boolean first = true;
for(String s : tooltipData) {
String s_ = s;
if(!first)
@@ -76,7 +76,7 @@ public class PageRecipe extends LexiconPage {
parsedTooltip.add(s_);
first = false;
}
RenderHelper.renderTooltip(mx, my, parsedTooltip);
int tooltipY = 8 + tooltipData.size() * 11;
@@ -20,14 +20,13 @@ import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import vazkii.botania.api.internal.IGuiLexiconEntry;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.lexicon.LexiconRecipeMappings;
import vazkii.botania.api.recipe.RecipeManaInfusion;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.item.ModItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class PageTerrasteel extends PageRecipe {
@@ -87,7 +87,7 @@ public final class LibLexicon {
public static final String TOOL_TERRASTEEL_ARMOR = "terrasteelArmor";
public static final String TOOL_GRASS_HORN = "grassHorn";
public static final String TOOL_TERRA_SWORD = "terraSword";
public static final String BAUBLE_INTRO = "bIntro";
public static final String BAUBLE_TINY_PLANET = "tinyPlanet";
public static final String BAUBLE_MANA_RING = "manaRing";
@@ -31,7 +31,7 @@ public final class LibObfuscation {
// ThreadDownloadImageData
public static final String[] TEXTURE_UPLOADED = new String[] { "textureUploaded", "field_110559_g", "i" };
public static final String[] BUFFERED_IMAGE = new String[] { "bufferedImage", "field_110560_d", "g" };
// Entity
public static final String[] IS_IMMUNE_TO_FIRE = new String[] { "isImmuneToFire", "field_70178_ae", "ag" };
}