本文整理汇总了Java中net.minecraft.util.EnumMovingObjectType类的典型用法代码示例。如果您正苦于以下问题:Java EnumMovingObjectType类的具体用法?Java EnumMovingObjectType怎么用?Java EnumMovingObjectType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EnumMovingObjectType类属于net.minecraft.util包,在下文中一共展示了EnumMovingObjectType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: func_77659_a
import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
public ItemStack func_77659_a(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
MovingObjectPosition var4 = this.func_77621_a(p_77659_2_, p_77659_3_, false);
if(var4 != null && var4.field_72313_a == EnumMovingObjectType.TILE) {
int var5 = p_77659_2_.func_72798_a(var4.field_72311_b, var4.field_72312_c, var4.field_72309_d);
if(var5 == Block.field_72104_bI.field_71990_ca) {
return p_77659_1_;
}
}
if(!p_77659_2_.field_72995_K) {
ChunkPosition var7 = p_77659_2_.func_72946_b("Stronghold", (int)p_77659_3_.field_70165_t, (int)p_77659_3_.field_70163_u, (int)p_77659_3_.field_70161_v);
if(var7 != null) {
EntityEnderEye var6 = new EntityEnderEye(p_77659_2_, p_77659_3_.field_70165_t, p_77659_3_.field_70163_u + 1.62D - (double)p_77659_3_.field_70129_M, p_77659_3_.field_70161_v);
var6.func_70220_a((double)var7.field_76930_a, var7.field_76928_b, (double)var7.field_76929_c);
p_77659_2_.func_72838_d(var6);
p_77659_2_.func_72956_a(p_77659_3_, "random.bow", 0.5F, 0.4F / (field_77697_d.nextFloat() * 0.4F + 0.8F));
p_77659_2_.func_72889_a((EntityPlayer)null, 1002, (int)p_77659_3_.field_70165_t, (int)p_77659_3_.field_70163_u, (int)p_77659_3_.field_70161_v, 0);
if(!p_77659_3_.field_71075_bZ.field_75098_d) {
--p_77659_1_.field_77994_a;
}
}
}
return p_77659_1_;
}
示例2: func_72731_b
import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
public void func_72731_b(EntityPlayer p_72731_1_, MovingObjectPosition p_72731_2_, int p_72731_3_, float p_72731_4_) {
if(p_72731_3_ == 0 && p_72731_2_.field_72313_a == EnumMovingObjectType.TILE) {
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F);
GL11.glLineWidth(2.0F);
GL11.glDisable(3553);
GL11.glDepthMask(false);
float var5 = 0.002F;
int var6 = this.field_72769_h.func_72798_a(p_72731_2_.field_72311_b, p_72731_2_.field_72312_c, p_72731_2_.field_72309_d);
if(var6 > 0) {
Block.field_71973_m[var6].func_71902_a(this.field_72769_h, p_72731_2_.field_72311_b, p_72731_2_.field_72312_c, p_72731_2_.field_72309_d);
double var7 = p_72731_1_.field_70142_S + (p_72731_1_.field_70165_t - p_72731_1_.field_70142_S) * (double)p_72731_4_;
double var9 = p_72731_1_.field_70137_T + (p_72731_1_.field_70163_u - p_72731_1_.field_70137_T) * (double)p_72731_4_;
double var11 = p_72731_1_.field_70136_U + (p_72731_1_.field_70161_v - p_72731_1_.field_70136_U) * (double)p_72731_4_;
this.func_72715_a(Block.field_71973_m[var6].func_71911_a_(this.field_72769_h, p_72731_2_.field_72311_b, p_72731_2_.field_72312_c, p_72731_2_.field_72309_d).func_72314_b((double)var5, (double)var5, (double)var5).func_72325_c(-var7, -var9, -var11));
}
GL11.glDepthMask(true);
GL11.glEnable(3553);
GL11.glDisable(3042);
}
}
示例3: func_71399_a
import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
private void func_71399_a(int p_71399_1_, boolean p_71399_2_) {
if(!p_71399_2_) {
this.field_71429_W = 0;
}
if(p_71399_1_ != 0 || this.field_71429_W <= 0) {
if(p_71399_2_ && this.field_71476_x != null && this.field_71476_x.field_72313_a == EnumMovingObjectType.TILE && p_71399_1_ == 0) {
int var3 = this.field_71476_x.field_72311_b;
int var4 = this.field_71476_x.field_72312_c;
int var5 = this.field_71476_x.field_72309_d;
this.field_71442_b.func_78759_c(var3, var4, var5, this.field_71476_x.field_72310_e);
if(this.field_71439_g.func_82246_f(var3, var4, var5)) {
this.field_71452_i.func_78867_a(var3, var4, var5, this.field_71476_x.field_72310_e);
this.field_71439_g.func_71038_i();
}
} else {
this.field_71442_b.func_78767_c();
}
}
}
示例4: bucketFill
import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
@ForgeSubscribe
/**
* Called by ItemBucket when it tries to fill a bucket
* @param evt
*/
public void bucketFill(FillBucketEvent evt) {
if (evt.current.getItem().equals(Item.bucketEmpty) && evt.target.typeOfHit == EnumMovingObjectType.TILE) {
if (evt.world.canMineBlock(evt.entityPlayer, evt.target.blockX, evt.target.blockY, evt.target.blockZ)) {
if (evt.entityPlayer.canPlayerEdit(evt.target.blockX, evt.target.blockY, evt.target.blockZ, evt.target.sideHit, evt.current)) {
if (evt.world.getBlockId(evt.target.blockX, evt.target.blockY, evt.target.blockZ) == blockID) {
evt.world.setBlockToAir(evt.target.blockX, evt.target.blockY, evt.target.blockZ);
evt.result = new ItemStack(Magitech.instance.magibucket);
evt.setResult(Result.ALLOW);
}
}
}
}
}
示例5: onItemRightClick
import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
/**
* Called whenever this item is equipped and the right mouse button is
* pressed. Args: itemStack, world, entityPlayer
*/
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true);
if (var4 == null) return par1ItemStack;
else {
if (var4.typeOfHit == EnumMovingObjectType.TILE) {
int var5 = var4.blockX;
int var6 = var4.blockY;
int var7 = var4.blockZ;
if (!par2World.canMineBlock(par3EntityPlayer, var5, var6, var7)) return par1ItemStack;
if (!par3EntityPlayer.canPlayerEdit(var5, var6, var7, var4.sideHit, par1ItemStack)) return par1ItemStack;
if (par2World.getBlockMaterial(var5, var6, var7) == Material.water && par2World.getBlockMetadata(var5, var6, var7) == 0 && par2World.isAirBlock(var5, var6 + 1, var7)) {
par2World.setBlock(var5, var6 + 1, var7, XRBlocks.lilypad.blockID);
if (!par3EntityPlayer.capabilities.isCreativeMode) {
--par1ItemStack.stackSize;
}
}
}
return par1ItemStack;
}
}
示例6: add
import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
public ItemStack add(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer){
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true);
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
{
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
par2World.setBlockToAir(i, j, k);
if (--par1ItemStack.stackSize <= 0)
{
return new ItemStack(Item.bucketWater);
}
if (!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bucketWater)))
{
par3EntityPlayer.dropPlayerItem(new ItemStack(Item.bucketWater.itemID, 1, 0));
}
}
return par1ItemStack;
}
示例7: onItemRightClick
import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
@Override
public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player)
{
Random rand = new Random();
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(world, player, true);
if (movingobjectposition == null)
{
return item;
}
else
{
if (!world.isRemote && movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
{
int i = movingobjectposition.blockX;
int j = movingobjectposition.blockY;
int k = movingobjectposition.blockZ;
if (!world.canMineBlock(player, i, j, k))
{
return item;
}
if (!player.canPlayerEdit(i, j, k, movingobjectposition.sideHit, item))
{
return item;
}
if (isSaltWaterSource(world, i, j, k))
{
world.playSoundAtEntity(player, "random.splash", 0.125F + rand.nextFloat()/4, 0.5F + rand.nextFloat());
item.stackSize --;
EntityItem result = new EntityItem(world, player.posX, player.posY, player.posZ, new ItemStack(ItemListMF.misc, 1, ItemListMF.saltPaper));
world.spawnEntityInWorld(result);
}
}
}
return item;
}
示例8: getClickedBlock
import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
public int[] getClickedBlock(float ticks, int mouseX, int mouseY)
{
if (mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE)
{
int j = mc.objectMouseOver.blockX;
int k = mc.objectMouseOver.blockY;
int l = mc.objectMouseOver.blockZ;
return new int[]{j, k, l};
}
return null;
}
示例9: tickEnd
import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData)
{
if (!type.contains(TickType.PLAYER)) return;
EntityPlayer entityPlayer = (EntityPlayer) tickData[0];
if (entityPlayer != null)
{
//If we JUST swung an Item
if (entityPlayer.swingProgressInt == 1)
{
ItemStack mainhand = entityPlayer.getCurrentEquippedItem();
if (mainhand != null && mainhand.getItem() instanceof IExtendedReachItem)
{
float extendedReach = ((IExtendedReachItem) mainhand.getItem()).getReachModifierInBlocks(mainhand);
if(extendedReach > 0)
{
MovingObjectPosition mouseOver = ExtendedReachHelper.getMouseOver(0, extendedReach + 4);
if (mouseOver != null && mouseOver.typeOfHit == EnumMovingObjectType.ENTITY)
{
Entity target = mouseOver.entityHit;
if (target instanceof EntityLiving && target != entityPlayer)
{
if (target.hurtResistantTime != ((EntityLiving) target).maxHurtResistantTime)
{
FMLClientHandler.instance().getClient().playerController.attackEntity(entityPlayer, target);
}
}
}
}
}
}
}
}
示例10: func_77659_a
import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
public ItemStack func_77659_a(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
MovingObjectPosition var4 = this.func_77621_a(p_77659_2_, p_77659_3_, true);
if(var4 == null) {
return p_77659_1_;
} else {
if(var4.field_72313_a == EnumMovingObjectType.TILE) {
int var5 = var4.field_72311_b;
int var6 = var4.field_72312_c;
int var7 = var4.field_72309_d;
if(!p_77659_2_.func_72962_a(p_77659_3_, var5, var6, var7)) {
return p_77659_1_;
}
if(!p_77659_3_.func_82247_a(var5, var6, var7, var4.field_72310_e, p_77659_1_)) {
return p_77659_1_;
}
if(p_77659_2_.func_72803_f(var5, var6, var7) == Material.field_76244_g) {
--p_77659_1_.field_77994_a;
if(p_77659_1_.field_77994_a <= 0) {
return new ItemStack(Item.field_77726_bs);
}
if(!p_77659_3_.field_71071_by.func_70441_a(new ItemStack(Item.field_77726_bs))) {
p_77659_3_.func_71021_b(new ItemStack(Item.field_77726_bs.field_77779_bT, 1, 0));
}
}
}
return p_77659_1_;
}
}
示例11: func_77659_a
import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
public ItemStack func_77659_a(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
if(p_77659_2_.field_72995_K) {
return p_77659_1_;
} else {
MovingObjectPosition var4 = this.func_77621_a(p_77659_2_, p_77659_3_, true);
if(var4 == null) {
return p_77659_1_;
} else {
if(var4.field_72313_a == EnumMovingObjectType.TILE) {
int var5 = var4.field_72311_b;
int var6 = var4.field_72312_c;
int var7 = var4.field_72309_d;
if(!p_77659_2_.func_72962_a(p_77659_3_, var5, var6, var7)) {
return p_77659_1_;
}
if(!p_77659_3_.func_82247_a(var5, var6, var7, var4.field_72310_e, p_77659_1_)) {
return p_77659_1_;
}
if(p_77659_2_.func_72803_f(var5, var6, var7) == Material.field_76244_g) {
Entity var8 = func_77840_a(p_77659_2_, p_77659_1_.func_77960_j(), (double)var5, (double)var6, (double)var7);
if(var8 != null) {
if(var8 instanceof EntityLivingBase && p_77659_1_.func_82837_s()) {
((EntityLiving)var8).func_94058_c(p_77659_1_.func_82833_r());
}
if(!p_77659_3_.field_71075_bZ.field_75098_d) {
--p_77659_1_.field_77994_a;
}
}
}
}
return p_77659_1_;
}
}
}
示例12: func_77659_a
import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
public ItemStack func_77659_a(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
MovingObjectPosition var4 = this.func_77621_a(p_77659_2_, p_77659_3_, true);
if(var4 == null) {
return p_77659_1_;
} else {
if(var4.field_72313_a == EnumMovingObjectType.TILE) {
int var5 = var4.field_72311_b;
int var6 = var4.field_72312_c;
int var7 = var4.field_72309_d;
if(!p_77659_2_.func_72962_a(p_77659_3_, var5, var6, var7)) {
return p_77659_1_;
}
if(!p_77659_3_.func_82247_a(var5, var6, var7, var4.field_72310_e, p_77659_1_)) {
return p_77659_1_;
}
if(p_77659_2_.func_72803_f(var5, var6, var7) == Material.field_76244_g && p_77659_2_.func_72805_g(var5, var6, var7) == 0 && p_77659_2_.func_72799_c(var5, var6 + 1, var7)) {
p_77659_2_.func_94575_c(var5, var6 + 1, var7, Block.field_71991_bz.field_71990_ca);
if(!p_77659_3_.field_71075_bZ.field_75098_d) {
--p_77659_1_.field_77994_a;
}
}
}
return p_77659_1_;
}
}
示例13: MovingObjectPosition
import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
public MovingObjectPosition(int p_i2303_1_, int p_i2303_2_, int p_i2303_3_, int p_i2303_4_, Vec3 p_i2303_5_) {
this.field_72313_a = EnumMovingObjectType.TILE;
this.field_72311_b = p_i2303_1_;
this.field_72312_c = p_i2303_2_;
this.field_72309_d = p_i2303_3_;
this.field_72310_e = p_i2303_4_;
this.field_72307_f = p_i2303_5_.field_72447_d.func_72345_a(p_i2303_5_.field_72450_a, p_i2303_5_.field_72448_b, p_i2303_5_.field_72449_c);
}
示例14: addMovingObjectType
import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
public static EnumMovingObjectType addMovingObjectType(String name)
{
if (!isSetup)
{
setup();
}
return addEnum(EnumMovingObjectType.class, name);
}
示例15: onItemRightClick
import net.minecraft.util.EnumMovingObjectType; //导入依赖的package包/类
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
MovingObjectPosition movingobjectposition = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, false);
if (movingobjectposition != null && movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
{
int i = par2World.getBlockId(movingobjectposition.blockX, movingobjectposition.blockY, movingobjectposition.blockZ);
if (i == Block.endPortalFrame.blockID)
{
return par1ItemStack;
}
}
if (!par2World.isRemote)
{
ChunkPosition chunkposition = par2World.findClosestStructure("Stronghold", (int)par3EntityPlayer.posX, (int)par3EntityPlayer.posY, (int)par3EntityPlayer.posZ);
if (chunkposition != null)
{
EntityEnderEye entityendereye = new EntityEnderEye(par2World, par3EntityPlayer.posX, par3EntityPlayer.posY + 1.62D - (double)par3EntityPlayer.yOffset, par3EntityPlayer.posZ);
entityendereye.moveTowards((double)chunkposition.x, chunkposition.y, (double)chunkposition.z);
par2World.spawnEntityInWorld(entityendereye);
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
par2World.playAuxSFXAtEntity((EntityPlayer)null, 1002, (int)par3EntityPlayer.posX, (int)par3EntityPlayer.posY, (int)par3EntityPlayer.posZ, 0);
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
--par1ItemStack.stackSize;
}
}
}
return par1ItemStack;
}