mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 19:05:16 +00:00
Lenses, materials, records, relics, equipment
This commit is contained in:
1 parent
6fb9b0101e
commit
58dbb0f9cf
29 files changed
+114
-155
No files matched your search
@@ -81,8 +81,8 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
|
||||
mapCoords(par1World.provider.dimensionId, par2, par3, par4, 2);
|
||||
}
|
||||
|
||||
public static String getCoordsAsString(int world, int x, int y, int z) {
|
||||
return world + ":" + x + ":" + y + ":" + z;
|
||||
public static String getCoordsAsString(int world, BlockPos pos) {
|
||||
return world + ":" + pos.getX() + ":" + pos.getY() + ":" + pos.getZ();
|
||||
}
|
||||
|
||||
static void mapCoords(int world, int x, int y, int z, int time) {
|
||||
|
||||
@@ -132,7 +132,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
return mb.makeSet();
|
||||
}
|
||||
|
||||
public static boolean spawn(EntityPlayer player, ItemStack par1ItemStack, World par3World, int par4, int par5, int par6, boolean hard) {
|
||||
public static boolean spawn(EntityPlayer player, ItemStack par1ItemStack, World par3World, BlockPos pos, boolean hard) {
|
||||
Block block = par3World.getBlock(par4, par5, par6);
|
||||
if(block == Blocks.beacon && isTruePlayer(player) && !par3World.isRemote) {
|
||||
if(par3World.getDifficulty() == EnumDifficulty.PEACEFUL) {
|
||||
|
||||
@@ -22,7 +22,7 @@ public class ItemBlockElven extends ItemBlockMod implements IElvenItem {
|
||||
|
||||
@Override
|
||||
public boolean isElvenItem(ItemStack stack) {
|
||||
return ((IElvenItem) field_150939_a).isElvenItem(stack);
|
||||
return ((IElvenItem) block).isElvenItem(stack);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -38,12 +38,12 @@ public class ItemBlockMod extends ItemBlock implements IPickupAchievement, ICraf
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
|
||||
return field_150939_a instanceof ICraftAchievement ? ((ICraftAchievement) field_150939_a).getAchievementOnCraft(stack, player, matrix) : null;
|
||||
return block instanceof ICraftAchievement ? ((ICraftAchievement) block).getAchievementOnCraft(stack, player, matrix) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnPickup(ItemStack stack, EntityPlayer player, EntityItem item) {
|
||||
return field_150939_a instanceof IPickupAchievement ? ((IPickupAchievement) field_150939_a).getAchievementOnPickup(stack, player, item) : null;
|
||||
return block instanceof IPickupAchievement ? ((IPickupAchievement) block).getAchievementOnPickup(stack, player, item) : null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,12 +18,12 @@ import vazkii.botania.common.block.decor.slabs.BlockModSlab;
|
||||
public class ItemBlockModSlab extends ItemSlab {
|
||||
|
||||
public ItemBlockModSlab(Block par1) {
|
||||
super(par1, ((BlockModSlab)par1).getSingleBlock(), ((BlockModSlab)par1).getFullBlock(), false);
|
||||
super(par1, ((BlockModSlab)par1).getSingleBlock(), ((BlockModSlab)par1).getFullBlock());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
return field_150939_a.getUnlocalizedName().replaceAll("tile.", "tile.botania:");
|
||||
return block.getUnlocalizedName().replaceAll("tile.", "tile.botania:");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,6 +23,6 @@ public class ItemBlockSpecialQuartz extends ItemMultiTexture {
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
return par1ItemStack.getItemDamage() >= 3 ? "" : ((BlockSpecialQuartz) field_150939_a).getNames()[par1ItemStack.getItemDamage()];
|
||||
return par1ItemStack.getItemDamage() >= 3 ? "" : ((BlockSpecialQuartz) block).getNames()[par1ItemStack.getItemDamage()];
|
||||
}
|
||||
}
|
||||
@@ -14,17 +14,17 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemBlockWithMetadata;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.achievement.ICraftAchievement;
|
||||
import vazkii.botania.common.achievement.IPickupAchievement;
|
||||
|
||||
public class ItemBlockWithMetadataAndName extends ItemBlockWithMetadata implements IPickupAchievement, ICraftAchievement {
|
||||
// todo 1.8 revalidate this (used to extend ItemBlockWithMetadata which got removed)
|
||||
public class ItemBlockWithMetadataAndName extends ItemBlock implements IPickupAchievement, ICraftAchievement {
|
||||
|
||||
public ItemBlockWithMetadataAndName(Block par2Block) {
|
||||
super(par2Block, par2Block);
|
||||
super(par2Block);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -39,12 +39,12 @@ public class ItemBlockWithMetadataAndName extends ItemBlockWithMetadata implemen
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnCraft(ItemStack stack, EntityPlayer player, IInventory matrix) {
|
||||
return field_150939_a instanceof ICraftAchievement ? ((ICraftAchievement) field_150939_a).getAchievementOnCraft(stack, player, matrix) : null;
|
||||
return block instanceof ICraftAchievement ? ((ICraftAchievement) block).getAchievementOnCraft(stack, player, matrix) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Achievement getAchievementOnPickup(ItemStack stack, EntityPlayer player, EntityItem item) {
|
||||
return field_150939_a instanceof IPickupAchievement ? ((IPickupAchievement) field_150939_a).getAchievementOnPickup(stack, player, item) : null;
|
||||
return block instanceof IPickupAchievement ? ((IPickupAchievement) block).getAchievementOnPickup(stack, player, item) : null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,7 +13,6 @@ package vazkii.botania.common.item.brew;
|
||||
import java.awt.Color;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -24,7 +23,6 @@ import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
@@ -69,7 +67,7 @@ public abstract class ItemBrewBase extends ItemMod implements IBrewItem, IPickup
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack p_77661_1_) {
|
||||
return EnumAction.drink;
|
||||
return EnumAction.DRINK;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,13 +77,13 @@ public abstract class ItemBrewBase extends ItemMod implements IBrewItem, IPickup
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onEaten(ItemStack stack, World world, EntityPlayer player) {
|
||||
public ItemStack onItemUseFinish(ItemStack stack, World world, EntityPlayer player) {
|
||||
if(!world.isRemote) {
|
||||
for(PotionEffect effect : getBrew(stack).getPotionEffects(stack)) {
|
||||
PotionEffect newEffect = new PotionEffect(effect.getPotionID(), effect.getDuration(), effect.getAmplifier(), true);
|
||||
PotionEffect newEffect = new PotionEffect(effect.getPotionID(), effect.getDuration(), effect.getAmplifier(), true, true);
|
||||
Potion potion = Potion.potionTypes[newEffect.getPotionID()];
|
||||
if(potion.isInstant())
|
||||
potion.affectEntity(player, player, newEffect.getAmplifier(), 1F);
|
||||
potion.affectEntity(player, player, player, newEffect.getAmplifier(), 1F);
|
||||
else player.addPotionEffect(newEffect);
|
||||
}
|
||||
|
||||
@@ -127,11 +125,6 @@ public abstract class ItemBrewBase extends ItemMod implements IBrewItem, IPickup
|
||||
icons[i] = IconHelper.forName(par1IconRegister, texName + "1_" + i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int pass) {
|
||||
return pass == 0 ? itemIcon : icons[Math.max(0, Math.min(icons.length - 1, swigs - getSwigsLeft(stack)))];
|
||||
|
||||
@@ -13,7 +13,6 @@ package vazkii.botania.common.item.brew;
|
||||
import java.awt.Color;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -21,7 +20,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.brew.Brew;
|
||||
@@ -62,11 +60,6 @@ public class ItemIncenseStick extends ItemMod implements IBrewItem, IBrewContain
|
||||
icons[i] = IconHelper.forItem(par1IconRegister, this, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int pass) {
|
||||
return icons[pass];
|
||||
@@ -103,7 +96,7 @@ public class ItemIncenseStick extends ItemMod implements IBrewItem, IBrewContain
|
||||
for(PotionEffect effect : brew.getPotionEffects(stack)) {
|
||||
Potion potion = Potion.potionTypes[effect.getPotionID()];
|
||||
EnumChatFormatting format = potion.isBadEffect() ? EnumChatFormatting.RED : EnumChatFormatting.GRAY;
|
||||
PotionEffect longEffect = new PotionEffect(effect.getPotionID(), effect.getDuration() * TIME_MULTIPLIER, effect.getAmplifier(), false);
|
||||
PotionEffect longEffect = new PotionEffect(effect.getPotionID(), effect.getDuration() * TIME_MULTIPLIER, effect.getAmplifier(), false, true);
|
||||
addStringToTooltip(" " + format + StatCollector.translateToLocal(effect.getEffectName()) + (effect.getAmplifier() == 0 ? "" : " " + StatCollector.translateToLocal("botania.roman" + (effect.getAmplifier() + 1))) + EnumChatFormatting.GRAY + (potion.isInstant() ? "" : " (" + Potion.getDurationString(longEffect) + ")"), list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,11 +12,9 @@ package vazkii.botania.common.item.brew;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import vazkii.botania.api.brew.Brew;
|
||||
import vazkii.botania.api.brew.IBrewContainer;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -153,11 +154,6 @@ public class ItemLens extends ItemMod implements ILens, ITinyPlanetExcempt {
|
||||
par3List.add(new ItemStack(par1, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIconFromDamageForRenderPass(int par1, int par2) {
|
||||
return par2 == 1 ? ringIcons[Math.min(SUBTYPES - 1, par1)] : iconGlass;
|
||||
@@ -249,8 +245,7 @@ public class ItemLens extends ItemMod implements ILens, ITinyPlanetExcempt {
|
||||
if(storedColor == 16)
|
||||
return Color.HSBtoRGB(Botania.proxy.getWorldElapsedTicks() * 2 % 360 / 360F, 1F, 1F);
|
||||
|
||||
float[] color = EntitySheep.fleeceColorTable[storedColor];
|
||||
return new Color(color[0], color[1], color[2]).getRGB();
|
||||
return EnumDyeColor.byMetadata(storedColor).getMapColor().colorValue;
|
||||
}
|
||||
|
||||
public static int getStoredColor(ItemStack stack) {
|
||||
|
||||
@@ -13,8 +13,8 @@ package vazkii.botania.common.item.lens;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
|
||||
@@ -24,10 +24,10 @@ public class LensBounce extends Lens {
|
||||
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
|
||||
if(!isManaBlock && pos.entityHit == null) {
|
||||
BlockPos coords = burst.getBurstSourceBlockPos();
|
||||
if(coords.posX != pos.blockX || coords.posY != pos.blockY || coords.posZ != pos.blockZ) {
|
||||
if(!coords.equals(pos.getBlockPos())) {
|
||||
Vector3 currentMovementVec = new Vector3(entity.motionX, entity.motionY, entity.motionZ);
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(pos.sideHit);
|
||||
Vector3 normalVector = new Vector3(dir.offsetX, dir.offsetY, dir.offsetZ).normalize();
|
||||
EnumFacing dir = pos.sideHit;
|
||||
Vector3 normalVector = new Vector3(dir.getFrontOffsetX(), dir.getFrontOffsetY(), dir.getFrontOffsetZ()).normalize();
|
||||
Vector3 movementVec = normalVector.multiply(-2 * currentMovementVec.dotProduct(normalVector)).add(currentMovementVec);
|
||||
|
||||
burst.setMotion(movementVec.x, movementVec.y, movementVec.z);
|
||||
|
||||
@@ -23,7 +23,7 @@ public class LensExplosive extends Lens {
|
||||
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
|
||||
if(!burst.isFake()) {
|
||||
BlockPos coords = burst.getBurstSourceBlockPos();
|
||||
if(!entity.worldObj.isRemote && pos.entityHit == null && !isManaBlock && (pos.blockX != coords.posX || pos.blockY != coords.posY || pos.blockZ != coords.posZ))
|
||||
if(!entity.worldObj.isRemote && pos.entityHit == null && !isManaBlock && !coords.equals(pos.getBlockPos()))
|
||||
entity.worldObj.createExplosion(entity, entity.posX, entity.posY, entity.posZ, burst.getMana() / 50F, true);
|
||||
} else dead = false;
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TileIncensePlate;
|
||||
@@ -26,23 +26,21 @@ public class LensFire extends Lens {
|
||||
@Override
|
||||
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
|
||||
BlockPos coords = burst.getBurstSourceBlockPos();
|
||||
if((coords.posX != pos.blockX || coords.posY != pos.blockY || coords.posZ != pos.blockZ) && !burst.isFake() && !isManaBlock) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(pos.sideHit);
|
||||
if(!coords.equals(pos.getBlockPos()) && !burst.isFake() && !isManaBlock) {
|
||||
EnumFacing dir = pos.sideHit;
|
||||
|
||||
int x = pos.blockX + dir.offsetX;
|
||||
int y = pos.blockY + dir.offsetY;
|
||||
int z = pos.blockZ + dir.offsetZ;
|
||||
BlockPos pos_ = pos.getBlockPos().offset(dir);
|
||||
|
||||
Block blockAt = entity.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ);
|
||||
Block blockAt_ = entity.worldObj.getBlock(x, y, z);
|
||||
Block blockAt = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock();
|
||||
Block blockAt_ = entity.worldObj.getBlockState(pos_).getBlock();
|
||||
|
||||
if(blockAt == Blocks.portal)
|
||||
entity.worldObj.setBlock(pos.blockX, pos.blockY, pos.blockZ, Blocks.air);
|
||||
entity.worldObj.setBlockState(pos.getBlockPos(), Blocks.air.getDefaultState());
|
||||
else if(blockAt == ModBlocks.incensePlate) {
|
||||
TileIncensePlate plate = (TileIncensePlate) entity.worldObj.getTileEntity(pos.blockX, pos.blockY, pos.blockZ);
|
||||
TileIncensePlate plate = (TileIncensePlate) entity.worldObj.getTileEntity(pos.getBlockPos());
|
||||
plate.ignite();
|
||||
} else if(blockAt_.isAir(entity.worldObj, x, y, z))
|
||||
entity.worldObj.setBlock(x, y, z, Blocks.fire);
|
||||
} else if(blockAt_.isAir(entity.worldObj, pos_))
|
||||
entity.worldObj.setBlockState(pos_, Blocks.fire.getDefaultState());
|
||||
}
|
||||
|
||||
return dead;
|
||||
|
||||
@@ -17,7 +17,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TileManaFlame;
|
||||
@@ -27,21 +26,17 @@ public class LensLight extends Lens {
|
||||
@Override
|
||||
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
|
||||
BlockPos coords = burst.getBurstSourceBlockPos();
|
||||
if((coords.posX != pos.blockX || coords.posY != pos.blockY || coords.posZ != pos.blockZ) && !burst.isFake() && !isManaBlock) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(pos.sideHit);
|
||||
if(!coords.equals(pos.getBlockPos()) && !burst.isFake() && !isManaBlock) {
|
||||
BlockPos pos_ = pos.getBlockPos().offset(pos.sideHit);
|
||||
|
||||
int x = pos.blockX + dir.offsetX;
|
||||
int y = pos.blockY + dir.offsetY;
|
||||
int z = pos.blockZ + dir.offsetZ;
|
||||
|
||||
Block blockAt = entity.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ);
|
||||
Block blockAt_ = entity.worldObj.getBlock(x, y, z);
|
||||
Block blockAt = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock();
|
||||
Block blockAt_ = entity.worldObj.getBlockState(pos_).getBlock();
|
||||
|
||||
if(blockAt == ModBlocks.manaFlame)
|
||||
entity.worldObj.setBlock(pos.blockX, pos.blockY, pos.blockZ, Blocks.air);
|
||||
else if(blockAt_.isAir(entity.worldObj, x, y, z) || blockAt_.isReplaceable(entity.worldObj, x, y, z)) {
|
||||
entity.worldObj.setBlock(x, y, z, ModBlocks.manaFlame);
|
||||
TileEntity tile = entity.worldObj.getTileEntity(x, y, z);
|
||||
entity.worldObj.setBlockState(pos.getBlockPos(), Blocks.air.getDefaultState());
|
||||
else if(blockAt_.isAir(entity.worldObj, pos_) || blockAt_.isReplaceable(entity.worldObj, pos_)) {
|
||||
entity.worldObj.setBlockState(pos_, ModBlocks.manaFlame.getDefaultState());
|
||||
TileEntity tile = entity.worldObj.getTileEntity(pos_);
|
||||
|
||||
if(tile instanceof TileManaFlame)
|
||||
((TileManaFlame) tile).setColor(burst.getColor());
|
||||
|
||||
@@ -14,6 +14,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.init.Blocks;
|
||||
@@ -33,10 +34,8 @@ public class LensMine extends Lens {
|
||||
@Override
|
||||
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
|
||||
World world = entity.worldObj;
|
||||
int x = pos.blockX;
|
||||
int y = pos.blockY;
|
||||
int z = pos.blockZ;
|
||||
Block block = world.getBlock(x, y, z);
|
||||
BlockPos pos_ = pos.getBlockPos();
|
||||
Block block = world.getBlockState(pos_).getBlock();
|
||||
|
||||
ItemStack composite = ((ItemLens) ModItems.lens).getCompositeLens(stack);
|
||||
boolean warp = composite != null && composite.getItem() == ModItems.lens && composite.getItemDamage() == ItemLens.WARP;
|
||||
@@ -44,29 +43,29 @@ public class LensMine extends Lens {
|
||||
if(warp && (block == ModBlocks.pistonRelay || block == Blocks.piston || block == Blocks.piston_extension || block == Blocks.piston_head))
|
||||
return false;
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
TileEntity tile = world.getTileEntity(pos_);
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
float hardness = block.getBlockHardness(world, x, y, z);
|
||||
IBlockState state = world.getBlockState(pos_);
|
||||
float hardness = block.getBlockHardness(world, pos_);
|
||||
int mana = burst.getMana();
|
||||
|
||||
BlockPos coords = burst.getBurstSourceBlockPos();
|
||||
if((coords.posX != x || coords.posY != y || coords.posZ != z) && !(tile instanceof IManaBlock) && block != null && hardness != -1 && hardness < 50F && (burst.isFake() || mana >= 24)) {
|
||||
if(!coords.equals(pos.getBlockPos()) && !(tile instanceof IManaBlock) && block != null && hardness != -1 && hardness < 50F && (burst.isFake() || mana >= 24)) {
|
||||
List<ItemStack> items = new ArrayList();
|
||||
|
||||
items.addAll(block.getDrops(world, x, y, z, meta, 0));
|
||||
items.addAll(block.getDrops(world, pos_, world.getBlockState(pos_), 0));
|
||||
|
||||
if(!burst.hasAlreadyCollidedAt(x)) {
|
||||
if(!burst.hasAlreadyCollidedAt(pos_)) {
|
||||
if(!burst.isFake() && !entity.worldObj.isRemote) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
world.setBlockToAir(pos_);
|
||||
if(ConfigHandler.blockBreakParticles)
|
||||
entity.worldObj.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(block) + (meta << 12));
|
||||
entity.worldObj.playAuxSFX(2001, pos_, Block.getStateId(state));
|
||||
|
||||
boolean offBounds = coords.posY < 0;
|
||||
boolean offBounds = coords.getY() < 0;
|
||||
boolean doWarp = warp && !offBounds;
|
||||
int dropX = doWarp ? coords.posX : x;
|
||||
int dropY = doWarp ? coords.posY : y;
|
||||
int dropZ = doWarp ? coords.posZ : z;
|
||||
int dropX = doWarp ? coords.getX() : pos_.getX();
|
||||
int dropY = doWarp ? coords.getY() : pos_.getY();
|
||||
int dropZ = doWarp ? coords.getZ() : pos_.getZ();
|
||||
|
||||
for(ItemStack stack_ : items)
|
||||
world.spawnEntityInWorld(new EntityItem(world, dropX + 0.5, dropY + 0.5, dropZ + 0.5, stack_));
|
||||
|
||||
@@ -10,14 +10,13 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.lens;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
|
||||
public class LensPiston extends Lens {
|
||||
@@ -25,21 +24,16 @@ public class LensPiston extends Lens {
|
||||
@Override
|
||||
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
|
||||
BlockPos coords = burst.getBurstSourceBlockPos();
|
||||
if((coords.posX != pos.blockX || coords.posY != pos.blockY || coords.posZ != pos.blockZ) && !burst.isFake() && !isManaBlock && !entity.worldObj.isRemote) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(pos.sideHit).getOpposite();
|
||||
int x = pos.blockX + dir.offsetX;
|
||||
int y = pos.blockY + dir.offsetY;
|
||||
int z = pos.blockZ + dir.offsetZ;
|
||||
if(!coords.equals(pos.getBlockPos()) && !burst.isFake() && !isManaBlock && !entity.worldObj.isRemote) {
|
||||
BlockPos pos_ = pos.getBlockPos().offset(pos.sideHit);
|
||||
|
||||
if(entity.worldObj.isAirBlock(x, y, z) || entity.worldObj.getBlock(x, y, z).isReplaceable(entity.worldObj, x, y, z)) {
|
||||
Block block = entity.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ);
|
||||
int meta = entity.worldObj.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ);
|
||||
TileEntity tile = entity.worldObj.getTileEntity(pos.blockX, pos.blockY, pos.blockZ);
|
||||
if(entity.worldObj.isAirBlock(pos_) || entity.worldObj.getBlockState(pos_).getBlock().isReplaceable(entity.worldObj, pos_)) {
|
||||
IBlockState state = entity.worldObj.getBlockState(pos_);
|
||||
TileEntity tile = entity.worldObj.getTileEntity(pos_);
|
||||
|
||||
if(block.getMobilityFlag() == 0 && block != Blocks.obsidian && block.getBlockHardness(entity.worldObj, pos.blockX, pos.blockY, pos.blockZ) >= 0 && tile == null) {
|
||||
entity.worldObj.setBlockToAir(pos.blockX, pos.blockY, pos.blockZ);
|
||||
entity.worldObj.setBlock(x, y, z, block, meta, 1 | 2);
|
||||
entity.worldObj.playAuxSFX(2001, pos.blockX, pos.blockY, pos.blockZ, Block.getIdFromBlock(block) + (meta << 12));
|
||||
if(state.getBlock().getMobilityFlag() == 0 && state.getBlock() != Blocks.obsidian && state.getBlock().getBlockHardness(entity.worldObj, pos_) >= 0 && tile == null) {
|
||||
entity.worldObj.destroyBlock(pos.getBlockPos(), false);
|
||||
entity.worldObj.setBlockState(pos_, state, 1 | 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ public class LensStorm extends Lens {
|
||||
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
|
||||
if(!burst.isFake()) {
|
||||
BlockPos coords = burst.getBurstSourceBlockPos();
|
||||
if(!entity.worldObj.isRemote && pos.entityHit == null && !isManaBlock && (pos.blockX != coords.posX || pos.blockY != coords.posY || pos.blockZ != coords.posZ))
|
||||
if(!entity.worldObj.isRemote && pos.entityHit == null && !isManaBlock && !coords.equals(pos.getBlockPos()))
|
||||
entity.worldObj.createExplosion(entity, entity.posX, entity.posY, entity.posZ, 5F, true);
|
||||
} else dead = false;
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ package vazkii.botania.common.item.lens;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
import vazkii.botania.common.block.BlockPistonRelay;
|
||||
@@ -25,15 +26,15 @@ public class LensWarp extends Lens {
|
||||
if(burst.isFake())
|
||||
return dead;
|
||||
|
||||
Block block = entity.worldObj.getBlock(pos.blockX, pos.blockY, pos.blockZ);
|
||||
Block block = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock();
|
||||
if(block == ModBlocks.pistonRelay) {
|
||||
String key = BlockPistonRelay.mappedPositions.get(BlockPistonRelay.getCoordsAsString(entity.worldObj.provider.dimensionId, pos.blockX, pos.blockY, pos.blockZ));
|
||||
String key = BlockPistonRelay.mappedPositions.get(BlockPistonRelay.getCoordsAsString(entity.worldObj.provider.getDimensionId(), pos.getBlockPos()));
|
||||
if(key != null) {
|
||||
String[] tokens = key.split(":");
|
||||
int worldId = Integer.parseInt(tokens[0]), x = Integer.parseInt(tokens[1]), y = Integer.parseInt(tokens[2]), z = Integer.parseInt(tokens[3]);
|
||||
if(worldId == entity.worldObj.provider.dimensionId) {
|
||||
if(worldId == entity.worldObj.provider.getDimensionId()) {
|
||||
entity.setPosition(x + 0.5, y + 0.5, z + 0.5);
|
||||
burst.setCollidedAt(x);
|
||||
burst.setCollidedAt(pos.getBlockPos());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,14 +22,10 @@ public class LensWeight extends Lens {
|
||||
@Override
|
||||
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
|
||||
if(!burst.isFake()) {
|
||||
int x = pos.blockX;
|
||||
int y = pos.blockY;
|
||||
int z = pos.blockZ;
|
||||
Block block = entity.worldObj.getBlock(x, y, z);
|
||||
Block blockBelow = entity.worldObj.getBlock(x, y - 1, z);
|
||||
int meta = entity.worldObj.getBlockMetadata(x, y, z);
|
||||
if(blockBelow.isAir(entity.worldObj, x, y - 1, z) && block.getBlockHardness(entity.worldObj, x, y, z) != -1 && entity.worldObj.getTileEntity(x, y, z) == null && block.canSilkHarvest(entity.worldObj, null, x, y, z, meta)) {
|
||||
EntityFallingBlock falling = new EntityFallingBlock(entity.worldObj, x + 0.5, y + 0.5, z + 0.5, block, meta);
|
||||
Block block = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock();
|
||||
Block blockBelow = entity.worldObj.getBlockState(pos.getBlockPos().down()).getBlock();
|
||||
if(blockBelow.isAir(entity.worldObj, pos.getBlockPos().down()) && block.getBlockHardness(entity.worldObj, pos.getBlockPos()) != -1 && entity.worldObj.getTileEntity(pos.getBlockPos()) == null && block.canSilkHarvest(entity.worldObj, pos.getBlockPos(), entity.worldObj.getBlockState(pos.getBlockPos()), null)) {
|
||||
EntityFallingBlock falling = new EntityFallingBlock(entity.worldObj, pos.getBlockPos().getX() + 0.5, pos.getBlockPos().getY() + 0.5, pos.getBlockPos().getZ() + 0.5, entity.worldObj.getBlockState(pos.getBlockPos()));
|
||||
if(!entity.worldObj.isRemote)
|
||||
entity.worldObj.spawnEntityInWorld(falling);
|
||||
}
|
||||
|
||||
@@ -16,8 +16,11 @@ import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.internal.VanillaPacketDispatcher;
|
||||
import vazkii.botania.api.item.IDyablePool;
|
||||
@@ -33,12 +36,9 @@ public class ItemDye extends Item16Colors implements IManaDissolvable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
|
||||
Block block = par3World.getBlock(par4, par5, par6);
|
||||
int meta = par1ItemStack.getItemDamage();
|
||||
if(meta != par3World.getBlockMetadata(par4, par5, par6) && (block == Blocks.wool || block == Blocks.carpet)) {
|
||||
par3World.setBlockMetadataWithNotify(par4, par5, par6, meta, 1 | 2);
|
||||
par1ItemStack.stackSize--;
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumFacing side, float par8, float par9, float par10) {
|
||||
if (par3World.getBlockState(pos).getBlock().recolorBlock(par3World, pos, side, EnumDyeColor.byMetadata(par1ItemStack.getItemDamage()))) {
|
||||
par1ItemStack.stackSize--; // todo 1.8 recheck ^^
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -53,7 +53,7 @@ public class ItemDye extends Item16Colors implements IManaDissolvable {
|
||||
if(meta != dyable.getColor()) {
|
||||
dyable.setColor(meta);
|
||||
stack.stackSize--;
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(item.worldObj, , tile.xCoord);
|
||||
VanillaPacketDispatcher.dispatchTEToNearbyPlayers(item.worldObj, tile.getPos());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@ public class ItemDye extends Item16Colors implements IManaDissolvable {
|
||||
public boolean itemInteractionForEntity(ItemStack p_111207_1_, EntityPlayer p_111207_2_, EntityLivingBase p_111207_3_) {
|
||||
if(p_111207_3_ instanceof EntitySheep) {
|
||||
EntitySheep entitysheep = (EntitySheep)p_111207_3_;
|
||||
int i = p_111207_1_.getItemDamage();
|
||||
EnumDyeColor i = EnumDyeColor.byMetadata(p_111207_1_.getItemDamage());
|
||||
|
||||
if(!entitysheep.getSheared() && entitysheep.getFleeceColor() != i) {
|
||||
entitysheep.setFleeceColor(i);
|
||||
|
||||
@@ -13,7 +13,6 @@ package vazkii.botania.common.item.material;
|
||||
import java.awt.Color;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -22,7 +21,8 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -67,7 +67,7 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
|
||||
boolean rightEvent = event.action == Action.RIGHT_CLICK_AIR;
|
||||
ItemStack stack = event.entityPlayer.getCurrentEquippedItem();
|
||||
boolean correctStack = stack != null && stack.getItem() == Items.glass_bottle;
|
||||
boolean ender = event.world.provider.dimensionId == 1;
|
||||
boolean ender = event.world.provider.getDimensionId() == 1;
|
||||
|
||||
if(rightEvent && correctStack && ender) {
|
||||
MovingObjectPosition pos = ToolCommons.raytraceFromEntity(event.world, event.entityPlayer, false, 5F);
|
||||
@@ -91,17 +91,17 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumFacing side, float par8, float par9, float par10) {
|
||||
if(par1ItemStack.getItemDamage() == 4 || par1ItemStack.getItemDamage() == 14)
|
||||
return EntityDoppleganger.spawn(par2EntityPlayer, par1ItemStack, par3World, par4, par5, par6, par1ItemStack.getItemDamage() == 14);
|
||||
else if(par1ItemStack.getItemDamage() == 20 && net.minecraft.item.ItemDye.applyBonemeal(par1ItemStack, par3World, par4, par5, par6, par2EntityPlayer)) {
|
||||
return EntityDoppleganger.spawn(par2EntityPlayer, par1ItemStack, par3World, pos, par1ItemStack.getItemDamage() == 14);
|
||||
else if(par1ItemStack.getItemDamage() == 20 && net.minecraft.item.ItemDye.applyBonemeal(par1ItemStack, par3World, pos, par2EntityPlayer)) {
|
||||
if(!par3World.isRemote)
|
||||
par3World.playAuxSFX(2005, par4, par5, par6, 0);
|
||||
par3World.playAuxSFX(2005, pos, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
return super.onItemUse(par1ItemStack, par2EntityPlayer, par3World, pos, side, par8, par9, par10);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,9 +23,4 @@ public class ItemPestleAndMortar extends ItemMod {
|
||||
setUnlocalizedName(LibItemNames.PESTLE_AND_MORTAR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesContainerItemLeaveCraftingGrid(ItemStack par1ItemStack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,6 +13,8 @@ package vazkii.botania.common.item.material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.recipe.IFlowerComponent;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
@@ -26,9 +28,9 @@ public class ItemPetal extends Item16Colors implements IFlowerComponent {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) {
|
||||
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumFacing side, float par8, float par9, float par10) {
|
||||
ItemStack stackToPlace = new ItemStack(ModBlocks.buriedPetals, 1, par1ItemStack.getItemDamage());
|
||||
stackToPlace.tryPlaceItemIntoWorld(par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
stackToPlace.onItemUse(par2EntityPlayer, par3World, pos, side, par8, par9, par10);
|
||||
|
||||
if(stackToPlace.stackSize == 0) {
|
||||
if(!par2EntityPlayer.capabilities.isCreativeMode)
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
*/
|
||||
package vazkii.botania.common.item.record;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemRecord;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -94,7 +94,7 @@ public class ItemDice extends ItemRelic {
|
||||
Item item = relicStacks[relic].getItem();
|
||||
IRelic irelic = (IRelic) item;
|
||||
Achievement achievement = irelic.getBindAchievement();
|
||||
return mpPlayer.func_147099_x().hasAchievementUnlocked(achievement);
|
||||
return mpPlayer.getStatFile().hasAchievementUnlocked(achievement);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.item.EnumAction;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.mana.IManaUsingItem;
|
||||
import vazkii.botania.api.mana.ManaItemHandler;
|
||||
@@ -38,21 +39,21 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs
|
||||
private static final String TAG_DIMENSION = "dim";
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
if(player.isSneaking()) {
|
||||
if(world.isRemote) {
|
||||
player.swingItem();
|
||||
for(int i = 0; i < 10; i++) {
|
||||
float x1 = (float) (x + Math.random());
|
||||
float y1 = y + 1;
|
||||
float z1 = (float) (z + Math.random());
|
||||
float x1 = (float) (pos.getX() + Math.random());
|
||||
float y1 = pos.getY() + 1;
|
||||
float z1 = (float) (pos.getZ() + Math.random());
|
||||
Botania.proxy.wispFX(player.worldObj, x1, y1, z1, (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random() * 0.5F, -0.05F + (float) Math.random() * 0.05F);
|
||||
}
|
||||
} else {
|
||||
ItemNBTHelper.setInt(stack, TAG_X, x);
|
||||
ItemNBTHelper.setInt(stack, TAG_Y, y);
|
||||
ItemNBTHelper.setInt(stack, TAG_Z, z);
|
||||
ItemNBTHelper.setInt(stack, TAG_DIMENSION, world.provider.dimensionId);
|
||||
ItemNBTHelper.setInt(stack, TAG_X, pos.getX());
|
||||
ItemNBTHelper.setInt(stack, TAG_Y, pos.getY());
|
||||
ItemNBTHelper.setInt(stack, TAG_Z, pos.getZ());
|
||||
ItemNBTHelper.setInt(stack, TAG_DIMENSION, world.provider.getDimensionId());
|
||||
world.playSoundAtEntity(player, "mob.endermen.portal", 1F, 5F);
|
||||
}
|
||||
}
|
||||
@@ -75,7 +76,7 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onEaten(ItemStack stack, World world, EntityPlayer player) {
|
||||
public ItemStack onItemUseFinish(ItemStack stack, World world, EntityPlayer player) {
|
||||
int x = ItemNBTHelper.getInt(stack, TAG_X, 0);
|
||||
int y = ItemNBTHelper.getInt(stack, TAG_Y, -1);
|
||||
int z = ItemNBTHelper.getInt(stack, TAG_Z, 0);
|
||||
@@ -83,7 +84,7 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs
|
||||
|
||||
int cost = (int) (MathHelper.pointDistanceSpace(x + 0.5, y + 0.5, z + 0.5, player.posX, player.posY, player.posZ) * 10);
|
||||
|
||||
if(y > -1 && dim == world.provider.dimensionId && ManaItemHandler.requestManaExact(stack, player, cost, true)) {
|
||||
if(y > -1 && dim == world.provider.getDimensionId() && ManaItemHandler.requestManaExact(stack, player, cost, true)) {
|
||||
moveParticlesAndSound(player);
|
||||
if(player instanceof EntityPlayerMP && !world.isRemote)
|
||||
((EntityPlayerMP) player).playerNetServerHandler.setPlayerLocation(x + 0.5, y + 1.6, z + 0.5, player.rotationYaw, player.rotationPitch);
|
||||
@@ -111,7 +112,7 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
|
||||
return EnumAction.block;
|
||||
return EnumAction.BLOCK;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -40,7 +40,7 @@ public class ItemInfiniteFruit extends ItemRelic implements IManaUsingItem {
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack p_77661_1_) {
|
||||
return isBoot(p_77661_1_) ? EnumAction.drink : EnumAction.eat;
|
||||
return isBoot(p_77661_1_) ? EnumAction.DRINK : EnumAction.EAT;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -106,7 +106,7 @@ public class ItemKingKey extends ItemRelic implements IManaUsingItem {
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction(ItemStack par1ItemStack) {
|
||||
return EnumAction.bow;
|
||||
return EnumAction.BOW;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user