mirror of
https://github.com/GTNewHorizons/Tainted-Magic.git
synced 2026-11-18 11:19:24 +00:00
Cleanup, bug fixes
This commit is contained in:
1 parent
443958c1cf
commit
f65217c406
9 files changed
+79
-25
No files matched your search
@@ -34,12 +34,12 @@ public class HUDHandler
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
EntityPlayer p = mc.thePlayer;
|
||||
ScaledResolution r = event.resolution;
|
||||
float pt = event.partialTicks;
|
||||
float pT = event.partialTicks;
|
||||
|
||||
if (mc.currentScreen == null)
|
||||
{
|
||||
ItemKatana.renderHUD(r, p, pt);
|
||||
ItemThaumicDisassembler.renderHUD(r, p, pt);
|
||||
ItemKatana.renderHUD(r, p, pT);
|
||||
ItemThaumicDisassembler.renderHUD(r, p, pT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,6 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable
|
||||
public static final ModelKatana katana = new ModelKatana();
|
||||
public static final ModelSaya saya = new ModelSaya();
|
||||
|
||||
static boolean equipped = false;
|
||||
static float ticksEquipped = 0F;
|
||||
|
||||
int ticksInUse = 0;
|
||||
@@ -346,7 +345,7 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public static void renderHUD (ScaledResolution r, EntityPlayer p, float pt)
|
||||
public static void renderHUD (ScaledResolution r, EntityPlayer p, float pT)
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
ItemStack s = mc.thePlayer.getCurrentEquippedItem();
|
||||
@@ -358,12 +357,10 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable
|
||||
else b = false;
|
||||
|
||||
float time = 30F;
|
||||
if (b) ticksEquipped = Math.min(time, ticksEquipped + pt);
|
||||
else ticksEquipped = Math.max(0F, ticksEquipped - pt);
|
||||
if (b) ticksEquipped = Math.min(time, ticksEquipped + pT);
|
||||
else ticksEquipped = Math.max(0F, ticksEquipped - pT);
|
||||
|
||||
float defAlpha = 0F;
|
||||
float fract = ticksEquipped / time;
|
||||
float a = fract;
|
||||
float a = ticksEquipped / time;
|
||||
|
||||
if (b || ticksEquipped != 0)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package taintedmagic.common.items.tools;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@@ -32,6 +33,9 @@ public class ItemThaumicDisassembler extends Item
|
||||
{
|
||||
public static final String TAG_MODE = "mode";
|
||||
|
||||
static float ticksEquipped = 0F;
|
||||
public static List<Integer> data = new ArrayList<Integer>();
|
||||
|
||||
public ItemThaumicDisassembler ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
@@ -116,9 +120,9 @@ public class ItemThaumicDisassembler extends Item
|
||||
return s;
|
||||
}
|
||||
|
||||
public static int getEfficiency (ItemStack s)
|
||||
public static int getEfficiency (int mode)
|
||||
{
|
||||
switch (getMode(s))
|
||||
switch (mode)
|
||||
{
|
||||
case 0 :
|
||||
return 20;
|
||||
@@ -132,16 +136,19 @@ public class ItemThaumicDisassembler extends Item
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int getEfficiency (ItemStack s)
|
||||
{
|
||||
return getEfficiency(getMode(s));
|
||||
}
|
||||
|
||||
public static int getMode (ItemStack s)
|
||||
{
|
||||
if (s.stackTagCompound == null) return 0;
|
||||
return s.stackTagCompound.getInteger(TAG_MODE);
|
||||
}
|
||||
|
||||
public static String getModeName (ItemStack s)
|
||||
public static String getModeName (int mode)
|
||||
{
|
||||
int mode = getMode(s);
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case 0 :
|
||||
@@ -156,6 +163,11 @@ public class ItemThaumicDisassembler extends Item
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getModeName (ItemStack s)
|
||||
{
|
||||
return getModeName(getMode(s));
|
||||
}
|
||||
|
||||
public void toggleMode (ItemStack s)
|
||||
{
|
||||
if (s.stackTagCompound == null) s.setTagCompound(new NBTTagCompound());
|
||||
@@ -176,29 +188,58 @@ public class ItemThaumicDisassembler extends Item
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public static void renderHUD (ScaledResolution resolution, EntityPlayer player, float partialTicks)
|
||||
public static void renderHUD (ScaledResolution r, EntityPlayer p, float pT)
|
||||
{
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
EntityPlayer p = TaintedMagic.proxy.getClientPlayer();
|
||||
ItemStack s = mc.thePlayer.getCurrentEquippedItem();
|
||||
FontRenderer f = mc.fontRenderer;
|
||||
|
||||
boolean b = false;
|
||||
|
||||
if (s != null && s.getItem() instanceof ItemThaumicDisassembler)
|
||||
{
|
||||
String str = "\u00A78" + StatCollector.translateToLocal("text.disassembler.mode") + ": " + getModeName(s) + (getMode(s) == 3 ? "\u00A7c" : "\u00A7a") + " (" + getEfficiency(s) + ")";
|
||||
if (data.isEmpty())
|
||||
{
|
||||
data.add(getMode(s));
|
||||
}
|
||||
|
||||
if (!data.isEmpty() && getMode(s) != data.get(0))
|
||||
{
|
||||
data.clear();
|
||||
data.add(getMode(s));
|
||||
}
|
||||
b = true;
|
||||
}
|
||||
else b = false;
|
||||
|
||||
float time = 30F;
|
||||
if (b) ticksEquipped = Math.min(time, ticksEquipped + pT);
|
||||
else ticksEquipped = Math.max(0F, ticksEquipped - pT);
|
||||
|
||||
float fract = ticksEquipped / time;
|
||||
|
||||
if (b || ticksEquipped != 0)
|
||||
{
|
||||
int mode = data.get(0);
|
||||
String str = "\u00A78" + StatCollector.translateToLocal("text.disassembler.mode") + ": " + getModeName(mode) + (mode == 3 ? "\u00A7c" : "\u00A7a") + " (" + getEfficiency(mode) + ")";
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glTranslated(0, -15, 0);
|
||||
|
||||
GL11.glTranslated(40.0F, -15.0F, 0.0F);
|
||||
GL11.glTranslatef(-fract * 40.0F, 0.0F, 0.0F);
|
||||
|
||||
GL11.glScalef(0.8F, 0.8F, 0.8F);
|
||||
|
||||
f.drawStringWithShadow(str, resolution.getScaledWidth() / 2 + 100, resolution.getScaledHeight() / 2 + (p.capabilities.isCreativeMode ? 230 : 212), 0xFFFFFF);
|
||||
f.drawStringWithShadow(str, r.getScaledWidth() / 2 + 100, r.getScaledHeight() / 2 + (p.capabilities.isCreativeMode ? 230 : 212), 0xFFFFFF);
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package taintedmagic.common.items.wand.foci;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -18,10 +19,10 @@ import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.FocusUpgradeType;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.bolt.FXLightningBolt;
|
||||
import thaumcraft.client.fx.particles.FXSparkle;
|
||||
import thaumcraft.client.fx.particles.FXWisp;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import thaumcraft.common.lib.network.PacketHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package taintedmagic.common.items.wand.foci;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -16,6 +17,9 @@ import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.FocusUpgradeType;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.bolt.FXLightningBolt;
|
||||
import thaumcraft.client.fx.particles.FXSparkle;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import thaumcraft.common.lib.utils.EntityUtils;
|
||||
|
||||
@@ -28,6 +32,8 @@ public class ItemFocusVisShard extends ItemFocusBasic
|
||||
private static final AspectList cost = new AspectList().add(Aspect.FIRE, 100).add(Aspect.ENTROPY, 100).add(Aspect.AIR, 100);
|
||||
private static final AspectList costPersistent = new AspectList().add(Aspect.FIRE, 100).add(Aspect.ENTROPY, 100).add(Aspect.WATER, 100).add(Aspect.AIR, 100);
|
||||
|
||||
EntityLivingBase target;
|
||||
|
||||
public ItemFocusVisShard ()
|
||||
{
|
||||
this.setCreativeTab(TaintedMagic.tabTaintedMagic);
|
||||
@@ -67,6 +73,7 @@ public class ItemFocusVisShard extends ItemFocusBasic
|
||||
Entity look = EntityUtils.getPointedEntity(p.worldObj, p, 0.0D, 32.0D, 1.1F);
|
||||
if (look != null && look instanceof EntityLivingBase)
|
||||
{
|
||||
this.target = (EntityLivingBase) look;
|
||||
if (wand.consumeAllVis(s, p, getVisCost(s), true, false))
|
||||
{
|
||||
EntityHomingShard shard = new EntityHomingShard(w, p, (EntityLivingBase) look, wand.getFocusPotency(s), isUpgradedWith(wand.getFocusItem(s), FocusUpgrades.persistent));
|
||||
@@ -75,7 +82,7 @@ public class ItemFocusVisShard extends ItemFocusBasic
|
||||
|
||||
for (int a = 0; a < 18; a++)
|
||||
{
|
||||
TaintedMagic.proxy.spawnLumosParticles(w, shard.posX, shard.posY, shard.posZ, 0);
|
||||
if (w.isRemote) spawnParticles(w, shard.posX, shard.posY, shard.posZ);
|
||||
}
|
||||
}
|
||||
p.swingItem();
|
||||
@@ -83,6 +90,14 @@ public class ItemFocusVisShard extends ItemFocusBasic
|
||||
return s;
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
void spawnParticles (World w, double x, double y, double z)
|
||||
{
|
||||
FXSparkle fx = new FXSparkle(w, x + w.rand.nextFloat(), y + w.rand.nextFloat(), z + w.rand.nextFloat(), 1.75F, 0, 3 + w.rand.nextInt(3));
|
||||
fx.setGravity(0.1F);
|
||||
ParticleEngine.instance.addEffect(w, fx);
|
||||
}
|
||||
|
||||
public AspectList getVisCost (ItemStack s)
|
||||
{
|
||||
return isUpgradedWith(s, FocusUpgrades.persistent) ? costPersistent : cost;
|
||||
|
||||
@@ -177,7 +177,7 @@ public class RecipeRegistry
|
||||
|
||||
ResearchRegistry.recipes.put("ItemMagicFunguar", ThaumcraftApi.addShapelessArcaneCraftingRecipe("MAGICFUNGUAR", new ItemStack(ItemRegistry.ItemMagicFunguar), new AspectList().add(Aspect.ORDER, 1).add(Aspect.WATER, 1).add(Aspect.EARTH, 1).add(Aspect.AIR, 1).add(Aspect.FIRE, 1).add(Aspect.ENTROPY, 1), new Object[]{ new ItemStack(ConfigBlocks.blockCustomPlant, 1, 5), new ItemStack(ConfigItems.itemShard, 1, 32767), new ItemStack(Blocks.brown_mushroom), new ItemStack(Blocks.red_mushroom), new ItemStack(Items.blaze_powder) }));
|
||||
|
||||
ResearchRegistry.recipes.put("ItemCrystalDagger", ThaumcraftApi.addArcaneCraftingRecipe("CRIMSONROBES", new ItemStack(ItemRegistry.ItemCrystalDagger), new AspectList().add(Aspect.EARTH, 85).add(Aspect.FIRE, 85).add(Aspect.ENTROPY, 85), new Object[]{ " A", " B ", "C ", Character.valueOf('A'), ItemApi.getItem("itemResource", 16), Character.valueOf('B'), ItemApi.getBlock("blockTube", 7), Character.valueOf('C'), "logWood" }));
|
||||
ResearchRegistry.recipes.put("ItemCrystalDagger", ThaumcraftApi.addArcaneCraftingRecipe("CRYSTALDAGGER", new ItemStack(ItemRegistry.ItemCrystalDagger), new AspectList().add(Aspect.EARTH, 85).add(Aspect.FIRE, 85).add(Aspect.ENTROPY, 85), new Object[]{ " A", " B ", "C ", Character.valueOf('A'), new ItemStack(Items.iron_ingot), Character.valueOf('B'), ItemApi.getBlock("blockTube", 7), Character.valueOf('C'), "logWood" }));
|
||||
|
||||
ResearchRegistry.recipes.put("ItemWandCap:1", ThaumcraftApi.addArcaneCraftingRecipe("CAP_cloth", new ItemStack(ItemRegistry.ItemWandCap, 1, 1), new AspectList().add(Aspect.EARTH, 10).add(Aspect.FIRE, 10).add(Aspect.ENTROPY, 10).add(Aspect.ORDER, 10), new Object[]{ "AAA", "A A", Character.valueOf('A'), ItemApi.getItem("itemResource", 7) }));
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ public class ResearchRegistry
|
||||
|
||||
new TaintedMagicResearchItem("MAGICFUNGUAR", TM, new AspectList().add(Aspect.MAGIC, 2).add(Aspect.HUNGER, 4).add(Aspect.PLANT, 2), 3, -3, 0, new ItemStack(ItemRegistry.ItemMagicFunguar)).setSecondary().setPages(new ResearchPage[]{ new ResearchPage("1"), new ResearchPage((IArcaneRecipe) recipes.get("ItemMagicFunguar")) }).setConcealed().registerResearchItem();
|
||||
|
||||
new TaintedMagicResearchItem("CRYSTALDAGGER", TM, new AspectList().add(Aspect.WEAPON, 4).add(Aspect.FIRE, 4).add(Aspect.HEAL, 4), 0, -3, 0, new ItemStack(ItemRegistry.ItemCrystalDagger, 1, 7)).setParentsHidden("ENCHFABRIC", "ESSENTIACRYSTAL", "VOIDMETAL").setParents("TAINTEDMAGIC").setComplexity(2).setPages(new ResearchPage[]{ new ResearchPage("1"), new ResearchPage((IArcaneRecipe) recipes.get("ItemCrystalDagger")) }).registerResearchItem();
|
||||
new TaintedMagicResearchItem("CRYSTALDAGGER", TM, new AspectList().add(Aspect.WEAPON, 4).add(Aspect.FIRE, 4).add(Aspect.HEAL, 4), 0, -3, 0, new ItemStack(ItemRegistry.ItemCrystalDagger, 1, 7)).setParentsHidden("ENCHFABRIC", "ESSENTIACRYSTAL", "ELDRITCHMINOR").setParents("TAINTEDMAGIC").setComplexity(2).setPages(new ResearchPage[]{ new ResearchPage("1"), new ResearchPage((IArcaneRecipe) recipes.get("ItemCrystalDagger")) }).registerResearchItem();
|
||||
ThaumcraftApi.addWarpToResearch("CRYSTALDAGGER", 2);
|
||||
|
||||
new TaintedMagicResearchItem("MACEFOCUS", TM, new AspectList().add(Aspect.ENTROPY, 10).add(Aspect.EARTH, 4).add(Aspect.WEAPON, 6).add(Aspect.MAGIC, 8), 5, 4, 0, new ItemStack(ItemRegistry.ItemFocusMageMace)).setParents("TMFOCUSFIRE").setConcealed().setComplexity(2).setParentsHidden("THAUMIUM").setPages(new ResearchPage[]{ new ResearchPage("1"), new ResearchPage((InfusionRecipe) recipes.get("ItemFocusMageMace")) }).registerResearchItem();
|
||||
|
||||
Reference in new issue
Block a user