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,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);