mirror of
https://github.com/GTNewHorizons/Tainted-Magic.git
synced 2026-11-21 04:22:21 +00:00
Merge remote-tracking branch 'Yorke/master'
# Conflicts: # gradle.properties # version.txt
This commit is contained in:
14 files changed
+1055
-259
No files matched your search
@@ -26,6 +26,7 @@ public class BlockLumos extends Block implements ITileEntityProvider {
|
||||
setTickRandomly(false);
|
||||
setLightLevel(1.0F);
|
||||
setBlockTextureName("thaumcraft:blank");
|
||||
setBlockBounds(0.3F, 0.3F, 0.3F, 0.7F, 0.7F, 0.7F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -52,17 +53,6 @@ public class BlockLumos extends Block implements ITileEntityProvider {
|
||||
ParticleEngine.instance.addEffect(world, fx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState (final IBlockAccess world, final int x, final int y, final int z) {
|
||||
final int meta = world.getBlockMetadata(x, y, z);
|
||||
if (meta == 0) {
|
||||
setBlockBounds(0.3F, 0.3F, 0.3F, 0.7F, 0.7F, 0.7F);
|
||||
}
|
||||
else {
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool (final World world, final int x, final int y, final int z) {
|
||||
return null;
|
||||
|
||||
@@ -1,25 +1,14 @@
|
||||
package taintedmagic.common.blocks.tile;
|
||||
|
||||
import baubles.api.BaublesApi;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import taintedmagic.common.blocks.BlockLumos;
|
||||
import taintedmagic.common.items.equipment.ItemLumosRing;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXSparkle;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
|
||||
public class TileLumos extends TileEntity {
|
||||
|
||||
public TileLumos () {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUpdate () {
|
||||
return true;
|
||||
@@ -27,57 +16,13 @@ public class TileLumos extends TileEntity {
|
||||
|
||||
@Override
|
||||
public void updateEntity () {
|
||||
final Block block = worldObj.getBlock(xCoord, yCoord, zCoord);
|
||||
final int meta = worldObj.getBlockMetadata(xCoord, yCoord, zCoord);
|
||||
|
||||
if (block instanceof BlockLumos) {
|
||||
final EntityPlayer player = worldObj.getClosestPlayer(xCoord, yCoord, zCoord, 4);
|
||||
|
||||
if (meta == 0 && worldObj.rand.nextInt(15) == 0 && worldObj.isRemote) {
|
||||
spawnParticles();
|
||||
}
|
||||
if ( (meta == 1 || meta == 2) && player == null) {
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
}
|
||||
else if (meta == 1 && player != null) {
|
||||
if (player.getHeldItem() == null
|
||||
|| player.getHeldItem() != null && ! (player.getHeldItem().getItem() instanceof ItemWandCasting)) {
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
}
|
||||
else if (player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemWandCasting) {
|
||||
final ItemStack stack = player.getHeldItem();
|
||||
final ItemWandCasting wand = (ItemWandCasting) stack.getItem();
|
||||
|
||||
if (wand.getFocus(stack) == null
|
||||
|| wand.getFocus(stack) != null && wand.getFocus(stack) != ItemRegistry.ItemFocusLumos) {
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (meta == 2 && player != null) {
|
||||
final IInventory baub = BaublesApi.getBaubles(player);
|
||||
if (baub.getStackInSlot(1) == null && baub.getStackInSlot(2) == null) {
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
}
|
||||
else if (baub.getStackInSlot(1) != null && baub.getStackInSlot(2) == null
|
||||
&& ! (baub.getStackInSlot(1).getItem() instanceof ItemLumosRing)) {
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
}
|
||||
else if (baub.getStackInSlot(1) == null && baub.getStackInSlot(2) != null
|
||||
&& ! (baub.getStackInSlot(2).getItem() instanceof ItemLumosRing)) {
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
}
|
||||
else if (baub.getStackInSlot(1) != null && baub.getStackInSlot(2) != null
|
||||
&& ! (baub.getStackInSlot(1).getItem() instanceof ItemLumosRing)
|
||||
&& ! (baub.getStackInSlot(2).getItem() instanceof ItemLumosRing)) {
|
||||
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
if (getBlockType() instanceof BlockLumos && worldObj.rand.nextInt(15) == 0 && worldObj.isRemote) {
|
||||
spawnParticles();
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
void spawnParticles () {
|
||||
private void spawnParticles () {
|
||||
final FXSparkle fx = new FXSparkle(worldObj, xCoord + 0.5D + worldObj.rand.nextGaussian() * 0.1D,
|
||||
yCoord + 0.5D + worldObj.rand.nextGaussian() * 0.1D, zCoord + 0.5D + worldObj.rand.nextGaussian() * 0.1D, 1.75F,
|
||||
6, 3 + worldObj.rand.nextInt(2));
|
||||
|
||||
@@ -22,17 +22,16 @@ import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
import taintedmagic.client.handler.HUDHandler;
|
||||
import taintedmagic.common.items.equipment.ItemLumosRing;
|
||||
import taintedmagic.common.items.tools.ItemHollowDagger;
|
||||
import taintedmagic.common.items.wand.foci.ItemFocusMageMace;
|
||||
import taintedmagic.common.registry.BlockRegistry;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
import thaumcraft.api.wands.StaffRod;
|
||||
import thaumcraft.api.wands.WandRod;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.config.Config;
|
||||
import thaumcraft.common.items.ItemEssence;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import thaumcraft.common.lib.network.PacketHandler;
|
||||
@@ -46,7 +45,7 @@ public class TMEventHandler {
|
||||
final EntityPlayer player = (EntityPlayer) event.entity;
|
||||
|
||||
repairItems(player);
|
||||
createLumos(player);
|
||||
applyNightVision(player);
|
||||
modifyAttackDamage(player);
|
||||
}
|
||||
}
|
||||
@@ -65,30 +64,46 @@ public class TMEventHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean hasNightVision = false;
|
||||
|
||||
/**
|
||||
* Create Lumos lightsource blocks when the player is holding a wand or staff
|
||||
* Apply Night Vision effect when the player is holding a wand or staff
|
||||
* with the Lumos focus equipped or when the Lumos ring is equipped.
|
||||
*/
|
||||
public void createLumos (final EntityPlayer player) {
|
||||
final int x = (int) Math.floor(player.posX);
|
||||
final int y = (int) Math.floor(player.posY) + 1;
|
||||
final int z = (int) Math.floor(player.posZ);
|
||||
public void applyNightVision (final EntityPlayer player) {
|
||||
if (player.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
if (player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemWandCasting) {
|
||||
final ItemStack held = player.getHeldItem();
|
||||
final ItemWandCasting wand = (ItemWandCasting) held.getItem();
|
||||
|
||||
if (wand.getFocus(held) != null && wand.getFocus(held) == ItemRegistry.ItemFocusLumos && !player.worldObj.isRemote
|
||||
&& player.worldObj.isAirBlock(x, y, z)) {
|
||||
player.worldObj.setBlock(x, y, z, BlockRegistry.BlockLumos, 1, 3);
|
||||
}
|
||||
}
|
||||
boolean lumos = false;
|
||||
|
||||
final IInventory baub = BaublesApi.getBaubles(player);
|
||||
if (baub.getStackInSlot(1) != null && baub.getStackInSlot(1).getItem() instanceof ItemLumosRing
|
||||
|| baub.getStackInSlot(2) != null && baub.getStackInSlot(2).getItem() instanceof ItemLumosRing
|
||||
&& !player.worldObj.isRemote && player.worldObj.isAirBlock(x, y, z)) {
|
||||
player.worldObj.setBlock(x, y, z, BlockRegistry.BlockLumos, 2, 3);
|
||||
|| baub.getStackInSlot(2) != null && baub.getStackInSlot(2).getItem() instanceof ItemLumosRing) {
|
||||
lumos = true;
|
||||
}
|
||||
else if (player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemWandCasting) {
|
||||
final ItemStack held = player.getHeldItem();
|
||||
final ItemWandCasting wand = (ItemWandCasting) held.getItem();
|
||||
|
||||
if (wand.getFocus(held) != null && wand.getFocus(held) == ItemRegistry.ItemFocusLumos) {
|
||||
lumos = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (lumos) {
|
||||
if (!hasNightVision) {
|
||||
if (!player.isPotionActive(Potion.nightVision.id)) {
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 260, -1));
|
||||
hasNightVision = true;
|
||||
}
|
||||
}
|
||||
else if (player.ticksExisted % 20 == 0) {
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 260, -1));
|
||||
}
|
||||
}
|
||||
else if (hasNightVision) {
|
||||
player.removePotionEffect(Potion.nightVision.id);
|
||||
hasNightVision = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,75 +111,76 @@ public class TMEventHandler {
|
||||
* Some hacky code to make the Mage's Mace work...
|
||||
*/
|
||||
public void modifyAttackDamage (final EntityPlayer player) {
|
||||
if (!player.worldObj.isRemote) {
|
||||
final IInventory inv = player.inventory;
|
||||
if (player.worldObj.isRemote)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).getItem() instanceof ItemWandCasting) {
|
||||
final ItemStack stack = inv.getStackInSlot(i);
|
||||
final ItemWandCasting wand = (ItemWandCasting) inv.getStackInSlot(i).getItem();
|
||||
final IInventory inv = player.inventory;
|
||||
|
||||
if (wand.getFocus(stack) != null && wand.getFocus(stack) == ItemRegistry.ItemFocusMageMace
|
||||
&& wand.getRod(stack) instanceof WandRod) {
|
||||
final NBTTagList tags = new NBTTagList();
|
||||
final NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString("AttributeName", SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName());
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).getItem() instanceof ItemWandCasting) {
|
||||
final ItemStack stack = inv.getStackInSlot(i);
|
||||
final ItemWandCasting wand = (ItemWandCasting) inv.getStackInSlot(i).getItem();
|
||||
|
||||
final UUID uuid = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF");
|
||||
final AttributeModifier am = new AttributeModifier(uuid, "Weapon modifier",
|
||||
ConfigHandler.MAGE_MACE_DMG_INC_BASE + wand.getFocusPotency(stack), 0);
|
||||
if (wand.getFocus(stack) != null && wand.getFocus(stack) == ItemRegistry.ItemFocusMageMace
|
||||
&& wand.getRod(stack) instanceof WandRod) {
|
||||
final NBTTagList tags = new NBTTagList();
|
||||
final NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString("AttributeName", SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName());
|
||||
|
||||
tag.setString("Name", am.getName());
|
||||
tag.setDouble("Amount", am.getAmount());
|
||||
tag.setInteger("Operation", am.getOperation());
|
||||
tag.setLong("UUIDMost", am.getID().getMostSignificantBits());
|
||||
tag.setLong("UUIDLeast", am.getID().getLeastSignificantBits());
|
||||
final UUID uuid = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF");
|
||||
final AttributeModifier am = new AttributeModifier(uuid, "Weapon modifier",
|
||||
ConfigHandler.MAGE_MACE_DMG_INC_BASE + wand.getFocusPotency(stack), 0);
|
||||
|
||||
tags.appendTag(tag);
|
||||
stack.stackTagCompound.setTag("AttributeModifiers", tags);
|
||||
tag.setString("Name", am.getName());
|
||||
tag.setDouble("Amount", am.getAmount());
|
||||
tag.setInteger("Operation", am.getOperation());
|
||||
tag.setLong("UUIDMost", am.getID().getMostSignificantBits());
|
||||
tag.setLong("UUIDLeast", am.getID().getLeastSignificantBits());
|
||||
|
||||
tags.appendTag(tag);
|
||||
stack.stackTagCompound.setTag("AttributeModifiers", tags);
|
||||
}
|
||||
else if (wand.getRod(stack) instanceof WandRod) {
|
||||
if (!stack.hasTagCompound()) {
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
else if (wand.getRod(stack) instanceof WandRod) {
|
||||
if (!stack.hasTagCompound()) {
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
stack.stackTagCompound.removeTag("AttributeModifiers");
|
||||
}
|
||||
if (wand.getFocus(stack) != null && wand.getFocus(stack) == ItemRegistry.ItemFocusMageMace
|
||||
&& wand.getRod(stack) instanceof StaffRod) {
|
||||
final NBTTagList tags = new NBTTagList();
|
||||
final NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString("AttributeName", SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName());
|
||||
stack.stackTagCompound.removeTag("AttributeModifiers");
|
||||
}
|
||||
if (wand.getFocus(stack) != null && wand.getFocus(stack) == ItemRegistry.ItemFocusMageMace
|
||||
&& wand.getRod(stack) instanceof StaffRod) {
|
||||
final NBTTagList tags = new NBTTagList();
|
||||
final NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString("AttributeName", SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName());
|
||||
|
||||
final UUID uuid = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF");
|
||||
final AttributeModifier am = new AttributeModifier(uuid, "Weapon modifier",
|
||||
5.0D + ConfigHandler.MAGE_MACE_DMG_INC_BASE + wand.getFocusPotency(stack), 0);
|
||||
final UUID uuid = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF");
|
||||
final AttributeModifier am = new AttributeModifier(uuid, "Weapon modifier",
|
||||
5.0D + ConfigHandler.MAGE_MACE_DMG_INC_BASE + wand.getFocusPotency(stack), 0);
|
||||
|
||||
tag.setString("Name", am.getName());
|
||||
tag.setDouble("Amount", am.getAmount());
|
||||
tag.setInteger("Operation", am.getOperation());
|
||||
tag.setLong("UUIDMost", am.getID().getMostSignificantBits());
|
||||
tag.setLong("UUIDLeast", am.getID().getLeastSignificantBits());
|
||||
tag.setString("Name", am.getName());
|
||||
tag.setDouble("Amount", am.getAmount());
|
||||
tag.setInteger("Operation", am.getOperation());
|
||||
tag.setLong("UUIDMost", am.getID().getMostSignificantBits());
|
||||
tag.setLong("UUIDLeast", am.getID().getLeastSignificantBits());
|
||||
|
||||
tags.appendTag(tag);
|
||||
stack.stackTagCompound.setTag("AttributeModifiers", tags);
|
||||
}
|
||||
else if (wand.getRod(stack) instanceof StaffRod) {
|
||||
final NBTTagList tags = new NBTTagList();
|
||||
final NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString("AttributeName", SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName());
|
||||
tags.appendTag(tag);
|
||||
stack.stackTagCompound.setTag("AttributeModifiers", tags);
|
||||
}
|
||||
else if (wand.getRod(stack) instanceof StaffRod) {
|
||||
final NBTTagList tags = new NBTTagList();
|
||||
final NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString("AttributeName", SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName());
|
||||
|
||||
final UUID uuid = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF");
|
||||
final AttributeModifier am = new AttributeModifier(uuid, "Weapon modifier", 6.0D, 0);
|
||||
final UUID uuid = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF");
|
||||
final AttributeModifier am = new AttributeModifier(uuid, "Weapon modifier", 6.0D, 0);
|
||||
|
||||
tag.setString("Name", am.getName());
|
||||
tag.setDouble("Amount", am.getAmount());
|
||||
tag.setInteger("Operation", am.getOperation());
|
||||
tag.setLong("UUIDMost", am.getID().getMostSignificantBits());
|
||||
tag.setLong("UUIDLeast", am.getID().getLeastSignificantBits());
|
||||
tag.setString("Name", am.getName());
|
||||
tag.setDouble("Amount", am.getAmount());
|
||||
tag.setInteger("Operation", am.getOperation());
|
||||
tag.setLong("UUIDMost", am.getID().getMostSignificantBits());
|
||||
tag.setLong("UUIDLeast", am.getID().getLeastSignificantBits());
|
||||
|
||||
tags.appendTag(tag);
|
||||
stack.stackTagCompound.setTag("AttributeModifiers", tags);
|
||||
}
|
||||
tags.appendTag(tag);
|
||||
stack.stackTagCompound.setTag("AttributeModifiers", tags);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -217,8 +233,8 @@ public class TMEventHandler {
|
||||
*/
|
||||
@SubscribeEvent
|
||||
public void playerLoggedIn (final PlayerEvent.PlayerLoggedInEvent event) {
|
||||
if (UpdateHandler.updateStatus != null) {
|
||||
event.player.addChatMessage(new ChatComponentText(UpdateHandler.updateStatus));
|
||||
if (UpdateHandler.message != null) {
|
||||
event.player.addChatMessage(new ChatComponentText(UpdateHandler.message));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,21 +252,24 @@ public class TMEventHandler {
|
||||
* Give the player the Creation research upon crafting the Shard of Creation
|
||||
*/
|
||||
public void giveResearch (final EntityPlayer player) {
|
||||
if (!player.worldObj.isRemote && !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATION")
|
||||
// CREATION
|
||||
if (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATION")
|
||||
&& ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATIONSHARD")) {
|
||||
Thaumcraft.proxy.getResearchManager().completeResearch(player, "CREATION");
|
||||
PacketHandler.INSTANCE.sendTo(new PacketResearchComplete("CREATION"), (EntityPlayerMP) player);
|
||||
player.addChatMessage(
|
||||
new ChatComponentText(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("text.creation")));
|
||||
player.playSound("thaumcraft:wind", 1.0F, 5.0F);
|
||||
|
||||
if (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "OUTERREV")
|
||||
&& ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATION")) {
|
||||
Thaumcraft.proxy.getResearchManager().completeResearch(player, "OUTERREV");
|
||||
PacketHandler.INSTANCE.sendTo(new PacketResearchComplete("OUTERREV"), (EntityPlayerMP) player);
|
||||
}
|
||||
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 80, 0));
|
||||
player.addPotionEffect(new PotionEffect(Config.potionBlurredID, 200, 0));
|
||||
// effects
|
||||
HUDHandler.displayString(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("text.creation"), 3200,
|
||||
false);
|
||||
player.worldObj.playSoundAtEntity(player, "thaumcraft:egidle", 1.0F, 1.0F);
|
||||
player.worldObj.playSoundAtEntity(player, "thaumcraft:heartbeat", 1.0F, 1.0F);
|
||||
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 200, -1));
|
||||
}
|
||||
// OUTERREV
|
||||
if (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "OUTERREV")
|
||||
&& ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATION")) {
|
||||
Thaumcraft.proxy.getResearchManager().completeResearch(player, "OUTERREV");
|
||||
PacketHandler.INSTANCE.sendTo(new PacketResearchComplete("OUTERREV"), (EntityPlayerMP) player);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,12 +278,14 @@ public class TMEventHandler {
|
||||
*/
|
||||
@SubscribeEvent
|
||||
public void itemTooltip (final ItemTooltipEvent event) {
|
||||
// mage mace attack dmg
|
||||
if (event.itemStack.getItem() instanceof ItemFocusMageMace
|
||||
&& event.toolTip.contains(StatCollector.translateToLocal("item.Focus.cost1"))) {
|
||||
event.toolTip.remove(StatCollector.translateToLocal("item.Focus.cost1"));
|
||||
event.toolTip.add(1, StatCollector.translateToLocal("item.Focus.cost3"));
|
||||
}
|
||||
|
||||
// voidtouched items
|
||||
if (event.itemStack.stackTagCompound != null && event.itemStack.stackTagCompound.getBoolean("voidtouched")) {
|
||||
event.toolTip.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("text.voidtouched"));
|
||||
}
|
||||
|
||||
@@ -9,25 +9,26 @@ import net.minecraft.util.EnumChatFormatting;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
|
||||
public class UpdateHandler {
|
||||
private static String currentVersion = TaintedMagic.VERSION;
|
||||
private static String newestVersion;
|
||||
public static String updateStatus = null;
|
||||
private static String latestVersion = null;
|
||||
public static String message = null;
|
||||
|
||||
public static void checkForUpdate () {
|
||||
getNewestVersion();
|
||||
|
||||
if (newestVersion != null) {
|
||||
if (newestVersion.equalsIgnoreCase(currentVersion)) {
|
||||
if (latestVersion != null) {
|
||||
if (TaintedMagic.VERSION.equals("@VERSION@")) {
|
||||
message = String.format("%sTainted Magic is running in DEV!", EnumChatFormatting.GREEN);
|
||||
TaintedMagic.logger.info("Tainted Magic is running in DEV!");
|
||||
}
|
||||
else if (!newestVersion.equalsIgnoreCase(currentVersion)) {
|
||||
updateStatus = EnumChatFormatting.RED + "Tainted Magic is out of date! The latest version is "
|
||||
+ EnumChatFormatting.GREEN + newestVersion;
|
||||
else if (!latestVersion.equalsIgnoreCase(TaintedMagic.VERSION)) {
|
||||
message = String.format("%sTainted Magic is out of date! The latest version is %s%s", EnumChatFormatting.RED,
|
||||
EnumChatFormatting.GREEN, latestVersion);
|
||||
TaintedMagic.logger.warn("Mod out of date! You're still running {} ... the latest version is {}",
|
||||
currentVersion, newestVersion);
|
||||
TaintedMagic.VERSION, latestVersion);
|
||||
}
|
||||
}
|
||||
else {
|
||||
updateStatus = EnumChatFormatting.RED + "Tainted Magic failed to connect to the update server!";
|
||||
message = String.format("%sTainted Magic failed to connect to the update server!", EnumChatFormatting.RED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +36,7 @@ public class UpdateHandler {
|
||||
try {
|
||||
final URL url = new URL("https://raw.githubusercontent.com/yorkeJohn/Tainted-Magic/master/version.txt");
|
||||
final Scanner scan = new Scanner(url.openStream());
|
||||
newestVersion = scan.next();
|
||||
latestVersion = scan.next();
|
||||
scan.close();
|
||||
}
|
||||
catch (final MalformedURLException e) {
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
package taintedmagic.common.items;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXSparkle;
|
||||
|
||||
public class ItemSalis extends Item {
|
||||
|
||||
@@ -58,25 +61,67 @@ public class ItemSalis extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick (final ItemStack stack, final World world, final EntityPlayer player) {
|
||||
final int meta = stack.getItemDamage();
|
||||
switch (meta) {
|
||||
// Weather
|
||||
case 0 : {
|
||||
world.getWorldInfo().setRainTime(world.isRaining() ? 24000 : 0);
|
||||
world.getWorldInfo().setRaining(!world.isRaining());
|
||||
player.playSound("thaumcraft:wind", 0.3F, 1.0F + world.rand.nextFloat() * 0.5F);
|
||||
player.inventory.decrStackSize(player.inventory.currentItem, 1);
|
||||
return stack;
|
||||
public boolean onEntityItemUpdate (final EntityItem entity) {
|
||||
super.onEntityItemUpdate(entity);
|
||||
final World world = entity.worldObj;
|
||||
final int meta = entity.getEntityItem().getItemDamage();
|
||||
|
||||
if (entity.ticksExisted == 100) {
|
||||
switch (meta) {
|
||||
// Weather
|
||||
case 0 : {
|
||||
world.getWorldInfo().setRainTime(world.isRaining() ? 24000 : 0);
|
||||
world.getWorldInfo().setRaining(!world.isRaining());
|
||||
if (world.isRaining() && world.rand.nextInt(10) == 0) {
|
||||
world.getWorldInfo().setThundering(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
// Time
|
||||
case 1 : {
|
||||
world.setWorldTime(world.isDaytime() ? 14000 : 24000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
world.playSoundAtEntity(entity, "thaumcraft:ice", 0.3F, 1.0F + world.rand.nextFloat() * 0.25F);
|
||||
entity.setDead();
|
||||
if (world.isRemote) {
|
||||
for (int i = 0; i < 200; i++) {
|
||||
spawnParticles(entity, meta, true);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// Time
|
||||
case 1 : {
|
||||
world.setWorldTime(world.isDaytime() ? 14000 : 24000);
|
||||
player.playSound("thaumcraft:wind", 0.3F, 1.0F + world.rand.nextFloat() * 0.5F);
|
||||
player.inventory.decrStackSize(player.inventory.currentItem, 1);
|
||||
return stack;
|
||||
if (entity.ticksExisted % 30 == 1) {
|
||||
world.playSoundAtEntity(entity, "thaumcraft:wind", 0.1F, 1.0F + world.rand.nextFloat() * 0.5F);
|
||||
}
|
||||
if (world.isRemote) {
|
||||
spawnParticles(entity, meta, false);
|
||||
}
|
||||
return stack;
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
private void spawnParticles (final EntityItem entity, final int meta, final boolean death) {
|
||||
final Random rand = entity.worldObj.rand;
|
||||
|
||||
final double theta = Math.random() * Math.PI;
|
||||
final double phi = Math.random() * Math.PI * 2d;
|
||||
|
||||
final double x = Math.cos(phi) * Math.sin(theta) * 0.25d;
|
||||
final double y = Math.sin(phi) * Math.sin(theta) * 0.25d;
|
||||
final double z = Math.cos(theta) * 0.25d;
|
||||
|
||||
final FXSparkle fx = new FXSparkle(entity.worldObj, entity.posX + x, entity.boundingBox.maxY + y, entity.posZ + z,
|
||||
1.75f, meta == 0 ? 7 : 6, death ? 30 + rand.nextInt(5) : 3 + rand.nextInt(2));
|
||||
fx.setGravity(death ? 0f : -0.1f);
|
||||
fx.noClip = true;
|
||||
|
||||
if (death) {
|
||||
fx.motionX = x * 3d;
|
||||
fx.motionY = y * 3d;
|
||||
fx.motionZ = z * 3d;
|
||||
}
|
||||
ParticleEngine.instance.addEffect(entity.worldObj, fx);
|
||||
}
|
||||
}
|
||||
@@ -6,16 +6,16 @@ import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
public class TMMaterials {
|
||||
// Tool materials
|
||||
public static ToolMaterial toolMatHollow = EnumHelper.addToolMaterial("HOLLOW", 1, 200, 4.0F, -0.5F, 5);
|
||||
public static ToolMaterial toolMatShadow = EnumHelper.addToolMaterial("SHADOW", 3, 2500, 17.0F, 6.0F, 30);
|
||||
public static ToolMaterial toolMatPrimal = EnumHelper.addToolMaterial("PRIMAL", 3, 500, 16.0F, 16.75F, 30);
|
||||
public static final ToolMaterial TOOL_HOLLOW = EnumHelper.addToolMaterial("HOLLOW", 1, 200, 4.0F, -0.5F, 5);
|
||||
public static final ToolMaterial TOOL_SHADOW = EnumHelper.addToolMaterial("SHADOW", 3, 2500, 17.0F, 6.0F, 30);
|
||||
public static final ToolMaterial TOOL_PRIMAL = EnumHelper.addToolMaterial("PRIMAL", 3, 500, 16.0F, 16.75F, 30);
|
||||
|
||||
// Armour materials
|
||||
public static ArmorMaterial armorMatWarped = EnumHelper.addArmorMaterial("WARPED", 500, new int[]{ 4, 0, 0, 0 }, 20);
|
||||
public static ArmorMaterial armorMatVoidwalker =
|
||||
public static final ArmorMaterial ARMOR_WARPED = EnumHelper.addArmorMaterial("WARPED", 500, new int[]{ 4, 0, 0, 0 }, 20);
|
||||
public static final ArmorMaterial ARMOR_VOIDWALKER =
|
||||
EnumHelper.addArmorMaterial("VOIDWALKER", 300, new int[]{ 0, 0, 0, 4 }, 30);
|
||||
public static ArmorMaterial armorMatVoidFortress =
|
||||
public static final ArmorMaterial ARMOR_VOIDFORTRESS =
|
||||
EnumHelper.addArmorMaterial("VOIDFORTRESS", 300, new int[]{ 4, 8, 6, 0 }, 30);
|
||||
public static ArmorMaterial armorMatShadowFortress =
|
||||
public static final ArmorMaterial ARMOR_SHADOWFORTRESS =
|
||||
EnumHelper.addArmorMaterial("SHADOWFORTRESS", 3000, new int[]{ 4, 10, 6, 0 }, 30);
|
||||
}
|
||||
@@ -142,37 +142,37 @@ public class ItemRegistry {
|
||||
GameRegistry.registerItem(ItemWarpFertilizer, "ItemWarpFertilizer");
|
||||
|
||||
// Armor and Baubles
|
||||
ItemWarpedGoggles = new ItemWarpedGoggles(TMMaterials.armorMatWarped, 4, 0);
|
||||
ItemWarpedGoggles = new ItemWarpedGoggles(TMMaterials.ARMOR_WARPED, 4, 0);
|
||||
GameRegistry.registerItem(ItemWarpedGoggles, "ItemWarpedGoggles");
|
||||
|
||||
ItemVoidFortressHelmet =
|
||||
new ItemVoidFortressArmor(TMMaterials.armorMatVoidFortress, 4, 0).setUnlocalizedName("ItemVoidFortressHelmet");
|
||||
new ItemVoidFortressArmor(TMMaterials.ARMOR_VOIDFORTRESS, 4, 0).setUnlocalizedName("ItemVoidFortressHelmet");
|
||||
GameRegistry.registerItem(ItemVoidFortressHelmet, "ItemVoidFortressHelmet");
|
||||
|
||||
ItemVoidFortressChestplate = new ItemVoidFortressArmor(TMMaterials.armorMatVoidFortress, 4, 1)
|
||||
ItemVoidFortressChestplate = new ItemVoidFortressArmor(TMMaterials.ARMOR_VOIDFORTRESS, 4, 1)
|
||||
.setUnlocalizedName("ItemVoidFortressChestplate");
|
||||
GameRegistry.registerItem(ItemVoidFortressChestplate, "ItemVoidFortressChestplate");
|
||||
|
||||
ItemVoidFortressLeggings = new ItemVoidFortressArmor(TMMaterials.armorMatVoidFortress, 4, 2)
|
||||
.setUnlocalizedName("ItemVoidFortressLeggings");
|
||||
ItemVoidFortressLeggings =
|
||||
new ItemVoidFortressArmor(TMMaterials.ARMOR_VOIDFORTRESS, 4, 2).setUnlocalizedName("ItemVoidFortressLeggings");
|
||||
GameRegistry.registerItem(ItemVoidFortressLeggings, "ItemVoidFortressLeggings");
|
||||
|
||||
ItemVoidwalkerBoots =
|
||||
new ItemVoidwalkerBoots(TMMaterials.armorMatVoidwalker, 4, 3).setUnlocalizedName("ItemVoidwalkerBoots");
|
||||
new ItemVoidwalkerBoots(TMMaterials.ARMOR_VOIDWALKER, 4, 3).setUnlocalizedName("ItemVoidwalkerBoots");
|
||||
GameRegistry.registerItem(ItemVoidwalkerBoots, "ItemVoidwalkerBoots");
|
||||
|
||||
ItemVoidwalkerSash = new ItemVoidwalkerSash();
|
||||
GameRegistry.registerItem(ItemVoidwalkerSash, "ItemVoidwalkerSash");
|
||||
|
||||
ItemShadowFortressHelmet = new ItemShadowFortressArmor(TMMaterials.armorMatShadowFortress, 4, 0)
|
||||
ItemShadowFortressHelmet = new ItemShadowFortressArmor(TMMaterials.ARMOR_SHADOWFORTRESS, 4, 0)
|
||||
.setUnlocalizedName("ItemShadowFortressHelmet");
|
||||
GameRegistry.registerItem(ItemShadowFortressHelmet, "ItemShadowFortressHelmet");
|
||||
|
||||
ItemShadowFortressChestplate = new ItemShadowFortressArmor(TMMaterials.armorMatShadowFortress, 4, 1)
|
||||
ItemShadowFortressChestplate = new ItemShadowFortressArmor(TMMaterials.ARMOR_SHADOWFORTRESS, 4, 1)
|
||||
.setUnlocalizedName("ItemShadowFortressChestplate");
|
||||
GameRegistry.registerItem(ItemShadowFortressChestplate, "ItemShadowFortressChestplate");
|
||||
|
||||
ItemShadowFortressLeggings = new ItemShadowFortressArmor(TMMaterials.armorMatShadowFortress, 4, 2)
|
||||
ItemShadowFortressLeggings = new ItemShadowFortressArmor(TMMaterials.ARMOR_SHADOWFORTRESS, 4, 2)
|
||||
.setUnlocalizedName("ItemShadowFortressLeggings");
|
||||
GameRegistry.registerItem(ItemShadowFortressLeggings, "ItemShadowFortressLeggings");
|
||||
|
||||
@@ -233,25 +233,25 @@ public class ItemRegistry {
|
||||
ItemThaumicDisassembler = new ItemThaumicDisassembler();
|
||||
GameRegistry.registerItem(ItemThaumicDisassembler, "ItemThaumicDisassembler");
|
||||
|
||||
ItemHollowDagger = new ItemHollowDagger(TMMaterials.toolMatHollow);
|
||||
ItemHollowDagger = new ItemHollowDagger(TMMaterials.TOOL_HOLLOW);
|
||||
GameRegistry.registerItem(ItemHollowDagger, "ItemHollowDagger");
|
||||
|
||||
ItemShadowmetalHoe = new ItemShadowmetalHoe(TMMaterials.toolMatShadow);
|
||||
ItemShadowmetalHoe = new ItemShadowmetalHoe(TMMaterials.TOOL_SHADOW);
|
||||
GameRegistry.registerItem(ItemShadowmetalHoe, "ItemShadowmetalHoe");
|
||||
|
||||
ItemShadowmetalPick = new ItemShadowmetalPick(TMMaterials.toolMatShadow);
|
||||
ItemShadowmetalPick = new ItemShadowmetalPick(TMMaterials.TOOL_SHADOW);
|
||||
GameRegistry.registerItem(ItemShadowmetalPick, "ItemShadowmetalPick");
|
||||
|
||||
ItemShadowmetalAxe = new ItemShadowmetalAxe(TMMaterials.toolMatShadow);
|
||||
ItemShadowmetalAxe = new ItemShadowmetalAxe(TMMaterials.TOOL_SHADOW);
|
||||
GameRegistry.registerItem(ItemShadowmetalAxe, "ItemShadowmetalAxe");
|
||||
|
||||
ItemShadowmetalSpade = new ItemShadowmetalSpade(TMMaterials.toolMatShadow);
|
||||
ItemShadowmetalSpade = new ItemShadowmetalSpade(TMMaterials.TOOL_SHADOW);
|
||||
GameRegistry.registerItem(ItemShadowmetalSpade, "ItemShadowmetalSpade");
|
||||
|
||||
ItemShadowmetalSword = new ItemShadowmetalSword(TMMaterials.toolMatShadow);
|
||||
ItemShadowmetalSword = new ItemShadowmetalSword(TMMaterials.TOOL_SHADOW);
|
||||
GameRegistry.registerItem(ItemShadowmetalSword, "ItemShadowmetalSword");
|
||||
|
||||
ItemPrimalBlade = new ItemPrimalBlade(TMMaterials.toolMatPrimal);
|
||||
ItemPrimalBlade = new ItemPrimalBlade(TMMaterials.TOOL_PRIMAL);
|
||||
GameRegistry.registerItem(ItemPrimalBlade, "ItemPrimalBlade");
|
||||
|
||||
ItemKatana = new ItemKatana();
|
||||
|
||||
@@ -132,10 +132,8 @@ public class RecipeRegistry {
|
||||
|
||||
// Shard of Creation
|
||||
ResearchRegistry.recipes.put("ItemMaterial:5",
|
||||
ThaumcraftApi.addInfusionCraftingRecipe(
|
||||
"CREATIONSHARD", new ItemStack(ItemRegistry.ItemMaterial, 1, 5), 8, TaintedMagicHelper.getPrimals(50)
|
||||
.add(Aspect.AURA, 40).add(Aspect.VOID, 40).add(Aspect.MAGIC, 40).add(Aspect.ELDRITCH, 40),
|
||||
new ItemStack(ConfigItems.itemShard, 1, 6),
|
||||
ThaumcraftApi.addInfusionCraftingRecipe("CREATIONSHARD", new ItemStack(ItemRegistry.ItemMaterial, 1, 5), 8,
|
||||
TaintedMagicHelper.getPrimals(55), new ItemStack(ConfigItems.itemShard, 1, 6),
|
||||
new ItemStack[]{ new ItemStack(ConfigItems.itemEldritchObject, 1, 3),
|
||||
new ItemStack(ConfigItems.itemShard, 1, 0), new ItemStack(ConfigItems.itemShard, 1, 1),
|
||||
new ItemStack(ConfigItems.itemShard, 1, 2), new ItemStack(Items.nether_star),
|
||||
|
||||
Reference in new issue
Block a user