mirror of
https://github.com/GTNewHorizons/Tainted-Magic.git
synced 2026-11-21 04:22:21 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
1eaf9b7991
commit
62390a0d0f
79 files changed
+3118
-1929
No files matched your search
@@ -5,5 +5,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IHeldItemHUD {
|
||||
void renderHUD (ScaledResolution res, EntityPlayer player, ItemStack stack, float partialTicks, float fract);
|
||||
|
||||
void renderHUD(ScaledResolution res, EntityPlayer player, ItemStack stack, float partialTicks, float fract);
|
||||
}
|
||||
@@ -4,5 +4,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IRenderInventoryItem {
|
||||
void render (EntityPlayer player, ItemStack stack, float partialTicks);
|
||||
|
||||
void render(EntityPlayer player, ItemStack stack, float partialTicks);
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.items.ItemVoidBlood;
|
||||
|
||||
/**
|
||||
@@ -14,7 +15,7 @@ import taintedmagic.common.items.ItemVoidBlood;
|
||||
public class RecipeVoidBlood implements IRecipe {
|
||||
|
||||
@Override
|
||||
public boolean matches (final InventoryCrafting inv, final World world) {
|
||||
public boolean matches(final InventoryCrafting inv, final World world) {
|
||||
boolean foundBlood = false;
|
||||
boolean foundArmour = false;
|
||||
|
||||
@@ -24,19 +25,16 @@ public class RecipeVoidBlood implements IRecipe {
|
||||
if (stack != null) {
|
||||
if (stack.getItem() instanceof ItemVoidBlood && !foundBlood) {
|
||||
foundBlood = true;
|
||||
}
|
||||
else if (stack.getItem() instanceof ItemArmor && !foundArmour) {
|
||||
} else if (stack.getItem() instanceof ItemArmor && !foundArmour) {
|
||||
foundArmour = true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
} else return false;
|
||||
}
|
||||
}
|
||||
return foundBlood && foundArmour;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult (final InventoryCrafting inv) {
|
||||
public ItemStack getCraftingResult(final InventoryCrafting inv) {
|
||||
ItemStack copy = null;
|
||||
ItemStack armor = null;
|
||||
ItemStack blood = null;
|
||||
@@ -44,13 +42,13 @@ public class RecipeVoidBlood implements IRecipe {
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).getItem() instanceof ItemArmor) {
|
||||
armor = inv.getStackInSlot(i);
|
||||
}
|
||||
else if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).getItem() instanceof ItemVoidBlood) {
|
||||
} else if (inv.getStackInSlot(i) != null && inv.getStackInSlot(i).getItem() instanceof ItemVoidBlood) {
|
||||
blood = inv.getStackInSlot(i);
|
||||
}
|
||||
}
|
||||
if (armor != null && blood != null && (armor.getTagCompound() == null
|
||||
|| armor.getTagCompound() != null && !armor.getTagCompound().getBoolean("voidtouched"))) {
|
||||
if (armor != null && blood != null
|
||||
&& (armor.getTagCompound() == null
|
||||
|| armor.getTagCompound() != null && !armor.getTagCompound().getBoolean("voidtouched"))) {
|
||||
copy = armor.copy();
|
||||
if (copy.getTagCompound() == null) {
|
||||
copy.setTagCompound(new NBTTagCompound());
|
||||
@@ -63,12 +61,12 @@ public class RecipeVoidBlood implements IRecipe {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize () {
|
||||
public int getRecipeSize() {
|
||||
return 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getRecipeOutput () {
|
||||
public ItemStack getRecipeOutput() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,11 @@
|
||||
package taintedmagic.client;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import taintedmagic.client.handler.ClientHandler;
|
||||
import taintedmagic.client.handler.HUDHandler;
|
||||
import taintedmagic.client.handler.SashClientHandler;
|
||||
@@ -24,27 +19,33 @@ import taintedmagic.common.entities.EntityDiffusion;
|
||||
import taintedmagic.common.entities.EntityHomingShard;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.client.renderers.entity.RenderEldritchOrb;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
public class ClientProxy extends CommonProxy {
|
||||
|
||||
@Override
|
||||
public void preInit (final FMLPreInitializationEvent event) {
|
||||
public void preInit(final FMLPreInitializationEvent event) {
|
||||
super.preInit(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init (final FMLInitializationEvent event) {
|
||||
public void init(final FMLInitializationEvent event) {
|
||||
super.init(event);
|
||||
registerRenderers();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit (final FMLPostInitializationEvent event) {
|
||||
public void postInit(final FMLPostInitializationEvent event) {
|
||||
super.postInit(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerHandlers () {
|
||||
public void registerHandlers() {
|
||||
super.registerHandlers();
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(new HUDHandler());
|
||||
@@ -55,7 +56,7 @@ public class ClientProxy extends CommonProxy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRenderers () {
|
||||
public void registerRenderers() {
|
||||
// Entities
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityDarkMatter.class, new RenderEldritchOrb());
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityHomingShard.class, new RenderEntityHomingShard());
|
||||
@@ -66,7 +67,7 @@ public class ClientProxy extends CommonProxy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityPlayer getClientPlayer () {
|
||||
public EntityPlayer getClientPlayer() {
|
||||
return Minecraft.getMinecraft().thePlayer;
|
||||
}
|
||||
|
||||
@@ -76,7 +77,7 @@ public class ClientProxy extends CommonProxy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getClientWorld () {
|
||||
public World getClientWorld() {
|
||||
return FMLClientHandler.instance().getClient().theWorld;
|
||||
}
|
||||
}
|
||||
@@ -3,22 +3,23 @@ package taintedmagic.client.handler;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import taintedmagic.api.IRenderInventoryItem;
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
import taintedmagic.api.IRenderInventoryItem;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ClientHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void tickEnd (final TickEvent event) {
|
||||
public void tickEnd(final TickEvent event) {
|
||||
if (event.phase == TickEvent.Phase.END) {
|
||||
HUDHandler.updateTicks();
|
||||
}
|
||||
@@ -28,15 +29,15 @@ public class ClientHandler {
|
||||
* Render items implementing IRenderInventoryItem
|
||||
*/
|
||||
@SubscribeEvent
|
||||
public void onPlayerRender (final RenderPlayerEvent.Specials.Post event) {
|
||||
public void onPlayerRender(final RenderPlayerEvent.Specials.Post event) {
|
||||
final EntityPlayer player = event.entityPlayer;
|
||||
if (player.getActivePotionEffect(Potion.invisibility) != null)
|
||||
return;
|
||||
if (player.getActivePotionEffect(Potion.invisibility) != null) return;
|
||||
|
||||
final ItemStack[] inv = player.inventory.mainInventory;
|
||||
final List<Item> rendering = new ArrayList<>();
|
||||
for (final ItemStack stack : inv) {
|
||||
if (stack != null && stack.getItem() instanceof IRenderInventoryItem && !rendering.contains(stack.getItem())) {
|
||||
if (stack != null && stack.getItem() instanceof IRenderInventoryItem
|
||||
&& !rendering.contains(stack.getItem())) {
|
||||
((IRenderInventoryItem) stack.getItem()).render(player, stack, event.partialRenderTick);
|
||||
rendering.add(stack.getItem());
|
||||
}
|
||||
|
||||
@@ -2,11 +2,6 @@ package taintedmagic.client.handler;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
@@ -15,14 +10,20 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import taintedmagic.api.IHeldItemHUD;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public final class HUDHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void renderGameOverlayEvent (final RenderGameOverlayEvent.Post event) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderGameOverlayEvent(final RenderGameOverlayEvent.Post event) {
|
||||
if (event.type == ElementType.ALL) {
|
||||
renderHeldItemHUD(event.partialTicks);
|
||||
renderString();
|
||||
@@ -33,8 +34,8 @@ public final class HUDHandler {
|
||||
private static ItemStack stack = null;
|
||||
private static ItemStack last = null;
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
private void renderHeldItemHUD (final float partialTicks) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void renderHeldItemHUD(final float partialTicks) {
|
||||
final EntityPlayer player = TaintedMagic.proxy.getClientPlayer();
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
final ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
@@ -47,16 +48,14 @@ public final class HUDHandler {
|
||||
boolean b = false;
|
||||
if (stack != null && stack.getItem() instanceof IHeldItemHUD) {
|
||||
b = true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
b = false;
|
||||
}
|
||||
|
||||
final float time = 30.0F;
|
||||
if (b) {
|
||||
ticksEquipped = Math.min(time, ticksEquipped + partialTicks);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
ticksEquipped = Math.max(0F, ticksEquipped - partialTicks);
|
||||
}
|
||||
|
||||
@@ -64,8 +63,7 @@ public final class HUDHandler {
|
||||
|
||||
if (b) {
|
||||
((IHeldItemHUD) stack.getItem()).renderHUD(res, player, stack, partialTicks, fract);
|
||||
}
|
||||
else if (!b && ticksEquipped != 0) {
|
||||
} else if (!b && ticksEquipped != 0) {
|
||||
((IHeldItemHUD) last.getItem()).renderHUD(res, player, last, partialTicks, fract);
|
||||
}
|
||||
}
|
||||
@@ -78,25 +76,25 @@ public final class HUDHandler {
|
||||
/**
|
||||
* Displays text above the health bar for a specified duration.
|
||||
*
|
||||
* @param text The string to display.
|
||||
* @param text The string to display.
|
||||
* @param duration The duration to display for (in ticks).
|
||||
* @param rainbow Display the string in rainbow.
|
||||
* @param rainbow Display the string in rainbow.
|
||||
*/
|
||||
public static void displayString (final String text, final int duration, final boolean rainbow) {
|
||||
public static void displayString(final String text, final int duration, final boolean rainbow) {
|
||||
currentText = text;
|
||||
ticks = time = duration;
|
||||
isRainbow = rainbow;
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public static void updateTicks () {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void updateTicks() {
|
||||
if (ticks > 0) {
|
||||
ticks--;
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
private void renderString () {
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void renderString() {
|
||||
if (ticks > 0 && !MathHelper.stringNullOrLengthZero(currentText)) {
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
final ScaledResolution res = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
|
||||
@@ -8,13 +8,17 @@ public class SashClientHandler {
|
||||
private static boolean sashEnabled = true;
|
||||
|
||||
public static void toggle() {
|
||||
sashEnabled = !sashEnabled;
|
||||
sashEnabled = !sashEnabled;
|
||||
if (sashEnabled) {
|
||||
HUDHandler.displayString(EnumChatFormatting.GREEN + StatCollector.translateToLocal("text.sash.speed.on"),
|
||||
300, false);
|
||||
HUDHandler.displayString(
|
||||
EnumChatFormatting.GREEN + StatCollector.translateToLocal("text.sash.speed.on"),
|
||||
300,
|
||||
false);
|
||||
} else {
|
||||
HUDHandler.displayString(EnumChatFormatting.RED + StatCollector.translateToLocal("text.sash.speed.off"),
|
||||
300, false);
|
||||
HUDHandler.displayString(
|
||||
EnumChatFormatting.RED + StatCollector.translateToLocal("text.sash.speed.off"),
|
||||
300,
|
||||
false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
package taintedmagic.client.handler;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import taintedmagic.common.items.equipment.ItemVoidwalkerSash;
|
||||
import taintedmagic.common.network.PacketHandler;
|
||||
import taintedmagic.common.network.PacketSashToggle;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
@@ -7,18 +16,14 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import taintedmagic.common.items.equipment.ItemVoidwalkerSash;
|
||||
import taintedmagic.common.network.PacketHandler;
|
||||
import taintedmagic.common.network.PacketSashToggle;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class SashKeyListener {
|
||||
|
||||
private static final KeyBinding toggleSash = new KeyBinding("tmisc.toggleSash", Keyboard.CHAR_NONE, "tmisc.keyCategory");
|
||||
private static final KeyBinding toggleSash = new KeyBinding(
|
||||
"tmisc.toggleSash",
|
||||
Keyboard.CHAR_NONE,
|
||||
"tmisc.keyCategory");
|
||||
|
||||
public SashKeyListener() {
|
||||
FMLCommonHandler.instance().bus().register(this);
|
||||
|
||||
@@ -2,6 +2,7 @@ package taintedmagic.client.handler;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
|
||||
public final class SashServerHandler {
|
||||
@@ -11,8 +12,7 @@ public final class SashServerHandler {
|
||||
|
||||
private static NBTTagCompound getCompound(EntityPlayer player) {
|
||||
NBTTagCompound cmp = player.getEntityData();
|
||||
if (!cmp.hasKey(COMPOUND))
|
||||
cmp.setTag(COMPOUND, new NBTTagCompound());
|
||||
if (!cmp.hasKey(COMPOUND)) cmp.setTag(COMPOUND, new NBTTagCompound());
|
||||
|
||||
return cmp.getCompoundTag(COMPOUND);
|
||||
}
|
||||
|
||||
@@ -7,11 +7,12 @@ import net.minecraft.client.model.ModelRenderer;
|
||||
* Katana model - created by <wiiv> using Tabula 4.1.1
|
||||
*/
|
||||
public class ModelKatana extends ModelBase {
|
||||
|
||||
public ModelRenderer blade;
|
||||
public ModelRenderer grip1;
|
||||
public ModelRenderer grip2;
|
||||
|
||||
public ModelKatana () {
|
||||
public ModelKatana() {
|
||||
textureWidth = 32;
|
||||
textureHeight = 64;
|
||||
|
||||
@@ -29,7 +30,7 @@ public class ModelKatana extends ModelBase {
|
||||
grip1.addChild(grip2);
|
||||
}
|
||||
|
||||
public void render (final float size) {
|
||||
public void render(final float size) {
|
||||
blade.render(size);
|
||||
grip1.render(size);
|
||||
}
|
||||
|
||||
@@ -7,9 +7,10 @@ import net.minecraft.client.model.ModelRenderer;
|
||||
* Saya model - created by <wiiv> using Tabula 4.1.1
|
||||
*/
|
||||
public class ModelSaya extends ModelBase {
|
||||
|
||||
public ModelRenderer saya;
|
||||
|
||||
public ModelSaya () {
|
||||
public ModelSaya() {
|
||||
textureWidth = 32;
|
||||
textureHeight = 64;
|
||||
|
||||
@@ -18,14 +19,14 @@ public class ModelSaya extends ModelBase {
|
||||
saya.addBox(-1.0F, 0.5F, -2.0F, 2, 48, 4, 0.0F);
|
||||
}
|
||||
|
||||
public void render (final float size) {
|
||||
public void render(final float size) {
|
||||
saya.render(size);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a helper function from Tabula to set the rotation of model parts
|
||||
*/
|
||||
public void setRotation (final ModelRenderer m, final float x, final float y, final float z) {
|
||||
public void setRotation(final ModelRenderer m, final float x, final float y, final float z) {
|
||||
m.rotateAngleX = x;
|
||||
m.rotateAngleY = y;
|
||||
m.rotateAngleZ = z;
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package taintedmagic.client.renderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import taintedmagic.common.entities.EntityDiffusion;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.lib.UtilsFX;
|
||||
@@ -13,12 +14,12 @@ import thaumcraft.client.lib.UtilsFX;
|
||||
public class RenderEntityDiffusion extends Render {
|
||||
|
||||
@Override
|
||||
public void doRender (final Entity entity, final double x, final double y, final double z, final float f,
|
||||
public void doRender(final Entity entity, final double x, final double y, final double z, final float f,
|
||||
final float partialTicks) {
|
||||
render((EntityDiffusion) entity, x, y, z, f, partialTicks);
|
||||
}
|
||||
|
||||
public void render (final EntityDiffusion entity, final double x, final double y, final double z, final float f,
|
||||
public void render(final EntityDiffusion entity, final double x, final double y, final double z, final float f,
|
||||
final float partialTicks) {
|
||||
final Tessellator t = Tessellator.instance;
|
||||
|
||||
@@ -67,7 +68,7 @@ public class RenderEntityDiffusion extends Render {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture (final Entity entity) {
|
||||
protected ResourceLocation getEntityTexture(final Entity entity) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,14 @@
|
||||
package taintedmagic.client.renderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.Render;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import taintedmagic.common.entities.EntityHomingShard;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.lib.UtilsFX;
|
||||
@@ -17,17 +18,17 @@ import thaumcraft.client.lib.UtilsFX;
|
||||
*/
|
||||
public class RenderEntityHomingShard extends Render {
|
||||
|
||||
public RenderEntityHomingShard () {
|
||||
public RenderEntityHomingShard() {
|
||||
shadowSize = 0.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doRender (final Entity entity, final double x, final double y, final double z, final float f,
|
||||
public void doRender(final Entity entity, final double x, final double y, final double z, final float f,
|
||||
final float partialTicks) {
|
||||
render((EntityHomingShard) entity, x, y, z, f, partialTicks);
|
||||
}
|
||||
|
||||
public void render (final EntityHomingShard entity, final double x, final double y, final double z, final float f,
|
||||
public void render(final EntityHomingShard entity, final double x, final double y, final double z, final float f,
|
||||
final float partialTicks) {
|
||||
final Tessellator t = Tessellator.instance;
|
||||
|
||||
@@ -61,7 +62,9 @@ public class RenderEntityHomingShard extends Render {
|
||||
|
||||
GL11.glRotatef(180.0F - renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glScalef(0.4F + 0.1F * entity.getStrength(), 0.4F + 0.1F * entity.getStrength(),
|
||||
GL11.glScalef(
|
||||
0.4F + 0.1F * entity.getStrength(),
|
||||
0.4F + 0.1F * entity.getStrength(),
|
||||
0.4F + 0.1F * entity.getStrength());
|
||||
|
||||
t.startDrawingQuads();
|
||||
@@ -87,7 +90,7 @@ public class RenderEntityHomingShard extends Render {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ResourceLocation getEntityTexture (final Entity entity) {
|
||||
protected ResourceLocation getEntityTexture(final Entity entity) {
|
||||
return TextureMap.locationBlocksTexture;
|
||||
}
|
||||
}
|
||||
@@ -1,34 +1,36 @@
|
||||
package taintedmagic.client.renderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.items.tools.ItemKatana;
|
||||
import thaumcraft.client.lib.UtilsFX;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderItemKatana implements IItemRenderer {
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType (final ItemStack stack, final ItemRenderType type) {
|
||||
public boolean handleRenderType(final ItemStack stack, final ItemRenderType type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper (final ItemRenderType type, final ItemStack stack, final ItemRendererHelper helper) {
|
||||
public boolean shouldUseRenderHelper(final ItemRenderType type, final ItemStack stack,
|
||||
final ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem (final ItemRenderType type, final ItemStack stack, final Object... data) {
|
||||
public void renderItem(final ItemRenderType type, final ItemStack stack, final Object... data) {
|
||||
final EntityPlayer player = TaintedMagic.proxy.getClientPlayer();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
@@ -36,20 +38,18 @@ public class RenderItemKatana implements IItemRenderer {
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glScalef(1.4F, 1.4F, 1.4F);
|
||||
|
||||
if ( (player.getHeldItem() == null || player.getHeldItem() != stack) && type != ItemRenderType.EQUIPPED) {
|
||||
if ((player.getHeldItem() == null || player.getHeldItem() != stack) && type != ItemRenderType.EQUIPPED) {
|
||||
GL11.glPushMatrix();
|
||||
if (type == ItemRenderType.ENTITY) {
|
||||
GL11.glScalef(0.5F, 0.5F, 0.5F);
|
||||
GL11.glTranslatef(0F, 0.5F, 0F);
|
||||
GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
else if (type == ItemRenderType.INVENTORY) {
|
||||
} else if (type == ItemRenderType.INVENTORY) {
|
||||
GL11.glScalef(0.4F, 0.4F, 0.4F);
|
||||
GL11.glRotatef(-65, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-50, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(1F, 1F, 0.0F);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
GL11.glTranslatef(0.0F, -0.7F, 0.0F);
|
||||
}
|
||||
|
||||
@@ -78,14 +78,12 @@ public class RenderItemKatana implements IItemRenderer {
|
||||
GL11.glTranslatef(2.0F, 1.85F, -0.25F);
|
||||
GL11.glRotatef(-10F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(-10F, 0.0F, 0.0F, 1.0F);
|
||||
}
|
||||
else if (type == ItemRenderType.INVENTORY) {
|
||||
} else if (type == ItemRenderType.INVENTORY) {
|
||||
GL11.glScalef(0.4F, 0.4F, 0.4F);
|
||||
GL11.glRotatef(-65, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-50, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(1F, 1F, 0.0F);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
GL11.glRotatef(60, 0.0F, 0.0F, 1.0F);
|
||||
GL11.glRotatef(-40, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(70, 0.0F, 1.0F, 0.0F);
|
||||
@@ -134,14 +132,15 @@ public class RenderItemKatana implements IItemRenderer {
|
||||
/**
|
||||
* TC method to draw runes on runed staves
|
||||
*/
|
||||
public static void drawRune (final double x, final double y, final double z, final int rune, final EntityPlayer player) {
|
||||
public static void drawRune(final double x, final double y, final double z, final int rune,
|
||||
final EntityPlayer player) {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
UtilsFX.bindTexture("textures/misc/script.png");
|
||||
|
||||
final float r = MathHelper.sin( (player.ticksExisted + rune * 5) / 5.0F) * 0.1F + 0.88F;
|
||||
final float g = MathHelper.sin( (player.ticksExisted + rune * 5) / 7.0F) * 0.1F + 0.63F;
|
||||
final float alpha = MathHelper.sin( (player.ticksExisted + rune * 5) / 10.0F) * 0.3F;
|
||||
final float r = MathHelper.sin((player.ticksExisted + rune * 5) / 5.0F) * 0.1F + 0.88F;
|
||||
final float g = MathHelper.sin((player.ticksExisted + rune * 5) / 7.0F) * 0.1F + 0.63F;
|
||||
final float alpha = MathHelper.sin((player.ticksExisted + rune * 5) / 10.0F) * 0.3F;
|
||||
|
||||
GL11.glColor4f(r, g, 0.2F, alpha + 0.6F);
|
||||
|
||||
@@ -170,4 +169,4 @@ public class RenderItemKatana implements IItemRenderer {
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
package taintedmagic.common;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import taintedmagic.client.handler.SashServerHandler;
|
||||
import taintedmagic.common.handler.ConfigHandler;
|
||||
import taintedmagic.common.handler.TMEventHandler;
|
||||
@@ -20,10 +17,14 @@ import taintedmagic.common.registry.OreDictRegistry;
|
||||
import taintedmagic.common.registry.RecipeRegistry;
|
||||
import taintedmagic.common.registry.ResearchRegistry;
|
||||
import taintedmagic.common.registry.TMEntityRegistry;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
public class CommonProxy {
|
||||
|
||||
public void preInit (final FMLPreInitializationEvent event) {
|
||||
public void preInit(final FMLPreInitializationEvent event) {
|
||||
ConfigHandler.config = new Configuration(event.getSuggestedConfigurationFile());
|
||||
ConfigHandler.initConfig();
|
||||
|
||||
@@ -40,24 +41,23 @@ public class CommonProxy {
|
||||
}
|
||||
}
|
||||
|
||||
public void init (final FMLInitializationEvent event) {
|
||||
public void init(final FMLInitializationEvent event) {
|
||||
registerHandlers();
|
||||
TMFocusUpgrades.initFocusUpgrades();
|
||||
}
|
||||
|
||||
public void postInit (final FMLPostInitializationEvent event) {
|
||||
public void postInit(final FMLPostInitializationEvent event) {
|
||||
ResearchRegistry.initResearch();
|
||||
}
|
||||
|
||||
public void registerHandlers () {
|
||||
public void registerHandlers() {
|
||||
MinecraftForge.EVENT_BUS.register(new TMEventHandler());
|
||||
FMLCommonHandler.instance().bus().register(new TMEventHandler());
|
||||
}
|
||||
|
||||
public void registerRenderers () {
|
||||
}
|
||||
public void registerRenderers() {}
|
||||
|
||||
public EntityPlayer getClientPlayer () {
|
||||
public EntityPlayer getClientPlayer() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class CommonProxy {
|
||||
return SashServerHandler.isSashEnabled(player);
|
||||
}
|
||||
|
||||
public World getClientWorld () {
|
||||
public World getClientWorld() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagByte;
|
||||
|
||||
import taintedmagic.common.helper.TaintedMagicHelper;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
@@ -13,12 +14,12 @@ import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
|
||||
public class TMCreativeTab extends CreativeTabs {
|
||||
|
||||
public TMCreativeTab () {
|
||||
public TMCreativeTab() {
|
||||
super(TaintedMagic.MOD_ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayAllReleventItems (final List list) {
|
||||
public void displayAllReleventItems(final List list) {
|
||||
super.displayAllReleventItems(list);
|
||||
|
||||
final ItemStack stack = new ItemStack(ConfigItems.itemWandCasting);
|
||||
@@ -54,7 +55,7 @@ public class TMCreativeTab extends CreativeTabs {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getIconItemStack () {
|
||||
public ItemStack getIconItemStack() {
|
||||
final ItemStack stack = new ItemStack(ConfigItems.itemWandCasting);
|
||||
final ItemWandCasting wand = (ItemWandCasting) stack.getItem();
|
||||
|
||||
@@ -65,7 +66,7 @@ public class TMCreativeTab extends CreativeTabs {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getTabIconItem () {
|
||||
public Item getTabIconItem() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,10 @@
|
||||
package taintedmagic.common;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
@@ -9,12 +14,11 @@ import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
@Mod (modid = TaintedMagic.MOD_ID, name = TaintedMagic.MOD_NAME, version = TaintedMagic.VERSION,
|
||||
@Mod(
|
||||
modid = TaintedMagic.MOD_ID,
|
||||
name = TaintedMagic.MOD_NAME,
|
||||
version = TaintedMagic.VERSION,
|
||||
dependencies = TaintedMagic.DEPENDENCIES)
|
||||
public class TaintedMagic {
|
||||
|
||||
@@ -23,11 +27,11 @@ public class TaintedMagic {
|
||||
public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
public static final String DEPENDENCIES = "required-after:Forge@[10.13.4.1448,);required-after:Thaumcraft@[4.2.3.5,)";
|
||||
|
||||
@Mod.Instance ("TaintedMagic")
|
||||
@Mod.Instance("TaintedMagic")
|
||||
public static TaintedMagic instance;
|
||||
|
||||
// Proxies
|
||||
@SidedProxy (clientSide = "taintedmagic.client.ClientProxy", serverSide = "taintedmagic.common.CommonProxy")
|
||||
@SidedProxy(clientSide = "taintedmagic.client.ClientProxy", serverSide = "taintedmagic.common.CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
|
||||
// TM creative tab
|
||||
@@ -41,21 +45,21 @@ public class TaintedMagic {
|
||||
|
||||
// Pre init
|
||||
@EventHandler
|
||||
public static void preInit (final FMLPreInitializationEvent event) {
|
||||
public static void preInit(final FMLPreInitializationEvent event) {
|
||||
logger.info("Pre-initializing Tainted Magic!");
|
||||
proxy.preInit(event);
|
||||
}
|
||||
|
||||
// Init
|
||||
@EventHandler
|
||||
public static void init (final FMLInitializationEvent event) {
|
||||
public static void init(final FMLInitializationEvent event) {
|
||||
logger.info("Initializing Tainted Magic!");
|
||||
proxy.init(event);
|
||||
}
|
||||
|
||||
// Post init
|
||||
@EventHandler
|
||||
public static void postInit (final FMLPostInitializationEvent event) {
|
||||
public static void postInit(final FMLPostInitializationEvent event) {
|
||||
logger.info("Post-initializing Tainted Magic!");
|
||||
proxy.postInit(event);
|
||||
logger.info("Loading complete!");
|
||||
|
||||
@@ -2,8 +2,6 @@ package taintedmagic.common.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -12,14 +10,17 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import taintedmagic.common.blocks.tile.TileLumos;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXSparkle;
|
||||
import thaumcraft.common.config.Config;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockLumos extends Block implements ITileEntityProvider {
|
||||
|
||||
public BlockLumos () {
|
||||
public BlockLumos() {
|
||||
super(Config.airyMaterial);
|
||||
setStepSound(new Block.SoundType("stone", -1, -1));
|
||||
setBlockName("BlockLumos");
|
||||
@@ -30,7 +31,7 @@ public class BlockLumos extends Block implements ITileEntityProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockDestroyedByPlayer (final World world, final int x, final int y, final int z, final int meta) {
|
||||
public void onBlockDestroyedByPlayer(final World world, final int x, final int y, final int z, final int meta) {
|
||||
super.onBlockDestroyedByPlayer(world, x, y, z, meta);
|
||||
|
||||
world.playSound(x, y, z, "thaumcraft:ice", 0.3F, 1.1F + world.rand.nextFloat() * 0.1F, true);
|
||||
@@ -42,10 +43,16 @@ public class BlockLumos extends Block implements ITileEntityProvider {
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
void spawnBreakParticles (final World world, final double x, final double y, final double z) {
|
||||
final FXSparkle fx = new FXSparkle(world, x + world.rand.nextFloat(), y + world.rand.nextFloat(),
|
||||
z + world.rand.nextFloat(), 1.75F, 6, 3 + world.rand.nextInt(3));
|
||||
@SideOnly(Side.CLIENT)
|
||||
void spawnBreakParticles(final World world, final double x, final double y, final double z) {
|
||||
final FXSparkle fx = new FXSparkle(
|
||||
world,
|
||||
x + world.rand.nextFloat(),
|
||||
y + world.rand.nextFloat(),
|
||||
z + world.rand.nextFloat(),
|
||||
1.75F,
|
||||
6,
|
||||
3 + world.rand.nextInt(3));
|
||||
fx.motionX += world.rand.nextGaussian() * 0.1D;
|
||||
fx.motionY += world.rand.nextGaussian() * 0.1D;
|
||||
fx.motionZ += world.rand.nextGaussian() * 0.1D;
|
||||
@@ -54,57 +61,58 @@ public class BlockLumos extends Block implements ITileEntityProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool (final World world, final int x, final int y, final int z) {
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(final World world, final int x, final int y, final int z) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType () {
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSideSolid (final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection side) {
|
||||
public boolean isSideSolid(final IBlockAccess world, final int x, final int y, final int z,
|
||||
final ForgeDirection side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlockNormalCube () {
|
||||
public boolean isBlockNormalCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube () {
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReplaceable (final IBlockAccess world, final int x, final int y, final int z) {
|
||||
public boolean isReplaceable(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeReplacedByLeaves (final IBlockAccess world, final int x, final int y, final int z) {
|
||||
public boolean canBeReplacedByLeaves(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock () {
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped (final int a, final Random random, final int b) {
|
||||
public Item getItemDropped(final int a, final Random random, final int b) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItem (final World world, final int x, final int y, final int z) {
|
||||
public Item getItem(final World world, final int x, final int y, final int z) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity (final World world, final int m) {
|
||||
public TileEntity createNewTileEntity(final World world, final int m) {
|
||||
return new TileLumos();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package taintedmagic.common.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.block.BlockBush;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -18,13 +17,15 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.BlockRegistry;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class BlockNightshadeBush extends BlockBush {
|
||||
|
||||
public BlockNightshadeBush () {
|
||||
public BlockNightshadeBush() {
|
||||
super(Material.plants);
|
||||
setBlockName("BlockNightshadeBush");
|
||||
setBlockTextureName("taintedmagic:BlockNightshadeBush");
|
||||
@@ -34,17 +35,18 @@ public class BlockNightshadeBush extends BlockBush {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped (final int a, final Random random, final int b) {
|
||||
public Item getItemDropped(final int a, final Random random, final int b) {
|
||||
return ItemRegistry.ItemNightshadeBerries;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped (final Random random) {
|
||||
public int quantityDropped(final Random random) {
|
||||
return 1 + random.nextInt(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock (final World world, final int x, final int y, final int z, final Entity entity) {
|
||||
public void onEntityCollidedWithBlock(final World world, final int x, final int y, final int z,
|
||||
final Entity entity) {
|
||||
super.onEntityCollidedWithBlock(world, x, y, z, entity);
|
||||
|
||||
if (entity instanceof EntityLivingBase) {
|
||||
@@ -54,18 +56,21 @@ public class BlockNightshadeBush extends BlockBush {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability (final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z,
|
||||
final ForgeDirection face) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed (final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z,
|
||||
final ForgeDirection face) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreak (final BlockEvent.HarvestDropsEvent event) {
|
||||
if (event.block instanceof BlockNightshadeBush && event.harvester != null && event.harvester.getHeldItem() != null
|
||||
public void onBreak(final BlockEvent.HarvestDropsEvent event) {
|
||||
if (event.block instanceof BlockNightshadeBush && event.harvester != null
|
||||
&& event.harvester.getHeldItem() != null
|
||||
&& event.harvester.getHeldItem().getItem() instanceof ItemShears) {
|
||||
event.drops.clear();
|
||||
event.drops.add(new ItemStack(BlockRegistry.BlockNightshadeBush, 1, 0));
|
||||
|
||||
@@ -3,8 +3,6 @@ package taintedmagic.common.blocks;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -18,8 +16,11 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.BlockRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockWarpwoodLeaves extends Block implements IShearable {
|
||||
|
||||
@@ -27,7 +28,7 @@ public class BlockWarpwoodLeaves extends Block implements IShearable {
|
||||
private IIcon opaqueIcon;
|
||||
private IIcon transparentIcon;
|
||||
|
||||
public BlockWarpwoodLeaves () {
|
||||
public BlockWarpwoodLeaves() {
|
||||
super(Material.leaves);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setLightOpacity(0);
|
||||
@@ -37,30 +38,32 @@ public class BlockWarpwoodLeaves extends Block implements IShearable {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public boolean shouldSideBeRendered (final IBlockAccess world, final int x, final int y, final int z, final int side) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(final IBlockAccess world, final int x, final int y, final int z,
|
||||
final int side) {
|
||||
return !Blocks.leaves.isOpaqueCube() || super.shouldSideBeRendered(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube () {
|
||||
public boolean isOpaqueCube() {
|
||||
return Blocks.leaves.isOpaqueCube();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon (final int side, final int meta) {
|
||||
public IIcon getIcon(final int side, final int meta) {
|
||||
return !Blocks.leaves.isOpaqueCube() ? transparentIcon : opaqueIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerBlockIcons (final IIconRegister ir) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(final IIconRegister ir) {
|
||||
opaqueIcon = ir.registerIcon("taintedmagic:BlockWarpwoodLeaves_opaque");
|
||||
transparentIcon = ir.registerIcon("taintedmagic:BlockWarpwoodLeaves_transparent");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock (final World world, final int x, final int y, final int z, final Block block, final int meta) {
|
||||
public void breakBlock(final World world, final int x, final int y, final int z, final Block block,
|
||||
final int meta) {
|
||||
final byte dist = 1;
|
||||
final int off = dist + 1;
|
||||
|
||||
@@ -81,11 +84,11 @@ public class BlockWarpwoodLeaves extends Block implements IShearable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick (final World world, final int x, final int y, final int z, final Random random) {
|
||||
public void updateTick(final World world, final int x, final int y, final int z, final Random random) {
|
||||
if (!world.isRemote) {
|
||||
final int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if ( (meta & 0x8) != 0 && (meta & 0x4) == 0) {
|
||||
if ((meta & 0x8) != 0 && (meta & 0x4) == 0) {
|
||||
final byte pos = 4;
|
||||
final int off = pos + 1;
|
||||
final byte dist = 32;
|
||||
@@ -103,13 +106,11 @@ public class BlockWarpwoodLeaves extends Block implements IShearable {
|
||||
final Block block = world.getBlock(x + i, y + j, z + k);
|
||||
|
||||
if (block != null && block.canSustainLeaves(world, x + i, y + j, z + k)) {
|
||||
adjacentTreeBlocks[ (i + half) * dist2 + (j + half) * dist + k + half] = 0;
|
||||
}
|
||||
else if (block != null && block.isLeaves(world, x + i, y + j, z + k)) {
|
||||
adjacentTreeBlocks[ (i + half) * dist2 + (j + half) * dist + k + half] = -2;
|
||||
}
|
||||
else {
|
||||
adjacentTreeBlocks[ (i + half) * dist2 + (j + half) * dist + k + half] = -1;
|
||||
adjacentTreeBlocks[(i + half) * dist2 + (j + half) * dist + k + half] = 0;
|
||||
} else if (block != null && block.isLeaves(world, x + i, y + j, z + k)) {
|
||||
adjacentTreeBlocks[(i + half) * dist2 + (j + half) * dist + k + half] = -2;
|
||||
} else {
|
||||
adjacentTreeBlocks[(i + half) * dist2 + (j + half) * dist + k + half] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -118,33 +119,40 @@ public class BlockWarpwoodLeaves extends Block implements IShearable {
|
||||
for (int j = -pos; j <= pos; j++) {
|
||||
for (int k = -pos; k <= pos; k++) {
|
||||
for (int l = -pos; l <= pos; l++) {
|
||||
if (adjacentTreeBlocks[ (j + half) * dist2 + (k + half) * dist + l + half] != i - 1) {
|
||||
if (adjacentTreeBlocks[(j + half) * dist2 + (k + half) * dist + l + half]
|
||||
!= i - 1) {
|
||||
continue;
|
||||
}
|
||||
if (adjacentTreeBlocks[ (j + half - 1) * dist2 + (k + half) * dist + l + half] == -2) {
|
||||
adjacentTreeBlocks[ (j + half - 1) * dist2 + (k + half) * dist + l + half] = i;
|
||||
if (adjacentTreeBlocks[(j + half - 1) * dist2 + (k + half) * dist + l + half]
|
||||
== -2) {
|
||||
adjacentTreeBlocks[(j + half - 1) * dist2 + (k + half) * dist + l + half] = i;
|
||||
}
|
||||
|
||||
if (adjacentTreeBlocks[ (j + half + 1) * dist2 + (k + half) * dist + l + half] == -2) {
|
||||
adjacentTreeBlocks[ (j + half + 1) * dist2 + (k + half) * dist + l + half] = i;
|
||||
if (adjacentTreeBlocks[(j + half + 1) * dist2 + (k + half) * dist + l + half]
|
||||
== -2) {
|
||||
adjacentTreeBlocks[(j + half + 1) * dist2 + (k + half) * dist + l + half] = i;
|
||||
}
|
||||
|
||||
if (adjacentTreeBlocks[ (j + half) * dist2 + (k + half - 1) * dist + l + half] == -2) {
|
||||
adjacentTreeBlocks[ (j + half) * dist2 + (k + half - 1) * dist + l + half] = i;
|
||||
if (adjacentTreeBlocks[(j + half) * dist2 + (k + half - 1) * dist + l + half]
|
||||
== -2) {
|
||||
adjacentTreeBlocks[(j + half) * dist2 + (k + half - 1) * dist + l + half] = i;
|
||||
}
|
||||
|
||||
if (adjacentTreeBlocks[ (j + half) * dist2 + (k + half + 1) * dist + l + half] == -2) {
|
||||
adjacentTreeBlocks[ (j + half) * dist2 + (k + half + 1) * dist + l + half] = i;
|
||||
if (adjacentTreeBlocks[(j + half) * dist2 + (k + half + 1) * dist + l + half]
|
||||
== -2) {
|
||||
adjacentTreeBlocks[(j + half) * dist2 + (k + half + 1) * dist + l + half] = i;
|
||||
}
|
||||
|
||||
if (adjacentTreeBlocks[ (j + half) * dist2 + (k + half) * dist + l + half - 1] == -2) {
|
||||
adjacentTreeBlocks[ (j + half) * dist2 + (k + half) * dist + l + half - 1] = i;
|
||||
if (adjacentTreeBlocks[(j + half) * dist2 + (k + half) * dist + l + half - 1]
|
||||
== -2) {
|
||||
adjacentTreeBlocks[(j + half) * dist2 + (k + half) * dist + l + half - 1] = i;
|
||||
}
|
||||
|
||||
if (adjacentTreeBlocks[ (j + half) * dist2 + (k + half) * dist + l + half + 1] != -2) {
|
||||
if (adjacentTreeBlocks[(j + half) * dist2 + (k + half) * dist + l + half + 1]
|
||||
!= -2) {
|
||||
continue;
|
||||
}
|
||||
adjacentTreeBlocks[ (j + half) * dist2 + (k + half) * dist + l + half + 1] = i;
|
||||
adjacentTreeBlocks[(j + half) * dist2 + (k + half) * dist + l + half + 1] = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -155,91 +163,91 @@ public class BlockWarpwoodLeaves extends Block implements IShearable {
|
||||
|
||||
if (adj >= 0) {
|
||||
world.setBlock(x, y, z, this, meta & 0xFFFFFFF7, 3);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
removeLeaves(world, x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void removeLeaves (final World world, final int x, final int y, final int z) {
|
||||
private void removeLeaves(final World world, final int x, final int y, final int z) {
|
||||
dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance (final World world, final int x, final int y, final int z, final int m, final float f,
|
||||
final int i) {
|
||||
public void dropBlockAsItemWithChance(final World world, final int x, final int y, final int z, final int m,
|
||||
final float f, final int i) {
|
||||
if (!world.isRemote && (m & 0x8) != 0 && (m & 0x4) == 0) {
|
||||
if ( (m & 0x1) == 0 && world.rand.nextInt(50) == 0) {
|
||||
if ((m & 0x1) == 0 && world.rand.nextInt(50) == 0) {
|
||||
dropBlockAsItem(world, x, y, z, new ItemStack(BlockRegistry.BlockWarpwoodSapling));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock (final World world, final EntityPlayer player, final int x, final int y, final int z,
|
||||
public void harvestBlock(final World world, final EntityPlayer player, final int x, final int y, final int z,
|
||||
final int i) {
|
||||
super.harvestBlock(world, player, x, y, z, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped (final int i) {
|
||||
public int damageDropped(final int i) {
|
||||
return i & 0x1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped (final Random random) {
|
||||
public int quantityDropped(final Random random) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped (final int i, final Random random, final int i2) {
|
||||
public Item getItemDropped(final int i, final Random random, final int i2) {
|
||||
return Item.getItemById(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLeaves (final IBlockAccess world, final int x, final int y, final int z) {
|
||||
public boolean isLeaves(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beginLeavesDecay (final World world, final int x, final int y, final int z) {
|
||||
public void beginLeavesDecay(final World world, final int x, final int y, final int z) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 0x8, 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public int getBlockColor () {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBlockColor() {
|
||||
return 0xFFFFFF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock (final MovingObjectPosition mop, final World world, final int x, final int y, final int z) {
|
||||
public ItemStack getPickBlock(final MovingObjectPosition mop, final World world, final int x, final int y,
|
||||
final int z) {
|
||||
final int m = world.getBlockMetadata(x, y, z);
|
||||
return new ItemStack(this, 1, m & 0x1);
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int getRenderColor (final int m) {
|
||||
public int getRenderColor(final int m) {
|
||||
return 0xFFFFFF;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public int colorMultiplier (final IBlockAccess world, final int x, final int y, final int z) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
return 0xFFFFFF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShearable (final ItemStack stack, final IBlockAccess world, final int x, final int y, final int z) {
|
||||
public boolean isShearable(final ItemStack stack, final IBlockAccess world, final int x, final int y, final int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> onSheared (final ItemStack stack, final IBlockAccess world, final int x, final int y,
|
||||
public ArrayList<ItemStack> onSheared(final ItemStack stack, final IBlockAccess world, final int x, final int y,
|
||||
final int z, final int fortune) {
|
||||
final ArrayList drops = new ArrayList();
|
||||
drops.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 0x3));
|
||||
@@ -247,12 +255,14 @@ public class BlockWarpwoodLeaves extends Block implements IShearable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability (final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z,
|
||||
final ForgeDirection face) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed (final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z,
|
||||
final ForgeDirection face) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,6 @@ package taintedmagic.common.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockRotatedPillar;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.particle.EffectRenderer;
|
||||
@@ -13,10 +11,13 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXWisp;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockWarpwoodLog extends BlockRotatedPillar {
|
||||
|
||||
@@ -24,7 +25,7 @@ public class BlockWarpwoodLog extends BlockRotatedPillar {
|
||||
private IIcon side;
|
||||
private IIcon knot;
|
||||
|
||||
public BlockWarpwoodLog () {
|
||||
public BlockWarpwoodLog() {
|
||||
super(Material.wood);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setHardness(2.5F);
|
||||
@@ -33,48 +34,46 @@ public class BlockWarpwoodLog extends BlockRotatedPillar {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
protected IIcon getTopIcon (final int meta) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
protected IIcon getTopIcon(final int meta) {
|
||||
return top;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
protected IIcon getSideIcon (final int meta) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
protected IIcon getSideIcon(final int meta) {
|
||||
return meta == 2 ? knot : side;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerBlockIcons (final IIconRegister ir) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(final IIconRegister ir) {
|
||||
side = ir.registerIcon("taintedmagic:BlockWarpwoodLog_side");
|
||||
top = ir.registerIcon("taintedmagic:BlockWarpwoodLog_top");
|
||||
knot = ir.registerIcon("taintedmagic:BlockWarpwoodLog_knot");
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBlockHardness (final World world, final int x, final int y, final int z) {
|
||||
if (world.getBlockMetadata(x, y, z) == 2)
|
||||
return 25.0F;
|
||||
public float getBlockHardness(final World world, final int x, final int y, final int z) {
|
||||
if (world.getBlockMetadata(x, y, z) == 2) return 25.0F;
|
||||
return super.getBlockHardness(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops (final World world, final int x, final int y, final int z, final int meta,
|
||||
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int meta,
|
||||
final int fortune) {
|
||||
final ArrayList<ItemStack> drops = new ArrayList<>();
|
||||
|
||||
if (meta == 2) {
|
||||
drops.add(new ItemStack(ConfigItems.itemResource, world.rand.nextInt(5) + 1, 17));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
drops.add(new ItemStack(this, 1, 0));
|
||||
}
|
||||
return drops;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addDestroyEffects (final World world, final int x, final int y, final int z, final int meta,
|
||||
public boolean addDestroyEffects(final World world, final int x, final int y, final int z, final int meta,
|
||||
final EffectRenderer ef) {
|
||||
if (meta == 2) {
|
||||
if (world.isRemote) {
|
||||
@@ -85,12 +84,16 @@ public class BlockWarpwoodLog extends BlockRotatedPillar {
|
||||
return super.addDestroyEffects(world, x, y, z, meta, ef);
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
private void particles (final World world, final int x, final int y, final int z) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void particles(final World world, final int x, final int y, final int z) {
|
||||
for (int i = 0; i < 15; i++) {
|
||||
final FXWisp fx = new FXWisp(world, x + 0.5D + (Math.random() - Math.random()) * 0.5D,
|
||||
y + 0.5D + (Math.random() - Math.random()) * 0.5D, z + 0.5D + (Math.random() - Math.random()) * 0.5D,
|
||||
0.25F + (float) Math.random() * 0.25F, 5);
|
||||
final FXWisp fx = new FXWisp(
|
||||
world,
|
||||
x + 0.5D + (Math.random() - Math.random()) * 0.5D,
|
||||
y + 0.5D + (Math.random() - Math.random()) * 0.5D,
|
||||
z + 0.5D + (Math.random() - Math.random()) * 0.5D,
|
||||
0.25F + (float) Math.random() * 0.25F,
|
||||
5);
|
||||
|
||||
fx.setGravity(0.01F);
|
||||
|
||||
@@ -102,22 +105,24 @@ public class BlockWarpwoodLog extends BlockRotatedPillar {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSustainLeaves (final IBlockAccess world, final int x, final int y, final int z) {
|
||||
public boolean canSustainLeaves(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWood (final IBlockAccess world, final int x, final int y, final int z) {
|
||||
public boolean isWood(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability (final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z,
|
||||
final ForgeDirection face) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed (final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z,
|
||||
final ForgeDirection face) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,12 @@ package taintedmagic.common.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
|
||||
public class BlockWarpwoodPlanks extends Block {
|
||||
|
||||
public BlockWarpwoodPlanks () {
|
||||
public BlockWarpwoodPlanks() {
|
||||
super(Material.wood);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setBlockName("BlockWarpwoodPlanks");
|
||||
|
||||
@@ -3,8 +3,6 @@ package taintedmagic.common.blocks;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockSapling;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -12,19 +10,22 @@ 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 taintedmagic.common.world.WorldGenWarpwoodTree;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockWarpwoodSapling extends BlockSapling {
|
||||
|
||||
public BlockWarpwoodSapling () {
|
||||
public BlockWarpwoodSapling() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setBlockName("BlockWarpwoodSapling");
|
||||
setStepSound(soundTypeGrass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_149878_d (final World world, final int x, final int y, final int z, final Random random) {
|
||||
public void func_149878_d(final World world, final int x, final int y, final int z, final Random random) {
|
||||
if (!world.isRemote) {
|
||||
final int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
@@ -39,25 +40,25 @@ public class BlockWarpwoodSapling extends BlockSapling {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void getSubBlocks (final Item item, final CreativeTabs tab, final List list) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) {
|
||||
list.add(new ItemStack(this, 1, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped (final int i, final Random random, final int i2) {
|
||||
public Item getItemDropped(final int i, final Random random, final int i2) {
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerBlockIcons (final IIconRegister ir) {
|
||||
public void registerBlockIcons(final IIconRegister ir) {
|
||||
blockIcon = ir.registerIcon("taintedmagic:BlockWarpwoodSapling");
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public IIcon getIcon (final int side, final int meta) {
|
||||
public IIcon getIcon(final int side, final int meta) {
|
||||
return blockIcon;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,39 @@
|
||||
package taintedmagic.common.blocks.tile;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import taintedmagic.common.blocks.BlockLumos;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXSparkle;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class TileLumos extends TileEntity {
|
||||
|
||||
@Override
|
||||
public boolean canUpdate () {
|
||||
public boolean canUpdate() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity () {
|
||||
public void updateEntity() {
|
||||
if (getBlockType() instanceof BlockLumos && worldObj.rand.nextInt(15) == 0 && worldObj.isRemote) {
|
||||
spawnParticles();
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
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));
|
||||
@SideOnly(Side.CLIENT)
|
||||
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));
|
||||
fx.slowdown = true;
|
||||
fx.setGravity(-0.5F);
|
||||
ParticleEngine.instance.addEffect(worldObj, fx);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.common.entities.projectile.EntityEldritchOrb;
|
||||
|
||||
public class EntityDarkMatter extends EntityEldritchOrb {
|
||||
@@ -17,11 +18,11 @@ public class EntityDarkMatter extends EntityEldritchOrb {
|
||||
private int enlarge;
|
||||
private boolean corrosive;
|
||||
|
||||
public EntityDarkMatter (final World world) {
|
||||
public EntityDarkMatter(final World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityDarkMatter (final World world, final EntityLivingBase entity, final float dmg, final int enlarge,
|
||||
public EntityDarkMatter(final World world, final EntityLivingBase entity, final float dmg, final int enlarge,
|
||||
final boolean corrosive) {
|
||||
super(world, entity);
|
||||
this.dmg = dmg;
|
||||
@@ -30,16 +31,16 @@ public class EntityDarkMatter extends EntityEldritchOrb {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRenderInPass (final int pass) {
|
||||
public boolean shouldRenderInPass(final int pass) {
|
||||
return pass == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact (final MovingObjectPosition mop) {
|
||||
protected void onImpact(final MovingObjectPosition mop) {
|
||||
if (!worldObj.isRemote && getThrower() != null) {
|
||||
final double expand = 1.5D + enlarge * 0.5D;
|
||||
final List<Entity> entities =
|
||||
worldObj.getEntitiesWithinAABBExcludingEntity(getThrower(), boundingBox.expand(expand, expand, expand));
|
||||
final List<Entity> entities = worldObj
|
||||
.getEntitiesWithinAABBExcludingEntity(getThrower(), boundingBox.expand(expand, expand, expand));
|
||||
|
||||
for (final Entity e : entities) {
|
||||
if (e instanceof EntityLivingBase) {
|
||||
@@ -57,4 +58,4 @@ public class EntityDarkMatter extends EntityEldritchOrb {
|
||||
}
|
||||
setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,6 @@ package taintedmagic.common.entities;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
@@ -14,7 +11,11 @@ import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class EntityDiffusion extends EntityThrowable {
|
||||
|
||||
@@ -23,11 +24,11 @@ public class EntityDiffusion extends EntityThrowable {
|
||||
public boolean corrosive = false;
|
||||
public float dmg = 0.0F;
|
||||
|
||||
public EntityDiffusion (final World world) {
|
||||
public EntityDiffusion(final World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityDiffusion (final World world, final EntityLivingBase entity, final float scatter, final float dmg,
|
||||
public EntityDiffusion(final World world, final EntityLivingBase entity, final float scatter, final float dmg,
|
||||
final boolean corrosive) {
|
||||
super(world, entity);
|
||||
this.corrosive = corrosive;
|
||||
@@ -36,38 +37,47 @@ public class EntityDiffusion extends EntityThrowable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRenderInPass (final int pass) {
|
||||
public boolean shouldRenderInPass(final int pass) {
|
||||
return pass == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getGravityVelocity () {
|
||||
protected float getGravityVelocity() {
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float func_70182_d () {
|
||||
protected float func_70182_d() {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleHealthUpdate (final byte b) {
|
||||
public void handleHealthUpdate(final byte b) {
|
||||
if (b == 16) {
|
||||
if (worldObj.isRemote) {
|
||||
final float fx = (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.3F;
|
||||
final float fy = (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.3F;
|
||||
final float fz = (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.3F;
|
||||
Thaumcraft.proxy.wispFX3(worldObj, posX + fx, posY + fy, posZ + fz, posX + fx * 8.0F, posY + fy * 8.0F,
|
||||
posZ + fz * 8.0F, 0.3F, 5, true, 0.02F);
|
||||
Thaumcraft.proxy.wispFX3(
|
||||
worldObj,
|
||||
posX + fx,
|
||||
posY + fy,
|
||||
posZ + fz,
|
||||
posX + fx * 8.0F,
|
||||
posY + fy * 8.0F,
|
||||
posZ + fz * 8.0F,
|
||||
0.3F,
|
||||
5,
|
||||
true,
|
||||
0.02F);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
super.handleHealthUpdate(b);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate () {
|
||||
public void onUpdate() {
|
||||
if (ticksExisted > 20) {
|
||||
setDead();
|
||||
}
|
||||
@@ -84,19 +94,19 @@ public class EntityDiffusion extends EntityThrowable {
|
||||
super.onUpdate();
|
||||
}
|
||||
|
||||
public void writeSpawnData (final ByteBuf buf) {
|
||||
public void writeSpawnData(final ByteBuf buf) {
|
||||
buf.writeFloat(dmg);
|
||||
}
|
||||
|
||||
public void readSpawnData (final ByteBuf buf) {
|
||||
public void readSpawnData(final ByteBuf buf) {
|
||||
dmg = buf.readFloat();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact (final MovingObjectPosition mop) {
|
||||
protected void onImpact(final MovingObjectPosition mop) {
|
||||
if (!worldObj.isRemote && getThrower() != null) {
|
||||
final List<Entity> entities =
|
||||
worldObj.getEntitiesWithinAABBExcludingEntity(getThrower(), boundingBox.expand(1.0D, 1.0D, 1.0D));
|
||||
final List<Entity> entities = worldObj
|
||||
.getEntitiesWithinAABBExcludingEntity(getThrower(), boundingBox.expand(1.0D, 1.0D, 1.0D));
|
||||
|
||||
for (final Entity e : entities) {
|
||||
if (e instanceof EntityLivingBase) {
|
||||
@@ -116,35 +126,35 @@ public class EntityDiffusion extends EntityThrowable {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canTriggerWalking () {
|
||||
protected boolean canTriggerWalking() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public float getShadowSize () {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public float getShadowSize() {
|
||||
return 0.1F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeEntityToNBT (final NBTTagCompound tag) {
|
||||
public void writeEntityToNBT(final NBTTagCompound tag) {
|
||||
super.writeEntityToNBT(tag);
|
||||
tag.setFloat(TAG_DAMAGE, dmg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readEntityFromNBT (final NBTTagCompound tag) {
|
||||
public void readEntityFromNBT(final NBTTagCompound tag) {
|
||||
super.readEntityFromNBT(tag);
|
||||
dmg = tag.getInteger(TAG_DAMAGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeCollidedWith () {
|
||||
public boolean canBeCollidedWith() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityFrom (final DamageSource dmg, final float f) {
|
||||
public boolean attackEntityFrom(final DamageSource dmg, final float f) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -4,10 +4,6 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -18,8 +14,13 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.lib.utils.EntityUtils;
|
||||
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
/**
|
||||
* This class is based off of EntityHomingShard.class created by <Azanor> as part of Thaumcraft 5
|
||||
@@ -30,14 +31,14 @@ public class EntityHomingShard extends EntityThrowable implements IEntityAdditio
|
||||
private boolean persistent;
|
||||
private EntityLivingBase target;
|
||||
|
||||
private static final Material[] MATS =
|
||||
{ Material.plants, Material.air, Material.leaves, Material.portal, Material.vine, Material.web };
|
||||
private static final Material[] MATS = { Material.plants, Material.air, Material.leaves, Material.portal,
|
||||
Material.vine, Material.web };
|
||||
|
||||
public EntityHomingShard (final World world) {
|
||||
public EntityHomingShard(final World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityHomingShard (final World world, final EntityLivingBase thrower, final EntityLivingBase target,
|
||||
public EntityHomingShard(final World world, final EntityLivingBase thrower, final EntityLivingBase target,
|
||||
final int strength, final boolean persistent) {
|
||||
super(world, thrower);
|
||||
this.target = target;
|
||||
@@ -45,8 +46,12 @@ public class EntityHomingShard extends EntityThrowable implements IEntityAdditio
|
||||
this.persistent = persistent;
|
||||
setStrength(strength);
|
||||
final Vec3 vec = thrower.getLookVec();
|
||||
setLocationAndAngles(thrower.posX + vec.xCoord / 2.0D, thrower.posY + thrower.getEyeHeight() + vec.yCoord / 2.0D,
|
||||
thrower.posZ + vec.zCoord / 2.0D, thrower.rotationYaw, thrower.rotationPitch);
|
||||
setLocationAndAngles(
|
||||
thrower.posX + vec.xCoord / 2.0D,
|
||||
thrower.posY + thrower.getEyeHeight() + vec.yCoord / 2.0D,
|
||||
thrower.posZ + vec.zCoord / 2.0D,
|
||||
thrower.rotationYaw,
|
||||
thrower.rotationPitch);
|
||||
final float f = 0.5F;
|
||||
final float ry = thrower.rotationYaw + (rand.nextFloat() - rand.nextFloat()) * 60.0F;
|
||||
final float rp = thrower.rotationPitch + (rand.nextFloat() - rand.nextFloat()) * 60.0F;
|
||||
@@ -56,31 +61,31 @@ public class EntityHomingShard extends EntityThrowable implements IEntityAdditio
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRenderInPass (final int pass) {
|
||||
public boolean shouldRenderInPass(final int pass) {
|
||||
return pass == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void entityInit () {
|
||||
public void entityInit() {
|
||||
super.entityInit();
|
||||
dataWatcher.addObject(17, (byte) 0);
|
||||
}
|
||||
|
||||
public void setStrength (final int strength) {
|
||||
public void setStrength(final int strength) {
|
||||
dataWatcher.updateObject(17, Byte.valueOf((byte) strength));
|
||||
}
|
||||
|
||||
public int getStrength () {
|
||||
public int getStrength() {
|
||||
return dataWatcher.getWatchableObjectByte(17);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getGravityVelocity () {
|
||||
protected float getGravityVelocity() {
|
||||
return 0.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeSpawnData (final ByteBuf buf) {
|
||||
public void writeSpawnData(final ByteBuf buf) {
|
||||
int id = -1;
|
||||
if (target != null) {
|
||||
id = target.getEntityId();
|
||||
@@ -89,7 +94,7 @@ public class EntityHomingShard extends EntityThrowable implements IEntityAdditio
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readSpawnData (final ByteBuf buf) {
|
||||
public void readSpawnData(final ByteBuf buf) {
|
||||
final int id = buf.readInt();
|
||||
if (id >= 0) {
|
||||
target = (EntityLivingBase) worldObj.getEntityByID(id);
|
||||
@@ -97,12 +102,17 @@ public class EntityHomingShard extends EntityThrowable implements IEntityAdditio
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact (final MovingObjectPosition mop) {
|
||||
protected void onImpact(final MovingObjectPosition mop) {
|
||||
if (!worldObj.isRemote && mop.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY
|
||||
&& (getThrower() == null || getThrower() != null && mop.entityHit != getThrower())) {
|
||||
mop.entityHit.attackEntityFrom(DamageSource.causeIndirectMagicDamage(this, getThrower()),
|
||||
mop.entityHit.attackEntityFrom(
|
||||
DamageSource.causeIndirectMagicDamage(this, getThrower()),
|
||||
2.0F + getStrength() * 0.5F);
|
||||
worldObj.playSoundAtEntity(this, "thaumcraft:zap", 1.0F, 1.0F + (rand.nextFloat() - rand.nextFloat()) * 0.2F);
|
||||
worldObj.playSoundAtEntity(
|
||||
this,
|
||||
"thaumcraft:zap",
|
||||
1.0F,
|
||||
1.0F + (rand.nextFloat() - rand.nextFloat()) * 0.2F);
|
||||
worldObj.setEntityState(this, (byte) 16);
|
||||
setDead();
|
||||
}
|
||||
@@ -122,31 +132,34 @@ public class EntityHomingShard extends EntityThrowable implements IEntityAdditio
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void handleHealthUpdate (final byte b) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void handleHealthUpdate(final byte b) {
|
||||
if (b == 16) {
|
||||
Thaumcraft.proxy.burst(worldObj, posX, posY, posZ, 0.3F);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
super.handleHealthUpdate(b);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate () {
|
||||
public void onUpdate() {
|
||||
final double motion = Math.abs(motionX) + Math.abs(motionY) + Math.abs(motionZ);
|
||||
if (motion > 0.0D && worldObj.isRemote) {
|
||||
Thaumcraft.proxy.sparkle((float) posX + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.25F,
|
||||
Thaumcraft.proxy.sparkle(
|
||||
(float) posX + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.25F,
|
||||
(float) posY + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.25F,
|
||||
(float) posZ + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.25F, 0.5F, 0, 0.0F);
|
||||
(float) posZ + (worldObj.rand.nextFloat() - worldObj.rand.nextFloat()) * 0.25F,
|
||||
0.5F,
|
||||
0,
|
||||
0.0F);
|
||||
}
|
||||
|
||||
super.onUpdate();
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
if (persistent && (target == null || target.isDead || target.getDistanceSqToEntity(this) > 1250.0D)) {
|
||||
final ArrayList<Entity> ents =
|
||||
EntityUtils.getEntitiesInRange(worldObj, posX, posY, posZ, this, targetClass, 16.0D);
|
||||
final ArrayList<Entity> ents = EntityUtils
|
||||
.getEntitiesInRange(worldObj, posX, posY, posZ, this, targetClass, 16.0D);
|
||||
|
||||
for (final Entity entity : ents) {
|
||||
if (entity instanceof EntityLivingBase && !entity.isDead
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package taintedmagic.common.handler;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.api.wands.FocusUpgradeType;
|
||||
|
||||
@@ -19,45 +20,89 @@ public class ConfigHandler {
|
||||
public static int PERSISTENT_UPGRADE_ID = 67;
|
||||
public static int DIFFUSION_UPGRADE_ID = 68;
|
||||
|
||||
public static void initConfig () {
|
||||
public static void initConfig() {
|
||||
TaintedMagic.logger.info("Loading config...");
|
||||
|
||||
config.load();
|
||||
|
||||
NOTIFY_UPDATE = config.getBoolean("NOTIFY_UPDATE", "misc", true,
|
||||
NOTIFY_UPDATE = config.getBoolean(
|
||||
"NOTIFY_UPDATE",
|
||||
"misc",
|
||||
true,
|
||||
"Setting this to false will disable Tainted Magic update notifications.");
|
||||
|
||||
RESEARCH_TAGS = config.getBoolean("RESEARCH_TAGS", "research", true,
|
||||
RESEARCH_TAGS = config.getBoolean(
|
||||
"RESEARCH_TAGS",
|
||||
"research",
|
||||
true,
|
||||
"Setting this to false will disable the '[TM]' tag on Tainted Magic research items.");
|
||||
|
||||
CUSTOM_RESEARCH_TAB_BACK = config.getBoolean("CUSTOM_RESEARCH_TAB_BACK", "research", false,
|
||||
CUSTOM_RESEARCH_TAB_BACK = config.getBoolean(
|
||||
"CUSTOM_RESEARCH_TAB_BACK",
|
||||
"research",
|
||||
false,
|
||||
"Setting this to true will bring back the old Tainted Magic research tab background.");
|
||||
|
||||
MAGE_MACE_DMG_INC_BASE = config.getFloat("MAGE_MACE_DMG_INC_BASE", "wands_and_foci", 8.0F, 1.0F, 100.0F,
|
||||
MAGE_MACE_DMG_INC_BASE = config.getFloat(
|
||||
"MAGE_MACE_DMG_INC_BASE",
|
||||
"wands_and_foci",
|
||||
8.0F,
|
||||
1.0F,
|
||||
100.0F,
|
||||
"Defines the base amount of damage to increase wand / staff attack damage by "
|
||||
+ "when the Mage's Mace focus is equipped.");
|
||||
|
||||
WARP_WAND_REFRESH_BASE = config.getFloat("WARP_WAND_REFRESH_BASE", "wands_and_foci", 10000.0F, 100.0F, 100000.0F,
|
||||
WARP_WAND_REFRESH_BASE = config.getFloat(
|
||||
"WARP_WAND_REFRESH_BASE",
|
||||
"wands_and_foci",
|
||||
10000.0F,
|
||||
100.0F,
|
||||
100000.0F,
|
||||
"Defines the base refresh period in ticks for the Warpwood Wand. The delay period between vis refreshes "
|
||||
+ "is calculated by dividing this number by the amount of permanent warp the player has accumulated.");
|
||||
|
||||
/**
|
||||
* Focus upgrade IDs
|
||||
*/
|
||||
SANITY_UPGRADE_ID = config.getInt("SANITY_UPGRADE_ID", "wands_and_foci", 64, FocusUpgradeType.types.length + 1,
|
||||
Short.MAX_VALUE, "The ID for the Sanity focus upgrade.");
|
||||
SANITY_UPGRADE_ID = config.getInt(
|
||||
"SANITY_UPGRADE_ID",
|
||||
"wands_and_foci",
|
||||
64,
|
||||
FocusUpgradeType.types.length + 1,
|
||||
Short.MAX_VALUE,
|
||||
"The ID for the Sanity focus upgrade.");
|
||||
|
||||
ANTIBODY_UPGRADE_ID = config.getInt("ANTIBODY_UPGRADE_ID", "wands_and_foci", 65, FocusUpgradeType.types.length + 1,
|
||||
Short.MAX_VALUE, "The ID for the Antibody focus upgrade.");
|
||||
ANTIBODY_UPGRADE_ID = config.getInt(
|
||||
"ANTIBODY_UPGRADE_ID",
|
||||
"wands_and_foci",
|
||||
65,
|
||||
FocusUpgradeType.types.length + 1,
|
||||
Short.MAX_VALUE,
|
||||
"The ID for the Antibody focus upgrade.");
|
||||
|
||||
CORROSIVE_UPGRADE_ID = config.getInt("CORROSIVE_UPGRADE_ID", "wands_and_foci", 66, FocusUpgradeType.types.length + 1,
|
||||
Short.MAX_VALUE, "The ID for the Corrosive focus upgrade.");
|
||||
CORROSIVE_UPGRADE_ID = config.getInt(
|
||||
"CORROSIVE_UPGRADE_ID",
|
||||
"wands_and_foci",
|
||||
66,
|
||||
FocusUpgradeType.types.length + 1,
|
||||
Short.MAX_VALUE,
|
||||
"The ID for the Corrosive focus upgrade.");
|
||||
|
||||
PERSISTENT_UPGRADE_ID = config.getInt("PERSISTENT_UPGRADE_ID", "wands_and_foci", 67, FocusUpgradeType.types.length + 1,
|
||||
Short.MAX_VALUE, "The ID for the Persistent focus upgrade.");
|
||||
PERSISTENT_UPGRADE_ID = config.getInt(
|
||||
"PERSISTENT_UPGRADE_ID",
|
||||
"wands_and_foci",
|
||||
67,
|
||||
FocusUpgradeType.types.length + 1,
|
||||
Short.MAX_VALUE,
|
||||
"The ID for the Persistent focus upgrade.");
|
||||
|
||||
DIFFUSION_UPGRADE_ID = config.getInt("DIFFUSION_UPGRADE_ID", "wands_and_foci", 68, FocusUpgradeType.types.length + 1,
|
||||
Short.MAX_VALUE, "The ID for the Diffusion focus upgrade.");
|
||||
DIFFUSION_UPGRADE_ID = config.getInt(
|
||||
"DIFFUSION_UPGRADE_ID",
|
||||
"wands_and_foci",
|
||||
68,
|
||||
FocusUpgradeType.types.length + 1,
|
||||
Short.MAX_VALUE,
|
||||
"The ID for the Diffusion focus upgrade.");
|
||||
|
||||
config.save();
|
||||
}
|
||||
|
||||
@@ -2,10 +2,6 @@ package taintedmagic.common.handler;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import baubles.api.BaublesApi;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -22,6 +18,7 @@ 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;
|
||||
@@ -36,11 +33,15 @@ import thaumcraft.common.items.ItemEssence;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import thaumcraft.common.lib.network.PacketHandler;
|
||||
import thaumcraft.common.lib.network.playerdata.PacketResearchComplete;
|
||||
import baubles.api.BaublesApi;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
|
||||
|
||||
public class TMEventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void playerTick (final LivingEvent.LivingUpdateEvent event) {
|
||||
public void playerTick(final LivingEvent.LivingUpdateEvent event) {
|
||||
if (event.entity instanceof EntityPlayer) {
|
||||
final EntityPlayer player = (EntityPlayer) event.entity;
|
||||
|
||||
@@ -53,11 +54,13 @@ public class TMEventHandler {
|
||||
/**
|
||||
* Repair "Voidtouched" items
|
||||
*/
|
||||
public void repairItems (final EntityPlayer player) {
|
||||
public void repairItems(final EntityPlayer player) {
|
||||
for (int i = 0; i < player.inventory.getSizeInventory(); i++) {
|
||||
final ItemStack stack = player.inventory.getStackInSlot(i);
|
||||
if (!player.worldObj.isRemote && stack != null && stack.stackTagCompound != null
|
||||
&& stack.stackTagCompound.getBoolean("voidtouched") && stack.isItemDamaged())
|
||||
if (!player.worldObj.isRemote && stack != null
|
||||
&& stack.stackTagCompound != null
|
||||
&& stack.stackTagCompound.getBoolean("voidtouched")
|
||||
&& stack.isItemDamaged())
|
||||
if (player.ticksExisted % 20 == 0) {
|
||||
stack.setItemDamage(stack.getItemDamage() - 1);
|
||||
}
|
||||
@@ -67,12 +70,11 @@ public class TMEventHandler {
|
||||
private boolean hasNightVision = false;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* 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 applyNightVision (final EntityPlayer player) {
|
||||
if (player.worldObj.isRemote)
|
||||
return;
|
||||
public void applyNightVision(final EntityPlayer player) {
|
||||
if (player.worldObj.isRemote) return;
|
||||
|
||||
boolean lumos = false;
|
||||
|
||||
@@ -80,8 +82,7 @@ public class TMEventHandler {
|
||||
if (baub.getStackInSlot(1) != null && baub.getStackInSlot(1).getItem() instanceof ItemLumosRing
|
||||
|| baub.getStackInSlot(2) != null && baub.getStackInSlot(2).getItem() instanceof ItemLumosRing) {
|
||||
lumos = true;
|
||||
}
|
||||
else if (player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemWandCasting) {
|
||||
} else if (player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemWandCasting) {
|
||||
final ItemStack held = player.getHeldItem();
|
||||
final ItemWandCasting wand = (ItemWandCasting) held.getItem();
|
||||
|
||||
@@ -96,12 +97,10 @@ public class TMEventHandler {
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 260, -1));
|
||||
hasNightVision = true;
|
||||
}
|
||||
}
|
||||
else if (player.ticksExisted % 20 == 0) {
|
||||
} else if (player.ticksExisted % 20 == 0) {
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 260, -1));
|
||||
}
|
||||
}
|
||||
else if (hasNightVision) {
|
||||
} else if (hasNightVision) {
|
||||
player.removePotionEffect(Potion.nightVision.id);
|
||||
hasNightVision = false;
|
||||
}
|
||||
@@ -110,9 +109,8 @@ public class TMEventHandler {
|
||||
/*
|
||||
* Some hacky code to make the Mage's Mace work...
|
||||
*/
|
||||
public void modifyAttackDamage (final EntityPlayer player) {
|
||||
if (player.worldObj.isRemote)
|
||||
return;
|
||||
public void modifyAttackDamage(final EntityPlayer player) {
|
||||
if (player.worldObj.isRemote) return;
|
||||
|
||||
final IInventory inv = player.inventory;
|
||||
|
||||
@@ -128,8 +126,11 @@ public class TMEventHandler {
|
||||
tag.setString("AttributeName", SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName());
|
||||
|
||||
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);
|
||||
final AttributeModifier am = new AttributeModifier(
|
||||
uuid,
|
||||
"Weapon modifier",
|
||||
ConfigHandler.MAGE_MACE_DMG_INC_BASE + wand.getFocusPotency(stack),
|
||||
0);
|
||||
|
||||
tag.setString("Name", am.getName());
|
||||
tag.setDouble("Amount", am.getAmount());
|
||||
@@ -139,8 +140,7 @@ public class TMEventHandler {
|
||||
|
||||
tags.appendTag(tag);
|
||||
stack.stackTagCompound.setTag("AttributeModifiers", tags);
|
||||
}
|
||||
else if (wand.getRod(stack) instanceof WandRod) {
|
||||
} else if (wand.getRod(stack) instanceof WandRod) {
|
||||
if (!stack.hasTagCompound()) {
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
@@ -153,8 +153,11 @@ public class TMEventHandler {
|
||||
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 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());
|
||||
@@ -164,8 +167,7 @@ public class TMEventHandler {
|
||||
|
||||
tags.appendTag(tag);
|
||||
stack.stackTagCompound.setTag("AttributeModifiers", tags);
|
||||
}
|
||||
else if (wand.getRod(stack) instanceof StaffRod) {
|
||||
} else if (wand.getRod(stack) instanceof StaffRod) {
|
||||
final NBTTagList tags = new NBTTagList();
|
||||
final NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setString("AttributeName", SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName());
|
||||
@@ -187,7 +189,7 @@ public class TMEventHandler {
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void entityAttacked (final LivingAttackEvent event) {
|
||||
public void entityAttacked(final LivingAttackEvent event) {
|
||||
if (event.source.getEntity() instanceof EntityPlayer) {
|
||||
final EntityPlayer player = (EntityPlayer) event.source.getEntity();
|
||||
|
||||
@@ -200,9 +202,7 @@ public class TMEventHandler {
|
||||
final ItemFocusBasic focus = wand.getFocus(held);
|
||||
|
||||
if (focus != null && focus instanceof ItemFocusMageMace) {
|
||||
if (wand.consumeAllVis(held, player, focus.getVisCost(held), true, false)) {
|
||||
}
|
||||
else {
|
||||
if (wand.consumeAllVis(held, player, focus.getVisCost(held), true, false)) {} else {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
@@ -232,7 +232,7 @@ public class TMEventHandler {
|
||||
* Update notifications
|
||||
*/
|
||||
@SubscribeEvent
|
||||
public void playerLoggedIn (final PlayerEvent.PlayerLoggedInEvent event) {
|
||||
public void playerLoggedIn(final PlayerEvent.PlayerLoggedInEvent event) {
|
||||
if (UpdateHandler.message != null) {
|
||||
event.player.addChatMessage(new ChatComponentText(UpdateHandler.message));
|
||||
}
|
||||
@@ -242,7 +242,7 @@ public class TMEventHandler {
|
||||
* Detect when the player crafts a Shard of Creation
|
||||
*/
|
||||
@SubscribeEvent
|
||||
public void itemCrafted (final ItemCraftedEvent event) {
|
||||
public void itemCrafted(final ItemCraftedEvent event) {
|
||||
if (event.crafting.getItem() == ItemRegistry.ItemMaterial && event.crafting.getItemDamage() == 5) {
|
||||
giveResearch(event.player);
|
||||
}
|
||||
@@ -251,7 +251,7 @@ public class TMEventHandler {
|
||||
/**
|
||||
* Give the player the Creation research upon crafting the Shard of Creation
|
||||
*/
|
||||
public void giveResearch (final EntityPlayer player) {
|
||||
public void giveResearch(final EntityPlayer player) {
|
||||
// CREATION
|
||||
if (!ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATION")
|
||||
&& ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "CREATIONSHARD")) {
|
||||
@@ -259,7 +259,9 @@ public class TMEventHandler {
|
||||
PacketHandler.INSTANCE.sendTo(new PacketResearchComplete("CREATION"), (EntityPlayerMP) player);
|
||||
|
||||
// effects
|
||||
HUDHandler.displayString(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("text.creation"), 3200,
|
||||
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);
|
||||
@@ -277,7 +279,7 @@ public class TMEventHandler {
|
||||
* Modify certain tooltips
|
||||
*/
|
||||
@SubscribeEvent
|
||||
public void itemTooltip (final ItemTooltipEvent event) {
|
||||
public void itemTooltip(final ItemTooltipEvent event) {
|
||||
// mage mace attack dmg
|
||||
if (event.itemStack.getItem() instanceof ItemFocusMageMace
|
||||
&& event.toolTip.contains(StatCollector.translateToLocal("item.Focus.cost1"))) {
|
||||
|
||||
@@ -6,43 +6,46 @@ import java.net.URL;
|
||||
import java.util.Scanner;
|
||||
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
|
||||
public class UpdateHandler {
|
||||
|
||||
private static String latestVersion = null;
|
||||
public static String message = null;
|
||||
|
||||
public static void checkForUpdate () {
|
||||
public static void checkForUpdate() {
|
||||
getNewestVersion();
|
||||
|
||||
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 (!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 {}",
|
||||
TaintedMagic.VERSION,
|
||||
latestVersion);
|
||||
}
|
||||
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 {}",
|
||||
TaintedMagic.VERSION, latestVersion);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
message = String.format("%sTainted Magic failed to connect to the update server!", EnumChatFormatting.RED);
|
||||
}
|
||||
}
|
||||
|
||||
private static void getNewestVersion () {
|
||||
private static void getNewestVersion() {
|
||||
try {
|
||||
final URL url = new URL("https://raw.githubusercontent.com/yorkeJohn/Tainted-Magic/master/version.txt");
|
||||
final Scanner scan = new Scanner(url.openStream());
|
||||
latestVersion = scan.next();
|
||||
scan.close();
|
||||
}
|
||||
catch (final MalformedURLException e) {
|
||||
} catch (final MalformedURLException e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
catch (final IOException e) {
|
||||
} catch (final IOException e) {
|
||||
TaintedMagic.logger.error("Could not connect to GitHub repository!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package taintedmagic.common.handler;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.wands.IWandRodOnUpdate;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
@@ -11,12 +12,11 @@ import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
public class WandHandler implements IWandRodOnUpdate {
|
||||
|
||||
@Override
|
||||
public void onUpdate (final ItemStack stack, final EntityPlayer player) {
|
||||
public void onUpdate(final ItemStack stack, final EntityPlayer player) {
|
||||
if (!player.isPotionActive(Config.potionWarpWardID)) {
|
||||
final int permwarp = Thaumcraft.proxy.getPlayerKnowledge().getWarpPerm(player.getCommandSenderName());
|
||||
|
||||
if (permwarp == 0)
|
||||
return;
|
||||
if (permwarp == 0) return;
|
||||
|
||||
// Exponential decay in the form 1/x
|
||||
final float base = ConfigHandler.WARP_WAND_REFRESH_BASE;
|
||||
|
||||
@@ -1,23 +1,25 @@
|
||||
package taintedmagic.common.helper;
|
||||
|
||||
import baubles.api.BaublesApi;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.codechicken.lib.vec.Vector3;
|
||||
import thaumcraft.common.items.baubles.ItemAmuletVis;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import baubles.api.BaublesApi;
|
||||
|
||||
public class TaintedMagicHelper {
|
||||
|
||||
/**
|
||||
* Returns an aspect list containing the specified amount of each primal aspect.
|
||||
*
|
||||
* @param amount The amount of each primal aspect.
|
||||
*/
|
||||
public static AspectList getPrimals (final int amount) {
|
||||
public static AspectList getPrimals(final int amount) {
|
||||
return new AspectList().add(Aspect.FIRE, amount).add(Aspect.WATER, amount).add(Aspect.EARTH, amount)
|
||||
.add(Aspect.AIR, amount).add(Aspect.ORDER, amount).add(Aspect.ENTROPY, amount);
|
||||
}
|
||||
@@ -25,17 +27,18 @@ public class TaintedMagicHelper {
|
||||
/**
|
||||
* Returns true if the player has adaquate vis to be consumed from their inventory (wands, baubles, etc)
|
||||
*
|
||||
* @param player The player
|
||||
* @param player The player
|
||||
* @param aspects The cost to be consumed
|
||||
* @param doit Should the vis actually be consumed
|
||||
* @param doit Should the vis actually be consumed
|
||||
*/
|
||||
public static boolean consumeVisFromInventory (final EntityPlayer player, final AspectList aspects, final boolean doit) {
|
||||
public static boolean consumeVisFromInventory(final EntityPlayer player, final AspectList aspects,
|
||||
final boolean doit) {
|
||||
final IInventory baubles = BaublesApi.getBaubles(player);
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (baubles.getStackInSlot(i) != null && baubles.getStackInSlot(i).getItem() instanceof ItemAmuletVis
|
||||
&& ((ItemAmuletVis) baubles.getStackInSlot(i).getItem()).consumeAllVis(baubles.getStackInSlot(i), player,
|
||||
aspects, doit, true))
|
||||
&& ((ItemAmuletVis) baubles.getStackInSlot(i).getItem())
|
||||
.consumeAllVis(baubles.getStackInSlot(i), player, aspects, doit, true))
|
||||
return true;
|
||||
|
||||
}
|
||||
@@ -53,7 +56,7 @@ public class TaintedMagicHelper {
|
||||
* @param origin The origin entity.
|
||||
* @param target The target entity.
|
||||
*/
|
||||
public static Vector3 getVectorBetweenEntities (final Entity origin, final Entity target) {
|
||||
public static Vector3 getVectorBetweenEntities(final Entity origin, final Entity target) {
|
||||
final Vector3 fromPosition = new Vector3(origin.posX, origin.posY, origin.posZ);
|
||||
final Vector3 toPosition = new Vector3(target.posX, target.posY, target.posZ);
|
||||
final Vector3 dist = fromPosition.sub(toPosition);
|
||||
@@ -65,11 +68,11 @@ public class TaintedMagicHelper {
|
||||
* Gets the distance from the player to a point (x, y, z)
|
||||
*
|
||||
* @param player The player.
|
||||
* @param x The X coordinate.
|
||||
* @param y The Y coordinate.
|
||||
* @param z The Z coordinate.
|
||||
* @param x The X coordinate.
|
||||
* @param y The Y coordinate.
|
||||
* @param z The Z coordinate.
|
||||
*/
|
||||
public static double getDistanceTo (final EntityPlayer player, final double x, final double y, final double z) {
|
||||
public static double getDistanceTo(final EntityPlayer player, final double x, final double y, final double z) {
|
||||
final double distX = player.posX - x;
|
||||
final double distY = player.posY - y;
|
||||
final double distZ = player.posZ - z;
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
package taintedmagic.common.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemCrimsonBlood extends Item {
|
||||
|
||||
public ItemCrimsonBlood () {
|
||||
public ItemCrimsonBlood() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setTextureName("taintedmagic:ItemCrimsonBlood");
|
||||
setUnlocalizedName("ItemCrimsonBlood");
|
||||
@@ -18,8 +19,8 @@ public class ItemCrimsonBlood extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -3,13 +3,6 @@ package taintedmagic.common.items;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
@@ -20,6 +13,9 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import taintedmagic.api.IRenderInventoryItem;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.helper.TaintedMagicHelper;
|
||||
@@ -27,6 +23,11 @@ import thaumcraft.api.IWarpingGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.client.lib.UtilsFX;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFlyteCharm extends Item implements IWarpingGear, IRenderInventoryItem {
|
||||
|
||||
@@ -40,7 +41,7 @@ public class ItemFlyteCharm extends Item implements IWarpingGear, IRenderInvento
|
||||
// Stores flying players
|
||||
public static final Set<String> FLIGHT_MANAGER = new HashSet<>();
|
||||
|
||||
public ItemFlyteCharm () {
|
||||
public ItemFlyteCharm() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setUnlocalizedName("ItemFlyteCharm");
|
||||
setMaxStackSize(1);
|
||||
@@ -51,13 +52,13 @@ public class ItemFlyteCharm extends Item implements IWarpingGear, IRenderInvento
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return TaintedMagic.rarityCreation;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void updateFlight (final LivingEvent.LivingUpdateEvent event) {
|
||||
public void updateFlight(final LivingEvent.LivingUpdateEvent event) {
|
||||
if (event.entityLiving instanceof EntityPlayer) {
|
||||
final EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
final String entry = getPlayerEntry(player, player.worldObj.isRemote);
|
||||
@@ -72,7 +73,8 @@ public class ItemFlyteCharm extends Item implements IWarpingGear, IRenderInvento
|
||||
|
||||
if (!isFlying) {
|
||||
// Glide
|
||||
if (player.isSneaking() && !player.onGround && player.fallDistance > 0.5F
|
||||
if (player.isSneaking() && !player.onGround
|
||||
&& player.fallDistance > 0.5F
|
||||
&& TaintedMagicHelper.consumeVisFromInventory(player, COST_GLIDE, true)) {
|
||||
final double speed = 0.1D;
|
||||
player.motionY = -speed;
|
||||
@@ -80,50 +82,47 @@ public class ItemFlyteCharm extends Item implements IWarpingGear, IRenderInvento
|
||||
player.motionZ += Math.sin(Math.toRadians(player.rotationYawHead + 90)) * speed;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
player.capabilities.allowFlying = false;
|
||||
player.capabilities.isFlying = false;
|
||||
}
|
||||
FLIGHT_MANAGER.remove(entry);
|
||||
}
|
||||
}
|
||||
else if (canFly(player)) {
|
||||
} else if (canFly(player)) {
|
||||
FLIGHT_MANAGER.add(entry);
|
||||
player.capabilities.allowFlying = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean canFly (final EntityPlayer player) {
|
||||
private boolean canFly(final EntityPlayer player) {
|
||||
final boolean hasVis = TaintedMagicHelper.consumeVisFromInventory(player, COST_FLIGHT, false);
|
||||
for (int i = 0; i < player.inventory.getSizeInventory(); i++) {
|
||||
final ItemStack stack = player.inventory.getStackInSlot(i);
|
||||
if (stack != null && stack.getItem() instanceof ItemFlyteCharm)
|
||||
return hasVis;
|
||||
if (stack != null && stack.getItem() instanceof ItemFlyteCharm) return hasVis;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static String getPlayerEntry (final EntityPlayer player, final boolean remote) {
|
||||
private static String getPlayerEntry(final EntityPlayer player, final boolean remote) {
|
||||
return player.getUniqueID().toString() + ":" + remote;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
private void onLogout (final PlayerEvent.PlayerLoggedOutEvent event) {
|
||||
private void onLogout(final PlayerEvent.PlayerLoggedOutEvent event) {
|
||||
FLIGHT_MANAGER.remove(getPlayerEntry(event.player, true));
|
||||
FLIGHT_MANAGER.remove(getPlayerEntry(event.player, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp (final ItemStack stack, final EntityPlayer player) {
|
||||
public int getWarp(final ItemStack stack, final EntityPlayer player) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
// Render magic circle
|
||||
@Override
|
||||
public void render (final EntityPlayer player, final ItemStack stack, final float partialTicks) {
|
||||
public void render(final EntityPlayer player, final ItemStack stack, final float partialTicks) {
|
||||
final Tessellator t = Tessellator.instance;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
@@ -131,8 +130,11 @@ public class ItemFlyteCharm extends Item implements IWarpingGear, IRenderInvento
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
GL11.glTranslated(0, (player != Minecraft.getMinecraft().thePlayer ? 1.62F : 0F) - player.getDefaultEyeHeight()
|
||||
+ (player.isSneaking() ? 0.0625 : 0), 0);
|
||||
GL11.glTranslated(
|
||||
0,
|
||||
(player != Minecraft.getMinecraft().thePlayer ? 1.62F : 0F) - player.getDefaultEyeHeight()
|
||||
+ (player.isSneaking() ? 0.0625 : 0),
|
||||
0);
|
||||
|
||||
GL11.glRotatef(45, -1, 0, -1);
|
||||
GL11.glTranslatef(0.0F, -0.5F, -0.2F);
|
||||
|
||||
@@ -3,8 +3,6 @@ package taintedmagic.common.items;
|
||||
import java.awt.Color;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -21,11 +19,14 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldProvider;
|
||||
|
||||
import taintedmagic.client.handler.HUDHandler;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXSparkle;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemGateKey extends Item implements IWarpingGear {
|
||||
|
||||
@@ -38,58 +39,60 @@ public class ItemGateKey extends Item implements IWarpingGear {
|
||||
private static final String TAG_DIM = "dimID";
|
||||
private static final String TAG_COLOUR = "colour";
|
||||
|
||||
public ItemGateKey () {
|
||||
public ItemGateKey() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setUnlocalizedName("ItemGateKey");
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return TaintedMagic.rarityCreation;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (final IIconRegister ir) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister ir) {
|
||||
icon = ir.registerIcon("taintedmagic:ItemGateKey");
|
||||
overlay = ir.registerIcon("taintedmagic:ItemGateKey_overlay");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses () {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public int getRenderPasses (final int meta) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderPasses(final int meta) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public IIcon getIconFromDamageForRenderPass (final int meta, final int pass) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamageForRenderPass(final int meta, final int pass) {
|
||||
return pass == 1 ? overlay : icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColorFromItemStack (final ItemStack stack, final int pass) {
|
||||
public int getColorFromItemStack(final ItemStack stack, final int pass) {
|
||||
if (pass == 1 && stack.stackTagCompound != null && stack.stackTagCompound.getInteger(TAG_COLOUR) != 0)
|
||||
return Color.HSBtoRGB(stack.stackTagCompound.getInteger(TAG_COLOUR) / 360F, 1.0F,
|
||||
return Color.HSBtoRGB(
|
||||
stack.stackTagCompound.getInteger(TAG_COLOUR) / 360F,
|
||||
1.0F,
|
||||
0.2F * (float) Math.sin(TaintedMagic.proxy.getClientPlayer().ticksExisted / 10D) + 0.8F);
|
||||
return 0xFFFFFF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp (final ItemStack stack, final EntityPlayer player) {
|
||||
public int getWarp(final ItemStack stack, final EntityPlayer player) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
public void addInformation(final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
if (stack.stackTagCompound != null) {
|
||||
list.add(EnumChatFormatting.GREEN + StatCollector.translateToLocal("key.bound"));
|
||||
|
||||
@@ -100,24 +103,23 @@ public class ItemGateKey extends Item implements IWarpingGear {
|
||||
final int y = stack.stackTagCompound.getInteger(TAG_Y);
|
||||
final int z = stack.stackTagCompound.getInteger(TAG_Z);
|
||||
list.add(x + ", " + y + ", " + z);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
list.add(EnumChatFormatting.RED + StatCollector.translateToLocal("key.unbound"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction (final ItemStack stack) {
|
||||
public EnumAction getItemUseAction(final ItemStack stack) {
|
||||
return EnumAction.bow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxItemUseDuration (final ItemStack stack) {
|
||||
public int getMaxItemUseDuration(final ItemStack stack) {
|
||||
return 40;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick (final ItemStack stack, final World world, final EntityPlayer player) {
|
||||
public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer player) {
|
||||
if (stack.stackTagCompound != null) {
|
||||
player.setItemInUse(stack, getMaxItemUseDuration(stack));
|
||||
}
|
||||
@@ -125,8 +127,8 @@ public class ItemGateKey extends Item implements IWarpingGear {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse (final ItemStack stack, final EntityPlayer player, final World world, final int x, final int y,
|
||||
final int z, final int face, final float hitX, final float hitY, final float hitZ) {
|
||||
public boolean onItemUse(final ItemStack stack, final EntityPlayer player, final World world, final int x,
|
||||
final int y, final int z, final int face, final float hitX, final float hitY, final float hitZ) {
|
||||
if (stack.stackTagCompound == null) {
|
||||
if (!world.isRemote) {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
@@ -135,8 +137,7 @@ public class ItemGateKey extends Item implements IWarpingGear {
|
||||
stack.stackTagCompound.setInteger(TAG_Y, y + 1);
|
||||
stack.stackTagCompound.setInteger(TAG_Z, z);
|
||||
stack.stackTagCompound.setInteger(TAG_DIM, world.provider.dimensionId);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
player.swingItem();
|
||||
for (int a = 0; a < 9; a++) {
|
||||
sparkle(world, x + 0.5D, y, z + 0.5D);
|
||||
@@ -147,16 +148,22 @@ public class ItemGateKey extends Item implements IWarpingGear {
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void sparkle (final World world, final double x, final double y, final double z) {
|
||||
final FXSparkle fx = new FXSparkle(world, x + 0.33F * world.rand.nextGaussian(), y + 0.5D + world.rand.nextFloat(),
|
||||
z + 0.33F * world.rand.nextGaussian(), 1.75F, 6, 3 + world.rand.nextInt(3));
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void sparkle(final World world, final double x, final double y, final double z) {
|
||||
final FXSparkle fx = new FXSparkle(
|
||||
world,
|
||||
x + 0.33F * world.rand.nextGaussian(),
|
||||
y + 0.5D + world.rand.nextFloat(),
|
||||
z + 0.33F * world.rand.nextGaussian(),
|
||||
1.75F,
|
||||
6,
|
||||
3 + world.rand.nextInt(3));
|
||||
fx.setGravity(0.1F);
|
||||
ParticleEngine.instance.addEffect(world, fx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUsingTick (final ItemStack stack, final EntityPlayer player, final int i) {
|
||||
public void onUsingTick(final ItemStack stack, final EntityPlayer player, final int i) {
|
||||
super.onUsingTick(stack, player, i);
|
||||
|
||||
if (player.worldObj.isRemote) {
|
||||
@@ -170,7 +177,7 @@ public class ItemGateKey extends Item implements IWarpingGear {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onEaten (final ItemStack stack, final World world, final EntityPlayer player) {
|
||||
public ItemStack onEaten(final ItemStack stack, final World world, final EntityPlayer player) {
|
||||
super.onEaten(stack, world, player);
|
||||
if (stack.stackTagCompound != null) {
|
||||
final int x = stack.stackTagCompound.getInteger(TAG_X);
|
||||
@@ -178,22 +185,27 @@ public class ItemGateKey extends Item implements IWarpingGear {
|
||||
final int z = stack.stackTagCompound.getInteger(TAG_Z);
|
||||
final int dim = stack.stackTagCompound.getInteger(TAG_DIM);
|
||||
|
||||
if (y > -1 && dim == world.provider.dimensionId && world.getBlock(x, y, z) == Blocks.air
|
||||
if (y > -1 && dim == world.provider.dimensionId
|
||||
&& world.getBlock(x, y, z) == Blocks.air
|
||||
&& world.getBlock(x, y + 1, z) == Blocks.air) {
|
||||
if (!world.isRemote) {
|
||||
if (player instanceof EntityPlayerMP) {
|
||||
((EntityPlayerMP) player).playerNetServerHandler.setPlayerLocation(x + 0.5D, y, z + 0.5D,
|
||||
player.rotationYaw, player.rotationPitch);
|
||||
((EntityPlayerMP) player).playerNetServerHandler
|
||||
.setPlayerLocation(x + 0.5D, y, z + 0.5D, player.rotationYaw, player.rotationPitch);
|
||||
}
|
||||
world.playSoundAtEntity(player, "mob.endermen.portal", 5.0F, 1.0F);
|
||||
}
|
||||
player.addPotionEffect(new PotionEffect(Potion.confusion.id, 160, 0));
|
||||
}
|
||||
else if (dim != world.provider.dimensionId) {
|
||||
HUDHandler.displayString(EnumChatFormatting.RED + StatCollector.translateToLocal("key.invaliddim"), 300, false);
|
||||
}
|
||||
else {
|
||||
HUDHandler.displayString(EnumChatFormatting.RED + StatCollector.translateToLocal("key.error"), 300, false);
|
||||
} else if (dim != world.provider.dimensionId) {
|
||||
HUDHandler.displayString(
|
||||
EnumChatFormatting.RED + StatCollector.translateToLocal("key.invaliddim"),
|
||||
300,
|
||||
false);
|
||||
} else {
|
||||
HUDHandler.displayString(
|
||||
EnumChatFormatting.RED + StatCollector.translateToLocal("key.error"),
|
||||
300,
|
||||
false);
|
||||
}
|
||||
}
|
||||
return stack;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package taintedmagic.common.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
@@ -10,16 +8,19 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.lib.network.PacketHandler;
|
||||
import thaumcraft.common.lib.network.playerdata.PacketAspectPool;
|
||||
import thaumcraft.common.lib.research.ResearchManager;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemMagicFunguar extends ItemFood {
|
||||
|
||||
public ItemMagicFunguar (final int healAmount, final float saturation, final boolean b) {
|
||||
public ItemMagicFunguar(final int healAmount, final float saturation, final boolean b) {
|
||||
super(healAmount, saturation, b);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setTextureName("taintedmagic:ItemMagicFunguar");
|
||||
@@ -28,7 +29,7 @@ public class ItemMagicFunguar extends ItemFood {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFoodEaten (final ItemStack stack, final World world, final EntityPlayer player) {
|
||||
protected void onFoodEaten(final ItemStack stack, final World world, final EntityPlayer player) {
|
||||
super.onFoodEaten(stack, world, player);
|
||||
|
||||
// Potion effects
|
||||
@@ -42,15 +43,18 @@ public class ItemMagicFunguar extends ItemFood {
|
||||
Thaumcraft.proxy.playerKnowledge.addAspectPool(player.getCommandSenderName(), aspects[i], (short) 1);
|
||||
ResearchManager.scheduleSave(player);
|
||||
PacketHandler.INSTANCE.sendTo(
|
||||
new PacketAspectPool(aspects[i].getTag(), (short) 1,
|
||||
Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(player.getCommandSenderName(), aspects[i])),
|
||||
new PacketAspectPool(
|
||||
aspects[i].getTag(),
|
||||
(short) 1,
|
||||
Thaumcraft.proxy.playerKnowledge
|
||||
.getAspectPoolFor(player.getCommandSenderName(), aspects[i])),
|
||||
(EntityPlayerMP) player);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,6 @@ package taintedmagic.common.items;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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;
|
||||
@@ -13,81 +11,75 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemMaterial extends Item {
|
||||
|
||||
/**
|
||||
* 0 Shadow Metal Ingot
|
||||
* 1 Shadow-imbued Cloth
|
||||
* 2 Crimson-stained Cloth
|
||||
* 3 Warped Unbalanced Shard
|
||||
* 4 Tainted Unbalanced Shard
|
||||
* 5 Shard of Creation
|
||||
* 6 Thaumic Alloy Plate
|
||||
* 7 Crimson Alloy Plate
|
||||
* 8 Shadow Metal Nugget
|
||||
* 9 Primordial Nodule
|
||||
* 10 Primordial Mote
|
||||
* 11 Fragment of Creation
|
||||
* 0 Shadow Metal Ingot 1 Shadow-imbued Cloth 2 Crimson-stained Cloth 3 Warped Unbalanced Shard 4 Tainted Unbalanced
|
||||
* Shard 5 Shard of Creation 6 Thaumic Alloy Plate 7 Crimson Alloy Plate 8 Shadow Metal Nugget 9 Primordial Nodule
|
||||
* 10 Primordial Mote 11 Fragment of Creation
|
||||
*/
|
||||
private static final int SUBTYPES = 12;
|
||||
private final IIcon[] icons = new IIcon[SUBTYPES];
|
||||
|
||||
public ItemMaterial () {
|
||||
public ItemMaterial() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setUnlocalizedName("ItemMaterial");
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
final int meta = stack.getItemDamage();
|
||||
switch (meta) {
|
||||
case 0 :
|
||||
return EnumRarity.uncommon;
|
||||
case 1 :
|
||||
return EnumRarity.uncommon;
|
||||
case 2 :
|
||||
return EnumRarity.uncommon;
|
||||
case 3 :
|
||||
return EnumRarity.common;
|
||||
case 4 :
|
||||
return EnumRarity.common;
|
||||
case 5 :
|
||||
return TaintedMagic.rarityCreation;
|
||||
case 6 :
|
||||
return EnumRarity.uncommon;
|
||||
case 7 :
|
||||
return EnumRarity.uncommon;
|
||||
case 8 :
|
||||
return EnumRarity.uncommon;
|
||||
case 9 :
|
||||
return EnumRarity.epic;
|
||||
case 10 :
|
||||
return EnumRarity.epic;
|
||||
case 11 :
|
||||
return TaintedMagic.rarityCreation;
|
||||
case 0:
|
||||
return EnumRarity.uncommon;
|
||||
case 1:
|
||||
return EnumRarity.uncommon;
|
||||
case 2:
|
||||
return EnumRarity.uncommon;
|
||||
case 3:
|
||||
return EnumRarity.common;
|
||||
case 4:
|
||||
return EnumRarity.common;
|
||||
case 5:
|
||||
return TaintedMagic.rarityCreation;
|
||||
case 6:
|
||||
return EnumRarity.uncommon;
|
||||
case 7:
|
||||
return EnumRarity.uncommon;
|
||||
case 8:
|
||||
return EnumRarity.uncommon;
|
||||
case 9:
|
||||
return EnumRarity.epic;
|
||||
case 10:
|
||||
return EnumRarity.epic;
|
||||
case 11:
|
||||
return TaintedMagic.rarityCreation;
|
||||
}
|
||||
return EnumRarity.common;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (final IIconRegister ir) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister ir) {
|
||||
for (int i = 0; i < icons.length; i++) {
|
||||
icons[i] = ir.registerIcon("taintedmagic:ItemMaterial" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public IIcon getIconFromDamage (final int meta) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(final int meta) {
|
||||
return icons[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
public void addInformation(final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
super.addInformation(stack, player, list, b);
|
||||
|
||||
if (stack.getItemDamage() == 5) {
|
||||
@@ -96,15 +88,15 @@ public class ItemMaterial extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void getSubItems (final Item item, final CreativeTabs tab, final List list) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item item, final CreativeTabs tab, final List list) {
|
||||
for (int i = 0; i < SUBTYPES; i++) {
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName (final ItemStack stack) {
|
||||
public String getUnlocalizedName(final ItemStack stack) {
|
||||
return super.getUnlocalizedName() + "." + stack.getItemDamage();
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,19 @@
|
||||
package taintedmagic.common.items;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemNightshadeBerries extends ItemFood {
|
||||
|
||||
public ItemNightshadeBerries (final int healAmount, final float saturation, final boolean b) {
|
||||
public ItemNightshadeBerries(final int healAmount, final float saturation, final boolean b) {
|
||||
super(healAmount, saturation, b);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setUnlocalizedName("ItemNightshadeBerries");
|
||||
@@ -21,13 +22,13 @@ public class ItemNightshadeBerries extends ItemFood {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFoodEaten (final ItemStack stack, final World world, final EntityPlayer player) {
|
||||
protected void onFoodEaten(final ItemStack stack, final World world, final EntityPlayer player) {
|
||||
super.onFoodEaten(stack, world, player);
|
||||
if (!world.isRemote) {
|
||||
player.attackEntityFrom(new DamageSource("nightshade"), Short.MAX_VALUE);
|
||||
|
||||
@@ -3,8 +3,6 @@ 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.item.EntityItem;
|
||||
@@ -13,75 +11,78 @@ 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;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemSalis extends Item {
|
||||
|
||||
private static final int SUBTYPES = 2;
|
||||
private final IIcon[] icons = new IIcon[SUBTYPES];
|
||||
|
||||
public ItemSalis () {
|
||||
public ItemSalis() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
hasSubtypes = true;
|
||||
setUnlocalizedName("ItemSalis");
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return TaintedMagic.rarityCreation;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (final IIconRegister ir) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister ir) {
|
||||
for (int i = 0; i < icons.length; i++) {
|
||||
icons[i] = ir.registerIcon("taintedmagic:ItemSalis" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public IIcon getIconFromDamage (final int meta) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(final int meta) {
|
||||
return icons[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void getSubItems (final Item item, final CreativeTabs tab, final List list) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item item, final CreativeTabs tab, final List list) {
|
||||
for (int i = 0; i < SUBTYPES; i++) {
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName (final ItemStack stack) {
|
||||
public String getUnlocalizedName(final ItemStack stack) {
|
||||
return super.getUnlocalizedName() + "." + stack.getItemDamage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onEntityItemUpdate (final EntityItem entity) {
|
||||
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);
|
||||
// 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;
|
||||
}
|
||||
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();
|
||||
@@ -101,8 +102,8 @@ public class ItemSalis extends Item {
|
||||
return false;
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
private void spawnParticles (final EntityItem entity, final int meta, final boolean death) {
|
||||
@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;
|
||||
@@ -112,8 +113,14 @@ public class ItemSalis extends Item {
|
||||
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));
|
||||
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;
|
||||
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
package taintedmagic.common.items;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.RecipeSorter.Category;
|
||||
|
||||
import taintedmagic.api.RecipeVoidBlood;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemVoidBlood extends Item {
|
||||
|
||||
public ItemVoidBlood () {
|
||||
public ItemVoidBlood() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setTextureName("taintedmagic:ItemVoidBlood");
|
||||
setUnlocalizedName("ItemVoidBlood");
|
||||
@@ -25,8 +26,8 @@ public class ItemVoidBlood extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,23 @@
|
||||
package taintedmagic.common.items;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.BlockRegistry;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXWisp;
|
||||
import thaumcraft.common.blocks.BlockCustomPlant;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemWarpFertilizer extends Item {
|
||||
|
||||
public ItemWarpFertilizer () {
|
||||
public ItemWarpFertilizer() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setUnlocalizedName("ItemWarpFertilizer");
|
||||
setTextureName("taintedmagic:ItemWarpFertilizer");
|
||||
@@ -25,7 +26,7 @@ public class ItemWarpFertilizer extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
@@ -33,10 +34,10 @@ public class ItemWarpFertilizer extends Item {
|
||||
* Turn Silverwood Saplings into Warpwood Saplings
|
||||
*/
|
||||
@Override
|
||||
public boolean onItemUse (final ItemStack stack, final EntityPlayer player, final World world, final int x, final int y,
|
||||
final int z, final int side, final float hitX, final float hitY, final float hitZ) {
|
||||
public boolean onItemUse(final ItemStack stack, final EntityPlayer player, final World world, final int x,
|
||||
final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ) {
|
||||
super.onItemUse(stack, player, world, x, y, z, side, hitX, hitY, hitZ);
|
||||
if (! (world.getBlock(x, y, z) instanceof BlockCustomPlant) || world.getBlockMetadata(x, y, z) != 1)
|
||||
if (!(world.getBlock(x, y, z) instanceof BlockCustomPlant) || world.getBlockMetadata(x, y, z) != 1)
|
||||
return false;
|
||||
if (world.isRemote) {
|
||||
particles(world, x, y, z, 10 + world.rand.nextInt(11));
|
||||
@@ -49,12 +50,16 @@ public class ItemWarpFertilizer extends Item {
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void particles (final World world, final int x, final int y, final int z, final int count) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void particles(final World world, final int x, final int y, final int z, final int count) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
final FXWisp fx = new FXWisp(world, x + 0.5D + (Math.random() - Math.random()) * 0.5D,
|
||||
y + 0.5D + (Math.random() - Math.random()) * 0.5D, z + 0.5D + (Math.random() - Math.random()) * 0.5D,
|
||||
0.25F + (float) Math.random() * 0.25F, 5);
|
||||
final FXWisp fx = new FXWisp(
|
||||
world,
|
||||
x + 0.5D + (Math.random() - Math.random()) * 0.5D,
|
||||
y + 0.5D + (Math.random() - Math.random()) * 0.5D,
|
||||
z + 0.5D + (Math.random() - Math.random()) * 0.5D,
|
||||
0.25F + (float) Math.random() * 0.25F,
|
||||
5);
|
||||
|
||||
fx.setGravity(0.01F);
|
||||
|
||||
|
||||
@@ -5,17 +5,19 @@ import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
public class TMMaterials {
|
||||
|
||||
// Tool materials
|
||||
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 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 final ArmorMaterial ARMOR_VOIDFORTRESS =
|
||||
EnumHelper.addArmorMaterial("VOIDFORTRESS", 300, new int[]{ 4, 8, 6, 0 }, 30);
|
||||
public static final ArmorMaterial ARMOR_SHADOWFORTRESS =
|
||||
EnumHelper.addArmorMaterial("SHADOWFORTRESS", 3000, new int[]{ 4, 10, 6, 0 }, 30);
|
||||
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 final ArmorMaterial ARMOR_VOIDFORTRESS = EnumHelper
|
||||
.addArmorMaterial("VOIDFORTRESS", 300, new int[] { 4, 8, 6, 0 }, 30);
|
||||
public static final ArmorMaterial ARMOR_SHADOWFORTRESS = EnumHelper
|
||||
.addArmorMaterial("SHADOWFORTRESS", 3000, new int[] { 4, 10, 6, 0 }, 30);
|
||||
}
|
||||
@@ -1,18 +1,19 @@
|
||||
package taintedmagic.common.items.equipment;
|
||||
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.api.IBauble;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.api.IBauble;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemLumosRing extends Item implements IBauble {
|
||||
|
||||
public ItemLumosRing () {
|
||||
public ItemLumosRing() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setTextureName("taintedmagic:ItemLumosRing");
|
||||
setMaxDamage(-1);
|
||||
@@ -21,35 +22,32 @@ public class ItemLumosRing extends Item implements IBauble {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEquip (final ItemStack stack, final EntityLivingBase entity) {
|
||||
public boolean canEquip(final ItemStack stack, final EntityLivingBase entity) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUnequip (final ItemStack stack, final EntityLivingBase entity) {
|
||||
public boolean canUnequip(final ItemStack stack, final EntityLivingBase entity) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaubleType getBaubleType (final ItemStack stack) {
|
||||
public BaubleType getBaubleType(final ItemStack stack) {
|
||||
return BaubleType.RING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEquipped (final ItemStack stack, final EntityLivingBase entity) {
|
||||
}
|
||||
public void onEquipped(final ItemStack stack, final EntityLivingBase entity) {}
|
||||
|
||||
@Override
|
||||
public void onUnequipped (final ItemStack stack, final EntityLivingBase entity) {
|
||||
}
|
||||
public void onUnequipped(final ItemStack stack, final EntityLivingBase entity) {}
|
||||
|
||||
@Override
|
||||
public void onWornTick (final ItemStack stack, final EntityLivingBase entity) {
|
||||
}
|
||||
public void onWornTick(final ItemStack stack, final EntityLivingBase entity) {}
|
||||
}
|
||||
@@ -2,8 +2,6 @@ package taintedmagic.common.items.equipment;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -14,63 +12,70 @@ import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.common.items.armor.ItemFortressArmor;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemShadowFortressArmor extends ItemFortressArmor implements IWarpingGear, IVisDiscountGear, ISpecialArmor {
|
||||
public class ItemShadowFortressArmor extends ItemFortressArmor
|
||||
implements IWarpingGear, IVisDiscountGear, ISpecialArmor {
|
||||
|
||||
public ItemShadowFortressArmor (final ArmorMaterial material, final int j, final int k) {
|
||||
public ItemShadowFortressArmor(final ArmorMaterial material, final int j, final int k) {
|
||||
super(material, j, k);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (final IIconRegister ir) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister ir) {
|
||||
iconHelm = ir.registerIcon("taintedmagic:ItemShadowFortressHelmet");
|
||||
iconChest = ir.registerIcon("taintedmagic:ItemShadowFortressChestplate");
|
||||
iconLegs = ir.registerIcon("taintedmagic:ItemShadowFortressLeggings");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
list.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount") + ": "
|
||||
+ getVisDiscount(stack, player, null) + "%");
|
||||
public void addInformation(final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
list.add(
|
||||
EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount")
|
||||
+ ": "
|
||||
+ getVisDiscount(stack, player, null)
|
||||
+ "%");
|
||||
super.addInformation(stack, player, list, b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture (final ItemStack stack, final Entity entity, final int slot, final String type) {
|
||||
public String getArmorTexture(final ItemStack stack, final Entity entity, final int slot, final String type) {
|
||||
return "taintedmagic:textures/models/ModelShadowFortressArmor.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.epic;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable (final ItemStack stack, final ItemStack repairItem) {
|
||||
public boolean getIsRepairable(final ItemStack stack, final ItemStack repairItem) {
|
||||
return repairItem.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial, 1, 0)) ? true
|
||||
: super.getIsRepairable(stack, repairItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount (final ItemStack stack, final EntityPlayer player, final Aspect aspect) {
|
||||
public int getVisDiscount(final ItemStack stack, final EntityPlayer player, final Aspect aspect) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp (final ItemStack stack, final EntityPlayer player) {
|
||||
public int getWarp(final ItemStack stack, final EntityPlayer player) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ISpecialArmor.ArmorProperties getProperties (final EntityLivingBase entity, final ItemStack stack,
|
||||
public ISpecialArmor.ArmorProperties getProperties(final EntityLivingBase entity, final ItemStack stack,
|
||||
final DamageSource source, final double dmg, final int slot) {
|
||||
int priority = 0;
|
||||
double ratio = damageReduceAmount / 25.0D;
|
||||
@@ -78,12 +83,10 @@ public class ItemShadowFortressArmor extends ItemFortressArmor implements IWarpi
|
||||
if (source.isMagicDamage()) {
|
||||
priority = 1;
|
||||
ratio = damageReduceAmount / 35.0D;
|
||||
}
|
||||
else if (source.isFireDamage() || source.isExplosion()) {
|
||||
} else if (source.isFireDamage() || source.isExplosion()) {
|
||||
priority = 1;
|
||||
ratio = damageReduceAmount / 20.0D;
|
||||
}
|
||||
else if (source.isUnblockable()) {
|
||||
} else if (source.isUnblockable()) {
|
||||
priority = 0;
|
||||
ratio = 0.0D;
|
||||
}
|
||||
@@ -106,15 +109,15 @@ public class ItemShadowFortressArmor extends ItemFortressArmor implements IWarpi
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getArmorDisplay (final EntityPlayer player, final ItemStack stack, final int slot) {
|
||||
public int getArmorDisplay(final EntityPlayer player, final ItemStack stack, final int slot) {
|
||||
return damageReduceAmount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void damageArmor (final EntityLivingBase entity, final ItemStack stack, final DamageSource source, final int dmg,
|
||||
final int slot) {
|
||||
public void damageArmor(final EntityLivingBase entity, final ItemStack stack, final DamageSource source,
|
||||
final int dmg, final int slot) {
|
||||
if (source != DamageSource.fall) {
|
||||
stack.damageItem(dmg, entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,6 @@ package taintedmagic.common.items.equipment;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -12,56 +10,64 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumcraft.common.items.armor.ItemFortressArmor;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemVoidFortressArmor extends ItemFortressArmor implements IWarpingGear, IVisDiscountGear {
|
||||
|
||||
public ItemVoidFortressArmor (final ArmorMaterial material, final int j, final int k) {
|
||||
public ItemVoidFortressArmor(final ArmorMaterial material, final int j, final int k) {
|
||||
super(material, j, k);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (final IIconRegister ir) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister ir) {
|
||||
iconHelm = ir.registerIcon("taintedmagic:ItemVoidFortressHelmet");
|
||||
iconChest = ir.registerIcon("taintedmagic:ItemVoidFortressChestplate");
|
||||
iconLegs = ir.registerIcon("taintedmagic:ItemVoidFortressLeggings");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
list.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount") + ": "
|
||||
+ getVisDiscount(stack, player, null) + "%");
|
||||
public void addInformation(final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
list.add(
|
||||
EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount")
|
||||
+ ": "
|
||||
+ getVisDiscount(stack, player, null)
|
||||
+ "%");
|
||||
super.addInformation(stack, player, list, b);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture (final ItemStack stack, final Entity entity, final int slot, final String type) {
|
||||
public String getArmorTexture(final ItemStack stack, final Entity entity, final int slot, final String type) {
|
||||
return "taintedmagic:textures/models/ModelVoidFortressArmor.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable (final ItemStack stack, final ItemStack repairItem) {
|
||||
public boolean getIsRepairable(final ItemStack stack, final ItemStack repairItem) {
|
||||
return repairItem.isItemEqual(new ItemStack(ConfigItems.itemResource, 1, 16)) ? true
|
||||
: super.getIsRepairable(stack, repairItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate (final ItemStack stack, final World world, final Entity entity, final int i, final boolean b) {
|
||||
public void onUpdate(final ItemStack stack, final World world, final Entity entity, final int i, final boolean b) {
|
||||
super.onUpdate(stack, world, entity, i, b);
|
||||
if (!world.isRemote && stack.isItemDamaged() && entity.ticksExisted % 20 == 0 && entity instanceof EntityLivingBase) {
|
||||
if (!world.isRemote && stack.isItemDamaged()
|
||||
&& entity.ticksExisted % 20 == 0
|
||||
&& entity instanceof EntityLivingBase) {
|
||||
stack.damageItem(-1, (EntityLivingBase) entity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick (final World world, final EntityPlayer player, final ItemStack stack) {
|
||||
public void onArmorTick(final World world, final EntityPlayer player, final ItemStack stack) {
|
||||
super.onArmorTick(world, player, stack);
|
||||
if (!world.isRemote && stack.isItemDamaged() && player.ticksExisted % 20 == 0) {
|
||||
stack.damageItem(-1, player);
|
||||
@@ -69,12 +75,12 @@ public class ItemVoidFortressArmor extends ItemFortressArmor implements IWarping
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp (final ItemStack stack, final EntityPlayer player) {
|
||||
public int getWarp(final ItemStack stack, final EntityPlayer player) {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount (final ItemStack stack, final EntityPlayer player, final Aspect aspect) {
|
||||
public int getVisDiscount(final ItemStack stack, final EntityPlayer player, final Aspect aspect) {
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package taintedmagic.common.items.equipment;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -9,55 +7,60 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.common.items.armor.ItemGoggles;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemVoidmetalGoggles extends ItemGoggles implements IWarpingGear {
|
||||
|
||||
public ItemVoidmetalGoggles (final ArmorMaterial material, final int j, final int k) {
|
||||
public ItemVoidmetalGoggles(final ArmorMaterial material, final int j, final int k) {
|
||||
super(material, j, k);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setUnlocalizedName("ItemVoidmetalGoggles");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (final IIconRegister ir) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister ir) {
|
||||
icon = ir.registerIcon("taintedmagic:ItemVoidmetalGoggles");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture (final ItemStack stack, final Entity entity, final int slot, final String type) {
|
||||
public String getArmorTexture(final ItemStack stack, final Entity entity, final int slot, final String type) {
|
||||
return "taintedmagic:textures/models/ModelVoidmetalGoggles.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp (final ItemStack stack, final EntityPlayer player) {
|
||||
public int getWarp(final ItemStack stack, final EntityPlayer player) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount (final ItemStack stack, final EntityPlayer player, final Aspect aspect) {
|
||||
public int getVisDiscount(final ItemStack stack, final EntityPlayer player, final Aspect aspect) {
|
||||
return 12;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate (final ItemStack stack, final World world, final Entity entity, final int i, final boolean b) {
|
||||
public void onUpdate(final ItemStack stack, final World world, final Entity entity, final int i, final boolean b) {
|
||||
super.onUpdate(stack, world, entity, i, b);
|
||||
if (!world.isRemote && stack.isItemDamaged() && entity.ticksExisted % 20 == 0 && entity instanceof EntityLivingBase) {
|
||||
if (!world.isRemote && stack.isItemDamaged()
|
||||
&& entity.ticksExisted % 20 == 0
|
||||
&& entity instanceof EntityLivingBase) {
|
||||
stack.damageItem(-1, (EntityLivingBase) entity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick (final World world, final EntityPlayer player, final ItemStack stack) {
|
||||
public void onArmorTick(final World world, final EntityPlayer player, final ItemStack stack) {
|
||||
super.onArmorTick(world, player, stack);
|
||||
if (!world.isRemote && stack.isItemDamaged() && player.ticksExisted % 20 == 0) {
|
||||
stack.damageItem(-1, player);
|
||||
|
||||
@@ -2,10 +2,6 @@ package taintedmagic.common.items.equipment;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -19,6 +15,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.IRepairable;
|
||||
@@ -30,11 +27,15 @@ import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXWispEG;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.items.armor.Hover;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemVoidwalkerBoots extends ItemArmor
|
||||
implements IVisDiscountGear, IWarpingGear, IRunicArmor, IRepairable, ISpecialArmor {
|
||||
|
||||
public ItemVoidwalkerBoots (final ArmorMaterial material, final int j, final int k) {
|
||||
public ItemVoidwalkerBoots(final ArmorMaterial material, final int j, final int k) {
|
||||
super(material, j, k);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setUnlocalizedName("ItemVoidwalkerBoots");
|
||||
@@ -44,32 +45,32 @@ public class ItemVoidwalkerBoots extends ItemArmor
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture (final ItemStack stack, final Entity entity, final int slot, final String type) {
|
||||
public String getArmorTexture(final ItemStack stack, final Entity entity, final int slot, final String type) {
|
||||
return "taintedmagic:textures/models/ModelVoidwalkerBoots.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.epic;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRunicCharge (final ItemStack stack) {
|
||||
public int getRunicCharge(final ItemStack stack) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp (final ItemStack stack, final EntityPlayer player) {
|
||||
public int getWarp(final ItemStack stack, final EntityPlayer player) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getVisDiscount (final ItemStack stack, final EntityPlayer player, final Aspect aspect) {
|
||||
public int getVisDiscount(final ItemStack stack, final EntityPlayer player, final Aspect aspect) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ISpecialArmor.ArmorProperties getProperties (final EntityLivingBase entity, final ItemStack stack,
|
||||
public ISpecialArmor.ArmorProperties getProperties(final EntityLivingBase entity, final ItemStack stack,
|
||||
final DamageSource source, final double dmg, final int slot) {
|
||||
int priority = 0;
|
||||
double ratio = damageReduceAmount / 90.0D;
|
||||
@@ -77,8 +78,7 @@ public class ItemVoidwalkerBoots extends ItemArmor
|
||||
if (source.isMagicDamage() || source.isFireDamage() || source.isExplosion()) {
|
||||
priority = 1;
|
||||
ratio = damageReduceAmount / 80.0D;
|
||||
}
|
||||
else if (source.isUnblockable()) {
|
||||
} else if (source.isUnblockable()) {
|
||||
priority = 0;
|
||||
ratio = 0.0D;
|
||||
}
|
||||
@@ -86,34 +86,39 @@ public class ItemVoidwalkerBoots extends ItemArmor
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getArmorDisplay (final EntityPlayer player, final ItemStack stack, final int slot) {
|
||||
public int getArmorDisplay(final EntityPlayer player, final ItemStack stack, final int slot) {
|
||||
return damageReduceAmount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void damageArmor (final EntityLivingBase entity, final ItemStack stack, final DamageSource source, final int dmg,
|
||||
final int slot) {
|
||||
public void damageArmor(final EntityLivingBase entity, final ItemStack stack, final DamageSource source,
|
||||
final int dmg, final int slot) {
|
||||
if (source != DamageSource.fall) {
|
||||
stack.damageItem(dmg, entity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
list.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount") + ": "
|
||||
+ getVisDiscount(stack, player, null) + "%");
|
||||
public void addInformation(final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
list.add(
|
||||
EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tc.visdiscount")
|
||||
+ ": "
|
||||
+ getVisDiscount(stack, player, null)
|
||||
+ "%");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate (final ItemStack stack, final World world, final Entity entity, final int j, final boolean k) {
|
||||
public void onUpdate(final ItemStack stack, final World world, final Entity entity, final int j, final boolean k) {
|
||||
super.onUpdate(stack, world, entity, j, k);
|
||||
if (!world.isRemote && stack.isItemDamaged() && entity.ticksExisted % 20 == 0 && entity instanceof EntityLivingBase) {
|
||||
if (!world.isRemote && stack.isItemDamaged()
|
||||
&& entity.ticksExisted % 20 == 0
|
||||
&& entity instanceof EntityLivingBase) {
|
||||
stack.damageItem(-1, (EntityLivingBase) entity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick (final World world, final EntityPlayer player, final ItemStack stack) {
|
||||
public void onArmorTick(final World world, final EntityPlayer player, final ItemStack stack) {
|
||||
super.onArmorTick(world, player, stack);
|
||||
// repair
|
||||
if (!world.isRemote && stack.isItemDamaged() && player.ticksExisted % 20 == 0) {
|
||||
@@ -139,16 +144,15 @@ public class ItemVoidwalkerBoots extends ItemArmor
|
||||
if (player.onGround || player.capabilities.isFlying) {
|
||||
float bonus = 0.12F;
|
||||
final ItemStack sash = PlayerHandler.getPlayerBaubles(player).getStackInSlot(3);
|
||||
if (sash != null && sash.getItem() instanceof ItemVoidwalkerSash && TaintedMagic.proxy.isSashEnabled(player)) {
|
||||
if (sash != null && sash.getItem() instanceof ItemVoidwalkerSash
|
||||
&& TaintedMagic.proxy.isSashEnabled(player)) {
|
||||
bonus *= 2.0F;
|
||||
}
|
||||
|
||||
player.moveFlying(0.0F, 1.0F, player.capabilities.isFlying ? bonus * 0.75F : bonus);
|
||||
}
|
||||
else if (Hover.getHover(player.getEntityId())) {
|
||||
} else if (Hover.getHover(player.getEntityId())) {
|
||||
player.jumpMovementFactor = 0.03F;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
player.jumpMovementFactor = player.isSprinting() ? 0.045F : 0.04F;
|
||||
}
|
||||
}
|
||||
@@ -159,7 +163,7 @@ public class ItemVoidwalkerBoots extends ItemArmor
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void playerJumps (final LivingEvent.LivingJumpEvent event) {
|
||||
public void playerJumps(final LivingEvent.LivingJumpEvent event) {
|
||||
if (event.entity instanceof EntityPlayer) {
|
||||
final EntityPlayer player = (EntityPlayer) event.entity;
|
||||
final ItemStack boots = player.inventory.armorItemInSlot(0);
|
||||
@@ -168,17 +172,21 @@ public class ItemVoidwalkerBoots extends ItemArmor
|
||||
if (boots != null && boots.getItem() == ItemRegistry.ItemVoidwalkerBoots) {
|
||||
player.motionY *= 1.25D;
|
||||
}
|
||||
if (sash != null && sash.getItem() instanceof ItemVoidwalkerSash && TaintedMagic.proxy.isSashEnabled(player)) {
|
||||
if (sash != null && sash.getItem() instanceof ItemVoidwalkerSash
|
||||
&& TaintedMagic.proxy.isSashEnabled(player)) {
|
||||
player.motionY *= 1.05D;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
private void particles (final World world, final EntityPlayer player) {
|
||||
final FXWispEG fx = new FXWispEG(world, player.posX + (Math.random() - Math.random()) * 0.5D,
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void particles(final World world, final EntityPlayer player) {
|
||||
final FXWispEG fx = new FXWispEG(
|
||||
world,
|
||||
player.posX + (Math.random() - Math.random()) * 0.5D,
|
||||
player.boundingBox.minY + 0.05D + (Math.random() - Math.random()) * 0.1D,
|
||||
player.posZ + (Math.random() - Math.random()) * 0.5D, player);
|
||||
player.posZ + (Math.random() - Math.random()) * 0.5D,
|
||||
player);
|
||||
ParticleEngine.instance.addEffect(world, fx);
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,6 @@ package taintedmagic.common.items.equipment;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.api.IBauble;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
@@ -13,6 +10,7 @@ import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import taintedmagic.client.handler.SashClientHandler;
|
||||
import taintedmagic.client.handler.SashServerHandler;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
@@ -20,10 +18,13 @@ import thaumcraft.api.IRunicArmor;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
import thaumcraft.api.ItemRunic;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.api.IBauble;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
public class ItemVoidwalkerSash extends ItemRunic implements IRunicArmor, IWarpingGear, IBauble {
|
||||
|
||||
public ItemVoidwalkerSash () {
|
||||
public ItemVoidwalkerSash() {
|
||||
super(20);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setTextureName("taintedmagic:ItemVoidwalkerSash");
|
||||
@@ -36,16 +37,15 @@ public class ItemVoidwalkerSash extends ItemRunic implements IRunicArmor, IWarpi
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.epic;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
public void addInformation(final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
if (TaintedMagic.proxy.isSashEnabled(player)) {
|
||||
list.add(EnumChatFormatting.GREEN + StatCollector.translateToLocal("text.sash.speed.on"));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
list.add(EnumChatFormatting.RED + StatCollector.translateToLocal("text.sash.speed.off"));
|
||||
}
|
||||
|
||||
@@ -53,46 +53,45 @@ public class ItemVoidwalkerSash extends ItemRunic implements IRunicArmor, IWarpi
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp (final ItemStack stack, final EntityPlayer player) {
|
||||
public int getWarp(final ItemStack stack, final EntityPlayer player) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRunicCharge (final ItemStack stack) {
|
||||
public int getRunicCharge(final ItemStack stack) {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEquip (final ItemStack stack, final EntityLivingBase entity) {
|
||||
public boolean canEquip(final ItemStack stack, final EntityLivingBase entity) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUnequip (final ItemStack stack, final EntityLivingBase entity) {
|
||||
public boolean canUnequip(final ItemStack stack, final EntityLivingBase entity) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BaubleType getBaubleType (final ItemStack stack) {
|
||||
public BaubleType getBaubleType(final ItemStack stack) {
|
||||
return BaubleType.BELT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEquipped (final ItemStack stack, final EntityLivingBase entity) {
|
||||
public void onEquipped(final ItemStack stack, final EntityLivingBase entity) {
|
||||
Thaumcraft.instance.runicEventHandler.isDirty = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUnequipped (final ItemStack stack, final EntityLivingBase entity) {
|
||||
public void onUnequipped(final ItemStack stack, final EntityLivingBase entity) {
|
||||
Thaumcraft.instance.runicEventHandler.isDirty = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWornTick (final ItemStack stack, final EntityLivingBase entity) {
|
||||
}
|
||||
public void onWornTick(final ItemStack stack, final EntityLivingBase entity) {}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick (final ItemStack stack, final World world, final EntityPlayer player) {
|
||||
public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer player) {
|
||||
if (player.isSneaking()) {
|
||||
if (world.isRemote) {
|
||||
SashClientHandler.toggle();
|
||||
|
||||
@@ -1,48 +1,49 @@
|
||||
package taintedmagic.common.items.equipment;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.IWarpingGear;
|
||||
import thaumcraft.common.items.armor.ItemGoggles;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemWarpedGoggles extends ItemGoggles implements IWarpingGear {
|
||||
|
||||
public ItemWarpedGoggles (final ArmorMaterial material, final int j, final int k) {
|
||||
public ItemWarpedGoggles(final ArmorMaterial material, final int j, final int k) {
|
||||
super(material, j, k);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setUnlocalizedName("ItemWarpedGoggles");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (final IIconRegister ir) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister ir) {
|
||||
icon = ir.registerIcon("taintedmagic:ItemWarpedGoggles");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getArmorTexture (final ItemStack stack, final Entity entity, final int slot, final String type) {
|
||||
public String getArmorTexture(final ItemStack stack, final Entity entity, final int slot, final String type) {
|
||||
return "taintedmagic:textures/models/ModelWarpedGoggles.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.rare;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp (final ItemStack stack, final EntityPlayer player) {
|
||||
public int getWarp(final ItemStack stack, final EntityPlayer player) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable (final ItemStack stack, final ItemStack repairItem) {
|
||||
public boolean getIsRepairable(final ItemStack stack, final ItemStack repairItem) {
|
||||
return repairItem.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial, 1, 0)) ? true
|
||||
: super.getIsRepairable(stack, repairItem);
|
||||
}
|
||||
|
||||
@@ -3,12 +3,13 @@ package taintedmagic.common.items.tools;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.api.IRepairable;
|
||||
|
||||
public class ItemHollowDagger extends ItemSword implements IRepairable {
|
||||
|
||||
public ItemHollowDagger (final ToolMaterial material) {
|
||||
public ItemHollowDagger(final ToolMaterial material) {
|
||||
super(material);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setUnlocalizedName("ItemHollowDagger");
|
||||
@@ -17,7 +18,7 @@ public class ItemHollowDagger extends ItemSword implements IRepairable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,6 @@ package taintedmagic.common.items.tools;
|
||||
import java.awt.Color;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
@@ -33,6 +28,10 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import taintedmagic.api.IHeldItemHUD;
|
||||
import taintedmagic.api.IRenderInventoryItem;
|
||||
import taintedmagic.client.model.ModelKatana;
|
||||
@@ -48,6 +47,8 @@ import thaumcraft.client.lib.UtilsFX;
|
||||
import thaumcraft.codechicken.lib.vec.Vector3;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.entities.projectile.EntityExplosiveOrb;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemKatana extends Item implements IWarpingGear, IRepairable, IRenderInventoryItem, IHeldItemHUD {
|
||||
|
||||
@@ -62,19 +63,19 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable, IRend
|
||||
// inscription attack cooldown (7 seconds)
|
||||
private static final int COOLDOWN_TICKS = 140;
|
||||
|
||||
private static final ResourceLocation TEXTURE_THAUMIUM =
|
||||
new ResourceLocation("taintedmagic:textures/models/ModelKatanaThaumium.png");
|
||||
private static final ResourceLocation TEXTURE_VOIDMETAL =
|
||||
new ResourceLocation("taintedmagic:textures/models/ModelKatanaVoidmetal.png");
|
||||
private static final ResourceLocation TEXTURE_SHADOWMETAL =
|
||||
new ResourceLocation("taintedmagic:textures/models/ModelKatanaShadowmetal.png");
|
||||
private static final ResourceLocation TEXTURE_THAUMIUM = new ResourceLocation(
|
||||
"taintedmagic:textures/models/ModelKatanaThaumium.png");
|
||||
private static final ResourceLocation TEXTURE_VOIDMETAL = new ResourceLocation(
|
||||
"taintedmagic:textures/models/ModelKatanaVoidmetal.png");
|
||||
private static final ResourceLocation TEXTURE_SHADOWMETAL = new ResourceLocation(
|
||||
"taintedmagic:textures/models/ModelKatanaShadowmetal.png");
|
||||
|
||||
public static final ModelKatana KATANA = new ModelKatana();
|
||||
public static final ModelSaya SAYA = new ModelSaya();
|
||||
|
||||
private int ticksInUse = 0;
|
||||
|
||||
public ItemKatana () {
|
||||
public ItemKatana() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setUnlocalizedName("ItemKatana");
|
||||
setHasSubtypes(true);
|
||||
@@ -82,35 +83,35 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable, IRend
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFull3D () {
|
||||
public boolean isFull3D() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock (final Block block, final ItemStack stack) {
|
||||
public boolean canHarvestBlock(final Block block, final ItemStack stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction (final ItemStack stack) {
|
||||
public EnumAction getItemUseAction(final ItemStack stack) {
|
||||
return EnumAction.bow;
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubItems (final Item item, final CreativeTabs tab, final List list) {
|
||||
public void getSubItems(final Item item, final CreativeTabs tab, final List list) {
|
||||
for (int a = 0; a < SUBTYPES; a++) {
|
||||
list.add(new ItemStack(this, 1, a));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName (final ItemStack stack) {
|
||||
public String getUnlocalizedName(final ItemStack stack) {
|
||||
return super.getUnlocalizedName() + "." + stack.getItemDamage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
public void addInformation(final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
if (stack.getItemDamage() == 1) {
|
||||
list.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("enchantment.special.sapless"));
|
||||
}
|
||||
@@ -123,24 +124,25 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable, IRend
|
||||
list.add("\u00A79+" + getAttackDamage(stack) + " " + StatCollector.translateToLocal("text.attackdamage"));
|
||||
|
||||
if (stack.hasTagCompound() && stack.stackTagCompound.hasKey(TAG_INSCRIPTION)) {
|
||||
list.add(EnumChatFormatting.GOLD + StatCollector
|
||||
.translateToLocal("text.katana.inscription." + stack.stackTagCompound.getInteger(TAG_INSCRIPTION)));
|
||||
list.add(
|
||||
EnumChatFormatting.GOLD + StatCollector.translateToLocal(
|
||||
"text.katana.inscription." + stack.stackTagCompound.getInteger(TAG_INSCRIPTION)));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp (final ItemStack stack, final EntityPlayer player) {
|
||||
public int getWarp(final ItemStack stack, final EntityPlayer player) {
|
||||
return stack.getItemDamage() == 0 ? 0 : stack.getItemDamage() == 1 ? 3 : 7;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity (final ItemStack stack, final EntityLivingBase entity, final EntityLivingBase player) {
|
||||
if (!entity.worldObj.isRemote && (! (entity instanceof EntityPlayer) || ! (player instanceof EntityPlayer)
|
||||
public boolean hitEntity(final ItemStack stack, final EntityLivingBase entity, final EntityLivingBase player) {
|
||||
if (!entity.worldObj.isRemote && (!(entity instanceof EntityPlayer) || !(player instanceof EntityPlayer)
|
||||
|| MinecraftServer.getServer().isPVPEnabled())) {
|
||||
// Sapping effects
|
||||
if (stack.getItemDamage() == 1) {
|
||||
@@ -155,46 +157,51 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable, IRend
|
||||
// Inscription effects
|
||||
if (hasAnyInscription(stack)) {
|
||||
switch (getInscription(stack)) {
|
||||
case 0 : {
|
||||
entity.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) player).setFireDamage(),
|
||||
getAttackDamage(stack));
|
||||
entity.setFire(3);
|
||||
break;
|
||||
case 0: {
|
||||
entity.attackEntityFrom(
|
||||
DamageSource.causePlayerDamage((EntityPlayer) player).setFireDamage(),
|
||||
getAttackDamage(stack));
|
||||
entity.setFire(3);
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
entity.attackEntityFrom(
|
||||
DamageSource.causePlayerDamage((EntityPlayer) player).setMagicDamage(),
|
||||
getAttackDamage(stack));
|
||||
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 140));
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
entity.attackEntityFrom(
|
||||
DamageSource.causePlayerDamage((EntityPlayer) player).setMagicDamage(),
|
||||
getAttackDamage(stack));
|
||||
entity.addPotionEffect(new PotionEffect(Potion.wither.id, 60));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
case 1 : {
|
||||
entity.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) player).setMagicDamage(),
|
||||
getAttackDamage(stack));
|
||||
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 140));
|
||||
break;
|
||||
}
|
||||
case 2 : {
|
||||
entity.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) player).setMagicDamage(),
|
||||
getAttackDamage(stack));
|
||||
entity.addPotionEffect(new PotionEffect(Potion.wither.id, 60));
|
||||
break;
|
||||
}
|
||||
default :
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
entity.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) player), getAttackDamage(stack));
|
||||
}
|
||||
}
|
||||
// Sound effect
|
||||
player.worldObj.playSoundAtEntity(player, "thaumcraft:swing", 0.5F + (float) Math.random(),
|
||||
player.worldObj.playSoundAtEntity(
|
||||
player,
|
||||
"thaumcraft:swing",
|
||||
0.5F + (float) Math.random(),
|
||||
0.5F + (float) Math.random());
|
||||
|
||||
return super.hitEntity(stack, entity, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxItemUseDuration (final ItemStack stack) {
|
||||
public int getMaxItemUseDuration(final ItemStack stack) {
|
||||
return 72000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick (final ItemStack stack, final World world, final EntityPlayer player) {
|
||||
public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer player) {
|
||||
if (!hasCooldown(stack)) {
|
||||
player.setItemInUse(stack, getMaxItemUseDuration(stack));
|
||||
}
|
||||
@@ -202,7 +209,7 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable, IRend
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUsingTick (final ItemStack stack, final EntityPlayer player, final int i) {
|
||||
public void onUsingTick(final ItemStack stack, final EntityPlayer player, final int i) {
|
||||
super.onUsingTick(stack, player, i);
|
||||
|
||||
ticksInUse = getMaxItemUseDuration(stack) - i;
|
||||
@@ -214,7 +221,7 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable, IRend
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerStoppedUsing (final ItemStack stack, final World world, final EntityPlayer player, final int i) {
|
||||
public void onPlayerStoppedUsing(final ItemStack stack, final World world, final EntityPlayer player, final int i) {
|
||||
super.onPlayerStoppedUsing(stack, world, player, i);
|
||||
|
||||
if (isFullyCharged(player)) {
|
||||
@@ -229,101 +236,125 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable, IRend
|
||||
}
|
||||
|
||||
if (mop.entityHit != null) {
|
||||
PacketHandler.INSTANCE
|
||||
.sendToServer(new PacketKatanaAttack(mop.entityHit, player, getAttackDamage(stack) * mul));
|
||||
PacketHandler.INSTANCE.sendToServer(
|
||||
new PacketKatanaAttack(mop.entityHit, player, getAttackDamage(stack) * mul));
|
||||
}
|
||||
}
|
||||
player.worldObj.playSoundAtEntity(player, "thaumcraft:swing", 0.5F + (float) Math.random(),
|
||||
player.worldObj.playSoundAtEntity(
|
||||
player,
|
||||
"thaumcraft:swing",
|
||||
0.5F + (float) Math.random(),
|
||||
0.5F + (float) Math.random());
|
||||
player.swingItem();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
switch (getInscription(stack)) {
|
||||
case 0 : // fireball
|
||||
{
|
||||
final EntityExplosiveOrb proj = new EntityExplosiveOrb(world, player);
|
||||
proj.strength = getAttackDamage(stack) * .25F;
|
||||
proj.posX += proj.motionX;
|
||||
proj.posY += proj.motionY;
|
||||
proj.posZ += proj.motionZ;
|
||||
case 0: // fireball
|
||||
{
|
||||
final EntityExplosiveOrb proj = new EntityExplosiveOrb(world, player);
|
||||
proj.strength = getAttackDamage(stack) * .25F;
|
||||
proj.posX += proj.motionX;
|
||||
proj.posY += proj.motionY;
|
||||
proj.posZ += proj.motionZ;
|
||||
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(proj);
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(proj);
|
||||
}
|
||||
player.swingItem();
|
||||
|
||||
break;
|
||||
}
|
||||
player.swingItem();
|
||||
case 1: // thunder
|
||||
{
|
||||
// get entities within 10 block radius
|
||||
final List<EntityLivingBase> ents = world.getEntitiesWithinAABB(
|
||||
EntityLivingBase.class,
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
player.posX,
|
||||
player.posY,
|
||||
player.posZ,
|
||||
player.posX + 1,
|
||||
player.posY + 1,
|
||||
player.posZ + 1).expand(10.0D, 10.0D, 10.0D));
|
||||
|
||||
break;
|
||||
}
|
||||
case 1 : // thunder
|
||||
{
|
||||
// get entities within 10 block radius
|
||||
final List<EntityLivingBase> ents = world.getEntitiesWithinAABB(EntityLivingBase.class,
|
||||
AxisAlignedBB.getBoundingBox(player.posX, player.posY, player.posZ, player.posX + 1,
|
||||
player.posY + 1, player.posZ + 1).expand(10.0D, 10.0D, 10.0D));
|
||||
if (ents != null && ents.size() > 0) {
|
||||
for (final EntityLivingBase entity : ents) {
|
||||
if (entity != player && entity.isEntityAlive() && !entity.isEntityInvulnerable()) {
|
||||
entity.attackEntityFrom(DamageSource.magic, getAttackDamage(stack) * 0.25F);
|
||||
|
||||
if (ents != null && ents.size() > 0) {
|
||||
for (final EntityLivingBase entity : ents) {
|
||||
if (entity != player && entity.isEntityAlive() && !entity.isEntityInvulnerable()) {
|
||||
entity.attackEntityFrom(DamageSource.magic, getAttackDamage(stack) * 0.25F);
|
||||
final Vector3 movement = TaintedMagicHelper
|
||||
.getVectorBetweenEntities(entity, player);
|
||||
entity.addVelocity(movement.x * 5.0D, 1.5D, movement.z * 5.0D);
|
||||
|
||||
final Vector3 movement = TaintedMagicHelper.getVectorBetweenEntities(entity, player);
|
||||
entity.addVelocity(movement.x * 5.0D, 1.5D, movement.z * 5.0D);
|
||||
|
||||
if (world.isRemote) {
|
||||
ItemFocusShockwave.spawnParticles(world, player, entity);
|
||||
if (world.isRemote) {
|
||||
ItemFocusShockwave.spawnParticles(world, player, entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
world.playSoundAtEntity(player, "taintedmagic:shockwave", 5.0F, 1.5F * (float) Math.random());
|
||||
player.swingItem();
|
||||
|
||||
break;
|
||||
}
|
||||
case 2: // heal
|
||||
{
|
||||
// heal 50% of missing health
|
||||
player.heal((player.getMaxHealth() - player.getHealth()) * 0.5F);
|
||||
|
||||
world.playSoundAtEntity(player, "taintedmagic:shockwave", 5.0F, 1.5F * (float) Math.random());
|
||||
player.swingItem();
|
||||
// get entities within 5 blocks
|
||||
final List<EntityLivingBase> ents = world.getEntitiesWithinAABB(
|
||||
EntityLivingBase.class,
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
player.posX,
|
||||
player.posY,
|
||||
player.posZ,
|
||||
player.posX + 1,
|
||||
player.posY + 1,
|
||||
player.posZ + 1).expand(5.0D, 5.0D, 5.0D));
|
||||
|
||||
break;
|
||||
}
|
||||
case 2 : // heal
|
||||
{
|
||||
// heal 50% of missing health
|
||||
player.heal( (player.getMaxHealth() - player.getHealth()) * 0.5F);
|
||||
|
||||
// get entities within 5 blocks
|
||||
final List<EntityLivingBase> ents = world.getEntitiesWithinAABB(EntityLivingBase.class,
|
||||
AxisAlignedBB.getBoundingBox(player.posX, player.posY, player.posZ, player.posX + 1,
|
||||
player.posY + 1, player.posZ + 1).expand(5.0D, 5.0D, 5.0D));
|
||||
|
||||
// add wither to all entities in range
|
||||
if (ents != null && ents.size() > 0) {
|
||||
for (final EntityLivingBase entity : ents)
|
||||
if (entity != player && entity.isEntityAlive() && !entity.isEntityInvulnerable()) {
|
||||
entity.addPotionEffect(new PotionEffect(Potion.wither.id, 100, 1));
|
||||
}
|
||||
}
|
||||
|
||||
// beneficial effects on the player
|
||||
player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 60, 1));
|
||||
player.addPotionEffect(new PotionEffect(Potion.resistance.id, 120, 1));
|
||||
|
||||
// particles similar to pech focus
|
||||
if (world.isRemote) {
|
||||
for (int a = 0; a < 18; a++) {
|
||||
Thaumcraft.proxy.wispFX2(world, player.posX + world.rand.nextGaussian() * 0.25F,
|
||||
player.boundingBox.minY + 1.0F + world.rand.nextGaussian() * 0.5F,
|
||||
player.posZ + world.rand.nextGaussian() * 0.25F, 0.25F + (float) Math.random() * 0.25F, 3,
|
||||
true, false, 0.02F);
|
||||
|
||||
Thaumcraft.proxy.sparkle((float) player.posX + (float) world.rand.nextGaussian() * 0.25F,
|
||||
(float) player.boundingBox.minY + 1.0F + (float) world.rand.nextGaussian() * 0.5F,
|
||||
(float) player.posZ + (float) world.rand.nextGaussian() * 0.25F, 5);
|
||||
// add wither to all entities in range
|
||||
if (ents != null && ents.size() > 0) {
|
||||
for (final EntityLivingBase entity : ents)
|
||||
if (entity != player && entity.isEntityAlive() && !entity.isEntityInvulnerable()) {
|
||||
entity.addPotionEffect(new PotionEffect(Potion.wither.id, 100, 1));
|
||||
}
|
||||
}
|
||||
|
||||
// beneficial effects on the player
|
||||
player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 60, 1));
|
||||
player.addPotionEffect(new PotionEffect(Potion.resistance.id, 120, 1));
|
||||
|
||||
// particles similar to pech focus
|
||||
if (world.isRemote) {
|
||||
for (int a = 0; a < 18; a++) {
|
||||
Thaumcraft.proxy.wispFX2(
|
||||
world,
|
||||
player.posX + world.rand.nextGaussian() * 0.25F,
|
||||
player.boundingBox.minY + 1.0F + world.rand.nextGaussian() * 0.5F,
|
||||
player.posZ + world.rand.nextGaussian() * 0.25F,
|
||||
0.25F + (float) Math.random() * 0.25F,
|
||||
3,
|
||||
true,
|
||||
false,
|
||||
0.02F);
|
||||
|
||||
Thaumcraft.proxy.sparkle(
|
||||
(float) player.posX + (float) world.rand.nextGaussian() * 0.25F,
|
||||
(float) player.boundingBox.minY + 1.0F
|
||||
+ (float) world.rand.nextGaussian() * 0.5F,
|
||||
(float) player.posZ + (float) world.rand.nextGaussian() * 0.25F,
|
||||
5);
|
||||
}
|
||||
}
|
||||
|
||||
world.playSoundAtEntity(player, "thaumcraft:wand", 1.0F, 0.9F + (float) Math.random() * 0.1F);
|
||||
player.swingItem();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
world.playSoundAtEntity(player, "thaumcraft:wand", 1.0F, 0.9F + (float) Math.random() * 0.1F);
|
||||
player.swingItem();
|
||||
|
||||
break;
|
||||
}
|
||||
default :
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
setCooldown(stack, COOLDOWN_TICKS);
|
||||
}
|
||||
@@ -331,76 +362,78 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable, IRend
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate (final ItemStack stack, final World world, final Entity entity, final int i, final boolean b) {
|
||||
public void onUpdate(final ItemStack stack, final World world, final Entity entity, final int i, final boolean b) {
|
||||
// update the cooldown every tick
|
||||
if (hasCooldown(stack)) {
|
||||
setCooldown(stack, getCooldown(stack) - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isFullyCharged (final EntityPlayer player) {
|
||||
private boolean isFullyCharged(final EntityPlayer player) {
|
||||
final float f = Math.min((float) ticksInUse / (float) CHARGE_TICKS, 1.0F);
|
||||
return f == 1.0F;
|
||||
}
|
||||
|
||||
public static boolean hasAnyInscription (final ItemStack stack) {
|
||||
public static boolean hasAnyInscription(final ItemStack stack) {
|
||||
return stack.hasTagCompound() && stack.stackTagCompound.hasKey(TAG_INSCRIPTION);
|
||||
}
|
||||
|
||||
private int getInscription (final ItemStack stack) {
|
||||
private int getInscription(final ItemStack stack) {
|
||||
if (stack.hasTagCompound() && stack.stackTagCompound.hasKey(TAG_INSCRIPTION))
|
||||
return stack.stackTagCompound.getInteger(TAG_INSCRIPTION);
|
||||
return 0;
|
||||
}
|
||||
|
||||
private boolean hasCooldown (final ItemStack stack) {
|
||||
private boolean hasCooldown(final ItemStack stack) {
|
||||
return stack.hasTagCompound() && stack.stackTagCompound.getInteger(TAG_COOLDOWN) > 0;
|
||||
}
|
||||
|
||||
private void setCooldown (final ItemStack stack, final int cooldown) {
|
||||
private void setCooldown(final ItemStack stack, final int cooldown) {
|
||||
if (!stack.hasTagCompound()) {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
stack.stackTagCompound.setInteger(TAG_COOLDOWN, cooldown);
|
||||
}
|
||||
|
||||
private int getCooldown (final ItemStack stack) {
|
||||
private int getCooldown(final ItemStack stack) {
|
||||
if (stack.hasTagCompound() && stack.stackTagCompound.hasKey(TAG_COOLDOWN))
|
||||
return stack.stackTagCompound.getInteger(TAG_COOLDOWN);
|
||||
return 0;
|
||||
}
|
||||
|
||||
private float getAttackDamage (final ItemStack stack) {
|
||||
private float getAttackDamage(final ItemStack stack) {
|
||||
switch (stack.getItemDamage()) {
|
||||
case 0 :
|
||||
return 14.25F;
|
||||
case 1 :
|
||||
return 17.5F;
|
||||
case 2 :
|
||||
return 20.75F;
|
||||
case 0:
|
||||
return 14.25F;
|
||||
case 1:
|
||||
return 17.5F;
|
||||
case 2:
|
||||
return 20.75F;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static ResourceLocation getTexture (final ItemStack stack) {
|
||||
public static ResourceLocation getTexture(final ItemStack stack) {
|
||||
switch (stack.getItemDamage()) {
|
||||
case 0 :
|
||||
return TEXTURE_THAUMIUM;
|
||||
case 1 :
|
||||
return TEXTURE_VOIDMETAL;
|
||||
case 2 :
|
||||
return TEXTURE_SHADOWMETAL;
|
||||
case 0:
|
||||
return TEXTURE_THAUMIUM;
|
||||
case 1:
|
||||
return TEXTURE_VOIDMETAL;
|
||||
case 2:
|
||||
return TEXTURE_SHADOWMETAL;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderHUD (final ScaledResolution res, final EntityPlayer player, final ItemStack stack,
|
||||
public void renderHUD(final ScaledResolution res, final EntityPlayer player, final ItemStack stack,
|
||||
final float partialTicks, final float fract) {
|
||||
final Tessellator t = Tessellator.instance;
|
||||
|
||||
final float overlay = Math.min(hasCooldown(stack) ? (float) getCooldown(stack) / (float) COOLDOWN_TICKS
|
||||
: (float) player.getItemInUseDuration() / (float) CHARGE_TICKS, 1.0F);
|
||||
final float overlay = Math.min(
|
||||
hasCooldown(stack) ? (float) getCooldown(stack) / (float) COOLDOWN_TICKS
|
||||
: (float) player.getItemInUseDuration() / (float) CHARGE_TICKS,
|
||||
1.0F);
|
||||
|
||||
final float scale = 0.315F;
|
||||
|
||||
@@ -420,10 +453,10 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable, IRend
|
||||
UtilsFX.bindTexture(new ResourceLocation("thaumcraft:textures/misc/script.png"));
|
||||
|
||||
for (int rune = 0; rune < 16; rune++) {
|
||||
float red = MathHelper.sin( (player.ticksExisted + rune * 5) / 5.0F) * 0.1F + 0.8F;
|
||||
float green = MathHelper.sin( (player.ticksExisted + rune * 5) / 7.0F) * 0.1F + 0.7F;
|
||||
float red = MathHelper.sin((player.ticksExisted + rune * 5) / 5.0F) * 0.1F + 0.8F;
|
||||
float green = MathHelper.sin((player.ticksExisted + rune * 5) / 7.0F) * 0.1F + 0.7F;
|
||||
float blue = 0.4F;
|
||||
final float alpha = MathHelper.sin( (player.ticksExisted + rune * 5) / 10.0F) * 0.3F;
|
||||
final float alpha = MathHelper.sin((player.ticksExisted + rune * 5) / 10.0F) * 0.3F;
|
||||
|
||||
final float f = 0.0625F * rune;
|
||||
final float f1 = f + 0.0625F;
|
||||
@@ -446,7 +479,7 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable, IRend
|
||||
Color color = new Color(Color.HSBtoRGB(rune / 16F * 0.3F, 1.0F, 1.0F));
|
||||
// flip the gradient when cooling down
|
||||
if (hasCooldown(stack)) {
|
||||
color = new Color(Color.HSBtoRGB( (16F - rune) / 16F * 0.3F, 1.0F, 1.0F));
|
||||
color = new Color(Color.HSBtoRGB((16F - rune) / 16F * 0.3F, 1.0F, 1.0F));
|
||||
}
|
||||
// convert to float rgb
|
||||
red = color.getRed() / 255F;
|
||||
@@ -472,7 +505,7 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable, IRend
|
||||
|
||||
// render katana on hip
|
||||
@Override
|
||||
public void render (final EntityPlayer player, final ItemStack stack, final float partialTicks) {
|
||||
public void render(final EntityPlayer player, final ItemStack stack, final float partialTicks) {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
final int light = player.getBrightnessForRender(0);
|
||||
|
||||
@@ -16,6 +16,7 @@ import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.helper.TaintedMagicHelper;
|
||||
import thaumcraft.api.IRepairable;
|
||||
@@ -23,7 +24,7 @@ import thaumcraft.api.IWarpingGear;
|
||||
|
||||
public class ItemPrimalBlade extends ItemSword implements IWarpingGear, IRepairable {
|
||||
|
||||
public ItemPrimalBlade (final ToolMaterial material) {
|
||||
public ItemPrimalBlade(final ToolMaterial material) {
|
||||
super(material);
|
||||
setTextureName("taintedmagic:ItemPrimalBlade");
|
||||
setUnlocalizedName("ItemPrimalBlade");
|
||||
@@ -31,17 +32,17 @@ public class ItemPrimalBlade extends ItemSword implements IWarpingGear, IRepaira
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction (final ItemStack stack) {
|
||||
public EnumAction getItemUseAction(final ItemStack stack) {
|
||||
return EnumAction.block;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return TaintedMagic.rarityCreation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity (final ItemStack stack, final EntityLivingBase entity, final EntityLivingBase player) {
|
||||
public boolean hitEntity(final ItemStack stack, final EntityLivingBase entity, final EntityLivingBase player) {
|
||||
super.hitEntity(stack, entity, player);
|
||||
|
||||
entity.addPotionEffect(new PotionEffect(Potion.wither.id, 60, 1));
|
||||
@@ -53,17 +54,23 @@ public class ItemPrimalBlade extends ItemSword implements IWarpingGear, IRepaira
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick (final ItemStack stack, final World world, final EntityPlayer player) {
|
||||
public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer player) {
|
||||
player.setItemInUse(stack, getMaxItemUseDuration(stack));
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUsingTick (final ItemStack stack, final EntityPlayer player, final int i) {
|
||||
public void onUsingTick(final ItemStack stack, final EntityPlayer player, final int i) {
|
||||
|
||||
final List<Entity> ents = player.worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB
|
||||
.getBoundingBox(player.posX, player.posY, player.posZ, player.posX + 1, player.posY + 1, player.posZ + 1)
|
||||
.expand(15.0D, 15.0D, 15.0D));
|
||||
final List<Entity> ents = player.worldObj.getEntitiesWithinAABB(
|
||||
Entity.class,
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
player.posX,
|
||||
player.posY,
|
||||
player.posZ,
|
||||
player.posX + 1,
|
||||
player.posY + 1,
|
||||
player.posZ + 1).expand(15.0D, 15.0D, 15.0D));
|
||||
|
||||
if (player.ticksExisted % 10 == 0) {
|
||||
player.worldObj.playSoundAtEntity(player, "thaumcraft:brain", 0.05F, 0.5F);
|
||||
@@ -73,7 +80,8 @@ public class ItemPrimalBlade extends ItemSword implements IWarpingGear, IRepaira
|
||||
for (final Entity entity : ents) {
|
||||
if (entity != player) {
|
||||
if (entity.isEntityAlive() && !entity.isEntityInvulnerable()) {
|
||||
final double dist = TaintedMagicHelper.getDistanceTo(player, entity.posX, entity.posY, entity.posZ);
|
||||
final double dist = TaintedMagicHelper
|
||||
.getDistanceTo(player, entity.posX, entity.posY, entity.posZ);
|
||||
if (dist < 2.0D) {
|
||||
entity.attackEntityFrom(DamageSource.magic, 3.0F);
|
||||
}
|
||||
@@ -97,19 +105,19 @@ public class ItemPrimalBlade extends ItemSword implements IWarpingGear, IRepaira
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate (final ItemStack stack, final World world, final Entity entity, final int i, final boolean b) {
|
||||
public void onUpdate(final ItemStack stack, final World world, final Entity entity, final int i, final boolean b) {
|
||||
if (!world.isRemote && stack.isItemDamaged() && entity.ticksExisted % 20 == 0) {
|
||||
stack.damageItem(-1, (EntityLivingBase) entity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
public void addInformation(final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
list.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("text.sapprimal"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWarp (final ItemStack stack, final EntityPlayer player) {
|
||||
public int getWarp(final ItemStack stack, final EntityPlayer player) {
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
@@ -3,13 +3,14 @@ package taintedmagic.common.items.tools;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.IRepairable;
|
||||
|
||||
public class ItemShadowmetalAxe extends ItemAxe implements IRepairable {
|
||||
|
||||
public ItemShadowmetalAxe (final ToolMaterial material) {
|
||||
public ItemShadowmetalAxe(final ToolMaterial material) {
|
||||
super(material);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setTextureName("taintedmagic:ItemShadowmetalAxe");
|
||||
@@ -17,13 +18,13 @@ public class ItemShadowmetalAxe extends ItemAxe implements IRepairable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable (final ItemStack stack, final ItemStack repairItem) {
|
||||
public boolean getIsRepairable(final ItemStack stack, final ItemStack repairItem) {
|
||||
return repairItem.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial, 1, 0)) ? true
|
||||
: super.getIsRepairable(stack, repairItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package taintedmagic.common.items.tools;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -11,13 +9,16 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.UseHoeEvent;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.IRepairable;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class ItemShadowmetalHoe extends ItemHoe implements IRepairable {
|
||||
|
||||
public ItemShadowmetalHoe (final ToolMaterial material) {
|
||||
public ItemShadowmetalHoe(final ToolMaterial material) {
|
||||
super(material);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setTextureName("taintedmagic:ItemShadowmetalHoe");
|
||||
@@ -28,14 +29,14 @@ public class ItemShadowmetalHoe extends ItemHoe implements IRepairable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable (final ItemStack stack, final ItemStack repairItem) {
|
||||
public boolean getIsRepairable(final ItemStack stack, final ItemStack repairItem) {
|
||||
return repairItem.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial, 1, 0)) ? true
|
||||
: super.getIsRepairable(stack, repairItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse (final ItemStack stack, final EntityPlayer player, final World world, final int x, final int y,
|
||||
final int z, final int i, final float f, final float f1, final float f2) {
|
||||
public boolean onItemUse(final ItemStack stack, final EntityPlayer player, final World world, final int x,
|
||||
final int y, final int z, final int i, final float f, final float f1, final float f2) {
|
||||
super.onItemUse(stack, player, world, x, y, z, i, f, f1, f2);
|
||||
|
||||
if (!player.worldObj.isRemote) {
|
||||
@@ -44,15 +45,25 @@ public class ItemShadowmetalHoe extends ItemHoe implements IRepairable {
|
||||
if (player.worldObj.getBlock(x, y, z) == Blocks.farmland) {
|
||||
player.worldObj.setBlock(x, y, z, Blocks.dirt);
|
||||
stack.damageItem(1, player);
|
||||
world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, dirt.stepSound.getStepResourcePath(),
|
||||
(dirt.stepSound.getVolume() + 1.0F) / 2.0F, dirt.stepSound.getPitch() * 0.8F);
|
||||
}
|
||||
else if (player.worldObj.getBlock(x, y, z) == Blocks.dirt || player.worldObj.getBlock(x, y, z) == Blocks.grass) {
|
||||
player.worldObj.setBlock(x, y, z, Blocks.farmland);
|
||||
stack.damageItem(1, player);
|
||||
world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, dirt.stepSound.getStepResourcePath(),
|
||||
(dirt.stepSound.getVolume() + 1.0F) / 2.0F, dirt.stepSound.getPitch() * 0.8F);
|
||||
}
|
||||
world.playSoundEffect(
|
||||
x + 0.5F,
|
||||
y + 0.5F,
|
||||
z + 0.5F,
|
||||
dirt.stepSound.getStepResourcePath(),
|
||||
(dirt.stepSound.getVolume() + 1.0F) / 2.0F,
|
||||
dirt.stepSound.getPitch() * 0.8F);
|
||||
} else if (player.worldObj.getBlock(x, y, z) == Blocks.dirt
|
||||
|| player.worldObj.getBlock(x, y, z) == Blocks.grass) {
|
||||
player.worldObj.setBlock(x, y, z, Blocks.farmland);
|
||||
stack.damageItem(1, player);
|
||||
world.playSoundEffect(
|
||||
x + 0.5F,
|
||||
y + 0.5F,
|
||||
z + 0.5F,
|
||||
dirt.stepSound.getStepResourcePath(),
|
||||
(dirt.stepSound.getVolume() + 1.0F) / 2.0F,
|
||||
dirt.stepSound.getPitch() * 0.8F);
|
||||
}
|
||||
}
|
||||
if (player.worldObj.getBlock(x, y, z) == Blocks.dirt || player.worldObj.getBlock(x, y, z) == Blocks.grass
|
||||
|| player.worldObj.getBlock(x, y, z) == Blocks.farmland) {
|
||||
@@ -62,14 +73,14 @@ public class ItemShadowmetalHoe extends ItemHoe implements IRepairable {
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void useHoe (final UseHoeEvent event) {
|
||||
public void useHoe(final UseHoeEvent event) {
|
||||
if (event.current.getItem() == ItemRegistry.ItemShadowmetalHoe) {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -3,13 +3,14 @@ package taintedmagic.common.items.tools;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.IRepairable;
|
||||
|
||||
public class ItemShadowmetalPick extends ItemPickaxe implements IRepairable {
|
||||
|
||||
public ItemShadowmetalPick (final ToolMaterial material) {
|
||||
public ItemShadowmetalPick(final ToolMaterial material) {
|
||||
super(material);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setTextureName("taintedmagic:ItemShadowmetalPick");
|
||||
@@ -17,13 +18,13 @@ public class ItemShadowmetalPick extends ItemPickaxe implements IRepairable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable (final ItemStack stack, final ItemStack repairItem) {
|
||||
public boolean getIsRepairable(final ItemStack stack, final ItemStack repairItem) {
|
||||
return repairItem.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial, 1, 0)) ? true
|
||||
: super.getIsRepairable(stack, repairItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -3,13 +3,14 @@ package taintedmagic.common.items.tools;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.IRepairable;
|
||||
|
||||
public class ItemShadowmetalSpade extends ItemSpade implements IRepairable {
|
||||
|
||||
public ItemShadowmetalSpade (final ToolMaterial material) {
|
||||
public ItemShadowmetalSpade(final ToolMaterial material) {
|
||||
super(material);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setTextureName("taintedmagic:ItemShadowmetalSpade");
|
||||
@@ -17,13 +18,13 @@ public class ItemShadowmetalSpade extends ItemSpade implements IRepairable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable (final ItemStack stack, final ItemStack repairItem) {
|
||||
public boolean getIsRepairable(final ItemStack stack, final ItemStack repairItem) {
|
||||
return repairItem.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial, 1, 0)) ? true
|
||||
: super.getIsRepairable(stack, repairItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -3,13 +3,14 @@ package taintedmagic.common.items.tools;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import thaumcraft.api.IRepairable;
|
||||
|
||||
public class ItemShadowmetalSword extends ItemSword implements IRepairable {
|
||||
|
||||
public ItemShadowmetalSword (final ToolMaterial material) {
|
||||
public ItemShadowmetalSword(final ToolMaterial material) {
|
||||
super(material);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setTextureName("taintedmagic:ItemShadowmetalSword");
|
||||
@@ -17,13 +18,13 @@ public class ItemShadowmetalSword extends ItemSword implements IRepairable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsRepairable (final ItemStack stack, final ItemStack repairItem) {
|
||||
public boolean getIsRepairable(final ItemStack stack, final ItemStack repairItem) {
|
||||
return repairItem.isItemEqual(new ItemStack(ItemRegistry.ItemMaterial, 1, 0)) ? true
|
||||
: super.getIsRepairable(stack, repairItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package taintedmagic.common.items.tools;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -18,11 +17,13 @@ import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.UseHoeEvent;
|
||||
|
||||
import taintedmagic.client.handler.HUDHandler;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.common.items.wands.WandManager;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
|
||||
public class ItemThaumicDisassembler extends Item {
|
||||
|
||||
@@ -33,7 +34,7 @@ public class ItemThaumicDisassembler extends Item {
|
||||
public static final int ENTROPY_USAGE_HOE = ENTROPY_USAGE_BASE * 5;
|
||||
public static final int ENTROPY_USAGE_HIT = ENTROPY_USAGE_BASE * 10;
|
||||
|
||||
public ItemThaumicDisassembler () {
|
||||
public ItemThaumicDisassembler() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("ItemThaumicDisassembler");
|
||||
@@ -41,40 +42,45 @@ public class ItemThaumicDisassembler extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar (final ItemStack stack) {
|
||||
public boolean showDurabilityBar(final ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay (final ItemStack stack) {
|
||||
public double getDurabilityForDisplay(final ItemStack stack) {
|
||||
return 1d - (double) getEntropyCharge(stack) / (double) MAX_CHARGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
public void addInformation(final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
super.addInformation(stack, player, list, b);
|
||||
|
||||
list.add(StatCollector.translateToLocal("text.disassembler.charge") + ": " + EnumChatFormatting.DARK_GRAY
|
||||
+ getEntropyCharge(stack) / 100 + "/" + MAX_CHARGE / 100);
|
||||
list.add(
|
||||
StatCollector.translateToLocal("text.disassembler.charge") + ": "
|
||||
+ EnumChatFormatting.DARK_GRAY
|
||||
+ getEntropyCharge(stack) / 100
|
||||
+ "/"
|
||||
+ MAX_CHARGE / 100);
|
||||
list.add(StatCollector.translateToLocal("text.disassembler.mode") + ": " + getModeName(stack));
|
||||
list.add(StatCollector.translateToLocal("text.disassembler.efficiency") + ": "
|
||||
+ (getMode(stack) == 3 ? EnumChatFormatting.RED : EnumChatFormatting.GREEN) + getEfficiency(stack));
|
||||
list.add(
|
||||
StatCollector.translateToLocal("text.disassembler.efficiency") + ": "
|
||||
+ (getMode(stack) == 3 ? EnumChatFormatting.RED : EnumChatFormatting.GREEN)
|
||||
+ getEfficiency(stack));
|
||||
list.add(" ");
|
||||
list.add(EnumChatFormatting.BLUE + "+20 " + StatCollector.translateToLocal("text.attackdamage"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock (final Block block, final ItemStack stack) {
|
||||
public boolean canHarvestBlock(final Block block, final ItemStack stack) {
|
||||
return block != Blocks.bedrock;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity (final ItemStack stack, final EntityLivingBase entity, final EntityLivingBase player) {
|
||||
public boolean hitEntity(final ItemStack stack, final EntityLivingBase entity, final EntityLivingBase player) {
|
||||
if (getEntropyCharge(stack) > 0) {
|
||||
entity.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) player), 20);
|
||||
consumeEntropy(stack, ENTROPY_USAGE_HIT);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
entity.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) player), 4);
|
||||
}
|
||||
|
||||
@@ -82,13 +88,13 @@ public class ItemThaumicDisassembler extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDigSpeed (final ItemStack stack, final Block block, final int meta) {
|
||||
public float getDigSpeed(final ItemStack stack, final Block block, final int meta) {
|
||||
return getEntropyCharge(stack) != 0 ? getEfficiency(stack) : 1f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed (final ItemStack stack, final World world, final Block block, final int x, final int y,
|
||||
final int z, final EntityLivingBase entity) {
|
||||
public boolean onBlockDestroyed(final ItemStack stack, final World world, final Block block, final int x,
|
||||
final int y, final int z, final EntityLivingBase entity) {
|
||||
if (block.getBlockHardness(world, x, y, z) != 0.0D) {
|
||||
consumeEntropy(stack, (int) ((double) ENTROPY_USAGE_BASE * (double) getEfficiency(stack) / 8d));
|
||||
}
|
||||
@@ -96,40 +102,43 @@ public class ItemThaumicDisassembler extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFull3D () {
|
||||
public boolean isFull3D() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick (final ItemStack stack, final World world, final EntityPlayer player) {
|
||||
public ItemStack onItemRightClick(final ItemStack stack, final World world, final EntityPlayer player) {
|
||||
if (player.isSneaking()) {
|
||||
if (stack.stackTagCompound == null) {
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
}
|
||||
stack.stackTagCompound.setInteger(TAG_MODE, getMode(stack) < 3 ? getMode(stack) + 1 : 0);
|
||||
|
||||
final String str = EnumChatFormatting.GRAY + StatCollector.translateToLocal("text.disassembler.mode") + ": "
|
||||
+ getModeName(getMode(stack)) + (getMode(stack) == 3 ? EnumChatFormatting.RED : EnumChatFormatting.GREEN)
|
||||
+ " (" + getEfficiency(getMode(stack)) + ")";
|
||||
final String str = EnumChatFormatting.GRAY + StatCollector.translateToLocal("text.disassembler.mode")
|
||||
+ ": "
|
||||
+ getModeName(getMode(stack))
|
||||
+ (getMode(stack) == 3 ? EnumChatFormatting.RED : EnumChatFormatting.GREEN)
|
||||
+ " ("
|
||||
+ getEfficiency(getMode(stack))
|
||||
+ ")";
|
||||
HUDHandler.displayString(str, 300, false);
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse (final ItemStack stack, final EntityPlayer player, final World world, final int x, final int y,
|
||||
final int z, final int side, final float hitX, final float hitY, final float hitZ) {
|
||||
public boolean onItemUse(final ItemStack stack, final EntityPlayer player, final World world, final int x,
|
||||
final int y, final int z, final int side, final float hitX, final float hitY, final float hitZ) {
|
||||
if (!player.isSneaking() && getMode(stack) != 3) {
|
||||
if (!useHoe(stack, player, world, x, y, z, side) && world.getBlock(x, y, z) != Blocks.farmland)
|
||||
return false;
|
||||
|
||||
if (getMode(stack) == 1)
|
||||
return true;
|
||||
if (getMode(stack) == 1) return true;
|
||||
|
||||
final int rad = getMode(stack) == 0 ? 1 : 2;
|
||||
for (int x1 = x - rad; x1 <= x + rad; x1++) {
|
||||
@@ -142,15 +151,14 @@ public class ItemThaumicDisassembler extends Item {
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean useHoe (final ItemStack stack, final EntityPlayer player, final World world, final int x, final int y,
|
||||
final int z, final int side) {
|
||||
private boolean useHoe(final ItemStack stack, final EntityPlayer player, final World world, final int x,
|
||||
final int y, final int z, final int side) {
|
||||
if (!player.canPlayerEdit(x, y, z, side, stack)
|
||||
|| !player.capabilities.isCreativeMode && getEntropyCharge(stack) < ENTROPY_USAGE_HOE)
|
||||
return false;
|
||||
|
||||
final UseHoeEvent event = new UseHoeEvent(player, stack, world, x, y, z);
|
||||
if (MinecraftForge.EVENT_BUS.post(event))
|
||||
return false;
|
||||
if (MinecraftForge.EVENT_BUS.post(event)) return false;
|
||||
|
||||
if (event.getResult() == Result.ALLOW) {
|
||||
consumeEntropy(stack, ENTROPY_USAGE_HOE);
|
||||
@@ -160,12 +168,16 @@ public class ItemThaumicDisassembler extends Item {
|
||||
final Block block = world.getBlock(x, y, z);
|
||||
final boolean air = world.isAirBlock(x, y + 1, z);
|
||||
|
||||
if (side == 0 || !air || block != Blocks.grass && block != Blocks.dirt)
|
||||
return false;
|
||||
if (side == 0 || !air || block != Blocks.grass && block != Blocks.dirt) return false;
|
||||
|
||||
final Block farm = Blocks.farmland;
|
||||
world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, farm.stepSound.getStepResourcePath(),
|
||||
(farm.stepSound.getVolume() + 1.0F) / 2.0F, farm.stepSound.getPitch() * 0.8F);
|
||||
world.playSoundEffect(
|
||||
x + 0.5F,
|
||||
y + 0.5F,
|
||||
z + 0.5F,
|
||||
farm.stepSound.getStepResourcePath(),
|
||||
(farm.stepSound.getVolume() + 1.0F) / 2.0F,
|
||||
farm.stepSound.getPitch() * 0.8F);
|
||||
|
||||
if (!world.isRemote) {
|
||||
world.setBlock(x, y, z, farm);
|
||||
@@ -176,70 +188,68 @@ public class ItemThaumicDisassembler extends Item {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static int getEfficiency (final int mode) {
|
||||
public static int getEfficiency(final int mode) {
|
||||
switch (mode) {
|
||||
case 0 :
|
||||
return 20;
|
||||
case 1 :
|
||||
return 8;
|
||||
case 2 :
|
||||
return 128;
|
||||
case 3 :
|
||||
return 0;
|
||||
case 0:
|
||||
return 20;
|
||||
case 1:
|
||||
return 8;
|
||||
case 2:
|
||||
return 128;
|
||||
case 3:
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int getEfficiency (final ItemStack stack) {
|
||||
public static int getEfficiency(final ItemStack stack) {
|
||||
return getEfficiency(getMode(stack));
|
||||
}
|
||||
|
||||
public static int getMode (final ItemStack stack) {
|
||||
if (stack.stackTagCompound == null)
|
||||
return 0;
|
||||
public static int getMode(final ItemStack stack) {
|
||||
if (stack.stackTagCompound == null) return 0;
|
||||
return stack.stackTagCompound.getInteger(TAG_MODE);
|
||||
}
|
||||
|
||||
public static String getModeName (final int mode) {
|
||||
public static String getModeName(final int mode) {
|
||||
switch (mode) {
|
||||
case 0 :
|
||||
return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.normal");
|
||||
case 1 :
|
||||
return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.slow");
|
||||
case 2 :
|
||||
return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.fast");
|
||||
case 3 :
|
||||
return "\u00A7c" + StatCollector.translateToLocal("text.disassembler.off");
|
||||
case 0:
|
||||
return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.normal");
|
||||
case 1:
|
||||
return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.slow");
|
||||
case 2:
|
||||
return "\u00A7a" + StatCollector.translateToLocal("text.disassembler.fast");
|
||||
case 3:
|
||||
return "\u00A7c" + StatCollector.translateToLocal("text.disassembler.off");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getModeName (final ItemStack stack) {
|
||||
public static String getModeName(final ItemStack stack) {
|
||||
return getModeName(getMode(stack));
|
||||
}
|
||||
|
||||
private void addEntropy (final ItemStack stack, final int amount) {
|
||||
private void addEntropy(final ItemStack stack, final int amount) {
|
||||
if (stack.getTagCompound() == null) {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
stack.getTagCompound().setInteger(TAG_CHARGE, getEntropyCharge(stack) + amount);
|
||||
}
|
||||
|
||||
private void consumeEntropy (final ItemStack stack, final int amount) {
|
||||
private void consumeEntropy(final ItemStack stack, final int amount) {
|
||||
if (stack.getTagCompound() == null) {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
stack.getTagCompound().setInteger(TAG_CHARGE, getEntropyCharge(stack) - amount);
|
||||
}
|
||||
|
||||
private int getEntropyCharge (final ItemStack stack) {
|
||||
if (stack.getTagCompound() == null)
|
||||
return 0;
|
||||
private int getEntropyCharge(final ItemStack stack) {
|
||||
if (stack.getTagCompound() == null) return 0;
|
||||
return stack.getTagCompound().getInteger(TAG_CHARGE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate (final ItemStack stack, final World world, final Entity entity, final int i, final boolean b) {
|
||||
public void onUpdate(final ItemStack stack, final World world, final Entity entity, final int i, final boolean b) {
|
||||
super.onUpdate(stack, world, entity, i, b);
|
||||
if (entity instanceof EntityPlayer) {
|
||||
final EntityPlayer player = (EntityPlayer) entity;
|
||||
@@ -255,4 +265,4 @@ public class ItemThaumicDisassembler extends Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,56 +2,57 @@ package taintedmagic.common.items.wand;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemWandCap extends Item {
|
||||
|
||||
private static final int SUBTYPES = 4;
|
||||
private final IIcon[] icons = new IIcon[SUBTYPES];
|
||||
|
||||
public ItemWandCap () {
|
||||
public ItemWandCap() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setUnlocalizedName("ItemWandCap");
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (final IIconRegister ir) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister ir) {
|
||||
for (int i = 0; i < icons.length; i++) {
|
||||
icons[i] = ir.registerIcon("taintedmagic:ItemWandCap" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public IIcon getIconFromDamage (final int i) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(final int i) {
|
||||
return icons[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void getSubItems (final Item item, final CreativeTabs tab, final List list) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item item, final CreativeTabs tab, final List list) {
|
||||
for (int i = 0; i < SUBTYPES; i++) {
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName (final ItemStack stack) {
|
||||
public String getUnlocalizedName(final ItemStack stack) {
|
||||
return super.getUnlocalizedName() + "." + stack.getItemDamage();
|
||||
}
|
||||
}
|
||||
@@ -2,56 +2,57 @@ package taintedmagic.common.items.wand;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
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.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemWandRod extends Item {
|
||||
|
||||
private static final int SUBTYPES = 2;
|
||||
private final IIcon[] icons = new IIcon[SUBTYPES];
|
||||
|
||||
public ItemWandRod () {
|
||||
public ItemWandRod() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setUnlocalizedName("ItemWandRod");
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity (final ItemStack stack) {
|
||||
public EnumRarity getRarity(final ItemStack stack) {
|
||||
return EnumRarity.uncommon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (final IIconRegister ir) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister ir) {
|
||||
for (int i = 0; i < icons.length; i++) {
|
||||
icons[i] = ir.registerIcon("taintedmagic:ItemWandRod" + i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public IIcon getIconFromDamage (final int i) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(final int i) {
|
||||
return icons[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void getSubItems (final Item item, final CreativeTabs tab, final List list) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item item, final CreativeTabs tab, final List list) {
|
||||
for (int i = 0; i < SUBTYPES; i++) {
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName (final ItemStack stack) {
|
||||
public String getUnlocalizedName(final ItemStack stack) {
|
||||
return super.getUnlocalizedName() + "." + stack.getItemDamage();
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,12 @@
|
||||
package taintedmagic.common.items.wand.foci;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.entities.EntityDarkMatter;
|
||||
import taintedmagic.common.entities.EntityDiffusion;
|
||||
@@ -18,6 +17,8 @@ import thaumcraft.api.wands.FocusUpgradeType;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFocusDarkMatter extends ItemFocusBasic {
|
||||
|
||||
@@ -29,59 +30,59 @@ public class ItemFocusDarkMatter extends ItemFocusBasic {
|
||||
private static final AspectList COST_SANITY = COST.copy().add(Aspect.ORDER, 50);
|
||||
private static final AspectList COST_CORROSIVE = COST.copy().add(Aspect.WATER, 50);
|
||||
|
||||
public ItemFocusDarkMatter () {
|
||||
public ItemFocusDarkMatter() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setUnlocalizedName("ItemFocusDarkMatter");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (final IIconRegister ir) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister ir) {
|
||||
icon = ir.registerIcon("taintedmagic:ItemFocusDarkMatter");
|
||||
depthIcon = ir.registerIcon("taintedmagic:ItemFocusDarkMatter_depth");
|
||||
ornIcon = ir.registerIcon("thaumcraft:focus_warding_orn");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getFocusDepthLayerIcon (final ItemStack stack) {
|
||||
public IIcon getFocusDepthLayerIcon(final ItemStack stack) {
|
||||
return depthIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getOrnament (final ItemStack stack) {
|
||||
public IIcon getOrnament(final ItemStack stack) {
|
||||
return ornIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses () {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public int getRenderPasses (final int meta) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderPasses(final int meta) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public IIcon getIconFromDamageForRenderPass (final int meta, final int pass) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamageForRenderPass(final int meta, final int pass) {
|
||||
return pass == 0 ? ornIcon : icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper (final ItemStack stack) {
|
||||
public String getSortingHelper(final ItemStack stack) {
|
||||
return "ELDRITCH" + super.getSortingHelper(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFocusColor (final ItemStack stack) {
|
||||
public int getFocusColor(final ItemStack stack) {
|
||||
return 0x000018;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost (final ItemStack stack) {
|
||||
public AspectList getVisCost(final ItemStack stack) {
|
||||
AspectList cost = isUpgradedWith(stack, TMFocusUpgrades.sanity) ? COST_SANITY
|
||||
: isUpgradedWith(stack, TMFocusUpgrades.corrosive) ? COST_CORROSIVE : COST;
|
||||
|
||||
@@ -95,33 +96,37 @@ public class ItemFocusDarkMatter extends ItemFocusBasic {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getActivationCooldown (final ItemStack stack) {
|
||||
public int getActivationCooldown(final ItemStack stack) {
|
||||
return isUpgradedWith(stack, TMFocusUpgrades.diffusion) ? -1 : 1000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisCostPerTick (final ItemStack stack) {
|
||||
public boolean isVisCostPerTick(final ItemStack stack) {
|
||||
return isUpgradedWith(stack, TMFocusUpgrades.diffusion);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation (final ItemStack stack) {
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation(final ItemStack stack) {
|
||||
return isUpgradedWith(stack, TMFocusUpgrades.diffusion) ? ItemFocusBasic.WandFocusAnimation.CHARGE
|
||||
: ItemFocusBasic.WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onFocusRightClick (final ItemStack stack, final World world, final EntityPlayer player,
|
||||
public ItemStack onFocusRightClick(final ItemStack stack, final World world, final EntityPlayer player,
|
||||
final MovingObjectPosition mop) {
|
||||
final ItemWandCasting wand = (ItemWandCasting) stack.getItem();
|
||||
|
||||
if (isUpgradedWith(wand.getFocusItem(stack), TMFocusUpgrades.diffusion)) {
|
||||
player.setItemInUse(stack, 2147483647);
|
||||
}
|
||||
else {
|
||||
if (!world.isRemote && wand.consumeAllVis(stack, player, getVisCost(wand.getFocusItem(stack)), true, false)) {
|
||||
final EntityDarkMatter proj = new EntityDarkMatter(world, player, 16F + wand.getFocusPotency(stack),
|
||||
wand.getFocusEnlarge(stack), isUpgradedWith(wand.getFocusItem(stack), TMFocusUpgrades.corrosive));
|
||||
} else {
|
||||
if (!world.isRemote
|
||||
&& wand.consumeAllVis(stack, player, getVisCost(wand.getFocusItem(stack)), true, false)) {
|
||||
final EntityDarkMatter proj = new EntityDarkMatter(
|
||||
world,
|
||||
player,
|
||||
16F + wand.getFocusPotency(stack),
|
||||
wand.getFocusEnlarge(stack),
|
||||
isUpgradedWith(wand.getFocusItem(stack), TMFocusUpgrades.corrosive));
|
||||
world.spawnEntityInWorld(proj);
|
||||
|
||||
if (!isUpgradedWith(wand.getFocusItem(stack), TMFocusUpgrades.sanity) && world.rand.nextInt(20) == 0) {
|
||||
@@ -136,7 +141,7 @@ public class ItemFocusDarkMatter extends ItemFocusBasic {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUsingFocusTick (final ItemStack stack, final EntityPlayer player, final int i) {
|
||||
public void onUsingFocusTick(final ItemStack stack, final EntityPlayer player, final int i) {
|
||||
final ItemWandCasting wand = (ItemWandCasting) stack.getItem();
|
||||
|
||||
if (!wand.consumeAllVis(stack, player, getVisCost(wand.getFocusItem(stack)), false, false)) {
|
||||
@@ -145,17 +150,25 @@ public class ItemFocusDarkMatter extends ItemFocusBasic {
|
||||
}
|
||||
|
||||
if (!player.worldObj.isRemote && soundDelay < System.currentTimeMillis()) {
|
||||
player.worldObj.playSoundAtEntity(player, "thaumcraft:wind", 0.3F + 0.2F * (float) Math.random(),
|
||||
player.worldObj.playSoundAtEntity(
|
||||
player,
|
||||
"thaumcraft:wind",
|
||||
0.3F + 0.2F * (float) Math.random(),
|
||||
0.75F + 0.25F * (float) Math.random());
|
||||
soundDelay = System.currentTimeMillis() + 750L;
|
||||
}
|
||||
|
||||
if (!player.worldObj.isRemote && wand.consumeAllVis(stack, player, getVisCost(wand.getFocusItem(stack)), true, false)) {
|
||||
if (!player.worldObj.isRemote
|
||||
&& wand.consumeAllVis(stack, player, getVisCost(wand.getFocusItem(stack)), true, false)) {
|
||||
for (int a = 0; a < 2 + wand.getFocusPotency(stack); a++) {
|
||||
final EntityDiffusion proj = new EntityDiffusion(player.worldObj, player,
|
||||
isUpgradedWith(wand.getFocusItem(stack), FocusUpgradeType.enlarge) ? 12.0F + wand.getFocusEnlarge(stack)
|
||||
final EntityDiffusion proj = new EntityDiffusion(
|
||||
player.worldObj,
|
||||
player,
|
||||
isUpgradedWith(wand.getFocusItem(stack), FocusUpgradeType.enlarge)
|
||||
? 12.0F + wand.getFocusEnlarge(stack)
|
||||
: 9.0F,
|
||||
12F + wand.getFocusPotency(stack), isUpgradedWith(wand.getFocusItem(stack), TMFocusUpgrades.corrosive));
|
||||
12F + wand.getFocusPotency(stack),
|
||||
isUpgradedWith(wand.getFocusItem(stack), TMFocusUpgrades.corrosive));
|
||||
|
||||
proj.posX += proj.motionX;
|
||||
proj.posY += proj.motionY;
|
||||
@@ -164,33 +177,37 @@ public class ItemFocusDarkMatter extends ItemFocusBasic {
|
||||
player.worldObj.spawnEntityInWorld(proj);
|
||||
}
|
||||
|
||||
if (!isUpgradedWith(wand.getFocusItem(stack), TMFocusUpgrades.sanity) && player.worldObj.rand.nextInt(1000) == 0) {
|
||||
if (!isUpgradedWith(wand.getFocusItem(stack), TMFocusUpgrades.sanity)
|
||||
&& player.worldObj.rand.nextInt(1000) == 0) {
|
||||
Thaumcraft.addStickyWarpToPlayer(player, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank (final ItemStack stack, final int rank) {
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(final ItemStack stack, final int rank) {
|
||||
switch (rank) {
|
||||
case 1 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency, FocusUpgradeType.enlarge };
|
||||
case 2 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency, FocusUpgradeType.enlarge };
|
||||
case 3 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency, FocusUpgradeType.enlarge,
|
||||
TMFocusUpgrades.corrosive, TMFocusUpgrades.sanity };
|
||||
case 4 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency, FocusUpgradeType.enlarge };
|
||||
case 5 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency, FocusUpgradeType.enlarge,
|
||||
TMFocusUpgrades.diffusion };
|
||||
case 1:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency,
|
||||
FocusUpgradeType.enlarge };
|
||||
case 2:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency,
|
||||
FocusUpgradeType.enlarge };
|
||||
case 3:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency,
|
||||
FocusUpgradeType.enlarge, TMFocusUpgrades.corrosive, TMFocusUpgrades.sanity };
|
||||
case 4:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency,
|
||||
FocusUpgradeType.enlarge };
|
||||
case 5:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency,
|
||||
FocusUpgradeType.enlarge, TMFocusUpgrades.diffusion };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canApplyUpgrade (final ItemStack stack, final EntityPlayer player, final FocusUpgradeType type,
|
||||
public boolean canApplyUpgrade(final ItemStack stack, final EntityPlayer player, final FocusUpgradeType type,
|
||||
final int rank) {
|
||||
return !type.equals(TMFocusUpgrades.diffusion)
|
||||
|| ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), "DIFFUSIONUPGRADE");
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
package taintedmagic.common.items.wand.foci;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.BlockRegistry;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
@@ -16,54 +15,56 @@ import thaumcraft.api.wands.ItemFocusBasic;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXSparkle;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFocusLumos extends ItemFocusBasic {
|
||||
|
||||
private static final AspectList COST = new AspectList().add(Aspect.AIR, 10).add(Aspect.FIRE, 25);
|
||||
|
||||
public ItemFocusLumos () {
|
||||
public ItemFocusLumos() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setUnlocalizedName("ItemFocusLumos");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (final IIconRegister ir) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister ir) {
|
||||
icon = ir.registerIcon("taintedmagic:ItemFocusLumos");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper (final ItemStack stack) {
|
||||
public String getSortingHelper(final ItemStack stack) {
|
||||
return "LUMOS" + super.getSortingHelper(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFocusColor (final ItemStack stack) {
|
||||
public int getFocusColor(final ItemStack stack) {
|
||||
return 0xC9D2F8;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost (final ItemStack stack) {
|
||||
public AspectList getVisCost(final ItemStack stack) {
|
||||
return COST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getActivationCooldown (final ItemStack stack) {
|
||||
public int getActivationCooldown(final ItemStack stack) {
|
||||
return 1000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisCostPerTick (final ItemStack stack) {
|
||||
public boolean isVisCostPerTick(final ItemStack stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation (final ItemStack stack) {
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation(final ItemStack stack) {
|
||||
return ItemFocusBasic.WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onFocusRightClick (final ItemStack stack, final World world, final EntityPlayer player,
|
||||
public ItemStack onFocusRightClick(final ItemStack stack, final World world, final EntityPlayer player,
|
||||
final MovingObjectPosition mop) {
|
||||
final ItemWandCasting wand = (ItemWandCasting) stack.getItem();
|
||||
|
||||
@@ -74,23 +75,23 @@ public class ItemFocusLumos extends ItemFocusBasic {
|
||||
|
||||
if (!world.getBlock(x, y, z).getMaterial().isReplaceable()) {
|
||||
switch (mop.sideHit) {
|
||||
case 0 :
|
||||
y--;
|
||||
break;
|
||||
case 1 :
|
||||
y++;
|
||||
break;
|
||||
case 2 :
|
||||
z--;
|
||||
break;
|
||||
case 3 :
|
||||
z++;
|
||||
break;
|
||||
case 4 :
|
||||
x--;
|
||||
break;
|
||||
case 5 :
|
||||
x++;
|
||||
case 0:
|
||||
y--;
|
||||
break;
|
||||
case 1:
|
||||
y++;
|
||||
break;
|
||||
case 2:
|
||||
z--;
|
||||
break;
|
||||
case 3:
|
||||
z++;
|
||||
break;
|
||||
case 4:
|
||||
x--;
|
||||
break;
|
||||
case 5:
|
||||
x++;
|
||||
}
|
||||
}
|
||||
if (world.getBlock(x, y, z).isReplaceable(world, x, y, z)
|
||||
@@ -100,37 +101,42 @@ public class ItemFocusLumos extends ItemFocusBasic {
|
||||
}
|
||||
world.playSoundAtEntity(player, "thaumcraft:ice", 0.3F, 1.1F + world.rand.nextFloat() * 0.1F);
|
||||
|
||||
for (int a = 0; a < 9; a++)
|
||||
if (world.isRemote) {
|
||||
spawnLumosParticles(world, x, y, z);
|
||||
}
|
||||
for (int a = 0; a < 9; a++) if (world.isRemote) {
|
||||
spawnLumosParticles(world, x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
player.swingItem();
|
||||
return stack;
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
void spawnLumosParticles (final World world, final double x, final double y, final double z) {
|
||||
final FXSparkle fx = new FXSparkle(world, x + world.rand.nextFloat(), y + world.rand.nextFloat(),
|
||||
z + world.rand.nextFloat(), 1.75F, 6, 3 + world.rand.nextInt(3));
|
||||
@SideOnly(Side.CLIENT)
|
||||
void spawnLumosParticles(final World world, final double x, final double y, final double z) {
|
||||
final FXSparkle fx = new FXSparkle(
|
||||
world,
|
||||
x + world.rand.nextFloat(),
|
||||
y + world.rand.nextFloat(),
|
||||
z + world.rand.nextFloat(),
|
||||
1.75F,
|
||||
6,
|
||||
3 + world.rand.nextInt(3));
|
||||
fx.setGravity(0.1F);
|
||||
ParticleEngine.instance.addEffect(world, fx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank (final ItemStack stack, final int rank) {
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(final ItemStack stack, final int rank) {
|
||||
switch (rank) {
|
||||
case 1 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal };
|
||||
case 2 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal };
|
||||
case 3 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal };
|
||||
case 4 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal };
|
||||
case 5 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal };
|
||||
case 1:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
|
||||
case 2:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
|
||||
case 3:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
|
||||
case 4:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
|
||||
case 5:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ package taintedmagic.common.items.wand.foci;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -13,12 +11,15 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.handler.ConfigHandler;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.wands.FocusUpgradeType;
|
||||
import thaumcraft.api.wands.ItemFocusBasic;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFocusMageMace extends ItemFocusBasic {
|
||||
|
||||
@@ -26,102 +27,105 @@ public class ItemFocusMageMace extends ItemFocusBasic {
|
||||
|
||||
private static final AspectList COST = new AspectList().add(Aspect.ENTROPY, 10);
|
||||
|
||||
public ItemFocusMageMace () {
|
||||
public ItemFocusMageMace() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setUnlocalizedName("ItemFocusMageMace");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (final IIconRegister ir) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister ir) {
|
||||
icon = ir.registerIcon("taintedmagic:ItemFocusMageMace");
|
||||
ornIcon = ir.registerIcon("taintedmagic:ItemFocusMageMace_orn");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getOrnament (final ItemStack stack) {
|
||||
public IIcon getOrnament(final ItemStack stack) {
|
||||
return ornIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses () {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public int getRenderPasses (final int meta) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderPasses(final int meta) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public IIcon getIconFromDamageForRenderPass (final int meta, final int pass) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamageForRenderPass(final int meta, final int pass) {
|
||||
return pass == 0 ? ornIcon : icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper (final ItemStack stack) {
|
||||
public String getSortingHelper(final ItemStack stack) {
|
||||
return "MACE" + super.getSortingHelper(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFocusColor (final ItemStack stack) {
|
||||
public int getFocusColor(final ItemStack stack) {
|
||||
return 0xACA9B5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost (final ItemStack stack) {
|
||||
public AspectList getVisCost(final ItemStack stack) {
|
||||
return COST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getActivationCooldown (final ItemStack stack) {
|
||||
public int getActivationCooldown(final ItemStack stack) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisCostPerTick (final ItemStack stack) {
|
||||
public boolean isVisCostPerTick(final ItemStack stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation (final ItemStack stack) {
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation(final ItemStack stack) {
|
||||
return WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onFocusRightClick (final ItemStack stack, final World world, final EntityPlayer player,
|
||||
public ItemStack onFocusRightClick(final ItemStack stack, final World world, final EntityPlayer player,
|
||||
final MovingObjectPosition mop) {
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
public void addInformation(final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
super.addInformation(stack, player, list, b);
|
||||
list.add(" ");
|
||||
|
||||
final DecimalFormat df = new DecimalFormat("0.#");
|
||||
final double dmg = ConfigHandler.MAGE_MACE_DMG_INC_BASE + getUpgradeLevel(stack, FocusUpgradeType.potency);
|
||||
|
||||
list.add(EnumChatFormatting.BLUE + "+" + df.format(dmg) + " "
|
||||
+ StatCollector.translateToLocal("text.attackdamageequipped"));
|
||||
list.add(
|
||||
EnumChatFormatting.BLUE + "+"
|
||||
+ df.format(dmg)
|
||||
+ " "
|
||||
+ StatCollector.translateToLocal("text.attackdamageequipped"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank (final ItemStack stack, final int rank) {
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(final ItemStack stack, final int rank) {
|
||||
switch (rank) {
|
||||
case 1 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 2 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 3 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 4 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 5 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 1:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 2:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 3:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 4:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 5:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ package taintedmagic.common.items.wand.foci;
|
||||
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.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -17,6 +15,7 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.helper.TaintedMagicHelper;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
@@ -27,6 +26,8 @@ import thaumcraft.client.fx.bolt.FXLightningBolt;
|
||||
import thaumcraft.codechicken.lib.vec.Vector3;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFocusShockwave extends ItemFocusBasic {
|
||||
|
||||
@@ -34,65 +35,69 @@ public class ItemFocusShockwave extends ItemFocusBasic {
|
||||
|
||||
private IIcon depthIcon;
|
||||
|
||||
public ItemFocusShockwave () {
|
||||
public ItemFocusShockwave() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setUnlocalizedName("ItemFocusShockwave");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (final IIconRegister ir) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister ir) {
|
||||
icon = ir.registerIcon("taintedmagic:ItemFocusShockwave");
|
||||
depthIcon = ir.registerIcon("taintedmagic:ItemFocusShockwave_depth");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getFocusDepthLayerIcon (final ItemStack stack) {
|
||||
public IIcon getFocusDepthLayerIcon(final ItemStack stack) {
|
||||
return depthIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper (final ItemStack stack) {
|
||||
public String getSortingHelper(final ItemStack stack) {
|
||||
return "SHOCKWAVE" + super.getSortingHelper(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFocusColor (final ItemStack stack) {
|
||||
public int getFocusColor(final ItemStack stack) {
|
||||
return 0xB0B7C4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost (final ItemStack stack) {
|
||||
public AspectList getVisCost(final ItemStack stack) {
|
||||
return COST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getActivationCooldown (final ItemStack stack) {
|
||||
public int getActivationCooldown(final ItemStack stack) {
|
||||
return 10000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisCostPerTick (final ItemStack stack) {
|
||||
public boolean isVisCostPerTick(final ItemStack stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation (final ItemStack stack) {
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation(final ItemStack stack) {
|
||||
return ItemFocusBasic.WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation (final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
public void addInformation(final ItemStack stack, final EntityPlayer player, final List list, final boolean b) {
|
||||
super.addInformation(stack, player, list, b);
|
||||
list.add(" ");
|
||||
list.add(EnumChatFormatting.BLUE + "+"
|
||||
+ new String(isUpgradedWith(stack, FocusUpgradeType.enlarge)
|
||||
? Integer.toString(15 + getUpgradeLevel(stack, FocusUpgradeType.enlarge)) : "15")
|
||||
+ " " + StatCollector.translateToLocal("text.radius"));
|
||||
list.add(
|
||||
EnumChatFormatting.BLUE + "+"
|
||||
+ new String(
|
||||
isUpgradedWith(stack, FocusUpgradeType.enlarge)
|
||||
? Integer.toString(15 + getUpgradeLevel(stack, FocusUpgradeType.enlarge))
|
||||
: "15")
|
||||
+ " "
|
||||
+ StatCollector.translateToLocal("text.radius"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onFocusRightClick (final ItemStack stack, final World world, final EntityPlayer player,
|
||||
public ItemStack onFocusRightClick(final ItemStack stack, final World world, final EntityPlayer player,
|
||||
final MovingObjectPosition mop) {
|
||||
final ItemWandCasting wand = (ItemWandCasting) stack.getItem();
|
||||
|
||||
@@ -100,16 +105,21 @@ public class ItemFocusShockwave extends ItemFocusBasic {
|
||||
final int enlarge = wand.getFocusEnlarge(stack);
|
||||
|
||||
if (wand.consumeAllVis(stack, player, getVisCost(stack), true, false)) {
|
||||
final List<EntityLivingBase> ents =
|
||||
world.getEntitiesWithinAABB(EntityLivingBase.class,
|
||||
AxisAlignedBB.getBoundingBox(player.posX, player.posY, player.posZ, player.posX + 1,
|
||||
player.posY + 1, player.posZ + 1)
|
||||
.expand(15.0D + enlarge, 15.0D + enlarge, 15.0D + enlarge));
|
||||
final List<EntityLivingBase> ents = world.getEntitiesWithinAABB(
|
||||
EntityLivingBase.class,
|
||||
AxisAlignedBB.getBoundingBox(
|
||||
player.posX,
|
||||
player.posY,
|
||||
player.posZ,
|
||||
player.posX + 1,
|
||||
player.posY + 1,
|
||||
player.posZ + 1).expand(15.0D + enlarge, 15.0D + enlarge, 15.0D + enlarge));
|
||||
|
||||
if (ents != null && ents.size() > 0) {
|
||||
for (final EntityLivingBase entity : ents) {
|
||||
if (entity != player && entity.isEntityAlive() && !entity.isEntityInvulnerable()) {
|
||||
final double dist = TaintedMagicHelper.getDistanceTo(player, entity.posX, entity.posY, entity.posZ);
|
||||
final double dist = TaintedMagicHelper
|
||||
.getDistanceTo(player, entity.posX, entity.posY, entity.posZ);
|
||||
|
||||
if (dist < 7.0D) {
|
||||
entity.attackEntityFrom(DamageSource.magic, 2.0F + potency);
|
||||
@@ -130,8 +140,8 @@ public class ItemFocusShockwave extends ItemFocusBasic {
|
||||
return null;
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
public static void spawnParticles (final World world, final EntityPlayer player, final Entity entity) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void spawnParticles(final World world, final EntityPlayer player, final Entity entity) {
|
||||
final FXLightningBolt bolt = new FXLightningBolt(world, player, entity, world.rand.nextLong(), 4);
|
||||
|
||||
bolt.defaultFractal();
|
||||
@@ -149,18 +159,23 @@ public class ItemFocusShockwave extends ItemFocusBasic {
|
||||
}
|
||||
|
||||
@Override
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank (final ItemStack stack, final int rank) {
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(final ItemStack stack, final int rank) {
|
||||
switch (rank) {
|
||||
case 1 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.enlarge, FocusUpgradeType.potency };
|
||||
case 2 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.enlarge, FocusUpgradeType.potency };
|
||||
case 3 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.enlarge, FocusUpgradeType.potency };
|
||||
case 4 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.enlarge, FocusUpgradeType.potency };
|
||||
case 5 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.enlarge, FocusUpgradeType.potency };
|
||||
case 1:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge,
|
||||
FocusUpgradeType.potency };
|
||||
case 2:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge,
|
||||
FocusUpgradeType.potency };
|
||||
case 3:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge,
|
||||
FocusUpgradeType.potency };
|
||||
case 4:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge,
|
||||
FocusUpgradeType.potency };
|
||||
case 5:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.enlarge,
|
||||
FocusUpgradeType.potency };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package taintedmagic.common.items.wand.foci;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -13,6 +11,7 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
@@ -22,6 +21,8 @@ import thaumcraft.common.config.Config;
|
||||
import thaumcraft.common.entities.monster.EntityTaintSwarm;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import thaumcraft.common.lib.utils.EntityUtils;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemFocusTaintSwarm extends ItemFocusBasic {
|
||||
|
||||
@@ -31,79 +32,79 @@ public class ItemFocusTaintSwarm extends ItemFocusBasic {
|
||||
private static final AspectList COST = new AspectList().add(Aspect.EARTH, 50).add(Aspect.WATER, 50);
|
||||
private static final AspectList COST_ANTIBODY = COST.copy().add(Aspect.ORDER, 10);
|
||||
|
||||
public ItemFocusTaintSwarm () {
|
||||
public ItemFocusTaintSwarm() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setUnlocalizedName("ItemFocusTaintSwarm");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (final IIconRegister ir) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister ir) {
|
||||
icon = ir.registerIcon("taintedmagic:ItemFocusTaintSwarm");
|
||||
depthIcon = ir.registerIcon("taintedmagic:ItemFocusTaintSwarm_depth");
|
||||
ornIcon = ir.registerIcon("thaumcraft:focus_whatever_orn");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getFocusDepthLayerIcon (final ItemStack stack) {
|
||||
public IIcon getFocusDepthLayerIcon(final ItemStack stack) {
|
||||
return depthIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getOrnament (final ItemStack stack) {
|
||||
public IIcon getOrnament(final ItemStack stack) {
|
||||
return ornIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses () {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public int getRenderPasses (final int meta) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderPasses(final int meta) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public IIcon getIconFromDamageForRenderPass (final int meta, final int pass) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamageForRenderPass(final int meta, final int pass) {
|
||||
return pass == 0 ? ornIcon : icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper (final ItemStack stack) {
|
||||
public String getSortingHelper(final ItemStack stack) {
|
||||
return "TAINT" + super.getSortingHelper(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFocusColor (final ItemStack stack) {
|
||||
public int getFocusColor(final ItemStack stack) {
|
||||
return 0x9929BD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost (final ItemStack stack) {
|
||||
public AspectList getVisCost(final ItemStack stack) {
|
||||
return isUpgradedWith(stack, TMFocusUpgrades.antibody) ? COST_ANTIBODY : COST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getActivationCooldown (final ItemStack stack) {
|
||||
public int getActivationCooldown(final ItemStack stack) {
|
||||
return 3000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisCostPerTick (final ItemStack stack) {
|
||||
public boolean isVisCostPerTick(final ItemStack stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation (final ItemStack stack) {
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation(final ItemStack stack) {
|
||||
return ItemFocusBasic.WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onFocusRightClick (final ItemStack stack, final World world, final EntityPlayer player,
|
||||
public ItemStack onFocusRightClick(final ItemStack stack, final World world, final EntityPlayer player,
|
||||
final MovingObjectPosition mop) {
|
||||
final ItemWandCasting wand = (ItemWandCasting) stack.getItem();
|
||||
|
||||
@@ -114,11 +115,15 @@ public class ItemFocusTaintSwarm extends ItemFocusBasic {
|
||||
final EntityTaintSwarm swarm = new EntityTaintSwarm(world);
|
||||
|
||||
final Vec3 look = player.getLookVec();
|
||||
swarm.setLocationAndAngles(player.posX + look.xCoord / 2.0D,
|
||||
player.posY + player.getEyeHeight() + look.yCoord / 2.0D, player.posZ + look.zCoord / 2.0D,
|
||||
player.rotationYaw, player.rotationPitch);
|
||||
swarm.setLocationAndAngles(
|
||||
player.posX + look.xCoord / 2.0D,
|
||||
player.posY + player.getEyeHeight() + look.yCoord / 2.0D,
|
||||
player.posZ + look.zCoord / 2.0D,
|
||||
player.rotationYaw,
|
||||
player.rotationPitch);
|
||||
|
||||
swarm.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(5.0D + wand.getFocusPotency(stack));
|
||||
swarm.getEntityAttribute(SharedMonsterAttributes.attackDamage)
|
||||
.setBaseValue(5.0D + wand.getFocusPotency(stack));
|
||||
swarm.setTarget(target);
|
||||
swarm.setIsSummoned(true);
|
||||
|
||||
@@ -137,18 +142,19 @@ public class ItemFocusTaintSwarm extends ItemFocusBasic {
|
||||
}
|
||||
|
||||
@Override
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank (final ItemStack stack, final int rank) {
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(final ItemStack stack, final int rank) {
|
||||
switch (rank) {
|
||||
case 1 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 2 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 3 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency, TMFocusUpgrades.antibody };
|
||||
case 4 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 5 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 1:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 2:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 3:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency,
|
||||
TMFocusUpgrades.antibody };
|
||||
case 4:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 5:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package taintedmagic.common.items.wand.foci;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -9,6 +7,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.entities.EntityHomingShard;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
@@ -19,56 +18,63 @@ import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXSparkle;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import thaumcraft.common.lib.utils.EntityUtils;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* This class is based off of ItemFocusShard.class created by <Azanor> as part of Thaumcraft 5.
|
||||
*/
|
||||
public class ItemFocusVisShard extends ItemFocusBasic {
|
||||
|
||||
private static final AspectList COST = new AspectList().add(Aspect.FIRE, 10).add(Aspect.ENTROPY, 10).add(Aspect.AIR, 10);
|
||||
private static final AspectList COST = new AspectList().add(Aspect.FIRE, 10).add(Aspect.ENTROPY, 10)
|
||||
.add(Aspect.AIR, 10);
|
||||
private static final AspectList COST_PERSISTENT = COST.copy().add(Aspect.WATER, 10);
|
||||
|
||||
public ItemFocusVisShard () {
|
||||
public ItemFocusVisShard() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setUnlocalizedName("ItemFocusVisShard");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerIcons (final IIconRegister ir) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister ir) {
|
||||
icon = ir.registerIcon("taintedmagic:ItemFocusVisShard");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSortingHelper (final ItemStack stack) {
|
||||
public String getSortingHelper(final ItemStack stack) {
|
||||
return "SHARD" + super.getSortingHelper(stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFocusColor (final ItemStack stack) {
|
||||
public int getFocusColor(final ItemStack stack) {
|
||||
return 0x9929BD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getActivationCooldown (final ItemStack stack) {
|
||||
public int getActivationCooldown(final ItemStack stack) {
|
||||
return 300;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation (final ItemStack stack) {
|
||||
public ItemFocusBasic.WandFocusAnimation getAnimation(final ItemStack stack) {
|
||||
return ItemFocusBasic.WandFocusAnimation.WAVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onFocusRightClick (final ItemStack stack, final World world, final EntityPlayer player,
|
||||
public ItemStack onFocusRightClick(final ItemStack stack, final World world, final EntityPlayer player,
|
||||
final MovingObjectPosition mop) {
|
||||
final ItemWandCasting wand = (ItemWandCasting) stack.getItem();
|
||||
final Entity look = EntityUtils.getPointedEntity(player.worldObj, player, 0.0D, 32.0D, 1.1F);
|
||||
|
||||
if (look != null && look instanceof EntityLivingBase) {
|
||||
if (wand.consumeAllVis(stack, player, getVisCost(stack), true, false)) {
|
||||
final EntityHomingShard shard = new EntityHomingShard(world, player, (EntityLivingBase) look,
|
||||
wand.getFocusPotency(stack), isUpgradedWith(wand.getFocusItem(stack), TMFocusUpgrades.persistent));
|
||||
final EntityHomingShard shard = new EntityHomingShard(
|
||||
world,
|
||||
player,
|
||||
(EntityLivingBase) look,
|
||||
wand.getFocusPotency(stack),
|
||||
isUpgradedWith(wand.getFocusItem(stack), TMFocusUpgrades.persistent));
|
||||
if (!world.isRemote) {
|
||||
world.spawnEntityInWorld(shard);
|
||||
}
|
||||
@@ -84,34 +90,41 @@ public class ItemFocusVisShard extends ItemFocusBasic {
|
||||
return stack;
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
void spawnParticles (final World world, final double x, final double y, final double z) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
void spawnParticles(final World world, final double x, final double y, final double z) {
|
||||
for (int a = 0; a < 18; a++) {
|
||||
final FXSparkle fx = new FXSparkle(world, x + world.rand.nextFloat(), y + world.rand.nextFloat(),
|
||||
z + world.rand.nextFloat(), 1.75F, 0, 3 + world.rand.nextInt(3));
|
||||
final FXSparkle fx = new FXSparkle(
|
||||
world,
|
||||
x + world.rand.nextFloat(),
|
||||
y + world.rand.nextFloat(),
|
||||
z + world.rand.nextFloat(),
|
||||
1.75F,
|
||||
0,
|
||||
3 + world.rand.nextInt(3));
|
||||
fx.setGravity(0.1F);
|
||||
ParticleEngine.instance.addEffect(world, fx);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getVisCost (final ItemStack stack) {
|
||||
public AspectList getVisCost(final ItemStack stack) {
|
||||
return isUpgradedWith(stack, TMFocusUpgrades.persistent) ? COST_PERSISTENT : COST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank (final ItemStack stack, final int rank) {
|
||||
public FocusUpgradeType[] getPossibleUpgradesByRank(final ItemStack stack, final int rank) {
|
||||
switch (rank) {
|
||||
case 1 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 2 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 3 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 4 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 5 :
|
||||
return new FocusUpgradeType[]{ FocusUpgradeType.frugal, FocusUpgradeType.potency, TMFocusUpgrades.persistent };
|
||||
case 1:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 2:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 3:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 4:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency };
|
||||
case 5:
|
||||
return new FocusUpgradeType[] { FocusUpgradeType.frugal, FocusUpgradeType.potency,
|
||||
TMFocusUpgrades.persistent };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package taintedmagic.common.items.wand.foci;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import taintedmagic.common.handler.ConfigHandler;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
@@ -14,27 +15,40 @@ public class TMFocusUpgrades {
|
||||
public static FocusUpgradeType persistent;
|
||||
public static FocusUpgradeType diffusion;
|
||||
|
||||
public static void initFocusUpgrades () {
|
||||
public static void initFocusUpgrades() {
|
||||
|
||||
sanity = new FocusUpgradeType(ConfigHandler.SANITY_UPGRADE_ID,
|
||||
new ResourceLocation("taintedmagic:textures/foci/IconSanity.png"), "focus.upgrade.sanity.name",
|
||||
"focus.upgrade.sanity.text", new AspectList().add(Aspect.MIND, 1).add(Aspect.HEAL, 1));
|
||||
sanity = new FocusUpgradeType(
|
||||
ConfigHandler.SANITY_UPGRADE_ID,
|
||||
new ResourceLocation("taintedmagic:textures/foci/IconSanity.png"),
|
||||
"focus.upgrade.sanity.name",
|
||||
"focus.upgrade.sanity.text",
|
||||
new AspectList().add(Aspect.MIND, 1).add(Aspect.HEAL, 1));
|
||||
|
||||
antibody = new FocusUpgradeType(ConfigHandler.ANTIBODY_UPGRADE_ID,
|
||||
new ResourceLocation("taintedmagic:textures/foci/IconAntibody.png"), "focus.upgrade.antibody.name",
|
||||
"focus.upgrade.antibody.text", new AspectList().add(Aspect.TAINT, 1).add(Aspect.HEAL, 1));
|
||||
antibody = new FocusUpgradeType(
|
||||
ConfigHandler.ANTIBODY_UPGRADE_ID,
|
||||
new ResourceLocation("taintedmagic:textures/foci/IconAntibody.png"),
|
||||
"focus.upgrade.antibody.name",
|
||||
"focus.upgrade.antibody.text",
|
||||
new AspectList().add(Aspect.TAINT, 1).add(Aspect.HEAL, 1));
|
||||
|
||||
corrosive = new FocusUpgradeType(ConfigHandler.CORROSIVE_UPGRADE_ID,
|
||||
new ResourceLocation("taintedmagic:textures/foci/IconCorrosive.png"), "focus.upgrade.corrosive.name",
|
||||
"focus.upgrade.corrosive.text", new AspectList().add(Aspect.TAINT, 1).add(Aspect.POISON, 1));
|
||||
corrosive = new FocusUpgradeType(
|
||||
ConfigHandler.CORROSIVE_UPGRADE_ID,
|
||||
new ResourceLocation("taintedmagic:textures/foci/IconCorrosive.png"),
|
||||
"focus.upgrade.corrosive.name",
|
||||
"focus.upgrade.corrosive.text",
|
||||
new AspectList().add(Aspect.TAINT, 1).add(Aspect.POISON, 1));
|
||||
|
||||
persistent = new FocusUpgradeType(ConfigHandler.PERSISTENT_UPGRADE_ID,
|
||||
new ResourceLocation("taintedmagic:textures/foci/IconPersistent.png"), "focus.upgrade.persistent.name",
|
||||
persistent = new FocusUpgradeType(
|
||||
ConfigHandler.PERSISTENT_UPGRADE_ID,
|
||||
new ResourceLocation("taintedmagic:textures/foci/IconPersistent.png"),
|
||||
"focus.upgrade.persistent.name",
|
||||
"focus.upgrade.persistent.text",
|
||||
new AspectList().add(Aspect.ARMOR, 1).add(Aspect.MOTION, 1).add(Aspect.ENERGY, 1));
|
||||
|
||||
diffusion = new FocusUpgradeType(ConfigHandler.DIFFUSION_UPGRADE_ID,
|
||||
new ResourceLocation("taintedmagic:textures/foci/IconDiffusion.png"), "focus.upgrade.diffusion.name",
|
||||
diffusion = new FocusUpgradeType(
|
||||
ConfigHandler.DIFFUSION_UPGRADE_ID,
|
||||
new ResourceLocation("taintedmagic:textures/foci/IconDiffusion.png"),
|
||||
"focus.upgrade.diffusion.name",
|
||||
"focus.upgrade.diffusion.text",
|
||||
new AspectList().add(Aspect.DARKNESS, 1).add(Aspect.ELDRITCH, 2).add(Aspect.AURA, 4));
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package taintedmagic.common.network;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
|
||||
public class PacketHandler {
|
||||
|
||||
public static final SimpleNetworkWrapper INSTANCE =
|
||||
NetworkRegistry.INSTANCE.newSimpleChannel(TaintedMagic.MOD_ID.toLowerCase());
|
||||
public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE
|
||||
.newSimpleChannel(TaintedMagic.MOD_ID.toLowerCase());
|
||||
|
||||
public static void initPackets () {
|
||||
public static void initPackets() {
|
||||
INSTANCE.registerMessage(PacketKatanaAttack.class, PacketKatanaAttack.class, 0, Side.SERVER);
|
||||
INSTANCE.registerMessage(PacketSashToggle.class, PacketSashToggle.class, 1, Side.SERVER);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
package taintedmagic.common.network;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -11,6 +7,11 @@ import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketKatanaAttack implements IMessage, IMessageHandler<PacketKatanaAttack, IMessage> {
|
||||
|
||||
private int entityID;
|
||||
@@ -18,10 +19,9 @@ public class PacketKatanaAttack implements IMessage, IMessageHandler<PacketKatan
|
||||
private int dimensionID;
|
||||
private float dmg;
|
||||
|
||||
public PacketKatanaAttack () {
|
||||
}
|
||||
public PacketKatanaAttack() {}
|
||||
|
||||
public PacketKatanaAttack (final Entity entity, final EntityPlayer player, final float dmg) {
|
||||
public PacketKatanaAttack(final Entity entity, final EntityPlayer player, final float dmg) {
|
||||
entityID = entity.getEntityId();
|
||||
playerID = player.getEntityId();
|
||||
dimensionID = entity.dimension;
|
||||
@@ -29,16 +29,16 @@ public class PacketKatanaAttack implements IMessage, IMessageHandler<PacketKatan
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMessage onMessage (final PacketKatanaAttack message, final MessageContext ctx) {
|
||||
public IMessage onMessage(final PacketKatanaAttack message, final MessageContext ctx) {
|
||||
final World world = DimensionManager.getWorld(message.dimensionID);
|
||||
if (world == null)
|
||||
return null;
|
||||
if (world == null) return null;
|
||||
|
||||
final Entity entity = world.getEntityByID(message.entityID);
|
||||
final Entity player = world.getEntityByID(message.playerID);
|
||||
|
||||
if (entity != null && entity instanceof EntityLivingBase && player != null && player instanceof EntityPlayer) {
|
||||
entity.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer) player).setDamageBypassesArmor(),
|
||||
entity.attackEntityFrom(
|
||||
DamageSource.causePlayerDamage((EntityPlayer) player).setDamageBypassesArmor(),
|
||||
message.dmg);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class PacketKatanaAttack implements IMessage, IMessageHandler<PacketKatan
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes (final ByteBuf buf) {
|
||||
public void fromBytes(final ByteBuf buf) {
|
||||
entityID = buf.readInt();
|
||||
playerID = buf.readInt();
|
||||
dimensionID = buf.readInt();
|
||||
@@ -54,7 +54,7 @@ public class PacketKatanaAttack implements IMessage, IMessageHandler<PacketKatan
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes (final ByteBuf buf) {
|
||||
public void toBytes(final ByteBuf buf) {
|
||||
buf.writeInt(entityID);
|
||||
buf.writeInt(playerID);
|
||||
buf.writeInt(dimensionID);
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
package taintedmagic.common.network;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import taintedmagic.client.handler.SashServerHandler;
|
||||
import taintedmagic.common.items.equipment.ItemVoidwalkerSash;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import taintedmagic.client.handler.SashServerHandler;
|
||||
import taintedmagic.common.items.equipment.ItemVoidwalkerSash;
|
||||
|
||||
public class PacketSashToggle implements IMessage, IMessageHandler<PacketSashToggle, IMessage> {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package taintedmagic.common.registry;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import taintedmagic.common.blocks.BlockLumos;
|
||||
import taintedmagic.common.blocks.BlockNightshadeBush;
|
||||
import taintedmagic.common.blocks.BlockWarpwoodLeaves;
|
||||
@@ -9,6 +9,7 @@ import taintedmagic.common.blocks.BlockWarpwoodLog;
|
||||
import taintedmagic.common.blocks.BlockWarpwoodPlanks;
|
||||
import taintedmagic.common.blocks.BlockWarpwoodSapling;
|
||||
import taintedmagic.common.blocks.tile.TileLumos;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class BlockRegistry {
|
||||
|
||||
@@ -19,7 +20,7 @@ public class BlockRegistry {
|
||||
public static Block BlockNightshadeBush;
|
||||
public static Block BlockLumos;
|
||||
|
||||
public static void initBlocks () {
|
||||
public static void initBlocks() {
|
||||
BlockWarpwoodLog = new BlockWarpwoodLog();
|
||||
GameRegistry.registerBlock(BlockWarpwoodLog, "BlockWarpwoodLog");
|
||||
|
||||
@@ -39,7 +40,7 @@ public class BlockRegistry {
|
||||
GameRegistry.registerBlock(BlockLumos, "BlockLumos");
|
||||
}
|
||||
|
||||
public static void initTiles () {
|
||||
public static void initTiles() {
|
||||
GameRegistry.registerTileEntity(TileLumos.class, "TileLumos");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package taintedmagic.common.registry;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemHoe;
|
||||
@@ -9,6 +8,7 @@ import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import taintedmagic.common.handler.WandHandler;
|
||||
import taintedmagic.common.items.ItemCrimsonBlood;
|
||||
import taintedmagic.common.items.ItemFlyteCharm;
|
||||
@@ -48,6 +48,7 @@ import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.wands.StaffRod;
|
||||
import thaumcraft.api.wands.WandCap;
|
||||
import thaumcraft.api.wands.WandRod;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class ItemRegistry {
|
||||
|
||||
@@ -113,7 +114,7 @@ public class ItemRegistry {
|
||||
|
||||
public static Item ItemKatana;
|
||||
|
||||
public static void initItems () {
|
||||
public static void initItems() {
|
||||
ItemMaterial = new ItemMaterial();
|
||||
GameRegistry.registerItem(ItemMaterial, "ItemMaterial");
|
||||
|
||||
@@ -145,20 +146,20 @@ public class ItemRegistry {
|
||||
ItemWarpedGoggles = new ItemWarpedGoggles(TMMaterials.ARMOR_WARPED, 4, 0);
|
||||
GameRegistry.registerItem(ItemWarpedGoggles, "ItemWarpedGoggles");
|
||||
|
||||
ItemVoidFortressHelmet =
|
||||
new ItemVoidFortressArmor(TMMaterials.ARMOR_VOIDFORTRESS, 4, 0).setUnlocalizedName("ItemVoidFortressHelmet");
|
||||
ItemVoidFortressHelmet = new ItemVoidFortressArmor(TMMaterials.ARMOR_VOIDFORTRESS, 4, 0)
|
||||
.setUnlocalizedName("ItemVoidFortressHelmet");
|
||||
GameRegistry.registerItem(ItemVoidFortressHelmet, "ItemVoidFortressHelmet");
|
||||
|
||||
ItemVoidFortressChestplate = new ItemVoidFortressArmor(TMMaterials.ARMOR_VOIDFORTRESS, 4, 1)
|
||||
.setUnlocalizedName("ItemVoidFortressChestplate");
|
||||
GameRegistry.registerItem(ItemVoidFortressChestplate, "ItemVoidFortressChestplate");
|
||||
|
||||
ItemVoidFortressLeggings =
|
||||
new ItemVoidFortressArmor(TMMaterials.ARMOR_VOIDFORTRESS, 4, 2).setUnlocalizedName("ItemVoidFortressLeggings");
|
||||
ItemVoidFortressLeggings = new ItemVoidFortressArmor(TMMaterials.ARMOR_VOIDFORTRESS, 4, 2)
|
||||
.setUnlocalizedName("ItemVoidFortressLeggings");
|
||||
GameRegistry.registerItem(ItemVoidFortressLeggings, "ItemVoidFortressLeggings");
|
||||
|
||||
ItemVoidwalkerBoots =
|
||||
new ItemVoidwalkerBoots(TMMaterials.ARMOR_VOIDWALKER, 4, 3).setUnlocalizedName("ItemVoidwalkerBoots");
|
||||
ItemVoidwalkerBoots = new ItemVoidwalkerBoots(TMMaterials.ARMOR_VOIDWALKER, 4, 3)
|
||||
.setUnlocalizedName("ItemVoidwalkerBoots");
|
||||
GameRegistry.registerItem(ItemVoidwalkerBoots, "ItemVoidwalkerBoots");
|
||||
|
||||
ItemVoidwalkerSash = new ItemVoidwalkerSash();
|
||||
@@ -186,11 +187,21 @@ public class ItemRegistry {
|
||||
ItemWandRod = new ItemWandRod();
|
||||
GameRegistry.registerItem(ItemWandRod, "ItemWandRod");
|
||||
|
||||
WAND_ROD_WARPWOOD = new WandRod("warpwood", 250, new ItemStack(ItemWandRod, 1, 0), 16, new WandHandler(),
|
||||
WAND_ROD_WARPWOOD = new WandRod(
|
||||
"warpwood",
|
||||
250,
|
||||
new ItemStack(ItemWandRod, 1, 0),
|
||||
16,
|
||||
new WandHandler(),
|
||||
new ResourceLocation("taintedmagic:textures/models/ModelWAND_ROD_WARPWOOD.png"));
|
||||
WAND_ROD_WARPWOOD.setGlowing(true);
|
||||
|
||||
STAFF_ROD_WARPWOOD = new StaffRod("warpwood", 500, new ItemStack(ItemWandRod, 1, 1), 20, new WandHandler(),
|
||||
STAFF_ROD_WARPWOOD = new StaffRod(
|
||||
"warpwood",
|
||||
500,
|
||||
new ItemStack(ItemWandRod, 1, 1),
|
||||
20,
|
||||
new WandHandler(),
|
||||
new ResourceLocation("taintedmagic:textures/models/ModelWAND_ROD_WARPWOOD.png"));
|
||||
STAFF_ROD_WARPWOOD.setRunes(true);
|
||||
STAFF_ROD_WARPWOOD.setGlowing(true);
|
||||
@@ -199,16 +210,19 @@ public class ItemRegistry {
|
||||
GameRegistry.registerItem(ItemWandCap, "ItemWandCap");
|
||||
|
||||
WAND_CAP_SHADOWMETAL = new WandCap("shadowmetal", 0.65F, new ItemStack(ItemWandCap, 1, 0), 12);
|
||||
WAND_CAP_SHADOWMETAL.setTexture(new ResourceLocation("taintedmagic:textures/models/ModelWAND_CAP_SHADOWMETAL.png"));
|
||||
WAND_CAP_SHADOWMETAL
|
||||
.setTexture(new ResourceLocation("taintedmagic:textures/models/ModelWAND_CAP_SHADOWMETAL.png"));
|
||||
|
||||
WAND_CAP_CLOTH = new WandCap("cloth", 0.97F, new ItemStack(ItemWandCap, 1, 1), 2);
|
||||
WAND_CAP_CLOTH.setTexture(new ResourceLocation("taintedmagic:textures/models/ModelWAND_CAP_CLOTH.png"));
|
||||
|
||||
WAND_CAP_CRIMSON_CLOTH = new WandCap("crimsoncloth", 0.93F, new ItemStack(ItemWandCap, 1, 2), 3);
|
||||
WAND_CAP_CRIMSON_CLOTH.setTexture(new ResourceLocation("taintedmagic:textures/models/ModelWAND_CAP_CRIMSON_CLOTH.png"));
|
||||
WAND_CAP_CRIMSON_CLOTH
|
||||
.setTexture(new ResourceLocation("taintedmagic:textures/models/ModelWAND_CAP_CRIMSON_CLOTH.png"));
|
||||
|
||||
WAND_CAP_SHADOW_CLOTH = new WandCap("shadowcloth", 0.93F, new ItemStack(ItemWandCap, 1, 3), 4);
|
||||
WAND_CAP_SHADOW_CLOTH.setTexture(new ResourceLocation("taintedmagic:textures/models/ModelWAND_CAP_SHADOW_CLOTH.png"));
|
||||
WAND_CAP_SHADOW_CLOTH
|
||||
.setTexture(new ResourceLocation("taintedmagic:textures/models/ModelWAND_CAP_SHADOW_CLOTH.png"));
|
||||
|
||||
// Foci
|
||||
ItemFocusTaintSwarm = new ItemFocusTaintSwarm();
|
||||
|
||||
@@ -5,7 +5,7 @@ import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class OreDictRegistry {
|
||||
|
||||
public static void initOreDict () {
|
||||
public static void initOreDict() {
|
||||
OreDictionary.registerOre("logWood", new ItemStack(BlockRegistry.BlockWarpwoodLog));
|
||||
OreDictionary.registerOre("treeSapling", new ItemStack(BlockRegistry.BlockWarpwoodSapling));
|
||||
OreDictionary.registerOre("ingotShadow", new ItemStack(ItemRegistry.ItemMaterial));
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -5,6 +5,7 @@ import java.util.HashMap;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import taintedmagic.common.handler.ConfigHandler;
|
||||
import taintedmagic.common.helper.TaintedMagicHelper;
|
||||
import taintedmagic.common.research.TMResearchItem;
|
||||
@@ -26,8 +27,10 @@ public class ResearchRegistry {
|
||||
public static final String CATEGORY_TM = "TAINTEDMAGIC";
|
||||
public static HashMap<String, Object> recipes = new HashMap<>();
|
||||
|
||||
public static void initResearch () {
|
||||
ResearchCategories.registerCategory(CATEGORY_TM, new ResourceLocation("taintedmagic:textures/misc/tab_tm.png"),
|
||||
public static void initResearch() {
|
||||
ResearchCategories.registerCategory(
|
||||
CATEGORY_TM,
|
||||
new ResourceLocation("taintedmagic:textures/misc/tab_tm.png"),
|
||||
ConfigHandler.CUSTOM_RESEARCH_TAB_BACK
|
||||
? new ResourceLocation("taintedmagic:textures/gui/gui_tm_researchback.png")
|
||||
: new ResourceLocation("thaumcraft:textures/gui/gui_researchback.png"));
|
||||
@@ -37,301 +40,620 @@ public class ResearchRegistry {
|
||||
/**
|
||||
* Copied Thaumcraft research
|
||||
*/
|
||||
r = new ThaumcraftResearchItem("TMELDRITCHMAJOR", "ELDRITCHMAJOR", "ELDRITCH", 7, -7,
|
||||
r = new ThaumcraftResearchItem(
|
||||
"TMELDRITCHMAJOR",
|
||||
"ELDRITCHMAJOR",
|
||||
"ELDRITCH",
|
||||
7,
|
||||
-7,
|
||||
new ResourceLocation("thaumcraft:textures/misc/r_eldritchmajor.png"));
|
||||
r.setSpecial().setConcealed().setRound().registerResearchItem();
|
||||
|
||||
/**
|
||||
* Tainted Magic research
|
||||
*/
|
||||
r = new TMResearchItem("TAINTEDMAGIC", new AspectList(), 2, -1, new ItemStack(ConfigItems.itemResource, 1, 13), 0, 0);
|
||||
r = new TMResearchItem(
|
||||
"TAINTEDMAGIC",
|
||||
new AspectList(),
|
||||
2,
|
||||
-1,
|
||||
new ItemStack(ConfigItems.itemResource, 1, 13),
|
||||
0,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), new ResearchPage("2"));
|
||||
r.setRound().setAutoUnlock().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("SHADOWMETAL",
|
||||
new AspectList().add(Aspect.METAL, 1).add(Aspect.DARKNESS, 1).add(Aspect.MAGIC, 1), 0, 1,
|
||||
new ItemStack(ItemRegistry.ItemMaterial), 1, 1);
|
||||
r.setPages(new ResearchPage("1"), cruciblePage("ItemMaterial:0"), recipePage("ItemShadowmetalPick"),
|
||||
recipePage("ItemShadowmetalSpade"), recipePage("ItemShadowmetalAxe"), recipePage("ItemShadowmetalHoe"),
|
||||
r = new TMResearchItem(
|
||||
"SHADOWMETAL",
|
||||
new AspectList().add(Aspect.METAL, 1).add(Aspect.DARKNESS, 1).add(Aspect.MAGIC, 1),
|
||||
0,
|
||||
1,
|
||||
new ItemStack(ItemRegistry.ItemMaterial),
|
||||
1,
|
||||
1);
|
||||
r.setPages(
|
||||
new ResearchPage("1"),
|
||||
cruciblePage("ItemMaterial:0"),
|
||||
recipePage("ItemShadowmetalPick"),
|
||||
recipePage("ItemShadowmetalSpade"),
|
||||
recipePage("ItemShadowmetalAxe"),
|
||||
recipePage("ItemShadowmetalHoe"),
|
||||
recipePage("ItemShadowmetalSword"));
|
||||
r.setParents("TAINTEDMAGIC").setConcealed().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("CAP_shadowmetal",
|
||||
new AspectList().add(Aspect.METAL, 4).add(Aspect.DARKNESS, 4).add(Aspect.ELDRITCH, 4).add(Aspect.MAGIC, 4), -3,
|
||||
2, new ItemStack(ItemRegistry.ItemWandCap, 1, 0), 2, 4);
|
||||
r = new TMResearchItem(
|
||||
"CAP_shadowmetal",
|
||||
new AspectList().add(Aspect.METAL, 4).add(Aspect.DARKNESS, 4).add(Aspect.ELDRITCH, 4)
|
||||
.add(Aspect.MAGIC, 4),
|
||||
-3,
|
||||
2,
|
||||
new ItemStack(ItemRegistry.ItemWandCap, 1, 0),
|
||||
2,
|
||||
4);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemWandCap:0"));
|
||||
r.setParents("SHADOWMETAL", "CAP_void", "PRIMPEARL").setConcealed().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("SHADOWCLOTH", new AspectList().add(Aspect.CLOTH, 1).add(Aspect.DARKNESS, 1), -2, 4,
|
||||
new ItemStack(ItemRegistry.ItemMaterial, 1, 1), 0, 0);
|
||||
r = new TMResearchItem(
|
||||
"SHADOWCLOTH",
|
||||
new AspectList().add(Aspect.CLOTH, 1).add(Aspect.DARKNESS, 1),
|
||||
-2,
|
||||
4,
|
||||
new ItemStack(ItemRegistry.ItemMaterial, 1, 1),
|
||||
0,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), arcanePage("ItemMaterial:1"));
|
||||
r.setConcealed().setSecondary().setParents("ENCHFABRIC", "SHADOWMETAL").registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("ROD_warpwood",
|
||||
new AspectList().add(Aspect.TREE, 4).add(Aspect.DARKNESS, 4).add(Aspect.ELDRITCH, 4), 8, 0,
|
||||
new ItemStack(ItemRegistry.ItemWandRod, 1, 0), 3, 5);
|
||||
r = new TMResearchItem(
|
||||
"ROD_warpwood",
|
||||
new AspectList().add(Aspect.TREE, 4).add(Aspect.DARKNESS, 4).add(Aspect.ELDRITCH, 4),
|
||||
8,
|
||||
0,
|
||||
new ItemStack(ItemRegistry.ItemWandRod, 1, 0),
|
||||
3,
|
||||
5);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemWandRod:0"));
|
||||
r.setParents("WARPTREE", "VOIDMETAL", "PRIMPEARL", "ROD_primal_staff").setParentsHidden("SHADOWMETAL").setConcealed()
|
||||
r.setParents("WARPTREE", "VOIDMETAL", "PRIMPEARL", "ROD_primal_staff").setParentsHidden("SHADOWMETAL")
|
||||
.setConcealed().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem(
|
||||
"ROD_warpwood_staff",
|
||||
new AspectList().add(Aspect.TREE, 4).add(Aspect.DARKNESS, 4).add(Aspect.ELDRITCH, 4),
|
||||
10,
|
||||
-1,
|
||||
new ItemStack(ItemRegistry.ItemWandRod, 1, 1),
|
||||
2,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), arcanePage("ItemWandRod:1"));
|
||||
r.setConcealed().setParents("ROD_warpwood").setParentsHidden("CREATIONSHARD").setSecondary()
|
||||
.registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("ROD_warpwood_staff",
|
||||
new AspectList().add(Aspect.TREE, 4).add(Aspect.DARKNESS, 4).add(Aspect.ELDRITCH, 4), 10, -1,
|
||||
new ItemStack(ItemRegistry.ItemWandRod, 1, 1), 2, 0);
|
||||
r.setPages(new ResearchPage("1"), arcanePage("ItemWandRod:1"));
|
||||
r.setConcealed().setParents("ROD_warpwood").setParentsHidden("CREATIONSHARD").setSecondary().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("UNBALANCEDSHARDS", new AspectList().add(Aspect.CRYSTAL, 4).add(Aspect.DARKNESS, 4), 4, -1,
|
||||
new ItemStack(ItemRegistry.ItemMaterial, 1, 4), 0, 1);
|
||||
r = new TMResearchItem(
|
||||
"UNBALANCEDSHARDS",
|
||||
new AspectList().add(Aspect.CRYSTAL, 4).add(Aspect.DARKNESS, 4),
|
||||
4,
|
||||
-1,
|
||||
new ItemStack(ItemRegistry.ItemMaterial, 1, 4),
|
||||
0,
|
||||
1);
|
||||
r.setPages(new ResearchPage("1"), cruciblePage("ItemMaterial:4"), cruciblePage("ItemMaterial:3"));
|
||||
r.setParents("TAINTEDMAGIC").setConcealed().setSecondary().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("WARPTREE", new AspectList().add(Aspect.MAGIC, 4).add(Aspect.DARKNESS, 4).add(Aspect.TREE, 4), 6,
|
||||
-2, new ItemStack(ItemRegistry.ItemWarpFertilizer), 3, 2);
|
||||
r = new TMResearchItem(
|
||||
"WARPTREE",
|
||||
new AspectList().add(Aspect.MAGIC, 4).add(Aspect.DARKNESS, 4).add(Aspect.TREE, 4),
|
||||
6,
|
||||
-2,
|
||||
new ItemStack(ItemRegistry.ItemWarpFertilizer),
|
||||
3,
|
||||
2);
|
||||
r.setPages(new ResearchPage("1"), arcanePage("ItemWarpFertilizer"));
|
||||
r.setParents("UNBALANCEDSHARDS").setConcealed().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("CRIMSONROBES",
|
||||
new AspectList().add(Aspect.CLOTH, 4).add(Aspect.EXCHANGE, 4).add(Aspect.ARMOR, 4), -2, -1,
|
||||
new ItemStack(ItemRegistry.ItemMaterial, 1, 2), 2, 0);
|
||||
r.setPages(new ResearchPage("1"), arcanePage("ItemMaterial:2"), arcanePage("ItemHelmetCultistRobe"),
|
||||
arcanePage("ItemChestCultistRobe"), arcanePage("ItemLegsCultistRobe"), arcanePage("ItemBootsCultist"));
|
||||
r = new TMResearchItem(
|
||||
"CRIMSONROBES",
|
||||
new AspectList().add(Aspect.CLOTH, 4).add(Aspect.EXCHANGE, 4).add(Aspect.ARMOR, 4),
|
||||
-2,
|
||||
-1,
|
||||
new ItemStack(ItemRegistry.ItemMaterial, 1, 2),
|
||||
2,
|
||||
0);
|
||||
r.setPages(
|
||||
new ResearchPage("1"),
|
||||
arcanePage("ItemMaterial:2"),
|
||||
arcanePage("ItemHelmetCultistRobe"),
|
||||
arcanePage("ItemChestCultistRobe"),
|
||||
arcanePage("ItemLegsCultistRobe"),
|
||||
arcanePage("ItemBootsCultist"));
|
||||
r.setParents("HOLLOWDAGGER").setConcealed().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("VOIDFORTRESS",
|
||||
new AspectList().add(Aspect.ARMOR, 5).add(Aspect.ELDRITCH, 3).add(Aspect.DARKNESS, 3).add(Aspect.VOID, 5), 8,
|
||||
-9, new ItemStack(ItemRegistry.ItemVoidFortressHelmet), 2, 2);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemVoidFortressHelmet"), infusionPage("ItemVoidFortressChestplate"),
|
||||
r = new TMResearchItem(
|
||||
"VOIDFORTRESS",
|
||||
new AspectList().add(Aspect.ARMOR, 5).add(Aspect.ELDRITCH, 3).add(Aspect.DARKNESS, 3)
|
||||
.add(Aspect.VOID, 5),
|
||||
8,
|
||||
-9,
|
||||
new ItemStack(ItemRegistry.ItemVoidFortressHelmet),
|
||||
2,
|
||||
2);
|
||||
r.setPages(
|
||||
new ResearchPage("1"),
|
||||
infusionPage("ItemVoidFortressHelmet"),
|
||||
infusionPage("ItemVoidFortressChestplate"),
|
||||
infusionPage("ItemVoidFortressLeggings"));
|
||||
r.setParentsHidden("ARMORVOIDFORTRESS", "ARMORFORTRESS").setParents("TMELDRITCHMAJOR").setConcealed()
|
||||
.registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("WARPEDGOGGLES",
|
||||
new AspectList().add(Aspect.ARMOR, 4).add(Aspect.ELDRITCH, 4).add(Aspect.DARKNESS, 4).add(Aspect.ARMOR, 4), 2,
|
||||
4, new ItemStack(ItemRegistry.ItemWarpedGoggles), 1, 0);
|
||||
r = new TMResearchItem(
|
||||
"WARPEDGOGGLES",
|
||||
new AspectList().add(Aspect.ARMOR, 4).add(Aspect.ELDRITCH, 4).add(Aspect.DARKNESS, 4)
|
||||
.add(Aspect.ARMOR, 4),
|
||||
2,
|
||||
4,
|
||||
new ItemStack(ItemRegistry.ItemWarpedGoggles),
|
||||
1,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemWarpedGoggles"));
|
||||
r.setParentsHidden("TAINTEDMAGIC", "GOGGLES").setConcealed().setSecondary().setParents("SHADOWMETAL")
|
||||
.registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("KNIGHTROBES",
|
||||
new AspectList().add(Aspect.CLOTH, 4).add(Aspect.DARKNESS, 4).add(Aspect.ARMOR, 4), -4, -2,
|
||||
new ItemStack(ItemRegistry.ItemMaterial, 1, 7), 2, 0);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemMaterial:7"), arcanePage("ItemHelmetCultistPlate"),
|
||||
arcanePage("ItemChestCultistPlate"), arcanePage("ItemLegsCultistPlate"));
|
||||
r = new TMResearchItem(
|
||||
"KNIGHTROBES",
|
||||
new AspectList().add(Aspect.CLOTH, 4).add(Aspect.DARKNESS, 4).add(Aspect.ARMOR, 4),
|
||||
-4,
|
||||
-2,
|
||||
new ItemStack(ItemRegistry.ItemMaterial, 1, 7),
|
||||
2,
|
||||
0);
|
||||
r.setPages(
|
||||
new ResearchPage("1"),
|
||||
infusionPage("ItemMaterial:7"),
|
||||
arcanePage("ItemHelmetCultistPlate"),
|
||||
arcanePage("ItemChestCultistPlate"),
|
||||
arcanePage("ItemLegsCultistPlate"));
|
||||
r.setParentsHidden("ELDRITCHMINOR").setParents("CRIMSONROBES").setConcealed().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("PRAETORARMOR",
|
||||
new AspectList().add(Aspect.CLOTH, 4).add(Aspect.DARKNESS, 4).add(Aspect.ARMOR, 4).add(Aspect.ELDRITCH, 4), -6,
|
||||
0, ItemApi.getItem("itemHelmetCultistLeaderPlate", 0), 2, 0);
|
||||
r.setPages(new ResearchPage("1"), arcanePage("ItemHelmetCultistLeaderPlate"), arcanePage("ItemChestCultistLeaderPlate"),
|
||||
r = new TMResearchItem(
|
||||
"PRAETORARMOR",
|
||||
new AspectList().add(Aspect.CLOTH, 4).add(Aspect.DARKNESS, 4).add(Aspect.ARMOR, 4)
|
||||
.add(Aspect.ELDRITCH, 4),
|
||||
-6,
|
||||
0,
|
||||
ItemApi.getItem("itemHelmetCultistLeaderPlate", 0),
|
||||
2,
|
||||
0);
|
||||
r.setPages(
|
||||
new ResearchPage("1"),
|
||||
arcanePage("ItemHelmetCultistLeaderPlate"),
|
||||
arcanePage("ItemChestCultistLeaderPlate"),
|
||||
arcanePage("ItemLegsCultistLeaderPlate"));
|
||||
r.setParents("KNIGHTROBES").setParentsHidden("CRIMSONROBES", "TMELDRITCHMAJOR", "VOIDMETAL").setConcealed()
|
||||
.registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("VOIDBLOOD",
|
||||
new AspectList().add(Aspect.VOID, 14).add(Aspect.DARKNESS, 8).add(Aspect.ARMOR, 18).add(Aspect.AURA, 4), -2, -5,
|
||||
new ItemStack(ItemRegistry.ItemVoidBlood), 0, 3);
|
||||
r = new TMResearchItem(
|
||||
"VOIDBLOOD",
|
||||
new AspectList().add(Aspect.VOID, 14).add(Aspect.DARKNESS, 8).add(Aspect.ARMOR, 18).add(Aspect.AURA, 4),
|
||||
-2,
|
||||
-5,
|
||||
new ItemStack(ItemRegistry.ItemVoidBlood),
|
||||
0,
|
||||
3);
|
||||
r.setPages(new ResearchPage("1"), arcanePage("ItemVoidBlood"));
|
||||
r.setSecondary().setParents("HOLLOWDAGGER").setParentsHidden("ELDRITCHMAJOR", "BREAKPEARL").setConcealed()
|
||||
.registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("VOIDWALKERBOOTS",
|
||||
new AspectList().add(Aspect.MAGIC, 4).add(Aspect.DARKNESS, 8).add(Aspect.ARMOR, 8).add(Aspect.ELDRITCH, 8), 4,
|
||||
-8, new ItemStack(ItemRegistry.ItemVoidwalkerBoots), 3, 4);
|
||||
r = new TMResearchItem(
|
||||
"VOIDWALKERBOOTS",
|
||||
new AspectList().add(Aspect.MAGIC, 4).add(Aspect.DARKNESS, 8).add(Aspect.ARMOR, 8)
|
||||
.add(Aspect.ELDRITCH, 8),
|
||||
4,
|
||||
-8,
|
||||
new ItemStack(ItemRegistry.ItemVoidwalkerBoots),
|
||||
3,
|
||||
4);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemVoidwalkerBoots"));
|
||||
r.setParentsHidden("PRIMPEARL", "BOOTSTRAVELLER", "SHADOWCLOTH", "ARMORVOIDFORTRESS").setConcealed()
|
||||
.setParents("TMELDRITCHMAJOR").registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("BREAKPEARL", TaintedMagicHelper.getPrimals(4).add(Aspect.ENTROPY, 12), 8, -6,
|
||||
new ItemStack(ItemRegistry.ItemMaterial, 1, 9), 0, 0);
|
||||
r = new TMResearchItem(
|
||||
"BREAKPEARL",
|
||||
TaintedMagicHelper.getPrimals(4).add(Aspect.ENTROPY, 12),
|
||||
8,
|
||||
-6,
|
||||
new ItemStack(ItemRegistry.ItemMaterial, 1, 9),
|
||||
0,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), arcanePage("ItemMaterial:9"), arcanePage("ItemMaterial:10"));
|
||||
r.setConcealed().setParents("PRIMPEARL").setSecondary().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("CREATIONSHARD", TaintedMagicHelper.getPrimals(16), 9, -7,
|
||||
new ItemStack(ItemRegistry.ItemMaterial, 1, 5), 3, 9);
|
||||
r = new TMResearchItem(
|
||||
"CREATIONSHARD",
|
||||
TaintedMagicHelper.getPrimals(16),
|
||||
9,
|
||||
-7,
|
||||
new ItemStack(ItemRegistry.ItemMaterial, 1, 5),
|
||||
3,
|
||||
9);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemMaterial:5"), arcanePage("ItemMaterial:11"));
|
||||
r.setConcealed().setParents("TMELDRITCHMAJOR").setParentsHidden("PRIMPEARL").setSpecial().registerResearchItem();
|
||||
r.setConcealed().setParents("TMELDRITCHMAJOR").setParentsHidden("PRIMPEARL").setSpecial()
|
||||
.registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("CREATION", new AspectList(), 11, -5,
|
||||
new ResourceLocation("taintedmagic:textures/misc/r_creation.png"), 0, 0);
|
||||
r.setPages(new ResearchPage("1"), new ResearchPage("2"), new ResearchPage("3"), new ResearchPage("4"),
|
||||
new ResearchPage("5"), new ResearchPage("6"));
|
||||
r = new TMResearchItem(
|
||||
"CREATION",
|
||||
new AspectList(),
|
||||
11,
|
||||
-5,
|
||||
new ResourceLocation("taintedmagic:textures/misc/r_creation.png"),
|
||||
0,
|
||||
0);
|
||||
r.setPages(
|
||||
new ResearchPage("1"),
|
||||
new ResearchPage("2"),
|
||||
new ResearchPage("3"),
|
||||
new ResearchPage("4"),
|
||||
new ResearchPage("5"),
|
||||
new ResearchPage("6"));
|
||||
r.setParents("CREATIONSHARD").setConcealed().setRound().setSpecial().setHidden().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("SKYSALT", new AspectList().add(TaintedMagicHelper.getPrimals(4)).add(Aspect.WEATHER, 4), 12, -7,
|
||||
new ItemStack(ItemRegistry.ItemSalis, 1, 0), 0, 0);
|
||||
r = new TMResearchItem(
|
||||
"SKYSALT",
|
||||
new AspectList().add(TaintedMagicHelper.getPrimals(4)).add(Aspect.WEATHER, 4),
|
||||
12,
|
||||
-7,
|
||||
new ItemStack(ItemRegistry.ItemSalis, 1, 0),
|
||||
0,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemSalis:0"));
|
||||
r.setConcealed().setParents("CREATION").setSecondary().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("TIMESALT", new AspectList().add(TaintedMagicHelper.getPrimals(4)).add(Aspect.EXCHANGE, 4), 13,
|
||||
-6, new ItemStack(ItemRegistry.ItemSalis, 1, 1), 0, 0);
|
||||
r = new TMResearchItem(
|
||||
"TIMESALT",
|
||||
new AspectList().add(TaintedMagicHelper.getPrimals(4)).add(Aspect.EXCHANGE, 4),
|
||||
13,
|
||||
-6,
|
||||
new ItemStack(ItemRegistry.ItemSalis, 1, 1),
|
||||
0,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemSalis:1"));
|
||||
r.setConcealed().setParents("CREATION").setSecondary().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("THAUMICDISASSEMBLER",
|
||||
new AspectList().add(Aspect.METAL, 4).add(Aspect.WEAPON, 8).add(Aspect.TOOL, 4), 6, -9,
|
||||
new ItemStack(ItemRegistry.ItemThaumicDisassembler), 3, 0);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemThaumicDisassembler"), arcanePage("ItemMaterial:6"),
|
||||
r = new TMResearchItem(
|
||||
"THAUMICDISASSEMBLER",
|
||||
new AspectList().add(Aspect.METAL, 4).add(Aspect.WEAPON, 8).add(Aspect.TOOL, 4),
|
||||
6,
|
||||
-9,
|
||||
new ItemStack(ItemRegistry.ItemThaumicDisassembler),
|
||||
3,
|
||||
0);
|
||||
r.setPages(
|
||||
new ResearchPage("1"),
|
||||
infusionPage("ItemThaumicDisassembler"),
|
||||
arcanePage("ItemMaterial:6"),
|
||||
new ResearchPage("2"));
|
||||
r.setParentsHidden("THAUMIUM", "VOIDMETAL", "PRIMPEARL").setConcealed().setParents("TMELDRITCHMAJOR")
|
||||
.registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("VOIDSASH", new AspectList().add(Aspect.VOID, 4).add(Aspect.METAL, 8).add(Aspect.ARMOR, 4), 3,
|
||||
-9, new ItemStack(ItemRegistry.ItemVoidwalkerSash), 0, 3);
|
||||
r = new TMResearchItem(
|
||||
"VOIDSASH",
|
||||
new AspectList().add(Aspect.VOID, 4).add(Aspect.METAL, 8).add(Aspect.ARMOR, 4),
|
||||
3,
|
||||
-9,
|
||||
new ItemStack(ItemRegistry.ItemVoidwalkerSash),
|
||||
0,
|
||||
3);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemVoidwalkerSash"));
|
||||
r.setParentsHidden("PRIMPEARL").setParents("VOIDWALKERBOOTS").setConcealed().setSecondary().registerResearchItem();
|
||||
r.setParentsHidden("PRIMPEARL").setParents("VOIDWALKERBOOTS").setConcealed().setSecondary()
|
||||
.registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("MAGICFUNGUAR", new AspectList().add(Aspect.MAGIC, 2).add(Aspect.HUNGER, 4).add(Aspect.PLANT, 2),
|
||||
2, -4, new ItemStack(ItemRegistry.ItemMagicFunguar), 0, 0);
|
||||
r = new TMResearchItem(
|
||||
"MAGICFUNGUAR",
|
||||
new AspectList().add(Aspect.MAGIC, 2).add(Aspect.HUNGER, 4).add(Aspect.PLANT, 2),
|
||||
2,
|
||||
-4,
|
||||
new ItemStack(ItemRegistry.ItemMagicFunguar),
|
||||
0,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), arcanePage("ItemMagicFunguar"));
|
||||
r.setSecondary().setParents("VISHROOMCRAFT").setConcealed().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("VISHROOMCRAFT", new AspectList().add(Aspect.MAGIC, 4).add(Aspect.CRAFT, 2).add(Aspect.PLANT, 3),
|
||||
3, -3, new ItemStack(ConfigBlocks.blockCustomPlant, 1, 5), 0, 0);
|
||||
r = new TMResearchItem(
|
||||
"VISHROOMCRAFT",
|
||||
new AspectList().add(Aspect.MAGIC, 4).add(Aspect.CRAFT, 2).add(Aspect.PLANT, 3),
|
||||
3,
|
||||
-3,
|
||||
new ItemStack(ConfigBlocks.blockCustomPlant, 1, 5),
|
||||
0,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), cruciblePage("Vishroom_red"), cruciblePage("Vishroom_brown"));
|
||||
r.setSecondary().setConcealed().setHidden().setItemTriggers(new ItemStack(ConfigBlocks.blockCustomPlant, 1, 5))
|
||||
.registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("HOLLOWDAGGER", new AspectList().add(Aspect.WEAPON, 4).add(Aspect.FIRE, 4).add(Aspect.HEAL, 4),
|
||||
0, -3, new ItemStack(ItemRegistry.ItemHollowDagger, 1, 7), 2, 2);
|
||||
r = new TMResearchItem(
|
||||
"HOLLOWDAGGER",
|
||||
new AspectList().add(Aspect.WEAPON, 4).add(Aspect.FIRE, 4).add(Aspect.HEAL, 4),
|
||||
0,
|
||||
-3,
|
||||
new ItemStack(ItemRegistry.ItemHollowDagger, 1, 7),
|
||||
2,
|
||||
2);
|
||||
r.setPages(new ResearchPage("1"), arcanePage("ItemHollowDagger"));
|
||||
r.setParentsHidden("ENCHFABRIC", "ESSENTIACRYSTAL", "ELDRITCHMINOR").setParents("TAINTEDMAGIC").registerResearchItem();
|
||||
r.setParentsHidden("ENCHFABRIC", "ESSENTIACRYSTAL", "ELDRITCHMINOR").setParents("TAINTEDMAGIC")
|
||||
.registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("CRIMSONBLADE",
|
||||
new AspectList().add(Aspect.ENTROPY, 8).add(Aspect.ELDRITCH, 2).add(Aspect.WEAPON, 16).add(Aspect.VOID, 6), -6,
|
||||
2, new ItemStack(ConfigItems.itemSwordCrimson), 0, 5);
|
||||
r = new TMResearchItem(
|
||||
"CRIMSONBLADE",
|
||||
new AspectList().add(Aspect.ENTROPY, 8).add(Aspect.ELDRITCH, 2).add(Aspect.WEAPON, 16)
|
||||
.add(Aspect.VOID, 6),
|
||||
-6,
|
||||
2,
|
||||
new ItemStack(ConfigItems.itemSwordCrimson),
|
||||
0,
|
||||
5);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemSwordCrimson"));
|
||||
r.setParents("PRAETORARMOR").setConcealed().setSecondary().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("SHADOWFORTRESS",
|
||||
new AspectList().add(Aspect.METAL, 4).add(Aspect.DARKNESS, 8).add(Aspect.ARMOR, 8).add(Aspect.VOID, 2), 0, 3,
|
||||
new ItemStack(ItemRegistry.ItemShadowFortressHelmet), 3, 3);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemShadowFortressHelmet"),
|
||||
infusionPage("ItemShadowFortressChestplate"), infusionPage("ItemShadowFortressLeggings"));
|
||||
r.setParents("SHADOWMETAL").setConcealed().setParentsHidden("VOIDFORTRESS", "TMELDRITCHMAJOR", "UNBALANCEDSHARDS")
|
||||
.registerResearchItem();
|
||||
r = new TMResearchItem(
|
||||
"SHADOWFORTRESS",
|
||||
new AspectList().add(Aspect.METAL, 4).add(Aspect.DARKNESS, 8).add(Aspect.ARMOR, 8).add(Aspect.VOID, 2),
|
||||
0,
|
||||
3,
|
||||
new ItemStack(ItemRegistry.ItemShadowFortressHelmet),
|
||||
3,
|
||||
3);
|
||||
r.setPages(
|
||||
new ResearchPage("1"),
|
||||
infusionPage("ItemShadowFortressHelmet"),
|
||||
infusionPage("ItemShadowFortressChestplate"),
|
||||
infusionPage("ItemShadowFortressLeggings"));
|
||||
r.setParents("SHADOWMETAL").setConcealed()
|
||||
.setParentsHidden("VOIDFORTRESS", "TMELDRITCHMAJOR", "UNBALANCEDSHARDS").registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("CAP_cloth", new AspectList().add(Aspect.MAGIC, 4).add(Aspect.CLOTH, 4), 3, 1,
|
||||
new ItemStack(ItemRegistry.ItemWandCap, 1, 1), 0, 0);
|
||||
r = new TMResearchItem(
|
||||
"CAP_cloth",
|
||||
new AspectList().add(Aspect.MAGIC, 4).add(Aspect.CLOTH, 4),
|
||||
3,
|
||||
1,
|
||||
new ItemStack(ItemRegistry.ItemWandCap, 1, 1),
|
||||
0,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), arcanePage("ItemWandCap:1"));
|
||||
r.setParentsHidden("CAP_gold", "ENCHFABRIC").setConcealed().setSecondary().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("CAP_crimsoncloth",
|
||||
new AspectList().add(Aspect.MAGIC, 8).add(Aspect.CLOTH, 4).add(Aspect.HEAL, 8), -1, -1,
|
||||
new ItemStack(ItemRegistry.ItemWandCap, 1, 2), 0, 0);
|
||||
r = new TMResearchItem(
|
||||
"CAP_crimsoncloth",
|
||||
new AspectList().add(Aspect.MAGIC, 8).add(Aspect.CLOTH, 4).add(Aspect.HEAL, 8),
|
||||
-1,
|
||||
-1,
|
||||
new ItemStack(ItemRegistry.ItemWandCap, 1, 2),
|
||||
0,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), arcanePage("ItemWandCap:2"));
|
||||
r.setParentsHidden("CAP_cloth").setSecondary().setConcealed().setParents("CRIMSONROBES").registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("CAP_shadowcloth",
|
||||
new AspectList().add(Aspect.MAGIC, 16).add(Aspect.CLOTH, 8).add(Aspect.VOID, 16).add(Aspect.DARKNESS, 8), -3, 5,
|
||||
new ItemStack(ItemRegistry.ItemWandCap, 1, 3), 0, 1);
|
||||
r = new TMResearchItem(
|
||||
"CAP_shadowcloth",
|
||||
new AspectList().add(Aspect.MAGIC, 16).add(Aspect.CLOTH, 8).add(Aspect.VOID, 16)
|
||||
.add(Aspect.DARKNESS, 8),
|
||||
-3,
|
||||
5,
|
||||
new ItemStack(ItemRegistry.ItemWandCap, 1, 3),
|
||||
0,
|
||||
1);
|
||||
r.setPages(new ResearchPage("1"), arcanePage("ItemWandCap:3"));
|
||||
r.setParentsHidden("CAP_cloth").setSecondary().setConcealed().setParents("SHADOWCLOTH").registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("PRIMALBLADE", new AspectList().add(Aspect.MAGIC, 1).add(Aspect.ELDRITCH, 1)
|
||||
.add(Aspect.WEAPON, 1).add(Aspect.VOID, 1).add(Aspect.AURA, 1), 11, -3,
|
||||
new ItemStack(ItemRegistry.ItemPrimalBlade), 3, 5);
|
||||
r = new TMResearchItem(
|
||||
"PRIMALBLADE",
|
||||
new AspectList().add(Aspect.MAGIC, 1).add(Aspect.ELDRITCH, 1).add(Aspect.WEAPON, 1).add(Aspect.VOID, 1)
|
||||
.add(Aspect.AURA, 1),
|
||||
11,
|
||||
-3,
|
||||
new ItemStack(ItemRegistry.ItemPrimalBlade),
|
||||
3,
|
||||
5);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemPrimalBlade"));
|
||||
r.setParentsHidden("VOIDMETAL", "PRIMALCRUSHER", "UNBALANCEDSHARDS", "HOLLOWDAGGER").setConcealed()
|
||||
.setParents("CREATION").registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("THAUMIUMKATANA",
|
||||
new AspectList().add(Aspect.METAL, 8).add(Aspect.MAGIC, 4).add(Aspect.WEAPON, 6), 12, -1,
|
||||
new ItemStack(ItemRegistry.ItemKatana, 1, 0), 3, 0);
|
||||
r = new TMResearchItem(
|
||||
"THAUMIUMKATANA",
|
||||
new AspectList().add(Aspect.METAL, 8).add(Aspect.MAGIC, 4).add(Aspect.WEAPON, 6),
|
||||
12,
|
||||
-1,
|
||||
new ItemStack(ItemRegistry.ItemKatana, 1, 0),
|
||||
3,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemKatana:0"));
|
||||
r.setParentsHidden("ARMORFORTRESS").setConcealed().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("VOIDMETALKATANA",
|
||||
new AspectList().add(Aspect.METAL, 16).add(Aspect.MAGIC, 8).add(Aspect.WEAPON, 12).add(Aspect.VOID, 12), 7, -10,
|
||||
new ItemStack(ItemRegistry.ItemKatana, 1, 1), 3, 3);
|
||||
r = new TMResearchItem(
|
||||
"VOIDMETALKATANA",
|
||||
new AspectList().add(Aspect.METAL, 16).add(Aspect.MAGIC, 8).add(Aspect.WEAPON, 12).add(Aspect.VOID, 12),
|
||||
7,
|
||||
-10,
|
||||
new ItemStack(ItemRegistry.ItemKatana, 1, 1),
|
||||
3,
|
||||
3);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemKatana:1"));
|
||||
r.setParentsHidden("THAUMIUMKATANA").setParents("VOIDFORTRESS").setConcealed().setSecondary().registerResearchItem();
|
||||
r.setParentsHidden("THAUMIUMKATANA").setParents("VOIDFORTRESS").setConcealed().setSecondary()
|
||||
.registerResearchItem();
|
||||
|
||||
r = new TMResearchItem(
|
||||
"SHADOWMETALKATANA", new AspectList().add(Aspect.METAL, 16).add(Aspect.MAGIC, 8).add(Aspect.WEAPON, 12)
|
||||
.add(Aspect.VOID, 12).add(Aspect.DARKNESS, 14),
|
||||
0, 5, new ItemStack(ItemRegistry.ItemKatana, 1, 2), 3, 5);
|
||||
"SHADOWMETALKATANA",
|
||||
new AspectList().add(Aspect.METAL, 16).add(Aspect.MAGIC, 8).add(Aspect.WEAPON, 12).add(Aspect.VOID, 12)
|
||||
.add(Aspect.DARKNESS, 14),
|
||||
0,
|
||||
5,
|
||||
new ItemStack(ItemRegistry.ItemKatana, 1, 2),
|
||||
3,
|
||||
5);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemKatana:2"));
|
||||
r.setParentsHidden("VOIDMETALKATANA").setParents("SHADOWFORTRESS").setConcealed().setSecondary().registerResearchItem();
|
||||
r.setParentsHidden("VOIDMETALKATANA").setParents("SHADOWFORTRESS").setConcealed().setSecondary()
|
||||
.registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("INSCRIPTIONFIRE",
|
||||
new AspectList().add(Aspect.FIRE, 8).add(Aspect.ENTROPY, 4).add(Aspect.METAL, 6), 14, 0,
|
||||
new ResourceLocation("taintedmagic:textures/misc/r_inscription0.png"), 0, 0);
|
||||
r = new TMResearchItem(
|
||||
"INSCRIPTIONFIRE",
|
||||
new AspectList().add(Aspect.FIRE, 8).add(Aspect.ENTROPY, 4).add(Aspect.METAL, 6),
|
||||
14,
|
||||
0,
|
||||
new ResourceLocation("taintedmagic:textures/misc/r_inscription0.png"),
|
||||
0,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemKatanaThaumium:inscription0"));
|
||||
r.setParents("THAUMIUMKATANA").setParentsHidden("FOCUSFIRE").setConcealed().setSecondary().registerResearchItem();
|
||||
r.setParents("THAUMIUMKATANA").setParentsHidden("FOCUSFIRE").setConcealed().setSecondary()
|
||||
.registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("INSCRIPTIONTHUNDER",
|
||||
new AspectList().add(Aspect.ENTROPY, 8).add(Aspect.MOTION, 4).add(Aspect.METAL, 6), 14, 1,
|
||||
new ResourceLocation("taintedmagic:textures/misc/r_inscription1.png"), 0, 0);
|
||||
r = new TMResearchItem(
|
||||
"INSCRIPTIONTHUNDER",
|
||||
new AspectList().add(Aspect.ENTROPY, 8).add(Aspect.MOTION, 4).add(Aspect.METAL, 6),
|
||||
14,
|
||||
1,
|
||||
new ResourceLocation("taintedmagic:textures/misc/r_inscription1.png"),
|
||||
0,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemKatanaThaumium:inscription1"));
|
||||
r.setParents("THAUMIUMKATANA").setParentsHidden("FOCUSSHOCKWAVE").setConcealed().setSecondary().registerResearchItem();
|
||||
r.setParents("THAUMIUMKATANA").setParentsHidden("FOCUSSHOCKWAVE").setConcealed().setSecondary()
|
||||
.registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("INSCRIPTIONHEAL",
|
||||
new AspectList().add(Aspect.HEAL, 8).add(Aspect.UNDEAD, 4).add(Aspect.METAL, 6), 14, 2,
|
||||
new ResourceLocation("taintedmagic:textures/misc/r_inscription2.png"), 0, 2);
|
||||
r = new TMResearchItem(
|
||||
"INSCRIPTIONHEAL",
|
||||
new AspectList().add(Aspect.HEAL, 8).add(Aspect.UNDEAD, 4).add(Aspect.METAL, 6),
|
||||
14,
|
||||
2,
|
||||
new ResourceLocation("taintedmagic:textures/misc/r_inscription2.png"),
|
||||
0,
|
||||
2);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemKatanaThaumium:inscription2"));
|
||||
r.setParents("THAUMIUMKATANA").setParentsHidden("BATHSALTS").setConcealed().setSecondary().registerResearchItem();
|
||||
r.setParents("THAUMIUMKATANA").setParentsHidden("BATHSALTS").setConcealed().setSecondary()
|
||||
.registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("VOIDGOGGLES",
|
||||
new AspectList().add(Aspect.VOID, 8).add(Aspect.DARKNESS, 4).add(Aspect.MAGIC, 6).add(Aspect.SENSES, 12), 3, 3,
|
||||
new ItemStack(ItemRegistry.ItemVoidmetalGoggles), 0, 2);
|
||||
r = new TMResearchItem(
|
||||
"VOIDGOGGLES",
|
||||
new AspectList().add(Aspect.VOID, 8).add(Aspect.DARKNESS, 4).add(Aspect.MAGIC, 6)
|
||||
.add(Aspect.SENSES, 12),
|
||||
3,
|
||||
3,
|
||||
new ItemStack(ItemRegistry.ItemVoidmetalGoggles),
|
||||
0,
|
||||
2);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemVoidmetalGoggles"));
|
||||
r.setParents("WARPEDGOGGLES").setParentsHidden("VOIDMETAL").setConcealed().setSecondary().registerResearchItem();
|
||||
r.setParents("WARPEDGOGGLES").setParentsHidden("VOIDMETAL").setConcealed().setSecondary()
|
||||
.registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("ELDRITCHFOCUS",
|
||||
new AspectList().add(Aspect.ELDRITCH, 22).add(Aspect.ENTROPY, 14).add(Aspect.AIR, 4).add(Aspect.DARKNESS, 6), 5,
|
||||
-5, new ItemStack(ItemRegistry.ItemFocusDarkMatter), 3, 7);
|
||||
r = new TMResearchItem(
|
||||
"ELDRITCHFOCUS",
|
||||
new AspectList().add(Aspect.ELDRITCH, 22).add(Aspect.ENTROPY, 14).add(Aspect.AIR, 4)
|
||||
.add(Aspect.DARKNESS, 6),
|
||||
5,
|
||||
-5,
|
||||
new ItemStack(ItemRegistry.ItemFocusDarkMatter),
|
||||
3,
|
||||
7);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemFocusDarkMatter"));
|
||||
r.setParentsHidden("OUTERREV").setParents("TMELDRITCHMAJOR").setConcealed().setSpecial().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("DIFFUSIONUPGRADE",
|
||||
new AspectList().add(Aspect.MAGIC, 4).add(Aspect.DARKNESS, 8).add(Aspect.WEAPON, 8).add(Aspect.ELDRITCH, 10), 6,
|
||||
-4, new ResourceLocation("taintedmagic:textures/foci/IconDiffusion.png"), 0, 2);
|
||||
r = new TMResearchItem(
|
||||
"DIFFUSIONUPGRADE",
|
||||
new AspectList().add(Aspect.MAGIC, 4).add(Aspect.DARKNESS, 8).add(Aspect.WEAPON, 8)
|
||||
.add(Aspect.ELDRITCH, 10),
|
||||
6,
|
||||
-4,
|
||||
new ResourceLocation("taintedmagic:textures/foci/IconDiffusion.png"),
|
||||
0,
|
||||
2);
|
||||
r.setPages(new ResearchPage("1"));
|
||||
r.setParentsHidden("FOCALMANIPULATION").setConcealed().setParents("ELDRITCHFOCUS").setSecondary()
|
||||
.registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("MACEFOCUS",
|
||||
new AspectList().add(Aspect.ENTROPY, 10).add(Aspect.EARTH, 4).add(Aspect.WEAPON, 6).add(Aspect.MAGIC, 8), 7, 3,
|
||||
new ItemStack(ItemRegistry.ItemFocusMageMace), 2, 0);
|
||||
r = new TMResearchItem(
|
||||
"MACEFOCUS",
|
||||
new AspectList().add(Aspect.ENTROPY, 10).add(Aspect.EARTH, 4).add(Aspect.WEAPON, 6)
|
||||
.add(Aspect.MAGIC, 8),
|
||||
7,
|
||||
3,
|
||||
new ItemStack(ItemRegistry.ItemFocusMageMace),
|
||||
2,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemFocusMageMace"));
|
||||
r.setConcealed().setParentsHidden("THAUMIUM", "FOCUSFIRE").registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("FOCUSSHOCKWAVE",
|
||||
new AspectList().add(Aspect.MAGIC, 20).add(Aspect.ENTROPY, 12).add(Aspect.AIR, 6).add(Aspect.MOTION, 12), 7, 2,
|
||||
new ItemStack(ItemRegistry.ItemFocusShockwave), 0, 0);
|
||||
r = new TMResearchItem(
|
||||
"FOCUSSHOCKWAVE",
|
||||
new AspectList().add(Aspect.MAGIC, 20).add(Aspect.ENTROPY, 12).add(Aspect.AIR, 6)
|
||||
.add(Aspect.MOTION, 12),
|
||||
7,
|
||||
2,
|
||||
new ItemStack(ItemRegistry.ItemFocusShockwave),
|
||||
0,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemFocusShockwave"));
|
||||
r.setParentsHidden("FOCUSSHOCK").setConcealed().setSecondary().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("FOCUSSHARD", new AspectList().add(Aspect.CRYSTAL, 2).add(Aspect.MAGIC, 4).add(Aspect.MOTION, 6),
|
||||
6, 1, new ItemStack(ItemRegistry.ItemFocusVisShard), 0, 0);
|
||||
r = new TMResearchItem(
|
||||
"FOCUSSHARD",
|
||||
new AspectList().add(Aspect.CRYSTAL, 2).add(Aspect.MAGIC, 4).add(Aspect.MOTION, 6),
|
||||
6,
|
||||
1,
|
||||
new ItemStack(ItemRegistry.ItemFocusVisShard),
|
||||
0,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), arcanePage("ItemFocusVisShard"));
|
||||
r.setParents("UNBALANCEDSHARDS").setParentsHidden("FOCUSFIRE").setConcealed().setSecondary().registerResearchItem();
|
||||
r.setParents("UNBALANCEDSHARDS").setParentsHidden("FOCUSFIRE").setConcealed().setSecondary()
|
||||
.registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("TAINTFOCUS", new AspectList().add(Aspect.TAINT, 4).add(Aspect.LIFE, 4).add(Aspect.MOTION, 4), 5,
|
||||
2, new ItemStack(ItemRegistry.ItemFocusTaintSwarm), 3, 3);
|
||||
r = new TMResearchItem(
|
||||
"TAINTFOCUS",
|
||||
new AspectList().add(Aspect.TAINT, 4).add(Aspect.LIFE, 4).add(Aspect.MOTION, 4),
|
||||
5,
|
||||
2,
|
||||
new ItemStack(ItemRegistry.ItemFocusTaintSwarm),
|
||||
3,
|
||||
3);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemFocusTaintSwarm"));
|
||||
r.setParentsHidden("INFUSION", "BOTTLETAINT").setParents("FOCUSSHARD").setConcealed().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("FOCUSLUMOS", new AspectList().add(Aspect.FIRE, 16).add(Aspect.LIGHT, 24).add(Aspect.ENERGY, 8),
|
||||
5, 3, new ItemStack(ItemRegistry.ItemFocusLumos), 0, 0);
|
||||
r = new TMResearchItem(
|
||||
"FOCUSLUMOS",
|
||||
new AspectList().add(Aspect.FIRE, 16).add(Aspect.LIGHT, 24).add(Aspect.ENERGY, 8),
|
||||
5,
|
||||
3,
|
||||
new ItemStack(ItemRegistry.ItemFocusLumos),
|
||||
0,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), arcanePage("ItemFocusLumos"));
|
||||
r.setParentsHidden("FOCUSFIRE").setConcealed().setSecondary().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("LUMOSRING",
|
||||
new AspectList().add(Aspect.ARMOR, 16).add(Aspect.AURA, 12).add(Aspect.LIGHT, 24).add(Aspect.ENERGY, 8), 6, 4,
|
||||
new ItemStack(ItemRegistry.ItemLumosRing), 2, 0);
|
||||
r = new TMResearchItem(
|
||||
"LUMOSRING",
|
||||
new AspectList().add(Aspect.ARMOR, 16).add(Aspect.AURA, 12).add(Aspect.LIGHT, 24).add(Aspect.ENERGY, 8),
|
||||
6,
|
||||
4,
|
||||
new ItemStack(ItemRegistry.ItemLumosRing),
|
||||
2,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemLumosRing"));
|
||||
r.setParents("FOCUSLUMOS").setParentsHidden("RUNICARMOR").setConcealed().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("FLYTECHARM",
|
||||
new AspectList().add(Aspect.FLIGHT, 15).add(Aspect.AIR, 20).add(Aspect.SENSES, 8).add(Aspect.MAGIC, 12), 13, -4,
|
||||
new ItemStack(ItemRegistry.ItemFlyteCharm), 3, 0);
|
||||
r = new TMResearchItem(
|
||||
"FLYTECHARM",
|
||||
new AspectList().add(Aspect.FLIGHT, 15).add(Aspect.AIR, 20).add(Aspect.SENSES, 8).add(Aspect.MAGIC, 12),
|
||||
13,
|
||||
-4,
|
||||
new ItemStack(ItemRegistry.ItemFlyteCharm),
|
||||
3,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemFlyteCharm"));
|
||||
r.setParents("CREATION").setParentsHidden("VOIDSASH", "PRIMALARROW").setConcealed().registerResearchItem();
|
||||
|
||||
r = new TMResearchItem("GATEKEY",
|
||||
new AspectList().add(Aspect.TRAVEL, 30).add(Aspect.EXCHANGE, 15).add(Aspect.AURA, 20).add(Aspect.FLIGHT, 10), 9,
|
||||
-4, new ItemStack(ItemRegistry.ItemGateKey), 3, 0);
|
||||
r = new TMResearchItem(
|
||||
"GATEKEY",
|
||||
new AspectList().add(Aspect.TRAVEL, 30).add(Aspect.EXCHANGE, 15).add(Aspect.AURA, 20)
|
||||
.add(Aspect.FLIGHT, 10),
|
||||
9,
|
||||
-4,
|
||||
new ItemStack(ItemRegistry.ItemGateKey),
|
||||
3,
|
||||
0);
|
||||
r.setPages(new ResearchPage("1"), infusionPage("ItemGateKey"));
|
||||
r.setParents("CREATION").setConcealed().registerResearchItem();
|
||||
}
|
||||
@@ -340,19 +662,19 @@ public class ResearchRegistry {
|
||||
* ResearchPage helpers
|
||||
*/
|
||||
|
||||
private static ResearchPage recipePage (final String key) {
|
||||
private static ResearchPage recipePage(final String key) {
|
||||
return new ResearchPage((IRecipe) recipes.get(key));
|
||||
}
|
||||
|
||||
private static ResearchPage arcanePage (final String key) {
|
||||
private static ResearchPage arcanePage(final String key) {
|
||||
return new ResearchPage((IArcaneRecipe) recipes.get(key));
|
||||
}
|
||||
|
||||
private static ResearchPage infusionPage (final String key) {
|
||||
private static ResearchPage infusionPage(final String key) {
|
||||
return new ResearchPage((InfusionRecipe) recipes.get(key));
|
||||
}
|
||||
|
||||
private static ResearchPage cruciblePage (final String key) {
|
||||
private static ResearchPage cruciblePage(final String key) {
|
||||
return new ResearchPage((CrucibleRecipe) recipes.get(key));
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,32 @@
|
||||
package taintedmagic.common.registry;
|
||||
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.entities.EntityDarkMatter;
|
||||
import taintedmagic.common.entities.EntityDiffusion;
|
||||
import taintedmagic.common.entities.EntityHomingShard;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
|
||||
public class TMEntityRegistry {
|
||||
|
||||
public static void initEntities () {
|
||||
public static void initEntities() {
|
||||
int id = 0;
|
||||
EntityRegistry.registerModEntity(EntityDarkMatter.class, "EntityDarkMatter", id++, TaintedMagic.instance, 64, 21, true);
|
||||
EntityRegistry.registerModEntity(EntityHomingShard.class, "EntityHomingShard", id++, TaintedMagic.instance, 64, 3,
|
||||
EntityRegistry.registerModEntity(
|
||||
EntityDarkMatter.class,
|
||||
"EntityDarkMatter",
|
||||
id++,
|
||||
TaintedMagic.instance,
|
||||
64,
|
||||
21,
|
||||
true);
|
||||
EntityRegistry.registerModEntity(EntityDiffusion.class, "EntityDiffusion", id++, TaintedMagic.instance, 64, 20, true);
|
||||
EntityRegistry.registerModEntity(
|
||||
EntityHomingShard.class,
|
||||
"EntityHomingShard",
|
||||
id++,
|
||||
TaintedMagic.instance,
|
||||
64,
|
||||
3,
|
||||
true);
|
||||
EntityRegistry
|
||||
.registerModEntity(EntityDiffusion.class, "EntityDiffusion", id++, TaintedMagic.instance, 64, 20, true);
|
||||
}
|
||||
}
|
||||
@@ -1,52 +1,53 @@
|
||||
package taintedmagic.common.research;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import taintedmagic.common.handler.ConfigHandler;
|
||||
import taintedmagic.common.registry.ResearchRegistry;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchItem;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class TMResearchItem extends ResearchItem {
|
||||
|
||||
private int warp = 0;
|
||||
|
||||
public TMResearchItem (final String key, final String category) {
|
||||
public TMResearchItem(final String key, final String category) {
|
||||
super(key, category);
|
||||
}
|
||||
|
||||
public TMResearchItem (final String key, final AspectList tags, final int col, final int row, final ItemStack icon,
|
||||
public TMResearchItem(final String key, final AspectList tags, final int col, final int row, final ItemStack icon,
|
||||
final int complexity, final int warp) {
|
||||
super(key, ResearchRegistry.CATEGORY_TM, tags, col, row, complexity, icon);
|
||||
this.warp = warp;
|
||||
}
|
||||
|
||||
public TMResearchItem (final String key, final AspectList tags, final int col, final int row, final ResourceLocation icon,
|
||||
final int complexity, final int warp) {
|
||||
public TMResearchItem(final String key, final AspectList tags, final int col, final int row,
|
||||
final ResourceLocation icon, final int complexity, final int warp) {
|
||||
super(key, ResearchRegistry.CATEGORY_TM, tags, col, row, complexity, icon);
|
||||
this.warp = warp;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public String getName () {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getName() {
|
||||
return StatCollector.translateToLocal("tm.name." + key);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public String getText () {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getText() {
|
||||
return (ConfigHandler.RESEARCH_TAGS ? "[TM] " : "")
|
||||
+ StatCollector.translateToLocal(new StringBuilder("tm.tag.").append(key).toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResearchItem setPages (final ResearchPage... pages) {
|
||||
public ResearchItem setPages(final ResearchPage... pages) {
|
||||
for (final ResearchPage page : pages) {
|
||||
if (page.type == ResearchPage.PageType.TEXT) {
|
||||
page.text = "tm.text." + key + "." + page.text;
|
||||
@@ -57,9 +58,8 @@ public class TMResearchItem extends ResearchItem {
|
||||
}
|
||||
|
||||
if (parentsHidden == null || parentsHidden.length == 0) {
|
||||
parentsHidden = new String[]{ "INFUSION" };
|
||||
}
|
||||
else {
|
||||
parentsHidden = new String[] { "INFUSION" };
|
||||
} else {
|
||||
final String[] newParents = new String[parentsHidden.length + 1];
|
||||
newParents[0] = "INFUSION";
|
||||
|
||||
@@ -74,11 +74,11 @@ public class TMResearchItem extends ResearchItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResearchItem registerResearchItem () {
|
||||
public ResearchItem registerResearchItem() {
|
||||
super.registerResearchItem();
|
||||
if (warp > 0) {
|
||||
ThaumcraftApi.addWarpToResearch(key, warp);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,25 @@
|
||||
package taintedmagic.common.research;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import taintedmagic.common.registry.ResearchRegistry;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchCategories;
|
||||
import thaumcraft.api.research.ResearchItem;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* This class was created by <flaxbeard> as part of Thaumic Exploration.
|
||||
* It is being distributed as part of Tainted Magic.
|
||||
* This class was created by <flaxbeard> as part of Thaumic Exploration. It is being distributed as part of Tainted
|
||||
* Magic.
|
||||
*/
|
||||
public class ThaumcraftResearchItem extends ResearchItem {
|
||||
|
||||
private final ResearchItem original;
|
||||
|
||||
public ThaumcraftResearchItem (final String tag, final String origin, final String originCategory, final int col,
|
||||
public ThaumcraftResearchItem(final String tag, final String origin, final String originCategory, final int col,
|
||||
final int row, final ResourceLocation icon) {
|
||||
super(tag, ResearchRegistry.CATEGORY_TM, new AspectList(), col, row, 1, icon);
|
||||
original = ResearchCategories.researchCategories.get(originCategory).research.get(origin);
|
||||
@@ -27,7 +28,7 @@ public class ThaumcraftResearchItem extends ResearchItem {
|
||||
setHidden();
|
||||
}
|
||||
|
||||
public ThaumcraftResearchItem (final String tag, final String origin, final String originCategory, final int col,
|
||||
public ThaumcraftResearchItem(final String tag, final String origin, final String originCategory, final int col,
|
||||
final int row, final ItemStack icon) {
|
||||
super(tag, ResearchRegistry.CATEGORY_TM, new AspectList(), col, row, 1, icon);
|
||||
original = ResearchCategories.researchCategories.get(originCategory).research.get(origin);
|
||||
@@ -36,11 +37,10 @@ public class ThaumcraftResearchItem extends ResearchItem {
|
||||
setHidden();
|
||||
}
|
||||
|
||||
private void bindToOriginal () {
|
||||
private void bindToOriginal() {
|
||||
if (original.siblings == null) {
|
||||
original.setSiblings(key);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
final String[] family = original.siblings;
|
||||
final String[] newFamily = new String[family.length + 1];
|
||||
for (int x = 0; x < family.length; x++) {
|
||||
@@ -55,34 +55,34 @@ public class ThaumcraftResearchItem extends ResearchItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResearchPage[] getPages () {
|
||||
public ResearchPage[] getPages() {
|
||||
return original.getPages();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public String getName () {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getName() {
|
||||
return original.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public String getText () {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getText() {
|
||||
return original.getText();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStub () {
|
||||
public boolean isStub() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHidden () {
|
||||
public boolean isHidden() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComplexity () {
|
||||
public int getComplexity() {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import taintedmagic.common.registry.BlockRegistry;
|
||||
import thaumcraft.common.lib.world.WorldGenCustomFlowers;
|
||||
|
||||
@@ -24,7 +25,7 @@ public class WorldGenWarpwoodTree extends WorldGenAbstractTree {
|
||||
private final int randomTreeHeight;
|
||||
boolean worldgen = false;
|
||||
|
||||
public WorldGenWarpwoodTree (final boolean doBlockNotify, final int minTreeHeight, final int randomTreeHeight) {
|
||||
public WorldGenWarpwoodTree(final boolean doBlockNotify, final int minTreeHeight, final int randomTreeHeight) {
|
||||
super(doBlockNotify);
|
||||
worldgen = !doBlockNotify;
|
||||
this.minTreeHeight = minTreeHeight;
|
||||
@@ -34,11 +35,10 @@ public class WorldGenWarpwoodTree extends WorldGenAbstractTree {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generate (final World world, final Random random, final int x, final int y, final int z) {
|
||||
public boolean generate(final World world, final Random random, final int x, final int y, final int z) {
|
||||
final int height = random.nextInt(randomTreeHeight) + minTreeHeight;
|
||||
boolean flag = true;
|
||||
if (y < 1 || y + height + 1 > 256)
|
||||
return false;
|
||||
if (y < 1 || y + height + 1 > 256) return false;
|
||||
for (int i1 = y; i1 <= y + 1 + height; ++i1) {
|
||||
byte spread = 1;
|
||||
if (i1 == y) {
|
||||
@@ -54,23 +54,22 @@ public class WorldGenWarpwoodTree extends WorldGenAbstractTree {
|
||||
if (i1 >= 0 && i1 < 256) {
|
||||
final Block block = world.getBlock(j1, i1, k1);
|
||||
if (!block.isAir(world, j1, i1, k1) && !block.isLeaves(world, j1, i1, k1)
|
||||
&& !block.isReplaceable(world, j1, i1, k1) && i1 > y) {
|
||||
&& !block.isReplaceable(world, j1, i1, k1)
|
||||
&& i1 > y) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!flag)
|
||||
return false;
|
||||
if (!flag) return false;
|
||||
final Block block1 = world.getBlock(x, y - 1, z);
|
||||
final boolean isSoil = block1.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, (BlockSapling) Blocks.sapling);
|
||||
if (!isSoil || y >= 256 - height - 1)
|
||||
return false;
|
||||
final boolean isSoil = block1
|
||||
.canSustainPlant(world, x, y - 1, z, ForgeDirection.UP, (BlockSapling) Blocks.sapling);
|
||||
if (!isSoil || y >= 256 - height - 1) return false;
|
||||
block1.onPlantGrow(world, x, y - 1, z, x, y, z);
|
||||
final int start = y + height - 5;
|
||||
final int end = y + height + 3 + random.nextInt(3);
|
||||
@@ -86,7 +85,8 @@ public class WorldGenWarpwoodTree extends WorldGenAbstractTree {
|
||||
final double d5 = zz - z;
|
||||
final double dist = d3 * d3 + d4 * d4 + d5 * d5;
|
||||
|
||||
if (dist < 10 + random.nextInt(8) && world.getBlock(xx, k2, zz).canBeReplacedByLeaves(world, xx, k2, zz)) {
|
||||
if (dist < 10 + random.nextInt(8)
|
||||
&& world.getBlock(xx, k2, zz).canBeReplacedByLeaves(world, xx, k2, zz)) {
|
||||
setBlockAndNotifyAdequately(world, xx, k2, zz, leaves, 1);
|
||||
}
|
||||
}
|
||||
@@ -107,8 +107,7 @@ public class WorldGenWarpwoodTree extends WorldGenAbstractTree {
|
||||
if (k2 > 0 && !lastblock && random.nextInt(chance) == 0) {
|
||||
setBlockAndNotifyAdequately(world, x, y + k2, z, trunk, 2);
|
||||
lastblock = true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
setBlockAndNotifyAdequately(world, x, y + k2, z, trunk, 0);
|
||||
lastblock = false;
|
||||
chance--;
|
||||
@@ -180,4 +179,4 @@ public class WorldGenWarpwoodTree extends WorldGenAbstractTree {
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user