mirror of
https://github.com/GTNewHorizons/ThaumicTinkerer.git
synced 2026-11-28 16:06:07 +00:00
Merge remote-tracking branch 'origin/1.7' into 1.7
This commit is contained in:
commit
d57da2f43c
40 files changed
+385
-366
No files matched your search
@@ -16,12 +16,13 @@ package vazkii.tinkerer.common.item;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import vazkii.tinkerer.common.block.ModBlocks;
|
||||
import vazkii.tinkerer.common.lib.LibBlockNames;
|
||||
|
||||
public class ItemBlockMagnet extends ItemBlock {
|
||||
|
||||
public ItemBlockMagnet(int par1) {
|
||||
super(par1);
|
||||
public ItemBlockMagnet() {
|
||||
super(ModBlocks.magnet);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,13 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
@@ -25,33 +31,21 @@ import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import thaumcraft.api.IRepairable;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ScanResult;
|
||||
import thaumcraft.common.lib.research.ScanManager;
|
||||
import vazkii.tinkerer.client.core.helper.IconHelper;
|
||||
import vazkii.tinkerer.common.core.handler.ModCreativeTab;
|
||||
import vazkii.tinkerer.common.core.helper.EnumMobAspect;
|
||||
import vazkii.tinkerer.common.lib.LibObfuscation;
|
||||
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemBloodSword extends ItemSword implements IRepairable {
|
||||
|
||||
@Override
|
||||
@@ -70,7 +64,7 @@ public class ItemBloodSword extends ItemSword implements IRepairable {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this);
|
||||
}
|
||||
|
||||
@@ -91,7 +85,7 @@ public class ItemBloodSword extends ItemSword implements IRepairable {
|
||||
event.drops.add(entityitem);
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
@SubscribeEvent
|
||||
public void onDrops(LivingDropsEvent event){
|
||||
if (event.source.damageType.equals("player")) {
|
||||
|
||||
@@ -113,7 +107,7 @@ public class ItemBloodSword extends ItemSword implements IRepairable {
|
||||
}
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
@SubscribeEvent
|
||||
public void onDamageTaken(LivingAttackEvent event) {
|
||||
if(event.entity.worldObj.isRemote)
|
||||
return;
|
||||
@@ -125,7 +119,7 @@ public class ItemBloodSword extends ItemSword implements IRepairable {
|
||||
if(event.entityLiving instanceof EntityPlayer && handle) {
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
ItemStack itemInUse = ReflectionHelper.getPrivateValue(EntityPlayer.class, player, LibObfuscation.ITEM_IN_USE);
|
||||
if(itemInUse != null && itemInUse.itemID == itemID) {
|
||||
if(itemInUse != null && itemInUse.getItem()==this) {
|
||||
|
||||
event.setCanceled(true);
|
||||
handleNext = 3;
|
||||
@@ -137,8 +131,8 @@ public class ItemBloodSword extends ItemSword implements IRepairable {
|
||||
Entity source = event.source.getSourceOfDamage();
|
||||
if(source != null && source instanceof EntityLivingBase) {
|
||||
EntityLivingBase attacker = (EntityLivingBase) source;
|
||||
ItemStack itemInUse = attacker.getCurrentItemOrArmor(0);
|
||||
if(itemInUse != null && itemInUse.itemID == itemID)
|
||||
ItemStack itemInUse = attacker.getHeldItem();
|
||||
if(itemInUse != null && itemInUse.getItem()==this)
|
||||
attacker.attackEntityFrom(DamageSource.magic, 2);
|
||||
}
|
||||
}
|
||||
@@ -154,10 +148,10 @@ public class ItemBloodSword extends ItemSword implements IRepairable {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
if(stack.stackTagCompound.getInteger("Activated")==0){
|
||||
par3EntityPlayer.addChatMessage("\u00a74"+ StatCollector.translateToLocal("ttmisc.bloodSword.activateEssentiaHarvest"));
|
||||
par3EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.bloodSword.activateEssentiaHarvest"));
|
||||
stack.stackTagCompound.setInteger("Activated",1);
|
||||
}else{
|
||||
par3EntityPlayer.addChatMessage("\u00a74"+ StatCollector.translateToLocal("ttmisc.bloodSword.deactivateEssentiaHarvest"));
|
||||
par3EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.bloodSword.deactivateEssentiaHarvest"));
|
||||
stack.stackTagCompound.setInteger("Activated",0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
package vazkii.tinkerer.common.item;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.tinkerer.common.block.ModBlocks;
|
||||
@@ -38,7 +39,7 @@ public class ItemBrightNitor extends ItemMod {
|
||||
}
|
||||
|
||||
public static void setBlock(int x, int y, int z, World world) {
|
||||
if((world.getBlockId(x, y, z) == 0 || world.getBlockId(x, y, z) == ModBlocks.nitorGas.blockID) && !world.isRemote)
|
||||
world.setBlock(x, y, z, ModBlocks.nitorGas.blockID, meta, 2);
|
||||
if((world.getBlock(x, y, z) == Blocks.air || world.getBlock(x, y, z) == ModBlocks.nitorGas) && !world.isRemote)
|
||||
world.setBlock(x, y, z, ModBlocks.nitorGas, meta, 2);
|
||||
}
|
||||
}
|
||||
@@ -14,32 +14,32 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.tinkerer.client.core.helper.IconHelper;
|
||||
import vazkii.tinkerer.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.tinkerer.common.lib.LibFeatures;
|
||||
import vazkii.tinkerer.common.lib.LibObfuscation;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemCleansingTalisman extends ItemMod {
|
||||
|
||||
private static final String TAG_ENABLED = "enabled";
|
||||
|
||||
private Icon enabledIcon;
|
||||
private IIcon enabledIcon;
|
||||
|
||||
public ItemCleansingTalisman() {
|
||||
setMaxStackSize(1);
|
||||
@@ -97,7 +97,7 @@ public class ItemCleansingTalisman extends ItemMod {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this, 0);
|
||||
enabledIcon = IconHelper.forItem(par1IconRegister, this, 1);
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public class ItemCleansingTalisman extends ItemMod {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(ItemStack stack, int pass) {
|
||||
public IIcon getIcon(ItemStack stack, int pass) {
|
||||
return isEnabled(stack) ? enabledIcon : itemIcon;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,15 +18,13 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.common.entities.golems.EntityGolemBase;
|
||||
import thaumcraft.common.entities.golems.EnumGolemType;
|
||||
import vazkii.tinkerer.common.block.tile.TileGolemConnector;
|
||||
import vazkii.tinkerer.common.block.tile.transvector.TileTransvector;
|
||||
import vazkii.tinkerer.common.block.tile.transvector.TileTransvectorInterface;
|
||||
import vazkii.tinkerer.common.core.golems.EnumGolemDecorations;
|
||||
import vazkii.tinkerer.common.core.helper.ItemNBTHelper;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -60,11 +58,11 @@ public class ItemConnector extends ItemMod {
|
||||
|
||||
playSound(par3World, par4, par5, par6);
|
||||
if(tile instanceof TileTransvector)
|
||||
par2EntityPlayer.addChatMessage("ttmisc.connector.set");
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.connector.set"));
|
||||
else
|
||||
par2EntityPlayer.addChatMessage("ttmisc.golemconnector.set");
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.golemconnector.set"));
|
||||
} else
|
||||
par2EntityPlayer.addChatMessage("ttmisc.connector.notinterf");
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.connector.notinterf"));
|
||||
} else {
|
||||
int x = getX(par1ItemStack);
|
||||
int y = getY(par1ItemStack);
|
||||
@@ -74,17 +72,17 @@ public class ItemConnector extends ItemMod {
|
||||
if (tile1 == null || !(tile1 instanceof TileTransvector)) {
|
||||
setY(par1ItemStack, -1);
|
||||
|
||||
par2EntityPlayer.addChatMessage("ttmisc.connector.notpresent");
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.connector.notpresent"));
|
||||
} else {
|
||||
TileTransvector trans = (TileTransvector) tile1;
|
||||
|
||||
if (tile != null && tile1 instanceof TileTransvectorInterface && tile instanceof TileTransvectorInterface) {
|
||||
par2EntityPlayer.addChatMessage("ttmisc.connector.interffail");
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.connector.interffail"));
|
||||
return true;
|
||||
}
|
||||
|
||||
if(Math.abs(x - par4) > trans.getMaxDistance() || Math.abs(y - par5) > trans.getMaxDistance() || Math.abs(z - par6) > trans.getMaxDistance()) {
|
||||
par2EntityPlayer.addChatMessage("ttmisc.connector.toofar");
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.connector.toofar"));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -95,8 +93,8 @@ public class ItemConnector extends ItemMod {
|
||||
setY(par1ItemStack, -1);
|
||||
|
||||
playSound(par3World, par4, par5, par6);
|
||||
par2EntityPlayer.addChatMessage("ttmisc.connector.complete");
|
||||
PacketDispatcher.sendPacketToAllInDimension(trans.getDescriptionPacket(), par3World.provider.dimensionId);
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.connector.complete"));
|
||||
par3World.markBlockForUpdate(trans.x,trans.y,trans.z);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +117,7 @@ public class ItemConnector extends ItemMod {
|
||||
{
|
||||
return false;
|
||||
}
|
||||
par2EntityPlayer.addChatMessage("ttmisc.golemconnector.notinterf");
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.golemconnector.notinterf"));
|
||||
return true;
|
||||
}
|
||||
int x = getX(par1ItemStack);
|
||||
@@ -132,7 +130,7 @@ public class ItemConnector extends ItemMod {
|
||||
{
|
||||
return false;
|
||||
}
|
||||
par2EntityPlayer.addChatMessage("ttmisc.golemconnector.notpresent");
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.golemconnector.notpresent"));
|
||||
return false;
|
||||
} else {
|
||||
if(par3EntityLivingBase.worldObj.isRemote)
|
||||
@@ -150,8 +148,8 @@ public class ItemConnector extends ItemMod {
|
||||
|
||||
|
||||
playSound(par3EntityLivingBase.worldObj, (int)par3EntityLivingBase.posX, (int)par3EntityLivingBase.posY, (int)par3EntityLivingBase.posZ);
|
||||
par2EntityPlayer.addChatMessage("ttmisc.golemconnector.complete");
|
||||
PacketDispatcher.sendPacketToAllInDimension(trans.getDescriptionPacket(), par3EntityLivingBase.worldObj.provider.dimensionId);
|
||||
par2EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.golemconnector.complete"));
|
||||
par2EntityPlayer.worldObj.markBlockForUpdate(trans.xCoord,trans.yCoord,trans.zCoord);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -42,9 +42,9 @@ public class ItemGas extends ItemMod {
|
||||
|
||||
if(air) {
|
||||
if(!par2World.isRemote)
|
||||
par2World.setBlock(x, y, z, setBlock.blockID, 4, 2);
|
||||
par2World.setBlock(x, y, z, setBlock, 4, 2);
|
||||
else par3EntityPlayer.swingItem();
|
||||
par2World.scheduleBlockUpdate(x, y, z, setBlock.blockID, 10);
|
||||
par2World.scheduleBlockUpdate(x, y, z, setBlock, 10);
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
|
||||
@@ -16,6 +16,7 @@ package vazkii.tinkerer.common.item;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
@@ -40,11 +41,11 @@ public class ItemGasRemover extends ItemMod {
|
||||
for(int x = xs - 3; x < xs + 3; x++)
|
||||
for(int y = ys - 3; y < ys + 3; y++)
|
||||
for(int z = zs - 3; z < zs + 3; z++) {
|
||||
int id = par2World.getBlockId(x, y, z);
|
||||
if(Block.blocksList[id] != null && Block.blocksList[id] instanceof BlockGas) {
|
||||
BlockGas gas = (BlockGas) Block.blocksList[id];
|
||||
Block block = par2World.getBlock(x, y, z);
|
||||
if(block != null && block instanceof BlockGas) {
|
||||
BlockGas gas = (BlockGas) block;
|
||||
gas.placeParticle(par2World, x, y, z);
|
||||
par2World.setBlock(x, y, z, 0, 0, 1 | 2);
|
||||
par2World.setBlock(x, y, z, Blocks.air, 0, 1 | 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package vazkii.tinkerer.common.item;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import thaumcraft.api.IScribeTools;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
|
||||
public class ItemInfusedInkwell extends ItemMod {
|
||||
public class ItemInfusedInkwell extends ItemMod implements IScribeTools {
|
||||
|
||||
public ItemInfusedInkwell() {
|
||||
super();
|
||||
@@ -21,7 +22,7 @@ public class ItemInfusedInkwell extends ItemMod {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int par1)
|
||||
public IIcon getIconFromDamage(int par1)
|
||||
{
|
||||
return ConfigItems.itemInkwell.getIconFromDamage(par1);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package vazkii.tinkerer.common.item;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import vazkii.tinkerer.client.lib.LibResources;
|
||||
import vazkii.tinkerer.common.core.helper.NumericAspectHelper;
|
||||
@@ -29,18 +29,12 @@ public class ItemMobAspect extends Item {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
|
||||
for(NumericAspectHelper aspect:NumericAspectHelper.values){
|
||||
par3List.add(getStackFromAspect(aspect.getAspect()));
|
||||
}
|
||||
}
|
||||
|
||||
public static Icon[] aspectIcons = new Icon[aspectCount];
|
||||
public static IIcon[] aspectIcons = new IIcon[aspectCount];
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
super.registerIcons(par1IconRegister);
|
||||
|
||||
for(NumericAspectHelper aspect:NumericAspectHelper.values){
|
||||
@@ -49,8 +43,15 @@ public class ItemMobAspect extends Item {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Icon getIconFromDamageForRenderPass(int par1, int par2) {
|
||||
@Override
|
||||
public void getSubItems(Item par1Item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for(NumericAspectHelper aspect:NumericAspectHelper.values){
|
||||
par3List.add(getStackFromAspect(aspect.getAspect()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamageForRenderPass(int par1, int par2) {
|
||||
return aspectIcons[par1%aspectCount];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package vazkii.tinkerer.common.item;
|
||||
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import vazkii.tinkerer.common.core.helper.EnumMobAspect;
|
||||
import vazkii.tinkerer.common.core.helper.ItemNBTHelper;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -35,8 +32,8 @@ public class ItemMobDisplay extends ItemMod {
|
||||
ItemNBTHelper.setString(stack, TAG_TYPE, type);
|
||||
}
|
||||
@Override
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List list) {
|
||||
super.getSubItems(par1, par2CreativeTabs, list);
|
||||
public void getSubItems(Item par1Item, CreativeTabs par2CreativeTabs, List list) {
|
||||
super.getSubItems(par1Item, par2CreativeTabs, list);
|
||||
for(EnumMobAspect aspect:EnumMobAspect.values())
|
||||
{
|
||||
Class aspClass=aspect.getEntityClass();
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import vazkii.tinkerer.client.core.helper.IconHelper;
|
||||
import vazkii.tinkerer.common.core.handler.ModCreativeTab;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemMod extends Item {
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ItemMod extends Item {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this);
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ package vazkii.tinkerer.common.item;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -47,7 +47,7 @@ public class ItemRevealingHelm extends ItemArmor implements IRepairable, IReveal
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +1,25 @@
|
||||
package vazkii.tinkerer.common.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
import thaumcraft.common.lib.research.ResearchManager;
|
||||
import vazkii.tinkerer.common.ThaumicTinkerer;
|
||||
import vazkii.tinkerer.common.core.helper.ItemNBTHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemShareBook extends ItemMod {
|
||||
|
||||
@@ -32,17 +35,17 @@ public class ItemShareBook extends ItemMod {
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||
String name = getPlayerName(par1ItemStack);
|
||||
if(name.endsWith(NON_ASIGNED)) {
|
||||
setPlayerName(par1ItemStack, par3EntityPlayer.username);
|
||||
setPlayerName(par1ItemStack, par3EntityPlayer.getGameProfile().getName());
|
||||
if(isOfflineShare(par1ItemStack))
|
||||
setPlayerResearch(par1ItemStack,par3EntityPlayer.username);
|
||||
setPlayerResearch(par1ItemStack,par3EntityPlayer.getGameProfile().getName());
|
||||
if(!par2World.isRemote)
|
||||
par3EntityPlayer.addChatMessage("ttmisc.shareTome.write");
|
||||
par3EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.shareTome.write"));
|
||||
} else sync : {
|
||||
List<String> researchesDone = ResearchManager.getResearchForPlayer(name);
|
||||
|
||||
if(researchesDone == null && ! isOfflineShare(par1ItemStack)) {
|
||||
if(!par2World.isRemote)
|
||||
par3EntityPlayer.addChatMessage("ttmisc.shareTome.notOnline");
|
||||
par3EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.shareTome.notOnline"));
|
||||
break sync;
|
||||
}
|
||||
if(researchesDone==null && isOfflineShare(par1ItemStack))
|
||||
@@ -50,7 +53,7 @@ public class ItemShareBook extends ItemMod {
|
||||
if(par2World.isRemote)
|
||||
researchesDone=getPlayerResearch(par1ItemStack);
|
||||
else {
|
||||
par3EntityPlayer.addChatMessage("ttmisc.shareTome.sync");
|
||||
par3EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.shareTome.sync"));
|
||||
break sync;
|
||||
|
||||
}
|
||||
@@ -60,7 +63,7 @@ public class ItemShareBook extends ItemMod {
|
||||
ThaumicTinkerer.tcProxy.getResearchManager().completeResearch(par3EntityPlayer, key);
|
||||
|
||||
if(!par2World.isRemote)
|
||||
par3EntityPlayer.addChatMessage("ttmisc.shareTome.sync");
|
||||
par3EntityPlayer.addChatMessage(new ChatComponentTranslation("ttmisc.shareTome.sync"));
|
||||
}
|
||||
|
||||
|
||||
@@ -72,11 +75,11 @@ public class ItemShareBook extends ItemMod {
|
||||
NBTTagCompound cmp=ItemNBTHelper.getNBT(par1ItemStack);
|
||||
if(!cmp.hasKey("research"))
|
||||
return retVals;
|
||||
NBTTagList list=cmp.getTagList("research");
|
||||
NBTTagList list=cmp.getTagList("research", Constants.NBT.TAG_STRING);
|
||||
for(int i=0;i<list.tagCount();i++)
|
||||
{
|
||||
NBTTagString str= (NBTTagString) list.tagAt(i);
|
||||
retVals.add(str.data);
|
||||
|
||||
retVals.add(list.getStringTagAt(i));
|
||||
}
|
||||
return retVals;
|
||||
}
|
||||
@@ -93,11 +96,11 @@ public class ItemShareBook extends ItemMod {
|
||||
String name = getPlayerName(par1ItemStack);
|
||||
par3List.add(name.equals(NON_ASIGNED) ? StatCollector.translateToLocal("ttmisc.shareTome.noAssign") : String.format(StatCollector.translateToLocal("ttmisc.shareTome.playerName"), name));
|
||||
if(isOfflineShare(par1ItemStack))
|
||||
par3List.add(StatCollector.translateToLocal("ttmisc.shareTomb.offlineshare"));
|
||||
par3List.add(new ChatComponentTranslation("ttmisc.shareTomb.offlineshare"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for(int i=0;i<2;i++)
|
||||
{
|
||||
par3List.add(new ItemStack(this,1,i));
|
||||
@@ -128,7 +131,7 @@ public class ItemShareBook extends ItemMod {
|
||||
NBTTagList list=new NBTTagList();
|
||||
for(String tag:researchesDone)
|
||||
{
|
||||
list.appendTag(new NBTTagString("tag",tag));
|
||||
list.appendTag(new NBTTagString(tag));
|
||||
}
|
||||
cmp.setTag("research",list);
|
||||
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import vazkii.tinkerer.common.lib.LibFeatures;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class ItemSpellCloth extends ItemMod {
|
||||
|
||||
@@ -46,9 +46,8 @@ public class ItemSpellCloth extends ItemMod {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItemStack(ItemStack itemStack) {
|
||||
public ItemStack getContainerItem(ItemStack itemStack) {
|
||||
itemStack.setItemDamage(itemStack.getItemDamage() + 1);
|
||||
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,30 +14,30 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityXPOrb;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.tinkerer.client.core.helper.IconHelper;
|
||||
import vazkii.tinkerer.common.ThaumicTinkerer;
|
||||
import vazkii.tinkerer.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.tinkerer.common.lib.LibFeatures;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemXPTalisman extends ItemMod {
|
||||
|
||||
private static final String TAG_XP = "xp";
|
||||
Icon enabledIcon;
|
||||
IIcon enabledIcon;
|
||||
|
||||
public ItemXPTalisman() {
|
||||
super();
|
||||
@@ -53,10 +53,10 @@ public class ItemXPTalisman extends ItemMod {
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.orb", 0.3F, 0.1F);
|
||||
}
|
||||
} else if(getXP(par1ItemStack) >= LibFeatures.XP_TALISMAN_ENCHANTING_BOTTLE_COST) {
|
||||
boolean has = par3EntityPlayer.inventory.consumeInventoryItem(Item.glassBottle.itemID);
|
||||
boolean has = par3EntityPlayer.inventory.consumeInventoryItem(Items.glass_bottle);
|
||||
if(has) {
|
||||
if(!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.expBottle, 1)) && !par2World.isRemote)
|
||||
par3EntityPlayer.dropItem(Item.expBottle.itemID, 1);
|
||||
if(!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Items.experience_bottle, 1)) && !par2World.isRemote)
|
||||
par3EntityPlayer.dropItem(Items.experience_bottle, 1);
|
||||
int xp = getXP(par1ItemStack);
|
||||
setXP(par1ItemStack, xp - LibFeatures.XP_TALISMAN_ENCHANTING_BOTTLE_COST);
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "random.orb", 0.1F, (float) (0.1F + Math.random() / 2F));
|
||||
@@ -126,14 +126,14 @@ public class ItemXPTalisman extends ItemMod {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this, 0);
|
||||
enabledIcon = IconHelper.forItem(par1IconRegister, this, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int par1) {
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return par1 == 1 ? enabledIcon : itemIcon;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public class SpellClothRecipe implements IRecipe {
|
||||
if(stack.isItemEnchanted() && !(stack.getItem() instanceof INoRemoveEnchant) && !foundEnchanted)
|
||||
foundEnchanted = true;
|
||||
|
||||
else if(stack.itemID == item.itemID && !foundCloth)
|
||||
else if(stack.getItem() == item && !foundCloth)
|
||||
foundCloth = true;
|
||||
|
||||
else return false; // Found an invalid item, breaking the recipe
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item.foci;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
@@ -30,12 +30,12 @@ import thaumcraft.api.wands.IWandFocus;
|
||||
import thaumcraft.common.config.Config;
|
||||
import vazkii.tinkerer.client.core.helper.IconHelper;
|
||||
import vazkii.tinkerer.common.item.ItemMod;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public abstract class ItemModFocus extends ItemMod implements IWandFocus {
|
||||
|
||||
private Icon ornament, depth;
|
||||
private IIcon ornament, depth;
|
||||
|
||||
public ItemModFocus() {
|
||||
super();
|
||||
@@ -54,7 +54,7 @@ public abstract class ItemModFocus extends ItemMod implements IWandFocus {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
super.registerIcons(par1IconRegister);
|
||||
if(hasOrnament())
|
||||
ornament = IconHelper.forItem(par1IconRegister, this, "Orn");
|
||||
@@ -94,12 +94,12 @@ public abstract class ItemModFocus extends ItemMod implements IWandFocus {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getOrnament() {
|
||||
public IIcon getOrnament() {
|
||||
return ornament;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getFocusDepthLayerIcon() {
|
||||
public IIcon getFocusDepthLayerIcon() {
|
||||
return depth;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,20 +14,20 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item.kami;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.tinkerer.client.core.helper.IconHelper;
|
||||
@@ -35,8 +35,9 @@ import vazkii.tinkerer.client.core.proxy.TTClientProxy;
|
||||
import vazkii.tinkerer.common.block.tile.transvector.TileTransvectorInterface;
|
||||
import vazkii.tinkerer.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.tinkerer.common.item.ItemMod;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemBlockTalisman extends ItemMod {
|
||||
@Deprecated
|
||||
@@ -45,7 +46,7 @@ public class ItemBlockTalisman extends ItemMod {
|
||||
private static final String TAG_BLOCK_META = "blockMeta";
|
||||
private static final String TAG_BLOCK_COUNT = "blockCount";
|
||||
|
||||
Icon enabledIcon;
|
||||
IIcon enabledIcon;
|
||||
|
||||
public ItemBlockTalisman() {
|
||||
super();
|
||||
@@ -65,12 +66,12 @@ public class ItemBlockTalisman extends ItemMod {
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
|
||||
int id = par3World.getBlockId(par4, par5, par6);
|
||||
Block block = par3World.getBlock(par4, par5, par6);
|
||||
int meta = par3World.getBlockMetadata(par4, par5, par6);
|
||||
boolean set = setBlock(par1ItemStack, id, meta);
|
||||
boolean set = setBlock(par1ItemStack, block, meta);
|
||||
|
||||
if(!set) {
|
||||
int bid = getBlockID(par1ItemStack);
|
||||
Block bBlock = getBlock(par1ItemStack);
|
||||
int bmeta = getBlockMeta(par1ItemStack);
|
||||
|
||||
TileEntity tile = par3World.getTileEntity(par4, par5, par6);
|
||||
@@ -80,22 +81,22 @@ public class ItemBlockTalisman extends ItemMod {
|
||||
for(int slot : slots) {
|
||||
ItemStack stackInSlot = inv.getStackInSlot(slot);
|
||||
if(stackInSlot == null) {
|
||||
ItemStack stack = new ItemStack(bid, 1, bmeta);
|
||||
ItemStack stack = new ItemStack(bBlock, 1, bmeta);
|
||||
int maxSize = stack.getMaxStackSize();
|
||||
stack.stackSize = remove(par1ItemStack, maxSize);
|
||||
if(stack.stackSize != 0) {
|
||||
if(inv.isItemValidForSlot(slot, stack) && (!(inv instanceof ISidedInventory) || ((ISidedInventory) inv).canInsertItem(slot, stack, par7))) {
|
||||
inv.setInventorySlotContents(slot, stack);
|
||||
inv.onInventoryChanged();
|
||||
inv.markDirty();
|
||||
set = true;
|
||||
}
|
||||
}
|
||||
} else if(stackInSlot.itemID == bid && stackInSlot.getItemDamage() == bmeta) {
|
||||
} else if(stackInSlot.getItem()== Item.getItemFromBlock(bBlock) && stackInSlot.getItemDamage() == bmeta) {
|
||||
int maxSize = stackInSlot.getMaxStackSize();
|
||||
int missing = maxSize - stackInSlot.stackSize;
|
||||
if(inv.isItemValidForSlot(slot, stackInSlot) && (!(inv instanceof ISidedInventory) || ((ISidedInventory) inv).canInsertItem(slot, stackInSlot, par7))) {
|
||||
stackInSlot.stackSize += remove(par1ItemStack, missing);
|
||||
inv.onInventoryChanged();
|
||||
inv.markDirty();
|
||||
set = true;
|
||||
}
|
||||
}
|
||||
@@ -103,7 +104,7 @@ public class ItemBlockTalisman extends ItemMod {
|
||||
} else {
|
||||
int remove = remove(par1ItemStack, 1);
|
||||
if(remove > 0) {
|
||||
Item.itemsList[bid].onItemUse(new ItemStack(bid, 1, bmeta), par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
Item.getItemFromBlock(bBlock).onItemUse(new ItemStack(bBlock, 1, bmeta), par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
set = true;
|
||||
}
|
||||
}
|
||||
@@ -116,8 +117,8 @@ public class ItemBlockTalisman extends ItemMod {
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
|
||||
int id = getBlockID(par1ItemStack);
|
||||
if(/*!par2World.isRemote && */par1ItemStack.getItemDamage() == 1 && id != 0 && par3Entity instanceof EntityPlayer) {
|
||||
Block block=getBlock(par1ItemStack);
|
||||
if(/*!par2World.isRemote && */par1ItemStack.getItemDamage() == 1 && block!=Blocks.air && par3Entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) par3Entity;
|
||||
int meta = getBlockMeta(par1ItemStack);
|
||||
|
||||
@@ -133,7 +134,7 @@ public class ItemBlockTalisman extends ItemMod {
|
||||
continue;
|
||||
}
|
||||
|
||||
if(stack.itemID == id && stack.getItemDamage() == meta) {
|
||||
if(Item.getItemFromBlock(block) == stack.getItem() && stack.getItemDamage() == meta) {
|
||||
counts[i] = stack.stackSize;
|
||||
if(highest == -1)
|
||||
highest = i;
|
||||
@@ -143,8 +144,8 @@ public class ItemBlockTalisman extends ItemMod {
|
||||
|
||||
if(highest == -1) {
|
||||
ItemStack heldItem = player.inventory.getItemStack();
|
||||
if(hasFreeSlot && (heldItem == null || heldItem.itemID != id || heldItem.getItemDamage() != meta)) {
|
||||
ItemStack stack = new ItemStack(id, remove(par1ItemStack, 64), meta);
|
||||
if(hasFreeSlot && (heldItem == null || Item.getItemFromBlock(block) == heldItem.getItem() || heldItem.getItemDamage() != meta)) {
|
||||
ItemStack stack = new ItemStack(block, remove(par1ItemStack, 64), meta);
|
||||
if(stack.stackSize != 0)
|
||||
player.inventory.addItemStackToInventory(stack);
|
||||
}
|
||||
@@ -160,7 +161,7 @@ public class ItemBlockTalisman extends ItemMod {
|
||||
}
|
||||
|
||||
int countInHighest = counts[highest];
|
||||
int maxSize = new ItemStack(id, 1, meta).getMaxStackSize();
|
||||
int maxSize = new ItemStack(block, 1, meta).getMaxStackSize();
|
||||
if(countInHighest < maxSize) {
|
||||
int missing = maxSize - countInHighest;
|
||||
ItemStack stackInHighest = player.inventory.getStackInSlot(highest);
|
||||
@@ -170,9 +171,9 @@ public class ItemBlockTalisman extends ItemMod {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean setBlock(ItemStack stack, int id, int meta) {
|
||||
if(getBlockID(stack) == 0 || getBlockCount(stack) == 0) {
|
||||
ItemNBTHelper.setInt(stack, TAG_BLOCK_ID, id);
|
||||
private boolean setBlock(ItemStack stack, Block block, int meta) {
|
||||
if(getBlock(stack) == Blocks.air || getBlockCount(stack) == 0) {
|
||||
ItemNBTHelper.setString(stack, TAG_BLOCK_NAME, block.getUnlocalizedName());
|
||||
ItemNBTHelper.setInt(stack, TAG_BLOCK_META, meta);
|
||||
return true;
|
||||
}
|
||||
@@ -199,6 +200,19 @@ public class ItemBlockTalisman extends ItemMod {
|
||||
return ItemNBTHelper.getInt(stack, TAG_BLOCK_ID, 0);
|
||||
}
|
||||
|
||||
public static String getBlockName(ItemStack stack)
|
||||
{
|
||||
return ItemNBTHelper.getString(stack,TAG_BLOCK_NAME,"");
|
||||
}
|
||||
|
||||
public static Block getBlock(ItemStack stack)
|
||||
{
|
||||
Block block=Block.getBlockFromName(getBlockName(stack));
|
||||
if(block== Blocks.air)
|
||||
block=Block.getBlockById(getBlockID(stack));
|
||||
|
||||
return block;
|
||||
}
|
||||
public static int getBlockMeta(ItemStack stack) {
|
||||
return ItemNBTHelper.getInt(stack, TAG_BLOCK_META, 0);
|
||||
}
|
||||
@@ -209,24 +223,24 @@ public class ItemBlockTalisman extends ItemMod {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this, 0);
|
||||
enabledIcon = IconHelper.forItem(par1IconRegister, this, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int par1) {
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return par1 == 1 ? enabledIcon : itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
int id = getBlockID(par1ItemStack);
|
||||
if(id != 0 && Block.blocksList[id] != null) {
|
||||
Block block=getBlock(par1ItemStack);
|
||||
if(block!=null && block!=Blocks.air) {
|
||||
int count = getBlockCount(par1ItemStack);
|
||||
par3List.add(StatCollector.translateToLocal(new ItemStack(Block.blocksList[id], 1, getBlockMeta(par1ItemStack)).getUnlocalizedName() + ".name") + " (x" + count + ")");
|
||||
par3List.add(StatCollector.translateToLocal(new ItemStack(block, 1, getBlockMeta(par1ItemStack)).getUnlocalizedName() + ".name") + " (x" + count + ")");
|
||||
}
|
||||
|
||||
if(par1ItemStack.getItemDamage() == 1)
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item.kami;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -21,7 +22,7 @@ import vazkii.tinkerer.client.core.proxy.TTClientProxy;
|
||||
|
||||
public class ItemBlockWarpGate extends ItemBlock {
|
||||
|
||||
public ItemBlockWarpGate(int par1) {
|
||||
public ItemBlockWarpGate(Block par1) {
|
||||
super(par1);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,14 +14,12 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item.kami;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.ai.EntityAIAvoidEntity;
|
||||
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
|
||||
import net.minecraft.entity.ai.EntityAITaskEntry;
|
||||
import net.minecraft.entity.ai.EntityAITasks;
|
||||
import net.minecraft.entity.item.EntityEnderCrystal;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.passive.EntityOcelot;
|
||||
@@ -33,7 +31,9 @@ import net.minecraft.world.World;
|
||||
import vazkii.tinkerer.client.core.proxy.TTClientProxy;
|
||||
import vazkii.tinkerer.common.item.ItemMod;
|
||||
import vazkii.tinkerer.common.lib.LibObfuscation;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemCatAmulet extends ItemMod {
|
||||
|
||||
@@ -49,11 +49,11 @@ public class ItemCatAmulet extends ItemMod {
|
||||
List<EntityLiving> entities = par2World.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(e.posX - range, e.posY - rangeY, e.posZ - range, e.posX + range, e.posY + rangeY, e.posZ + range));
|
||||
|
||||
for(EntityLiving entity : entities) {
|
||||
List<EntityAITaskEntry> entries = new ArrayList(entity.tasks.taskEntries);
|
||||
List<EntityAITasks.EntityAITaskEntry> entries = new ArrayList(entity.tasks.taskEntries);
|
||||
entries.addAll(new ArrayList(entity.targetTasks.taskEntries));
|
||||
|
||||
boolean avoidsOcelots = false;
|
||||
for(EntityAITaskEntry entry : entries) {
|
||||
for(EntityAITasks.EntityAITaskEntry entry : entries) {
|
||||
if(entry.action instanceof EntityAIAvoidEntity)
|
||||
avoidsOcelots = messWithRunAwayAI((EntityAIAvoidEntity) entry.action) || avoidsOcelots;
|
||||
|
||||
|
||||
@@ -14,22 +14,23 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item.kami;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
import thaumcraft.common.items.wands.ItemFocusPouch;
|
||||
import vazkii.tinkerer.client.core.helper.IconHelper;
|
||||
import vazkii.tinkerer.client.core.proxy.TTClientProxy;
|
||||
import vazkii.tinkerer.common.ThaumicTinkerer;
|
||||
import vazkii.tinkerer.common.core.handler.ModCreativeTab;
|
||||
import vazkii.tinkerer.common.lib.LibGuiIDs;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemIchorPouch extends ItemFocusPouch {
|
||||
|
||||
@@ -40,12 +41,12 @@ public class ItemIchorPouch extends ItemFocusPouch {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIconFromDamage(int par1) {
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return itemIcon;
|
||||
}
|
||||
|
||||
@@ -64,9 +65,9 @@ public class ItemIchorPouch extends ItemFocusPouch {
|
||||
public ItemStack[] getInventory(ItemStack item) {
|
||||
ItemStack[] stackList = new ItemStack[13 * 9];
|
||||
if (item.hasTagCompound()) {
|
||||
NBTTagList var2 = item.stackTagCompound.getTagList("Inventory");
|
||||
NBTTagList var2 = item.stackTagCompound.getTagList("Inventory", Constants.NBT.TAG_COMPOUND);
|
||||
for (int var3 = 0; var3 < var2.tagCount(); var3++) {
|
||||
NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3);
|
||||
NBTTagCompound var4 = (NBTTagCompound)var2.getCompoundTagAt(var3);
|
||||
int var5 = var4.getByte("Slot") & 0xFF;
|
||||
if (var5 >= 0 && var5 < stackList.length)
|
||||
stackList[var5] = ItemStack.loadItemStackFromNBT(var4);
|
||||
|
||||
@@ -14,22 +14,23 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item.kami;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import vazkii.tinkerer.client.core.helper.IconHelper;
|
||||
import vazkii.tinkerer.client.core.proxy.TTClientProxy;
|
||||
import vazkii.tinkerer.common.item.ItemMod;
|
||||
import vazkii.tinkerer.common.lib.LibItemNames;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemKamiResource extends ItemMod {
|
||||
|
||||
final int subtypes = 8;
|
||||
Icon[] icons;
|
||||
IIcon[] icons;
|
||||
|
||||
public ItemKamiResource() {
|
||||
super();
|
||||
@@ -37,21 +38,21 @@ public class ItemKamiResource extends ItemMod {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for(int i = 0; i < subtypes; i++)
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
icons = new Icon[subtypes];
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
icons = new IIcon[subtypes];
|
||||
|
||||
for(int i = 0; i < icons.length; i++)
|
||||
icons[i] = IconHelper.forNameRaw(par1IconRegister, LibItemNames.KAMI_RESOURCE_NAMES[i]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIconFromDamage(int par1) {
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return icons[Math.min(subtypes - 1, par1)];
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package vazkii.tinkerer.common.item.kami;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
@@ -32,7 +32,7 @@ public class ItemPlacementMirror extends ItemMod {
|
||||
private static final String TAG_BLOCK_META = "blockMeta";
|
||||
private static final String TAG_SIZE = "size";
|
||||
|
||||
Icon[] icons = new Icon[2];
|
||||
IIcon[] icons = new IIcon[2];
|
||||
|
||||
public ItemPlacementMirror() {
|
||||
super();
|
||||
@@ -46,7 +46,7 @@ public class ItemPlacementMirror extends ItemMod {
|
||||
|
||||
if(par2EntityPlayer.isSneaking()) {
|
||||
if(block != null && block.getRenderType() == 0)
|
||||
setBlock(par1ItemStack, id, meta);
|
||||
setBlock(par1ItemStack, block, meta);
|
||||
} else placeAllBlocks(par1ItemStack, par2EntityPlayer);
|
||||
|
||||
return true;
|
||||
@@ -77,37 +77,36 @@ public class ItemPlacementMirror extends ItemMod {
|
||||
}
|
||||
|
||||
private void placeBlockAndConsume(EntityPlayer player, ItemStack blockToPlace, ChunkCoordinates coords) {
|
||||
player.worldObj.setBlock(coords.posX, coords.posY, coords.posZ, Block.getBlockFromItem(blockToPlace.getItem()), blockToPlace.getItemDamage(), 1 | 2);
|
||||
player.worldObj.setBlock(coords.posX, coords.posY, coords.posZ, Block.getBlockFromItem(blockToPlace.getItem()), blockToPlace.getItemDamage(), 1 | 2);
|
||||
|
||||
if(player.capabilities.isCreativeMode)
|
||||
return;
|
||||
if (player.capabilities.isCreativeMode)
|
||||
return;
|
||||
|
||||
List<ItemStack> talismansToCheck = new ArrayList();
|
||||
for(int i = 0; i < player.inventory.getSizeInventory(); i++) {
|
||||
ItemStack stackInSlot = player.inventory.getStackInSlot(i);
|
||||
if(stackInSlot != null && stackInSlot.getItem() == blockToPlace.getItem() && stackInSlot.getItemDamage() == blockToPlace.getItemDamage()) {
|
||||
stackInSlot.stackSize--;
|
||||
if(stackInSlot.stackSize == 0)
|
||||
player.inventory.setInventorySlotContents(i, null);
|
||||
List<ItemStack> talismansToCheck = new ArrayList();
|
||||
for (int i = 0; i < player.inventory.getSizeInventory(); i++) {
|
||||
ItemStack stackInSlot = player.inventory.getStackInSlot(i);
|
||||
if (stackInSlot != null && stackInSlot.getItem() == blockToPlace.getItem() && stackInSlot.getItemDamage() == blockToPlace.getItemDamage()) {
|
||||
stackInSlot.stackSize--;
|
||||
if (stackInSlot.stackSize == 0)
|
||||
player.inventory.setInventorySlotContents(i, null);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(stackInSlot != null && stackInSlot.getItem() == ModItems.blockTalisman)
|
||||
talismansToCheck.add(stackInSlot);
|
||||
}
|
||||
|
||||
for(ItemStack talisman : talismansToCheck) {
|
||||
Block block = ItemBlockTalisman.getBlock(talisman);
|
||||
int meta = ItemBlockTalisman.getBlockMeta(talisman);
|
||||
|
||||
if(Item.getItemFromBlock(block) == blockToPlace.getItem() && meta == blockToPlace.getItemDamage()) {
|
||||
ItemBlockTalisman.remove(talisman, 1);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (stackInSlot != null && stackInSlot.getItem() == ModItems.blockTalisman)
|
||||
talismansToCheck.add(stackInSlot);
|
||||
}
|
||||
|
||||
for (ItemStack talisman : talismansToCheck) {
|
||||
Block block = ItemBlockTalisman.getBlock(talisman);
|
||||
int meta = ItemBlockTalisman.getBlockMeta(talisman);
|
||||
|
||||
if (Item.getItemFromBlock(block) == blockToPlace.getItem() && meta == blockToPlace.getItemDamage()) {
|
||||
ItemBlockTalisman.remove(talisman, 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasBlocks(ItemStack stack, EntityPlayer player, ChunkCoordinates[] blocks) {
|
||||
if(player.capabilities.isCreativeMode)
|
||||
@@ -115,7 +114,6 @@ public class ItemPlacementMirror extends ItemMod {
|
||||
|
||||
int required = blocks.length;
|
||||
int current = 0;
|
||||
|
||||
ItemStack reqStack = new ItemStack(getBlock(stack), 1, getBlockMeta(stack));
|
||||
List<ItemStack> talismansToCheck = new ArrayList();
|
||||
for(int i = 0; i < player.inventory.getSizeInventory(); i++) {
|
||||
@@ -180,8 +178,8 @@ public class ItemPlacementMirror extends ItemMod {
|
||||
return coords.toArray(new ChunkCoordinates[0]);
|
||||
}
|
||||
|
||||
private void setBlock(ItemStack stack, String name, int meta) {
|
||||
ItemNBTHelper.setString(stack, TAG_BLOCK_NAME, name);
|
||||
private void setBlock(ItemStack stack, Block block, int meta) {
|
||||
ItemNBTHelper.setString(stack, TAG_BLOCK_NAME, block.getUnlocalizedName());
|
||||
ItemNBTHelper.setInt(stack, TAG_BLOCK_META, meta);
|
||||
}
|
||||
|
||||
@@ -199,7 +197,11 @@ public class ItemPlacementMirror extends ItemMod {
|
||||
}
|
||||
public static Block getBlock(ItemStack stack)
|
||||
{
|
||||
return Block.getBlockFromName(getBlockName(stack));
|
||||
Block block=Block.getBlockFromName(getBlockName(stack));
|
||||
if(block==Blocks.air)
|
||||
block=Block.getBlockById(getBlockID(stack));
|
||||
|
||||
return block;
|
||||
}
|
||||
public static String getBlockName(ItemStack stack)
|
||||
{
|
||||
@@ -210,13 +212,14 @@ public class ItemPlacementMirror extends ItemMod {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
icons[0] = IconHelper.forItem(par1IconRegister, this, 0);
|
||||
icons[1] = IconHelper.forItem(par1IconRegister, this, 1);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Icon getIconFromDamageForRenderPass(int par1, int par2) {
|
||||
public IIcon getIconFromDamageForRenderPass(int par1, int par2) {
|
||||
return icons[par2 & 1];
|
||||
}
|
||||
|
||||
@@ -233,14 +236,10 @@ public class ItemPlacementMirror extends ItemMod {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
int id = getBlockID(par1ItemStack);
|
||||
Block block=getBlock(par1ItemStack);
|
||||
int size = getSize(par1ItemStack);
|
||||
|
||||
par3List.add(size + " x " + size);
|
||||
if(block== Blocks.air)
|
||||
if(id!=0)
|
||||
block=Block.getBlockById(id);
|
||||
if(block!=Blocks.air)
|
||||
par3List.add(StatCollector.translateToLocal(new ItemStack(block, 1, getBlockMeta(par1ItemStack)).getUnlocalizedName() + ".name"));
|
||||
}
|
||||
|
||||
@@ -52,11 +52,10 @@ public class ItemProtoclay extends ItemMod {
|
||||
String typeToFind = "";
|
||||
|
||||
if(player.isSwingInProgress && pos != null) {
|
||||
int id = par2World.getBlockId(pos.blockX, pos.blockY, pos.blockZ);
|
||||
Block block = Block.blocksList[id];
|
||||
Block block = par2World.getBlock(pos.blockX, pos.blockY, pos.blockZ);
|
||||
|
||||
if(block != null) {
|
||||
Material mat = block.blockMaterial;
|
||||
Material mat = block.getMaterial();
|
||||
if(ToolHandler.isRightMaterial(mat, ToolHandler.materialsPick))
|
||||
typeToFind = "pick";
|
||||
else if(ToolHandler.isRightMaterial(mat, ToolHandler.materialsShovel))
|
||||
|
||||
@@ -14,10 +14,7 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item.kami;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -31,6 +28,10 @@ import vazkii.tinkerer.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.tinkerer.common.core.helper.MiscHelper;
|
||||
import vazkii.tinkerer.common.item.ItemMod;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemSkyPearl extends ItemMod {
|
||||
|
||||
public static final String TAG_X = "x";
|
||||
@@ -45,8 +46,8 @@ public class ItemSkyPearl extends ItemMod {
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
|
||||
int id = par3World.getBlockId(par4, par5, par6);
|
||||
if(id == ModBlocks.warpGate.blockID && !isAttuned(par1ItemStack)) {
|
||||
Block block=par3World.getBlock(par4, par5, par6);
|
||||
if(block == ModBlocks.warpGate && !isAttuned(par1ItemStack)) {
|
||||
setValues(par1ItemStack, par4, par5, par6, par2EntityPlayer.dimension);
|
||||
par3World.playSoundAtEntity(par2EntityPlayer, "random.orb", 0.3F, 0.1F);
|
||||
}
|
||||
|
||||
@@ -14,21 +14,20 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item.kami.armor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraftforge.event.EventPriority;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingJumpEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
|
||||
import thaumcraft.common.lib.Utils;
|
||||
import vazkii.tinkerer.common.ThaumicTinkerer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemGemBoots extends ItemIchorclothArmorAdv {
|
||||
|
||||
public static List<String> playersWith1Step = new ArrayList();
|
||||
@@ -59,34 +58,34 @@ public class ItemGemBoots extends ItemIchorclothArmorAdv {
|
||||
int x = (int) player.posX;
|
||||
int y = (int) player.posY - 1;
|
||||
int z = (int) player.posZ;
|
||||
if(player.worldObj.getBlockId(x, y, z) == Block.dirt.blockID)
|
||||
player.worldObj.setBlock(x, y, z, Block.grass.blockID, 0, 2);
|
||||
if(player.worldObj.getBlock(x, y, z) == Blocks.dirt)
|
||||
player.worldObj.setBlock(x, y, z, Blocks.grass, 0, 2);
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
@SubscribeEvent
|
||||
public void onPlayerJump(LivingJumpEvent event) {
|
||||
if(event.entityLiving instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).itemID == itemID;
|
||||
boolean hasArmor = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem()== this;
|
||||
|
||||
if(hasArmor && ThaumicTinkerer.proxy.armorStatus(player) && player.getCurrentArmor(0).getItemDamage()==0)
|
||||
player.motionY += 0.3;
|
||||
}
|
||||
}
|
||||
|
||||
@ForgeSubscribe(priority = EventPriority.HIGH)
|
||||
@SubscribeEvent(priority = EventPriority.HIGH)
|
||||
public void onLivingUpdate(LivingUpdateEvent event) {
|
||||
if(event.entityLiving instanceof EntityPlayer && event.entityLiving.worldObj.isRemote) {
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
|
||||
boolean highStepListed = playersWith1Step.contains(player.username);
|
||||
boolean hasHighStep = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).itemID == itemID;
|
||||
boolean highStepListed = playersWith1Step.contains(player.getGameProfile().getName());
|
||||
boolean hasHighStep = player.getCurrentArmor(0) != null && player.getCurrentArmor(0).getItem() == this;
|
||||
|
||||
if( !highStepListed && (hasHighStep && ThaumicTinkerer.proxy.armorStatus(player) && player.getCurrentArmor(0).getItemDamage()==0))
|
||||
playersWith1Step.add(player.username);
|
||||
playersWith1Step.add(player.getGameProfile().getName());
|
||||
|
||||
if((!hasHighStep || !ThaumicTinkerer.proxy.armorStatus(player) || player.getCurrentArmor(0).getItemDamage()==1)&& highStepListed) {
|
||||
playersWith1Step.remove(player.username);
|
||||
playersWith1Step.remove(player.getGameProfile().getName());
|
||||
player.stepHeight = 0.5F;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,22 +14,22 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item.kami.armor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
|
||||
import vazkii.tinkerer.client.model.kami.ModelWings;
|
||||
import vazkii.tinkerer.common.ThaumicTinkerer;
|
||||
import vazkii.tinkerer.common.core.handler.ConfigHandler;
|
||||
import vazkii.tinkerer.common.item.ModItems;
|
||||
import vazkii.tinkerer.common.item.foci.ItemFocusDeflect;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemGemChest extends ItemIchorclothArmorAdv {
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ItemGemChest extends ItemIchorclothArmorAdv {
|
||||
ItemFocusDeflect.protectFromProjectiles(player);
|
||||
}
|
||||
|
||||
@ForgeSubscribe
|
||||
@SubscribeEvent
|
||||
public void updatePlayerFlyStatus(LivingUpdateEvent event) {
|
||||
if(event.entityLiving instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) event.entityLiving;
|
||||
@@ -87,12 +87,12 @@ public class ItemGemChest extends ItemIchorclothArmorAdv {
|
||||
}
|
||||
|
||||
public static String playerStr(EntityPlayer player) {
|
||||
return player.username + ":" + player.worldObj.isRemote;
|
||||
return player.getGameProfile().getName() + ":" + player.worldObj.isRemote;
|
||||
}
|
||||
|
||||
private static boolean shouldPlayerHaveFlight(EntityPlayer player) {
|
||||
ItemStack armor = player.getCurrentArmor(2);
|
||||
return armor != null && armor.itemID == ModItems.ichorChestGem.itemID && ThaumicTinkerer.proxy.armorStatus(player) && armor.getItemDamage()==0 && ConfigHandler.enableFlight;
|
||||
return armor != null && armor.getItem() == ModItems.ichorChestGem&& ThaumicTinkerer.proxy.armorStatus(player) && armor.getItemDamage()==0 && ConfigHandler.enableFlight;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -52,8 +52,8 @@ public class ItemGemHelm extends ItemIchorclothArmorAdv implements IGoggles, IRe
|
||||
player.setAir(300);
|
||||
PotionEffect effect = player.getActivePotionEffect(Potion.nightVision);
|
||||
|
||||
if(effect != null && effect.duration <= 202)
|
||||
effect.duration = 202;
|
||||
if(effect != null && effect.getDuration() <= 202)
|
||||
effect.setPotionDurationMax(202);
|
||||
else player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 202, 0));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package vazkii.tinkerer.common.item.kami.foci;
|
||||
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -11,7 +12,7 @@ import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.client.codechicken.core.vec.Vector3;
|
||||
@@ -21,7 +22,6 @@ import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import vazkii.tinkerer.client.core.proxy.TTClientProxy;
|
||||
import vazkii.tinkerer.common.ThaumicTinkerer;
|
||||
import vazkii.tinkerer.common.item.foci.ItemModFocus;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
|
||||
public class ItemFocusShadowbeam extends ItemModFocus {
|
||||
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item.kami.tool;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -22,8 +24,6 @@ import vazkii.tinkerer.client.core.helper.IconHelper;
|
||||
import vazkii.tinkerer.client.core.proxy.TTClientProxy;
|
||||
import vazkii.tinkerer.common.core.handler.ModCreativeTab;
|
||||
import vazkii.tinkerer.common.item.ModItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemIchorAxe extends ItemAxe {
|
||||
|
||||
@@ -35,7 +35,7 @@ public class ItemIchorAxe extends ItemAxe {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,29 +14,29 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item.kami.tool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.common.lib.Utils;
|
||||
import vazkii.tinkerer.client.core.handler.kami.ToolModeHUDHandler;
|
||||
import vazkii.tinkerer.client.core.helper.IconHelper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemIchorAxeAdv extends ItemIchorAxe implements IAdvancedTool {
|
||||
|
||||
Icon[] specialIcons = new Icon[3];
|
||||
IIcon[] specialIcons = new IIcon[3];
|
||||
|
||||
public ItemIchorAxeAdv() {
|
||||
super();
|
||||
@@ -46,7 +46,7 @@ public class ItemIchorAxeAdv extends ItemIchorAxe implements IAdvancedTool {
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) {
|
||||
World world = player.worldObj;
|
||||
Material mat = world.getBlockMaterial(x, y, z);
|
||||
Material mat = world.getBlock(x,y,z).getMaterial();
|
||||
if(!ToolHandler.isRightMaterial(mat, ToolHandler.materialsAxe))
|
||||
return false;
|
||||
|
||||
@@ -69,11 +69,11 @@ public class ItemIchorAxeAdv extends ItemIchorAxe implements IAdvancedTool {
|
||||
break;
|
||||
}
|
||||
case 2 : {
|
||||
int id = world.getBlockId(x, y, z);
|
||||
Block blck = world.getBlock(x, y, z);
|
||||
if(Utils.isWoodLog(world, x, y, z)) {
|
||||
while(id != 0) {
|
||||
Utils.breakFurthestBlock(world, x, y, z, id, player);
|
||||
id = world.getBlockId(x, y, z);
|
||||
while(blck != Blocks.air) {
|
||||
Utils.breakFurthestBlock(world, x, y, z, blck, player);
|
||||
blck = world.getBlock(x, y, z);
|
||||
}
|
||||
|
||||
List<EntityItem> items = world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x - 5, y - 1, z - 5, x + 5, y + 64, z + 5));
|
||||
@@ -90,19 +90,20 @@ public class ItemIchorAxeAdv extends ItemIchorAxe implements IAdvancedTool {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getStrVsBlock(ItemStack stack, Block block, int meta) {
|
||||
return Math.max(super.getStrVsBlock(stack, block, meta), Item.shears.getStrVsBlock(stack, block, meta));
|
||||
public float func_150893_a(ItemStack stack, Block block) {
|
||||
|
||||
return Math.max(super.func_150893_a(stack, block), Items.shears.func_150893_a(stack, block));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
super.registerIcons(par1IconRegister);
|
||||
for(int i = 0; i < specialIcons.length; i++)
|
||||
specialIcons[i] = IconHelper.forItem(par1IconRegister, this, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIconFromDamage(int par1) {
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return par1 >= specialIcons.length ? super.getIconFromDamage(par1) : specialIcons[par1];
|
||||
}
|
||||
|
||||
@@ -116,10 +117,7 @@ public class ItemIchorAxeAdv extends ItemIchorAxe implements IAdvancedTool {
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item.kami.tool;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -22,8 +24,6 @@ import vazkii.tinkerer.client.core.helper.IconHelper;
|
||||
import vazkii.tinkerer.client.core.proxy.TTClientProxy;
|
||||
import vazkii.tinkerer.common.core.handler.ModCreativeTab;
|
||||
import vazkii.tinkerer.common.item.ModItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemIchorPick extends ItemPickaxe {
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ItemIchorPick extends ItemPickaxe {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,16 +14,17 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item.kami.tool;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.tinkerer.client.core.handler.kami.ToolModeHUDHandler;
|
||||
import vazkii.tinkerer.client.core.helper.IconHelper;
|
||||
|
||||
@@ -31,7 +32,7 @@ import java.util.List;
|
||||
|
||||
public class ItemIchorPickAdv extends ItemIchorPick implements IAdvancedTool {
|
||||
|
||||
Icon[] specialIcons = new Icon[3];
|
||||
IIcon[] specialIcons = new IIcon[3];
|
||||
|
||||
public ItemIchorPickAdv() {
|
||||
super();
|
||||
@@ -39,14 +40,14 @@ public class ItemIchorPickAdv extends ItemIchorPick implements IAdvancedTool {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
super.registerIcons(par1IconRegister);
|
||||
for(int i = 0; i < specialIcons.length; i++)
|
||||
specialIcons[i] = IconHelper.forItem(par1IconRegister, this, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIconFromDamage(int par1) {
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return par1 >= specialIcons.length ? super.getIconFromDamage(par1) : specialIcons[par1];
|
||||
}
|
||||
|
||||
@@ -63,7 +64,7 @@ public class ItemIchorPickAdv extends ItemIchorPick implements IAdvancedTool {
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) {
|
||||
World world = player.worldObj;
|
||||
Material mat = world.getBlockMaterial(x, y, z);
|
||||
Material mat = world.getBlock(x, y, z).getMaterial();
|
||||
if(!ToolHandler.isRightMaterial(mat, ToolHandler.materialsPick))
|
||||
return false;
|
||||
|
||||
@@ -71,7 +72,7 @@ public class ItemIchorPickAdv extends ItemIchorPick implements IAdvancedTool {
|
||||
if(block == null)
|
||||
return false;
|
||||
|
||||
int id=world.getBlockId(x, y, z);
|
||||
Block blk=world.getBlock(x, y, z);
|
||||
|
||||
ForgeDirection direction = ForgeDirection.getOrientation(block.sideHit);
|
||||
int fortune = EnchantmentHelper.getFortuneModifier(player);
|
||||
@@ -85,8 +86,8 @@ public class ItemIchorPickAdv extends ItemIchorPick implements IAdvancedTool {
|
||||
boolean doZ = direction.offsetZ == 0;
|
||||
|
||||
ToolHandler.removeBlocksInIteration(player, world, x, y, z, doX ? -2 : 0, doY ? -1 : 0, doZ ? -2 : 0, doX ? 3 : 1, doY ? 4 : 1, doZ ? 3 : 1, -1, ToolHandler.materialsPick, silk, fortune);
|
||||
if(id==7){
|
||||
world.setBlock(x, y, z, 7);
|
||||
if(blk== Blocks.bedrock){
|
||||
world.setBlock(x, y, z, Blocks.bedrock);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -96,19 +97,16 @@ public class ItemIchorPickAdv extends ItemIchorPick implements IAdvancedTool {
|
||||
int zo = -direction.offsetZ;
|
||||
|
||||
ToolHandler.removeBlocksInIteration(player, world, x, y, z, xo >= 0 ? 0 : -10, yo >= 0 ? 0 : -10, zo >= 0 ? 0 : -10, xo > 0 ? 10 : 1, yo > 0 ? 10 : 1, zo > 0 ? 10 : 1, -1, ToolHandler.materialsPick, silk, fortune);
|
||||
if(id==7){
|
||||
world.setBlock(x, y, z, 7);
|
||||
}
|
||||
if(blk== Blocks.bedrock){
|
||||
world.setBlock(x, y, z, Blocks.bedrock);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item.kami.tool;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -22,8 +24,6 @@ import vazkii.tinkerer.client.core.helper.IconHelper;
|
||||
import vazkii.tinkerer.client.core.proxy.TTClientProxy;
|
||||
import vazkii.tinkerer.common.core.handler.ModCreativeTab;
|
||||
import vazkii.tinkerer.common.item.ModItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemIchorShovel extends ItemSpade {
|
||||
|
||||
@@ -35,7 +35,7 @@ public class ItemIchorShovel extends ItemSpade {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,24 +14,24 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item.kami.tool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.tinkerer.client.core.handler.kami.ToolModeHUDHandler;
|
||||
import vazkii.tinkerer.client.core.helper.IconHelper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemIchorShovelAdv extends ItemIchorShovel implements IAdvancedTool {
|
||||
|
||||
Icon[] specialIcons = new Icon[3];
|
||||
IIcon[] specialIcons = new IIcon[3];
|
||||
|
||||
public ItemIchorShovelAdv() {
|
||||
super();
|
||||
@@ -39,14 +39,14 @@ public class ItemIchorShovelAdv extends ItemIchorShovel implements IAdvancedTool
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
super.registerIcons(par1IconRegister);
|
||||
for(int i = 0; i < specialIcons.length; i++)
|
||||
specialIcons[i] = IconHelper.forItem(par1IconRegister, this, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIconFromDamage(int par1) {
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return par1 >= specialIcons.length ? super.getIconFromDamage(par1) : specialIcons[par1];
|
||||
}
|
||||
|
||||
@@ -63,10 +63,9 @@ public class ItemIchorShovelAdv extends ItemIchorShovel implements IAdvancedTool
|
||||
@Override
|
||||
public boolean onBlockStartBreak(ItemStack stack, int x, int y, int z, EntityPlayer player) {
|
||||
World world = player.worldObj;
|
||||
Material mat = world.getBlockMaterial(x, y, z);
|
||||
Material mat = world.getBlock(x, y, z).getMaterial();
|
||||
if(!ToolHandler.isRightMaterial(mat, ToolHandler.materialsShovel))
|
||||
return false;
|
||||
|
||||
MovingObjectPosition block = ToolHandler.raytraceFromEntity(world, player, true, 4.5);
|
||||
if(block == null)
|
||||
return false;
|
||||
@@ -82,22 +81,19 @@ public class ItemIchorShovelAdv extends ItemIchorShovel implements IAdvancedTool
|
||||
boolean doY = direction.offsetY == 0;
|
||||
boolean doZ = direction.offsetZ == 0;
|
||||
|
||||
ToolHandler.removeBlocksInIteration(player, world, x, y, z, doX ? -2 : 0, doY ? -1 : 0, doZ ? -2 : 0, doX ? 3 : 1, doY ? 4 : 1, doZ ? 3 : 1, -1, ToolHandler.materialsShovel, silk, fortune);
|
||||
ToolHandler.removeBlocksInIteration(player, world, x, y, z, doX ? -2 : 0, doY ? -1 : 0, doZ ? -2 : 0, doX ? 3 : 1, doY ? 4 : 1, doZ ? 3 : 1, null, ToolHandler.materialsShovel, silk, fortune);
|
||||
break;
|
||||
}
|
||||
case 2 : {
|
||||
int id = world.getBlockId(x, y, z);
|
||||
ToolHandler.removeBlocksInIteration(player, world, x, y, z, 0, -8, 0, 1, 8, 1, id, ToolHandler.materialsShovel, silk, fortune);
|
||||
Block blk= world.getBlock(x, y, z);
|
||||
ToolHandler.removeBlocksInIteration(player, world, x, y, z, 0, -8, 0, 1, 8, 1, blk, ToolHandler.materialsShovel, silk, fortune);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item.kami.tool;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemSword;
|
||||
@@ -22,8 +24,6 @@ import vazkii.tinkerer.client.core.helper.IconHelper;
|
||||
import vazkii.tinkerer.client.core.proxy.TTClientProxy;
|
||||
import vazkii.tinkerer.common.core.handler.ModCreativeTab;
|
||||
import vazkii.tinkerer.common.item.ModItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemIchorSword extends ItemSword {
|
||||
|
||||
@@ -34,7 +34,7 @@ public class ItemIchorSword extends ItemSword {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,9 +14,7 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item.kami.tool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -24,15 +22,17 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.tinkerer.client.core.handler.kami.ToolModeHUDHandler;
|
||||
import vazkii.tinkerer.client.core.helper.IconHelper;
|
||||
import vazkii.tinkerer.common.core.handler.kami.SoulHeartHandler;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemIchorSwordAdv extends ItemIchorSword implements IAdvancedTool {
|
||||
|
||||
Icon[] specialIcons = new Icon[3];
|
||||
IIcon[] specialIcons = new IIcon[3];
|
||||
|
||||
public ItemIchorSwordAdv() {
|
||||
super();
|
||||
@@ -40,7 +40,7 @@ public class ItemIchorSwordAdv extends ItemIchorSword implements IAdvancedTool {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister par1IconRegister) {
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
super.registerIcons(par1IconRegister);
|
||||
for(int i = 0; i < specialIcons.length; i++)
|
||||
specialIcons[i] = IconHelper.forItem(par1IconRegister, this, i);
|
||||
@@ -88,7 +88,7 @@ public class ItemIchorSwordAdv extends ItemIchorSword implements IAdvancedTool {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIconFromDamage(int par1) {
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return par1 >= specialIcons.length ? super.getIconFromDamage(par1) : specialIcons[par1];
|
||||
}
|
||||
|
||||
|
||||
@@ -17,18 +17,18 @@ package vazkii.tinkerer.common.item.kami.tool;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.tinkerer.common.block.ModBlocks;
|
||||
import vazkii.tinkerer.common.core.handler.ConfigHandler;
|
||||
import vazkii.tinkerer.common.dim.WorldProviderBedrock;
|
||||
import vazkii.tinkerer.common.lib.LibBlockIDs;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -60,15 +60,13 @@ public final class ToolHandler {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void removeBlocksInIteration(EntityPlayer player, World world, int x, int y, int z, int xs, int ys, int zs, int xe, int ye, int ze, int lockID, Material[] materialsListing, boolean silk, int fortune) {
|
||||
final int blockID = world.getBlockId(x, y, z);
|
||||
final Block block = Block.blocksList[blockID];
|
||||
public static void removeBlocksInIteration(EntityPlayer player, World world, int x, int y, int z, int xs, int ys, int zs, int xe, int ye, int ze, Block block, Material[] materialsListing, boolean silk, int fortune) {
|
||||
float blockHardness = block.getBlockHardness(world, x, y, z);
|
||||
for(int x1 = xs; x1 < xe; x1++){
|
||||
for(int y1 = ys; y1 < ye; y1++){
|
||||
for(int z1 = zs; z1 < ze; z1++){
|
||||
if(x != x1 && y != y1 && z != z1){
|
||||
ToolHandler.removeBlockWithDrops(player, world, x1 + x, y1 + y, z1 + z, x, y, z, lockID, materialsListing, silk, fortune,blockHardness);
|
||||
ToolHandler.removeBlockWithDrops(player, world, x1 + x, y1 + y, z1 + z, x, y, z, block, materialsListing, silk, fortune,blockHardness);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -76,29 +74,28 @@ public final class ToolHandler {
|
||||
}
|
||||
}
|
||||
|
||||
public static void removeBlockWithDrops(EntityPlayer player, World world, int x, int y, int z, int bx, int by, int bz, int lockID, Material[] materialsListing, boolean silk, int fortune,float blockHardness) {
|
||||
public static void removeBlockWithDrops(EntityPlayer player, World world, int x, int y, int z, int bx, int by, int bz, Block block, Material[] materialsListing, boolean silk, int fortune,float blockHardness) {
|
||||
if(!world.blockExists(x, y, z))
|
||||
return;
|
||||
|
||||
int id = world.getBlockId(x, y, z);
|
||||
Block blk = world.getBlock(x, y, z);
|
||||
|
||||
if(lockID != -1 && id != lockID)
|
||||
if(block != null && blk != block)
|
||||
return;
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
Material mat = world.getBlockMaterial(x, y, z);
|
||||
Block block = Block.blocksList[id];
|
||||
if(block != null && !block.isAirBlock(world, x, y, z) && (block.getPlayerRelativeBlockHardness(player, world, x, y, z) != 0)) {
|
||||
Material mat = world.getBlock(x, y, z).getMaterial();
|
||||
if(block != null && !block.isAir(world, x, y, z) && (block.getPlayerRelativeBlockHardness(player, world, x, y, z) != 0)) {
|
||||
List<ItemStack> items = new ArrayList();
|
||||
|
||||
if(!block.canHarvestBlock(player, meta) || !isRightMaterial(mat, materialsListing))
|
||||
return;
|
||||
if(ConfigHandler.bedrockDimensionID != 0 && id==7 && ((world.provider.isSurfaceWorld() && y<5) || (y>253 && world.provider instanceof WorldProviderBedrock))){
|
||||
world.setBlock(x, y, z, LibBlockIDs.idPortal);
|
||||
if(ConfigHandler.bedrockDimensionID != 0 && block== Blocks.bedrock && ((world.provider.isSurfaceWorld() && y<5) || (y>253 && world.provider instanceof WorldProviderBedrock))){
|
||||
world.setBlock(x, y, z, ModBlocks.portal);
|
||||
}
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
int localMeta = world.getBlockMetadata(x, y, z);
|
||||
if (block.removeBlockByPlayer(world, player, x, y, z)) {
|
||||
if (block.removedByPlayer(world, player, x, y, z)) {
|
||||
block.onBlockDestroyedByPlayer(world, x, y, z, localMeta);
|
||||
}
|
||||
block.harvestBlock(world, player, x, y, z, localMeta);
|
||||
@@ -138,7 +135,7 @@ public final class ToolHandler {
|
||||
if (player instanceof EntityPlayerMP)
|
||||
d3 = ((EntityPlayerMP) player).theItemInWorldManager.getBlockReachDistance();
|
||||
Vec3 vec31 = vec3.addVector(f7 * d3, f6 * d3, f8 * d3);
|
||||
return world.rayTraceBlocks_do_do(vec3, vec31, par3, !par3);
|
||||
return world.rayTraceBlocks(vec3, vec31, par3);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,14 +14,15 @@
|
||||
*/
|
||||
package vazkii.tinkerer.common.item.quartz;
|
||||
|
||||
import net.minecraft.block.BlockHalfSlab;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.item.ItemSlab;
|
||||
import vazkii.tinkerer.common.block.ModBlocks;
|
||||
|
||||
public class ItemDarkQuartzSlab extends ItemSlab {
|
||||
|
||||
public ItemDarkQuartzSlab(int par1) {
|
||||
super(par1, (BlockHalfSlab) ModBlocks.darkQuartzSlab, (BlockHalfSlab) ModBlocks.darkQuartzSlabFull, par1 == ModBlocks.darkQuartzSlabFull.blockID);
|
||||
public ItemDarkQuartzSlab(Block par1) {
|
||||
super(par1, (BlockSlab) ModBlocks.darkQuartzSlab, (BlockSlab) ModBlocks.darkQuartzSlabFull, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user