Compare commits

..
9 Commits
15 changed files with 242 additions and 28 deletions

No files matched your search

+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. Researches that come from this mod are prefixed by [TT]. Compiled for Thaumcraft 3.0.5.",
"version": "1.0.4",
"version": "1.0.5",
"mcversion": "1.5+",
"logoFile": "/mods/ThaumicTinkerer/logo.png",
"url": "minecraftforum.net/topic/1813058-",
@@ -18,11 +18,14 @@ import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import thaumcraft.common.Config;
import thaumcraft.common.blocks.BlockWarded;
import thaumcraft.common.items.wands.ItemWandCasting;
import thaumcraft.common.tiles.TileOwned;
import vazkii.tinkerer.util.helper.ModCreativeTab;
@@ -49,6 +52,31 @@ public class BlockPhantomStone extends BlockWarded {
return false;
}
@Override
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
TileOwned tile = (TileOwned) par1World.getBlockTileEntity(par2, par3, par4);
if (tile != null) {
String owner = tile.owner;
if(owner.equals(par5EntityPlayer.username)) {
if(par5EntityPlayer.getCurrentEquippedItem() != null && par5EntityPlayer.getCurrentEquippedItem().getItem() instanceof ItemWandCasting) {
if(!par1World.isRemote) {
int id = par1World.getBlockId(par2, par3, par4);
int meta = par1World.getBlockMetadata(par2, par3, par4);
par1World.spawnEntityInWorld(new EntityItem(par1World, par2 + 0.5, par3 + 0.5, par4 + 0.5, new ItemStack(id, 1, meta)));
par1World.playAuxSFX(2001, par2, par3, par4, blockID + (meta << 12));
tile.safeToRemove = true;
par1World.setBlock(par2, par3, par4, 0, 0, 1 & 2);
} else par5EntityPlayer.swingItem();
return true;
}
}
}
return false;
}
@Override
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) {
TileOwned tile = (TileOwned) par1World.getBlockTileEntity(par2, par3, par4);
@@ -15,10 +15,12 @@
package vazkii.tinkerer.core.proxy;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.client.MinecraftForgeClient;
import thaumcraft.client.fx.FXLightningBolt;
import vazkii.tinkerer.ThaumicTinkerer;
import vazkii.tinkerer.client.render.block.RenderWardChest;
import vazkii.tinkerer.client.render.entity.RenderDeathRune;
import vazkii.tinkerer.client.render.item.RenderItemFluxDetector;
@@ -36,6 +38,7 @@ import vazkii.tinkerer.network.packet.PacketVerification;
import vazkii.tinkerer.tile.TileEntityAnimationTablet;
import vazkii.tinkerer.tile.TileEntityTransmutator;
import vazkii.tinkerer.tile.TileEntityWardChest;
import vazkii.tinkerer.util.helper.MiscHelper;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.registry.TickRegistry;
@@ -92,4 +95,33 @@ public class TTClientProxy extends TTCommonProxy {
lightning.finalizeBolt();
}
@Override
public void sanityCheckedFrozenParticles(EntityLiving entity) {
for(int i = 0; i < 6; i++) {
float x = (float) (entity.posX + (entity.worldObj.rand.nextDouble() - 0.5F) * (entity.width * 2F));
float y = (float) (entity.posY + entity.worldObj.rand.nextDouble() * entity.height);
float z = (float) (entity.posZ + (entity.worldObj.rand.nextDouble() - 0.5F) * (entity.width * 2F));
float size = (float) Math.random();
float gravity = (float) (Math.random() / 20F);
if(MiscHelper.getMc().renderViewEntity != null)
ThaumicTinkerer.tcProxy.sparkle(x, y, z, size, 2, gravity);
}
}
@Override
public void sanityCheckedPossessedParticles(EntityLiving entity) {
for(int i = 0; i < 3; i++) {
float x = (float) (entity.posX + (entity.worldObj.rand.nextDouble() - 0.5F) * (entity.width * 2F));
float y = (float) (entity.posY + entity.worldObj.rand.nextDouble() * entity.height);
float z = (float) (entity.posZ + (entity.worldObj.rand.nextDouble() - 0.5F) * (entity.width * 2F));
float size = (float) (Math.random() / 2F);
float gravity = (float) (Math.random() / 20F);
if(MiscHelper.getMc().renderViewEntity != null)
ThaumicTinkerer.tcProxy.wispFX2(entity.worldObj, x, y, z, size, 5, false, gravity);
}
}
}
@@ -15,6 +15,7 @@
package vazkii.tinkerer.core.proxy;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import vazkii.tinkerer.ThaumicTinkerer;
@@ -55,4 +56,8 @@ public class TTCommonProxy {
}
public void sigilLightning(World world, Entity entity, Vec3 end) { }
}
public void sanityCheckedFrozenParticles(EntityLiving entity) { }
public void sanityCheckedPossessedParticles(EntityLiving entity) { }
}
@@ -40,7 +40,6 @@ import vazkii.tinkerer.ThaumicTinkerer;
import vazkii.tinkerer.lib.LibEnchantmentIDs;
import vazkii.tinkerer.lib.LibPotions;
import vazkii.tinkerer.potion.ModPotions;
import vazkii.tinkerer.util.helper.MiscHelper;
import cpw.mods.fml.relauncher.ReflectionHelper;
public class ModEnchantmentHandler {
@@ -119,17 +118,7 @@ public class ModEnchantmentHandler {
event.entityLiving.setJumping(false);
event.entityLiving.motionY = 0;
for(int i = 0; i < 6; i++) {
float x = (float) (event.entityLiving.posX + (event.entityLiving.worldObj.rand.nextDouble() - 0.5F) * (event.entityLiving.width * 2F));
float y = (float) (event.entityLiving.posY + event.entityLiving.worldObj.rand.nextDouble() * event.entityLiving.height);
float z = (float) (event.entityLiving.posZ + (event.entityLiving.worldObj.rand.nextDouble() - 0.5F) * (event.entityLiving.width * 2F));
float size = (float) Math.random();
float gravity = (float) (Math.random() / 20F);
if(MiscHelper.getMc().renderViewEntity != null)
ThaumicTinkerer.tcProxy.sparkle(x, y, z, size, 2, gravity);
}
ThaumicTinkerer.proxy.sanityCheckedFrozenParticles(event.entityLiving);
} else if(event.entityLiving.landMovementFactor == 0F && event.entityLiving.jumpMovementFactor == 0F){
event.entityLiving.landMovementFactor = 0.1F;
event.entityLiving.jumpMovementFactor = 0.02F;
@@ -153,17 +142,7 @@ public class ModEnchantmentHandler {
if(event.entityLiving.getAttackTarget() instanceof EntityPlayer)
event.entityLiving.setAttackTarget(null);
for(int i = 0; i < 3; i++) {
float x = (float) (event.entityLiving.posX + (event.entityLiving.worldObj.rand.nextDouble() - 0.5F) * (event.entityLiving.width * 2F));
float y = (float) (event.entityLiving.posY + event.entityLiving.worldObj.rand.nextDouble() * event.entityLiving.height);
float z = (float) (event.entityLiving.posZ + (event.entityLiving.worldObj.rand.nextDouble() - 0.5F) * (event.entityLiving.width * 2F));
float size = (float) (Math.random() / 2F);
float gravity = (float) (Math.random() / 20F);
if(MiscHelper.getMc().renderViewEntity != null)
ThaumicTinkerer.tcProxy.wispFX2(event.entityLiving.worldObj, x, y, z, size, 5, false, gravity);
}
ThaumicTinkerer.proxy.sanityCheckedPossessedParticles(event.entityLiving);
}
}
@@ -70,6 +70,8 @@ public class ItemFireBracelet extends ItemMod {
par3World.playSoundAtEntity(par2EntityPlayer, "thaumcraft.brain", 1F, 1F);
did = true;
onItemUseFirst(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
return did;
}
}
@@ -0,0 +1,122 @@
/**
* 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 @ [29 May 2013, 20:52:44 (GMT)]
*/
package vazkii.tinkerer.item;
import java.util.List;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import thaumcraft.common.Config;
import thaumcraft.common.research.ResearchManager;
import vazkii.tinkerer.util.helper.ItemNBTHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemShareTome extends ItemMod {
private static final String TAG_PLAYER = "player";
private static final String NON_ASIGNED = "[Not Assigned]";
private static final String[] INFO = new String[] {
"This is a creative only item.",
"It can be right clicked by a player",
"to keep their research. After this,",
"another player can right click it",
"and they'll learn all that the other",
"player knew. This is good for co-op playing.",
"Have fun - Vazkii"
};
public ItemShareTome(int par1) {
super(par1);
setMaxStackSize(1);
}
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
String name = getPlayerName(par1ItemStack);
if(name.endsWith(NON_ASIGNED)) {
setPlayerName(par1ItemStack, par3EntityPlayer.username);
if(!par2World.isRemote)
par3EntityPlayer.addChatMessage("Research Data Written!");
} else {
sync : {
List<String> researchesDone = ResearchManager.getCompletedResearch(name);
if(researchesDone == null) {
if(!par2World.isRemote)
par3EntityPlayer.addChatMessage(name + "is not online. Research could not be acquired.");
break sync;
}
for(String key : researchesDone)
ResearchManager.completeResearch(par3EntityPlayer, key);
if(!par2World.isRemote)
par3EntityPlayer.addChatMessage("Research Data Synced!");
}
}
return par1ItemStack;
}
@Override
@SideOnly(Side.CLIENT)
public EnumRarity getRarity(ItemStack par1ItemStack) {
return EnumRarity.epic;
}
@Override
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1) {
return Config.itemThaumonomicon.getIconFromDamage(1);
}
@Override
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack par1ItemStack) {
return true;
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
String name = getPlayerName(par1ItemStack);
par3List.add(name.equals(NON_ASIGNED) ? name : "Bound to " + name + "'s research.");
if(GuiScreen.isShiftKeyDown())
for(String s : INFO)
par3List.add(s);
else par3List.add("Press SHIFT for more info.");
}
@Override
public boolean getShareTag() {
return true;
}
private String getPlayerName(ItemStack stack) {
return ItemNBTHelper.getString(stack, TAG_PLAYER, NON_ASIGNED);
}
private void setPlayerName(ItemStack stack, String playerName) {
ItemNBTHelper.setString(stack, TAG_PLAYER, playerName);
}
}
+3 -1
View File
@@ -49,6 +49,7 @@ public final class ModItems {
public static Item cleansingTalisman;
public static Item fluxDetector;
public static Item dummyEnchantbook;
public static Item researchShareBook;
public static void initItems() {
wandTinkerer = new ItemWandTinkerer(LibItemIDs.idWandTinkerer).setUnlocalizedName(LibItemNames.WAND_TINKERER);
@@ -73,6 +74,7 @@ public final class ModItems {
cleansingTalisman = new ItemCleansingTalisman(LibItemIDs.idCleansingTalisman).setUnlocalizedName(LibItemNames.CLEANSING_TALISMAN);
fluxDetector = new ItemFluxDetector(LibItemIDs.idFluxDetector).setUnlocalizedName(LibItemNames.FLUX_DETECTOR);
dummyEnchantbook = new ItemDummyEnchantbook(LibItemIDs.idDummyEnchantbook).setUnlocalizedName(LibItemNames.DUMMY_ENCHANTBOOK);
researchShareBook = new ItemShareTome(LibItemIDs.idResearchShareBook).setUnlocalizedName(LibItemNames.RESEARCH_SHARE_BOOK);
nameItems();
}
@@ -99,7 +101,7 @@ public final class ModItems {
LanguageRegistry.addName(gasRemover, LibItemNames.GAS_REMOVER_D);
LanguageRegistry.addName(cleansingTalisman, LibItemNames.CLEANSING_TALISMAN_D);
LanguageRegistry.addName(fluxDetector, LibItemNames.FLUX_DETECTOR_D);
LanguageRegistry.addName(dummyEnchantbook, "DUMMY ENCHANTING BOOK");
LanguageRegistry.addName(researchShareBook, LibItemNames.RESEARCH_SHARE_BOOK_D);
}
public static void applyObjectTags() {
@@ -24,6 +24,7 @@ public final class LibItemIDs {
public static final int DEFAULT_FLUX_DETECTOR = 21169;
public static final int DEFAULT_CLEANSING_TALISMAN = 21170;
public static final int DEFAULT_DUMMY_ENCHANTBOOK = 21171;
public static final int DEFAULT_RESEARCH_SHARE_BOOK = 21172;
public static int idWandTinkerer;
public static int idGlowstoneGas;
@@ -47,4 +48,5 @@ public final class LibItemIDs {
public static int idFluxDetector;
public static int idCleansingTalisman;
public static int idDummyEnchantbook;
public static int idResearchShareBook;
}
@@ -95,4 +95,7 @@ public final class LibItemNames {
public static final String CLEANSING_TALISMAN_D = "Talisman of Remedium";
public static final String DUMMY_ENCHANTBOOK = "dummyEnchantbook";
public static final String RESEARCH_SHARE_BOOK = "researchShareBook";
public static final String RESEARCH_SHARE_BOOK_D = "Tome of Knowledge Sharing";
}
+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.4";
public static final String MOD_VERSION = "1.0.5";
public static final String DEPENDENCIES = "required-after:Thaumcraft";
@@ -0,0 +1,35 @@
/**
* 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 @ [29 May 2013, 20:28:06 (GMT)]
*/
package vazkii.tinkerer.tile;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
public class FakeInvPlayer extends InventoryPlayer {
TabletFakePlayer fakePlayer;
public FakeInvPlayer(TabletFakePlayer fakePlayer) {
super(fakePlayer);
this.fakePlayer = fakePlayer;
}
@Override
public void setInventorySlotContents(int par1, ItemStack par2ItemStack) {
super.setInventorySlotContents(par1, par2ItemStack);
if(par1 == currentItem)
fakePlayer.tablet.setInventorySlotContents(0, getStackInSlot(currentItem));
}
}
@@ -26,6 +26,7 @@ public class TabletFakePlayer extends FakePlayer {
public TabletFakePlayer(TileEntityAnimationTablet tablet) {
super(tablet.worldObj, tablet.getInvName());
this.tablet = tablet;
inventory = new FakeInvPlayer(this);
}
@Override
@@ -35,6 +36,8 @@ public class TabletFakePlayer extends FakePlayer {
@Override
public void onUpdate() {
capabilities.isCreativeMode = false;
posX = tablet.xCoord + 0.5;
posY = tablet.yCoord + 1.6;
posZ = tablet.zCoord + 0.5;
@@ -66,6 +66,7 @@ public final class ConfigurationHandler {
LibItemIDs.idFluxDetector = loadItem(LibItemNames.FLUX_DETECTOR, LibItemIDs.DEFAULT_FLUX_DETECTOR);
LibItemIDs.idCleansingTalisman = loadItem(LibItemNames.CLEANSING_TALISMAN, LibItemIDs.DEFAULT_CLEANSING_TALISMAN);
LibItemIDs.idDummyEnchantbook = loadItem(LibItemNames.DUMMY_ENCHANTBOOK, LibItemIDs.DEFAULT_DUMMY_ENCHANTBOOK);
LibItemIDs.idResearchShareBook = loadItem(LibItemNames.RESEARCH_SHARE_BOOK, LibItemIDs.DEFAULT_RESEARCH_SHARE_BOOK);
LibBlockIDs.idGlowstoneGas = loadBlock(LibBlockNames.GLOWSTONE_GAS, LibBlockIDs.DEFAULT_GLOWSTONE_GAS);
LibBlockIDs.idTransmutator = loadBlock(LibBlockNames.TRANSMUTATOR, LibBlockIDs.DEFAULT_TRANSMUTATOR);
+1 -1
View File
@@ -284,7 +284,7 @@ This new detector, the Fluxometer can measure the flux in the nearest relevant n
<longText>The pieces of knowledge you have been connecting speak of extremely powerful enchantments on the various schools of magic. You don't know what might come out of this, but you are sure that you would need to study various different items.</longText>
<page type = "text">Extensive research of lost knowledge revealed a set of four very powerful enchantments.
These enchantments can not be enchanted trough the regular means of using an enchanting table, rather, they would need to be created by the usage of an infusion altar. Furthermore, only one of these enchantments can be applied to a specific item at any given time.</page>
These enchantments can not be enchanted through the regular means of using an enchanting table, rather, they would need to be created by the usage of an infusion altar. Furthermore, only one of these enchantments can be applied to a specific item at any given time.</page>
<page type = "text">Freezing: Any entity hit with this sword will recieve a freezing effect, imparing their movement. Being set on fire will negate this.
Soulbringer: When a sword imbuded with this hits an undead, there's a chance for that undead to get possessed and succumb to your side.