Cleanup and texture improvments

This commit is contained in:
John Yorke committed 2017-07-22 00:31:39 -03:00
1 parent cc77874e71
commit 11221eac84
28 files changed
+211 -118

No files matched your search

@@ -1,6 +1,7 @@
package taintedmagic.client;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
@@ -18,6 +19,7 @@ import taintedmagic.common.entities.EntityGlowpet;
import taintedmagic.common.entities.EntityHomingShard;
import taintedmagic.common.entities.EntityTaintBubble;
import taintedmagic.common.helper.TaintedMagicHelper;
import taintedmagic.common.items.tools.ItemKatana;
import taintedmagic.common.registry.ItemRegistry;
import thaumcraft.client.fx.ParticleEngine;
import thaumcraft.client.fx.particles.FXWisp;
@@ -48,6 +50,12 @@ public class ClientProxy extends CommonProxy
return Minecraft.getMinecraft().thePlayer;
}
@Override
public WorldClient getClientWorld ()
{
return Minecraft.getMinecraft().theWorld;
}
@Override
public void registerClientHandlers ()
{
@@ -21,8 +21,8 @@ public class RenderEntityDiffusion extends Render
GL11.glTranslated(x, y, z);
float c = 0.1F;
float a = ( (20.0F - (float) e.ticksExisted) / 40.0F);
float color = 0.1F;
float alpha = (20.0F - (float) e.ticksExisted) / 40.0F;
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
@@ -37,7 +37,7 @@ public class RenderEntityDiffusion extends Render
float f7 = 0.5F;
float f8 = 0.5F;
GL11.glColor4f(c, c, c, a);
GL11.glColor4f(color, color, color, alpha);
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
@@ -48,7 +48,7 @@ public class RenderEntityDiffusion extends Render
t.startDrawingQuads();
t.setNormal(0.0F, 1.0F, 0.0F);
t.setColorRGBA_F(c, c, c, a);
t.setColorRGBA_F(color, color, color, alpha);
t.addVertexWithUV(0.0F - f7, 0.0F - f8, 0.0D, f2, f5);
t.addVertexWithUV(f6 - f7, 0.0F - f8, 0.0D, f3, f5);
@@ -7,6 +7,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import taintedmagic.common.entities.EntityGlowpet;
import thaumcraft.client.fx.ParticleEngine;
@@ -24,9 +25,11 @@ public class RenderEntityGlowpet extends Render
Tessellator t = Tessellator.instance;
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
bindTexture(ParticleEngine.particleTexture);
@@ -39,17 +42,26 @@ public class RenderEntityGlowpet extends Render
float f7 = 0.5F;
float f8 = 0.5F;
GL11.glColor4f(1.0F, 0.75F, 0.45F, 1.0F);
float red = 1.0F;
float green = 0.75F;
float blue = 0.5F;
float alpha = 1.0F;
GL11.glColor4f(red, green, blue, alpha);
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
GL11.glScalef(0.4F, 0.4F, 0.4F);
float s = 0.4F;
GL11.glScalef(s, s, s);
t.startDrawingQuads();
t.setColorRGBA_F(1.0F, 0.75F, 0.45F, 1.0F);
t.setColorRGBA_F(red, green, blue, alpha);
t.setNormal(0.0F, 1.0F, 0.0F);
t.setBrightness(240);
@@ -62,12 +74,10 @@ public class RenderEntityGlowpet extends Render
GL11.glPopMatrix();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glBlendFunc(770, 771);
GL11.glDisable(3042);
GL11.glDisable(32826);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glDepthMask(true);
GL11.glPopMatrix();
}
@@ -9,6 +9,7 @@ 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;
@@ -30,9 +31,11 @@ public class RenderEntityHomingShard extends Render
Tessellator t = Tessellator.instance;
GL11.glPushMatrix();
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
bindTexture(ParticleEngine.particleTexture);
@@ -45,17 +48,24 @@ public class RenderEntityHomingShard extends Render
float f7 = 0.5F;
float f8 = 0.5F;
GL11.glColor4f(0.405F, 0.075F, 0.525F, 1.0F);
float red = 0.405F;
float green = 0.075F;
float blue = 0.525F;
float alpha = 1.0F;
GL11.glColor4f(red, green, blue, alpha);
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
GL11.glScalef(0.4F + 0.1F * e.getStrength(), 0.4F + 0.1F * e.getStrength(), 0.4F + 0.1F * e.getStrength());
t.startDrawingQuads();
t.setColorRGBA_F(0.405F, 0.075F, 0.525F, 1.0F);
t.setColorRGBA_F(red, green, blue, alpha);
t.setNormal(0.0F, 1.0F, 0.0F);
t.setBrightness(240);
@@ -68,12 +78,10 @@ public class RenderEntityHomingShard extends Render
GL11.glPopMatrix();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glBlendFunc(770, 771);
GL11.glDisable(3042);
GL11.glDisable(32826);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glDepthMask(true);
GL11.glPopMatrix();
}
@@ -21,28 +21,24 @@ public class RenderEntityTaintBubble extends Render
this.shadowSize = 0.0F;
}
@Override
public void doRender (Entity e, double x, double y, double z, float f, float pt)
public void renderEntityAt (EntityTaintBubble e, double x, double y, double z, float f, float pt)
{
Tessellator t = Tessellator.instance;
EntityTaintBubble bubble = (EntityTaintBubble) e;
float r = 0.8F + e.worldObj.rand.nextFloat() * 0.2F;
float g = e.worldObj.rand.nextFloat() * 0.4F;
float b = 1.0F - e.worldObj.rand.nextFloat() * 0.2F;
float a = (50.0F - (float) e.ticksExisted) / 50.0F;
float alpha = (50.0F - (float) e.ticksExisted) / 50.0F;
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glEnable(GL11.GL_BLEND);
GL11.glTranslated(x, y, z);
GL11.glEnable(GL11.GL_BLEND);
GL11.glDepthMask(false);
GL11.glColor4f(r, g, b, a);
GL11.glColor4f(e.red, e.green, e.blue, alpha);
Minecraft.getMinecraft().renderEngine.bindTexture(texture);
int p = 7 + bubble.ticksExisted % 8;
int p = 7 + e.ticksExisted % 8;
float f2 = p / 16.0F;
float f3 = f2 + 0.0624375F;
float f4 = 0.25F;
@@ -52,7 +48,7 @@ public class RenderEntityTaintBubble extends Render
float f7 = 0.5F;
float f8 = 0.5F;
float s = 0.3F;
float s = 0.35F;
GL11.glScalef(s, s, s);
@@ -63,7 +59,7 @@ public class RenderEntityTaintBubble extends Render
t.setBrightness(240);
t.setNormal(0.0F, 1.0F, 0.0F);
t.setColorRGBA_F(r, g, b, a);
t.setColorRGBA_F(e.red, e.green, e.blue, alpha);
t.addVertexWithUV(-f7, -f8, 0.0D, f2, f5);
t.addVertexWithUV(f6 - f7, -f8, 0.0D, f3, f5);
@@ -74,6 +70,7 @@ public class RenderEntityTaintBubble extends Render
GL11.glDepthMask(true);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
@@ -82,4 +79,10 @@ public class RenderEntityTaintBubble extends Render
{
return null;
}
@Override
public void doRender (Entity e, double x, double y, double z, float f, float pT)
{
renderEntityAt((EntityTaintBubble) e, x, y, z, f, pT);
}
}
@@ -1,5 +1,6 @@
package taintedmagic.common;
import net.minecraft.client.multiplayer.WorldClient;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
@@ -21,4 +22,9 @@ public class CommonProxy
public void spawnShockwaveParticles (World w)
{
}
public WorldClient getClientWorld ()
{
return null;
}
}
@@ -42,7 +42,9 @@ public class TaintedMagic
public static TaintedMagicEventHandler taintedMagicEvents;
public static CreativeTabs tabTaintedMagic = new TaintedMagicCreativeTab();
public static ConfigHandler configHandler;
public static final Logger log = LogManager.getLogger("TAINTEDMAGIC");
public static EnumRarity rarityCreation = EnumHelper.addRarity("CREATION", EnumChatFormatting.GOLD, "Creation");
// Pre init
@@ -19,7 +19,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class EntityGlowpet extends EntityThrowable
{
int maxAge = 0;
public int maxAge = 0;
Material[] mats = { Material.plants, Material.air, Material.leaves, Material.portal, Material.vine, Material.web, Material.portal };
public EntityGlowpet (World w)
@@ -27,6 +27,10 @@ public class EntityTaintBubble extends EntityThrowable implements IEntityAdditio
public boolean corrosive = false;
public float dmg = 0.0F;
public float red = 0.0F;
public float green = 0.0F;
public float blue = 0.0F;
public EntityTaintBubble (World w)
{
super(w);
@@ -38,6 +42,10 @@ public class EntityTaintBubble extends EntityThrowable implements IEntityAdditio
this.corrosive = corrosive;
this.dmg = dmg;
setThrowableHeading(this.motionX, this.motionY, this.motionZ, func_70182_d(), scatter);
this.red = 0.8F + worldObj.rand.nextFloat() * 0.2F;
this.green = worldObj.rand.nextFloat() * 0.2F;
this.blue = 1.0F - worldObj.rand.nextFloat() * 0.2F;
}
@Override
@@ -58,14 +66,18 @@ public class EntityTaintBubble extends EntityThrowable implements IEntityAdditio
public void onUpdate ()
{
this.motionX *= 0.95D;
this.motionY *= 0.95D;
this.motionZ *= 0.95D;
// simulated taint swarm motion
ChunkCoordinates c = new ChunkCoordinates((int) this.posX + this.rand.nextInt(7) - this.rand.nextInt(7), (int) this.posY + this.rand.nextInt(6) - 2, (int) this.posZ + this.rand.nextInt(7) - this.rand.nextInt(7));
double varX = c.posX + 0.5D - this.posX;
double varY = c.posY + 0.1D - this.posY;
double varZ = c.posZ + 0.5D - this.posZ;
this.motionX += (Math.signum(varX) * 0.5D - this.motionX) * 0.025D;
this.motionX += (Math.signum(varX) * 0.5D - this.motionX) * 0.02D;
this.motionY += (Math.signum(varY) * 0.7D - this.motionY) * 0.05D;
this.motionZ += (Math.signum(varZ) * 0.5D - this.motionZ) * 0.025D;
this.motionZ += (Math.signum(varZ) * 0.5D - this.motionZ) * 0.02D;
float angle = (float) (Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) - 90.0F;
float wrappedAngle = MathHelper.wrapAngleTo180_float(angle - this.rotationYaw);
@@ -73,9 +85,6 @@ public class EntityTaintBubble extends EntityThrowable implements IEntityAdditio
if (this.ticksExisted > 50) setDead();
this.motionX *= 0.95D;
this.motionY *= 0.95D;
this.motionZ *= 0.95D;
if (this.onGround)
{
@@ -89,11 +98,17 @@ public class EntityTaintBubble extends EntityThrowable implements IEntityAdditio
public void writeSpawnData (ByteBuf buf)
{
buf.writeFloat(this.dmg);
buf.writeFloat(this.red);
buf.writeFloat(this.green);
buf.writeFloat(this.blue);
}
public void readSpawnData (ByteBuf buf)
{
this.dmg = buf.readFloat();
this.red = buf.readFloat();
this.green = buf.readFloat();
this.blue = buf.readFloat();
}
protected void onImpact (MovingObjectPosition mop)
@@ -29,12 +29,11 @@ public class WandHandler implements IWandRodOnUpdate
int permwarp = Thaumcraft.proxy.getPlayerKnowledge().getWarpPerm(player.getCommandSenderName());
int x = permwarp;
if (x == 0) x++;
if (x == 0) return;
int y = Math.max( (200 - x), 20);
double fx = 20 * coth(x / 250.0D);
int rfx = Math.min((int) Math.round(fx), 200);
if (player.ticksExisted % rfx == 0)
{
for (int i = 0; i < primals.length; i++)
@@ -36,8 +36,8 @@ import taintedmagic.client.model.ModelKatana;
import taintedmagic.client.model.ModelSaya;
import taintedmagic.common.TaintedMagic;
import taintedmagic.common.entities.EntityTaintBubble;
import taintedmagic.common.network.PacketKatanaAttack;
import taintedmagic.common.network.PacketHandler;
import taintedmagic.common.network.PacketKatanaAttack;
import thaumcraft.api.IRepairable;
import thaumcraft.api.IWarpingGear;
import thaumcraft.common.config.Config;
@@ -294,10 +294,10 @@ public class ItemKatana extends Item implements IWarpingGear, IRepairable
@SubscribeEvent
public void onPlayerRender (RenderPlayerEvent.Specials.Post event)
{
if (event.entityLiving.getActivePotionEffect(Potion.invisibility) != null) return;
EntityPlayer p = event.entityPlayer;
if (p.getActivePotionEffect(Potion.invisibility) != null) return;
for (int i = 0; i < p.inventory.getSizeInventory(); i++)
{
if (p.inventory.getStackInSlot(i) != null && p.inventory.getStackInSlot(i).getItem() instanceof ItemKatana)
@@ -126,9 +126,7 @@ public class ItemFocusLumos extends ItemFocusBasic
w.playSoundAtEntity(p, "thaumcraft:ice", 0.3F, 1.1F + w.rand.nextFloat() * 0.1F);
for (int a = 0; a < 9; a++)
{
FXSparkle fx = new FXSparkle(w, x + w.rand.nextFloat(), y + w.rand.nextFloat(), z + w.rand.nextFloat(), 1.75F, w.rand.nextInt(5), 3 + w.rand.nextInt(3));
fx.setGravity(0.1F);
ParticleEngine.instance.addEffect(w, fx);
spawnParticles(w, x, y, z);
}
}
}
@@ -143,9 +141,7 @@ public class ItemFocusLumos extends ItemFocusBasic
w.playSoundAtEntity(pet, "taintedmagic:shard", 0.3F, 1.1F + w.rand.nextFloat() * 0.1F);
for (int a = 0; a < 18; a++)
{
FXSparkle fx = new FXSparkle(w, pet.posX + w.rand.nextFloat(), pet.posY + w.rand.nextFloat(), pet.posZ + w.rand.nextFloat(), 1.75F, w.rand.nextInt(5), 3 + w.rand.nextInt(3));
fx.setGravity(0.1F);
ParticleEngine.instance.addEffect(w, fx);
spawnParticles(w, pet.posX, pet.posY, pet.posZ);
}
}
}
@@ -173,9 +169,7 @@ public class ItemFocusLumos extends ItemFocusBasic
{
for (int a = 0; a < 9; a++)
{
FXSparkle fx = new FXSparkle(w, x + w.rand.nextFloat(), y + w.rand.nextFloat(), z + w.rand.nextFloat(), 1.75F, w.rand.nextInt(5), 3 + w.rand.nextInt(3));
fx.setGravity(0.1F);
ParticleEngine.instance.addEffect(w, fx);
spawnParticles(w, x, y, z);
}
}
}
@@ -190,6 +184,14 @@ public class ItemFocusLumos extends ItemFocusBasic
p.swingItem();
return s;
}
@SideOnly(Side.CLIENT)
void spawnParticles(World w, double x, double y, double z)
{
FXSparkle fx = new FXSparkle(w, x + w.rand.nextFloat(), y + w.rand.nextFloat(), z + w.rand.nextFloat(), 1.75F, w.rand.nextInt(5), 3 + w.rand.nextInt(3));
fx.setGravity(0.1F);
ParticleEngine.instance.addEffect(w, fx);
}
public FocusUpgradeType[] getPossibleUpgradesByRank (ItemStack s, int r)
{
@@ -62,7 +62,7 @@ public class ItemFocusMageMace extends ItemFocusBasic
public int getFocusColor (ItemStack s)
{
return 3289650;
return 13813960;
}
public AspectList getVisCost (ItemStack s)
@@ -84,30 +84,7 @@ public class ItemFocusMeteorology extends ItemFocusBasic
w.getWorldInfo().setRainTime(w.isRaining() ? 24000 : 0);
w.getWorldInfo().setRaining(!w.isRaining());
p.playSound("thaumcraft:wand", 0.5F, 1.0F);
if (w.isRemote)
{
for (int i = 1; i < 200; i++)
{
double xp = (-Math.random() * 2.0F) + (Math.random() * 2.0F);
double zp = (-Math.random() * 2.0F) + (Math.random() * 2.0F);
double yp = (-Math.random() * 2.0F) + (Math.random() * 2.0F);
double off = Math.random() * 0.1;
float green = p.worldObj.rand.nextFloat();
float blue = p.worldObj.rand.nextFloat();
FXWisp ef = new FXWisp(w, p.posX + xp + off, p.posY + 10 + yp + off, p.posZ + zp + off, 0.5F + ((float) Math.random() * 0.25F), 0.25F, green, blue);
ef.setGravity(0.75F);
ef.shrink = true;
ef.noClip = true;
Vector3 movement = TaintedMagicHelper.getDistanceBetween(ef, p);
ef.addVelocity(movement.x * 0.5, movement.y * 0.5, movement.z * 0.5);
ParticleEngine.instance.addEffect(w, ef);
}
}
spawnParticles(w, p);
}
return s;
}
@@ -117,4 +94,32 @@ public class ItemFocusMeteorology extends ItemFocusBasic
{
return TaintedMagic.rarityCreation;
}
@SideOnly (Side.CLIENT)
void spawnParticles (World w, EntityPlayer p)
{
if (w.isRemote)
{
for (int i = 1; i < 200; i++)
{
double xp = (-Math.random() * 2.0F) + (Math.random() * 2.0F);
double zp = (-Math.random() * 2.0F) + (Math.random() * 2.0F);
double yp = (-Math.random() * 2.0F) + (Math.random() * 2.0F);
double off = Math.random() * 0.1;
float green = p.worldObj.rand.nextFloat();
float blue = p.worldObj.rand.nextFloat();
FXWisp ef = new FXWisp(w, p.posX + xp + off, p.posY + 10 + yp + off, p.posZ + zp + off, 0.5F + ((float) Math.random() * 0.25F), 0.25F, green, blue);
ef.setGravity(0.75F);
ef.shrink = true;
ef.noClip = true;
Vector3 movement = TaintedMagicHelper.getDistanceBetween(ef, p);
ef.addVelocity(movement.x * 0.5, movement.y * 0.5, movement.z * 0.5);
ParticleEngine.instance.addEffect(w, ef);
}
}
}
}
@@ -25,7 +25,8 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ItemFocusTime extends ItemFocusBasic
{
IIcon depthIcon = null;
public IIcon depthIcon;
public IIcon iconOverlay;
private static final AspectList cost = new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000).add(Aspect.FIRE, 1000).add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000);
@@ -39,6 +40,7 @@ public class ItemFocusTime extends ItemFocusBasic
public void registerIcons (IIconRegister ir)
{
this.icon = ir.registerIcon("taintedmagic:ItemFocusTime");
this.iconOverlay = ir.registerIcon("taintedmagic:ItemFocusTime_overlay");
this.depthIcon = ir.registerIcon("taintedmagic:ItemFocusMeteorology_depth");
}
@@ -58,6 +60,38 @@ public class ItemFocusTime extends ItemFocusBasic
return player == null ? 0xFFFFFF : Color.HSBtoRGB(player.ticksExisted * 16 % 360 / 360F, 1F, 1F);
}
@SideOnly (Side.CLIENT)
public int getRenderPasses (int m)
{
return 2;
}
@Override
@SideOnly (Side.CLIENT)
public IIcon getIconFromDamageForRenderPass (int meta, int pass)
{
return (pass == 0) ? this.icon : this.iconOverlay;
}
@SideOnly (Side.CLIENT)
public int getColorFromItemStack (ItemStack s, int pass)
{
if (pass == 0)
{
EntityPlayer p = TaintedMagic.proxy.getClientPlayer();
return p == null ? 0xFFFFFF : Color.HSBtoRGB(p.ticksExisted * 16F % 360 / 360F, 1F, 1F);
}
if (pass == 1) return 16777215;
return 16777215;
}
@SideOnly (Side.CLIENT)
public boolean requiresMultipleRenderPasses ()
{
return true;
}
public AspectList getVisCost (ItemStack s)
{
return new AspectList().add(Aspect.AIR, 1000).add(Aspect.WATER, 1000).add(Aspect.FIRE, 1000).add(Aspect.EARTH, 1000).add(Aspect.ORDER, 1000).add(Aspect.ENTROPY, 1000);
@@ -87,45 +121,43 @@ public class ItemFocusTime extends ItemFocusBasic
w.setWorldTime(w.isDaytime() ? 14000 : 24000);
p.playSound("thaumcraft:wand", 0.5F, 1.0F);
if (w.isRemote)
{
for (int i = 1; i < 200; i++)
{
double xp = (-Math.random() * 2.0F) + (Math.random() * 2.0F);
double zp = (-Math.random() * 2.0F) + (Math.random() * 2.0F);
double yp = (-Math.random() * 2.0F) + (Math.random() * 2.0F);
double off = Math.random() * 0.1;
float red = p.worldObj.rand.nextFloat();
float green = p.worldObj.rand.nextFloat();
float blue = p.worldObj.rand.nextFloat();
FXWisp ef = new FXWisp(w, p.posX + xp + off, p.posY + 10 + yp + off, p.posZ + zp + off, 0.5F + ((float) Math.random() * 0.25F), red, green, blue);
ef.setGravity(0.75F);
ef.shrink = true;
ef.noClip = true;
Vector3 movement = TaintedMagicHelper.getDistanceBetween(ef, p);
ef.addVelocity(movement.x * 0.5, movement.y * 0.5, movement.z * 0.5);
ParticleEngine.instance.addEffect(w, ef);
}
}
spawnParticles(w, p);
}
return s;
}
@Override
public int getColorFromItemStack (ItemStack s, int i)
{
EntityPlayer p = TaintedMagic.proxy.getClientPlayer();
return p == null ? 0xFFFFFF : Color.HSBtoRGB(p.ticksExisted * 16 % 360 / 360F, 1F, 1F);
}
@SideOnly (Side.CLIENT)
public EnumRarity getRarity (ItemStack s)
{
return TaintedMagic.rarityCreation;
}
@SideOnly (Side.CLIENT)
void spawnParticles (World w, EntityPlayer p)
{
if (w.isRemote)
{
for (int i = 1; i < 200; i++)
{
double xp = (-Math.random() * 2.0F) + (Math.random() * 2.0F);
double zp = (-Math.random() * 2.0F) + (Math.random() * 2.0F);
double yp = (-Math.random() * 2.0F) + (Math.random() * 2.0F);
double off = Math.random() * 0.1;
float red = p.worldObj.rand.nextFloat();
float green = p.worldObj.rand.nextFloat();
float blue = p.worldObj.rand.nextFloat();
FXWisp ef = new FXWisp(w, p.posX + xp + off, p.posY + 10 + yp + off, p.posZ + zp + off, 0.5F + ((float) Math.random() * 0.25F), red, green, blue);
ef.setGravity(0.75F);
ef.shrink = true;
ef.noClip = true;
Vector3 movement = TaintedMagicHelper.getDistanceBetween(ef, p);
ef.addVelocity(movement.x * 0.5, movement.y * 0.5, movement.z * 0.5);
ParticleEngine.instance.addEffect(w, ef);
}
}
}
}
@@ -31,8 +31,10 @@ public class RecipeRegistry
public static void initCrafting ()
{
ResearchRegistry.recipes.put("BlockShadowmetal", GameRegistry.addShapedRecipe(new ItemStack(Item.getItemFromBlock(BlockRegistry.BlockShadowmetal)), new Object[]{ "AAA", "AAA", "AAA", Character.valueOf('A'), new ItemStack(ItemRegistry.ItemMaterial) }));
GameRegistry.addShapedRecipe(new ItemStack(Item.getItemFromBlock(BlockRegistry.BlockShadowmetal)), new Object[]{ "AAA", "AAA", "AAA", Character.valueOf('A'), new ItemStack(ItemRegistry.ItemMaterial) });
GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.ItemMaterial, 1, 0), new Object[]{ "AAA", "AAA", "AAA", Character.valueOf('A'), new ItemStack(ItemRegistry.ItemMaterial, 1, 9) });
ResearchRegistry.recipes.put("ItemShadowmetalPick", GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.ItemShadowmetalPick), new Object[]{ "AAA", " B ", " B ", Character.valueOf('A'), new ItemStack(ItemRegistry.ItemMaterial), Character.valueOf('B'), new ItemStack(Items.stick) }));
ResearchRegistry.recipes.put("ItemShadowmetalAxe", CraftingManager.getInstance().addRecipe(new ItemStack(ItemRegistry.ItemShadowmetalAxe), new Object[]{ "AA", "BA", "B ", Character.valueOf('A'), new ItemStack(ItemRegistry.ItemMaterial), Character.valueOf('B'), new ItemStack(Items.stick) }));
@@ -44,6 +46,7 @@ public class RecipeRegistry
ResearchRegistry.recipes.put("ItemShadowmetalSword", GameRegistry.addShapedRecipe(new ItemStack(ItemRegistry.ItemShadowmetalSword), new Object[]{ "A", "A", "B", Character.valueOf('A'), new ItemStack(ItemRegistry.ItemMaterial), Character.valueOf('B'), new ItemStack(Items.stick) }));
GameRegistry.addRecipe(new ItemStack(ItemRegistry.ItemMaterial, 9), new Object[]{ "A", Character.valueOf('A'), new ItemStack(BlockRegistry.BlockShadowmetal) });
GameRegistry.addRecipe(new ItemStack(ItemRegistry.ItemMaterial, 9, 9), new Object[]{ "A", Character.valueOf('A'), new ItemStack(ItemRegistry.ItemMaterial, 1, 0) });
ResearchRegistry.recipes.put("BlockWarpwoodPlanks", CraftingManager.getInstance().addRecipe(new ItemStack(BlockRegistry.BlockWarpwoodPlanks, 4), new Object[]{ "A", Character.valueOf('A'), new ItemStack(BlockRegistry.BlockWarpwoodLog) }));
@@ -52,7 +52,7 @@ public class ResearchRegistry
*/
new TaintedMagicResearchItem("TAINTEDMAGIC", TM, new AspectList(), 2, -1, 0, new ItemStack(ConfigItems.itemResource, 1, 13)).setRound().setAutoUnlock().setPages(new ResearchPage[]{ new ResearchPage("1"), new ResearchPage("2") }).registerResearchItem();
new TaintedMagicResearchItem("SHADOWMETAL", TM, new AspectList().add(Aspect.METAL, 1).add(Aspect.DARKNESS, 1).add(Aspect.MAGIC, 1), 0, 1, 0, new ItemStack(BlockRegistry.BlockShadowOre)).setParents("TAINTEDMAGIC").setConcealed().setPages(new ResearchPage[]{ new ResearchPage("1"), new ResearchPage((CrucibleRecipe) recipes.get("BlockShadowOre")), new ResearchPage(new ItemStack(BlockRegistry.BlockShadowOre)), new ResearchPage((IRecipe) recipes.get("BlockShadowmetal")), new ResearchPage((IRecipe) recipes.get("ItemShadowmetalPick")), new ResearchPage((IRecipe) recipes.get("ItemShadowmetalSpade")), new ResearchPage((IRecipe) recipes.get("ItemShadowmetalAxe")), new ResearchPage((IRecipe) recipes.get("ItemShadowmetalHoe")), new ResearchPage((IRecipe) recipes.get("ItemShadowmetalSword")) }).registerResearchItem();
new TaintedMagicResearchItem("SHADOWMETAL", TM, new AspectList().add(Aspect.METAL, 1).add(Aspect.DARKNESS, 1).add(Aspect.MAGIC, 1), 0, 1, 0, new ItemStack(BlockRegistry.BlockShadowOre)).setParents("TAINTEDMAGIC").setConcealed().setPages(new ResearchPage[]{ new ResearchPage("1"), new ResearchPage((CrucibleRecipe) recipes.get("BlockShadowOre")), new ResearchPage(new ItemStack(BlockRegistry.BlockShadowOre)), new ResearchPage((IRecipe) recipes.get("ItemShadowmetalPick")), new ResearchPage((IRecipe) recipes.get("ItemShadowmetalSpade")), new ResearchPage((IRecipe) recipes.get("ItemShadowmetalAxe")), new ResearchPage((IRecipe) recipes.get("ItemShadowmetalHoe")), new ResearchPage((IRecipe) recipes.get("ItemShadowmetalSword")) }).registerResearchItem();
ThaumcraftApi.addWarpToResearch("SHADOWMETAL", 2);
@@ -114,7 +114,7 @@ public class ResearchRegistry
new TaintedMagicResearchItem("CRYSTALDAGGER", TM, new AspectList().add(Aspect.WEAPON, 4).add(Aspect.FIRE, 4).add(Aspect.HEAL, 4), 0, -3, 0, new ItemStack(ItemRegistry.ItemCrystalDagger, 1, 7)).setParentsHidden("ENCHFABRIC", "ESSENTIACRYSTAL", "VOIDMETAL").setParents("TAINTEDMAGIC").setComplexity(2).setPages(new ResearchPage[]{ new ResearchPage("1"), new ResearchPage((IArcaneRecipe) recipes.get("ItemCrystalDagger")) }).registerResearchItem();
ThaumcraftApi.addWarpToResearch("CRYSTALDAGGER", 2);
new TaintedMagicResearchItem("MACEFOCUS", TM, new AspectList().add(Aspect.ENTROPY, 10).add(Aspect.EARTH, 4).add(Aspect.WEAPON, 6).add(Aspect.MAGIC, 8), 5, 4, 0, new ItemStack(ItemRegistry.ItemFocusMageMace)).setParents("TMFOCUSFIRE").setConcealed().setComplexity(2).setParentsHidden("FOCUSFIRE", "SHADOWMETAL").setPages(new ResearchPage[]{ new ResearchPage("1"), new ResearchPage((InfusionRecipe) recipes.get("ItemFocusMageMace")) }).setSecondary().registerResearchItem();
new TaintedMagicResearchItem("MACEFOCUS", TM, new AspectList().add(Aspect.ENTROPY, 10).add(Aspect.EARTH, 4).add(Aspect.WEAPON, 6).add(Aspect.MAGIC, 8), 5, 4, 0, new ItemStack(ItemRegistry.ItemFocusMageMace)).setParents("TMFOCUSFIRE").setConcealed().setComplexity(2).setParentsHidden("FOCUSFIRE", "SHADOWMETAL").setPages(new ResearchPage[]{ new ResearchPage("1"), new ResearchPage((InfusionRecipe) recipes.get("ItemFocusMageMace")) }).registerResearchItem();
new TaintedMagicResearchItem("CRIMSONBLADE", TM, new AspectList().add(Aspect.ENTROPY, 8).add(Aspect.ELDRITCH, 2).add(Aspect.WEAPON, 16).add(Aspect.VOID, 6), -7, 1, 0, ItemApi.getItem("itemSwordCrimson", 0)).setParents("PRAETORARMOR").setConcealed().setComplexity(3).setPages(new ResearchPage[]{ new ResearchPage("1"), new ResearchPage((InfusionRecipe) recipes.get("ItemSwordCrimson")) }).setSecondary().registerResearchItem();
ThaumcraftApi.addWarpToResearch("CRIMSONBLADE", 3);