This commit is contained in:
Vasco Lavos committed 2015-08-28 23:14:45 +01:00
1 parent a1e8a78b57
commit 3de6177092
59 files changed
+237 -262

No files matched your search

@@ -33,7 +33,7 @@ public final class CorporeaHelper {
private static final List<ICorporeaAutoCompleteController> autoCompleteControllers = new ArrayList<ICorporeaAutoCompleteController>();
private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]");
public static final String[] WILDCARD_STRINGS = new String[] {
"...", "~", "+", "?" , "*"
};
@@ -340,9 +340,9 @@ public final class CorporeaHelper {
return true;
return false;
}
// Copy from StringUtils
public static String stripControlCodes(String str) {
return patternControlCode.matcher(str).replaceAll("");
}
// Copy from StringUtils
public static String stripControlCodes(String str) {
return patternControlCode.matcher(str).replaceAll("");
}
}
@@ -10,7 +10,6 @@
*/
package vazkii.botania.api.item;
import vazkii.botania.api.mana.ManaItemHandler;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -29,7 +28,7 @@ public interface IBlockProvider {
* the requestor as the ItemStack passed in.
*/
public boolean provideBlock(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta, boolean doit);
/**
* Gets the amount of blocks of the type passed stored in this item. You must
* check for the block passed in to not give the counter for a wrong block. Returning
@@ -37,5 +36,5 @@ public interface IBlockProvider {
* the Rod of the Lands would return -1 if the block is dirt).
*/
public int getBlockCount(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta);
}
@@ -24,9 +24,9 @@ import net.minecraft.item.ItemStack;
public interface IManaProficiencyArmor {
public boolean shouldGiveProficiency(ItemStack stack, int slot, EntityPlayer player);
public final static class Helper {
public static boolean hasProficiency(EntityPlayer player) {
for(int i = 0; i < 4; i++) {
ItemStack armor = player.getCurrentArmor(i);
@@ -38,7 +38,7 @@ public interface IManaProficiencyArmor {
}
return false;
}
}
}
@@ -12,11 +12,11 @@ package vazkii.botania.api.item;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChunkCoordinates;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
* An item that implements this will allow for various wireframes to be drawn
@@ -58,7 +58,7 @@ public final class ContributorFancinessHandler {
if(Minecraft.getMinecraft().gameSettings.getOptionOrdinalValue(Options.SHOW_CAPE) && flowerMap != null && flowerMap.containsKey(name))
renderFlower(event, flowerMap.get(name));
}
public static void firstStart() {
if(!startedLoading) {
new ThreadContributorListLoader();
@@ -42,8 +42,6 @@ public class CorporeaAutoCompleteHandler {
List<CompletionData> completions = new ArrayList<CompletionData>();
int position;
private static final String __OBFID = "CL_00001501";
static TreeSet<String> itemNames = new TreeSet<String>(
new Comparator<String>() {
@Override
@@ -168,7 +166,7 @@ public class CorporeaAutoCompleteHandler {
}
return result;
}
private static class CompletionData implements Comparable<CompletionData> {
private String string;
@@ -72,7 +72,7 @@ public final class HUDHandler {
public void onDrawScreenPre(RenderGameOverlayEvent.Pre event) {
Minecraft mc = Minecraft.getMinecraft();
Profiler profiler = mc.mcProfiler;
if(event.type == ElementType.HEALTH) {
profiler.startSection("botania-hud");
ItemStack amulet = PlayerHandler.getPlayerBaubles(mc.thePlayer).getStackInSlot(0);
@@ -84,7 +84,7 @@ public final class HUDHandler {
profiler.endSection();
}
}
@SubscribeEvent
public void onDrawScreenPost(RenderGameOverlayEvent.Post event) {
Minecraft mc = Minecraft.getMinecraft();
@@ -276,7 +276,7 @@ public final class HUDHandler {
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, recipe.getOutput(), x + 26, y);
RenderItem.getInstance().renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, recipe.getOutput(), x + 26, y);
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
if(diluted) {
String s = StatCollector.translateToLocal("botaniamisc.pay2win");
mc.fontRenderer.drawStringWithShadow(s, res.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(s) / 2, y + 20, 0xFF8888);
@@ -103,9 +103,9 @@ public final class PresistantVariableHelper {
for(String key : keys)
GuiLexicon.notes.put(key, notesCmp.getString(key));
}
lastBotaniaVersion = cmp.hasKey(TAG_LAST_BOTANIA_VERSION) ? cmp.getString(TAG_LAST_BOTANIA_VERSION) : "(N/A)";
firstLoad = cmp.hasKey(TAG_FIRST_LOAD) ? cmp.getBoolean(TAG_FIRST_LOAD) : firstLoad;
if(firstLoad) {
GuiLexicon.currentOpenLexicon = new GuiLexiconEntry(LexiconData.welcome, new GuiLexicon());
@@ -242,7 +242,7 @@ public class ClientProxy extends CommonProxy {
LibRenderIDs.idCocoon = RenderingRegistry.getNextAvailableRenderId();
LibRenderIDs.idLightRelay = RenderingRegistry.getNextAvailableRenderId();
LibRenderIDs.idBellows = RenderingRegistry.getNextAvailableRenderId();
RenderSpecialFlower specialFlowerRender = new RenderSpecialFlower(LibRenderIDs.idSpecialFlower);
RenderingRegistry.registerBlockHandler(new RenderAltar());
RenderingRegistry.registerBlockHandler(specialFlowerRender);
@@ -11,9 +11,7 @@
package vazkii.botania.client.gui.lexicon;
import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
@@ -164,7 +162,7 @@ public class GuiLexicon extends GuiScreen {
buttonList.add(new GuiButtonAchievement(-2, left - 6, top + 26));
buttonList.add(new GuiButtonChallenges(-3, left - 6, top + 40));
GuiButtonUpdateWarning button = new GuiButtonUpdateWarning(-4, left - 6, top + 60);
GuiButtonUpdateWarning button = new GuiButtonUpdateWarning(-4, left - 6, top + 60);
buttonList.add(button);
if(PresistantVariableHelper.lastBotaniaVersion.equals(LibMisc.VERSION)) {
button.enabled = false;
@@ -345,10 +343,10 @@ public class GuiLexicon extends GuiScreen {
case -2 :
mc.displayGuiScreen(new GuiAchievementsHacky(this, mc.thePlayer.getStatFileWriter()));
break;
case -3 :
case -3 :
mc.displayGuiScreen(new GuiLexiconChallengesList());
break;
case -4 :
case -4 :
if(isShiftKeyDown()) {
try {
if(Desktop.isDesktopSupported())
@@ -364,7 +362,7 @@ public class GuiLexicon extends GuiScreen {
}
break;
case NOTES_BUTTON_ID :
case NOTES_BUTTON_ID :
notesEnabled = !notesEnabled;
break;
}
@@ -19,7 +19,6 @@ import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.handler.PresistantVariableHelper;
import vazkii.botania.client.core.helper.RenderHelper;
@@ -35,7 +34,7 @@ public class GuiButtonUpdateWarning extends GuiButtonLexicon {
public void drawButton(Minecraft par1Minecraft, int par2, int par3) {
if(!visible || !enabled)
return;
field_146123_n = par2 >= xPosition && par3 >= yPosition && par2 < xPosition + width && par3 < yPosition + height;
int k = getHoverState(field_146123_n);
@@ -52,7 +51,7 @@ public class GuiButtonUpdateWarning extends GuiButtonLexicon {
if(i == 3)
tooltip.add("");
}
int tooltipY = (tooltip.size() - 1) * 10 - 25;
if(k == 2)
RenderHelper.renderTooltip(par2 - 125, par3 + tooltipY, tooltip);
@@ -10,12 +10,10 @@
*/
package vazkii.botania.client.model;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.handler.ClientTickHandler;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import org.lwjgl.opengl.GL11;
public class ModelBellows extends ModelBase {
@@ -72,17 +70,17 @@ public class ModelBellows extends ModelBase {
float f5 = 1F / 16F;
Base.render(f5);
Pipe.render(f5);
//float fract = Math.max(0.1F, (float) (Math.sin(((double) ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) * 0.2) + 1F) * 0.5F);
float mov = (1F - fract) * 0.5F;
GL11.glTranslatef(0F, mov, 0F);
Top.render(f5);
Handle1.render(f5);
Handle2.render(f5);
Handle3.render(f5);
GL11.glTranslatef(0F, -mov, 0F);
GL11.glRotatef(180F, 1F, 0F, 0F);
GL11.glTranslatef(-0.19F, -1.375F, -0.19F);
GL11.glScalef(1F, fract, 1F);
@@ -19,7 +19,6 @@ import org.lwjgl.opengl.GL11;
import vazkii.botania.client.lib.LibRenderIDs;
import vazkii.botania.common.block.tile.mana.TileBellows;
import vazkii.botania.common.block.tile.mana.TilePump;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class RenderBellows implements ISimpleBlockRenderingHandler {
@@ -14,9 +14,6 @@ import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.Entity;
import net.minecraft.entity.projectile.EntityPotion;
import net.minecraft.item.ItemPotion;
import net.minecraft.potion.PotionHelper;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
@@ -33,46 +30,46 @@ public class RenderThornChakram extends Render {
public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
EntityThornChakram c = (EntityThornChakram) p_76986_1_;
boolean fire = c.isFire();
IIcon iicon = ModItems.thornChakram.getIconFromDamage(fire ? 1 : 0);
IIcon iicon = ModItems.thornChakram.getIconFromDamage(fire ? 1 : 0);
if(iicon != null) {
GL11.glPushMatrix();
GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glScalef(0.5F, 0.5F, 0.5F);
this.bindEntityTexture(p_76986_1_);
Tessellator tessellator = Tessellator.instance;
if(iicon != null) {
GL11.glPushMatrix();
GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glScalef(0.5F, 0.5F, 0.5F);
bindEntityTexture(p_76986_1_);
Tessellator tessellator = Tessellator.instance;
this.func_77026_a(tessellator, iicon, fire ? 240 : -1);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
}
func_77026_a(tessellator, iicon, fire ? 240 : -1);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
}
@Override
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
return TextureMap.locationItemsTexture;
}
return TextureMap.locationItemsTexture;
}
private void func_77026_a(Tessellator p_77026_1_, IIcon p_77026_2_, int light) {
float f = p_77026_2_.getMinU();
float f1 = p_77026_2_.getMaxU();
float f2 = p_77026_2_.getMinV();
float f3 = p_77026_2_.getMaxV();
float f4 = 1.0F;
float f5 = 0.5F;
float f6 = 0.25F;
GL11.glRotatef(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
p_77026_1_.startDrawingQuads();
p_77026_1_.setNormal(0.0F, 1.0F, 0.0F);
if(light != -1)
p_77026_1_.setBrightness(light);
p_77026_1_.addVertexWithUV(0.0F - f5, 0.0F - f6, 0.0D, f, f3);
p_77026_1_.addVertexWithUV(f4 - f5, 0.0F - f6, 0.0D, f1, f3);
p_77026_1_.addVertexWithUV(f4 - f5, f4 - f6, 0.0D, f1, f2);
p_77026_1_.addVertexWithUV(0.0F - f5, f4 - f6, 0.0D, f, f2);
p_77026_1_.draw();
}
private void func_77026_a(Tessellator p_77026_1_, IIcon p_77026_2_, int light) {
float f = p_77026_2_.getMinU();
float f1 = p_77026_2_.getMaxU();
float f2 = p_77026_2_.getMinV();
float f3 = p_77026_2_.getMaxV();
float f4 = 1.0F;
float f5 = 0.5F;
float f6 = 0.25F;
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
p_77026_1_.startDrawingQuads();
p_77026_1_.setNormal(0.0F, 1.0F, 0.0F);
if(light != -1)
p_77026_1_.setBrightness(light);
p_77026_1_.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, (double)f, (double)f3);
p_77026_1_.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, (double)f1, (double)f3);
p_77026_1_.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, (double)f1, (double)f2);
p_77026_1_.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, (double)f, (double)f2);
p_77026_1_.draw();
}
}
@@ -50,8 +50,8 @@ public class RenderTileAlfPortal extends TileEntitySpecialRenderer {
GL11.glTranslatef(1.25F, 0F, 1.75F);
GL11.glRotatef(90F, 0F, 1F, 0F);
}
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_LIGHTING);
renderIcon(0, 0, BlockAlfPortal.portalTex, 3, 3, 240);
@@ -10,18 +10,17 @@
*/
package vazkii.botania.client.render.tile;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelBellows;
import vazkii.botania.client.model.ModelPump;
import vazkii.botania.common.block.tile.mana.TileBellows;
import vazkii.botania.common.block.tile.mana.TilePump;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
public class RenderTileBellows extends TileEntitySpecialRenderer {
@@ -35,7 +34,7 @@ public class RenderTileBellows extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) {
TileBellows bellows = (TileBellows) tileentity;
GL11.glPushMatrix();
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glColor4f(1F, 1F, 1F, 1F);
@@ -53,5 +52,5 @@ public class RenderTileBellows extends TileEntitySpecialRenderer {
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
}
@@ -10,8 +10,6 @@
*/
package vazkii.botania.client.render.tile;
import java.nio.FloatBuffer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.OpenGlHelper;
@@ -80,16 +78,16 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer {
GL11.glScalef(1F, 0.3F, 1F);
GL11.glTranslatef(0F, 3.5F, 0F);
}
if(name.equals("kyle hyde"))
mc.renderEngine.bindTexture(textureGrayscale);
if(name.equals("dinnerbone") || name.equals("grumm")) {
GL11.glRotatef(180F, 0F, 0F, 1F);
GL11.glTranslatef(0F, -2.625F, 0F);
}
boolean render = !(name.equals("mami") || name.equals("soaryn") || (name.equals("eloraam") && jump != 0));
boolean render = !(name.equals("mami") || name.equals("soaryn") || name.equals("eloraam") && jump != 0);
if(render)
model.render();
GL11.glPopMatrix();
@@ -99,7 +97,7 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer {
mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);
ContributorFancinessHandler.firstStart();
float scale = 1F / 4F;
GL11.glTranslatef(0F, 1F, 0F);
GL11.glScalef(scale, scale, scale);
@@ -108,7 +106,7 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer {
GL11.glRotatef(90F, 0F, 1F, 0F);
GL11.glRotatef(20F, 1F, 0F, 1F);
renderIcon(((ItemManaResource) ModItems.manaResource).phiFlowerIcon);
if(name.equals("vazkii")) {
GL11.glRotatef(-20F, 1F, 0F, 1F);
GL11.glScalef(1.25F, 1.25F, 1.25F);
@@ -163,11 +161,11 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer {
GL11.glRotatef(90F, 0F, 1F, 0F);
GL11.glTranslatef(-0.5F, -1.5F, -0.4F);
renderIcon(Items.book.getIconFromDamage(0));
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
GL11.glTranslatef(0.5F, 0.5F, 0F);
GL11.glScalef(0.3F, 0.3F, 0.3F);
RenderBlocks.getInstance().renderBlockAsItem(Blocks.iron_ore, 0, 1F);
} else if(name.equals("profmobius")) {
GL11.glScalef(1.25F, 1.25F, 1.25F);
@@ -260,13 +258,13 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer {
if(icon != null) {
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
GL11.glRotatef(180F, 1F, 0F, 0F);
GL11.glTranslatef(-0.5F, -0.5F, 0F);
GL11.glTranslatef(-0.5F, -0.5F, 0F);
ShaderHelper.useShader(ShaderHelper.gold);
renderIcon(icon);
ShaderHelper.releaseShader();
}
}
GL11.glPopMatrix();
}
@@ -323,7 +321,7 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer {
GL11.glDepthMask(true);
mc.fontRenderer.drawString(s, -mc.fontRenderer.getStringWidth(s) / 2, 0, 0xFFFFFF);
}
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_BLEND);
GL11.glColor4f(1F, 1F, 1F, 1F);
@@ -12,9 +12,6 @@ package vazkii.botania.common.block;
import java.util.Random;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -34,6 +31,9 @@ import vazkii.botania.common.block.tile.TileBifrost;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockBifrost extends BlockModContainer implements ILexiconable {
@@ -61,7 +61,7 @@ public class BlockBifrost extends BlockModContainer implements ILexiconable {
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
return new ItemStack(ModItems.rainbowRod);
}
public boolean shouldSideBeRendered1(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_);
@@ -82,7 +82,7 @@ public class BlockBifrost extends BlockModContainer implements ILexiconable {
public int quantityDropped(int meta, int fortune, Random random) {
return 0;
}
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void loadTextures(TextureStitchEvent.Pre event) {
@@ -92,7 +92,7 @@ public class BlockBifrost extends BlockModContainer implements ILexiconable {
blockIcon = icon;
}
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
// NO-OP
@@ -17,16 +17,12 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import vazkii.botania.api.lexicon.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.tile.TileBifrost;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
@@ -41,12 +37,12 @@ public class BlockBifrostPerm extends BlockMod implements ILexiconable {
setStepSound(soundTypeGlass);
setTickRandomly(true);
}
@Override
public IIcon getIcon(int side, int meta) {
return ModBlocks.bifrost.getIcon(side, meta);
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
// NO-OP
@@ -67,7 +63,7 @@ public class BlockBifrostPerm extends BlockMod implements ILexiconable {
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
return shouldSideBeRendered1(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, 1 - p_149646_5_);
}
@Override
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
if(rand.nextBoolean())
@@ -23,7 +23,6 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.common.block.tile.TileCacophonium;
import vazkii.botania.common.block.tile.TileSpecialFlower;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockCacophonium extends BlockModContainer {
@@ -51,7 +50,7 @@ public class BlockCacophonium extends BlockModContainer {
protected boolean canSilkHarvest() {
return false;
}
@Override
public boolean registerInCreative() {
return false;
@@ -66,12 +65,12 @@ public class BlockCacophonium extends BlockModContainer {
if(power && !powered) {
TileEntity tile = world.getTileEntity(x, y, z);
if(tile != null && tile instanceof TileCacophonium)
((TileCacophonium) tile).annoyDirewolf();
((TileCacophonium) tile).annoyDirewolf();
world.setBlockMetadataWithNotify(x, y, z, meta | 8, 4);
} else if(!power && powered)
world.setBlockMetadataWithNotify(x, y, z, meta & -9, 4);
world.setBlockMetadataWithNotify(x, y, z, meta & -9, 4);
}
@Override
public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) {
if(!par6EntityPlayer.capabilities.isCreativeMode)
@@ -53,7 +53,7 @@ public abstract class BlockCamo extends BlockModContainer<TileCamo> {
public static boolean isValidBlock(Block block) {
return block.isOpaqueCube() || isValidRenderType(block.getRenderType());
}
public static boolean isValidRenderType(int type) {
return validRenderTypes.contains(type);
}
@@ -328,7 +328,7 @@ public final class ModBlocks {
cacophonium = new BlockCacophonium();
bellows = new BlockBellows();
bifrostPerm = new BlockBifrostPerm();
ModFluffBlocks.init();
for(int i = 0; i < 16; i++)
@@ -32,13 +32,13 @@ import vazkii.botania.common.lib.LibBlockNames;
public class BlockBellows extends BlockModContainer implements ILexiconable {
private static final int[] META_ROTATIONS = new int[] { 3, 4, 2, 5 };
public BlockBellows() {
super(Material.wood);
setHardness(2.0F);
setStepSound(soundTypeWood);
setBlockName(LibBlockNames.BELLOWS);
float f = (1F - 10 / 16F) / 2F;
setBlockBounds(f, 0F, f, 1F - f, 10F / 16F, 1F - f);
}
@@ -48,19 +48,19 @@ public class BlockBellows extends BlockModContainer implements ILexiconable {
int l = MathHelper.floor_double(p_149689_5_.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, META_ROTATIONS[l], 2);
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
// NO-OP
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int s, float xs, float ys, float zs) {
if(EntityDoppleganger.isTruePlayer(player))
((TileBellows) world.getTileEntity(x, y, z)).interact();
return true;
}
@Override
public boolean isOpaqueCube() {
return false;
@@ -80,7 +80,7 @@ public class BlockBellows extends BlockModContainer implements ILexiconable {
public int getRenderType() {
return LibRenderIDs.idBellows;
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileBellows();
@@ -171,7 +171,7 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona
@Override
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
int meta = world.getBlockMetadata(x, y, z);
switch(meta) {
case 1:
return LexiconData.gatherDrum;
@@ -126,5 +126,5 @@ public class SubTileExoflame extends SubTileFunctional {
public LexiconEntry getEntry() {
return LexiconData.exoflame;
}
}
@@ -10,36 +10,36 @@
*/
package vazkii.botania.common.block.tile;
import vazkii.botania.common.item.ItemCacophonium;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import vazkii.botania.common.item.ItemCacophonium;
public class TileCacophonium extends TileMod {
private static final String TAG_STACK = "stack";
public ItemStack stack;
public void annoyDirewolf() {
ItemCacophonium.playSound(worldObj, stack, xCoord, yCoord, zCoord, 1F);
}
@Override
public void writeCustomNBT(NBTTagCompound cmp) {
super.writeCustomNBT(cmp);
NBTTagCompound cmp1 = new NBTTagCompound();
if(stack != null)
stack.writeToNBT(cmp1);
cmp.setTag(TAG_STACK, cmp1);
}
@Override
public void readCustomNBT(NBTTagCompound cmp) {
super.readCustomNBT(cmp);
NBTTagCompound cmp1 = cmp.getCompoundTag(TAG_STACK);
stack = ItemStack.loadItemStackFromNBT(cmp1);
}
}
@@ -96,7 +96,7 @@ public class TileHourglass extends TileSimpleInventory {
return 0x5A412f;
return 0;
}
@Override
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
if(itemstack == null)
@@ -61,31 +61,31 @@ public class TileBellows extends TileMod {
furnace.furnaceCookTime = Math.min(199, furnace.furnaceCookTime + 20);
furnace.furnaceBurnTime = Math.max(0, furnace.furnaceBurnTime - 10);
}
if(furnace.getBlockType() == Blocks.lit_furnace) {
// Copypasta from BlockFurnace
int x = furnace.xCoord;
int y = furnace.yCoord;
int z = furnace.zCoord;
int l = worldObj.getBlockMetadata(x, y, z);
float f = (float)x + 0.5F;
float f1 = (float)y + 0.0F + worldObj.rand.nextFloat() * 6.0F / 16.0F;
float f2 = (float)z + 0.5F;
float f = x + 0.5F;
float f1 = y + 0.0F + worldObj.rand.nextFloat() * 6.0F / 16.0F;
float f2 = z + 0.5F;
float f3 = 0.52F;
float f4 = worldObj.rand.nextFloat() * 0.6F - 0.3F;
if(l == 4) {
worldObj.spawnParticle("smoke", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle("flame", (double)(f - f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
} else if(l == 5) {
worldObj.spawnParticle("smoke", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle("flame", (double)(f + f3), (double)f1, (double)(f2 + f4), 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
} else if(l == 2) {
worldObj.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 - f3), 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
} else if(l == 3) {
worldObj.spawnParticle("smoke", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle("flame", (double)(f + f4), (double)f1, (double)(f2 + f3), 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
worldObj.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
}
}
}
@@ -90,13 +90,13 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc
public boolean fragile = false;
public boolean isDoingTransfer = false;
public int ticksDoingTransfer = 0;
String inputKey = "";
String outputKey = "";
int ticks = 0;
boolean sendPacket = false;
@Override
public boolean isFull() {
Block blockBelow = worldObj.getBlock(xCoord, yCoord - 1, zCoord);
@@ -232,7 +232,7 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc
bellowCount++;
}
int transfRate = 1000 * (bellowCount + 1);
if(outputting) {
if(canSpare) {
if(getCurrentMana() > 0 && mana.getMana(stack) < mana.getMaxMana(stack))
@@ -274,7 +274,7 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc
if(wasDoingTransfer)
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(this);
}
ticks++;
}
@@ -384,7 +384,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
addBlock(ModFluffBlocks.enderBrickSlab);
addBlock(ModFluffBlocks.enderBrickStairs);
}
addItem(ModItems.cosmetic);
}
@@ -187,7 +187,7 @@ public final class ConfigHandler {
desc = "Set this to false to disable the 1.9 Ender features available as recipes. This only disables the recipes and entries. Old ones that are already in the world will stay.";
enderStuff19Enabled = loadPropBool("19enderStuff.enabled", desc, enderStuff19Enabled);
desc = "The quantity of Botania flower patches to generate in the world, defaults to 2, the lower the number the less patches generate.";
flowerQuantity = loadPropInt("worldgen.flower.quantity", desc, flowerQuantity);
@@ -99,10 +99,10 @@ public class CommonProxy {
ModBrewRecipes.init();
ModAchievements.init();
ModMultiblocks.init();
if(Botania.etFuturumLoaded)
ModBanners.init();
ChestGenHandler.init();
LexiconData.init();
@@ -288,7 +288,7 @@ public final class ModCraftingRecipes {
public static IRecipe recipeManaweaveLegs;
public static IRecipe recipeManaweaveBoots;
public static IRecipe recipeBifrost;
// Garden of Glass
public static IRecipe recipeRootToSapling;
public static IRecipe recipeRootToFertilizer;
@@ -1904,7 +1904,7 @@ public final class ModCraftingRecipes {
recipeStarSword = BotaniaAPI.getLatestAddedRecipe();
// Rod of the Shifting Crust Recipe
addOreDictRecipe(new ItemStack(ModItems.exchangeRod),
addOreDictRecipe(new ItemStack(ModItems.exchangeRod),
" SR", " TS", "T ",
'T', LibOreDict.LIVINGWOOD_TWIG,
'S', "stone",
@@ -1916,13 +1916,13 @@ public final class ModCraftingRecipes {
recipeGreaterMagnetRing = BotaniaAPI.getLatestAddedRecipe();
// Flare Chakram Recipe
addOreDictRecipe(new ItemStack(ModItems.thornChakram, 2, 1),
addOreDictRecipe(new ItemStack(ModItems.thornChakram, 2, 1),
"BBB", "CPC", "BBB",
'B', new ItemStack(Items.blaze_powder),
'P', LibOreDict.PIXIE_DUST,
'C', new ItemStack(ModItems.thornChakram));
recipeFireChakram = BotaniaAPI.getLatestAddedRecipe();
// Thundercaller Recipe
addOreDictRecipe(new ItemStack(ModItems.thunderSword),
" I", "AD ", "TA ",
@@ -1930,22 +1930,22 @@ public final class ModCraftingRecipes {
'D', LibOreDict.MANA_DIAMOND,
'A', LibOreDict.ENDER_AIR_BOTTLE,
'T', new ItemStack(ModItems.terraSword));
recipeThunderSword = BotaniaAPI.getLatestAddedRecipe();
recipeThunderSword = BotaniaAPI.getLatestAddedRecipe();
// Manatide Bellows Recipe
addOreDictRecipe(new ItemStack(ModBlocks.bellows),
addOreDictRecipe(new ItemStack(ModBlocks.bellows),
"SSS", "RL ", "SSS",
'S', new ItemStack(ModFluffBlocks.livingwoodSlab),
'R', LibOreDict.RUNE[3],
'L', new ItemStack(Items.leather));
recipeBellows = BotaniaAPI.getLatestAddedRecipe();
// Manaweave Cloth Recipe
addOreDictRecipe(new ItemStack(ModItems.manaResource, 1, 22),
addOreDictRecipe(new ItemStack(ModItems.manaResource, 1, 22),
"SS", "SS",
'S', LibOreDict.MANA_STRING);
recipeManaweaveCloth = BotaniaAPI.getLatestAddedRecipe();
// Manaweave Armor Recipes
addOreDictRecipe(new ItemStack(ModItems.manaweaveHelm),
"SSS", "S S",
@@ -1967,7 +1967,7 @@ public final class ModCraftingRecipes {
// Bifrost Block Recipe
addShapelessOreDictRecipe(new ItemStack(ModBlocks.bifrostPerm), new ItemStack(ModItems.rainbowRod), new ItemStack(ModBlocks.elfGlass));
recipeBifrost = BotaniaAPI.getLatestAddedRecipe();
///////////////////////////////////////////////////////////////////////////////////////////////////////////
// Storage Block/Nugget Recipes
@@ -35,7 +35,7 @@ public class ModElvenTradeRecipes {
elvenQuartzRecipe = BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModItems.quartz, 1, 5), new ItemStack(Items.quartz));
alfglassRecipe = BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModBlocks.elfGlass), new ItemStack(ModBlocks.manaGlass));
BotaniaAPI.registerElvenTradeRecipe(new ItemStack(Items.iron_ingot), new ItemStack(Items.iron_ingot));
BotaniaAPI.registerElvenTradeRecipe(new ItemStack(Blocks.iron_block), new ItemStack(Blocks.iron_block));
BotaniaAPI.registerElvenTradeRecipe(new ItemStack(Items.ender_pearl), new ItemStack(Items.ender_pearl));
@@ -48,7 +48,7 @@ public class ModManaConjurationRecipes {
leavesRecipes.add(BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Blocks.leaves, 2, i), new ItemStack(Blocks.leaves, 1, i), 2000));
for(int i = 0; i < 2; i++)
leavesRecipes.add(BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Blocks.leaves2, 2, i), new ItemStack(Blocks.leaves2, 1, i), 2000));
grassRecipe = BotaniaAPI.registerManaConjurationRecipe(new ItemStack(Blocks.tallgrass, 2, 1), new ItemStack(Blocks.tallgrass, 1, 1), 800);
}
@@ -174,7 +174,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
for(EntityPlayer p : players)
if(isTruePlayer(p))
playerCount++;
e.setPlayerCount(playerCount);
e.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.maxHealth).setBaseValue(MAX_HP * playerCount);
@@ -42,7 +42,7 @@ public class EntityThornChakram extends EntityThrowable {
protected void entityInit() {
dataWatcher.addObject(30, 0);
dataWatcher.addObject(31, (byte) 0);
dataWatcher.setObjectWatched(30);
dataWatcher.setObjectWatched(31);
}
@@ -61,7 +61,7 @@ public class EntityThornChakram extends EntityThrowable {
for(int i = 0; i < 3; i++)
worldObj.spawnParticle("flame", posX + r * (Math.random() - 0.5), posY + r * (Math.random() - 0.5), posZ + r * (Math.random() - 0.5), m * (Math.random() - 0.5), m * (Math.random() - 0.5), m * (Math.random() - 0.5));
}
int bounces = getTimesBounced();
if(bounces >= MAX_BOUNCES || ticksExisted > 60) {
EntityLivingBase thrower = getThrower();
@@ -97,7 +97,7 @@ public class EntityThornChakram extends EntityThrowable {
setDead();
}
}
private ItemStack getItemStack() {
return new ItemStack(ModItems.thornChakram, 1, isFire() ? 1 : 0);
}
@@ -143,13 +143,13 @@ public class EntityThornChakram extends EntityThrowable {
public void setTimesBounced(int times) {
dataWatcher.updateObject(30, times);
}
public boolean isFire() {
return dataWatcher.getWatchableObjectByte(31) != 0;
}
public void setFire(boolean fire) {
dataWatcher.updateObject(31, (byte) (fire ? 1 : 0));
}
}
@@ -10,11 +10,11 @@
*/
package vazkii.botania.common.integration.etfuturum;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.item.ModItems;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.item.ModItems;
public final class ModBanners {
@@ -40,9 +40,9 @@ public final class ModBanners {
addPattern(clazz, "sword", "srd", new ItemStack(Items.iron_sword));
} catch (ClassNotFoundException e) {
// Looks like we don't have EtFuturum around, let's not do any of this nonsense then
}
}
}
public static void addPattern(Class<Enum<?>> clazz, String name, String id, ItemStack craftingItem) {
name = "botania_" + name;
id = "bt_" + id;
@@ -305,7 +305,7 @@ public class ItemBlackHoleTalisman extends ItemMod implements IBlockProvider {
return true;
}
}
return false;
}
@@ -82,11 +82,11 @@ public class ItemCacophonium extends ItemMod {
boolean can = isDOIT(stack);
if(!can) {
String sound = ItemNBTHelper.getString(stack, TAG_SOUND, "");
boolean doit = isDOIT(stack);
isDOIT(stack);
if(sound != null && !sound.isEmpty())
can = true;
}
if(can) {
Block block = world.getBlock(x, y, z);
if(block == Blocks.noteblock) {
@@ -96,10 +96,10 @@ public class ItemCacophonium extends ItemMod {
return true;
}
}
return false;
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) {
if(isDOIT(stack))
@@ -130,20 +130,20 @@ public class ItemCacophonium extends ItemMod {
if(count % (isDOIT(stack) ? 20 : 6) == 0)
playSound(player.worldObj, stack, player.posX, player.posY, player.posZ, 0.9F);
}
public static void playSound(World world, ItemStack stack, double x, double y, double z, float volume) {
if(stack == null)
return;
String sound = ItemNBTHelper.getString(stack, TAG_SOUND, "");
boolean doit = isDOIT(stack);
if(doit)
sound = "botania:doit";
if(sound != null && !sound.isEmpty())
world.playSoundEffect(x, y, z, sound, volume, doit ? 1F : ((world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F + 1.0F));
world.playSoundEffect(x, y, z, sound, volume, doit ? 1F : (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F + 1.0F);
}
private static boolean isDOIT(ItemStack stack) {
return stack != null && stack.getDisplayName().equalsIgnoreCase("shia labeouf");
}
@@ -64,7 +64,7 @@ public class ItemEnderHand extends ItemMod implements IManaUsingItem, IBlockProv
public boolean provideBlock(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta, boolean doit) {
if(requestor != null && requestor.getItem() == this)
return false;
ItemStack istack = ItemExchangeRod.removeFromInventory(player, player.getInventoryEnderChest(), stack, block, meta, false);
if(istack != null) {
boolean mana = ManaItemHandler.requestManaExact(stack, player, COST_PROVIDE, false);
@@ -73,11 +73,11 @@ public class ItemEnderHand extends ItemMod implements IManaUsingItem, IBlockProv
ManaItemHandler.requestManaExact(stack, player, COST_PROVIDE, true);
ItemExchangeRod.removeFromInventory(player, player.getInventoryEnderChest(), stack, block, meta, true);
}
return true;
}
}
return false;
}
@@ -85,7 +85,7 @@ public class ItemEnderHand extends ItemMod implements IManaUsingItem, IBlockProv
public int getBlockCount(EntityPlayer player, ItemStack requestor, ItemStack stack, Block block, int meta) {
if(requestor != null && requestor.getItem() == this)
return 0;
return ItemExchangeRod.getInventoryItemCount(player, player.getInventoryEnderChest(), stack, block, meta);
}
@@ -29,30 +29,30 @@ import vazkii.botania.common.lib.LibItemNames;
public class ItemThornChakram extends ItemMod implements ICraftAchievement {
IIcon iconFire;
public ItemThornChakram() {
setUnlocalizedName(LibItemNames.THORN_CHAKRAM);
setMaxStackSize(6);
setHasSubtypes(true);
}
@Override
public void getSubItems(Item item, CreativeTabs tab, List list) {
for(int i = 0; i < 2; i++)
list.add(new ItemStack(item, 1, i));
}
@Override
public void registerIcons(IIconRegister par1IconRegister) {
itemIcon = IconHelper.forItem(par1IconRegister, this, 0);
iconFire = IconHelper.forItem(par1IconRegister, this, 1);
}
@Override
public IIcon getIconFromDamage(int dmg) {
return dmg == 0 ? itemIcon : iconFire;
}
@Override
public String getUnlocalizedName(ItemStack stack) {
return super.getUnlocalizedName() + stack.getItemDamage();
@@ -69,7 +69,7 @@ public class ItemThornChakram extends ItemMod implements ICraftAchievement {
c.setFire(p_77659_1_.getItemDamage() != 0);
p_77659_2_.spawnEntityInWorld(c);
}
return p_77659_1_;
}
@@ -263,7 +263,7 @@ public final class ModItems {
public static Item manaweaveChest;
public static Item manaweaveLegs;
public static Item manaweaveBoots;
public static void init() {
lexicon = new ItemLexicon();
petal = new ItemPetal();
@@ -408,7 +408,7 @@ public final class ModItems {
manaweaveLegs = new ItemManaweaveLegs();
manaweaveChest = new ItemManaweaveChest();
manaweaveBoots = new ItemManaweaveBoots();
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
for(int i = 0; i < 16; i++) {
OreDictionary.registerOre(LibOreDict.PETAL[i], new ItemStack(petal, 1, i));
@@ -16,7 +16,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.item.IPixieSpawner;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.item.equipment.armor.manasteel.ItemManasteelArmor;
@@ -13,7 +13,7 @@ package vazkii.botania.common.item.equipment.armor.manaweave;
import vazkii.botania.common.lib.LibItemNames;
public class ItemManaweaveBoots extends ItemManaweaveArmor {
public ItemManaweaveBoots() {
super(3, LibItemNames.MANAWEAVE_BOOTS);
}
@@ -13,7 +13,7 @@ package vazkii.botania.common.item.equipment.armor.manaweave;
import vazkii.botania.common.lib.LibItemNames;
public class ItemManaweaveChest extends ItemManaweaveArmor {
public ItemManaweaveChest() {
super(1, LibItemNames.MANAWEAVE_CHEST);
}
@@ -22,9 +22,9 @@ import vazkii.botania.common.item.equipment.tool.ToolCommons;
import vazkii.botania.common.lib.LibItemNames;
public class ItemManaweaveHelm extends ItemManaweaveArmor implements IManaDiscountArmor, IManaProficiencyArmor {
private static final int MANA_PER_DAMAGE = 30;
public ItemManaweaveHelm() {
super(0, LibItemNames.MANAWEAVE_HELM);
}
@@ -38,7 +38,7 @@ public class ItemManaweaveHelm extends ItemManaweaveArmor implements IManaDiscou
public boolean shouldGiveProficiency(ItemStack stack, int slot, EntityPlayer player) {
return hasArmorSet(player);
}
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
if(!world.isRemote && stack.getItemDamage() > 0 && ManaItemHandler.requestManaExact(stack, player, MANA_PER_DAMAGE * 2, true))
@@ -49,5 +49,5 @@ public class ItemManaweaveHelm extends ItemManaweaveArmor implements IManaDiscou
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot) {
ToolCommons.damageItem(stack, damage, entity, MANA_PER_DAMAGE);
}
}
@@ -13,7 +13,7 @@ package vazkii.botania.common.item.equipment.armor.manaweave;
import vazkii.botania.common.lib.LibItemNames;
public class ItemManaweaveLegs extends ItemManaweaveArmor {
public ItemManaweaveLegs() {
super(2, LibItemNames.MANAWEAVE_LEGS);
}
@@ -171,13 +171,13 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub
boolean isSprinting = p.isSprinting();
if(isSprinting != wasSprting)
ItemNBTHelper.setBoolean(stack, TAG_IS_SPRINTING, isSprinting);
int time = ItemNBTHelper.getInt(stack, TAG_TIME_LEFT, MAX_FLY_TIME);
int newTime = time;
Vector3 look = new Vector3(p.getLookVec());
look.y = 0;
look.normalize();
if(flying) {
if(time > 0 && !ItemNBTHelper.getBoolean(stack, TAG_INFINITE_FLIGHT, false))
newTime--;
@@ -198,10 +198,10 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub
BotaniaAPI.internalHandler.sendBaubleUpdatePacket((EntityPlayerMP) player, 0);
}
} else if(!flying) {
boolean doGlide = player.isSneaking() && !player.onGround;
boolean doGlide = player.isSneaking() && !player.onGround;
if(time < MAX_FLY_TIME && player.ticksExisted % (doGlide ? 6 : 2) == 0)
newTime++;
if(doGlide) {
player.motionY = Math.max(-0.15F, player.motionY);
float mul = 0.6F;
@@ -17,5 +17,5 @@ public class ItemGreaterMagnetRing extends ItemMagnetRing {
public ItemGreaterMagnetRing() {
super(LibItemNames.MAGNET_RING_GREATER, 16);
}
}
@@ -50,12 +50,12 @@ public class ItemMagnetRing extends ItemBauble {
});
int range;
public ItemMagnetRing() {
this(LibItemNames.MAGNET_RING, 6);
MinecraftForge.EVENT_BUS.register(this);
}
public ItemMagnetRing(String name, int range) {
super(name);
this.range = range;
@@ -16,7 +16,6 @@ import java.util.Random;
import net.minecraft.command.IEntitySelector;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.IMob;
import net.minecraft.entity.player.EntityPlayer;
@@ -36,14 +35,12 @@ import vazkii.botania.common.lib.LibItemNames;
public class ItemThunderSword extends ItemManasteelSword implements ICraftAchievement {
private static final int MANA_PER_DAMAGE = 150;
private static final String TAG_LIGHTNING_SEED = "lightningSeed";
public ItemThunderSword() {
super(BotaniaAPI.terrasteelToolMaterial, LibItemNames.THUNDER_SWORD);
}
@Override
public boolean hitEntity(ItemStack stack, EntityLivingBase entity, EntityLivingBase attacker) {
if(!(entity instanceof EntityPlayer) && entity != null) {
@@ -51,40 +48,40 @@ public class ItemThunderSword extends ItemManasteelSword implements ICraftAchiev
final List<EntityLivingBase> alreadyTargetedEntities = new ArrayList();
int dmg = 5;
long lightningSeed = ItemNBTHelper.getLong(stack, TAG_LIGHTNING_SEED, 0);
IEntitySelector selector = new IEntitySelector() {
@Override
public boolean isEntityApplicable(Entity e) {
return e instanceof EntityLivingBase && e instanceof IMob && !(e instanceof EntityPlayer) && !alreadyTargetedEntities.contains(e);
}
};
Random rand = new Random(lightningSeed);
EntityLivingBase lightningSource = entity;
for(int i = 0; i < 4; i++) {
List<EntityLivingBase> entities = entity.worldObj.getEntitiesWithinAABBExcludingEntity(lightningSource, AxisAlignedBB.getBoundingBox(lightningSource.posX - range, lightningSource.posY - range, lightningSource.posZ - range, lightningSource.posX + range, lightningSource.posY + range, lightningSource.posZ + range), selector);
if(entities.isEmpty())
break;
EntityLivingBase target = entities.get(rand.nextInt(entities.size()));
if(attacker instanceof EntityPlayer)
target.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) attacker), dmg);
else target.attackEntityFrom(DamageSource.causeMobDamage(attacker), dmg);
Botania.proxy.lightningFX(entity.worldObj, Vector3.fromEntityCenter(lightningSource), Vector3.fromEntityCenter(target), 1, 0x0179C4, 0xAADFFF);
alreadyTargetedEntities.add(target);
lightningSource = target;
dmg--;
}
if(!entity.worldObj.isRemote)
ItemNBTHelper.setLong(stack, TAG_LIGHTNING_SEED, entity.worldObj.rand.nextLong());
}
return super.hitEntity(stack, entity, attacker);
}
@@ -93,5 +90,5 @@ public class ItemThunderSword extends ItemManasteelSword implements ICraftAchiev
return ModAchievements.terrasteelWeaponCraft;
}
}
@@ -54,7 +54,7 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
public IIcon goldfishIcon = null;
public IIcon nerfBatIcon = null;
// end dank_memes
public ItemManaResource() {
super();
setUnlocalizedName(LibItemNames.MANA_RESOURCE);
@@ -18,7 +18,6 @@ import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
@@ -120,12 +119,12 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra
return;
EntityPlayer player = (EntityPlayer) entity;
int extraRange = ItemNBTHelper.getInt(stack, TAG_EXTRA_RANGE, 1);
int extraRangeNew = IManaProficiencyArmor.Helper.hasProficiency(player) ? 3 : 1;
int extraRangeNew = IManaProficiencyArmor.Helper.hasProficiency(player) ? 3 : 1;
if(extraRange != extraRangeNew)
ItemNBTHelper.setInt(stack, TAG_EXTRA_RANGE, extraRangeNew);
Block block = getBlock(stack);
int meta = getBlockMeta(stack);
if(ItemNBTHelper.getBoolean(stack, TAG_SWAPPING, false)) {
@@ -133,7 +132,7 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra
ItemNBTHelper.setBoolean(stack, TAG_SWAPPING, false);
return;
}
int x = ItemNBTHelper.getInt(stack, TAG_SELECT_X, 0);
int y = ItemNBTHelper.getInt(stack, TAG_SELECT_Y, 0);
int z = ItemNBTHelper.getInt(stack, TAG_SELECT_Z, 0);
@@ -171,9 +170,9 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra
Block block = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
boolean invalid = !BlockCamo.isValidBlock(block);
if(invalid)
if(invalid)
matrix[i][j][k] = true;
else if((block == blockToSwap && meta == metaToSwap) || block != targetBlock || meta != targetMeta)
else if(block == blockToSwap && meta == metaToSwap || block != targetBlock || meta != targetMeta)
matrix[i][j][k] = null;
else matrix[i][j][k] = false;
}
@@ -256,7 +255,7 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra
invStack.stackSize--;
if(invStack.stackSize == 0)
inv.setInventorySlotContents(i, null);
}
}
return retStack;
}
@@ -272,11 +271,11 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra
return null;
}
public static ItemStack removeFromInventory(EntityPlayer player, ItemStack stack, Block block, int meta, boolean doit) {
if(player.capabilities.isCreativeMode)
return new ItemStack(block, 1, meta);
return removeFromInventory(player, player.inventory, stack, block, meta, doit);
}
@@ -285,7 +284,7 @@ public class ItemExchangeRod extends ItemMod implements IManaUsingItem, IWirefra
return -1;
return getInventoryItemCount(player, player.inventory, stack, block, meta);
}
public static int getInventoryItemCount(EntityPlayer player, IInventory inv, ItemStack stack, Block block, int meta) {
if(player.capabilities.isCreativeMode)
return -1;
@@ -49,7 +49,7 @@ public class ItemFireRod extends ItemMod implements IManaUsingItem {
@Override
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
if(par1ItemStack.isItemDamaged() && par3Entity instanceof EntityPlayer)
if(par1ItemStack.isItemDamaged() && par3Entity instanceof EntityPlayer)
par1ItemStack.setItemDamage(par1ItemStack.getItemDamage() - (IManaProficiencyArmor.Helper.hasProficiency((EntityPlayer) par3Entity) ? 2 : 1));
}
@@ -54,7 +54,7 @@ public class ItemRainbowRod extends ItemMod implements IManaUsingItem {
boolean prof = IManaProficiencyArmor.Helper.hasProficiency(par3EntityPlayer);
int maxlen = prof ? 160 : 100;
int time = prof ? (int) (TIME * 1.6) : TIME;
while(count < maxlen && (int) lx == (int) x && (int) ly == (int) y && (int) lz == (int) z || count < 4 || par2World.getBlock((int) x, (int) y, (int) z).isAir(par2World, (int) x, (int) y, (int) z) || par2World.getBlock((int) x, (int) y, (int) z) == place) {
if(y >= 256 || y <= 0)
break;
@@ -90,17 +90,17 @@ public class ItemRainbowRod extends ItemMod implements IManaUsingItem {
return par1ItemStack;
}
@Override
public ItemStack getContainerItem(ItemStack itemStack) {
return itemStack.copy();
}
@Override
public boolean hasContainerItem(ItemStack stack) {
return getContainerItem(stack) != null;
}
@Override
public boolean doesContainerItemLeaveCraftingGrid(ItemStack par1ItemStack) {
return false;
@@ -22,5 +22,5 @@ public class HLexiconEntry extends ALexiconEntry {
public String getWebLink() {
return "http://heads.freshcoal.com/usernames.php";
}
}
@@ -433,7 +433,7 @@ public final class LexiconData {
bellows = new BLexiconEntry(LibLexicon.MANA_BELLOWS, categoryMana);
bellows.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeBellows));
// FUNCTIONAL FLOWERS ENTRIES
functionalIntro = new BLexiconEntry(LibLexicon.FFLOWER_INTRO, categoryFunctionalFlowers);
functionalIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageCraftingRecipe("4", ModCraftingRecipes.recipeRedstoneRoot)).setIcon(null);;
@@ -595,7 +595,7 @@ public final class LexiconData {
conjurationCatalyst = new ALexiconEntry(LibLexicon.DEVICE_MANA_CONJURATION, categoryDevices);
conjurationCatalyst.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeConjurationCatalyst), new PageManaInfusionRecipe("2", ModManaConjurationRecipes.redstoneRecipe), new PageManaInfusionRecipe("3", ModManaConjurationRecipes.glowstoneRecipe), new PageManaInfusionRecipe("4", ModManaConjurationRecipes.quartzRecipe),
new PageManaInfusionRecipe("5", ModManaConjurationRecipes.coalRecipe), new PageManaInfusionRecipe("6", ModManaConjurationRecipes.snowballRecipe), new PageManaInfusionRecipe("7", ModManaConjurationRecipes.netherrackRecipe), new PageManaInfusionRecipe("8", ModManaConjurationRecipes.soulSandRecipe), new PageManaInfusionRecipe("9", ModManaConjurationRecipes.gravelRecipe),
new PageManaInfusionRecipe("5", ModManaConjurationRecipes.coalRecipe), new PageManaInfusionRecipe("6", ModManaConjurationRecipes.snowballRecipe), new PageManaInfusionRecipe("7", ModManaConjurationRecipes.netherrackRecipe), new PageManaInfusionRecipe("8", ModManaConjurationRecipes.soulSandRecipe), new PageManaInfusionRecipe("9", ModManaConjurationRecipes.gravelRecipe),
new PageManaInfusionRecipe("10", ModManaConjurationRecipes.leavesRecipes), new PageManaInfusionRecipe("11", ModManaConjurationRecipes.grassRecipe));
spectralPlatform = new ALexiconEntry(LibLexicon.DEVICE_SPECTRAL_PLATFORM, categoryDevices);
@@ -745,7 +745,7 @@ public final class LexiconData {
fireChakram = new ALexiconEntry(LibLexicon.TOOL_FIRE_CHAKRAM, categoryTools);
fireChakram.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeFireChakram));
overgrowthSeed = new BLexiconEntry(LibLexicon.TOOL_OVERGROWTH_SEED, categoryTools);
overgrowthSeed.setLexiconPages(new PageText("0")).setIcon(new ItemStack(ModItems.overgrowthSeed));
@@ -769,10 +769,10 @@ public final class LexiconData {
exchangeRod = new BLexiconEntry(LibLexicon.TOOL_EXCHANGE_ROD, categoryTools);
exchangeRod.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageCraftingRecipe("3", ModCraftingRecipes.recipeExchangeRod));
manaweave = new BLexiconEntry(LibLexicon.TOOL_MANAWEAVE, categoryTools);
manaweave.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeManaweaveCloth), new PageCraftingRecipe("3", ModCraftingRecipes.recipeManaweaveHelm), new PageCraftingRecipe("4", ModCraftingRecipes.recipeManaweaveChest), new PageCraftingRecipe("5", ModCraftingRecipes.recipeManaweaveLegs), new PageCraftingRecipe("6", ModCraftingRecipes.recipeManaweaveBoots));
// ENDER ENTRIES
enderAir = new BLexiconEntry(LibLexicon.ENDER_AIR, categoryEnder);
enderAir.setPriority().setLexiconPages(new PageText("0"));
@@ -841,7 +841,7 @@ public final class LexiconData {
thunderSword = new ALexiconEntry(LibLexicon.ENDER_THUNDER_SWORD, categoryEnder);
thunderSword.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipeThunderSword));
// BAUBLES ENTRIES
baublesIntro = new BLexiconEntry(LibLexicon.BAUBLE_INTRO, categoryBaubles);
baublesIntro.setPriority().setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_BAUBLES), new PageText("2"));
@@ -1042,7 +1042,7 @@ public final class LexiconData {
tcIntegration = new CLexiconEntry(LibLexicon.MISC_TC_INTEGRATION, BotaniaAPI.categoryMisc, "Thaumcraft");
tcIntegration.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeHelmetOfRevealing), new PageText("3"), new PageManaInfusionRecipe("4", ModManaInfusionRecipes.manaInkwellRecipe), new PageText("5"), new PageBrew(ModBrewRecipes.warpWardBrew, "6a", "6b")).setIcon(new ItemStack(ModItems.manaInkwell));
}
if(Botania.etFuturumLoaded) {
banners = new CLexiconEntry(LibLexicon.MISC_BANNERS, BotaniaAPI.categoryMisc, "EtFuturum");
banners.setLexiconPages(new PageText("0"), new PageImage("1", LibResources.ENTRY_BANNERS)).setIcon(new ItemStack(ModItems.lexicon));
@@ -156,7 +156,7 @@ public final class LibItemNames {
public static final String MANAWEAVE_CHEST = "manaweaveChest";
public static final String MANAWEAVE_LEGS = "manaweaveLegs";
public static final String MANAWEAVE_BOOTS = "manaweaveBoots";
public static final String[] LENS_NAMES = new String[] {
"lensNormal",
"lensSpeed",