mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-13 16:54:06 +00:00
One of them cleanups.
This commit is contained in:
1 parent
c8dbfdf90d
commit
ff7b82ca07
118 files changed
+555
-605
No files matched your search
@@ -19,7 +19,7 @@ import net.minecraft.item.ItemStack;
|
||||
public interface IAncientWillContainer {
|
||||
|
||||
public void addAncientWill(ItemStack stack, int will);
|
||||
|
||||
|
||||
public boolean hasAncientWill(ItemStack stack, int will);
|
||||
|
||||
|
||||
}
|
||||
@@ -26,5 +26,5 @@ public interface IManaDiscountArmor {
|
||||
* You can also return negative values to make tools cost more.
|
||||
*/
|
||||
public float getDiscount(ItemStack stack, int slot, EntityPlayer player);
|
||||
|
||||
|
||||
}
|
||||
@@ -197,7 +197,7 @@ public final class ManaItemHandler {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Requests mana from items in a given player's inventory. This version also
|
||||
* checks for IManaDiscountArmor items equipped to lower the cost.
|
||||
@@ -208,8 +208,8 @@ public final class ManaItemHandler {
|
||||
*/
|
||||
public static int requestManaForTool(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) {
|
||||
float multiplier = Math.max(0F, 1F - getFullDiscountForTools(player));
|
||||
int cost = (int) ((float) manaToGet * multiplier);
|
||||
return (int) ((float) requestMana(stack, player, cost, remove) / multiplier);
|
||||
int cost = (int) (manaToGet * multiplier);
|
||||
return (int) (requestMana(stack, player, cost, remove) / multiplier);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -222,13 +222,13 @@ public final class ManaItemHandler {
|
||||
*/
|
||||
public static boolean requestManaExactForTool(ItemStack stack, EntityPlayer player, int manaToGet, boolean remove) {
|
||||
float multiplier = Math.max(0F, 1F - getFullDiscountForTools(player));
|
||||
int cost = (int) ((float) manaToGet * multiplier);
|
||||
int cost = (int) (manaToGet * multiplier);
|
||||
return requestManaExact(stack, player, cost, remove);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the sum of all the discounts on IManaDiscountArmor items equipped
|
||||
* on the player passed in.
|
||||
* on the player passed in.
|
||||
*/
|
||||
public static float getFullDiscountForTools(EntityPlayer player) {
|
||||
float discount = 0F;
|
||||
@@ -237,7 +237,7 @@ public final class ManaItemHandler {
|
||||
if(armor != null && armor.getItem() instanceof IManaDiscountArmor)
|
||||
discount += ((IManaDiscountArmor) armor.getItem()).getDiscount(armor, i, player);
|
||||
}
|
||||
|
||||
|
||||
return discount;
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,6 @@ import vazkii.botania.api.item.IBaubleRender.Helper;
|
||||
import vazkii.botania.api.item.IBaubleRender.RenderType;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.equipment.armor.elementium.ItemElementiumHelm;
|
||||
import vazkii.botania.common.item.equipment.armor.terrasteel.ItemTerrasteelHelm;
|
||||
import baubles.common.container.InventoryBaubles;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
@@ -49,7 +48,7 @@ public final class BaubleRenderHandler {
|
||||
dispatchRenders(inv, event, RenderType.BODY);
|
||||
if(inv.getStackInSlot(3) != null)
|
||||
renderManaTablet(event);
|
||||
|
||||
|
||||
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;
|
||||
@@ -59,8 +58,8 @@ public final class BaubleRenderHandler {
|
||||
GL11.glRotatef(yaw - 270, 0, 1, 0);
|
||||
GL11.glRotatef(pitch, 0, 0, 1);
|
||||
dispatchRenders(inv, event, RenderType.HEAD);
|
||||
|
||||
ItemStack helm = player.inventory.armorItemInSlot(3);
|
||||
|
||||
ItemStack helm = player.inventory.armorItemInSlot(3);
|
||||
if(helm != null && helm.getItem() instanceof ItemTerrasteelHelm)
|
||||
ItemTerrasteelHelm.renderOnPlayer(helm, event);
|
||||
GL11.glPopMatrix();
|
||||
@@ -77,7 +76,7 @@ public final class BaubleRenderHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void renderManaTablet(RenderPlayerEvent event) {
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
boolean renderedOne = false;
|
||||
@@ -91,7 +90,7 @@ public final class BaubleRenderHandler {
|
||||
boolean armor = event.entityPlayer.getCurrentArmor(1) != null;
|
||||
GL11.glRotatef(180F, 1F, 0F, 0F);
|
||||
GL11.glRotatef(90F, 0F, 1F, 0F);
|
||||
GL11.glTranslatef(-0.25F, -0.85F, renderedOne ? (armor ? 0.2F : 0.28F) : (armor ? -0.3F : -0.25F));
|
||||
GL11.glTranslatef(-0.25F, -0.85F, renderedOne ? armor ? 0.2F : 0.28F : armor ? -0.3F : -0.25F);
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
@@ -111,7 +110,7 @@ public final class BaubleRenderHandler {
|
||||
GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
|
||||
|
||||
if(renderedOne)
|
||||
return;
|
||||
renderedOne = true;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ClientTickHandler {
|
||||
if(event.phase == Phase.START)
|
||||
partialTicks = event.renderTickTime;
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void clientTickEnd(ClientTickEvent event) {
|
||||
if(event.phase == Phase.END) {
|
||||
|
||||
@@ -291,7 +291,7 @@ public final class HUDHandler {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
profiler.endSection();
|
||||
}
|
||||
|
||||
|
||||
public static void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res) {
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
@@ -12,8 +12,6 @@ package vazkii.botania.client.core.handler;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
@@ -21,17 +19,20 @@ import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public final class ItemsRemainingRenderHandler {
|
||||
|
||||
|
||||
private static int maxTicks = 30;
|
||||
private static int leaveTicks = 20;
|
||||
|
||||
|
||||
private static ItemStack stack;
|
||||
private static int ticks, count;
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void render(ScaledResolution resolution, float partTicks) {
|
||||
if(ticks > 0 && stack != null) {
|
||||
@@ -39,14 +40,14 @@ public final class ItemsRemainingRenderHandler {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
int x = resolution.getScaledWidth() / 2 + 10 + Math.max(0, pos - leaveTicks);
|
||||
int y = resolution.getScaledHeight() / 2;
|
||||
|
||||
|
||||
int start = maxTicks - leaveTicks;
|
||||
float alpha = (ticks + partTicks) > start ? 1F : (float) (ticks + partTicks) / (float) start;
|
||||
float alpha = ticks + partTicks > start ? 1F : (ticks + partTicks) / start;
|
||||
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
|
||||
GL11.glColor4f(1F, 1F, 1F, alpha);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
int xp = x + (int) (16F * (1F - alpha));
|
||||
@@ -58,38 +59,38 @@ public final class ItemsRemainingRenderHandler {
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
|
||||
|
||||
String text = EnumChatFormatting.GREEN + stack.getDisplayName();
|
||||
if(count >= 0) {
|
||||
int max = stack.getMaxStackSize();
|
||||
int stacks = count / max;
|
||||
int rem = count % max;
|
||||
|
||||
|
||||
if(stacks == 0)
|
||||
text = "" + count;
|
||||
else text = count + " (" + stacks + "*" + max + "+" + rem + ")";
|
||||
}
|
||||
|
||||
int color = 0x00FFFFFF | ((int) (alpha * 0xFF) << 24);
|
||||
|
||||
int color = 0x00FFFFFF | (int) (alpha * 0xFF) << 24;
|
||||
mc.fontRenderer.drawStringWithShadow(text, x + 20, y + 6, color);
|
||||
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void tick() {
|
||||
if(ticks > 0)
|
||||
--ticks;
|
||||
}
|
||||
|
||||
|
||||
public static void set(ItemStack stack, int count) {
|
||||
ItemsRemainingRenderHandler.stack = stack;
|
||||
ItemsRemainingRenderHandler.count = count;
|
||||
ticks = stack == null ? 0 : maxTicks;
|
||||
}
|
||||
|
||||
|
||||
public static void set(EntityPlayer player, ItemStack displayStack, Pattern pattern) {
|
||||
int count = 0;
|
||||
for(int i = 0; i < player.inventory.getSizeInventory(); i++) {
|
||||
@@ -97,8 +98,8 @@ public final class ItemsRemainingRenderHandler {
|
||||
if(stack != null && pattern.matcher(stack.getUnlocalizedName()).find())
|
||||
count += stack.stackSize;
|
||||
}
|
||||
|
||||
|
||||
set(displayStack, count);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -14,8 +14,6 @@ import java.awt.Desktop;
|
||||
import java.net.URI;
|
||||
import java.util.Calendar;
|
||||
|
||||
import baubles.common.container.InventoryBaubles;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.PlayerControllerMP;
|
||||
@@ -23,7 +21,6 @@ import net.minecraft.client.network.NetHandlerPlayClient;
|
||||
import net.minecraft.client.renderer.entity.RenderSnowball;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.PlayerCapabilities;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntitySkull;
|
||||
@@ -113,6 +110,8 @@ import vazkii.botania.common.entity.EntityThornChakram;
|
||||
import vazkii.botania.common.entity.EntityVineBall;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.lib.LibObfuscation;
|
||||
import baubles.common.container.InventoryBaubles;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
@@ -227,7 +226,7 @@ public class ClientProxy extends CommonProxy {
|
||||
public boolean isTheClientPlayer(EntityLivingBase entity) {
|
||||
return entity == Minecraft.getMinecraft().thePlayer;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isClientPlayerWearingMonocle() {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
@@ -291,7 +290,7 @@ public class ClientProxy extends CommonProxy {
|
||||
public void setSparkleFXCorrupt(boolean corrupt) {
|
||||
corruptSparkle = corrupt;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m, boolean fake) {
|
||||
if(!doParticle() && !fake)
|
||||
|
||||
@@ -72,7 +72,7 @@ public class FXSparkle extends EntityFX {
|
||||
for(FXSparkle sparkle : queuedRenders)
|
||||
sparkle.renderQueued(tessellator);
|
||||
tessellator.draw();
|
||||
|
||||
|
||||
ShaderHelper.useShader(ShaderHelper.filmGrain);
|
||||
tessellator.startDrawingQuads();
|
||||
for(FXSparkle sparkle : queuedCorruptRenders)
|
||||
|
||||
@@ -152,7 +152,7 @@ public class GuiLexicon extends GuiScreen {
|
||||
RenderHelper.renderTooltip(par1, par2, Arrays.asList(EnumChatFormatting.GOLD + "#goldfishchris", EnumChatFormatting.RED + "INTENSIFY HIM"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
super.drawScreen(par1, par2, par3);
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa
|
||||
ClientTickHandler.notifyPageChange();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
LexiconPage page = entry.pages.get(this.page);
|
||||
|
||||
page.onOpened(this);
|
||||
|
||||
@@ -56,17 +56,17 @@ public class RenderLexicon implements IItemRenderer {
|
||||
ticks += ClientTickHandler.partialTicks;
|
||||
else ticks -= ClientTickHandler.partialTicks;
|
||||
}
|
||||
|
||||
|
||||
GL11.glTranslatef(0.3F + 0.02F * ticks, 0.475F + 0.01F * ticks, -0.2F - 0.01F * ticks);
|
||||
GL11.glRotatef(87.5F + ticks * 5, 0F, 1F, 0F);
|
||||
GL11.glRotatef(ticks * 2.5F, 0F, 0F, 1F);
|
||||
GL11.glScalef(0.9F, 0.9F, 0.9F);
|
||||
opening = ticks / 12F;
|
||||
|
||||
|
||||
float pageFlipTicks = ClientTickHandler.pageFlipTicks;
|
||||
if(pageFlipTicks > 0)
|
||||
pageFlipTicks -= ClientTickHandler.partialTicks;
|
||||
|
||||
|
||||
pageFlip = pageFlipTicks / 5F;
|
||||
|
||||
model.render(null, 0F, 0F, pageFlip, opening, 0F, 1F / 16F);
|
||||
|
||||
@@ -82,10 +82,10 @@ public class RenderTileTinyPotato extends TileEntitySpecialRenderer {
|
||||
tessellator.startDrawingQuads();
|
||||
int i = mc.fontRenderer.getStringWidth(potato.name) / 2;
|
||||
tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F);
|
||||
tessellator.addVertex((double)(-i - 1), -1.0D, 0.0D);
|
||||
tessellator.addVertex((double)(-i - 1), 8.0D, 0.0D);
|
||||
tessellator.addVertex((double)(i + 1), 8.0D, 0.0D);
|
||||
tessellator.addVertex((double)(i + 1), -1.0D, 0.0D);
|
||||
tessellator.addVertex(-i - 1, -1.0D, 0.0D);
|
||||
tessellator.addVertex(-i - 1, 8.0D, 0.0D);
|
||||
tessellator.addVertex(i + 1, 8.0D, 0.0D);
|
||||
tessellator.addVertex(i + 1, -1.0D, 0.0D);
|
||||
tessellator.draw();
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
*/
|
||||
package vazkii.botania.common;
|
||||
|
||||
import vazkii.botania.common.core.handler.AliasHandler;
|
||||
import vazkii.botania.common.core.handler.ManaNetworkHandler;
|
||||
import vazkii.botania.common.core.proxy.CommonProxy;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -21,7 +20,6 @@ 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;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
|
||||
@@ -21,17 +21,17 @@ import net.minecraft.stats.Achievement;
|
||||
public class AchievementMod extends Achievement {
|
||||
|
||||
public static List<Achievement> achievements = new ArrayList();
|
||||
|
||||
|
||||
public AchievementMod(String name, int x, int y, ItemStack icon, Achievement parent) {
|
||||
super("achievement.botania:" + name, "botania:" + name, x, y, icon, parent);
|
||||
achievements.add(this);
|
||||
registerStat();
|
||||
}
|
||||
|
||||
|
||||
public AchievementMod(String name, int x, int y, Item icon, Achievement parent) {
|
||||
this(name, x, y, new ItemStack(icon), parent);
|
||||
}
|
||||
|
||||
|
||||
public AchievementMod(String name, int x, int y, Block icon, Achievement parent) {
|
||||
this(name, x, y, new ItemStack(icon), parent);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public final class AchievementTriggerer {
|
||||
event.player.addStat(achievement, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onItemCrafted(ItemCraftedEvent event) {
|
||||
if(event.crafting != null && event.crafting.getItem() instanceof ICraftAchievement) {
|
||||
@@ -36,5 +36,5 @@ public final class AchievementTriggerer {
|
||||
event.player.addStat(achievement, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -12,12 +12,11 @@ package vazkii.botania.common.achievement;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
|
||||
public interface ICraftAchievement {
|
||||
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix);
|
||||
|
||||
|
||||
}
|
||||
@@ -18,5 +18,5 @@ import net.minecraft.stats.Achievement;
|
||||
public interface IPickupAchievement {
|
||||
|
||||
public Achievement getAchievementOnPickup(ItemStack stack, EntityPlayer player, EntityItem item);
|
||||
|
||||
|
||||
}
|
||||
@@ -10,24 +10,22 @@
|
||||
*/
|
||||
package vazkii.botania.common.achievement;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraftforge.common.AchievementPage;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
import vazkii.botania.common.lib.LibAchievementNames;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
public final class ModAchievements {
|
||||
|
||||
public static AchievementPage botaniaPage;
|
||||
|
||||
|
||||
public static Achievement flowerPickup;
|
||||
public static Achievement lexiconUse;
|
||||
public static Achievement daybloomPickup;
|
||||
@@ -48,54 +46,54 @@ public final class ModAchievements {
|
||||
public static Achievement gaiaGuardianKill;
|
||||
public static Achievement spawnerMoverUse;
|
||||
public static Achievement tiaraWings;
|
||||
|
||||
|
||||
public static Achievement signalFlareStun;
|
||||
public static Achievement l20ShardUse;
|
||||
public static Achievement gaiaGuardianNoArmor;
|
||||
public static Achievement rankSSPick;
|
||||
|
||||
|
||||
public static Achievement desuGun;
|
||||
|
||||
|
||||
public static void init() {
|
||||
flowerPickup = new AchievementMod(LibAchievementNames.FLOWER_PICKUP, 0, 0, new ItemStack(ModBlocks.flower, 1, 6), null);
|
||||
lexiconUse = new AchievementMod(LibAchievementNames.LEXICON_USE, 1, 1, ModItems.lexicon, flowerPickup);
|
||||
daybloomPickup = new AchievementMod(LibAchievementNames.DAYBLOOM_PICKUP, 3, 1, ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_DAYBLOOM), lexiconUse);
|
||||
manaPoolPickup = new AchievementMod(LibAchievementNames.MANA_POOL_PICKUP, 3, -1, ModBlocks.pool, daybloomPickup);
|
||||
|
||||
|
||||
endoflamePickup = new AchievementMod(LibAchievementNames.ENDOFLAME_PICKUP, 1, -3, ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_ENDOFLAME), manaPoolPickup);
|
||||
tinyPotatoPet = new AchievementMod(LibAchievementNames.TINY_POTATO_PET, 2, -5, ModBlocks.tinyPotato, manaPoolPickup);
|
||||
sparkCraft = new AchievementMod(LibAchievementNames.SPARK_CRAFT, 4, -5, ModItems.spark, manaPoolPickup);
|
||||
baubleWear = new AchievementMod(LibAchievementNames.BAUBLE_WEAR, 5, -3, ModItems.manaRing, manaPoolPickup);
|
||||
manaCookieEat = new AchievementMod(LibAchievementNames.MANA_COOKIE_EAT, 3, -7, ModItems.manaCookie, manaPoolPickup);
|
||||
runePickup = new AchievementMod(LibAchievementNames.RUNE_PICKUP, 6, -1, ModBlocks.runeAltar, manaPoolPickup);
|
||||
|
||||
|
||||
dirtRodCraft = new AchievementMod(LibAchievementNames.DIRT_ROD_CRAFT, 8, 0, ModItems.dirtRod, runePickup);
|
||||
manaBlasterShoot = new AchievementMod(LibAchievementNames.MANA_BLASTER_SHOOT, 8, -2, ModItems.manaGun, runePickup);
|
||||
terrasteelPickup = new AchievementMod(LibAchievementNames.TERRASTEEL_PICKUP, 6, 4, new ItemStack(ModItems.manaResource, 1, 4), runePickup).setSpecial();
|
||||
|
||||
terrasteelWeaponCraft = new AchievementMod(LibAchievementNames.TERRASTEEL_WEAPON_CRAFT, 8, 5, ModItems.terraSword, terrasteelPickup);
|
||||
|
||||
terrasteelWeaponCraft = new AchievementMod(LibAchievementNames.TERRASTEEL_WEAPON_CRAFT, 8, 5, ModItems.terraSword, terrasteelPickup);
|
||||
elfPortalOpen = new AchievementMod(LibAchievementNames.ELF_PORTAL_OPEN, 4, 4, ModBlocks.alfPortal, terrasteelPickup).setSpecial();
|
||||
|
||||
|
||||
kekimurusPickup = new AchievementMod(LibAchievementNames.KEKIMURUS_PICKUP, 3, 6, ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_KEKIMURUS), elfPortalOpen);
|
||||
heiseiDreamPickup = new AchievementMod(LibAchievementNames.HEISEI_DREAM_PICKUP, 5, 6, ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_HEISEI_DREAM), elfPortalOpen);
|
||||
gaiaGuardianKill = new AchievementMod(LibAchievementNames.GAIA_GUARDIAN_KILL, 2, 4, new ItemStack(ModItems.manaResource, 1, 5), elfPortalOpen).setSpecial();
|
||||
|
||||
|
||||
spawnerMoverUse = new AchievementMod(LibAchievementNames.SPAWNER_MOVER_USE, -1, 5, ModItems.spawnerMover, gaiaGuardianKill);
|
||||
tiaraWings = new AchievementMod(LibAchievementNames.TIARA_WINGS, -1, 3, ModItems.flightTiara, gaiaGuardianKill);
|
||||
|
||||
|
||||
signalFlareStun = new AchievementMod(LibAchievementNames.SIGNAL_FLARE_STUN, -3, -3, ModItems.signalFlare, null).setSpecial();
|
||||
l20ShardUse = new AchievementMod(LibAchievementNames.L20_SHARD_USE, -5, -1, ModItems.laputaShard, null).setSpecial();
|
||||
gaiaGuardianNoArmor = new AchievementMod(LibAchievementNames.GAIA_GUARDIAN_NO_ARMOR, -5, -3, new ItemStack(Items.skull, 1, 3), null).setSpecial();
|
||||
rankSSPick = new AchievementMod(LibAchievementNames.RANK_SS_PICK, -3, -1, ModItems.terraPick, null).setSpecial();
|
||||
|
||||
|
||||
ItemStack desu = new ItemStack(ModItems.manaGun);
|
||||
desu.setStackDisplayName("desu gun");
|
||||
desuGun = new AchievementMod(LibAchievementNames.DESU_GUN, -8, -2, desu, null).setSpecial();
|
||||
|
||||
|
||||
botaniaPage = new AchievementPage(LibMisc.MOD_NAME, AchievementMod.achievements.toArray(new Achievement[AchievementMod.achievements.size()]));
|
||||
AchievementPage.registerAchievementPage(botaniaPage);
|
||||
|
||||
|
||||
FMLCommonHandler.instance().bus().register(new AchievementTriggerer());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -10,7 +10,6 @@
|
||||
*/
|
||||
package vazkii.botania.common.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -67,7 +66,7 @@ public class BlockEnchantedSoil extends BlockMod implements ILexiconable {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest() {
|
||||
return true;
|
||||
@@ -77,5 +76,5 @@ public class BlockEnchantedSoil extends BlockMod implements ILexiconable {
|
||||
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
|
||||
return LexiconData.overgrowthSeed;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class BlockOpenCrate extends BlockModContainer implements ILexiconable, I
|
||||
IIcon iconBottomCraft;
|
||||
|
||||
IIcon[] sidePatternIcons;
|
||||
|
||||
|
||||
Random random;
|
||||
|
||||
private static final int SUBTYPES = 2;
|
||||
@@ -138,7 +138,7 @@ public class BlockOpenCrate extends BlockModContainer implements ILexiconable, I
|
||||
iconBottom = IconHelper.forBlock(par1IconRegister, this, 1);
|
||||
iconSideCraft = IconHelper.forBlock(par1IconRegister, this, 2);
|
||||
iconBottomCraft = IconHelper.forBlock(par1IconRegister, this, 3);
|
||||
|
||||
|
||||
sidePatternIcons = new IIcon[TileCraftCrate.PATTERNS.length];
|
||||
for(int i = 0; i < sidePatternIcons.length; i++)
|
||||
sidePatternIcons[i] = IconHelper.forName(par1IconRegister, "ocPattern" + i);
|
||||
@@ -154,10 +154,10 @@ public class BlockOpenCrate extends BlockModContainer implements ILexiconable, I
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if(tile != null && tile instanceof TileCraftCrate && ((TileCraftCrate) tile).pattern != -1 && side != 0)
|
||||
return sidePatternIcons[((TileCraftCrate) tile).pattern];
|
||||
|
||||
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return meta == 0 ? new TileOpenCrate() : new TileCraftCrate();
|
||||
|
||||
@@ -24,11 +24,9 @@ import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
@@ -41,7 +39,6 @@ import vazkii.botania.api.subtile.ISpecialFlower;
|
||||
import vazkii.botania.api.wand.IWandHUD;
|
||||
import vazkii.botania.api.wand.IWandable;
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.achievement.IPickupAchievement;
|
||||
import vazkii.botania.common.block.tile.TileSpecialFlower;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
import vazkii.botania.common.item.block.ItemBlockSpecialFlower;
|
||||
@@ -78,7 +75,7 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
LibBlockNames.SUBTILE_BELLETHORN,
|
||||
LibBlockNames.SUBTILE_DREADTHORN,
|
||||
LibBlockNames.SUBTILE_HEISEI_DREAM,
|
||||
LibBlockNames.SUBTILE_TIGERSEYE,
|
||||
LibBlockNames.SUBTILE_TIGERSEYE,
|
||||
LibBlockNames.SUBTILE_MARIMORPHOSIS,
|
||||
LibBlockNames.SUBTILE_ORECHID,
|
||||
LibBlockNames.SUBTILE_FALLEN_KANADE,
|
||||
|
||||
@@ -250,9 +250,9 @@ public final class ModBlocks {
|
||||
prism = new BlockPrism();
|
||||
dirtPath = new BlockDirtPath();
|
||||
enchantedSoil = new BlockEnchantedSoil();
|
||||
|
||||
|
||||
ModFluffBlocks.init();
|
||||
|
||||
|
||||
for(int i = 0; i < 16; i++)
|
||||
OreDictionary.registerOre(LibOreDict.FLOWER[i], new ItemStack(flower, 1, i));
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@ import vazkii.botania.common.block.decor.slabs.prismarine.BlockDarkPrismarineSla
|
||||
import vazkii.botania.common.block.decor.slabs.prismarine.BlockPrismarineBrickSlab;
|
||||
import vazkii.botania.common.block.decor.slabs.prismarine.BlockPrismarineSlab;
|
||||
import vazkii.botania.common.block.decor.stairs.BlockBiomeStoneStairs;
|
||||
import vazkii.botania.common.block.decor.stairs.BlockLivingStairs;
|
||||
import vazkii.botania.common.block.decor.stairs.BlockReedStairs;
|
||||
import vazkii.botania.common.block.decor.stairs.BlockThatchStairs;
|
||||
import vazkii.botania.common.block.decor.stairs.bricks.BlockCustomBrickStairs;
|
||||
@@ -129,17 +128,17 @@ public final class ModFluffBlocks {
|
||||
public static Block elfQuartzSlab;
|
||||
public static Block elfQuartzSlabFull;
|
||||
public static Block elfQuartzStairs;
|
||||
|
||||
|
||||
public static Block dirtPathSlab;
|
||||
public static Block dirtPathSlabFull;
|
||||
|
||||
|
||||
public static Block biomeStoneA;
|
||||
public static Block biomeStoneB;
|
||||
|
||||
|
||||
public static Block[] biomeStoneStairs = new Block[24];
|
||||
public static Block[] biomeStoneSlabs = new Block[24];
|
||||
public static Block[] biomeStoneFullSlabs = new Block[24];
|
||||
|
||||
|
||||
public static void init() {
|
||||
livingwoodStairs = new BlockLivingwoodStairs();
|
||||
livingwoodSlab = new BlockLivingwoodSlab(false);
|
||||
@@ -189,7 +188,7 @@ public final class ModFluffBlocks {
|
||||
tileStairs = new BlockTileStairs();
|
||||
tileSlab = new BlockTileSlab(false);
|
||||
tileSlabFull = new BlockTileSlab(true);
|
||||
|
||||
|
||||
biomeStoneA = new BlockBiomeStoneA();
|
||||
biomeStoneB = new BlockBiomeStoneB();
|
||||
|
||||
@@ -223,7 +222,7 @@ public final class ModFluffBlocks {
|
||||
|
||||
dirtPathSlab = new BlockDirtPathSlab(false);
|
||||
dirtPathSlabFull = new BlockDirtPathSlab(true);
|
||||
|
||||
|
||||
for(int i = 0; i < 24; i++) {
|
||||
int meta = i % 16;
|
||||
Block block = i < 16 ? biomeStoneA : biomeStoneB;
|
||||
@@ -231,7 +230,7 @@ public final class ModFluffBlocks {
|
||||
biomeStoneSlabs[i] = new BlockBiomeStoneSlab(false, block, meta, i);
|
||||
biomeStoneFullSlabs[i] = new BlockBiomeStoneSlab(true, block, meta, i);
|
||||
}
|
||||
|
||||
|
||||
if(ConfigHandler.darkQuartzEnabled) {
|
||||
((BlockModSlab) darkQuartzSlab).register();
|
||||
((BlockModSlab) darkQuartzSlabFull).register();
|
||||
@@ -280,14 +279,14 @@ public final class ModFluffBlocks {
|
||||
((BlockModSlab) snowBrickSlabFull).register();
|
||||
((BlockModSlab) tileSlab).register();
|
||||
((BlockModSlab) tileSlabFull).register();
|
||||
|
||||
|
||||
((BlockModSlab) dirtPathSlab).register();
|
||||
((BlockModSlab) dirtPathSlabFull).register();
|
||||
|
||||
|
||||
for(int i = 0; i < 24; i++) {
|
||||
((BlockModSlab) biomeStoneSlabs[i]).register();
|
||||
((BlockModSlab) biomeStoneFullSlabs[i]).register();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -36,7 +36,7 @@ public class BlockManaFlame extends BlockModContainer {
|
||||
setBlockBounds(f, f, f, 1F - f, 1F - f, 1F - f);
|
||||
setLightLevel(1F);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean registerInCreative() {
|
||||
return false;
|
||||
|
||||
@@ -11,10 +11,7 @@
|
||||
package vazkii.botania.common.block.decor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -32,10 +29,10 @@ import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.block.BlockModContainer;
|
||||
import vazkii.botania.common.block.tile.TileTinyPotato;
|
||||
import vazkii.botania.common.item.block.ItemBlockMod;
|
||||
import vazkii.botania.common.item.block.ItemBlockTinyPotato;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockTinyPotato extends BlockModContainer implements ILexiconable {
|
||||
|
||||
@@ -46,13 +43,14 @@ public class BlockTinyPotato extends BlockModContainer implements ILexiconable {
|
||||
float f = 1F / 16F * 6F;
|
||||
setBlockBounds(f, 0, f, 1F - f, f, 1F - f);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Block setBlockName(String par1Str) {
|
||||
GameRegistry.registerBlock(this, ItemBlockTinyPotato.class, par1Str);
|
||||
return super.setBlockName(par1Str);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldRegisterInNameSet() {
|
||||
return false;
|
||||
}
|
||||
@@ -83,10 +81,10 @@ public class BlockTinyPotato extends BlockModContainer implements ILexiconable {
|
||||
int l1 = MathHelper.floor_double(par5EntityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
par1World.setBlockMetadataWithNotify(par2, par3, par4, l1, 2);
|
||||
if (par6ItemStack.hasDisplayName())
|
||||
((TileTinyPotato) par1World.getTileEntity(par2, par3, par4)).name = par6ItemStack.getDisplayName();
|
||||
if (par6ItemStack.hasDisplayName())
|
||||
((TileTinyPotato) par1World.getTileEntity(par2, par3, par4)).name = par6ItemStack.getDisplayName();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) {
|
||||
if(!par6EntityPlayer.capabilities.isCreativeMode)
|
||||
@@ -105,7 +103,7 @@ public class BlockTinyPotato extends BlockModContainer implements ILexiconable {
|
||||
stack.setStackDisplayName(name);
|
||||
list.add(stack);
|
||||
}
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ package vazkii.botania.common.block.decor.biomestone;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -29,40 +28,41 @@ import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.block.BlockMod;
|
||||
import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockBiomeStone extends BlockMod implements ILexiconable {
|
||||
|
||||
private static IIcon[] icons = new IIcon[32];
|
||||
int iconOffset;
|
||||
|
||||
|
||||
public BlockBiomeStone(int iconOffset, String name) {
|
||||
super(Material.rock);
|
||||
setHardness(1.5F);
|
||||
setResistance(10F);
|
||||
setStepSound(soundTypeStone);
|
||||
setBlockName(name);
|
||||
this.iconOffset = iconOffset;
|
||||
this.iconOffset = iconOffset;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
for(int i = 0; i < 16; i++) {
|
||||
int index = i + iconOffset;
|
||||
icons[index] = IconHelper.forName(register, "biomeStone" + index);
|
||||
icons[index] = IconHelper.forName(register, "biomeStone" + index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for(int i = 0; i < 16; i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return icons[meta + iconOffset];
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean shouldRegisterInNameSet() {
|
||||
return false;
|
||||
|
||||
@@ -17,7 +17,7 @@ public class BlockBiomeStoneA extends BlockBiomeStone {
|
||||
public BlockBiomeStoneA() {
|
||||
super(0, LibBlockNames.BIOME_STONE_A);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int damageDropped(int par1) {
|
||||
return par1 % 8 + 8;
|
||||
|
||||
@@ -10,19 +10,19 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor.slabs;
|
||||
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class BlockBiomeStoneSlab extends BlockLivingSlab {
|
||||
|
||||
int index;
|
||||
|
||||
|
||||
public BlockBiomeStoneSlab(boolean full, Block source, int meta, int index) {
|
||||
super(full, source, meta);
|
||||
this.index = index;
|
||||
@@ -37,7 +37,7 @@ public class BlockBiomeStoneSlab extends BlockLivingSlab {
|
||||
public BlockSlab getSingleBlock() {
|
||||
return (BlockSlab) ModFluffBlocks.biomeStoneSlabs[index];
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
|
||||
return LexiconData.marimorphosis;
|
||||
|
||||
@@ -13,7 +13,6 @@ package vazkii.botania.common.block.decor.slabs;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
@@ -26,7 +25,7 @@ public class BlockDirtPathSlab extends BlockLivingSlab {
|
||||
super(full, ModBlocks.dirtPath, 0);
|
||||
setHardness(0.6F);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BlockSlab getFullBlock() {
|
||||
return (BlockSlab) ModFluffBlocks.dirtPathSlab;
|
||||
|
||||
@@ -10,19 +10,19 @@
|
||||
*/
|
||||
package vazkii.botania.common.block.decor.stairs;
|
||||
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
|
||||
public class BlockBiomeStoneStairs extends BlockLivingStairs {
|
||||
|
||||
public BlockBiomeStoneStairs(Block source, int meta) {
|
||||
super(source, meta);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
|
||||
return LexiconData.marimorphosis;
|
||||
|
||||
@@ -32,7 +32,6 @@ import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.block.BlockModContainer;
|
||||
import vazkii.botania.common.block.tile.TileSimpleInventory;
|
||||
import vazkii.botania.common.block.tile.mana.TilePrism;
|
||||
import vazkii.botania.common.block.tile.string.TileRedStringDispenser;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
@@ -127,7 +126,7 @@ public class BlockPrism extends BlockModContainer implements IManaTrigger, ILexi
|
||||
world.setBlockMetadataWithNotify(x, y, z, meta & -9, 1 | 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) {
|
||||
TileEntity tile = par1World.getTileEntity(par2, par3, par4);
|
||||
|
||||
+9
-11
@@ -14,7 +14,6 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import akka.util.Collections;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -23,7 +22,6 @@ import net.minecraftforge.common.BiomeDictionary;
|
||||
import net.minecraftforge.common.BiomeDictionary.Type;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.ModFluffBlocks;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
@@ -41,7 +39,7 @@ public class SubTileMarimorphosis extends SubTileFunctional {
|
||||
Type.SNOWY,
|
||||
Type.MESA
|
||||
};
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@@ -65,20 +63,20 @@ public class SubTileMarimorphosis extends SubTileFunctional {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ItemStack getStoneToPut(ChunkCoordinates coords) {
|
||||
List<Type> types = Arrays.asList(BiomeDictionary.getTypesForBiome(supertile.getWorldObj().getBiomeGenForCoords(coords.posX, coords.posZ)));
|
||||
|
||||
|
||||
List<Integer> values = new ArrayList();
|
||||
for(int i = 0; i < 8; i++) {
|
||||
int times = 1;
|
||||
if(types.contains(TYPES[i]))
|
||||
times = 12;
|
||||
|
||||
|
||||
for(int j = 0; j < times; j++)
|
||||
values.add(i);
|
||||
}
|
||||
|
||||
|
||||
return new ItemStack(ModFluffBlocks.biomeStoneA, 1, values.get(supertile.getWorldObj().rand.nextInt(values.size())));
|
||||
}
|
||||
|
||||
@@ -102,12 +100,12 @@ public class SubTileMarimorphosis extends SubTileFunctional {
|
||||
return null;
|
||||
return possibleCoords.get(supertile.getWorldObj().rand.nextInt(possibleCoords.size()));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return 0x769897;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean acceptsRedstone() {
|
||||
return true;
|
||||
@@ -117,10 +115,10 @@ public class SubTileMarimorphosis extends SubTileFunctional {
|
||||
public int getMaxMana() {
|
||||
return 1000;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.marimorphosis;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -56,7 +56,7 @@ public class SubTileMedumone extends SubTileFunctional {
|
||||
public int getMaxMana() {
|
||||
return 4000;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.medumone;
|
||||
|
||||
+16
-16
@@ -44,7 +44,7 @@ public class SubTileSpectranthemum extends SubTileFunctional {
|
||||
int x = supertile.xCoord;
|
||||
int y = supertile.yCoord;
|
||||
int z = supertile.zCoord;
|
||||
|
||||
|
||||
boolean did = false;
|
||||
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - range, y - range, z - range, x + range + 1, y + range, z + range + 1));
|
||||
for(EntityItem item : items) {
|
||||
@@ -66,23 +66,23 @@ public class SubTileSpectranthemum extends SubTileFunctional {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(did)
|
||||
sync();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void spawnExplosionParticles(EntityItem item) {
|
||||
for(int i = 0; i < 10; i++) {
|
||||
double m = 0.01;
|
||||
double d0 = item.worldObj.rand.nextGaussian() * m;
|
||||
double d1 = item.worldObj.rand.nextGaussian() * m;
|
||||
double d2 = item.worldObj.rand.nextGaussian() * m;
|
||||
double d3 = 10.0D;
|
||||
item.worldObj.spawnParticle("explode", item.posX + (double)(item.worldObj.rand.nextFloat() * item.width * 2.0F) - (double)item.width - d0 * d3, item.posY + (double)(item.worldObj.rand.nextFloat() * item.height) - d1 * d3, item.posZ + (double)(item.worldObj.rand.nextFloat() * item.width * 2.0F) - (double)item.width - d2 * d3, d0, d1, d2);
|
||||
}
|
||||
for(int i = 0; i < 10; i++) {
|
||||
double m = 0.01;
|
||||
double d0 = item.worldObj.rand.nextGaussian() * m;
|
||||
double d1 = item.worldObj.rand.nextGaussian() * m;
|
||||
double d2 = item.worldObj.rand.nextGaussian() * m;
|
||||
double d3 = 10.0D;
|
||||
item.worldObj.spawnParticle("explode", item.posX + item.worldObj.rand.nextFloat() * item.width * 2.0F - item.width - d0 * d3, item.posY + item.worldObj.rand.nextFloat() * item.height - d1 * d3, item.posZ + item.worldObj.rand.nextFloat() * item.width * 2.0F - item.width - d2 * d3, d0, d1, d2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void writeToPacketNBT(NBTTagCompound cmp) {
|
||||
super.writeToPacketNBT(cmp);
|
||||
@@ -90,7 +90,7 @@ public class SubTileSpectranthemum extends SubTileFunctional {
|
||||
cmp.setInteger(TAG_BIND_Y, bindY);
|
||||
cmp.setInteger(TAG_BIND_Z, bindZ);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readFromPacketNBT(NBTTagCompound cmp) {
|
||||
super.readFromPacketNBT(cmp);
|
||||
@@ -98,7 +98,7 @@ public class SubTileSpectranthemum extends SubTileFunctional {
|
||||
bindY = cmp.getInteger(TAG_BIND_Y);
|
||||
bindZ = cmp.getInteger(TAG_BIND_Z);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean acceptsRedstone() {
|
||||
return true;
|
||||
@@ -132,9 +132,9 @@ public class SubTileSpectranthemum extends SubTileFunctional {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ChunkCoordinates getBinding() {
|
||||
return (Minecraft.getMinecraft().thePlayer.isSneaking() && bindY != -1) ? new ChunkCoordinates(bindX, bindY, bindZ) : super.getBinding();
|
||||
return Minecraft.getMinecraft().thePlayer.isSneaking() && bindY != -1 ? new ChunkCoordinates(bindX, bindY, bindZ) : super.getBinding();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.spectranthemum;
|
||||
|
||||
@@ -12,7 +12,6 @@ package vazkii.botania.common.block.subtile.generating;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.monster.EntitySlime;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
@@ -41,7 +40,6 @@ public class SubTileNarslimmus extends SubTileGenerating {
|
||||
int size = slime.getSlimeSize();
|
||||
int mul = (int) Math.pow(2, size);
|
||||
int mana = 160 * mul;
|
||||
int remain = getMaxMana() - this.mana;
|
||||
if(!slime.worldObj.isRemote) {
|
||||
slime.setDead();
|
||||
slime.worldObj.playSoundAtEntity(slime, "mob.slime." + (size > 1 ? "big" : "small"), 1F, 0.02F);
|
||||
@@ -52,10 +50,10 @@ public class SubTileNarslimmus extends SubTileGenerating {
|
||||
for (int j = 0; j < mul * 8; ++j) {
|
||||
float f = slime.worldObj.rand.nextFloat() * (float)Math.PI * 2.0F;
|
||||
float f1 = slime.worldObj.rand.nextFloat() * 0.5F + 0.5F;
|
||||
float f2 = MathHelper.sin(f) * (float) size * 0.5F * f1;
|
||||
float f3 = MathHelper.cos(f) * (float) size * 0.5F * f1;
|
||||
float f4 = slime.worldObj.rand.nextFloat() * (float) size * 0.5F * f1;
|
||||
slime.worldObj.spawnParticle("slime", slime.posX + (double)f2, slime.boundingBox.minY + f4, slime.posZ + (double)f3, 0.0D, 0.0D, 0.0D);
|
||||
float f2 = MathHelper.sin(f) * size * 0.5F * f1;
|
||||
float f3 = MathHelper.cos(f) * size * 0.5F * f1;
|
||||
float f4 = slime.worldObj.rand.nextFloat() * size * 0.5F * f1;
|
||||
slime.worldObj.spawnParticle("slime", slime.posX + f2, slime.boundingBox.minY + f4, slime.posZ + f3, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -77,7 +75,7 @@ public class SubTileNarslimmus extends SubTileGenerating {
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.narslimmus;
|
||||
}
|
||||
|
||||
|
||||
public static class SpawnIntercepter {
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
+15
-15
@@ -13,8 +13,6 @@ package vazkii.botania.common.block.subtile.generating;
|
||||
import java.awt.Color;
|
||||
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.RenderHelper;
|
||||
@@ -22,10 +20,12 @@ import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
@@ -33,13 +33,13 @@ import vazkii.botania.common.lexicon.LexiconData;
|
||||
public class SubTileSpectrolus extends SubTileGenerating {
|
||||
|
||||
private static final String TAG_NEXT_COLOR = "nextColor";
|
||||
|
||||
|
||||
int nextColor;
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
|
||||
if(!supertile.getWorldObj().isRemote) {
|
||||
int range = 1;
|
||||
Item wool = Item.getItemFromBlock(Blocks.wool);
|
||||
@@ -51,7 +51,7 @@ public class SubTileSpectrolus extends SubTileGenerating {
|
||||
if(meta == nextColor) {
|
||||
mana = Math.min(getMaxMana(), mana + 100);
|
||||
nextColor = nextColor == 15 ? 0 : nextColor + 1;
|
||||
|
||||
|
||||
sync();
|
||||
}
|
||||
item.setDead();
|
||||
@@ -59,22 +59,22 @@ public class SubTileSpectrolus extends SubTileGenerating {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
return 2000;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return Color.HSBtoRGB((float) ticksExisted / 100F, 1F, 1F);
|
||||
return Color.HSBtoRGB(ticksExisted / 100F, 1F, 1F);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry() {
|
||||
return LexiconData.spectrolus;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res) {
|
||||
super.renderHUD(mc, res);
|
||||
@@ -99,17 +99,17 @@ public class SubTileSpectrolus extends SubTileGenerating {
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void writeToPacketNBT(NBTTagCompound cmp) {
|
||||
super.writeToPacketNBT(cmp);
|
||||
cmp.setInteger(TAG_NEXT_COLOR, nextColor);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readFromPacketNBT(NBTTagCompound cmp) {
|
||||
super.readFromPacketNBT(cmp);
|
||||
nextColor = cmp.getInteger(TAG_NEXT_COLOR);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -64,9 +64,9 @@ public class TileCraftCrate extends TileOpenCrate {
|
||||
true, true, true
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private static final String TAG_PATTERN = "pattern";
|
||||
|
||||
|
||||
public int pattern = -1;
|
||||
int signal = 0;
|
||||
|
||||
@@ -88,7 +88,7 @@ public class TileCraftCrate extends TileOpenCrate {
|
||||
public boolean isLocked(int slot) {
|
||||
return pattern != -1 && !PATTERNS[pattern][slot];
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
if(!worldObj.isRemote && craft(true) && canEject())
|
||||
@@ -159,19 +159,19 @@ public class TileCraftCrate extends TileOpenCrate {
|
||||
setInventorySlotContents(i, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void writeCustomNBT(NBTTagCompound par1nbtTagCompound) {
|
||||
super.writeCustomNBT(par1nbtTagCompound);
|
||||
par1nbtTagCompound.setInteger(TAG_PATTERN, pattern);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readCustomNBT(NBTTagCompound par1nbtTagCompound) {
|
||||
super.readCustomNBT(par1nbtTagCompound);
|
||||
pattern = par1nbtTagCompound.getInteger(TAG_PATTERN);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onWanded(EntityPlayer player, ItemStack stack) {
|
||||
craft(false);
|
||||
@@ -190,5 +190,5 @@ public class TileCraftCrate extends TileOpenCrate {
|
||||
if(pattern != lastPattern)
|
||||
worldObj.markBlockRangeForRenderUpdate(xCoord,yCoord,zCoord,xCoord,yCoord,zCoord);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -19,7 +19,7 @@ public class TileTinyPotato extends TileMod {
|
||||
|
||||
public int jumpTicks = 0;
|
||||
public String name = "";
|
||||
|
||||
|
||||
public void jump() {
|
||||
if(jumpTicks == 0)
|
||||
jumpTicks = 20;
|
||||
@@ -33,12 +33,12 @@ public class TileTinyPotato extends TileMod {
|
||||
if(jumpTicks > 0)
|
||||
jumpTicks--;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void writeCustomNBT(NBTTagCompound cmp) {
|
||||
cmp.setString(TAG_NAME, name);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readCustomNBT(NBTTagCompound cmp) {
|
||||
name = cmp.getString(TAG_NAME);
|
||||
|
||||
@@ -126,5 +126,5 @@ public class TileRedStringContainer extends TileRedString implements ISidedInven
|
||||
if(tile != null)
|
||||
tile.markDirty();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -10,13 +10,13 @@
|
||||
*/
|
||||
package vazkii.botania.common.brew.potion;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityFishHook;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
|
||||
import vazkii.botania.common.lib.LibPotionNames;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class PotionAllure extends PotionMod {
|
||||
|
||||
@@ -24,7 +24,7 @@ public class PotionAllure extends PotionMod {
|
||||
super(LibPotionNames.ALLURE, false, 0x0034E4, 5);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityUpdate(LivingUpdateEvent event) {
|
||||
EntityLivingBase e = event.entityLiving;
|
||||
|
||||
@@ -17,20 +17,20 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import vazkii.botania.common.brew.ModPotions;
|
||||
import vazkii.botania.common.lib.LibPotionNames;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class PotionBloodthirst extends PotionMod {
|
||||
|
||||
private static final int RANGE = 64;
|
||||
|
||||
|
||||
public PotionBloodthirst() {
|
||||
super(LibPotionNames.BLOODTHIRST, false, 0xC30000, 3);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onSpawn(LivingSpawnEvent.CheckSpawn event) {
|
||||
if(event.getResult() != Result.ALLOW && event.entityLiving instanceof IMob) {
|
||||
|
||||
@@ -24,7 +24,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
public class PotionEmptiness extends PotionMod {
|
||||
|
||||
private static final int RANGE = 128;
|
||||
|
||||
|
||||
public PotionEmptiness() {
|
||||
super(LibPotionNames.EMPTINESS, false, 0xE7E7E7, 2);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
@@ -41,5 +41,5 @@ public class PotionEmptiness extends PotionMod {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -22,7 +22,7 @@ public class PotionFeatherfeet extends PotionMod {
|
||||
super(LibPotionNames.FEATHER_FEET, false, 0x26ADFF, 1);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityUpdate(LivingUpdateEvent event) {
|
||||
EntityLivingBase e = event.entityLiving;
|
||||
|
||||
@@ -43,11 +43,11 @@ public class PotionMod extends Potion {
|
||||
|
||||
return super.getStatusIconIndex();
|
||||
}
|
||||
|
||||
|
||||
public boolean hasEffect(EntityLivingBase entity) {
|
||||
return hasEffect(entity, this);
|
||||
}
|
||||
|
||||
|
||||
public boolean hasEffect(EntityLivingBase entity, Potion potion) {
|
||||
return entity.getActivePotionEffect(potion) != null;
|
||||
}
|
||||
|
||||
@@ -33,5 +33,5 @@ public class PotionSoulCross extends PotionMod {
|
||||
living.heal(event.entityLiving.getMaxHealth() / 20);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -203,7 +203,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addBlock(ModFluffBlocks.elfQuartz);
|
||||
addBlock(ModFluffBlocks.elfQuartzSlab);
|
||||
addBlock(ModFluffBlocks.elfQuartzStairs);
|
||||
|
||||
|
||||
addBlock(ModFluffBlocks.biomeStoneA);
|
||||
addBlock(ModFluffBlocks.biomeStoneB);
|
||||
for(int i = 0; i < 24; i++)
|
||||
@@ -244,7 +244,7 @@ public final class BotaniaCreativeTab extends CreativeTabs {
|
||||
addItem(ModItems.terrasteelLegs);
|
||||
addItem(ModItems.terrasteelBoots);
|
||||
addItem(ModItems.ancientWill);
|
||||
|
||||
|
||||
addItem(ModItems.tinyPlanet);
|
||||
addBlock(ModBlocks.tinyPlanet);
|
||||
addItem(ModItems.manaRing);
|
||||
|
||||
@@ -34,13 +34,13 @@ public class PixieHandler {
|
||||
if(Math.random() < chance) {
|
||||
EntityPixie pixie = new EntityPixie(player.worldObj);
|
||||
pixie.setPosition(player.posX, player.posY + 2, player.posZ);
|
||||
|
||||
|
||||
if(((ItemElementiumHelm) ModItems.elementiumHelm).hasArmorSet(player)) {
|
||||
int[] potions = new int[] {
|
||||
Potion.blindness.id,
|
||||
Potion.wither.id,
|
||||
Potion.moveSlowdown.id,
|
||||
Potion.weakness.id
|
||||
Potion.blindness.id,
|
||||
Potion.wither.id,
|
||||
Potion.moveSlowdown.id,
|
||||
Potion.weakness.id
|
||||
};
|
||||
pixie.setApplyPotionEffect(new PotionEffect(potions[event.entity.worldObj.rand.nextInt(potions.length)], 40, 0));
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class CommonProxy {
|
||||
ModElvenTradeRecipes.init();
|
||||
ModBrewRecipes.init();
|
||||
ModAchievements.init();
|
||||
|
||||
|
||||
ChestGenHandler.init();
|
||||
|
||||
LexiconData.init();
|
||||
@@ -132,7 +132,7 @@ public class CommonProxy {
|
||||
public boolean isTheClientPlayer(EntityLivingBase entity) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public boolean isClientPlayerWearingMonocle() {
|
||||
return false;
|
||||
}
|
||||
@@ -153,7 +153,7 @@ public class CommonProxy {
|
||||
public void setSparkleFXNoClip(boolean noclip) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
|
||||
public void setSparkleFXCorrupt(boolean corrupt) {
|
||||
// NO-OP
|
||||
}
|
||||
@@ -173,7 +173,7 @@ public class CommonProxy {
|
||||
public void setWispFXDepthTest(boolean depth) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
|
||||
public void wispFX(World world, double x, double y, double z, float r, float g, float b, float size) {
|
||||
wispFX(world, x, y, z, r, g, b, size, 0F);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ModBrewRecipes {
|
||||
public static RecipeBrew emptinessBrew;
|
||||
public static RecipeBrew bloodthirstBrew;
|
||||
public static RecipeBrew allureBrew;
|
||||
|
||||
|
||||
public static RecipeBrew warpWardBrew;
|
||||
|
||||
public static void init() {
|
||||
@@ -58,7 +58,7 @@ public class ModBrewRecipes {
|
||||
invisibilityBrew = BotaniaAPI.registerBrewRecipe(ModBrews.invisibility, new ItemStack(Items.nether_wart), new ItemStack(Items.snowball), new ItemStack(Items.glowstone_dust));
|
||||
nightVisionBrew = BotaniaAPI.registerBrewRecipe(ModBrews.nightVision, new ItemStack(Items.nether_wart), new ItemStack(Items.spider_eye), new ItemStack(Items.golden_carrot));
|
||||
absorptionBrew = BotaniaAPI.registerBrewRecipe(ModBrews.absorption, new ItemStack(Items.nether_wart), new ItemStack(Items.golden_apple), new ItemStack(Items.potato));
|
||||
|
||||
|
||||
overloadBrew = BotaniaAPI.registerBrewRecipe(ModBrews.overload, new ItemStack(Items.nether_wart), new ItemStack(Items.blaze_powder), new ItemStack(Items.sugar), new ItemStack(Items.glowstone_dust), new ItemStack(ModItems.manaResource), new ItemStack(Items.spider_eye));
|
||||
soulCrossBrew = BotaniaAPI.registerBrewRecipe(ModBrews.soulCross, new ItemStack(Items.nether_wart), new ItemStack(Blocks.soul_sand), new ItemStack(Items.paper), new ItemStack(Items.apple), new ItemStack(Items.bone));
|
||||
featherFeetBrew = BotaniaAPI.registerBrewRecipe(ModBrews.featherfeet, new ItemStack(Items.nether_wart), new ItemStack(Items.feather), new ItemStack(Items.leather), new ItemStack(Blocks.wool, 1, -1));
|
||||
|
||||
@@ -1400,13 +1400,13 @@ public final class ModCraftingRecipes {
|
||||
recipeDirtPath = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Dreamwood Twig Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.manaResource, 1, 13),
|
||||
addOreDictRecipe(new ItemStack(ModItems.manaResource, 1, 13),
|
||||
"W", "W",
|
||||
'W', LibOreDict.DREAM_WOOD);
|
||||
recipeDreamwoodTwig = BotaniaAPI.getLatestAddedRecipe();
|
||||
recipeDreamwoodTwig = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Manaseer Monocle Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.monocle),
|
||||
addOreDictRecipe(new ItemStack(ModItems.monocle),
|
||||
"GN", "IN", " N",
|
||||
'G', new ItemStack(ModBlocks.manaGlass),
|
||||
'I', LibOreDict.MANA_STEEL,
|
||||
@@ -1414,13 +1414,13 @@ public final class ModCraftingRecipes {
|
||||
recipeMonocle = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Lens Clip Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.clip),
|
||||
addOreDictRecipe(new ItemStack(ModItems.clip),
|
||||
" D ", "D D", "DD ",
|
||||
'D', LibOreDict.DREAM_WOOD);
|
||||
recipeClip = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Rod of the Depths Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.cobbleRod),
|
||||
addOreDictRecipe(new ItemStack(ModItems.cobbleRod),
|
||||
" FC", " TW", "T ",
|
||||
'F', LibOreDict.RUNE[1],
|
||||
'W', LibOreDict.RUNE[0],
|
||||
@@ -1437,7 +1437,7 @@ public final class ModCraftingRecipes {
|
||||
recipeSmeltRod = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// World Seed Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.worldSeed, 4),
|
||||
addOreDictRecipe(new ItemStack(ModItems.worldSeed, 4),
|
||||
"G", "S", "D",
|
||||
'G', new ItemStack(Blocks.grass),
|
||||
'S', new ItemStack(Items.wheat_seeds),
|
||||
@@ -1445,21 +1445,21 @@ public final class ModCraftingRecipes {
|
||||
recipeWorldSeed = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Spellbinding Cloth Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.spellCloth),
|
||||
addOreDictRecipe(new ItemStack(ModItems.spellCloth),
|
||||
"WWW", "WPW", "WWW",
|
||||
'W', new ItemStack(Blocks.wool, 1, -1),
|
||||
'P', LibOreDict.MANA_PEARL);
|
||||
recipeSpellCloth = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Thorn Chakram Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.thornChakram),
|
||||
addOreDictRecipe(new ItemStack(ModItems.thornChakram),
|
||||
"VVV", "VTV", "VVV",
|
||||
'V', new ItemStack(Blocks.vine),
|
||||
'T', LibOreDict.TERRA_STEEL);
|
||||
recipeThornChakram = BotaniaAPI.getLatestAddedRecipe();
|
||||
|
||||
// Trodden Dirt Slab
|
||||
GameRegistry.addRecipe(new ItemStack(ModFluffBlocks.dirtPathSlab, 6),
|
||||
GameRegistry.addRecipe(new ItemStack(ModFluffBlocks.dirtPathSlab, 6),
|
||||
"DDD",
|
||||
'D', new ItemStack(ModBlocks.dirtPath));
|
||||
recipeDirtPathSlab = BotaniaAPI.getLatestAddedRecipe();
|
||||
@@ -1471,7 +1471,7 @@ public final class ModCraftingRecipes {
|
||||
'R', new ItemStack(Items.redstone),
|
||||
'P', LibOreDict.PLACEHOLDER
|
||||
);
|
||||
|
||||
|
||||
for(int i = 0; i < count; i++) {
|
||||
List<Object> recipe = new ArrayList();
|
||||
for(int j = 0; j < 3; j++) {
|
||||
@@ -1481,15 +1481,15 @@ public final class ModCraftingRecipes {
|
||||
recipe.add(s);
|
||||
}
|
||||
recipe.addAll(recipeObjects);
|
||||
|
||||
|
||||
addOreDictRecipe(new ItemStack(ModItems.craftPattern, 1, i), recipe.toArray(new Object[recipe.size()]));
|
||||
}
|
||||
|
||||
|
||||
recipesPatterns = BotaniaAPI.getLatestAddedRecipes(count);
|
||||
}
|
||||
|
||||
|
||||
// Gaia Spirit Ingot Recipe
|
||||
addOreDictRecipe(new ItemStack(ModItems.manaResource, 1, 14),
|
||||
addOreDictRecipe(new ItemStack(ModItems.manaResource, 1, 14),
|
||||
" S ", "SIS", " S ",
|
||||
'S', LibOreDict.LIFE_ESSENCE,
|
||||
'I', LibOreDict.TERRA_STEEL);
|
||||
@@ -1552,7 +1552,7 @@ public final class ModCraftingRecipes {
|
||||
addStairsAndSlabs(ModFluffBlocks.biomeStoneA, i + 8, ModFluffBlocks.biomeStoneStairs[i + 8], ModFluffBlocks.biomeStoneSlabs[i + 8]);
|
||||
addStairsAndSlabs(ModFluffBlocks.biomeStoneB, i, ModFluffBlocks.biomeStoneStairs[i + 16], ModFluffBlocks.biomeStoneSlabs[i + 16]);
|
||||
}
|
||||
|
||||
|
||||
// Misc Recipes
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.reeds, 9, 0), new ItemStack(ModBlocks.reedBlock));
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.wheat, 4, 0), new ItemStack(ModBlocks.thatch));
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ModElvenTradeRecipes {
|
||||
dragonstoneRecipes = new ArrayList();
|
||||
dragonstoneRecipes.add(BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModItems.manaResource, 1, 9), LibOreDict.MANA_DIAMOND));
|
||||
dragonstoneRecipes.add(BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModBlocks.storage, 1, 4), new ItemStack(ModBlocks.storage, 1, 3)));
|
||||
|
||||
|
||||
elvenQuartzRecipe = BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModItems.quartz, 1, 5), new ItemStack(Items.quartz));
|
||||
alfglassRecipe = BotaniaAPI.registerElvenTradeRecipe(new ItemStack(ModBlocks.elfGlass), new ItemStack(ModBlocks.manaGlass));
|
||||
}
|
||||
|
||||
@@ -54,11 +54,11 @@ public final class ModManaInfusionRecipes {
|
||||
manasteelRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModBlocks.storage, 1, 0), new ItemStack(Blocks.iron_block), 30000));
|
||||
|
||||
manaPearlRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 1), new ItemStack(Items.ender_pearl), 6000);
|
||||
|
||||
|
||||
manaDiamondRecipes = new ArrayList();
|
||||
manaDiamondRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaResource, 1, 2), "gemDiamond", 10000));
|
||||
manaDiamondRecipes.add(BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModBlocks.storage, 1, 3), new ItemStack(Blocks.diamond_block), 90000));
|
||||
|
||||
|
||||
pistonRelayRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModBlocks.pistonRelay), new ItemStack(Blocks.piston), 15000);
|
||||
manaCookieRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaCookie), new ItemStack(Items.cookie), 20000);
|
||||
grassSeedsRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.grassSeeds), new ItemStack(Blocks.tallgrass, 1, 1), 2500);
|
||||
|
||||
@@ -85,7 +85,7 @@ public final class ModPetalRecipes {
|
||||
gourmaryllisRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_GOURMARYLLIS), lightGray, lightGrayMana, yellowMana, yellow, yellowMana, red, runeFire, runeSummer);
|
||||
narslimmusRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_NARSLIMMUS), lime, limeMana, green, greenMana, black, runeSummer, runeWater);
|
||||
spectrolusRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_SPECTROLUS), redMana, orangeMana, yellowMana, greenMana, blueMana, cyanMana, purpleMana, white, runeWinter, runeAir, pixieDust);
|
||||
|
||||
|
||||
jadedAmaranthusRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_JADED_AMARANTHUS), purpleMana, purpleMana, lime, purple, green, runeSpring, redstoneRoot);
|
||||
bellethorneRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_BELLETHORN), redMana, redMana, cyan, cyan, red, redstoneRoot);
|
||||
dreadthorneRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_DREADTHORN), blackMana, purpleMana, cyan, cyan, black, purple, redstoneRoot);
|
||||
@@ -109,7 +109,7 @@ public final class ModPetalRecipes {
|
||||
spectranthemumRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_SPECTRANTHEMUM), whiteMana, whiteMana, white, white, cyan, runeEnvy, runeWater, redstoneRoot, pixieDust);
|
||||
medumoneRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_MEDUMONE), brown, brown, brownMana, gray, grayMana, runeEarth, redstoneRoot);
|
||||
marimorphosisRecipe = BotaniaAPI.registerPetalRecipe(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_MARIMORPHOSIS), grayMana, yellow, green, lime, lightBlue, red, runeEarth, runeFire, redstoneRoot);
|
||||
|
||||
|
||||
ItemStack stack = new ItemStack(Items.skull, 1, 3);
|
||||
ItemNBTHelper.setString(stack, "SkullOwner", "Vazkii");
|
||||
Object[] inputs = new Object[16];
|
||||
|
||||
@@ -10,14 +10,12 @@
|
||||
*/
|
||||
package vazkii.botania.common.crafting.recipe;
|
||||
|
||||
import vazkii.botania.api.item.IAncientWillContainer;
|
||||
import vazkii.botania.api.mana.ILens;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.lens.ItemLens;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.item.IAncientWillContainer;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
|
||||
public class AncientWillRecipe implements IRecipe {
|
||||
|
||||
@@ -50,16 +48,16 @@ public class AncientWillRecipe implements IRecipe {
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
if(stack != null) {
|
||||
if(stack.getItem() instanceof IAncientWillContainer && item == null)
|
||||
if(stack.getItem() instanceof IAncientWillContainer && item == null)
|
||||
item = stack;
|
||||
else will = stack.getItemDamage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
IAncientWillContainer container = (IAncientWillContainer) item.getItem();
|
||||
if(container.hasAncientWill(item, will))
|
||||
return null;
|
||||
|
||||
|
||||
ItemStack copy = item.copy();
|
||||
container.addAncientWill(copy, will);
|
||||
return copy;
|
||||
@@ -74,5 +72,5 @@ public class AncientWillRecipe implements IRecipe {
|
||||
public ItemStack getRecipeOutput() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -13,21 +13,19 @@ package vazkii.botania.common.crafting.recipe;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import vazkii.botania.api.mana.ILens;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.lens.ItemLens;
|
||||
import vazkii.botania.common.lib.LibOreDict;
|
||||
|
||||
public class LensDyingRecipe implements IRecipe {
|
||||
|
||||
private static final List<String> DYES = Arrays.asList(new String[] {
|
||||
"dyeWhite", "dyeOrange", "dyeMagenta", "dyeLightBlue", "dyeYellow", "dyeLime", "dyePink", "dyeGray", "dyeLightGray", "dyeCyan", "dyePurple", "dyeBlue", "dyeBrown", "dyeGreen", "dyeRed", "dyeBlack", LibOreDict.MANA_PEARL
|
||||
"dyeWhite", "dyeOrange", "dyeMagenta", "dyeLightBlue", "dyeYellow", "dyeLime", "dyePink", "dyeGray", "dyeLightGray", "dyeCyan", "dyePurple", "dyeBlue", "dyeBrown", "dyeGreen", "dyeRed", "dyeBlack", LibOreDict.MANA_PEARL
|
||||
});
|
||||
|
||||
@Override
|
||||
@@ -60,16 +58,16 @@ public class LensDyingRecipe implements IRecipe {
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
if(stack != null) {
|
||||
if(stack.getItem() instanceof ILens && lens == null)
|
||||
if(stack.getItem() instanceof ILens && lens == null)
|
||||
lens = stack;
|
||||
else color = getStackColor(stack);
|
||||
}
|
||||
}
|
||||
|
||||
if(lens.getItem() instanceof ILens) {
|
||||
ILens lensItem = (ILens) lens.getItem();
|
||||
lens.getItem();
|
||||
ItemStack lensCopy = lens.copy();
|
||||
((ItemLens) ModItems.lens).setLensColor(lensCopy, color);
|
||||
ItemLens.setLensColor(lensCopy, color);
|
||||
|
||||
return lensCopy;
|
||||
}
|
||||
@@ -94,7 +92,7 @@ public class LensDyingRecipe implements IRecipe {
|
||||
if(index > 0)
|
||||
return index;
|
||||
}
|
||||
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.common.item.ItemManaGun;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.equipment.tool.ItemTerraPick;
|
||||
|
||||
public class ManaGunClipRecipe implements IRecipe {
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public class SpellClothRecipe implements IRecipe {
|
||||
public boolean matches(InventoryCrafting var1, World var2) {
|
||||
boolean foundCloth = false;
|
||||
boolean foundEnchanted = false;
|
||||
|
||||
|
||||
for(int i = 0; i < var1.getSizeInventory(); i++) {
|
||||
ItemStack stack = var1.getStackInSlot(i);
|
||||
if(stack != null) {
|
||||
|
||||
@@ -273,7 +273,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
@Override
|
||||
public void onDeath(DamageSource p_70645_1_) {
|
||||
super.onDeath(p_70645_1_);
|
||||
EntityLivingBase entitylivingbase = this.func_94060_bK();
|
||||
EntityLivingBase entitylivingbase = func_94060_bK();
|
||||
if(entitylivingbase instanceof EntityPlayer) {
|
||||
((EntityPlayer) entitylivingbase).addStat(ModAchievements.gaiaGuardianKill, 1);
|
||||
if(!anyWithArmor)
|
||||
@@ -299,7 +299,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
if(par1) {
|
||||
boolean hard = isHardMode();
|
||||
entityDropItem(new ItemStack(ModItems.manaResource, hard ? 16 : 8, 5), 1F);
|
||||
|
||||
|
||||
if(hard) {
|
||||
entityDropItem(new ItemStack(ModItems.ancientWill, 1, rand.nextInt(6)), 1F);
|
||||
if(Math.random() < 0.25)
|
||||
@@ -329,7 +329,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
|
||||
ChunkCoordinates source = getSource();
|
||||
boolean hard = isHardMode();
|
||||
|
||||
|
||||
float range = 32F;
|
||||
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(source.posX + 0.5 - range, source.posY + 0.5 - range, source.posZ + 0.5 - range, source.posX + 0.5 + range, source.posY + 0.5 + range, source.posZ + 0.5 + range));
|
||||
|
||||
@@ -384,7 +384,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
int invul = getInvulTime();
|
||||
int mobTicks = getMobSpawnTicks();
|
||||
boolean spawnMissiles = hard && ticksExisted % 15 < 4;
|
||||
|
||||
|
||||
if(invul > 0 && mobTicks == MOB_SPAWN_TICKS) {
|
||||
if(invul < SPAWN_TICKS && invul > SPAWN_TICKS / 2 && worldObj.rand.nextInt(SPAWN_TICKS - invul + 1) == 0)
|
||||
for(int i = 0; i < 2; i++)
|
||||
@@ -443,7 +443,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
worldObj.spawnEntityInWorld(entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(hard && ticksExisted % 3 < 2) {
|
||||
spawnMissile();
|
||||
spawnMissiles = false;
|
||||
@@ -488,7 +488,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
spawnPixies = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(spawnMissiles)
|
||||
spawnMissile();
|
||||
} else {
|
||||
@@ -499,12 +499,12 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void spawnMissile() {
|
||||
if(!worldObj.isRemote) {
|
||||
EntityMagicMissile missile = new EntityMagicMissile(this, true);
|
||||
missile.setPosition(posX + (Math.random() - 0.5 * 0.1), posY + 2.4 + (Math.random() - 0.5 * 0.1), posZ + (Math.random() - 0.5 * 0.1));
|
||||
if(missile.getTarget()) {
|
||||
if(missile.getTarget()) {
|
||||
worldObj.playSoundAtEntity(this, "botania:missile", 0.6F, 0.8F + (float) Math.random() * 0.2F);
|
||||
worldObj.spawnEntityInWorld(missile);
|
||||
}
|
||||
|
||||
@@ -44,20 +44,20 @@ public class EntityMagicMissile extends EntityThrowable {
|
||||
ReflectionHelper.setPrivateValue(EntityThrowable.class, this, thrower, LibObfuscation.THROWER);
|
||||
setEvil(evil);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
dataWatcher.addObject(25, (byte) 0);
|
||||
}
|
||||
|
||||
|
||||
public void setEvil(boolean evil) {
|
||||
dataWatcher.updateObject(25, (byte) (evil ? 1 : 0));
|
||||
}
|
||||
|
||||
|
||||
public boolean isEvil() {
|
||||
return dataWatcher.getWatchableObjectByte(25) == 1;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@@ -91,7 +91,7 @@ public class EntityMagicMissile extends EntityThrowable {
|
||||
lockY = target.posY;
|
||||
lockZ = target.posZ;
|
||||
}
|
||||
|
||||
|
||||
Vector3 targetVec = evil ? new Vector3(lockX, lockY, lockZ) : Vector3.fromEntityCenter(target);
|
||||
Vector3 diffVec = targetVec.copy().sub(thisVec);
|
||||
Vector3 motionVec = diffVec.copy().normalize().multiply(evil ? 0.5 : 0.6);
|
||||
@@ -100,7 +100,7 @@ public class EntityMagicMissile extends EntityThrowable {
|
||||
if(ticksExisted < 10)
|
||||
motionY = Math.abs(motionY);
|
||||
motionZ = motionVec.z;
|
||||
|
||||
|
||||
List<EntityLivingBase> targetList = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(posX - 0.5, posY - 0.5, posZ - 0.5, posX + 0.5, posY + 0.5, posZ + 0.5));
|
||||
if(targetList.contains(target) && target != null) {
|
||||
EntityLivingBase thrower = getThrower();
|
||||
@@ -108,7 +108,7 @@ public class EntityMagicMissile extends EntityThrowable {
|
||||
target.attackEntityFrom(player == null ? DamageSource.causeMobDamage(thrower) : DamageSource.causePlayerDamage(player), evil ? 12 : 7);
|
||||
setDead();
|
||||
}
|
||||
|
||||
|
||||
if(evil && diffVec.mag() < 1)
|
||||
setDead();
|
||||
}
|
||||
|
||||
@@ -471,7 +471,7 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
ILensEffect lens = getLensInstance();
|
||||
if(lens != null && !lens.doParticles(this, getSourceLens()))
|
||||
return;
|
||||
|
||||
|
||||
Color color = new Color(getColor());
|
||||
float r = color.getRed() / 255F;
|
||||
float g = color.getGreen() / 255F;
|
||||
@@ -493,8 +493,8 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
} else {
|
||||
boolean monocle = Botania.proxy.isClientPlayerWearingMonocle();
|
||||
if(monocle)
|
||||
Botania.proxy.setWispFXDepthTest(false);
|
||||
|
||||
Botania.proxy.setWispFXDepthTest(false);
|
||||
|
||||
if(ConfigHandler.subtlePowerSystem)
|
||||
Botania.proxy.wispFX(worldObj, posX, posY, posZ, r, g, b, 0.1F * size, (float) (Math.random() - 0.5F) * 0.02F, (float) (Math.random() - 0.5F) * 0.02F, (float) (Math.random() - 0.5F) * 0.01F);
|
||||
else {
|
||||
@@ -536,9 +536,9 @@ public class EntityManaBurst extends EntityThrowable implements IManaBurst {
|
||||
posY = savedPosY;
|
||||
posZ = savedPosZ;
|
||||
}
|
||||
|
||||
|
||||
if(monocle)
|
||||
Botania.proxy.setWispFXDepthTest(true);
|
||||
Botania.proxy.setWispFXDepthTest(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public class EntityPixie extends EntityFlyingCreature {
|
||||
this.damage = damage;
|
||||
setType(type);
|
||||
}
|
||||
|
||||
|
||||
public void setApplyPotionEffect(PotionEffect effect) {
|
||||
this.effect = effect;
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ public class EntitySpark extends Entity implements ISparkEntity {
|
||||
}
|
||||
case 2 : { // Dominant
|
||||
List<ISparkEntity> validSparks = new ArrayList();
|
||||
for(ISparkEntity spark : allSparks) {
|
||||
for(ISparkEntity spark : allSparks) {
|
||||
if(spark == this)
|
||||
continue;
|
||||
|
||||
@@ -165,9 +165,9 @@ public class EntitySpark extends Entity implements ISparkEntity {
|
||||
if(upgrade_ == 0 && spark.getAttachedTile() instanceof IManaPool)
|
||||
validSparks.add(spark);
|
||||
}
|
||||
if(validSparks.size() > 0)
|
||||
validSparks.get(worldObj.rand.nextInt(validSparks.size())).registerTransfer(this);
|
||||
|
||||
if(validSparks.size() > 0)
|
||||
validSparks.get(worldObj.rand.nextInt(validSparks.size())).registerTransfer(this);
|
||||
|
||||
break;
|
||||
}
|
||||
case 3 : { // Recessive
|
||||
|
||||
@@ -29,69 +29,69 @@ public class EntityThornChakram extends EntityThrowable {
|
||||
|
||||
private static final int MAX_BOUNCES = 16;
|
||||
boolean bounced = false;
|
||||
|
||||
|
||||
public EntityThornChakram(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityThornChakram(World world, EntityLivingBase e) {
|
||||
super(world, e);
|
||||
}
|
||||
|
||||
|
||||
public EntityThornChakram(World world, EntityLivingBase e) {
|
||||
super(world, e);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
dataWatcher.addObject(30, 0);
|
||||
dataWatcher.setObjectWatched(30);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
double mx = motionX;
|
||||
double my = motionY;
|
||||
double mz = motionZ;
|
||||
|
||||
super.onUpdate();
|
||||
int bounces = getTimesBounced();
|
||||
if(bounces >= MAX_BOUNCES || ticksExisted > 60) {
|
||||
EntityLivingBase thrower = getThrower();
|
||||
noClip = true;
|
||||
if(thrower == null)
|
||||
dropAndKill();
|
||||
else {
|
||||
Vector3 motion = Vector3.fromEntityCenter(thrower).sub(Vector3.fromEntityCenter(this)).normalize();
|
||||
motionX = motion.x;
|
||||
motionY = motion.y;
|
||||
motionZ = motion.z;
|
||||
if(MathHelper.pointDistanceSpace(posX, posY, posZ, thrower.posX, thrower.posY, thrower.posZ) < 1)
|
||||
if(!(thrower instanceof EntityPlayer && (((EntityPlayer) thrower).capabilities.isCreativeMode || ((EntityPlayer) thrower).inventory.addItemStackToInventory(new ItemStack(ModItems.thornChakram)))))
|
||||
dropAndKill();
|
||||
else if(!worldObj.isRemote)
|
||||
setDead();
|
||||
}
|
||||
} else {
|
||||
if(!bounced) {
|
||||
motionX = mx;
|
||||
motionY = my;
|
||||
motionZ = mz;
|
||||
}
|
||||
bounced = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void dropAndKill() {
|
||||
if(!worldObj.isRemote) {
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
double mx = motionX;
|
||||
double my = motionY;
|
||||
double mz = motionZ;
|
||||
|
||||
super.onUpdate();
|
||||
int bounces = getTimesBounced();
|
||||
if(bounces >= MAX_BOUNCES || ticksExisted > 60) {
|
||||
EntityLivingBase thrower = getThrower();
|
||||
noClip = true;
|
||||
if(thrower == null)
|
||||
dropAndKill();
|
||||
else {
|
||||
Vector3 motion = Vector3.fromEntityCenter(thrower).sub(Vector3.fromEntityCenter(this)).normalize();
|
||||
motionX = motion.x;
|
||||
motionY = motion.y;
|
||||
motionZ = motion.z;
|
||||
if(MathHelper.pointDistanceSpace(posX, posY, posZ, thrower.posX, thrower.posY, thrower.posZ) < 1)
|
||||
if(!(thrower instanceof EntityPlayer && (((EntityPlayer) thrower).capabilities.isCreativeMode || ((EntityPlayer) thrower).inventory.addItemStackToInventory(new ItemStack(ModItems.thornChakram)))))
|
||||
dropAndKill();
|
||||
else if(!worldObj.isRemote)
|
||||
setDead();
|
||||
}
|
||||
} else {
|
||||
if(!bounced) {
|
||||
motionX = mx;
|
||||
motionY = my;
|
||||
motionZ = mz;
|
||||
}
|
||||
bounced = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void dropAndKill() {
|
||||
if(!worldObj.isRemote) {
|
||||
ItemStack stack = new ItemStack(ModItems.thornChakram);
|
||||
EntityItem item = new EntityItem(worldObj, posX, posY, posZ, stack);
|
||||
worldObj.spawnEntityInWorld(item);
|
||||
setDead();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition pos) {
|
||||
if(noClip)
|
||||
return;
|
||||
|
||||
|
||||
EntityLivingBase thrower = getThrower();
|
||||
if(pos.entityHit != null && pos.entityHit instanceof EntityLivingBase && pos.entityHit != thrower) {
|
||||
((EntityLivingBase) pos.entityHit).attackEntityFrom(thrower != null ? thrower instanceof EntityPlayer ? DamageSource.causePlayerDamage((EntityPlayer) thrower) : DamageSource.causeMobDamage(thrower) : DamageSource.generic, 6);
|
||||
@@ -112,16 +112,16 @@ public class EntityThornChakram extends EntityThrowable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected float getGravityVelocity() {
|
||||
return 0F;
|
||||
}
|
||||
|
||||
|
||||
int getTimesBounced() {
|
||||
return dataWatcher.getWatchableObjectInt(30);
|
||||
}
|
||||
|
||||
|
||||
void setTimesBounced(int times) {
|
||||
dataWatcher.updateObject(30, times);
|
||||
}
|
||||
|
||||
@@ -29,24 +29,24 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
public class ItemAncientWill extends ItemMod {
|
||||
|
||||
private static final int SUBTYPES = 6;
|
||||
|
||||
|
||||
IIcon[] icons;
|
||||
|
||||
|
||||
public ItemAncientWill() {
|
||||
setUnlocalizedName(LibItemNames.ANCIENT_WILL);
|
||||
setHasSubtypes(true);
|
||||
setMaxStackSize(1);
|
||||
|
||||
|
||||
GameRegistry.addRecipe(new AncientWillRecipe());
|
||||
RecipeSorter.register("botania:ancientWill", AncientWillRecipe.class, Category.SHAPELESS, "");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
for(int i = 0; i < SUBTYPES; i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
icons = new IIcon[SUBTYPES];
|
||||
@@ -58,21 +58,21 @@ public class ItemAncientWill extends ItemMod {
|
||||
public IIcon getIconFromDamage(int dmg) {
|
||||
return icons[Math.min(icons.length - 1, dmg)];
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) {
|
||||
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.craftToAddWill"), list);
|
||||
addStringToTooltip(StatCollector.translateToLocal("botania.armorset.will" + stack.getItemDamage() + ".shortDesc"), list);
|
||||
}
|
||||
|
||||
|
||||
public void addStringToTooltip(String s, List<String> tooltip) {
|
||||
tooltip.add(s.replaceAll("&", "\u00a7"));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
return super.getUnlocalizedName(par1ItemStack) + par1ItemStack.getItemDamage();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -18,5 +18,5 @@ public class ItemClip extends ItemMod {
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName(LibItemNames.CLIP);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -27,13 +27,13 @@ import vazkii.botania.common.lib.LibItemNames;
|
||||
public class ItemCraftPattern extends ItemMod {
|
||||
|
||||
IIcon[] icons;
|
||||
|
||||
|
||||
public ItemCraftPattern() {
|
||||
setHasSubtypes(true);
|
||||
setUnlocalizedName(LibItemNames.CRAFT_PATTERN);
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer p, World world, int x, int y, int z, int s, float xs, float ys, float zs) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
@@ -44,13 +44,13 @@ public class ItemCraftPattern extends ItemMod {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
for(int i = 0; i < TileCraftCrate.PATTERNS.length; i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
icons = new IIcon[TileCraftCrate.PATTERNS.length];
|
||||
@@ -62,10 +62,10 @@ public class ItemCraftPattern extends ItemMod {
|
||||
public IIcon getIconFromDamage(int dmg) {
|
||||
return icons[Math.min(icons.length - 1, dmg)];
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
return super.getUnlocalizedName(par1ItemStack) + par1ItemStack.getItemDamage();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -174,15 +174,15 @@ public class ItemCraftingHalo extends ItemMod {
|
||||
ItemStack stackAt = inv.getStackInSlot(i);
|
||||
if(stackAt != null && stack.isItemEqual(stackAt) && ItemStack.areItemStackTagsEqual(stack, stackAt)) {
|
||||
boolean consume = true;
|
||||
|
||||
|
||||
ItemStack container = stackAt.getItem().getContainerItem(stackAt);
|
||||
if(container != null) {
|
||||
if(container == stackAt)
|
||||
consume = false;
|
||||
else {
|
||||
InventoryHelper.insertItemIntoInventory(inv, container);
|
||||
if(container.stackSize != 0 && player != null)
|
||||
player.dropPlayerItemWithRandomChoice(container, false);
|
||||
InventoryHelper.insertItemIntoInventory(inv, container);
|
||||
if(container.stackSize != 0 && player != null)
|
||||
player.dropPlayerItemWithRandomChoice(container, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ public class ItemCraftingHalo extends ItemMod {
|
||||
if(stackAt.stackSize == 0)
|
||||
inv.setInventorySlotContents(i, null);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -400,7 +400,6 @@ public class ItemCraftingHalo extends ItemMod {
|
||||
float u = 1F;
|
||||
float v = 0.25F;
|
||||
|
||||
float uper = u / angles;
|
||||
float s = 3F;
|
||||
float m = 0.8F;
|
||||
float y = v * s * 2;
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ItemManaCookie extends ItemFood {
|
||||
super.onFoodEaten(p_77849_1_, p_77849_2_, p_77849_3_);
|
||||
p_77849_3_.addStat(ModAchievements.manaCookieEat, 1);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Item setUnlocalizedName(String par1Str) {
|
||||
GameRegistry.registerItem(this, par1Str);
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
package vazkii.botania.common.item;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -27,8 +26,6 @@ import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.RecipeSorter.Category;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.KnowledgeType;
|
||||
import vazkii.botania.api.mana.BurstProperties;
|
||||
import vazkii.botania.api.mana.ILens;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
@@ -36,7 +33,6 @@ import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.core.handler.ItemsRemainingRenderHandler;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.crafting.recipe.ManaGunClipRecipe;
|
||||
@@ -53,7 +49,7 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem {
|
||||
private static final String TAG_LENS = "lens";
|
||||
private static final String TAG_CLIP = "clip";
|
||||
private static final String TAG_CLIP_POS = "clipPos";
|
||||
|
||||
|
||||
private static final int CLIP_SLOTS = 6;
|
||||
private static final int COOLDOWN = 30;
|
||||
|
||||
@@ -122,14 +118,14 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem {
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int pass) {
|
||||
boolean desu = isSugoiKawaiiDesuNe(stack);
|
||||
int index = pass;
|
||||
if(index == 0 && hasClip(stack))
|
||||
index = 2;
|
||||
|
||||
|
||||
return icons[Math.min(2, index) + (desu ? 3 : 0)];
|
||||
}
|
||||
|
||||
@@ -219,20 +215,20 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem {
|
||||
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.shiftinfo"), par3List);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ItemStack lens = getLens(par1ItemStack);
|
||||
if(lens != null) {
|
||||
List<String> tooltip = lens.getTooltip(par2EntityPlayer, false);
|
||||
if(tooltip.size() > 1)
|
||||
par3List.addAll(tooltip.subList(1, tooltip.size()));
|
||||
}
|
||||
|
||||
|
||||
if(clip) {
|
||||
int pos = getClipPos(par1ItemStack);
|
||||
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.hasClip"), par3List);
|
||||
for(int i = 0; i < CLIP_SLOTS; i++) {
|
||||
String name = "";
|
||||
EnumChatFormatting formatting = i == pos ? EnumChatFormatting.GREEN : EnumChatFormatting.GRAY;
|
||||
EnumChatFormatting formatting = i == pos ? EnumChatFormatting.GREEN : EnumChatFormatting.GRAY;
|
||||
ItemStack lensAt = getLensAtPos(par1ItemStack, i);
|
||||
if(lensAt == null)
|
||||
name = StatCollector.translateToLocal("botaniamisc.clipEmpty");
|
||||
@@ -245,7 +241,7 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem {
|
||||
private void addStringToTooltip(String s, List<String> tooltip) {
|
||||
tooltip.add(s.replaceAll("&", "\u00a7"));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack par1ItemStack) {
|
||||
ItemStack lens = getLens(par1ItemStack);
|
||||
@@ -255,30 +251,30 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem {
|
||||
public static boolean hasClip(ItemStack stack) {
|
||||
return ItemNBTHelper.getBoolean(stack, TAG_CLIP, false);
|
||||
}
|
||||
|
||||
|
||||
public static void setClip(ItemStack stack, boolean clip) {
|
||||
ItemNBTHelper.setBoolean(stack, TAG_CLIP, clip);
|
||||
}
|
||||
|
||||
|
||||
public static int getClipPos(ItemStack stack) {
|
||||
return ItemNBTHelper.getInt(stack, TAG_CLIP_POS, 0);
|
||||
}
|
||||
|
||||
|
||||
public static void setClipPos(ItemStack stack, int pos) {
|
||||
ItemNBTHelper.setInt(stack, TAG_CLIP_POS, pos);
|
||||
}
|
||||
|
||||
|
||||
public static void rotatePos(ItemStack stack) {
|
||||
int currPos = getClipPos(stack);
|
||||
boolean acceptEmpty = getLensAtPos(stack, currPos) != null;
|
||||
int[] slots = new int[CLIP_SLOTS - 1];
|
||||
|
||||
|
||||
int index = 0;
|
||||
for(int i = currPos + 1; i < CLIP_SLOTS; i++, index++)
|
||||
slots[index] = i;
|
||||
for(int i = 0; i < currPos; i++, index++)
|
||||
slots[index] = i;
|
||||
|
||||
|
||||
for(int i : slots) {
|
||||
ItemStack lensAt = getLensAtPos(stack, i);
|
||||
if(acceptEmpty || lensAt != null) {
|
||||
@@ -287,7 +283,7 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static ItemStack getLensAtPos(ItemStack stack, int pos) {
|
||||
NBTTagCompound cmp = ItemNBTHelper.getCompound(stack, TAG_LENS + pos, true);
|
||||
if(cmp != null) {
|
||||
@@ -296,18 +292,18 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static void setLensAtPos(ItemStack stack, ItemStack lens, int pos) {
|
||||
NBTTagCompound cmp = new NBTTagCompound();
|
||||
if(lens != null)
|
||||
lens.writeToNBT(cmp);
|
||||
ItemNBTHelper.setCompound(stack, TAG_LENS + pos, cmp);
|
||||
}
|
||||
|
||||
|
||||
public static void setLens(ItemStack stack, ItemStack lens) {
|
||||
if(hasClip(stack))
|
||||
setLensAtPos(stack, lens, getClipPos(stack));
|
||||
|
||||
|
||||
NBTTagCompound cmp = new NBTTagCompound();
|
||||
if(lens != null)
|
||||
lens.writeToNBT(cmp);
|
||||
@@ -317,7 +313,7 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem {
|
||||
public static ItemStack getLens(ItemStack stack) {
|
||||
if(hasClip(stack))
|
||||
return getLensAtPos(stack, getClipPos(stack));
|
||||
|
||||
|
||||
NBTTagCompound cmp = ItemNBTHelper.getCompound(stack, TAG_LENS, true);
|
||||
if(cmp != null) {
|
||||
ItemStack lens = ItemStack.loadItemStackFromNBT(cmp);
|
||||
|
||||
@@ -23,7 +23,7 @@ public class ItemOvergrowthSeed extends ItemMod {
|
||||
public ItemOvergrowthSeed() {
|
||||
setUnlocalizedName(LibItemNames.OVERGROWTH_SEED);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int s, float xs, float ys, float zs) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
@@ -35,11 +35,11 @@ public class ItemOvergrowthSeed extends ItemMod {
|
||||
world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block));
|
||||
world.setBlock(x, y, z, ModBlocks.enchantedSoil);
|
||||
stack.stackSize--;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public class ItemSignalFlare extends ItemMod {
|
||||
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 50, 5));
|
||||
stunned++;
|
||||
}
|
||||
|
||||
|
||||
if(stunned >= 100)
|
||||
par3EntityPlayer.addStat(ModAchievements.signalFlareStun, 1);
|
||||
}
|
||||
|
||||
@@ -24,35 +24,35 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
public class ItemSpellCloth extends ItemMod {
|
||||
|
||||
public ItemSpellCloth() {
|
||||
setMaxDamage(35);
|
||||
setMaxStackSize(1);
|
||||
setNoRepair();
|
||||
setUnlocalizedName(LibItemNames.SPELL_CLOTH);
|
||||
|
||||
setMaxDamage(35);
|
||||
setMaxStackSize(1);
|
||||
setNoRepair();
|
||||
setUnlocalizedName(LibItemNames.SPELL_CLOTH);
|
||||
|
||||
GameRegistry.addRecipe(new SpellClothRecipe());
|
||||
RecipeSorter.register("botania:spellCloth", SpellClothRecipe.class, Category.SHAPELESS, "");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack(ItemStack par1ItemStack, int par2) {
|
||||
return Color.HSBtoRGB(0.55F, ((float) par1ItemStack.getMaxDamage() - (float) par1ItemStack.getItemDamage()) / par1ItemStack.getMaxDamage() * 0.5F, 1F);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack(ItemStack par1ItemStack, int par2) {
|
||||
return Color.HSBtoRGB(0.55F, ((float) par1ItemStack.getMaxDamage() - (float) par1ItemStack.getItemDamage()) / par1ItemStack.getMaxDamage() * 0.5F, 1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasContainerItem() {
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean hasContainerItem() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItem(ItemStack itemStack) {
|
||||
itemStack.setItemDamage(itemStack.getItemDamage() + 1);
|
||||
return itemStack;
|
||||
}
|
||||
@Override
|
||||
public ItemStack getContainerItem(ItemStack itemStack) {
|
||||
itemStack.setItemDamage(itemStack.getItemDamage() + 1);
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack par1ItemStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack par1ItemStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,23 +27,23 @@ public class ItemWorldSeed extends ItemMod {
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
ChunkCoordinates coords = world.getSpawnPoint();
|
||||
|
||||
|
||||
if(MathHelper.pointDistanceSpace(coords.posX + 0.5, coords.posY + 0.5, coords.posZ + 0.5, player.posX, player.posY, player.posZ) > 24) {
|
||||
player.rotationPitch = 0F;
|
||||
player.rotationYaw = 0F;
|
||||
player.setPositionAndUpdate(coords.posX + 0.5, coords.posY + 1.6, coords.posZ + 0.5);
|
||||
|
||||
while(!world.getCollidingBoundingBoxes(player, player.boundingBox).isEmpty())
|
||||
player.setPositionAndUpdate(player.posX, player.posY + 1, player.posZ);
|
||||
while(!world.getCollidingBoundingBoxes(player, player.boundingBox).isEmpty())
|
||||
player.setPositionAndUpdate(player.posX, player.posY + 1, player.posZ);
|
||||
|
||||
world.playSoundAtEntity(player, "mob.endermen.portal", 1F, 1F);
|
||||
for(int i = 0; i < 50; i++)
|
||||
world.playSoundAtEntity(player, "mob.endermen.portal", 1F, 1F);
|
||||
for(int i = 0; i < 50; i++)
|
||||
Botania.proxy.sparkleFX(world, player.posX + Math.random() * player.width, player.posY - 1.6 + Math.random() * player.height, player.posZ + Math.random() * player.width, 0.25F, 1F, 0.25F, 1F, 10);
|
||||
|
||||
stack.stackSize--;
|
||||
|
||||
stack.stackSize--;
|
||||
}
|
||||
|
||||
return stack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -310,7 +310,7 @@ public final class ModItems {
|
||||
overgrowthSeed = new ItemOvergrowthSeed();
|
||||
craftPattern = new ItemCraftPattern();
|
||||
ancientWill = new ItemAncientWill();
|
||||
|
||||
|
||||
OreDictionary.registerOre(LibOreDict.LEXICON, lexicon);
|
||||
for(int i = 0; i < 16; i++) {
|
||||
OreDictionary.registerOre(LibOreDict.PETAL[i], new ItemStack(petal, 1, i));
|
||||
|
||||
@@ -13,22 +13,21 @@ package vazkii.botania.common.item.block;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemNameTag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
|
||||
public class ItemBlockTinyPotato extends ItemBlockMod {
|
||||
|
||||
private static final List<String> TYPOS = Arrays.asList(new String[] {
|
||||
"vaskii", "vazki", "voskii", "vazkkii", "vazkki", "vazzki", "vaskki", "vozkii"
|
||||
"vaskii", "vazki", "voskii", "vazkkii", "vazkki", "vazzki", "vaskki", "vozkii"
|
||||
});
|
||||
|
||||
|
||||
private static final String NOT_MY_NAME[] = {
|
||||
"Six letter word just to get me along",
|
||||
"It's a intricacy and I'm coding on my mod and I,",
|
||||
@@ -48,13 +47,13 @@ public class ItemBlockTinyPotato extends ItemBlockMod {
|
||||
"That's not my name",
|
||||
"That's not my name"
|
||||
};
|
||||
|
||||
|
||||
private static final String TAG_TICKS = "notMyNameTicks";
|
||||
|
||||
|
||||
public ItemBlockTinyPotato(Block block) {
|
||||
super(block);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity e, int t, boolean idunno) {
|
||||
if(!world.isRemote && e instanceof EntityPlayer && e.ticksExisted % 30 == 0 && TYPOS.contains(stack.getDisplayName().toLowerCase())) {
|
||||
|
||||
@@ -46,5 +46,5 @@ public class ItemBlockWithMetadataAndName extends ItemBlockWithMetadata implemen
|
||||
public Achievement getAchievementOnPickup(ItemStack stack, EntityPlayer player, EntityItem item) {
|
||||
return field_150939_a instanceof IPickupAchievement ? ((IPickupAchievement) field_150939_a).getAchievementOnPickup(stack, player, item) : null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+11
-7
@@ -27,9 +27,10 @@ public abstract class ItemElementiumArmor extends ItemManasteelArmor implements
|
||||
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) {
|
||||
return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 7 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
|
||||
}
|
||||
|
||||
|
||||
static ItemStack[] armorset;
|
||||
|
||||
@Override
|
||||
public ItemStack[] getArmorSetStacks() {
|
||||
if(armorset == null)
|
||||
armorset = new ItemStack[] {
|
||||
@@ -37,30 +38,33 @@ public abstract class ItemElementiumArmor extends ItemManasteelArmor implements
|
||||
new ItemStack(ModItems.elementiumChest),
|
||||
new ItemStack(ModItems.elementiumLegs),
|
||||
new ItemStack(ModItems.elementiumBoots)
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
return armorset;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasArmorSetItem(EntityPlayer player, int i) {
|
||||
ItemStack stack = player.inventory.armorInventory[3 - i];
|
||||
if(stack == null)
|
||||
return false;
|
||||
|
||||
|
||||
switch(i) {
|
||||
case 0: return stack.getItem() == ModItems.elementiumHelm || stack.getItem() == ModItems.elementiumHelmRevealing;
|
||||
case 1: return stack.getItem() == ModItems.elementiumChest;
|
||||
case 2: return stack.getItem() == ModItems.elementiumLegs;
|
||||
case 3: return stack.getItem() == ModItems.elementiumBoots;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getArmorSetName() {
|
||||
return StatCollector.translateToLocal("botania.armorset.elementium.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addArmorSetDescription(ItemStack stack, List<String> list) {
|
||||
super.addArmorSetDescription(stack, list);
|
||||
addStringToTooltip(StatCollector.translateToLocal("botania.armorset.elementium.desc"), list);
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ public class ItemElementiumHelm extends ItemElementiumArmor implements IManaDisc
|
||||
public float getPixieChance(ItemStack stack) {
|
||||
return 0.11F;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public float getDiscount(ItemStack stack, int slot, EntityPlayer player) {
|
||||
return hasArmorSet(player) ? 0.1F : 0F;
|
||||
|
||||
+12
-12
@@ -109,7 +109,7 @@ public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor, IMan
|
||||
public boolean usesMana(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) {
|
||||
if(GuiScreen.isShiftKeyDown()) {
|
||||
@@ -120,7 +120,7 @@ public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor, IMan
|
||||
addStringToTooltip((hasArmorSetItem(player, i) ? EnumChatFormatting.GREEN : "") + " - " + stacks[i].getDisplayName(), list);
|
||||
} else addStringToTooltip(StatCollector.translateToLocal("botaniamisc.shiftinfo"), list);
|
||||
}
|
||||
|
||||
|
||||
public void addStringToTooltip(String s, List<String> tooltip) {
|
||||
tooltip.add(s.replaceAll("&", "\u00a7"));
|
||||
}
|
||||
@@ -134,47 +134,47 @@ public class ItemManasteelArmor extends ItemArmor implements ISpecialArmor, IMan
|
||||
new ItemStack(ModItems.manasteelChest),
|
||||
new ItemStack(ModItems.manasteelLegs),
|
||||
new ItemStack(ModItems.manasteelBoots)
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
return armorset;
|
||||
}
|
||||
|
||||
public boolean hasArmorSet(EntityPlayer player) {
|
||||
return hasArmorSetItem(player, 0) && hasArmorSetItem(player, 1) && hasArmorSetItem(player, 2) && hasArmorSetItem(player, 3);
|
||||
}
|
||||
|
||||
|
||||
public boolean hasArmorSetItem(EntityPlayer player, int i) {
|
||||
ItemStack stack = player.inventory.armorInventory[3 - i];
|
||||
if(stack == null)
|
||||
return false;
|
||||
|
||||
|
||||
switch(i) {
|
||||
case 0: return stack.getItem() == ModItems.manasteelHelm || stack.getItem() == ModItems.manasteelHelmRevealing;
|
||||
case 1: return stack.getItem() == ModItems.manasteelChest;
|
||||
case 2: return stack.getItem() == ModItems.manasteelLegs;
|
||||
case 3: return stack.getItem() == ModItems.manasteelBoots;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public int getSetPiecesEquipped(EntityPlayer player) {
|
||||
int pieces = 0;
|
||||
for(int i = 0; i < 4; i++)
|
||||
if(hasArmorSetItem(player, i))
|
||||
pieces++;
|
||||
|
||||
|
||||
return pieces;
|
||||
}
|
||||
|
||||
|
||||
public String getArmorSetName() {
|
||||
return StatCollector.translateToLocal("botania.armorset.manasteel.name");
|
||||
}
|
||||
|
||||
|
||||
public String getArmorSetTitle(EntityPlayer player) {
|
||||
return StatCollector.translateToLocal("botaniamisc.armorset") + " " + getArmorSetName() + " (" + getSetPiecesEquipped(player) + "/" + getArmorSetStacks().length + ")";
|
||||
}
|
||||
|
||||
|
||||
public void addArmorSetDescription(ItemStack stack, List<String> list) {
|
||||
addStringToTooltip(StatCollector.translateToLocal("botania.armorset.manasteel.desc"), list);
|
||||
}
|
||||
|
||||
+10
-14
@@ -11,12 +11,8 @@
|
||||
package vazkii.botania.common.item.equipment.armor.terrasteel;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
@@ -25,9 +21,6 @@ import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
import vazkii.botania.common.item.equipment.armor.manasteel.ItemManasteelArmor;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
public class ItemTerrasteelArmor extends ItemManasteelArmor {
|
||||
|
||||
public ItemTerrasteelArmor(int type, String name) {
|
||||
@@ -43,9 +36,10 @@ public class ItemTerrasteelArmor extends ItemManasteelArmor {
|
||||
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) {
|
||||
return par2ItemStack.getItem() == ModItems.manaResource && par2ItemStack.getItemDamage() == 4 ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
|
||||
}
|
||||
|
||||
|
||||
static ItemStack[] armorset;
|
||||
|
||||
@Override
|
||||
public ItemStack[] getArmorSetStacks() {
|
||||
if(armorset == null)
|
||||
armorset = new ItemStack[] {
|
||||
@@ -53,26 +47,28 @@ public class ItemTerrasteelArmor extends ItemManasteelArmor {
|
||||
new ItemStack(ModItems.terrasteelChest),
|
||||
new ItemStack(ModItems.terrasteelLegs),
|
||||
new ItemStack(ModItems.terrasteelBoots)
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
return armorset;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasArmorSetItem(EntityPlayer player, int i) {
|
||||
ItemStack stack = player.inventory.armorInventory[3 - i];
|
||||
if(stack == null)
|
||||
return false;
|
||||
|
||||
|
||||
switch(i) {
|
||||
case 0: return stack.getItem() == ModItems.terrasteelHelm || stack.getItem() == ModItems.terrasteelHelmRevealing;
|
||||
case 1: return stack.getItem() == ModItems.terrasteelChest;
|
||||
case 2: return stack.getItem() == ModItems.terrasteelLegs;
|
||||
case 3: return stack.getItem() == ModItems.terrasteelBoots;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getArmorSetName() {
|
||||
return StatCollector.translateToLocal("botania.armorset.terrasteel.name");
|
||||
}
|
||||
|
||||
+14
-14
@@ -45,7 +45,7 @@ public class ItemTerrasteelHelm extends ItemTerrasteelArmor implements IManaDisc
|
||||
|
||||
private static final String TAG_ANCIENT_WILL = "AncientWill";
|
||||
static IIcon willIcon;
|
||||
|
||||
|
||||
public ItemTerrasteelHelm() {
|
||||
this(LibItemNames.TERRASTEEL_HELM);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
@@ -61,17 +61,17 @@ public class ItemTerrasteelHelm extends ItemTerrasteelArmor implements IManaDisc
|
||||
super.registerIcons(par1IconRegister);
|
||||
willIcon = IconHelper.forName(par1IconRegister, "willFlame");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
super.onArmorTick(world, player, stack);
|
||||
if(hasArmorSet(player)) {
|
||||
int food = player.getFoodStats().getFoodLevel();
|
||||
if(food > 0 && food < 18 && player.shouldHeal() && player.ticksExisted % 80 == 0)
|
||||
player.heal(1F);
|
||||
if(food > 0 && food < 18 && player.shouldHeal() && player.ticksExisted % 80 == 0)
|
||||
player.heal(1F);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public float getDiscount(ItemStack stack, int slot, EntityPlayer player) {
|
||||
return hasArmorSet(player) ? 0.2F : 0F;
|
||||
@@ -86,11 +86,11 @@ public class ItemTerrasteelHelm extends ItemTerrasteelArmor implements IManaDisc
|
||||
public boolean hasAncientWill(ItemStack stack, int will) {
|
||||
return hasAncientWill_(stack, will);
|
||||
}
|
||||
|
||||
|
||||
public static boolean hasAncientWill_(ItemStack stack, int will) {
|
||||
return ItemNBTHelper.getBoolean(stack, TAG_ANCIENT_WILL + will, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addArmorSetDescription(ItemStack stack, List<String> list) {
|
||||
@@ -99,15 +99,15 @@ public class ItemTerrasteelHelm extends ItemTerrasteelArmor implements IManaDisc
|
||||
if(hasAncientWill(stack, i))
|
||||
addStringToTooltip(StatCollector.translateToLocal("botania.armorset.will" + i + ".desc"), list);
|
||||
}
|
||||
|
||||
|
||||
public static boolean hasAnyWill(ItemStack stack) {
|
||||
for(int i = 0; i < 6; i++)
|
||||
if(hasAncientWill_(stack, i))
|
||||
return true;
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void renderOnPlayer(ItemStack stack, RenderPlayerEvent event) {
|
||||
if(hasAnyWill(stack)) {
|
||||
@@ -124,12 +124,12 @@ public class ItemTerrasteelHelm extends ItemTerrasteelArmor implements IManaDisc
|
||||
ItemRenderer.renderItemIn2D(Tessellator.instance, f1, f2, f, f3, willIcon.getIconWidth(), willIcon.getIconHeight(), 1F / 16F);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityAttacked(LivingHurtEvent event) {
|
||||
Entity attacker = event.source.getEntity();
|
||||
if(attacker instanceof EntityPlayer) {
|
||||
EntityPlayer player = ((EntityPlayer) attacker);
|
||||
EntityPlayer player = (EntityPlayer) attacker;
|
||||
boolean crit = player.fallDistance > 0.0F && !player.onGround && !player.isOnLadder() && !player.isInWater() && !player.isPotionActive(Potion.blindness) && player.ridingEntity == null;
|
||||
ItemStack stack = player.inventory.armorItemInSlot(3);
|
||||
if(crit && stack != null && stack.getItem() instanceof ItemTerrasteelHelm) {
|
||||
@@ -139,11 +139,11 @@ public class ItemTerrasteelHelm extends ItemTerrasteelArmor implements IManaDisc
|
||||
boolean torag = hasAncientWill(stack, 3);
|
||||
boolean verac = hasAncientWill(stack, 4);
|
||||
boolean karil = hasAncientWill(stack, 5);
|
||||
|
||||
|
||||
if(ahrim)
|
||||
event.entityLiving.addPotionEffect(new PotionEffect(Potion.weakness.id, 20, 1));
|
||||
if(dharok)
|
||||
event.ammount *= (1F + (1F - player.getHealth() / player.getMaxHealth()) * 0.5F);
|
||||
event.ammount *= 1F + (1F - player.getHealth() / player.getMaxHealth()) * 0.5F;
|
||||
if(guthan)
|
||||
player.heal(event.ammount * 0.25F);
|
||||
if(torag)
|
||||
|
||||
@@ -22,7 +22,7 @@ public class ItemAuraRing extends ItemBauble {
|
||||
public ItemAuraRing(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
|
||||
public ItemAuraRing() {
|
||||
this(LibItemNames.AURA_RING);
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public class ItemAuraRing extends ItemBauble {
|
||||
if(player instanceof EntityPlayer && player.ticksExisted % getDelay() == 0)
|
||||
ManaItemHandler.dispatchManaExact(stack, (EntityPlayer) player, 1, true);
|
||||
}
|
||||
|
||||
|
||||
int getDelay() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
public abstract class ItemBauble extends ItemMod implements IBauble {
|
||||
|
||||
private static final String TAG_HASHCODE = "playerHashcode";
|
||||
|
||||
|
||||
public ItemBauble(String name) {
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
@@ -112,7 +112,7 @@ public abstract class ItemBauble extends ItemMod implements IBauble {
|
||||
|
||||
if(player instanceof EntityPlayer)
|
||||
((EntityPlayer) player).addStat(ModAchievements.baubleWear, 1);
|
||||
|
||||
|
||||
onEquippedOrLoadedIntoWorld(stack, player);
|
||||
setLastPlayerHashcode(stack, player.hashCode());
|
||||
}
|
||||
@@ -125,11 +125,11 @@ public abstract class ItemBauble extends ItemMod implements IBauble {
|
||||
public void onUnequipped(ItemStack stack, EntityLivingBase player) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
|
||||
public int getLastPlayerHashcode(ItemStack stack) {
|
||||
return ItemNBTHelper.getInt(stack, TAG_HASHCODE, 0);
|
||||
}
|
||||
|
||||
|
||||
public void setLastPlayerHashcode(ItemStack stack, int hash) {
|
||||
ItemNBTHelper.setInt(stack, TAG_HASHCODE, hash);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@ import vazkii.botania.common.lib.LibItemNames;
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.discovery.ModCandidate;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
@@ -10,12 +10,7 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.equipment.bauble;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import baubles.api.BaubleType;
|
||||
|
||||
public class ItemGreaterAuraRing extends ItemAuraRing {
|
||||
|
||||
|
||||
@@ -10,19 +10,18 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.equipment.bauble;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.item.IBaubleRender;
|
||||
import vazkii.botania.api.item.IBurstViewerBauble;
|
||||
import vazkii.botania.api.item.IBaubleRender.Helper;
|
||||
import vazkii.botania.api.item.IBaubleRender.RenderType;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import vazkii.botania.api.item.IBaubleRender;
|
||||
import vazkii.botania.api.item.IBurstViewerBauble;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import baubles.api.BaubleType;
|
||||
|
||||
public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, IBaubleRender {
|
||||
@@ -30,7 +29,7 @@ public class ItemMonocle extends ItemBauble implements IBurstViewerBauble, IBaub
|
||||
public ItemMonocle() {
|
||||
super(LibItemNames.MONOCLE);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BaubleType getBaubleType(ItemStack arg0) {
|
||||
return BaubleType.AMULET;
|
||||
|
||||
@@ -23,7 +23,6 @@ import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelSword;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
@@ -74,7 +73,7 @@ public class ItemEnderDagger extends ItemManasteelSword {
|
||||
par1ItemStack.damageItem(1, par3EntityLivingBase);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity player, int par4, boolean par5) {
|
||||
// NO-OP
|
||||
|
||||
@@ -148,7 +148,7 @@ public class ItemTerraPick extends ItemManasteelPick implements IManaItem {
|
||||
ToolCommons.removeBlocksInIteration(player, stack, world, x, y, z, doX ? -range : 0, doY ? -1 : 0, doZ ? -range : 0, doX ? range + 1 : 1, doY ? rangeY * 2 : 1, doZ ? range + 1 : 1, null, MATERIALS, silk, fortune, isTipped(stack));
|
||||
if(level == 5)
|
||||
player.addStat(ModAchievements.rankSSPick, 1);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.equipment.tool;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
public class ItemElementiumPick extends ItemManasteelPick {
|
||||
|
||||
static final List<String> validBlocks = Arrays.asList(new String[] {
|
||||
"dirt", "sand", "gravel", "cobblestone", "netherrack"
|
||||
"dirt", "sand", "gravel", "cobblestone", "netherrack"
|
||||
});
|
||||
|
||||
public ItemElementiumPick() {
|
||||
@@ -46,7 +46,7 @@ public class ItemElementiumPick extends ItemManasteelPick {
|
||||
for(int id : OreDictionary.getOreIDs(new ItemStack(block)))
|
||||
if(validBlocks.contains(OreDictionary.getOreName(id)))
|
||||
return true;
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -39,7 +39,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
public class ItemManasteelAxe extends ItemAxe implements IManaUsingItem {
|
||||
|
||||
private static final Pattern SAPLING_PATTERN = Pattern.compile("(?:(?:(?:[A-Z-_.:]|^)sapling)|(?:(?:[a-z-_.:]|^)Sapling))(?:[A-Z-_.:]|$)");
|
||||
|
||||
|
||||
private static final int MANA_PER_DAMAGE = 60;
|
||||
|
||||
public ItemManasteelAxe() {
|
||||
@@ -82,7 +82,7 @@ public class ItemManasteelAxe extends ItemAxe implements IManaUsingItem {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int s, float sx, float sy, float sz) {
|
||||
for(int i = 0; i < player.inventory.getSizeInventory(); i++) {
|
||||
@@ -93,7 +93,7 @@ public class ItemManasteelAxe extends ItemAxe implements IManaUsingItem {
|
||||
return did;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -39,7 +39,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
public class ItemManasteelPick extends ItemPickaxe implements IManaUsingItem {
|
||||
|
||||
private static final Pattern TORCH_PATTERN = Pattern.compile("(?:(?:(?:[A-Z-_.:]|^)torch)|(?:(?:[a-z-_.:]|^)Torch))(?:[A-Z-_.:]|$)");
|
||||
|
||||
|
||||
private static final int MANA_PER_DAMAGE = 60;
|
||||
|
||||
public ItemManasteelPick() {
|
||||
@@ -82,7 +82,7 @@ public class ItemManasteelPick extends ItemPickaxe implements IManaUsingItem {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int s, float sx, float sy, float sz) {
|
||||
for(int i = 0; i < player.inventory.getSizeInventory(); i++) {
|
||||
@@ -93,7 +93,7 @@ public class ItemManasteelPick extends ItemPickaxe implements IManaUsingItem {
|
||||
return did;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -99,7 +99,7 @@ public class ItemManasteelShovel extends ItemSpade implements IManaUsingItem {
|
||||
|
||||
if(p_77648_7_ != 0 && p_77648_3_.getBlock(p_77648_4_, p_77648_5_ + 1, p_77648_6_).isAir(p_77648_3_, p_77648_4_, p_77648_5_ + 1, p_77648_6_) && (block == Blocks.grass || block == Blocks.dirt)) {
|
||||
Block block1 = Blocks.farmland;
|
||||
p_77648_3_.playSoundEffect((double)((float)p_77648_4_ + 0.5F), (double)((float)p_77648_5_ + 0.5F), (double)((float)p_77648_6_ + 0.5F), block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume() + 1.0F) / 2.0F, block1.stepSound.getPitch() * 0.8F);
|
||||
p_77648_3_.playSoundEffect(p_77648_4_ + 0.5F, p_77648_5_ + 0.5F, p_77648_6_ + 0.5F, block1.stepSound.getStepResourcePath(), (block1.stepSound.getVolume() + 1.0F) / 2.0F, block1.stepSound.getPitch() * 0.8F);
|
||||
|
||||
if (p_77648_3_.isRemote)
|
||||
return true;
|
||||
|
||||
@@ -41,7 +41,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
public class ItemLens extends ItemMod implements ILens {
|
||||
|
||||
public static final int SUBTYPES = 18;
|
||||
|
||||
|
||||
private static final int NORMAL = 0,
|
||||
SPEED = 1,
|
||||
POWER = 2,
|
||||
@@ -71,7 +71,7 @@ public class ItemLens extends ItemMod implements ILens {
|
||||
private static final int[] props = new int[SUBTYPES];
|
||||
private static final Lens[] lenses = new Lens[SUBTYPES];
|
||||
private static Lens fallbackLens = new Lens();
|
||||
|
||||
|
||||
static {
|
||||
setProps(NORMAL, PROP_NONE);
|
||||
setProps(SPEED, PROP_NONE);
|
||||
@@ -91,7 +91,7 @@ public class ItemLens extends ItemMod implements ILens {
|
||||
setProps(FIRE, PROP_DAMAGE | PROP_TOUCH | PROP_INTERACTION);
|
||||
setProps(PISTON, PROP_TOUCH | PROP_INTERACTION);
|
||||
setProps(LIGHT, PROP_TOUCH | PROP_INTERACTION);
|
||||
|
||||
|
||||
setLens(NORMAL, fallbackLens);
|
||||
setLens(SPEED, new LensSpeed());
|
||||
setLens(POWER, new LensPower());
|
||||
@@ -198,7 +198,7 @@ public class ItemLens extends ItemMod implements ILens {
|
||||
props.color = getLensColor(stack);
|
||||
|
||||
getLens(stack.getItemDamage()).apply(stack, props);
|
||||
|
||||
|
||||
ItemStack compositeLens = getCompositeLens(stack);
|
||||
if(compositeLens != null && compositeLens.getItem() instanceof ILens)
|
||||
((ILens) compositeLens.getItem()).apply(compositeLens, props);
|
||||
@@ -209,7 +209,7 @@ public class ItemLens extends ItemMod implements ILens {
|
||||
EntityThrowable entity = (EntityThrowable) burst;
|
||||
|
||||
dead = getLens(stack.getItemDamage()).collideBurst(burst, entity, pos, isManaBlock, dead, stack);
|
||||
|
||||
|
||||
ItemStack compositeLens = getCompositeLens(stack);
|
||||
if(compositeLens != null && compositeLens.getItem() instanceof ILens)
|
||||
dead = ((ILens) compositeLens.getItem()).collideBurst(burst, pos, isManaBlock, dead, compositeLens);
|
||||
@@ -226,7 +226,7 @@ public class ItemLens extends ItemMod implements ILens {
|
||||
burst.setColor(getLensColor(stack));
|
||||
|
||||
getLens(stack.getItemDamage()).updateBurst(burst, entity, stack);
|
||||
|
||||
|
||||
ItemStack compositeLens = getCompositeLens(stack);
|
||||
if(compositeLens != null && compositeLens.getItem() instanceof ILens)
|
||||
((ILens) compositeLens.getItem()).updateBurst(burst, compositeLens);
|
||||
@@ -267,11 +267,11 @@ public class ItemLens extends ItemMod implements ILens {
|
||||
public static void setLens(int index, Lens lens) {
|
||||
lenses[index] = lens;
|
||||
}
|
||||
|
||||
|
||||
public static boolean isBlacklisted(int lens1, int lens2) {
|
||||
return (props[lens1] & props[lens2]) != 0;
|
||||
}
|
||||
|
||||
|
||||
public static Lens getLens(int index) {
|
||||
Lens lens = lenses[index];
|
||||
return lens == null ? fallbackLens : lens;
|
||||
|
||||
@@ -34,8 +34,8 @@ public class LensBounce extends Lens {
|
||||
dead = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return dead;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -41,5 +41,5 @@ public class LensDamage extends Lens {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -20,5 +20,5 @@ public class LensEfficiency extends Lens {
|
||||
props.manaLossPerTick /= 5F;
|
||||
props.ticksBeforeManaLoss *= 1.1F;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -16,7 +16,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
import vazkii.botania.api.mana.BurstProperties;
|
||||
|
||||
public class LensExplosive extends Lens {
|
||||
|
||||
@@ -27,8 +26,8 @@ public class LensExplosive extends Lens {
|
||||
if(!entity.worldObj.isRemote && pos.entityHit == null && !isManaBlock && (pos.blockX != coords.posX || pos.blockY != coords.posY || pos.blockZ != coords.posZ))
|
||||
entity.worldObj.createExplosion(entity, entity.posX, entity.posY, entity.posZ, burst.getMana() / 50F, true);
|
||||
} else dead = false;
|
||||
|
||||
|
||||
return dead;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -39,8 +39,8 @@ public class LensFire extends Lens {
|
||||
else if(blockAt_.isAir(entity.worldObj, x, y, z))
|
||||
entity.worldObj.setBlock(x, y, z, Blocks.fire);
|
||||
}
|
||||
|
||||
|
||||
return dead;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loaded 100 of 118 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user