This commit is contained in:
Lizbeth Rika committed 2015-01-18 17:16:58 +00:00
1 parent 0fcb96c50d
commit 9508b8889b
174 files changed
+808 -972

No files matched your search

@@ -60,7 +60,7 @@ public final class BotaniaAPI {
public static Map<String, KnowledgeType> knowledgeTypes = new HashMap<String, KnowledgeType>();
public static Map<String, Brew> brewMap = new LinkedHashMap<String, Brew>();
public static List<RecipePetals> petalRecipes = new ArrayList<RecipePetals>();
public static List<RecipeRuneAltar> runeAltarRecipes = new ArrayList<RecipeRuneAltar>();
public static List<RecipeManaInfusion> manaInfusionRecipes = new ArrayList<RecipeManaInfusion>();
@@ -96,9 +96,9 @@ public final class BotaniaAPI {
public static LexiconCategory categoryBaubles;
public static LexiconCategory categoryAlfhomancy;
public static LexiconCategory categoryMisc;
public static Brew fallbackBrew = new Brew("fallback", "botania.brew.fallback", 0, 0);
static {
registerSubTile("", DummySubTile.class);
@@ -202,7 +202,7 @@ public final class BotaniaAPI {
knowledgeTypes.put(id, type);
return type;
}
/**
* Registers a Brew and returns it.
*/
@@ -220,7 +220,7 @@ public final class BotaniaAPI {
return brewMap.get(key);
return fallbackBrew;
}
/**
* Registers a Petal Recipe.
* @param output The ItemStack to craft.
@@ -294,7 +294,7 @@ public final class BotaniaAPI {
elvenTradeRecipes.add(recipe);
return recipe;
}
/**
* Registers a Brew Recipe (for the Botanical Brewery).
* @param brew The brew in to be set in this recipe.
@@ -13,7 +13,6 @@ package vazkii.botania.api.boss;
import java.awt.Rectangle;
import net.minecraft.entity.boss.BossStatus;
import net.minecraft.entity.boss.IBossDisplayData;
import net.minecraft.util.ResourceLocation;
import cpw.mods.fml.relauncher.Side;
@@ -28,7 +27,7 @@ import cpw.mods.fml.relauncher.SideOnly;
* if that's not the case.
*/
public interface IBotaniaBoss extends IBossDisplayData {
/**
* The ResourceLocation to bind for this boss's boss bar.
* You can use BotaniaAPI.internalMethodHandler.getDefaultBossBarTexture() to get
@@ -36,7 +35,7 @@ public interface IBotaniaBoss extends IBossDisplayData {
*/
@SideOnly(Side.CLIENT)
public ResourceLocation getBossBarTexture();
/**
* A Rectangle instance delimiting the uv, width and height of this boss's
* boss bar texture. This is for the background, not the bar that shows
@@ -44,19 +43,19 @@ public interface IBotaniaBoss extends IBossDisplayData {
*/
@SideOnly(Side.CLIENT)
public Rectangle getBossBarTextureRect();
/**
* A Rectangle instance delimiting the uv, width and height of this boss's
* boss bar HP texture. This is for the foreground that shows how much
* HP the boss has. The width of the rectangle will be multiplied by the
* HP the boss has. The width of the rectangle will be multiplied by the
* faction of the boss's current HP by max HP.
*/
@SideOnly(Side.CLIENT)
public Rectangle getBossBarHPTextureRect();
/**
* A callback for when this boss's boss bar renders, you can do aditional rendering
* here if needed.
* here if needed.
*/
@SideOnly(Side.CLIENT)
public void bossBarRenderCallback();
@@ -29,15 +29,15 @@ public interface IBotaniaBossWithShader extends IBotaniaBoss {
* you don't want a shader to be used. You can use separate shaders
* for the background and foreground.
* @param background True if rendering the background of the boss bar,
* false if rendering the bar itself that shows the HP.
* false if rendering the bar itself that shows the HP.
*/
@SideOnly(Side.CLIENT)
public int getBossBarShaderProgram(boolean background);
/**
* A callback for the shader, used to pass in uniforms. Return null for no callback.
*/
@SideOnly(Side.CLIENT)
public ShaderCallback getBossBarShaderCallback(boolean background, int shader);
}
+14 -14
View File
@@ -29,7 +29,7 @@ public class Brew {
int cost;
List<PotionEffect> effects;
boolean canInfuseBloodPendant = true;
/**
* @param name The unlocalized name of this potion.
* @param color The color for the potion to be rendered in the bottle, note that it will get
@@ -44,7 +44,7 @@ public class Brew {
this.cost = cost;
this.effects = new ArrayList(Arrays.asList(effects));
}
/**
* Sets this brew to not be able to be infused onto the Tainted Blood Pendant.
*/
@@ -52,11 +52,11 @@ public class Brew {
canInfuseBloodPendant = false;
return this;
}
public boolean canInfuseBloodPendant() {
return canInfuseBloodPendant;
}
/**
* Returns the key for this brew, for it to be found in the map in the API.
* This should ALWAYS return the same result.
@@ -64,51 +64,51 @@ public class Brew {
public String getKey() {
return key;
}
/**
* Gets the insensitive unlocalized name. This is used for the lexicon.
*/
public String getUnlocalizedName() {
return name;
}
/**
* Gets the unlocalized name for the ItemStack passed in.
*/
public String getUnlocalizedName(ItemStack stack) {
return getUnlocalizedName();
}
/**
* Gets the display color for the ItemStack passed in. Note that for
* the lexicon, this passes in a botania Managlass Vial or an
* Gets the display color for the ItemStack passed in. Note that for
* the lexicon, this passes in a botania Managlass Vial or an
* Alfglass Flask at all times.
*/
public int getColor(ItemStack stack) {
return color;
}
/**
* Gets the insensitive unlocalized mana cost. This is used for the lexicon.
*/
public int getManaCost() {
return cost;
}
/**
* Gets the mana cost for the ItemStack passed in.
*/
public int getManaCost(ItemStack stack) {
return getManaCost();
}
/**
* Gets the list of potion effects for the ItemStack passed in.
* Note that for the lexicon, this passes in a botania Managlass
* Note that for the lexicon, this passes in a botania Managlass
* Vial or an Alfglass Flask at all times.
*/
public List<PotionEffect> getPotionEffects(ItemStack stack) {
return effects;
}
}
@@ -25,12 +25,12 @@ public interface IBrewContainer {
* passed in.
*/
public ItemStack getItemForBrew(Brew brew, ItemStack stack);
/**
* Gets the cost to add this brew onto this container. Return -1
* to not allow for the brew to be added. Normally you'd
* use brew.getManaCost(stack);
*/
public int getManaCost(Brew brew, ItemStack stack);
}
@@ -19,7 +19,7 @@ import net.minecraft.item.ItemStack;
* from going back into the brewery but other mods might use it for whatever.
*/
public interface IBrewItem {
public Brew getBrew(ItemStack brew);
}
@@ -43,7 +43,7 @@ public class DummyMethodHandler implements IInternalMethodHandler {
public LexiconPage elfPaperTextPage(String key) {
return dummyPage(key);
}
@Override
public LexiconPage imagePage(String key, String resource) {
return dummyPage(key);
@@ -98,7 +98,7 @@ public class DummyMethodHandler implements IInternalMethodHandler {
public LexiconPage elvenTradesPage(String key, RecipeElvenTrade recipe) {
return dummyPage(key);
}
@Override
public LexiconPage brewPage(String key, String bottomText, RecipeBrew recipe) {
return dummyPage(key);
@@ -112,7 +112,7 @@ public class DummyMethodHandler implements IInternalMethodHandler {
public ItemStack getSubTileAsStack(String subTile) {
return new ItemStack(Blocks.stone, 0, 0);
}
@Override
public ItemStack getSubTileAsFloatingFlowerStack(String subTile) {
return getSubTileAsStack(subTile);
@@ -43,7 +43,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public interface IInternalMethodHandler {
public LexiconPage textPage(String key);
public LexiconPage elfPaperTextPage(String key);
public LexiconPage imagePage(String key, String resource);
@@ -67,13 +67,13 @@ public interface IInternalMethodHandler {
public LexiconPage elvenTradePage(String key, List<RecipeElvenTrade> recipes);
public LexiconPage elvenTradesPage(String key, RecipeElvenTrade recipe);
public LexiconPage brewPage(String key, String bottomText, RecipeBrew recipe);
public IManaNetwork getManaNetworkInstance();
public ItemStack getSubTileAsStack(String subTile);
public ItemStack getSubTileAsFloatingFlowerStack(String subTile);
public IIcon getSubTileIconForName(String name);
@@ -94,12 +94,12 @@ public interface IInternalMethodHandler {
@SideOnly(Side.CLIENT)
public ResourceLocation getDefaultBossBarTexture();
@SideOnly(Side.CLIENT)
public void setBossStatus(IBotaniaBoss status);
public boolean isBuildcraftPipe(TileEntity tile);
public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m);
}
@@ -15,7 +15,7 @@ package vazkii.botania.api.internal;
* A Callback for when a shader is called. Used to define shader uniforms.
*/
public abstract class ShaderCallback {
public abstract void call(int shader);
}
@@ -33,7 +33,7 @@ public interface IBaubleRender {
* Called for the rendering of the bauble on the player. The player instance can be
* acquired through the event parameter. Transformations are already applied for
* the RenderType passed in. Make sure to check against the type parameter for
* rendering.
* rendering.
*/
@SideOnly(Side.CLIENT)
public void onPlayerBaubleRender(ItemStack stack, RenderPlayerEvent event, RenderType type);
@@ -51,7 +51,7 @@ public interface IBaubleRender {
public static void applySneakingRotation() {
GL11.glRotatef(28.64789F, 1.0F, 0.0F, 0.0F);
}
public static void translateToHeadLevel(EntityPlayer player) {
GL11.glTranslated(0, (player != Minecraft.getMinecraft().thePlayer ? 1.62F : 0F) - player.getDefaultEyeHeight() + (player.isSneaking() ? 0.0625 : 0), 0);
}
@@ -11,7 +11,6 @@
*/
package vazkii.botania.api.item;
import vazkii.botania.api.mana.IManaPool;
/**
* Used to define a Mana Pool that can be dyed through floral powder.
@@ -19,8 +18,8 @@ import vazkii.botania.api.mana.IManaPool;
public interface IDyablePool {
public int getColor();
public void setColor(int color);
}
@@ -1,22 +1,22 @@
/**
* This class was created by <SpitefulFox>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* File Created @ [? (GMT)]
*/
* This class was created by <SpitefulFox>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* File Created @ [? (GMT)]
*/
package vazkii.botania.api.item;
import net.minecraft.world.World;
/**
* A BiomeGenBase that implements this will not have Botania flowers generated.
*/
* A BiomeGenBase that implements this will not have Botania flowers generated.
*/
public interface IFlowerlessBiome {
/**
* @return Should this world be allowed to generate flowers?
*/
* @return Should this world be allowed to generate flowers?
*/
public boolean canGenerateFlowers(World world, int x, int z);
}
@@ -14,11 +14,11 @@ package vazkii.botania.api.item;
import net.minecraft.world.World;
/**
* A BlockBush can implement this to check if it can be broken
* A BlockBush can implement this to check if it can be broken
* by a Horn/Drum of the Wild or not.
*/
public interface IGrassHornExcempt {
public boolean canUproot(World world, int x, int y, int z);
}
@@ -26,5 +26,5 @@ public interface IManaDissolvable {
* size 0 the item is killed. This is called in both the server and client.
*/
public void onDissolveTick(IManaPool pool, ItemStack stack, EntityItem item);
}
@@ -18,7 +18,7 @@ package vazkii.botania.api.lexicon;
public interface ITwoNamedPage {
public void setSecondUnlocalizedName(String name);
public String getSecondUnlocalizedName();
}
@@ -19,7 +19,7 @@ import net.minecraft.util.ResourceLocation;
public class LexiconCategory implements Comparable<LexiconCategory> {
private static int count = 0;
public final String unlocalizedName;
public final List<LexiconEntry> entries = new ArrayList<LexiconEntry>();
private final int sortingId;
@@ -38,7 +38,7 @@ public class LexiconCategory implements Comparable<LexiconCategory> {
public String getUnlocalizedName() {
return unlocalizedName;
}
/**
* Sets the priority for this category for sorting. Higher numbers
* means they'll appear first in the book. The basics category
@@ -52,11 +52,11 @@ public class LexiconCategory implements Comparable<LexiconCategory> {
this.priority = priority;
return this;
}
public int getSortingPriority() {
return priority;
}
public final int getSortingId() {
return sortingId;
}
@@ -36,7 +36,7 @@ public interface ISparkAttachable extends IManaReceiver {
* Should NEVER return negative values. Make sure to check against that.
*/
public int getAvailableSpaceForMana();
/**
* Gets the Spark that is attached to this block. A common implementation is
* to check for Spark entities above:
@@ -28,7 +28,7 @@ public class RecipeBrew {
public RecipeBrew(Brew brew, Object... inputs) {
this.brew = brew;
List<Object> inputsToSet = new ArrayList();
for(Object obj : inputs) {
if(obj instanceof String || obj instanceof ItemStack)
@@ -49,7 +49,7 @@ public class RecipeBrew {
if(stack.getItem() instanceof IBrewContainer)
continue;
int stackIndex = -1, oredictIndex = -1;
for(int j = 0; j < inputsMissing.size(); j++) {
@@ -95,11 +95,11 @@ public class RecipeBrew {
public List<Object> getInputs() {
return new ArrayList(inputs);
}
public Brew getBrew() {
return brew;
}
public int getManaUsage() {
return brew.getManaCost();
}
@@ -108,7 +108,7 @@ public class RecipeBrew {
if(stack == null || !(stack.getItem() instanceof IBrewContainer))
return new ItemStack(Items.glass_bottle); // Fallback...
IBrewContainer container = (IBrewContainer) stack.getItem();
return container.getItemForBrew(brew, stack);
}
@@ -31,13 +31,13 @@ public class RecipeManaInfusion {
}
public boolean matches(ItemStack stack) {
if(input instanceof ItemStack) {
ItemStack inputCopy = ((ItemStack) input).copy();
if(inputCopy.getItemDamage() == Short.MAX_VALUE)
inputCopy.setItemDamage(stack.getItemDamage());
return stack.isItemEqual((ItemStack) inputCopy);
return stack.isItemEqual(inputCopy);
}
if(input instanceof String) {
@@ -11,8 +11,8 @@
*/
package vazkii.botania.api.subtile;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.entity.EntityLivingBase;
@@ -26,8 +26,8 @@ import net.minecraft.world.World;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.wand.IWandBindable;
import java.util.ArrayList;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
* A Sub-TileEntity, this is used for the flower system. Make sure to map subclasses
@@ -11,25 +11,15 @@
*/
package vazkii.botania.client.core.handler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.RenderPlayerEvent;
import org.lwjgl.opengl.GL11;
import vazkii.botania.api.item.IBaubleRender;
import vazkii.botania.api.item.IBaubleRender.RenderType;
import vazkii.botania.client.core.helper.ShaderHelper;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.core.handler.ConfigHandler;
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
import baubles.common.container.InventoryBaubles;
import baubles.common.lib.PlayerHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
@@ -40,12 +30,12 @@ public final class BaubleRenderHandler {
public void onPlayerRender(RenderPlayerEvent.Specials.Post event) {
if(!ConfigHandler.renderBaubles)
return;
EntityPlayer player = event.entityPlayer;
InventoryBaubles inv = PlayerHandler.getPlayerBaubles(player);
dispatchRenders(inv, event, RenderType.BODY);
float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick;
float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick;
float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick;
@@ -69,5 +59,5 @@ public final class BaubleRenderHandler {
}
}
}
}
@@ -34,17 +34,17 @@ public final class BossBarHandler {
public static final ResourceLocation defaultBossBar = new ResourceLocation(LibResources.GUI_BOSS_BAR);
static IBotaniaBoss currentBoss;
private static final BarCallback barUniformCallback = new BarCallback();
public static void setCurrentBoss(IBotaniaBoss status) {
currentBoss = status;
}
public static void render(ScaledResolution res) {
if(currentBoss == null)
return;
Minecraft mc = Minecraft.getMinecraft();
Rectangle bgRect = currentBoss.getBossBarTextureRect();
Rectangle fgRect = currentBoss.getBossBarHPTextureRect();
@@ -56,7 +56,7 @@ public final class BossBarHandler {
int yf = y + (bgRect.height - fgRect.height) / 2;
int fw = (int) ((double) fgRect.width * (currentBoss.getHealth() / currentBoss.getMaxHealth()));
int tx = c - mc.fontRenderer.getStringWidth(name) / 2;
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
@@ -66,52 +66,52 @@ public final class BossBarHandler {
drawBar(xf, yf, fgRect.x, fgRect.y, fw, fgRect.height, false);
mc.fontRenderer.drawStringWithShadow(name, tx, y - 10, 0xA2018C);
GL11.glDisable(GL11.GL_BLEND);
Entity e = (Entity) currentBoss;
EntityPlayer p = mc.thePlayer;
if(e.isDead || !p.worldObj.loadedEntityList.contains(e) || MathHelper.pointDistanceSpace(e.posX, e.posY, e.posZ, p.posX, p.posY, p.posZ) > 32)
currentBoss = null;
}
public static void drawBar(int x, int y, int u, int v, int w, int h, boolean bg) {
boolean useShader = currentBoss instanceof IBotaniaBossWithShader;
boolean useShader = currentBoss instanceof IBotaniaBossWithShader;
if(useShader) {
IBotaniaBossWithShader shader = (IBotaniaBossWithShader) currentBoss;
int program = shader.getBossBarShaderProgram(bg);
ShaderCallback callback = program == 0 ? null : shader.getBossBarShaderCallback(bg, program);
barUniformCallback.set(u, v, callback);
ShaderHelper.useShader(program, barUniformCallback);
}
RenderHelper.drawTexturedModalRect(x, y, 0, u, v, w, h);
if(useShader)
ShaderHelper.releaseShader();
}
static class BarCallback extends ShaderCallback {
int x, y;
ShaderCallback callback;
@Override
public void call(int shader) {
int startXUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "startX");
int startYUniform = ARBShaderObjects.glGetUniformLocationARB(shader, "startY");
ARBShaderObjects.glUniform1iARB(startXUniform, x);
ARBShaderObjects.glUniform1iARB(startYUniform, y);
if(callback != null)
callback.call(shader);
}
void set(int x, int y, ShaderCallback callback) {
this.x = x;
this.y = y;
this.callback = callback;
}
}
}
@@ -70,7 +70,7 @@ public final class HUDHandler {
if(event.type == ElementType.ALL) {
profiler.startSection("botania-hud");
MovingObjectPosition pos = mc.objectMouseOver;
if(pos != null) {
Block block = mc.theWorld.getBlock(pos.blockX, pos.blockY, pos.blockZ);
TileEntity tile = mc.theWorld.getTileEntity(pos.blockX, pos.blockY, pos.blockZ);
@@ -97,7 +97,7 @@ public final class HUDHandler {
ItemCraftingHalo.renderHUD(event.resolution, mc.thePlayer, equippedStack);
profiler.endSection();
}
profiler.startSection("manaBar");
EntityPlayer player = mc.thePlayer;
int totalMana = 0;
@@ -142,7 +142,7 @@ public final class HUDHandler {
BossBarHandler.render(event.resolution);
profiler.endSection();
profiler.endSection();
GL11.glColor4f(1F, 1F, 1F, 1F);
}
}
@@ -60,7 +60,7 @@ public class LightningHandler {
@SubscribeEvent
public void onRenderWorldLast(RenderWorldLastEvent event) {
Profiler profiler = Minecraft.getMinecraft().mcProfiler;
profiler.startSection("botania-particles");
ParticleRenderDispatcher.dispatch();
profiler.startSection("redString");
@@ -32,7 +32,7 @@ public final class RedStringRenderer {
public static final Queue<TileRedString> redStringTiles = new ArrayDeque();
static float sizeAlpha = 0F;
public static void renderAll() {
if(!redStringTiles.isEmpty()) {
GL11.glPushMatrix();
@@ -48,7 +48,7 @@ public final class RedStringRenderer {
TileRedString tile;
while((tile = redStringTiles.poll()) != null)
renderTile(tile);
if(lighting)
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_TEXTURE_2D);
@@ -57,7 +57,7 @@ public final class RedStringRenderer {
}
}
public static void tick() {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
boolean hasWand = player != null && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == ModItems.twigWand;
@@ -66,11 +66,11 @@ public final class RedStringRenderer {
else if(sizeAlpha < 1F &&hasWand)
sizeAlpha += 0.1F;
}
private static void renderTile(TileRedString tile) {
ForgeDirection dir = ForgeDirection.getOrientation(tile.getBlockMetadata());
ChunkCoordinates bind = tile.getBinding();
if(bind != null) {
GL11.glPushMatrix();
GL11.glTranslated(tile.xCoord + 0.5 - RenderManager.renderPosX, tile.yCoord + 0.5 - RenderManager.renderPosY, tile.zCoord + 0.5 - RenderManager.renderPosZ);
@@ -80,11 +80,11 @@ public final class RedStringRenderer {
Vector3 vecApply = vecMag.copy();
int stages = (int) (vecOrig.mag() / vecMag.mag());
Tessellator tessellator = Tessellator.instance;
GL11.glLineWidth(1F);
tessellator.startDrawing(GL11.GL_LINES);
double len = (double) -ClientTickHandler.ticksInGame / 100F + new Random(dir.ordinal() ^ tile.xCoord ^ tile.yCoord ^ tile.zCoord).nextInt(10000);
double add = vecMag.mag();
double rand = Math.random() - 0.5;
@@ -97,11 +97,11 @@ public final class RedStringRenderer {
}
tessellator.draw();
GL11.glPopMatrix();
}
}
private static void addVertexAtWithTranslation(Tessellator tess, ForgeDirection dir, double xpos, double ypos, double zpos, double rand, double l) {
double freq = 20;
double ampl = (0.15 * (Math.sin(l * 2F) * 0.5 + 0.5) + 0.1) * sizeAlpha;
@@ -109,8 +109,8 @@ public final class RedStringRenderer {
double x = xpos + Math.sin(l * freq) * ampl * Math.abs(Math.abs(dir.offsetX) - 1) + rand * randMul;
double y = ypos + Math.cos(l * freq) * ampl * Math.abs(Math.abs(dir.offsetY) - 1) + rand * randMul;
double z = zpos + (dir.offsetY == 0 ? Math.sin(l * freq) : Math.cos(l * freq)) * ampl * Math.abs(Math.abs(dir.offsetZ) - 1) + rand * randMul;
tess.addVertex(x, y, z);
}
}
@@ -194,7 +194,7 @@ public final class RenderHelper {
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glPopMatrix();
}
public static void renderProgressPie(int x, int y, float progress, ItemStack stack) {
Minecraft mc = Minecraft.getMinecraft();
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, stack, x, y);
@@ -207,14 +207,14 @@ public final class RenderHelper {
GL11.glStencilOp(GL11.GL_REPLACE, GL11.GL_KEEP, GL11.GL_KEEP);
GL11.glStencilMask(0xFF);
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, stack, x, y);
mc.renderEngine.bindTexture(new ResourceLocation(LibResources.GUI_MANA_HUD));
int r = 10;
int centerX = x + 8;
int centerY = y + 8;
int degs = (int) (360 * progress);
float a = 0.5F + 0.2F * ((float) Math.cos((double) ClientTickHandler.ticksInGame / 10) * 0.5F + 0.5F);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_SMOOTH);
@@ -33,13 +33,13 @@ import vazkii.botania.api.item.IExtendedPlayerController;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.wiki.IWikiProvider;
import vazkii.botania.api.wiki.WikiHooks;
import vazkii.botania.client.core.handler.BaubleRenderHandler;
import vazkii.botania.client.core.handler.BotaniaPlayerController;
import vazkii.botania.client.core.handler.BoundTileRenderer;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.handler.DebugHandler;
import vazkii.botania.client.core.handler.HUDHandler;
import vazkii.botania.client.core.handler.LightningHandler;
import vazkii.botania.client.core.handler.BaubleRenderHandler;
import vazkii.botania.client.core.handler.TooltipHandler;
import vazkii.botania.client.core.helper.ShaderHelper;
import vazkii.botania.client.fx.FXSparkle;
@@ -119,7 +119,7 @@ import cpw.mods.fml.relauncher.ReflectionHelper;
public class ClientProxy extends CommonProxy {
public static boolean singAnnoyingChristmasSongsTillVazkiisHeadExplodesFromAllTheDamnJingle = false;
@Override
public void init(FMLInitializationEvent event) {
super.init(event);
@@ -138,13 +138,13 @@ public class ClientProxy extends CommonProxy {
// Jingle bells jingle bells
Calendar calendar = Calendar.getInstance();
if((calendar.get(2) == 11 && calendar.get(5) >= 24 && calendar.get(5) <= 26) || (calendar.get(2) == 0 && calendar.get(5) <= 6))
singAnnoyingChristmasSongsTillVazkiisHeadExplodesFromAllTheDamnJingle = true;
Calendar calendar = Calendar.getInstance();
if(calendar.get(2) == 11 && calendar.get(5) >= 24 && calendar.get(5) <= 26 || calendar.get(2) == 0 && calendar.get(5) <= 6)
singAnnoyingChristmasSongsTillVazkiisHeadExplodesFromAllTheDamnJingle = true;
initRenderers();
}
private void initRenderers() {
LibRenderIDs.idAltar = RenderingRegistry.getNextAvailableRenderId();
LibRenderIDs.idSpecialFlower = RenderingRegistry.getNextAvailableRenderId();
@@ -168,7 +168,7 @@ public class ClientProxy extends CommonProxy {
RenderTransparentItem renderTransparentItem = new RenderTransparentItem();
RenderFloatingFlowerItem renderFloatingFlower = new RenderFloatingFlowerItem();
MinecraftForgeClient.registerItemRenderer(ModItems.lens, new RenderLens());
if(ConfigHandler.lexicon3dModel)
MinecraftForgeClient.registerItemRenderer(ModItems.lexicon, new RenderLexicon());
@@ -205,7 +205,7 @@ public class ClientProxy extends CommonProxy {
ShaderHelper.initShaders();
}
@Override
@Optional.Method(modid = "NotEnoughItems")
public void registerNEIStuff() {
@@ -24,37 +24,37 @@ public class ContainerCraftingHalo extends ContainerWorkbench {
super(p_i1808_1_, p_i1808_2_, 0, 0, 0);
craftMatrix = new InventoryCraftingHalo(this, 3, 3);
inventorySlots.clear();
inventoryItemStacks.clear();
// Le copypasta
this.addSlotToContainer(new SlotCrafting(p_i1808_1_.player, this.craftMatrix, this.craftResult, 0, 124, 35));
int l;
int i1;
addSlotToContainer(new SlotCrafting(p_i1808_1_.player, craftMatrix, craftResult, 0, 124, 35));
int l;
int i1;
for (l = 0; l < 3; ++l)
{
for (i1 = 0; i1 < 3; ++i1)
{
this.addSlotToContainer(new Slot(this.craftMatrix, i1 + l * 3, 30 + i1 * 18, 17 + l * 18));
}
}
for (l = 0; l < 3; ++l)
{
for (i1 = 0; i1 < 3; ++i1)
{
addSlotToContainer(new Slot(craftMatrix, i1 + l * 3, 30 + i1 * 18, 17 + l * 18));
}
}
for (l = 0; l < 3; ++l)
{
for (i1 = 0; i1 < 9; ++i1)
{
this.addSlotToContainer(new Slot(p_i1808_1_, i1 + l * 9 + 9, 8 + i1 * 18, 84 + l * 18));
}
}
for (l = 0; l < 3; ++l)
{
for (i1 = 0; i1 < 9; ++i1)
{
addSlotToContainer(new Slot(p_i1808_1_, i1 + l * 9 + 9, 8 + i1 * 18, 84 + l * 18));
}
}
for (l = 0; l < 9; ++l)
{
this.addSlotToContainer(new Slot(p_i1808_1_, l, 8 + l * 18, 142));
}
for (l = 0; l < 9; ++l)
{
addSlotToContainer(new Slot(p_i1808_1_, l, 8 + l * 18, 142));
}
this.onCraftMatrixChanged(this.craftMatrix);
onCraftMatrixChanged(craftMatrix);
}
@Override
@@ -24,23 +24,23 @@ public class GuiCraftingHalo extends GuiContainer {
private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation("textures/gui/container/crafting_table.png");
public GuiCraftingHalo(InventoryPlayer p_i1084_1_, World p_i1084_2_) {
super(new ContainerCraftingHalo(p_i1084_1_, p_i1084_2_));
}
@Override
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
this.fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 28, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
public GuiCraftingHalo(InventoryPlayer p_i1084_1_, World p_i1084_2_) {
super(new ContainerCraftingHalo(p_i1084_1_, p_i1084_2_));
}
@Override
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
fontRendererObj.drawString(I18n.format("container.crafting", new Object[0]), 28, 6, 4210752);
fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, ySize - 96 + 2, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.getTextureManager().bindTexture(craftingTableGuiTextures);
int k = (width - xSize) / 2;
int l = (height - ySize) / 2;
drawTexturedModalRect(k, l, 0, 0, xSize, ySize);
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(craftingTableGuiTextures);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
}
@@ -53,7 +53,7 @@ public class GuiLexicon extends GuiScreen {
public float lastTime = 0F;
public float partialTicks = 0F;
public float timeDelta = 0F;
List<LexiconCategory> allCategories;
String title;
@@ -64,10 +64,10 @@ public class GuiLexicon extends GuiScreen {
@Override
public void initGui() {
super.initGui();
allCategories = new ArrayList(BotaniaAPI.getAllCategories());
Collections.sort(allCategories);
lastTime = ClientTickHandler.ticksInGame;
title = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem().getDisplayName();
@@ -110,10 +110,10 @@ public class GuiLexicon extends GuiScreen {
GL11.glColor4f(1F, 1F, 1F, 1F);
mc.renderEngine.bindTexture(texture);
drawTexturedModalRect(left, top, 0, 0, guiWidth, guiHeight);
if(ClientProxy.singAnnoyingChristmasSongsTillVazkiisHeadExplodesFromAllTheDamnJingle)
drawTexturedModalRect(left + 3, top + 1, 0, 212, 138, 6);
drawBookmark(left + guiWidth / 2, top - getTitleHeight(), getTitle(), true);
String subtitle = getSubtitle();
if(subtitle != null) {
@@ -128,7 +128,7 @@ public class GuiLexicon extends GuiScreen {
populateBookmarks();
bookmarksNeedPopulation = false;
}
if(mc.thePlayer.getCommandSenderName().equals("haighyorkie")) {
GL11.glColor4f(1F, 1F, 1F, 1F);
mc.renderEngine.bindTexture(texture);
@@ -140,16 +140,16 @@ public class GuiLexicon extends GuiScreen {
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glTranslatef(0F, 0F, 2F);
int w = 256;
int h = 152;
int x = (int) ((ClientTickHandler.ticksInGame + par3) * 6) % (width + w) - w;
int y = (int) (top + guiHeight / 2 - h / 4 + Math.sin((ClientTickHandler.ticksInGame + par3) / 6.0) * 40);
drawTexturedModalRect(x * 2, y * 2, 0, 0, w, h);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
RenderHelper.renderTooltip(par1, par2, Arrays.asList(EnumChatFormatting.GOLD + "#goldfishchris", EnumChatFormatting.RED + "INTENSIFY HIM"));
}
}
@@ -12,7 +12,6 @@
package vazkii.botania.client.integration.nei;
import vazkii.botania.client.gui.crafting.GuiCraftingHalo;
import net.minecraft.client.gui.inventory.GuiCrafting;
import codechicken.nei.api.API;
import codechicken.nei.recipe.DefaultOverlayHandler;
@@ -22,5 +21,5 @@ public class NEIGuiHooks {
API.registerGuiOverlay(GuiCraftingHalo.class, "crafting");
API.registerGuiOverlayHandler(GuiCraftingHalo.class, new DefaultOverlayHandler(), "crafting");
}
}
@@ -46,7 +46,7 @@ public class RecipeHandlerBrewery extends TemplateRecipeHandler {
}
public void setIngredients(List<Object> inputs) {
int left = 96 - (inputs.size() * 18 / 2);
int left = 96 - inputs.size() * 18 / 2;
int i = 0;
for (Object o : inputs) {
@@ -97,7 +97,7 @@ public class RecipeHandlerBrewery extends TemplateRecipeHandler {
public void loadCraftingRecipes(String outputId, Object... results) {
if (outputId.equals("botania.brewery"))
for (RecipeBrew recipe : BotaniaAPI.brewRecipes)
this.arecipes.add(new CachedBreweryRecipe(recipe));
arecipes.add(new CachedBreweryRecipe(recipe));
else
super.loadCraftingRecipes(outputId, results);
}
@@ -107,7 +107,7 @@ public class RecipeHandlerBrewery extends TemplateRecipeHandler {
if (result.getItem() instanceof IBrewItem)
for (RecipeBrew recipe : BotaniaAPI.brewRecipes)
if (((IBrewItem) result.getItem()).getBrew(result) == recipe.getBrew())
this.arecipes.add(new CachedBreweryRecipe(recipe));
arecipes.add(new CachedBreweryRecipe(recipe));
}
@Override
@@ -115,13 +115,13 @@ public class RecipeHandlerBrewery extends TemplateRecipeHandler {
if (ingredient.getItem() instanceof IBrewContainer) {
for(RecipeBrew recipe : BotaniaAPI.brewRecipes) {
if(recipe.getOutput(ingredient) != null)
this.arecipes.add(new CachedBreweryRecipe(recipe, ingredient));
arecipes.add(new CachedBreweryRecipe(recipe, ingredient));
}
} else
for (RecipeBrew recipe : BotaniaAPI.brewRecipes) {
CachedBreweryRecipe crecipe = new CachedBreweryRecipe(recipe);
if (crecipe.contains(crecipe.inputs, ingredient))
this.arecipes.add(crecipe);
arecipes.add(crecipe);
}
}
@@ -42,7 +42,7 @@ public class RecipeHandlerElvenTrade extends TemplateRecipeHandler {
if(o instanceof String)
this.inputs.add(new PositionedStack(OreDictionary.getOres((String) o), 60 + i * 18, 6));
else this.inputs.add(new PositionedStack(o, 60 + i * 18, 6));
i++;
}
}
@@ -130,6 +130,6 @@ public class RecipeHandlerPetalApothecary extends TemplateRecipeHandler {
arecipes.add(crecipe);
}
}
}
@@ -42,7 +42,7 @@ public final class LibResources {
public static final String GUI_POTIONS = PREFIX_GUI + "potions.png";
public static final String GUI_NEI_BLANK = PREFIX_GUI + "neiBlank.png";
public static final String GUI_NEI_BREWERY = PREFIX_GUI + "neiBrewery.png";
public static final String ENTRY_FLOWERS = PREFIX_ENTRIES + "flowers.png";
public static final String ENTRY_APOTHECARY = PREFIX_ENTRIES + "apothecary.png";
public static final String ENTRY_PURE_DAISY = PREFIX_ENTRIES + "pureDaisy.png";
@@ -100,7 +100,7 @@ public final class LibResources {
public static final String MODEL_KNOCKBACK_BELT = PREFIX_MODEL + "knockbackBelt.png";
public static final String MODEL_HOLY_CLOAK = PREFIX_MODEL + "holyCloak.png";
public static final String MODEL_UNHOLY_CLOAK = PREFIX_MODEL + "unholyCloak.png";
public static final String MODEL_CAPE = "/assets/botania/textures/model/cape.png";
public static final String MISC_PARTICLES = PREFIX_MISC + "particles.png";
@@ -49,12 +49,12 @@ public class ModelBrewery extends ModelBase {
public void render(RenderTileBrewery render, double time) {
float f = 1F / 16F;
float offset = (float) Math.sin(time / 40) * 0.1F + 0.05F;
int plates = render.brewery.getSizeInventory() - 1;
float deg = (float) time / 16F;
float polerot = -deg * 25F;
GL11.glTranslatef(0F, offset, 0F);
GL11.glRotatef(polerot, 0F, 1F, 0F);
if(render.brewery.getStackInSlot(0) != null) {
@@ -69,14 +69,14 @@ public class ModelBrewery extends ModelBase {
Top.render(f);
Bottom.render(f);
GL11.glRotatef(-polerot, 0F, 1F, 0F);
float degper = (float) (2F * Math.PI) / plates;
for(int i = 0; i < plates; i++) {
Plate.rotateAngleY = deg;
float offset1 = (float) Math.sin(time / 20 + i * 40F) * 0.2F - 0.2F;
if(time == -1)
offset1 = 0F;
GL11.glTranslatef(0F, offset1, 0F);
if(render.brewery.getStackInSlot(i + 1) != null) {
float rot = Plate.rotateAngleY * 180F / (float) Math.PI;
@@ -91,10 +91,10 @@ public class ModelBrewery extends ModelBase {
GL11.glTranslatef(-transX, -transY, -transZ);
GL11.glRotatef(-rot, 0F, 1F, 0F);
}
Plate.render(f);
GL11.glTranslatef(0F, -offset1, 0F);
deg += degper;
}
GL11.glTranslatef(0F, -offset, 0F);
@@ -60,7 +60,7 @@ public class ModelSpinningCubes extends ModelBase {
GL11.glRotatef(deg, xRotate, yRotate, zRotate);
if(repeat < origRepeat) {
GL11.glColor4f(1F, 1F, 1F, ((float) repeat / (float) origRepeat) * 0.4F);
GL11.glColor4f(1F, 1F, 1F, (float) repeat / (float) origRepeat * 0.4F);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glDisable(GL11.GL_ALPHA_TEST);
@@ -82,7 +82,7 @@ public class ModelSpinningCubes extends ModelBase {
}
GL11.glPopMatrix();
GL11.glEnable(GL11.GL_TEXTURE_2D);
if(repeat != 0)
renderSpinningCubes(cubes, repeat - 1, origRepeat);
}
@@ -18,12 +18,10 @@ import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import vazkii.botania.client.lib.LibRenderIDs;
import vazkii.botania.client.render.tile.RenderTileBrewery;
import vazkii.botania.common.block.tile.TileAltar;
import vazkii.botania.common.block.tile.TileBrewery;
import vazkii.botania.common.block.tile.TileSpawnerClaw;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class RenderBrewery implements ISimpleBlockRenderingHandler {
@@ -52,5 +50,5 @@ public class RenderBrewery implements ISimpleBlockRenderingHandler {
public int getRenderId() {
return LibRenderIDs.idBrewery;
}
}
@@ -13,14 +13,8 @@ package vazkii.botania.client.render.block;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.item.ItemStack;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.lib.LibRenderIDs;
import vazkii.botania.common.block.tile.TileFloatingFlower;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
public class RenderFloatingFlower implements ISimpleBlockRenderingHandler {
@@ -15,7 +15,6 @@ import net.minecraft.block.Block;
import net.minecraft.client.renderer.EntityRenderer;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.init.Blocks;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
@@ -61,13 +60,13 @@ public class RenderSpecialFlower implements ISimpleBlockRenderingHandler {
double d1 = par2;
double d2 = par3;
double d0 = par4;
long sh;
long sh;
sh = (long)(par2 * 3129871) ^ (long) par4 * 116129781L ^ (long) par3;
sh = par2 * 3129871 ^ par4 * 116129781L ^ par3;
sh = sh * sh * 42317861L + sh * 11L;
d1 += ((double)((float)(sh >> 16 & 15L) / 15.0F) - 0.5D) * 0.3D;
d2 += (double)((float)(sh >> 32 & 15L) / 15.0F) * -0.15D;
d0 += ((double)((float)(sh >> 24 & 15L) / 15.0F) - 0.5D) * 0.3D;
d1 += ((sh >> 16 & 15L) / 15.0F - 0.5D) * 0.3D;
d2 += (sh >> 32 & 15L) / 15.0F * -0.15D;
d0 += ((sh >> 24 & 15L) / 15.0F - 0.5D) * 0.3D;
drawCrossedSquares(blockAccess, par1Block, par2, par3, par4, d1, d2, d0, 1.0F, render);
@@ -15,7 +15,6 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.boss.BossStatus;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.ARBShaderObjects;
@@ -46,7 +46,7 @@ public class RenderFloatingFlowerItem implements IItemRenderer {
GL11.glRotatef(-5F, 1F, 0F, 0F);
Item item = stack.getItem();
TileFloatingFlower.forcedStack = item instanceof ItemBlockFloatingSpecialFlower ? ItemBlockSpecialFlower.ofType(ItemBlockSpecialFlower.getType(stack)) : new ItemStack(ModBlocks.flower, 1, stack.getItemDamage());
TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileFloatingFlower(), 0.0D, 0.0D, 0.0D, 0.0F);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
@@ -16,7 +16,6 @@ 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.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.texture.TextureMap;
@@ -134,7 +133,7 @@ public class RenderTileAltar extends TileEntitySpecialRenderer {
Block block = lava ? Blocks.lava : Blocks.water;
int brightness = lava ? 240 : -1;
float alpha = lava ? 1F : 0.7F;
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glDisable(GL11.GL_ALPHA_TEST);
@@ -154,7 +153,7 @@ public class RenderTileAltar extends TileEntitySpecialRenderer {
}
GL11.glPopMatrix();
}
public void renderIcon(int par1, int par2, IIcon par3Icon, int par4, int par5, int brightness) {
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
@@ -12,18 +12,7 @@
package vazkii.botania.client.render.tile;
import java.awt.Color;
import java.util.Random;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.api.mana.ILens;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelBrewery;
import vazkii.botania.client.render.item.RenderLens;
import vazkii.botania.common.block.tile.TileBrewery;
import vazkii.botania.common.block.tile.mana.TileSpreader;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemRenderer;
@@ -39,13 +28,21 @@ import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.ForgeHooksClient;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelBrewery;
import vazkii.botania.common.block.tile.TileBrewery;
public class RenderTileBrewery extends TileEntitySpecialRenderer {
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_BREWERY);
ModelBrewery model = new ModelBrewery();
public TileBrewery brewery;
public static boolean rotate = true;
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) {
brewery = (TileBrewery) tileentity;
@@ -61,12 +58,12 @@ public class RenderTileBrewery extends TileEntitySpecialRenderer {
double time = ClientTickHandler.ticksInGame + f;
if(!rotate)
time = -1;
model.render(this, time);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
}
public void renderItemStack(ItemStack stack) {
if(stack != null) {
Minecraft mc = Minecraft.getMinecraft();
@@ -105,7 +102,7 @@ public class RenderTileBrewery extends TileEntitySpecialRenderer {
}
}
GL11.glScalef(1F / s, 1F / s, 1F / s);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
}
}
@@ -28,9 +28,7 @@ import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelMiniIsland;
import vazkii.botania.common.block.BlockModFlower;
import vazkii.botania.common.block.decor.IFloatingFlower;
import vazkii.botania.common.block.tile.TileFloatingFlower;
public class RenderTileFloatingFlower extends TileEntitySpecialRenderer {
@@ -66,7 +64,7 @@ public class RenderTileFloatingFlower extends TileEntitySpecialRenderer {
ItemStack stack = flower.getDisplayStack();
IIcon icon = stack.getIconIndex();
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
float f = icon.getMinU();
float f1 = icon.getMaxU();
@@ -11,18 +11,18 @@
*/
package vazkii.botania.client.render.tile;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import vazkii.botania.api.mana.ILens;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.render.item.RenderLens;
import vazkii.botania.common.block.tile.mana.TilePrism;
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
public class RenderTilePrism extends TileEntitySpecialRenderer {
@@ -31,8 +31,8 @@ public class RenderTilePrism extends TileEntitySpecialRenderer {
TilePrism prism = (TilePrism) tile;
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
float pos = (float) Math.sin((float) (ClientTickHandler.ticksInGame + partTicks) * 0.05F) * 0.5F * (1F - 1F / 16F) - 0.5F;
float pos = (float) Math.sin((ClientTickHandler.ticksInGame + partTicks) * 0.05F) * 0.5F * (1F - 1F / 16F) - 0.5F;
ItemStack stack = prism.getStackInSlot(0);
if(stack != null) {
@@ -11,13 +11,10 @@
*/
package vazkii.botania.client.render.tile;
import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.handler.RedStringRenderer;
import vazkii.botania.common.block.tile.string.TileRedString;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChunkCoordinates;
import vazkii.botania.client.core.handler.RedStringRenderer;
import vazkii.botania.common.block.tile.string.TileRedString;
public class RenderTileRedString extends TileEntitySpecialRenderer {
@@ -14,11 +14,8 @@ package vazkii.botania.client.render.tile;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
@@ -26,7 +23,6 @@ import org.lwjgl.opengl.GL11;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.helper.ShaderHelper;
import vazkii.botania.common.block.mana.BlockEnchanter;
import vazkii.botania.common.block.mana.BlockTerraPlate;
import vazkii.botania.common.block.tile.TileTerraPlate;
@@ -36,8 +32,8 @@ public class RenderTileTerraPlate extends TileEntitySpecialRenderer {
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) {
TileTerraPlate plate = (TileTerraPlate) tileentity;
float max = (float) TileTerraPlate.MAX_MANA / 10F;
float alphaMod = (float) Math.min(max, plate.getCurrentMana()) / max;
float max = TileTerraPlate.MAX_MANA / 10F;
float alphaMod = Math.min(max, plate.getCurrentMana()) / max;
GL11.glPushMatrix();
GL11.glTranslated(d0, d1, d2);
@@ -17,9 +17,9 @@ import vazkii.botania.common.core.proxy.CommonProxy;
import vazkii.botania.common.lib.LibMisc;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.ModAPIManager;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.ModAPIManager;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLMissingMappingsEvent;
@@ -33,7 +33,7 @@ public class Botania {
public static boolean thaumcraftLoaded = false;
public static boolean bcTriggersLoaded = false;
@Instance(LibMisc.MOD_ID)
public static Botania instance;
@@ -44,7 +44,7 @@ public class Botania {
public void preInit(FMLPreInitializationEvent event) {
thaumcraftLoaded = Loader.isModLoaded("Thaumcraft");
bcTriggersLoaded = ModAPIManager.INSTANCE.hasAPI("BuildCraftAPI|statements");
proxy.preInit(event);
}
@@ -103,10 +103,10 @@ public class BlockAltar extends BlockModContainer implements ILexiconable {
} else if(stack != null && stack.getItem() == Items.lava_bucket) {
if(!par5EntityPlayer.capabilities.isCreativeMode)
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, getContainer(stack));
tile.setLava(true);
par1World.func_147453_f(par2, par3, par4, this);
return true;
}
}
@@ -19,7 +19,7 @@ public class BlockDreamwood extends BlockLivingwood {
void register(String name) {
GameRegistry.registerBlock(this, ItemBlockDreamwood.class, name);
}
@Override
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
return LexiconData.elvenResources;
@@ -19,7 +19,6 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -33,11 +32,9 @@ import vazkii.botania.api.lexicon.ILexiconable;
import vazkii.botania.api.subtile.ISpecialFlower;
import vazkii.botania.api.wand.IWandHUD;
import vazkii.botania.api.wand.IWandable;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.decor.BlockFloatingFlower;
import vazkii.botania.common.block.tile.TileFloatingSpecialFlower;
import vazkii.botania.common.block.tile.TileSpecialFlower;
import vazkii.botania.common.core.handler.ConfigHandler;
import vazkii.botania.common.crafting.recipe.SpecialFloatingFlowerRecipe;
import vazkii.botania.common.item.block.ItemBlockFloatingSpecialFlower;
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
@@ -45,31 +42,31 @@ import vazkii.botania.common.lib.LibBlockNames;
import cpw.mods.fml.common.registry.GameRegistry;
public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements ISpecialFlower, IWandable, ILexiconable, IWandHUD {
public BlockFloatingSpecialFlower() {
super(LibBlockNames.FLOATING_SPECIAL_FLOWER);
GameRegistry.addRecipe(new SpecialFloatingFlowerRecipe());
RecipeSorter.register("botania:floatingSpecialFlower", SpecialFloatingFlowerRecipe.class, Category.SHAPELESS, "");
}
@Override
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
// NO-OP
}
@Override
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
for(String s : BotaniaAPI.subtilesForCreativeMenu)
par3List.add(ItemBlockSpecialFlower.ofType(new ItemStack(par1), s));
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
String name = ((TileSpecialFlower) world.getTileEntity(x, y, z)).subTileName;
return ItemBlockSpecialFlower.ofType(new ItemStack(world.getBlock(x, y, z)), name);
}
@Override
public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) {
if(!par6EntityPlayer.capabilities.isCreativeMode) {
@@ -77,7 +74,7 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
((TileSpecialFlower) par1World.getTileEntity(par2, par3, par4)).onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer);
}
}
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
ArrayList<ItemStack> list = new ArrayList();
@@ -91,14 +88,14 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
return list;
}
@Override
public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6) {
super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6);
TileEntity tileentity = par1World.getTileEntity(par2, par3, par4);
return tileentity != null ? tileentity.receiveClientEvent(par5, par6) : false;
}
@Override
public boolean onUsedByWand(EntityPlayer player, ItemStack stack, World world, int x, int y, int z, int side) {
return ((TileSpecialFlower) world.getTileEntity(x, y, z)).onWanded(stack, player);
@@ -123,12 +120,12 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z) {
((TileSpecialFlower) world.getTileEntity(x, y, z)).renderHUD(mc, res);
}
@Override
protected void register(String name) {
GameRegistry.registerBlock(this, ItemBlockFloatingSpecialFlower.class, name);
GameRegistry.registerBlock(this, ItemBlockFloatingSpecialFlower.class, name);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileFloatingSpecialFlower();
@@ -26,7 +26,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockMod extends Block {
public int originalLight;
public BlockMod(Material par2Material) {
super(par2Material);
if(registerInCreative())
@@ -49,7 +49,7 @@ public class BlockMod extends Block {
originalLight = (int) (p_149715_1_ * 15);
return super.setLightLevel(p_149715_1_);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister par1IconRegister) {
@@ -27,7 +27,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public abstract class BlockModContainer<T extends TileEntity> extends BlockContainer {
public int originalLight;
protected BlockModContainer(Material par2Material) {
super(par2Material);
if(registerInCreative())
@@ -44,7 +44,7 @@ public abstract class BlockModContainer<T extends TileEntity> extends BlockConta
protected boolean shouldRegisterInNameSet() {
return true;
}
@Override
public Block setLightLevel(float p_149715_1_) {
originalLight = (int) (p_149715_1_ * 15);
@@ -44,7 +44,7 @@ public class BlockModFlower extends BlockFlower implements ILexiconable {
public static IIcon[] iconsAlt;
public int originalLight;
public static final String ALT_DIR = "alt";
protected BlockModFlower() {
@@ -88,7 +88,7 @@ public class BlockModFlower extends BlockFlower implements ILexiconable {
iconsAlt[i] = IconHelper.forBlock(par1IconRegister, this, i, ALT_DIR);
}
}
@Override
public Block setLightLevel(float p_149715_1_) {
originalLight = (int) (p_149715_1_ * 15);
@@ -145,7 +145,7 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
protected boolean canPlaceBlockOn(Block block) {
return super.canPlaceBlockOn(block) || block == ModBlocks.redStringRelay;
}
@Override
public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) {
if(!par6EntityPlayer.capabilities.isCreativeMode) {
@@ -13,7 +13,6 @@ package vazkii.botania.common.block.decor;
import java.util.Random;
import cpw.mods.fml.common.Optional;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.item.Item;
@@ -26,6 +25,7 @@ import vazkii.botania.common.block.BlockModFlower;
import vazkii.botania.common.integration.coloredlights.ColoredLightHelper;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lib.LibBlockNames;
import cpw.mods.fml.common.Optional;
public class BlockBuriedPetals extends BlockModFlower {
@@ -34,12 +34,12 @@ public class BlockBuriedPetals extends BlockModFlower {
setBlockBounds(0F, 0F, 0F, 1F, 0.1F, 1F);
setLightLevel(0.25F);
}
@Override
@Optional.Method(modid = "easycoloredlights")
public int getLightValue(IBlockAccess world, int x, int y, int z) {
public int getLightValue(IBlockAccess world, int x, int y, int z) {
return ColoredLightHelper.getPackedColor(world.getBlockMetadata(x, y, z), originalLight);
}
}
@Override
public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
@@ -45,28 +45,28 @@ public class BlockDirtPath extends BlockMod implements ILexiconable {
float max = 0.4F;
double motionX = Math.abs(entity.motionX);
double motionZ = Math.abs(entity.motionZ);
if(motionX < max)
entity.motionX *= speed;
if(motionZ < max)
entity.motionZ *= speed;
double motionZ = Math.abs(entity.motionZ);
if(motionX < max)
entity.motionX *= speed;
if(motionZ < max)
entity.motionZ *= speed;
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
return AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1);
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plantable) {
return plantable.getPlantType(world, x, y - 1, z) == EnumPlantType.Plains;
@@ -76,5 +76,5 @@ public class BlockDirtPath extends BlockMod implements ILexiconable {
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
return LexiconData.dirtPath;
}
}
@@ -13,8 +13,6 @@ package vazkii.botania.common.block.decor;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -25,7 +23,6 @@ import vazkii.botania.api.lexicon.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.recipe.IElvenItem;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.common.block.BlockMod;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
@@ -48,7 +48,7 @@ public class BlockFloatingFlower extends BlockModContainer implements ILexiconab
public BlockFloatingFlower() {
this(LibBlockNames.MINI_ISLAND);
}
public BlockFloatingFlower(String name) {
super(Material.ground);
setBlockName(name);
@@ -59,12 +59,12 @@ public class BlockFloatingFlower extends BlockModContainer implements ILexiconab
float f = 0.1F;
setBlockBounds(f, f, f, 1F - f, 1F - f, 1F - f);
}
@Override
@Optional.Method(modid = "easycoloredlights")
public int getLightValue(IBlockAccess world, int x, int y, int z) {
public int getLightValue(IBlockAccess world, int x, int y, int z) {
return ColoredLightHelper.getPackedColor(world.getBlockMetadata(x, y, z), originalLight);
}
}
@Override
protected boolean shouldRegisterInNameSet() {
@@ -76,9 +76,9 @@ public class BlockFloatingFlower extends BlockModContainer implements ILexiconab
register(par1Str);
return super.setBlockName(par1Str);
}
protected void register(String name) {
GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, name);
GameRegistry.registerBlock(this, ItemBlockWithMetadataAndName.class, name);
}
@Override
@@ -13,7 +13,6 @@ package vazkii.botania.common.block.decor;
import java.util.ArrayList;
import cpw.mods.fml.common.Optional;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks;
@@ -25,8 +24,8 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import vazkii.botania.common.block.BlockModContainer;
import vazkii.botania.common.block.tile.TileManaFlame;
import vazkii.botania.common.integration.coloredlights.ColoredLightHelper;
import vazkii.botania.common.lib.LibBlockNames;
import cpw.mods.fml.common.Optional;
public class BlockManaFlame extends BlockModContainer {
@@ -38,23 +37,23 @@ public class BlockManaFlame extends BlockModContainer {
setBlockBounds(f, f, f, 1F - f, 1F - f, 1F - f);
setLightLevel(1F);
}
@Override
@Optional.Method(modid = "easycoloredlights")
public int getLightValue(IBlockAccess world, int x, int y, int z) {
public int getLightValue(IBlockAccess world, int x, int y, int z) {
return ((TileManaFlame) world.getTileEntity(x, y, z)).getLightColor();
}
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
// NO-OP
}
@Override
public int getRenderType() {
return -1;
}
@Override
public boolean isOpaqueCube() {
return false;
@@ -64,27 +63,27 @@ public class BlockManaFlame extends BlockModContainer {
public boolean renderAsNormalBlock() {
return false;
}
@Override
public boolean getBlocksMovement(IBlockAccess p_149655_1_, int p_149655_2_, int p_149655_3_, int p_149655_4_) {
return true;
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) {
return null;
}
@Override
public IIcon getIcon(int side, int meta) {
return Blocks.fire.getIcon(side, meta);
}
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
return new ArrayList();
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileManaFlame();
@@ -11,19 +11,14 @@
*/
package vazkii.botania.common.block.decor;
import java.util.Random;
import net.minecraft.block.Block;
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.util.IIcon;
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.client.core.helper.IconHelper;
import vazkii.botania.common.block.BlockMod;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
@@ -33,7 +28,7 @@ public class BlockManaGlass extends BlockMod implements ILexiconable {
public BlockManaGlass() {
this(LibBlockNames.MANA_GLASS);
}
public BlockManaGlass(String name) {
super(Material.glass);
setHardness(0.3F);
@@ -11,7 +11,6 @@
*/
package vazkii.botania.common.block.decor;
import cpw.mods.fml.common.Optional;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -23,6 +22,7 @@ import vazkii.botania.common.block.BlockMod;
import vazkii.botania.common.integration.coloredlights.ColoredLightHelper;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import cpw.mods.fml.common.Optional;
public class BlockSeaLamp extends BlockMod implements ILexiconable {
@@ -33,14 +33,14 @@ public class BlockSeaLamp extends BlockMod implements ILexiconable {
setLightLevel(1.0F);
setBlockName(LibBlockNames.SEA_LAMP);
}
int coloredLight = -1;
@Override
@Optional.Method(modid = "easycoloredlights")
public int getLightValue(IBlockAccess world, int x, int y, int z) {
public int getLightValue(IBlockAccess world, int x, int y, int z) {
return coloredLight == -1 ? (coloredLight = ColoredLightHelper.makeRGBLightValue(85, 136, 125, originalLight)) : coloredLight;
}
}
@Override
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
@@ -12,7 +12,6 @@
package vazkii.botania.common.block.decor;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
@@ -35,13 +34,13 @@ public class BlockShinyFlower extends BlockModFlower implements IInfusionStabili
super(LibBlockNames.SHINY_FLOWER);
setLightLevel(1F);
}
@Override
@Optional.Method(modid = "easycoloredlights")
public int getLightValue(IBlockAccess world, int x, int y, int z) {
public int getLightValue(IBlockAccess world, int x, int y, int z) {
return ColoredLightHelper.getPackedColor(world.getBlockMetadata(x, y, z), originalLight);
}
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
// NO-OP
@@ -16,5 +16,5 @@ import net.minecraft.item.ItemStack;
public interface IFloatingFlower {
public ItemStack getDisplayStack();
}
@@ -32,7 +32,6 @@ import vazkii.botania.api.wand.IWandHUD;
import vazkii.botania.client.lib.LibRenderIDs;
import vazkii.botania.common.block.BlockModContainer;
import vazkii.botania.common.block.tile.TileBrewery;
import vazkii.botania.common.block.tile.TileRuneAltar;
import vazkii.botania.common.block.tile.TileSimpleInventory;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
@@ -165,6 +164,6 @@ public class BlockBrewery extends BlockModContainer implements ILexiconable, IWa
@Override
public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z) {
((TileBrewery) world.getTileEntity(x, y, z)).renderHUD(mc, res);
}
}
}
@@ -34,7 +34,6 @@ import vazkii.botania.api.wand.IWandHUD;
import vazkii.botania.api.wand.IWandable;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.common.block.BlockModContainer;
import vazkii.botania.common.block.tile.TileBrewery;
import vazkii.botania.common.block.tile.TileEnchanter;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lexicon.LexiconData;
@@ -151,5 +150,5 @@ public class BlockEnchanter extends BlockModContainer implements IWandable, ILex
public void renderHUD(Minecraft mc, ScaledResolution res, World world, int x, int y, int z) {
((TileEnchanter) world.getTileEntity(x, y, z)).renderHUD(mc, res);
}
}
@@ -107,7 +107,7 @@ public class BlockForestDrum extends BlockMod implements IManaTrigger, ILexicona
public void onBurstCollision(IManaBurst burst, World world, int x, int y, int z) {
if(burst.isFake())
return;
if(world.getBlockMetadata(x, y, z) == 0)
ItemGrassHorn.breakGrass(world, 0, x, y, z);
else {
@@ -40,7 +40,7 @@ public class BlockPrism extends BlockModContainer implements IManaTrigger, ILexi
Random random;
IIcon[] icons;
public BlockPrism() {
super(Material.glass);
setHardness(0.3F);
@@ -49,10 +49,10 @@ public class BlockPrism extends BlockModContainer implements IManaTrigger, ILexi
setBlockName(LibBlockNames.PRISM);
float f = 0.25F;
setBlockBounds(f, 0F, f, 1F - f, 1F, 1F - f);
random = new Random();
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
icons = new IIcon[2];
@@ -69,17 +69,17 @@ public class BlockPrism extends BlockModContainer implements IManaTrigger, ILexi
public int getRenderBlockPass() {
return 1;
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) {
return null;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
@@ -112,7 +112,7 @@ public class BlockPrism extends BlockModContainer implements IManaTrigger, ILexi
return true;
}
@Override
public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) {
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
@@ -154,7 +154,7 @@ public class BlockPrism extends BlockModContainer implements IManaTrigger, ILexi
super.breakBlock(par1World, par2, par3, par4, par5, par6);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TilePrism();
@@ -33,7 +33,6 @@ import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.common.block.BlockModContainer;
import vazkii.botania.common.block.tile.TileRuneAltar;
import vazkii.botania.common.block.tile.TileSimpleInventory;
import vazkii.botania.common.block.tile.mana.TileSpreader;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
@@ -74,7 +73,7 @@ public class BlockRuneAltar extends BlockModContainer implements IWandable, IWan
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
TileRuneAltar altar = (TileRuneAltar) par1World.getTileEntity(par2, par3, par4);
if(par5EntityPlayer.isSneaking()) {
if(altar.manaToGet == 0)
for(int i = altar.getSizeInventory() - 1; i >= 0; i--) {
@@ -11,13 +11,6 @@
*/
package vazkii.botania.common.block.mana;
import vazkii.botania.api.lexicon.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.common.block.BlockModContainer;
import vazkii.botania.common.block.tile.TileTerraPlate;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
@@ -25,12 +18,19 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import vazkii.botania.api.lexicon.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.common.block.BlockModContainer;
import vazkii.botania.common.block.tile.TileTerraPlate;
import vazkii.botania.common.lexicon.LexiconData;
import vazkii.botania.common.lib.LibBlockNames;
public class BlockTerraPlate extends BlockModContainer implements ILexiconable {
public static IIcon overlay;
IIcon[] icons;
public BlockTerraPlate() {
super(Material.iron);
setBlockBounds(0F, 0F, 0F, 1F, 3F / 16F, 1F);
@@ -39,17 +39,17 @@ public class BlockTerraPlate extends BlockModContainer implements ILexiconable {
setStepSound(soundTypeMetal);
setBlockName(LibBlockNames.TERRA_PLATE);
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public void registerBlockIcons(IIconRegister par1IconRegister) {
icons = new IIcon[3];
@@ -23,7 +23,6 @@ import vazkii.botania.api.lexicon.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.client.core.helper.IconHelper;
import vazkii.botania.common.block.BlockModContainer;
import vazkii.botania.common.block.tile.mana.TileSpreader;
import vazkii.botania.common.block.tile.string.TileRedString;
import vazkii.botania.common.lexicon.LexiconData;
@@ -31,7 +30,7 @@ public abstract class BlockRedString extends BlockModContainer<TileRedString> im
IIcon senderIcon;
IIcon sideIcon;
public BlockRedString(String name) {
super(Material.rock);
setHardness(2.0F);
@@ -39,7 +38,7 @@ public abstract class BlockRedString extends BlockModContainer<TileRedString> im
setStepSound(soundTypeStone);
setBlockName(name);
}
@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);
@@ -51,19 +50,19 @@ public abstract class BlockRedString extends BlockModContainer<TileRedString> im
senderIcon = IconHelper.forName(par1IconRegister, "redStringSender");
sideIcon = registerSideIcon(par1IconRegister);
}
public IIcon registerSideIcon(IIconRegister register) {
return IconHelper.forBlock(register, this);
}
@Override
public IIcon getIcon(int side, int meta) {
return side == meta ? senderIcon : sideIcon;
}
@Override
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
return LexiconData.redString;
}
}
@@ -26,12 +26,12 @@ public class BlockRedStringComparator extends BlockRedString {
public boolean hasComparatorInputOverride() {
return true;
}
@Override
public int getComparatorInputOverride(World world, int x, int y, int z, int side) {
return ((TileRedStringComparator) world.getTileEntity(x, y, z)).getComparatorValue();
}
@Override
public TileRedString createNewTileEntity(World world, int meta) {
return new TileRedStringComparator();
@@ -14,7 +14,6 @@ package vazkii.botania.common.block.string;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import vazkii.botania.common.block.tile.string.TileRedString;
import vazkii.botania.common.block.tile.string.TileRedStringContainer;
import vazkii.botania.common.block.tile.string.TileRedStringDispenser;
import vazkii.botania.common.lib.LibBlockNames;
@@ -11,10 +11,7 @@
*/
package vazkii.botania.common.block.string;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.util.ForgeDirection;
import vazkii.botania.common.block.tile.string.TileRedString;
import vazkii.botania.common.block.tile.string.TileRedStringRelay;
import vazkii.botania.common.lib.LibBlockNames;
@@ -24,7 +21,7 @@ public class BlockRedStringRelay extends BlockRedString {
public BlockRedStringRelay() {
super(LibBlockNames.RED_STRING_RELAY);
}
@Override
public TileRedString createNewTileEntity(World world, int meta) {
return new TileRedStringRelay();
@@ -27,7 +27,7 @@ public class SubTileManastar extends SubTileEntity {
@Override
public void onUpdate() {
super.onUpdate();
int mana = 0;
for(ForgeDirection dir : LibMisc.CARDINAL_DIRECTIONS) {
TileEntity tile = supertile.getWorldObj().getTileEntity(supertile.xCoord + dir.offsetX, supertile.yCoord, supertile.zCoord + dir.offsetZ);
@@ -47,7 +47,7 @@ public class SubTilePureDaisy extends SubTileEntity {
@Override
public void onUpdate() {
super.onUpdate();
positionAt++;
if(positionAt == POSITIONS.length)
positionAt = 0;
@@ -53,7 +53,7 @@ public class SubTileExoflame extends SubTileFunctional {
mana -= 2;
did = true;
if(mana == 0)
break fireFurnaces;
}
@@ -69,13 +69,13 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I
worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord));
stack.func_150996_a(Items.bucket); // Set item
} else return false;
}
}
if(hasLava()) {
item.setFire(100);
return true;
}
boolean didChange = false;
if(stack.getItem() instanceof IFlowerComponent) {
@@ -162,7 +162,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I
Botania.proxy.sparkleFX(worldObj, xCoord + 0.5 + Math.random() * 0.4 - 0.2, yCoord + 1, zCoord + 0.5 + Math.random() * 0.4 - 0.2, red, green, blue, (float) Math.random(), 10);
}
}
if(hasLava()) {
isMossy = false;
worldObj.spawnParticle("smoke", xCoord + 0.5 + Math.random() * 0.4 - 0.2, yCoord + 1, zCoord + 0.5 + Math.random() * 0.4 - 0.2, 0, 0.05, 0);
@@ -229,7 +229,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I
hasWater = water;
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
public void setLava(boolean lava) {
hasLava = lava;
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
@@ -239,7 +239,7 @@ public class TileAltar extends TileSimpleInventory implements ISidedInventory, I
public boolean hasWater() {
return hasWater;
}
public boolean hasLava() {
return hasLava;
}
@@ -27,7 +27,6 @@ import vazkii.botania.api.brew.IBrewContainer;
import vazkii.botania.api.brew.IBrewItem;
import vazkii.botania.api.mana.IManaReceiver;
import vazkii.botania.api.recipe.RecipeBrew;
import vazkii.botania.api.recipe.RecipeRuneAltar;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.common.Botania;
import vazkii.botania.common.lib.LibBlockNames;
@@ -43,7 +42,7 @@ public class TileBrewery extends TileSimpleInventory implements ISidedInventory,
public int signal = 0;
public boolean addItem(EntityPlayer player, ItemStack stack) {
if(recipe != null || stack == null || (stack.getItem() instanceof IBrewItem && (((IBrewItem) stack.getItem()).getBrew(stack) != null && ((IBrewItem) stack.getItem()).getBrew(stack) != BotaniaAPI.fallbackBrew)) || ((getStackInSlot(0) == null) != stack.getItem() instanceof IBrewContainer))
if(recipe != null || stack == null || stack.getItem() instanceof IBrewItem && ((IBrewItem) stack.getItem()).getBrew(stack) != null && ((IBrewItem) stack.getItem()).getBrew(stack) != BotaniaAPI.fallbackBrew || getStackInSlot(0) == null != stack.getItem() instanceof IBrewContainer)
return false;
boolean did = false;
@@ -93,7 +92,7 @@ public class TileBrewery extends TileSimpleInventory implements ISidedInventory,
// Update every tick.
recieveMana(0);
if(!worldObj.isRemote && recipe == null) {
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1));
for(EntityItem item : items)
@@ -113,9 +112,9 @@ public class TileBrewery extends TileSimpleInventory implements ISidedInventory,
if(recipe != null) {
if(mana != manaLastTick) {
Color color = new Color(recipe.getBrew().getColor(getStackInSlot(0)));
float r = (float) color.getRed() / 255F;
float g = (float) color.getGreen() / 255F;
float b = (float) color.getBlue() / 255F;
float r = color.getRed() / 255F;
float g = color.getGreen() / 255F;
float b = color.getBlue() / 255F;
for(int i = 0; i < 5; i++) {
Botania.proxy.wispFX(worldObj, xCoord + 0.7 - Math.random() * 0.4, yCoord + 0.9 - Math.random() * 0.2, zCoord + 0.7 - Math.random() * 0.4, r, g, b, 0.1F + (float) Math.random() * 0.05F, 0.03F - (float) Math.random() * 0.06F, 0.03F + (float) Math.random() * 0.015F, 0.03F - (float) Math.random() * 0.06F);
for(int j = 0; j < 2; j++)
@@ -159,17 +158,17 @@ public class TileBrewery extends TileSimpleInventory implements ISidedInventory,
IBrewContainer container = (IBrewContainer) stack.getItem();
return container.getManaCost(recipe.getBrew(), stack);
}
public void craftingFanciness() {
worldObj.playSoundEffect(xCoord, yCoord, zCoord, "botania:potionCreate", 1F, 1.5F + (float) Math.random() * 0.25F);
for(int i = 0; i < 25; i++) {
Color color = new Color(recipe.getBrew().getColor(getStackInSlot(0)));
float r = (float) color.getRed() / 255F;
float g = (float) color.getGreen() / 255F;
float b = (float) color.getBlue() / 255F;
float r = color.getRed() / 255F;
float g = color.getGreen() / 255F;
float b = color.getBlue() / 255F;
Botania.proxy.sparkleFX(worldObj, xCoord + 0.5 + Math.random() * 0.4 - 0.2, yCoord + 1, zCoord + 0.5 + Math.random() * 0.4 - 0.2, r, g, b, (float) Math.random() * 2F + 0.5F, 10);
for(int j = 0; j < 2; j++)
Botania.proxy.wispFX(worldObj, xCoord + 0.7 - Math.random() * 0.4, yCoord + 0.9 - Math.random() * 0.2, zCoord + 0.7 - Math.random() * 0.4, 0.2F, 0.2F, 0.2F, 0.1F + (float) Math.random() * 0.2F, 0.05F - (float) Math.random() * 0.1F, 0.05F + (float) Math.random() * 0.03F, 0.05F - (float) Math.random() * 0.1F);
Botania.proxy.wispFX(worldObj, xCoord + 0.7 - Math.random() * 0.4, yCoord + 0.9 - Math.random() * 0.2, zCoord + 0.7 - Math.random() * 0.4, 0.2F, 0.2F, 0.2F, 0.1F + (float) Math.random() * 0.2F, 0.05F - (float) Math.random() * 0.1F, 0.05F + (float) Math.random() * 0.03F, 0.05F - (float) Math.random() * 0.1F);
}
}
@@ -246,7 +245,7 @@ public class TileBrewery extends TileSimpleInventory implements ISidedInventory,
public boolean canRecieveManaFromBursts() {
return !isFull();
}
public void renderHUD(Minecraft mc, ScaledResolution res) {
int manaToGet = getManaCost();
if(manaToGet > 0) {
@@ -256,7 +255,7 @@ public class TileBrewery extends TileSimpleInventory implements ISidedInventory,
if(recipe == null)
return;
RenderHelper.renderProgressPie(x, y, (float) mana / (float) manaToGet, recipe.getOutput(getStackInSlot(0)));
RenderHelper.renderProgressPie(x, y, (float) mana / (float) manaToGet, recipe.getOutput(getStackInSlot(0)));
}
}
@@ -1,5 +1,5 @@
/**
* This class was created by <Vazkii>. It's distributed as
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
@@ -29,12 +29,10 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.mana.IManaPool;
import vazkii.botania.api.mana.spark.ISparkAttachable;
import vazkii.botania.api.mana.spark.ISparkEntity;
import vazkii.botania.api.mana.spark.SparkHelper;
import vazkii.botania.api.recipe.RecipeRuneAltar;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
@@ -111,7 +109,7 @@ public class TileEnchanter extends TileMod implements ISparkAttachable {
if(tile != null && tile instanceof TilePylon)
((TilePylon) tile).activated = false;
}
if(!canEnchanterExist(worldObj, xCoord, yCoord, zCoord, getBlockMetadata())) {
worldObj.setBlock(xCoord, yCoord, zCoord, Blocks.lapis_block, 0, 1 | 2);
@@ -392,16 +390,16 @@ public class TileEnchanter extends TileMod implements ISparkAttachable {
public int getAvailableSpaceForMana() {
return Math.max(0, manaRequired - getCurrentMana());
}
public void renderHUD(Minecraft mc, ScaledResolution res) {
if(manaRequired > 0 && itemToEnchant != null) {
int x = res.getScaledWidth() / 2 + 20;
int y = res.getScaledHeight() / 2 - 8;
RenderHelper.renderProgressPie(x, y, (float) mana / (float) manaRequired, itemToEnchant);
RenderHelper.renderProgressPie(x, y, (float) mana / (float) manaRequired, itemToEnchant);
}
}
private static class EnchantmentData {
public int enchant, level;
@@ -19,7 +19,7 @@ import vazkii.botania.common.block.decor.IFloatingFlower;
public class TileFloatingFlower extends TileEntity implements IFloatingFlower {
public static ItemStack forcedStack = null;
@Override
public ItemStack getDisplayStack() {
if(forcedStack != null) {
@@ -27,10 +27,10 @@ public class TileFloatingFlower extends TileEntity implements IFloatingFlower {
forcedStack = null;
return retStack;
}
return new ItemStack(ModBlocks.flower, 1, getBlockMetadata());
}
@Override
public boolean canUpdate() {
return false;
@@ -21,6 +21,6 @@ public class TileFloatingSpecialFlower extends TileSpecialFlower implements IFlo
public ItemStack getDisplayStack() {
return ItemBlockSpecialFlower.ofType(subTileName);
}
}
@@ -11,35 +11,35 @@
*/
package vazkii.botania.common.block.tile;
import net.minecraft.nbt.NBTTagCompound;
import vazkii.botania.common.Botania;
import vazkii.botania.common.integration.coloredlights.ColoredLightHelper;
import net.minecraft.nbt.NBTTagCompound;
public class TileManaFlame extends TileMod {
private static final String TAG_COLOR = "color";
int color = 0x20FF20;
int lightColor = -1;
public void setColor(int color) {
this.color = color;
}
public int getColor() {
return color;
}
@Override
public void updateEntity() {
float c = 0.3F;
if(Math.random() < c) {
float v = 0.1F;
float r = (float) ((color >> 16) & 0xFF) / 0xFF + (float) (Math.random() - 0.5) * v;
float g = (float) ((color >> 8) & 0xFF) / 0xFF + (float) (Math.random() - 0.5) * v;
float r = (float) (color >> 16 & 0xFF) / 0xFF + (float) (Math.random() - 0.5) * v;
float g = (float) (color >> 8 & 0xFF) / 0xFF + (float) (Math.random() - 0.5) * v;
float b = (float) (color & 0xFF) / 0xFF + (float) (Math.random() - 0.5) * v;
float w = 0.15F;
@@ -47,33 +47,33 @@ public class TileManaFlame extends TileMod {
double x = xCoord + 0.5 + (Math.random() - 0.5) * w;
double y = yCoord + 0.25 + (Math.random() - 0.5) * h;
double z = zCoord + 0.5 + (Math.random() - 0.5) * w;
float s = 0.2F + (float) Math.random() * 0.1F;
float m = 0.03F + (float) Math.random() * 0.015F;
Botania.proxy.wispFX(worldObj, x, y, z, r, g, b, s, -m);
}
}
public int getLightColor() {
if(lightColor == -1) {
float r = (float) ((color >> 16) & 0xFF) / 0xFF;
float g = (float) ((color >> 8) & 0xFF) / 0xFF;
float r = (float) (color >> 16 & 0xFF) / 0xFF;
float g = (float) (color >> 8 & 0xFF) / 0xFF;
float b = (float) (color & 0xFF) / 0xFF;
lightColor = ColoredLightHelper.makeRGBLightValue(r, g, b, 1F);
}
return lightColor;
}
@Override
public void writeCustomNBT(NBTTagCompound cmp) {
cmp.setInteger(TAG_COLOR, color);
}
@Override
public void readCustomNBT(NBTTagCompound cmp) {
color = cmp.getInteger(TAG_COLOR);
}
}
@@ -13,13 +13,8 @@ package vazkii.botania.common.block.tile;
import java.util.List;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
@@ -27,16 +22,12 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ResourceLocation;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.mana.IManaReceiver;
import vazkii.botania.api.recipe.RecipeRuneAltar;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.helper.RenderHelper;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.Botania;
import vazkii.botania.common.block.ModBlocks;
import vazkii.botania.common.core.helper.MathHelper;
import vazkii.botania.common.core.helper.Vector3;
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lib.LibBlockNames;
@@ -140,11 +131,11 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}
public boolean hasValidRecipe() {
for(RecipeRuneAltar recipe : BotaniaAPI.runeAltarRecipes)
if(recipe.matches(this)) return true;
return false;
}
@@ -296,7 +287,7 @@ public class TileRuneAltar extends TileSimpleInventory implements ISidedInventor
if(recipe == null)
return;
RenderHelper.renderProgressPie(x, y, (float) mana / (float) manaToGet, recipe.getOutput());
RenderHelper.renderProgressPie(x, y, (float) mana / (float) manaToGet, recipe.getOutput());
}
}
@@ -11,6 +11,8 @@
*/
package vazkii.botania.common.block.tile;
import java.util.ArrayList;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.entity.EntityLivingBase;
@@ -29,8 +31,6 @@ import vazkii.botania.api.subtile.SubTileEntity;
import vazkii.botania.api.wand.IWandBindable;
import vazkii.botania.common.block.tile.string.TileRedStringRelay;
import java.util.ArrayList;
public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTileContainer {
private static final String TAG_SUBTILE_NAME = "subTileName";
@@ -84,11 +84,11 @@ public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTil
xCoord = currX;
yCoord = currY;
zCoord = currZ;
return;
}
}
subTile.onUpdate();
}
}
@@ -33,21 +33,21 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
public static final int MAX_MANA = TilePool.MAX_MANA / 2;
private static final int[][] LAPIS_BLOCKS = {
{ 1, 0, }, { -1, 0 }, { 0, 1 }, { 0, -1 }
{ 1, 0, }, { -1, 0 }, { 0, 1 }, { 0, -1 }
};
private static final int[][] LIVINGROCK_BLOCKS = {
{ 0, 0 }, { 1, 1 }, { 1, -1 }, { -1, 1 }, { -1, -1 }
};
private static final String TAG_MANA = "mana";
int mana;
@Override
public void updateEntity() {
boolean removeMana = true;
if(hasValidPlatform()) {
List<EntityItem> items = getItems();
if(areItemsValid(items)) {
@@ -65,7 +65,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
}
if(mana > 0)
doParticles();
if(mana >= MAX_MANA) {
EntityItem item = items.get(0);
for(EntityItem otherItem : items)
@@ -78,15 +78,15 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
}
}
}
if(removeMana)
recieveMana(-1000);
}
void doParticles() {
if(worldObj.isRemote) {
int ticks = (int) (100.0 * ((double) getCurrentMana() / (double) MAX_MANA));
int totalSpiritCount = 3;
double tickIncrement = 360D / totalSpiritCount;
@@ -97,9 +97,9 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
double g = Math.sin(wticks * Math.PI / 180 * 0.55);
for(int i = 0; i < totalSpiritCount; i++) {
double x = (int) xCoord + Math.sin(wticks * Math.PI / 180) * r + 0.5;
double y = (int) yCoord + 0.25 + Math.abs(r) * 0.7;
double z = (int) zCoord + Math.cos(wticks * Math.PI / 180) * r + 0.5;
double x = xCoord + Math.sin(wticks * Math.PI / 180) * r + 0.5;
double y = yCoord + 0.25 + Math.abs(r) * 0.7;
double z = zCoord + Math.cos(wticks * Math.PI / 180) * r + 0.5;
wticks += tickIncrement;
float[] colorsfx = new float[] {
@@ -114,15 +114,15 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
}
}
}
List<EntityItem> getItems() {
return worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1));
}
boolean areItemsValid(List<EntityItem> items) {
if(items.size() != 3)
return false;
ItemStack ingot = null;
ItemStack pearl = null;
ItemStack diamond = null;
@@ -130,7 +130,7 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
ItemStack stack = item.getEntityItem();
if(stack.getItem() != ModItems.manaResource || stack.stackSize != 1)
return false;
int meta = stack.getItemDamage();
if(meta == 0)
ingot = stack;
@@ -140,24 +140,24 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
diamond = stack;
else return false;
}
return ingot != null && pearl != null && diamond != null;
}
boolean hasValidPlatform() {
return checkAll(LAPIS_BLOCKS, Blocks.lapis_block) && checkAll(LIVINGROCK_BLOCKS, ModBlocks.livingrock);
}
boolean checkAll(int[][] positions, Block block) {
for(int i = 0; i < positions.length; i++) {
int[] positions_ = positions[i];
for (int[] position : positions) {
int[] positions_ = position;
if(!checkPlatform(positions_[0], positions_[1], block))
return false;
}
return true;
}
boolean checkPlatform(int xOff, int zOff, Block block) {
return worldObj.getBlock(xCoord + xOff, yCoord - 1, zOff + zCoord) == block;
}
@@ -166,12 +166,12 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
public void writeCustomNBT(NBTTagCompound cmp) {
cmp.setInteger(TAG_MANA, mana);
}
@Override
public void readCustomNBT(NBTTagCompound cmp) {
mana = cmp.getInteger(TAG_MANA);
}
@Override
public int getCurrentMana() {
return mana;
@@ -217,10 +217,10 @@ public class TileTerraPlate extends TileMod implements ISparkAttachable {
public boolean areIncomingTranfersDone() {
return !areItemsValid(getItems());
}
@Override
public int getAvailableSpaceForMana() {
return Math.max(0, MAX_MANA - getCurrentMana());
}
}
@@ -49,7 +49,6 @@ import vazkii.botania.common.block.tile.TileMod;
import vazkii.botania.common.core.handler.ConfigHandler;
import vazkii.botania.common.core.handler.ManaNetworkHandler;
import vazkii.botania.common.core.helper.Vector3;
import vazkii.botania.common.item.ModItems;
public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLocked, ISparkAttachable {
@@ -127,9 +126,9 @@ public class TilePool extends TileMod implements IManaPool, IDyablePool, IKeyLoc
item.setDead();
}
if((item.age > 100 && item.age < 130) || !catalystsRegistered)
if(item.age > 100 && item.age < 130 || !catalystsRegistered)
return false;
for(RecipeManaInfusion recipe : BotaniaAPI.manaInfusionRecipes) {
if(recipe.matches(stack) && (!recipe.isAlchemy() || alchemy) && (!recipe.isConjuration() || conjuration) && (getBlockMetadata() != 2 || recipe.getOutput().getItem() == Item.getItemFromBlock(getBlockType()))) {
int mana = recipe.getManaToConsume();
@@ -19,24 +19,23 @@ import vazkii.botania.api.mana.ILens;
import vazkii.botania.api.mana.IManaCollisionGhost;
import vazkii.botania.common.block.tile.TileSimpleInventory;
import vazkii.botania.common.lib.LibBlockNames;
import codechicken.lib.vec.Vector3;
public class TilePrism extends TileSimpleInventory implements IManaCollisionGhost {
public void onBurstCollision(IManaBurst burst) {
ItemStack lens = getStackInSlot(0);
boolean valid = lens != null && lens.getItem() instanceof ILens;
boolean valid = lens != null && lens.getItem() instanceof ILens;
burst.setSourceLens(valid ? lens.copy() : null);
burst.setColor(0xFFFFFF);
burst.setGravity(0F);
if(valid) {
Entity burstEntity = (Entity) burst;
BurstProperties properties = new BurstProperties(burst.getStartingMana(), burst.getMinManaLoss(), burst.getManaLossPerTick(), burst.getGravity(), 1F, burst.getColor());
((ILens) lens.getItem()).apply(lens, properties);
burst.setColor(properties.color);
burst.setStartingMana(properties.maxMana);
burst.setMinManaLoss(properties.ticksBeforeManaLoss);
@@ -45,7 +44,7 @@ public class TilePrism extends TileSimpleInventory implements IManaCollisionGhos
burst.setMotion(burstEntity.motionX * properties.motionModifier, burstEntity.motionY * properties.motionModifier,burstEntity.motionZ * properties.motionModifier);
}
}
@Override
public boolean isGhost() {
return true;
@@ -33,21 +33,21 @@ public abstract class TileRedString extends TileMod implements ITileBound {
int range = getRange();
ChunkCoordinates currBinding = getBinding();
setBinding(null);
for(int i = 0; i < range; i++) {
x += dir.offsetX;
y += dir.offsetY;
z += dir.offsetZ;
if(worldObj.isAirBlock(x, y, z))
continue;
TileEntity tile = worldObj.getTileEntity(x, y, z);
if(tile instanceof TileRedString)
continue;
if(acceptBlock(x, y, z)) {
setBinding(new ChunkCoordinates(x, y, z));
if((currBinding == null || currBinding.posX != x || currBinding.posY != y || currBinding.posZ != z))
if(currBinding == null || currBinding.posX != x || currBinding.posY != y || currBinding.posZ != z)
onBound(x, y, z);
break;
}
@@ -63,7 +63,7 @@ public abstract class TileRedString extends TileMod implements ITileBound {
public void onBound(int x, int y, int z) {
// NO-OP
}
@Override
public AxisAlignedBB getRenderBoundingBox() {
return INFINITE_EXTENT_AABB;
@@ -73,20 +73,20 @@ public abstract class TileRedString extends TileMod implements ITileBound {
public ChunkCoordinates getBinding() {
return binding;
}
public void setBinding(ChunkCoordinates binding) {
this.binding = binding;
}
public ForgeDirection getOrientation() {
return ForgeDirection.getOrientation(getBlockMetadata());
}
public TileEntity getTileAtBinding() {
ChunkCoordinates binding = getBinding();
return binding == null ? null : worldObj.getTileEntity(binding.posX, binding.posY, binding.posZ);
}
public Block getBlockAtBinding() {
ChunkCoordinates binding = getBinding();
return binding == null ? Blocks.air : worldObj.getBlock(binding.posX, binding.posY, binding.posZ);
@@ -18,29 +18,29 @@ import net.minecraftforge.common.util.ForgeDirection;
public class TileRedStringComparator extends TileRedString {
int comparatorValue = 0;
@Override
public void updateEntity() {
super.updateEntity();
ChunkCoordinates binding = getBinding();
ForgeDirection dir = getOrientation();
Block block = getBlockAtBinding();
int origVal = comparatorValue;
if(block.hasComparatorInputOverride()) {
int val = block.getComparatorInputOverride(worldObj, binding.posX, binding.posY, binding.posZ, dir.getOpposite().ordinal());
comparatorValue = val;
} else comparatorValue = 0;
if(origVal != comparatorValue)
worldObj.func_147453_f(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord));
}
public int getComparatorValue() {
return comparatorValue;
}
@Override
public boolean acceptBlock(int x, int y, int z) {
Block block = worldObj.getBlock(x, y, z);
@@ -11,13 +11,13 @@
*/
package vazkii.botania.common.block.tile.string;
import vazkii.botania.common.core.helper.InventoryHelper;
import vazkii.botania.common.lib.LibBlockNames;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import vazkii.botania.common.core.helper.InventoryHelper;
import vazkii.botania.common.lib.LibBlockNames;
public class TileRedStringContainer extends TileRedString implements ISidedInventory {
@@ -86,14 +86,14 @@ public class TileRedStringContainer extends TileRedString implements ISidedInven
public void openInventory() {
TileEntity tile = getTileAtBinding();
if(tile instanceof IInventory)
((IInventory) tile).openInventory();
((IInventory) tile).openInventory();
}
@Override
public void closeInventory() {
TileEntity tile = getTileAtBinding();
if(tile instanceof IInventory)
((IInventory) tile).closeInventory();
((IInventory) tile).closeInventory();
}
@Override
@@ -111,13 +111,13 @@ public class TileRedStringContainer extends TileRedString implements ISidedInven
@Override
public boolean canInsertItem(int slot, ItemStack stack, int side) {
TileEntity tile = getTileAtBinding();
return tile instanceof ISidedInventory ? ((ISidedInventory) tile).canInsertItem(slot, stack, side) : true;
return tile instanceof ISidedInventory ? ((ISidedInventory) tile).canInsertItem(slot, stack, side) : true;
}
@Override
public boolean canExtractItem(int slot, ItemStack stack, int side) {
TileEntity tile = getTileAtBinding();
return tile instanceof ISidedInventory ? ((ISidedInventory) tile).canExtractItem(slot, stack, side) : true;
return tile instanceof ISidedInventory ? ((ISidedInventory) tile).canExtractItem(slot, stack, side) : true;
}
}
@@ -11,7 +11,6 @@
*/
package vazkii.botania.common.block.tile.string;
import net.minecraft.inventory.IInventory;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityDispenser;
import net.minecraft.util.ChunkCoordinates;
@@ -23,7 +22,7 @@ public class TileRedStringDispenser extends TileRedStringContainer {
TileEntity tile = worldObj.getTileEntity(x, y, z);
return tile != null && tile instanceof TileEntityDispenser;
}
public void tickDispenser() {
ChunkCoordinates bind = getBinding();
if(bind != null) {
@@ -32,5 +31,5 @@ public class TileRedStringDispenser extends TileRedStringContainer {
worldObj.scheduleBlockUpdate(bind.posX, bind.posY, bind.posZ, tile.getBlockType(), tile.getBlockType().tickRate(worldObj));
}
}
}
@@ -15,7 +15,6 @@ import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.IGrowable;
import net.minecraft.init.Blocks;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
@@ -24,7 +23,7 @@ public class TileRedStringFertilizer extends TileRedString {
public boolean func_149851_a(World p_149851_1_, boolean p_149851_5_) {
ChunkCoordinates binding = getBinding();
Block block = getBlockAtBinding();
return block instanceof IGrowable ? ((IGrowable) block).func_149851_a(p_149851_1_, binding.posX, binding.posY, binding.posZ, p_149851_5_) : false;
}
@@ -40,7 +39,7 @@ public class TileRedStringFertilizer extends TileRedString {
if(block instanceof IGrowable)
((IGrowable) block).func_149853_b(p_149853_1_, p_149853_2_, binding.posX, binding.posY, binding.posZ);
}
@Override
public boolean acceptBlock(int x, int y, int z) {
return worldObj.getBlock(x, y, z) instanceof IGrowable;
@@ -21,7 +21,7 @@ public class TileRedStringRelay extends TileRedString {
public boolean acceptBlock(int x, int y, int z) {
if(x == xCoord && y == yCoord + 1 && z == zCoord)
return false;
Block block = worldObj.getBlock(x, y, z);
return block instanceof BlockFlower || block instanceof BlockMushroom;
}
@@ -21,7 +21,7 @@ public class BrewMod extends Brew {
super(key, key, color, cost, effects);
BotaniaAPI.registerBrew(this);
}
@Override
public String getUnlocalizedName() {
return "botania.brew." + super.getUnlocalizedName();
@@ -14,7 +14,6 @@ package vazkii.botania.common.brew;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import vazkii.botania.api.brew.Brew;
import vazkii.botania.common.Botania;
import vazkii.botania.common.lib.LibBrewNames;
public class ModBrews {
@@ -11,18 +11,7 @@
*/
package vazkii.botania.common.brew;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import net.minecraft.potion.Potion;
import vazkii.botania.common.brew.potion.PotionCleansing;
import vazkii.botania.common.brew.potion.PotionEmptiness;
import vazkii.botania.common.brew.potion.PotionFeatherfeet;
import vazkii.botania.common.brew.potion.PotionFulfilment;
import vazkii.botania.common.brew.potion.PotionGravitation;
import vazkii.botania.common.brew.potion.PotionLivingReactor;
import vazkii.botania.common.brew.potion.PotionManashock;
import vazkii.botania.common.brew.potion.PotionSoulCross;
public class ModPotions {
@@ -38,7 +27,7 @@ public class ModPotions {
public static void init() {
/*if(Potion.potionTypes.length < 256)
extendPotionArray();
soulCross = new PotionSoulCross();
featherfeet = new PotionFeatherfeet();
emptiness = new PotionEmptiness();
@@ -49,29 +38,4 @@ public class ModPotions {
cleansing = new PotionCleansing();*/
}
// This is the method that everyone and their mom uses right?
// Source: http://www.minecraftforge.net/wiki/Potion_Tutorial
private static void extendPotionArray() {
Potion[] potionTypes = null;
for(Field f : Potion.class.getDeclaredFields()) {
f.setAccessible(true);
try {
if(f.getName().equals("potionTypes") || f.getName().equals("field_76425_a")) {
Field modfield = Field.class.getDeclaredField("modifiers");
modfield.setAccessible(true);
modfield.setInt(f, f.getModifiers() & ~Modifier.FINAL);
potionTypes = (Potion[]) f.get(null);
Potion[] newPotionTypes = new Potion[256];
System.arraycopy(potionTypes, 0, newPotionTypes, 0, potionTypes.length);
f.set(null, newPotionTypes);
}
} catch (Exception e) {
System.err.println("Botania done goofed:");
System.err.println(e);
}
}
}
}
@@ -21,26 +21,26 @@ import cpw.mods.fml.relauncher.SideOnly;
public class PotionMod extends Potion {
private static final ResourceLocation resource = new ResourceLocation(LibResources.GUI_POTIONS);
public PotionMod(String name, boolean badEffect, int color, int iconIndex) {
super(findFreeID(), badEffect, color);
setPotionName("botania.potion." + name);
setIconIndex(iconIndex % 8, iconIndex / 8);
}
static int findFreeID() {
for(int i = 0; i < potionTypes.length; i++)
if(potionTypes[i] == null)
return i;
return -1;
}
@Override
@SideOnly(Side.CLIENT)
public int getStatusIconIndex() {
Minecraft.getMinecraft().renderEngine.bindTexture(resource);
return super.getStatusIconIndex();
}
@@ -113,7 +113,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
addItem(ModItems.bloodPendant);
addBlock(ModBlocks.pylon);
addBlock(ModBlocks.pistonRelay);
addBlock(ModBlocks.redStringContainer);
addBlock(ModBlocks.redStringDispenser);
addBlock(ModBlocks.redStringFertilizer);
@@ -130,11 +130,11 @@ public final class BotaniaCreativeTab extends CreativeTabs {
addItem(ModItems.signalFlare);
addBlock(ModBlocks.dirtPath);
addBlock(ModBlocks.dreamwood);
addBlock(ModBlocks.manaGlass);
addBlock(ModBlocks.elfGlass);
addBlock(ModBlocks.prismarine);
addBlock(ModBlocks.seaLamp);
addBlock(ModBlocks.prismarineStairs);
Loaded 100 of 174 files, more files were not shown because too many files have changed in this diff. Show more