mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-20 03:59:36 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
c312069d28
commit
6bdb2c0b96
100 files changed
+3171
-3401
No files matched your search
@@ -1,13 +1,8 @@
|
||||
package emt.item;
|
||||
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.api.IBauble;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.util.EMTTextHelper;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -20,11 +15,19 @@ import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.api.IBauble;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import emt.EMT;
|
||||
import emt.util.EMTTextHelper;
|
||||
|
||||
public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRunicArmor {
|
||||
|
||||
private static final String NBT_TAG_FORGE_DATA = "EMT";
|
||||
private static final String NBT_TAG_MIND_CORRUPTION = "MindCorruption";
|
||||
private static final String NBT_TAG_WARP = "warp";
|
||||
@@ -60,8 +63,9 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
|
||||
@Override
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) {
|
||||
String colourCode = "" + EnumChatFormatting.DARK_RED;
|
||||
list.add(colourCode
|
||||
+ "The Ring whispers to you, promising power. But at what cost? Long-term usage is NOT advised.");
|
||||
list.add(
|
||||
colourCode
|
||||
+ "The Ring whispers to you, promising power. But at what cost? Long-term usage is NOT advised.");
|
||||
list.add(colourCode + "Can RUIN your game if you don't understand what this does. READ THE QUEST!!");
|
||||
super.addInformation(itemStack, player, list, par4);
|
||||
}
|
||||
@@ -128,11 +132,11 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
|
||||
// Stop doing this 20 times per second...
|
||||
if (random.nextInt(20) > 0) return;
|
||||
|
||||
/* Why dump to a new tag when you can just grab the tag and work with it?
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
((EntityPlayer) player).writeToNBT(tag);
|
||||
NBTTagCompound forgeTag = tag.getCompoundTag("ForgeData");
|
||||
*/
|
||||
/*
|
||||
* Why dump to a new tag when you can just grab the tag and work with it? NBTTagCompound tag = new
|
||||
* NBTTagCompound(); ((EntityPlayer) player).writeToNBT(tag); NBTTagCompound forgeTag =
|
||||
* tag.getCompoundTag("ForgeData");
|
||||
*/
|
||||
|
||||
// Retrieve Players NBT Data
|
||||
|
||||
@@ -149,12 +153,17 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
|
||||
// stack, false ) ));
|
||||
|
||||
if (corruption == 0) {
|
||||
((EntityPlayer) player)
|
||||
.addChatMessage(new ChatComponentText(
|
||||
((EntityPlayer) player).addChatMessage(
|
||||
new ChatComponentText(
|
||||
EMTTextHelper.PURPLE + "You have worn the Ring. Your soul has now been forever "
|
||||
+ EMTTextHelper.PURPLE + "tainted. " + EMTTextHelper.RED + EMTTextHelper.ITALIC
|
||||
+ "Beware of wearing the ring. The tainting will only " + EMTTextHelper.RED
|
||||
+ EMTTextHelper.ITALIC + "increase, and strange things will start happening."));
|
||||
+ EMTTextHelper.PURPLE
|
||||
+ "tainted. "
|
||||
+ EMTTextHelper.RED
|
||||
+ EMTTextHelper.ITALIC
|
||||
+ "Beware of wearing the ring. The tainting will only "
|
||||
+ EMTTextHelper.RED
|
||||
+ EMTTextHelper.ITALIC
|
||||
+ "increase, and strange things will start happening."));
|
||||
}
|
||||
// First effect should become active after ~5 Minutes
|
||||
else if (corruption > 300 && corruption < 1400 && random.nextInt(100) == 0) {
|
||||
@@ -176,33 +185,41 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
|
||||
if (corruption >= 300) { // worn more than 5 minutes
|
||||
if (random.nextInt(100) == 0) { // every 100 seconds
|
||||
getItemWarpLevel(stack, true);
|
||||
((EntityPlayer) player)
|
||||
.addChatMessage(new ChatComponentText(
|
||||
EMTTextHelper.PURPLE + "The Ring suddenly starts to glow purple"));
|
||||
((EntityPlayer) player).addChatMessage(
|
||||
new ChatComponentText(EMTTextHelper.PURPLE + "The Ring suddenly starts to glow purple"));
|
||||
}
|
||||
if (random.nextInt(300) == 0) { // randomly every 5 minutes
|
||||
ThaumcraftApiHelper.addWarpToPlayer((EntityPlayer) player, 1, false); // adds 1 perm warp
|
||||
ThaumcraftApiHelper.addStickyWarpToPlayer(
|
||||
(EntityPlayer) player, random.nextInt(1)); // adds 0-1 sticky warp
|
||||
((EntityPlayer) player)
|
||||
.addChatMessage(new ChatComponentText(
|
||||
EMTTextHelper.PURPLE + "Your body suddenly starts to glow purple"));
|
||||
ThaumcraftApiHelper.addStickyWarpToPlayer((EntityPlayer) player, random.nextInt(1)); // adds 0-1
|
||||
// sticky warp
|
||||
((EntityPlayer) player).addChatMessage(
|
||||
new ChatComponentText(EMTTextHelper.PURPLE + "Your body suddenly starts to glow purple"));
|
||||
}
|
||||
if (corruption >= 3600) { // if you wear it for more than an hour total
|
||||
if (random.nextInt(300) == 0) {
|
||||
ThaumcraftApiHelper.addWarpToPlayer(
|
||||
(EntityPlayer) player, 5 + random.nextInt(5), false); // adds 5-10 perm warp
|
||||
ThaumcraftApiHelper.addStickyWarpToPlayer(
|
||||
(EntityPlayer) player, 5 + random.nextInt(5)); // adds 5-10 sticky warp
|
||||
ThaumcraftApiHelper.addWarpToPlayer(
|
||||
(EntityPlayer) player,
|
||||
10 + random.nextInt(40),
|
||||
true); // adds 10-50 temp warp, but this is ultra easy to remove
|
||||
((EntityPlayer) player)
|
||||
.addChatMessage(
|
||||
new ChatComponentText(
|
||||
EMTTextHelper.PURPLE
|
||||
+ "Your body resonates with the Ring and suddenly starts to glow purple ominously"));
|
||||
ThaumcraftApiHelper.addWarpToPlayer((EntityPlayer) player, 5 + random.nextInt(5), false); // adds
|
||||
// 5-10
|
||||
// perm
|
||||
// warp
|
||||
ThaumcraftApiHelper.addStickyWarpToPlayer((EntityPlayer) player, 5 + random.nextInt(5)); // adds
|
||||
// 5-10
|
||||
// sticky
|
||||
// warp
|
||||
ThaumcraftApiHelper.addWarpToPlayer((EntityPlayer) player, 10 + random.nextInt(40), true); // adds
|
||||
// 10-50
|
||||
// temp
|
||||
// warp,
|
||||
// but
|
||||
// this
|
||||
// is
|
||||
// ultra
|
||||
// easy
|
||||
// to
|
||||
// remove
|
||||
((EntityPlayer) player).addChatMessage(
|
||||
new ChatComponentText(
|
||||
EMTTextHelper.PURPLE
|
||||
+ "Your body resonates with the Ring and suddenly starts to glow purple ominously"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -216,11 +233,9 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
|
||||
public void onEquipped(ItemStack stack, EntityLivingBase player) {
|
||||
// This purges all corruption once the ring is put on / a second ring is equipped?
|
||||
/*
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
((EntityPlayer) player).writeToNBT(tag);
|
||||
tag.getCompoundTag( NBT_TAG_FORGE_DATA ).setInteger( NBT_TAG_MIND_CORRUPTION, 0);
|
||||
((EntityPlayer) player).readFromNBT(tag);
|
||||
*/
|
||||
* NBTTagCompound tag = new NBTTagCompound(); ((EntityPlayer) player).writeToNBT(tag); tag.getCompoundTag(
|
||||
* NBT_TAG_FORGE_DATA ).setInteger( NBT_TAG_MIND_CORRUPTION, 0); ((EntityPlayer) player).readFromNBT(tag);
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -229,11 +244,10 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
|
||||
if (!((EntityPlayer) player).capabilities.isCreativeMode)
|
||||
((EntityPlayer) player).capabilities.disableDamage = false;
|
||||
|
||||
/* Wtf? Remove ForgeData tag? There are more mods using this tag than just emt!
|
||||
((EntityPlayer) player).writeToNBT(tag);
|
||||
tag.removeTag( NBT_TAG_FORGE_DATA );
|
||||
((EntityPlayer) player).readFromNBT(tag);
|
||||
*/
|
||||
/*
|
||||
* Wtf? Remove ForgeData tag? There are more mods using this tag than just emt! ((EntityPlayer)
|
||||
* player).writeToNBT(tag); tag.removeTag( NBT_TAG_FORGE_DATA ); ((EntityPlayer) player).readFromNBT(tag);
|
||||
*/
|
||||
player.addPotionEffect(new PotionEffect(Potion.confusion.id, 200, 1, false));
|
||||
}
|
||||
|
||||
@@ -253,13 +267,12 @@ public class ItemOneRing extends ItemBase implements IBauble, IWarpingGear, IRun
|
||||
boolean tRet = false;
|
||||
if (random.nextInt(5) == 0) {
|
||||
tRet = true;
|
||||
((EntityPlayer) player)
|
||||
.addChatMessage(new ChatComponentText(EMTTextHelper.GREEN
|
||||
+ "You removed the Ring. Maybe you should think twice before using it next time?"));
|
||||
} else
|
||||
((EntityPlayer) player)
|
||||
.addChatMessage(new ChatComponentText(
|
||||
EMTTextHelper.PURPLE + "Nooo, don't remove me! I give you great power!"));
|
||||
((EntityPlayer) player).addChatMessage(
|
||||
new ChatComponentText(
|
||||
EMTTextHelper.GREEN
|
||||
+ "You removed the Ring. Maybe you should think twice before using it next time?"));
|
||||
} else((EntityPlayer) player).addChatMessage(
|
||||
new ChatComponentText(EMTTextHelper.PURPLE + "Nooo, don't remove me! I give you great power!"));
|
||||
|
||||
return tRet;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user