Compare commits

..
30 Commits
Author SHA1 Message Date
Vazkii 179d6f7ae5 Readied the libs for 1.0.3. 2013-05-21 12:59:42 +01:00
Vazkii 165e6a0d87 Fluxometer research and recipe. 2013-05-21 12:38:26 +01:00
Vazkii 9269c0a26e Tweaked the Flux Detector renderer to show near-empty values, so they can be seen even if they are minimal. 2013-05-21 12:37:27 +01:00
Vazkii 70748fd00c Dividing by zero is bad. 2013-05-21 11:59:14 +01:00
Vazkii 507a630668 Think I'll settle with that renderer. 2013-05-21 11:45:08 +01:00
Vazkii b233aaa802 Made the renderer for the Fluxometer neater. 2013-05-21 11:29:16 +01:00
Vazkii 9c67110655 Fixed the warded chest crashing the server... 2013-05-21 10:59:40 +01:00
Vazkii 4c39ce4fe9 Flux detector render, WIP. 2013-05-21 00:37:41 +01:00
Vazkii 5f4d434362 And some better research text for it too, I found the old one to be somewhat lacking. 2013-05-20 23:47:54 +01:00
Vazkii a42c8e80fe Cleaned up the TWW's Remedium Talisman ;) 2013-05-20 23:43:05 +01:00
Vazkii fdcbc88cb9 Fluxometer now has a tag compound to store found object tags on the nearby aura... hopefully. 2013-05-20 23:38:14 +01:00
TheWhiteWolves 594b34f78c Tweaked aspects on talisman of remedium 2013-05-20 23:33:01 +01:00
TheWhiteWolves d130f1061c Cleaned up code and added in missing config for talisman of remedium 2013-05-20 23:30:22 +01:00
TheWhiteWolves 0a1bde7abb Added Talisman of Remedium 2013-05-20 23:13:40 +01:00
Vazkii 5d5e99c69e Laid some scaffolding *cough* for the Fluxometer render. 2013-05-20 22:59:46 +01:00
Vazkii 1e69128e85 Getting started on a new item, the Fluxometer. 2013-05-20 22:32:00 +01:00
Vazkii dc48c45527 Fixed the wand of uprising recipe being wrong, and made the research be easier to understand. 2013-05-20 22:26:19 +01:00
Vazkii 054022bf2c Screw it, remove all the .25 translations. Fixing some render weirdness in the TDT renderer... 2013-05-20 22:09:55 +01:00
Vazkii f0bf6178da Recipe and Research for the Fume Dissipator. 2013-05-20 22:08:32 +01:00
Vazkii 8eeccc7449 Added the Fume Dissipator item. 2013-05-20 21:26:10 +01:00
Vazkii 40f87e628f Changed the Wand of the Tinkerer recipe and recharge time. 2013-05-20 20:59:05 +01:00
Vazkii 21e26b051b Commited the project Code Template, backup is good. 2013-05-20 19:53:35 +01:00
Vazkii 740b65785b Fixed TDT overlay for right clicks not rotating. 2013-05-20 19:28:13 +01:00
Vazkii 2483ec15bf Made the TDT able to be rotated and fixed some render shifts for it. 2013-05-20 13:10:37 +01:00
Vazkii 141b6e5f7b TDT render now shows where it's facing. 2013-05-20 12:07:50 +01:00
Vazkii af6b2d0287 Ok, how did that pass? 2013-05-20 11:46:19 +01:00
Vazkii 24e5bbf962 Merge branch 'master' of https://github.com/Vazkii/ThaumicTinkerer 2013-05-20 11:42:02 +01:00
Vazkii f78a3141e0 Hopefully fixed spellbinding cloth crashing when it breaks. 2013-05-20 11:41:16 +01:00
TheWhiteWolves 7f8dc37db0 Made Goliath Legging's effect work against creeper blasts 2013-05-19 19:19:22 +01:00
TheWhiteWolves 4449eea79c Fixed Goliath Leggings not receiving the Repair enchant 2013-05-19 18:51:34 +01:00
30 changed files with 597 additions and 33 deletions

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><templates><template autoinsert="false" context="filecomment_context" deleted="false" description="Comment for created Java files" enabled="true" id="org.eclipse.jdt.ui.text.codetemplates.filecomment" name="filecomment">/**
* This class was created by &lt;Vazkii&gt;. It's distributed as
* part of the ${project_name} Mod.
*
* ${project_name} is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ${project_name} is a Derivative Work on Thaumcraft 3.
* Thaumcraft 3 © Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [${date}, ${time} (GMT)]
*/</template></templates>
+1 -1
View File
@@ -3,7 +3,7 @@
"modid": "ThaumicTinkerer",
"name": "Thaumic Tinkerer",
"description": "An addon to Thaumcraft 3, implementing new content. This mod is a spiritual successor to Elemental Tinkerer. Compiled for Thaumcraft 3.0.5.",
"version": "1.0.2",
"version": "1.0.3",
"mcversion": "1.5+",
"logoFile": "/mods/ThaumicTinkerer/logo.png",
"url": "minecraftforum.net/topic/1813058-",
@@ -29,6 +29,7 @@ import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import thaumcraft.common.items.wands.ItemWandCasting;
import vazkii.tinkerer.ThaumicTinkerer;
import vazkii.tinkerer.client.util.helper.IconHelper;
import vazkii.tinkerer.lib.LibGuiIDs;
@@ -160,8 +161,20 @@ public class BlockAnimationTablet extends BlockModContainer {
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
if(!par1World.isRemote) {
TileEntity tile = par1World.getBlockTileEntity(par2, par3, par4);
if(tile != null)
par5EntityPlayer.openGui(ThaumicTinkerer.modInstance, LibGuiIDs.ID_ANIMATION_TABLET, par1World, par2, par3, par4);
if(tile != null) {
TileEntityAnimationTablet tablet = (TileEntityAnimationTablet) tile;
if(par5EntityPlayer.getCurrentEquippedItem() != null && par5EntityPlayer.getCurrentEquippedItem().getItem() instanceof ItemWandCasting) {
int meta = par1World.getBlockMetadata(par2, par3, par4);
boolean activated = (meta & 8) != 0;
if(!activated && !tablet.getIsBreaking() && tablet.swingProgress == 0) {
par1World.setBlockMetadataWithNotify(par2, par3, par4, meta == 5 ? + 2 : meta + 1, 1 | 2);
par1World.playSoundEffect(par2, par3, par4, "thaumcraft.tool", 0.6F, 1F);
} else par5EntityPlayer.addChatMessage("You can not rotate the Tablet while it's activated.");
// Rare chance this might happen, but better to cope for it.
return true;
} else par5EntityPlayer.openGui(ThaumicTinkerer.modInstance, LibGuiIDs.ID_ANIMATION_TABLET, par1World, par2, par3, par4);
}
}
return true;
@@ -0,0 +1,99 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 3.
* Thaumcraft 3 © Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [20 May 2013, 22:38:51 (GMT)]
*/
package vazkii.tinkerer.client.render.item;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.RenderEngine;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import org.lwjgl.opengl.GL11;
import thaumcraft.api.EnumTag;
import thaumcraft.api.ObjectTags;
import thaumcraft.client.lib.UtilsFX;
import thaumcraft.client.renderers.item.HandheldItemRenderer;
import thaumcraft.common.items.armor.ItemGoggles;
import vazkii.tinkerer.client.util.handler.ClientTickHandler;
import vazkii.tinkerer.item.ItemFluxDetector;
import vazkii.tinkerer.util.helper.MiscHelper;
public class RenderItemFluxDetector extends HandheldItemRenderer {
// Because I'm a lasy bastard and don't want to code
// the whole renderer. <3 you Azanor.
DummyGui dummyGui = new DummyGui();
@Override
public void renderThaumometer(ItemStack arg0, EntityPlayer arg1, RenderEngine arg2, float arg3) {
Minecraft mc = MiscHelper.getMc();
boolean goggles = arg1.getCurrentItemOrArmor(4) != null && arg1.getCurrentItemOrArmor(4).getItem() instanceof ItemGoggles;
GL11.glPushMatrix();
GL11.glTranslatef(-0.5F, -0.5F, 0F);
GL11.glScalef(3F, 3F, 3F);
renderItemStack(arg1, arg0, 0, false);
GL11.glScalef(0.3334F, 0.3334F, 0.3334F);
float scale = 1F / 128F;
GL11.glScalef(scale, scale, scale);
float originalZLevel = dummyGui.getZLevel();
ObjectTags tags = ItemFluxDetector.getTags(arg0);
if(tags != null && tags.size() > 0 && !arg1.isSwingInProgress) {
int degPerTag = 360 / tags.size();
int renderDeg = -90 + (int) (ClientTickHandler.clientTicksElapsed % 360);
dummyGui.setZLevel(900 - arg1.rotationPitch * 9);
for(EnumTag tag : tags.getAspects()) {
int amount = tags.getAmount(tag);
int radius = (int) Math.max(0, Math.min(60, arg1.rotationPitch - 30));
int xpos = (int) (radius * Math.cos(renderDeg * Math.PI / 180));
int ypos = (int) (radius * Math.sin(renderDeg * Math.PI / 180));
if(amount == 100 && arg1.rotationPitch >= 90 && goggles) {
xpos += Math.random() - 0.5;
ypos += Math.random() - 0.5;
}
GL11.glPushMatrix();
GL11.glTranslatef(-2500F, -6000F, -500F);
GL11.glScalef(400F, 400F, 150F);
float opacity = Math.min(arg1.rotationPitch / 100F, Math.max(0.15F, amount / 100F));
if(!goggles)
opacity = (float) Math.min(arg1.rotationPitch / 100F, Math.cos(ClientTickHandler.clientTicksElapsed / 5F) + 2F / 2F + 0.2F);
UtilsFX.drawTag(mc, xpos, ypos, goggles ? tag : EnumTag.UNKNOWN, 0, 0, dummyGui, false, false, opacity);
dummyGui.setZLevel(dummyGui.getZLevel() - 2F);
GL11.glTranslatef(0F, 0F, -1F);
GL11.glPopMatrix();
renderDeg += degPerTag;
}
}
dummyGui.setZLevel(originalZLevel);
GL11.glPopMatrix();
}
private static final class DummyGui extends GuiScreen {
public void setZLevel(float level) {
zLevel = level;
}
public float getZLevel() {
return zLevel;
}
}
}
@@ -38,30 +38,32 @@ import vazkii.tinkerer.util.helper.MiscHelper;
public class RenderTileAnimationTablet extends TileEntitySpecialRenderer {
private static final float[][] TRANSLATIONS = new float[][] {
{ 0F, 0F, -1.25F },
{ -1.25F, 0F, 0F },
{ 0F, 0F, -1F },
{ -1F, 0F, 0F },
{ 0F, 0F, 0F },
{ -1.25F, 0F, -1.25F }
{ -1F, 0F, -1F }
};
@Override
public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float partialTicks) {
TileEntityAnimationTablet tile = (TileEntityAnimationTablet) tileentity;
GL11.glPushMatrix();
GL11.glTranslated(d0, d1, d2);
renderOverlay(tile, LibResources.MISC_AT_OVERLAY_DIAL, -1, false, false, 0.65, 0.13F);
if(tile.leftClick)
renderOverlay(tile, LibResources.MISC_AT_OVERLAY_LEFT, 1, false, true, 1, 0.13F);
else renderOverlay(tile, LibResources.MISC_AT_OVERLAY_RIGHT, 1, false, true, 1, 0.13F);
int meta = tile.getBlockMetadata() & 7;
int rotation = meta == 2 ? 270 : meta == 3 ? 90 : meta == 4 ? 0 : 180;
GL11.glPushMatrix();
GL11.glTranslated(d0, d1, d2);
renderOverlay(tile, LibResources.MISC_AT_OVERLAY_DIAL, -1, false, false, 0.65, 0.13F, 0F);
if(tile.leftClick)
renderOverlay(tile, LibResources.MISC_AT_OVERLAY_LEFT, 1, false, true, 1, 0.13F, 0F);
else renderOverlay(tile, LibResources.MISC_AT_OVERLAY_RIGHT, 1, false, true, 1, 0.131F, 0F);
renderOverlay(tile, LibResources.MISC_AT_OVERLAY_FACING, 0, false, false, 0.5F, 0.13F, rotation + 90F);
GL11.glRotatef(rotation, 0F, 1F, 0F);
GL11.glTranslated(0.1, 0.2 + Math.cos(ClientTickHandler.clientTicksElapsed / 12D) / 18F, 0.5);
GL11.glScalef(0.8F, 0.8F, 0.8F);
float[] translations = TRANSLATIONS[meta - 2];
GL11.glTranslatef(translations[0], translations[1], translations[2]);
GL11.glScalef(0.8F, 0.8F, 0.8F);
GL11.glTranslatef(0.5F, 0F, 0.5F);
GL11.glRotatef(tile.swingProgress, 0F, 0F, 1F);
GL11.glTranslatef(-0.5F, 0F, -0.5F);
@@ -101,7 +103,7 @@ public class RenderTileAnimationTablet extends TileEntitySpecialRenderer {
}
}
private void renderOverlay(TileEntityAnimationTablet tablet, String texture, int rotationMod, boolean useLighting, boolean useBlend, double size, float height) {
private void renderOverlay(TileEntityAnimationTablet tablet, String texture, int rotationMod, boolean useLighting, boolean useBlend, double size, float height, float forceDeg) {
Minecraft mc = MiscHelper.getMc();
mc.renderEngine.bindTexture(texture);
GL11.glPushMatrix();
@@ -113,7 +115,7 @@ public class RenderTileAnimationTablet extends TileEntitySpecialRenderer {
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
}
GL11.glTranslatef(0.5F, height, 0.5F);
float deg = (float) (tablet.ticksExisted * rotationMod % 360F);
float deg = rotationMod == 0 ? forceDeg : (float) (tablet.ticksExisted * rotationMod % 360F);
GL11.glRotatef(deg, 0F, 1F, 0F);
GL11.glColor4f(1F, 1F, 1F, 1F);
Tessellator tess = Tessellator.instance;
@@ -17,14 +17,17 @@ package vazkii.tinkerer.core.proxy;
import net.minecraft.entity.Entity;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import thaumcraft.client.fx.FXLightningBolt;
import vazkii.tinkerer.client.render.block.RenderWardChest;
import vazkii.tinkerer.client.render.entity.RenderDeathRune;
import vazkii.tinkerer.client.render.item.RenderItemFluxDetector;
import vazkii.tinkerer.client.render.tile.RenderTileAnimationTablet;
import vazkii.tinkerer.client.render.tile.RenderTileTransmutator;
import vazkii.tinkerer.client.render.tile.RenderTileWardChest;
import vazkii.tinkerer.client.util.handler.ClientTickHandler;
import vazkii.tinkerer.entity.EntityDeathRune;
import vazkii.tinkerer.item.ModItems;
import vazkii.tinkerer.lib.LibRenderIDs;
import vazkii.tinkerer.network.PacketManager;
import vazkii.tinkerer.network.packet.PacketAnimationTabletSync;
@@ -77,6 +80,8 @@ public class TTClientProxy extends TTCommonProxy {
LibRenderIDs.idWardChest = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(new RenderWardChest());
MinecraftForgeClient.registerItemRenderer(ModItems.fluxDetector.itemID, new RenderItemFluxDetector());
}
@Override
@@ -0,0 +1,119 @@
/**
* This class was created by <TheWhiteWolves>. It's distributed as
* part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 3.
* Thaumcraft 3 © Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [20 May 2013, 19:35:05 (GMT)]
*/
package vazkii.tinkerer.item;
import java.util.List;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import thaumcraft.common.aura.AuraManager;
import vazkii.tinkerer.client.util.helper.IconHelper;
import vazkii.tinkerer.lib.LibFeatures;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemCleansingTalisman extends ItemMod {
private Icon enabledIcon;
private long timer = 0L;
private static final int[] POTIONS_TO_REMOVE = new int[] {
Potion.blindness.id,
Potion.confusion.id,
Potion.poison.id,
Potion.weakness.id,
Potion.moveSlowdown.id,
Potion.wither.id
};
public ItemCleansingTalisman(int par1) {
super(par1);
setMaxStackSize(1);
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
if(par3EntityPlayer.isSneaking()) {
int damage = par1ItemStack.getItemDamage();
par1ItemStack.setItemDamage(damage == 0 ? 1 : 0);
par2World.playSoundAtEntity(par3EntityPlayer, "random.orb", 0.3F, 0.1F);
}
return par1ItemStack;
}
@Override
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
if(par1ItemStack.getItemDamage() == 1 && !par2World.isRemote) {
if(timer < System.currentTimeMillis()) {
timer = System.currentTimeMillis() + 1000L;
if (par3Entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer)par3Entity;
boolean removed = false;
if(player.isBurning()) {
player.extinguish();
removed = true;
} else for(int potion : POTIONS_TO_REMOVE) {
if(player.isPotionActive(potion)) {
player.removePotionEffect(potion);
removed = true;
break;
}
}
if(removed) {
AuraManager.decreaseClosestAura(par2World, player.posX, player.posY, player.posZ, LibFeatures.CLEANSING_TALISMAN_VIS);
par2World.playSoundAtEntity(player, "thaumcraft.wand", 0.3F, 0.1F);
}
}
}
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) {
itemIcon = IconHelper.forItem(par1IconRegister, this, 0);
enabledIcon = IconHelper.forItem(par1IconRegister, this, 1);
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
if(par1ItemStack.getItemDamage() == 0)
par3List.add(EnumChatFormatting.RED + "Inactive");
else par3List.add(EnumChatFormatting.GREEN + "Active");
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1) {
return par1 == 1 ? enabledIcon : itemIcon;
}
@Override
@SideOnly(Side.CLIENT)
public EnumRarity getRarity(ItemStack par1ItemStack) {
return EnumRarity.uncommon;
}
}
@@ -0,0 +1,113 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 3.
* Thaumcraft 3 © Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [20 May 2013, 22:15:39 (GMT)]
*/
package vazkii.tinkerer.item;
import java.util.Collection;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTBase;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagInt;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import thaumcraft.api.EnumTag;
import thaumcraft.api.ObjectTags;
import thaumcraft.api.aura.AuraNode;
import thaumcraft.common.items.ItemThaumometer;
import vazkii.tinkerer.util.helper.MiscHelper;
import vazkii.tinkerer.util.helper.ModCreativeTab;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemFluxDetector extends ItemThaumometer {
private static final String TAG_OBJECT_TAGS_CMP = "tagsCmp";
private static final String TAG_OBJECT_TAG = "tag%s";
private static final String TAG_OBJECT_TAG_REPLACE = "tag";
public ItemFluxDetector(int par1) {
super(par1);
setCreativeTab(ModCreativeTab.INSTANCE);
}
@Override
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
if(!par2World.isRemote) {
AuraNode node = MiscHelper.getClosestNode(par2World, par3Entity.posX, par3Entity.posY, par3Entity.posZ);
setTagCompoundForNode(par1ItemStack, node);
}
}
private void setTagCompoundForNode(ItemStack stack, AuraNode node) {
NBTTagCompound cmp = new NBTTagCompound();
if(node == null) {
if(stack.hasTagCompound())
cmp.setCompoundTag(TAG_OBJECT_TAGS_CMP, new NBTTagCompound());
} else {
NBTTagCompound cmp1 = new NBTTagCompound();
ObjectTags flux = node.flux;
if(flux != null && flux.getAspects().length > 0) // Nice clean aura :D
for(EnumTag tag : flux.getAspects())
if(tag != null)
cmp1.setInteger(String.format(TAG_OBJECT_TAG, tag.id), flux.getAmount(tag));
cmp.setCompoundTag(TAG_OBJECT_TAGS_CMP, cmp1);
stack.setTagCompound(cmp);
}
}
public static ObjectTags getTags(ItemStack stack) {
if(stack.hasTagCompound()) {
NBTTagCompound cmp = stack.getTagCompound();
if(cmp.hasKey(TAG_OBJECT_TAGS_CMP)) {
NBTTagCompound cmp1 = cmp.getCompoundTag(TAG_OBJECT_TAGS_CMP);
if(cmp1 != null) {
ObjectTags tags = new ObjectTags();
Collection<NBTBase> cmpTags = cmp1.getTags();
for(NBTBase tag : cmpTags) {
if(tag instanceof NBTTagInt) {
NBTTagInt integer = (NBTTagInt) tag;
int tagID = Integer.parseInt(tag.getName().replaceAll(TAG_OBJECT_TAG_REPLACE, ""));
int amount = integer.data;
tags.add(EnumTag.get(tagID), amount);
}
}
return tags;
}
}
}
return null;
}
@Override
public boolean getShareTag() {
return true;
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1) {
return iconRing;
}
@Override
@SideOnly(Side.CLIENT)
public boolean requiresMultipleRenderPasses() {
return false;
}
}
@@ -0,0 +1,62 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the ThaumicTinkerer Mod.
*
* ThaumicTinkerer is Open Source and distributed under a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
* ThaumicTinkerer is a Derivative Work on Thaumcraft 3.
* Thaumcraft 3 © Azanor 2012
* (http://www.minecraftforum.net/topic/1585216-)
*
* File Created @ [20 May 2013, 21:01:32 (GMT)]
*/
package vazkii.tinkerer.item;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import vazkii.tinkerer.block.BlockGas;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemGasRemover extends ItemMod {
public ItemGasRemover(int par1) {
super(par1);
setMaxStackSize(1);
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
if(par3EntityPlayer.isSneaking()) {
int xs = (int) par3EntityPlayer.posX;
int ys = (int) par3EntityPlayer.posY;
int zs = (int) par3EntityPlayer.posZ;
for(int x = xs - 2; x < xs + 2; x++)
for(int y = ys - 3; y < ys + 3; y++)
for(int z = zs - 2; z < zs + 2; z++) {
int id = par2World.getBlockId(x, y, z);
if(Block.blocksList[id] != null && Block.blocksList[id] instanceof BlockGas) {
BlockGas gas = (BlockGas) Block.blocksList[id];
gas.placeParticle(par2World, x, y, z);
par2World.setBlock(x, y, z, 0, 0, 1 | 2);
}
}
par2World.playSoundAtEntity(par3EntityPlayer, "thaumcraft.wand", 0.2F, 1F);
}
return par1ItemStack;
}
@Override
@SideOnly(Side.CLIENT)
public EnumRarity getRarity(ItemStack par1ItemStack) {
return EnumRarity.uncommon;
}
}
@@ -16,12 +16,15 @@ package vazkii.tinkerer.item;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import thaumcraft.api.IVisDiscounter;
import thaumcraft.api.IVisRepairable;
import thaumcraft.api.ThaumcraftApi;
import thaumcraft.common.aura.AuraManager;
import vazkii.tinkerer.client.util.helper.IconHelper;
import vazkii.tinkerer.lib.LibResources;
import vazkii.tinkerer.util.handler.PlayerDamageHandler;
@@ -29,7 +32,7 @@ import vazkii.tinkerer.util.helper.ModCreativeTab;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemGoliathLegs extends ItemArmor implements IVisDiscounter {
public class ItemGoliathLegs extends ItemArmor implements IVisRepairable, IVisDiscounter {
public ItemGoliathLegs(int par1) {
super(par1, ThaumcraftApi.armorMatSpecial, 0, 2);
@@ -59,4 +62,12 @@ public class ItemGoliathLegs extends ItemArmor implements IVisDiscounter {
public int getVisDiscount() {
return 4;
}
@Override
public void doRepair(ItemStack stack, Entity player)
{
if (AuraManager.decreaseClosestAura(player.worldObj, player.posX, player.posY, player.posZ, 1)) {
stack.damageItem(-1, (EntityLiving)player);
}
}
}
@@ -46,12 +46,9 @@ public class ItemSpellCloth extends ItemMod {
@Override
public ItemStack getContainerItemStack(ItemStack itemStack) {
ItemStack copyStack = itemStack.copy();
copyStack.setItemDamage(copyStack.getItemDamage() + 1);
if(copyStack.getItemDamage() >= copyStack.getMaxDamage())
return null;
itemStack.setItemDamage(itemStack.getItemDamage() + 1);
return copyStack;
return itemStack;
}
@Override
@@ -37,7 +37,7 @@ public class ItemWandTinkerer extends ItemWandCasting {
@Override
public int getRechargeInterval() {
return 9;
return 12;
}
@Override
+12
View File
@@ -45,6 +45,9 @@ public final class ModItems {
public static Item enderMirror;
public static Item goliathLegs;
public static Item darkGas;
public static Item gasRemover;
public static Item cleansingTalisman;
public static Item fluxDetector;
public static void initItems() {
wandTinkerer = new ItemWandTinkerer(LibItemIDs.idWandTinkerer).setUnlocalizedName(LibItemNames.WAND_TINKERER);
@@ -65,6 +68,9 @@ public final class ModItems {
enderMirror = new ItemEnderMirror(LibItemIDs.idEnderMirror).setUnlocalizedName(LibItemNames.ENDER_MIRROR);
goliathLegs = new ItemGoliathLegs(LibItemIDs.idGoliathLegs).setUnlocalizedName(LibItemNames.GOLIATH_LEGS);
darkGas = new ItemGas(LibItemIDs.idDarkGas, ModBlocks.darkGas).setUnlocalizedName(LibItemNames.DARK_GAS);
gasRemover = new ItemGasRemover(LibItemIDs.idGasRemover).setUnlocalizedName(LibItemNames.GAS_REMOVER);
cleansingTalisman = new ItemCleansingTalisman(LibItemIDs.idCleansingTalisman).setUnlocalizedName(LibItemNames.CLEANSING_TALISMAN);
fluxDetector = new ItemFluxDetector(LibItemIDs.idFluxDetector).setUnlocalizedName(LibItemNames.FLUX_DETECTOR);
nameItems();
}
@@ -88,6 +94,9 @@ public final class ModItems {
LanguageRegistry.addName(enderMirror, LibItemNames.ENDER_MIRROR_D);
LanguageRegistry.addName(goliathLegs, LibItemNames.GOLIATH_LEGS_D);
LanguageRegistry.addName(darkGas, LibItemNames.DARK_GAS_D);
LanguageRegistry.addName(gasRemover, LibItemNames.GAS_REMOVER_D);
LanguageRegistry.addName(cleansingTalisman, LibItemNames.CLEANSING_TALISMAN_D);
LanguageRegistry.addName(fluxDetector, LibItemNames.FLUX_DETECTOR_D);
}
public static void applyObjectTags() {
@@ -126,5 +135,8 @@ public final class ModItems {
tags = new ObjectTags().add(EnumTag.DARK, 1);
ThaumcraftApi.registerComplexObjectTag(darkQuartz.itemID, LibMisc.TAG_META_WILDCARD, tags);
tags = new ObjectTags().add(EnumTag.HEAL, 16).add(EnumTag.KNOWLEDGE, 18).add(EnumTag.WATER, 6).add(EnumTag.MAGIC, 10).add(EnumTag.TOOL, 12);
ThaumcraftApi.registerObjectTag(cleansingTalisman.itemID, LibMisc.TAG_META_WILDCARD, tags);
}
}
@@ -38,4 +38,6 @@ public final class LibFeatures {
public static final int ENDER_MIRROR_COST = 1;
public static final int GOLIATH_LEGS_MAX_SAFETY = 5;
public static final int CLEANSING_TALISMAN_VIS = 10;
}
@@ -20,6 +20,9 @@ public final class LibItemIDs {
public static final int DEFAULT_ENDER_MIRROR = 21165;
public static final int DEFAULT_GOLIATH_LEGS = 21166;
public static final int DEFAULT_DARK_GAS = 21167;
public static final int DEFAULT_GAS_REMOVER = 21168;
public static final int DEFAULT_FLUX_DETECTOR = 21169;
public static final int DEFAULT_CLEANSING_TALISMAN = 21170;
public static int idWandTinkerer;
public static int idGlowstoneGas;
@@ -39,4 +42,7 @@ public final class LibItemIDs {
public static int idEnderMirror;
public static int idGoliathLegs;
public static int idDarkGas;
public static int idGasRemover;
public static int idFluxDetector;
public static int idCleansingTalisman;
}
@@ -81,4 +81,16 @@ public final class LibItemNames {
public static final String DARK_GAS = "darkGas";
public static final String DARK_GAS_R = "DARK_GAS";
public static final String DARK_GAS_D = "Gaseous Tenebrae";
public static final String GAS_REMOVER = "gasRemover";
public static final String GAS_REMOVER_R = "GAS_REMOVER";
public static final String GAS_REMOVER_D = "Fume Dissipator";
public static final String FLUX_DETECTOR = "fluxDetector";
public static final String FLUX_DETECTOR_R = "FLUX_DETECTOR";
public static final String FLUX_DETECTOR_D = "Fluxometer";
public static final String CLEANSING_TALISMAN = "cleansingTalisman";
public static final String CLEANSING_TALISMAN_R = "CLEANSING_TALISMAN";
public static final String CLEANSING_TALISMAN_D = "Talisman of Remedium";
}
+1 -1
View File
@@ -18,7 +18,7 @@ public final class LibMisc {
public static final String MOD_ID = "ThaumicTinkerer";
public static final String MOD_NAME = "Thaumic Tinkerer";
public static final String MOD_VERSION = "1.0.2";
public static final String MOD_VERSION = "1.0.3";
public static final String DEPENDENCIES = "required-after:Thaumcraft";
+1 -1
View File
@@ -40,7 +40,7 @@ public final class LibResources {
public static final String MISC_AT_OVERLAY_LEFT = BLUR + ROOT_MISC + "atLeft.png";
public static final String MISC_AT_OVERLAY_RIGHT = BLUR + ROOT_MISC + "atRight1.png";
public static final String MISC_AT_OVERLAY_DIAL = BLUR + ROOT_TC + "misc/dial.png";
public static final String MISC_ATOVERLAY_REDSTONE = BLUR + ROOT_TC + "misc/dial_ind.png";
public static final String MISC_AT_OVERLAY_FACING = BLUR + ROOT_MISC + "tabletFacingInd.png";
public static final String EMTPY_TEXTURE = "emptyTexture";
}
@@ -17,6 +17,7 @@ package vazkii.tinkerer.research;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import thaumcraft.api.ThaumcraftApi;
import thaumcraft.common.Config;
import vazkii.tinkerer.item.ModItems;
import vazkii.tinkerer.lib.LibItemNames;
@@ -27,6 +28,19 @@ public final class ModArcaneRecipes {
"SI",
'S', new ItemStack(Item.sign),
'I', new ItemStack(Item.dyePowder));
ThaumcraftApi.addArcaneCraftingRecipe(LibItemNames.GAS_REMOVER_R, LibItemNames.GAS_REMOVER_R, 15, new ItemStack(ModItems.gasRemover),
"DDD", "T G", "QQQ",
'D', new ItemStack(ModItems.darkQuartz),
'T', new ItemStack(ModItems.darkGas),
'G', new ItemStack(ModItems.glowstoneGas),
'Q', new ItemStack(Item.netherQuartz));
ThaumcraftApi.addArcaneCraftingRecipe(LibItemNames.FLUX_DETECTOR_R, LibItemNames.FLUX_DETECTOR_R, 75, new ItemStack(ModItems.fluxDetector),
" G ", "FMF", " G ",
'G', new ItemStack(Item.ingotGold),
'F', new ItemStack(Config.itemResource, 1, 8),
'M', new ItemStack(Config.itemThaumometer));
}
}
@@ -20,7 +20,7 @@ public final class ModInfusionRecipes {
ThaumcraftApi.addInfusionCraftingRecipe(LibItemNames.WAND_TINKERER_R, LibItemNames.WAND_TINKERER_R, 85, tags, new ItemStack(ModItems.wandTinkerer),
"SSS", "SWS", "SSS",
'S', new ItemStack(Config.itemShard, 1, 4),
'W', new ItemStack(Config.itemWandCastingApprentice, 1, LibMisc.CRAFTING_META_WILDCARD));
'W', new ItemStack(Config.itemWandCastingAdept, 1, LibMisc.CRAFTING_META_WILDCARD));
tags = new ObjectTags().add(EnumTag.WIND, 8);
ThaumcraftApi.addInfusionCraftingRecipe(LibItemNames.GLOWSTONE_GAS_R, LibItemNames.GLOWSTONE_GAS_R, 5, tags, new ItemStack(ModItems.glowstoneGas),
@@ -88,7 +88,7 @@ public final class ModInfusionRecipes {
tags = new ObjectTags().add(EnumTag.FLIGHT, 12).add(EnumTag.WIND, 6);
ThaumcraftApi.addInfusionCraftingRecipe(LibItemNames.WAND_UPRISING_R, LibItemNames.WAND_UPRISING_R, 25, tags, new ItemStack(ModItems.wandUprising),
" Q ", "QWQ", " Q ",
'Q', new ItemStack(Config.itemResource, 1, 10),
'Q', new ItemStack(Config.itemResource, 1, 3),
'W', new ItemStack(Config.itemWandLightning));
tags = new ObjectTags().add(EnumTag.POWER, 14).add(EnumTag.FLIGHT, 6);
@@ -152,5 +152,12 @@ public final class ModInfusionRecipes {
'Q', new ItemStack(ModItems.darkQuartz),
'P', new ItemStack(Config.itemEssence, 1, 0),
'A', new ItemStack(Config.itemResource, 1, 0));
tags = new ObjectTags().add(EnumTag.HEAL, 16).add(EnumTag.KNOWLEDGE, 18).add(EnumTag.TOOL, 12).add(EnumTag.MAGIC, 10);
ThaumcraftApi.addInfusionCraftingRecipe(LibItemNames.CLEANSING_TALISMAN_R, LibItemNames.CLEANSING_TALISMAN_R, 100, tags, new ItemStack(ModItems.cleansingTalisman),
"STS", "TWT", "STS",
'S', new ItemStack(ModItems.darkQuartz),
'T', new ItemStack(Config.itemResource, 1, 7),
'W', new ItemStack(Item.enderPearl));
}
}
@@ -47,6 +47,9 @@ public final class ModResearchItems {
public static ResearchItem enderMirror;
public static ResearchItem goliathLegs;
public static ResearchItem darkGas;
public static ResearchItem gasRemover;
public static ResearchItem cleansingTalisman;
public static ResearchItem fluxDetector;
public static void registerModResearchItems() {
ObjectTags tags = new ObjectTags().add(EnumTag.MAGIC, 16).add(EnumTag.VOID, 8);
@@ -111,5 +114,15 @@ public final class ModResearchItems {
tags = new ObjectTags().add(EnumTag.DARK, 4).add(EnumTag.WIND, 5).add(EnumTag.POWER, 4);
darkGas = new ResearchItem(LibItemNames.DARK_GAS_R, tags, 5, -1, ModItems.darkGas).setParents(Config.researchAlumentum).setParentsHidden(glowstoneGas).registerResearchItem();
tags = new ObjectTags();
gasRemover = new ResearchItem(LibItemNames.GAS_REMOVER_R, tags, 5, -2, ModItems.gasRemover).setParents(darkGas).setHidden().setStub().registerResearchItem();
darkGas.setSiblings(gasRemover);
tags = new ObjectTags().add(EnumTag.HEAL, 10).add(EnumTag.TOOL, 16).add(EnumTag.MAGIC, 8).add(EnumTag.WATER, 4).add(EnumTag.KNOWLEDGE, 16);
cleansingTalisman = new ResearchItem(LibItemNames.CLEANSING_TALISMAN_R, tags, 1, 18, ModItems.cleansingTalisman).setParents(Config.researchUTFT).setHidden().registerResearchItem();
tags = new ObjectTags().add(EnumTag.VISION, 16).add(EnumTag.MAGIC, 12).add(EnumTag.FLUX, 10);
fluxDetector = new ResearchItem(LibItemNames.FLUX_DETECTOR_R, tags, -3, 19, ModItems.fluxDetector).setParents(Config.researchBasicFlux).setParentsHidden(Config.researchGoggles).registerResearchItem();
}
}
@@ -19,7 +19,6 @@ import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.MathHelper;
import net.minecraftforge.common.ForgeDirection;
import thaumcraft.common.tiles.TileOwned;
import vazkii.tinkerer.lib.LibBlockNames;
@@ -129,7 +128,7 @@ public class TileEntityWardChest extends TileOwned implements ISidedInventory, n
@Override
public boolean isInvNameLocalized() {
return !MathHelper.stringNullOrLengthZero(customName);
return customName != null && customName.length() > 0;
}
@Override
@@ -57,6 +57,9 @@ public final class ConfigurationHandler {
LibItemIDs.idEnderMirror = loadItem(LibItemNames.ENDER_MIRROR, LibItemIDs.DEFAULT_ENDER_MIRROR);
LibItemIDs.idGoliathLegs = loadItem(LibItemNames.GOLIATH_LEGS, LibItemIDs.DEFAULT_GOLIATH_LEGS);
LibItemIDs.idDarkGas = loadItem(LibItemNames.DARK_GAS, LibItemIDs.DEFAULT_DARK_GAS);
LibItemIDs.idGasRemover = loadItem(LibItemNames.GAS_REMOVER, LibItemIDs.DEFAULT_GAS_REMOVER);
LibItemIDs.idFluxDetector = loadItem(LibItemNames.FLUX_DETECTOR, LibItemIDs.DEFAULT_FLUX_DETECTOR);
LibItemIDs.idCleansingTalisman = loadItem(LibItemNames.CLEANSING_TALISMAN, LibItemIDs.DEFAULT_CLEANSING_TALISMAN);
LibBlockIDs.idGlowstoneGas = loadBlock(LibBlockNames.GLOWSTONE_GAS, LibBlockIDs.DEFAULT_GLOWSTONE_GAS);
LibBlockIDs.idTransmutator = loadBlock(LibBlockNames.TRANSMUTATOR, LibBlockIDs.DEFAULT_TRANSMUTATOR);
@@ -35,7 +35,7 @@ public final class PlayerDamageHandler {
event.ammount -= 1;
int health = player.getHealth();
if(health > LibFeatures.GOLIATH_LEGS_MAX_SAFETY && event.ammount >= health && event.source.isUnblockable()) {
if(health > LibFeatures.GOLIATH_LEGS_MAX_SAFETY && event.ammount >= health) {
event.ammount = health - 1;
if(!player.worldObj.isRemote)
@@ -14,9 +14,14 @@
*/
package vazkii.tinkerer.util.helper;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import thaumcraft.api.aura.AuraNode;
import thaumcraft.common.aura.AuraManager;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -35,4 +40,29 @@ public final class MiscHelper {
public static String stackAsString(ItemStack stack) {
return stack == null ? "null" : stack.itemID + ":" + stack.getItemDamage();
}
public static AuraNode getClosestNode(World world, double x, double y, double z) {
List<Integer> nodes = AuraManager.getAurasWithin(world, x, y, z);
double closestDist = Double.MAX_VALUE;
AuraNode closestNode = null;
for(int i : nodes) {
AuraNode node = AuraManager.getNode(i);
float value = node.baseLevel / 4F;
double distX = node.xPos - x;
double distY = node.yPos - y;
double distZ = node.zPos - z;
double dist = distX * distX + distY * distY + distZ * distZ;
if(value * value >= dist && dist < closestDist) {
closestDist = dist;
closestNode = node;
}
}
return closestNode;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

+34 -3
View File
@@ -144,7 +144,7 @@ After a sigil is bound, you can hold right click it, like a bow to charge it and
<longText>Knowing the power of the Sword of the Zephyr to propel foes away, you are trying to create something that will allow you to propel yourself.</longText>
<page type = "text">Using the knowledge you got from creating the Sword of the Zephyr of propeling things around with air, you created a wand that will propel the holder in the direction that they're looking at.
While someone is flying through the use of this Wand, any fall damage that would have been taken is negated.</page>
While someone is flying through the use of this Wand, any acumulated gravitational energy is negated, reseting the fall damage the holder would take.</page>
<page type = "infusioncrafting">WAND_UPRISING</page>
</project>
@@ -235,8 +235,8 @@ They also give a more powerful vis reduction.</page>
<page type = "infusioncrafting">GOLIATH_LEGS</page>
</project>
<!-- ======================================== Gaseous Glowstone /-->
<project id = "DARK_GAS" version = "2">
<!-- ======================================== Gaseous Tenebrae /-->
<project id = "DARK_GAS" version = "1">
<name>Gaseous Tenebrae</name>
<popupText>[TT] Darkened Air</popupText>
<longText>After having learned how to create Gaseous Glowstone, you are thinking about making air that's dark. You are confident that it's possible, and that the other alchemical material is required.</longText>
@@ -245,4 +245,35 @@ They also give a more powerful vis reduction.</page>
This phial contains a concentrated extract of Gaseous Tenebrae, that can be released through a right click, and will spread relatively fast in the nearby area, darkening it.</page>
<page type = "infusioncrafting">DARK_GAS</page>
</project>
<!-- ======================================== Fume Dissipator /-->
<project id = "GAS_REMOVER" version = "1">
<name>Fume Dissipator</name>
<popupText>[TT] Clearing the Ambient</popupText>
<longText></longText>
<page type = "text">After knowing both the Gaseous Glowstone and Tenebrae, you are thinking it's becoming a hassle to get rid of it. With this item, by shift-right clicking on it, all the nearby gas will get dissipated.</page>
<page type = "arcanecrafting">GAS_REMOVER</page>
</project>
<!-- ======================================== Talisman of Remedium /-->
<project id = "CLEANSING_TALISMAN" version = "1">
<name>Talisman of Remedium</name>
<popupText>[TT] Better Than Milk!</popupText>
<longText>By studying the elements of life and body, you are confident you can make an item to purify yourself.</longText>
<page type = "text">You have studied life and the body and found that through the application of magic you can protect yourself from harmful outside influences by redirecting these effects to another place. This talisman will dispell most harmful effects on the holder, at the cost of vis from the local aura.
To enable or disable this ability, one would shift-right click on it. As expected, it only works whilst enabled.</page>
<page type = "infusioncrafting">CLEANSING_TALISMAN</page>
</project>
<!-- ======================================== Fluxometer /-->
<project id = "FLUX_DETECTOR" version = "1">
<name>Fluxometer</name>
<popupText>[TT] Visual Damage</popupText>
<longText>After research of the flux itself, you think that you can make use of one of your early discoveries, the Thaumometer, to measure the flux.</longText>
<page type = "text">Through the research of the flux itself, and through usage of one of your early discoveries, the Thaumomenter, you managed to discover an upgrade for it.
This new detector, the Fluxometer can measure the flux in the nearest relevant node. Whilst looking at the Fluxometer with Goggles of Revealing, the holder can see what flux is in the air. The flux displays as icons, the opacity of each icon indicates how much of that aspect is in the aura. If you look close, you can see maxed out aspects as a bit unstable.</page>
<page type = "arcanecrafting">FLUX_DETECTOR</page>
</project>
</research>
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB