本文整理汇总了Java中net.minecraft.block.BlockHopper类的典型用法代码示例。如果您正苦于以下问题:Java BlockHopper类的具体用法?Java BlockHopper怎么用?Java BlockHopper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BlockHopper类属于net.minecraft.block包,在下文中一共展示了BlockHopper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderBlockHopper
import net.minecraft.block.BlockHopper; //导入依赖的package包/类
public boolean renderBlockHopper(BlockHopper p_147803_1_, int p_147803_2_, int p_147803_3_, int p_147803_4_)
{
Tessellator var5 = Tessellator.instance;
var5.setBrightness(p_147803_1_.getBlockBrightness(this.blockAccess, p_147803_2_, p_147803_3_, p_147803_4_));
int var6 = p_147803_1_.colorMultiplier(this.blockAccess, p_147803_2_, p_147803_3_, p_147803_4_);
float var7 = (float)(var6 >> 16 & 255) / 255.0F;
float var8 = (float)(var6 >> 8 & 255) / 255.0F;
float var9 = (float)(var6 & 255) / 255.0F;
if (EntityRenderer.anaglyphEnable)
{
float var10 = (var7 * 30.0F + var8 * 59.0F + var9 * 11.0F) / 100.0F;
float var11 = (var7 * 30.0F + var8 * 70.0F) / 100.0F;
float var12 = (var7 * 30.0F + var9 * 70.0F) / 100.0F;
var7 = var10;
var8 = var11;
var9 = var12;
}
var5.setColorOpaque_F(var7, var8, var9);
return this.renderBlockHopperMetadata(p_147803_1_, p_147803_2_, p_147803_3_, p_147803_4_, this.blockAccess.getBlockMetadata(p_147803_2_, p_147803_3_, p_147803_4_), false);
}
示例2: func_145887_i
import net.minecraft.block.BlockHopper; //导入依赖的package包/类
public boolean func_145887_i()
{
if (this.worldObj != null && !this.worldObj.isClient)
{
if (!this.func_145888_j() && BlockHopper.func_149917_c(this.getBlockMetadata()))
{
boolean var1 = this.func_145883_k();
var1 = func_145891_a(this) || var1;
if (var1)
{
this.func_145896_c(8);
this.onInventoryChanged();
return true;
}
}
return false;
}
else
{
return false;
}
}
示例3: renderBlockHopper
import net.minecraft.block.BlockHopper; //导入依赖的package包/类
public boolean renderBlockHopper(BlockHopper p_147803_1_, int p_147803_2_, int p_147803_3_, int p_147803_4_)
{
Tessellator tessellator = Tessellator.instance;
tessellator.setBrightness(p_147803_1_.getMixedBrightnessForBlock(this.blockAccess, p_147803_2_, p_147803_3_, p_147803_4_));
int l = p_147803_1_.colorMultiplier(this.blockAccess, p_147803_2_, p_147803_3_, p_147803_4_);
float f = (float)(l >> 16 & 255) / 255.0F;
float f1 = (float)(l >> 8 & 255) / 255.0F;
float f2 = (float)(l & 255) / 255.0F;
if (EntityRenderer.anaglyphEnable)
{
float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F;
float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F;
float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F;
f = f3;
f1 = f4;
f2 = f5;
}
tessellator.setColorOpaque_F(f, f1, f2);
return this.renderBlockHopperMetadata(p_147803_1_, p_147803_2_, p_147803_3_, p_147803_4_, this.blockAccess.getBlockMetadata(p_147803_2_, p_147803_3_, p_147803_4_), false);
}
示例4: func_94172_a
import net.minecraft.block.BlockHopper; //导入依赖的package包/类
public boolean func_94172_a(BlockHopper p_94172_1_, int p_94172_2_, int p_94172_3_, int p_94172_4_) {
Tessellator var5 = Tessellator.field_78398_a;
var5.func_78380_c(p_94172_1_.func_71874_e(this.field_78669_a, p_94172_2_, p_94172_3_, p_94172_4_));
float var6 = 1.0F;
int var7 = p_94172_1_.func_71920_b(this.field_78669_a, p_94172_2_, p_94172_3_, p_94172_4_);
float var8 = (float)(var7 >> 16 & 255) / 255.0F;
float var9 = (float)(var7 >> 8 & 255) / 255.0F;
float var10 = (float)(var7 & 255) / 255.0F;
if(EntityRenderer.field_78517_a) {
float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F;
float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F;
float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F;
var8 = var11;
var9 = var12;
var10 = var13;
}
var5.func_78386_a(var6 * var8, var6 * var9, var6 * var10);
return this.func_96447_a(p_94172_1_, p_94172_2_, p_94172_3_, p_94172_4_, this.field_78669_a.func_72805_g(p_94172_2_, p_94172_3_, p_94172_4_), false);
}
示例5: func_98045_j
import net.minecraft.block.BlockHopper; //导入依赖的package包/类
public boolean func_98045_j() {
if(this.field_70331_k != null && !this.field_70331_k.field_72995_K) {
if(!this.func_98047_l() && BlockHopper.func_94452_d(this.func_70322_n())) {
boolean var1 = this.func_94116_j();
var1 = func_96116_a(this) || var1;
if(var1) {
this.func_98046_c(8);
this.func_70296_d();
return true;
}
}
return false;
} else {
return false;
}
}
示例6: func_94116_j
import net.minecraft.block.BlockHopper; //导入依赖的package包/类
private boolean func_94116_j() {
IInventory var1 = this.func_94119_v();
if(var1 == null) {
return false;
} else {
for(int var2 = 0; var2 < this.func_70302_i_(); ++var2) {
if(this.func_70301_a(var2) != null) {
ItemStack var3 = this.func_70301_a(var2).func_77946_l();
ItemStack var4 = func_94117_a(var1, this.func_70298_a(var2, 1), Facing.field_71588_a[BlockHopper.func_94451_c(this.func_70322_n())]);
if(var4 == null || var4.field_77994_a == 0) {
var1.func_70296_d();
return true;
}
this.func_70299_a(var2, var3);
}
}
return false;
}
}
示例7: renderBlockHopper
import net.minecraft.block.BlockHopper; //导入依赖的package包/类
public boolean renderBlockHopper(BlockHopper par1BlockHopper, int par2, int par3, int par4)
{
Tessellator tessellator = Tessellator.instance;
tessellator.setBrightness(par1BlockHopper.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4));
float f = 1.0F;
int l = par1BlockHopper.colorMultiplier(this.blockAccess, par2, par3, par4);
float f1 = (float)(l >> 16 & 255) / 255.0F;
float f2 = (float)(l >> 8 & 255) / 255.0F;
float f3 = (float)(l & 255) / 255.0F;
if (EntityRenderer.anaglyphEnable)
{
float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
float f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
f1 = f4;
f2 = f5;
f3 = f6;
}
tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);
return this.renderBlockHopperMetadata(par1BlockHopper, par2, par3, par4, this.blockAccess.getBlockMetadata(par2, par3, par4), false);
}
示例8: updateHopper
import net.minecraft.block.BlockHopper; //导入依赖的package包/类
public boolean updateHopper()
{
if (this.worldObj != null && !this.worldObj.isRemote)
{
if (!this.isCoolingDown() && BlockHopper.getIsBlockNotPoweredFromMetadata(this.getBlockMetadata()))
{
boolean flag = this.insertItemToInventory();
flag = suckItemsIntoHopper(this) || flag;
if (flag)
{
this.setTransferCooldown(8);
this.onInventoryChanged();
return true;
}
}
return false;
}
else
{
return false;
}
}
示例9: updateHopper
import net.minecraft.block.BlockHopper; //导入依赖的package包/类
public boolean updateHopper()
{
if (this.worldObj != null && !this.worldObj.isRemote)
{
if (!this.isOnTransferCooldown() && BlockHopper.isEnabled(this.getBlockMetadata()))
{
boolean flag = false;
if (!this.isEmpty())
{
flag = this.transferItemsOut();
}
if (!this.isFull())
{
flag = captureDroppedItems(this) || flag;
}
if (flag)
{
this.setTransferCooldown(8);
this.markDirty();
return true;
}
}
return false;
}
else
{
return false;
}
}
示例10: transferItemsOut
import net.minecraft.block.BlockHopper; //导入依赖的package包/类
private boolean transferItemsOut()
{
IInventory iinventory = this.getInventoryForHopperTransfer();
if (iinventory == null)
{
return false;
}
else
{
EnumFacing enumfacing = BlockHopper.getFacing(this.getBlockMetadata()).getOpposite();
if (this.isInventoryFull(iinventory, enumfacing))
{
return false;
}
else
{
for (int i = 0; i < this.getSizeInventory(); ++i)
{
if (this.getStackInSlot(i) != null)
{
ItemStack itemstack = this.getStackInSlot(i).copy();
ItemStack itemstack1 = putStackInInventoryAllSlots(iinventory, this.decrStackSize(i, 1), enumfacing);
if (itemstack1 == null || itemstack1.stackSize == 0)
{
iinventory.markDirty();
return true;
}
this.setInventorySlotContents(i, itemstack);
}
}
return false;
}
}
}
示例11: updateHopper
import net.minecraft.block.BlockHopper; //导入依赖的package包/类
private boolean updateHopper()
{
if (this.world != null && !this.world.isRemote)
{
if (!this.isOnTransferCooldown() && BlockHopper.isEnabled(this.getBlockMetadata()))
{
boolean flag = false;
if (!this.isEmpty())
{
flag = this.transferItemsOut();
}
if (!this.isFull())
{
flag = captureDroppedItems(this) || flag;
}
if (flag)
{
this.setTransferCooldown(8);
this.markDirty();
return true;
}
}
return false;
}
else
{
return false;
}
}
示例12: transferItemsOut
import net.minecraft.block.BlockHopper; //导入依赖的package包/类
private boolean transferItemsOut()
{
IInventory iinventory = this.getInventoryForHopperTransfer();
if (iinventory == null)
{
return false;
}
else
{
EnumFacing enumfacing = BlockHopper.getFacing(this.getBlockMetadata()).getOpposite();
if (this.isInventoryFull(iinventory, enumfacing))
{
return false;
}
else
{
for (int i = 0; i < this.getSizeInventory(); ++i)
{
if (!this.getStackInSlot(i).func_190926_b())
{
ItemStack itemstack = this.getStackInSlot(i).copy();
ItemStack itemstack1 = putStackInInventoryAllSlots(this, iinventory, this.decrStackSize(i, 1), enumfacing);
if (itemstack1.func_190926_b())
{
iinventory.markDirty();
return true;
}
this.setInventorySlotContents(i, itemstack);
}
}
return false;
}
}
}
示例13: transferItemsOut
import net.minecraft.block.BlockHopper; //导入依赖的package包/类
private boolean transferItemsOut()
{
if (net.minecraftforge.items.VanillaInventoryCodeHooks.insertHook(this)) { return true; }
IInventory iinventory = this.getInventoryForHopperTransfer();
if (iinventory == null)
{
return false;
}
else
{
EnumFacing enumfacing = BlockHopper.getFacing(this.getBlockMetadata()).getOpposite();
if (this.isInventoryFull(iinventory, enumfacing))
{
return false;
}
else
{
for (int i = 0; i < this.getSizeInventory(); ++i)
{
if (this.getStackInSlot(i) != null)
{
ItemStack itemstack = this.getStackInSlot(i).copy();
ItemStack itemstack1 = putStackInInventoryAllSlots(iinventory, this.decrStackSize(i, 1), enumfacing);
if (itemstack1 == null || itemstack1.stackSize == 0)
{
iinventory.markDirty();
return true;
}
this.setInventorySlotContents(i, itemstack);
}
}
return false;
}
}
}
示例14: getInventoryForHopperTransfer
import net.minecraft.block.BlockHopper; //导入依赖的package包/类
/**
* Returns the IInventory that this hopper is pointing into
*/
private IInventory getInventoryForHopperTransfer()
{
EnumFacing enumfacing = BlockHopper.getFacing(this.getBlockMetadata());
/**
* Returns the IInventory (if applicable) of the TileEntity at the specified position
*/
return getInventoryAtPosition(this.getWorld(), this.getXPos() + (double)enumfacing.getFrontOffsetX(), this.getYPos() + (double)enumfacing.getFrontOffsetY(), this.getZPos() + (double)enumfacing.getFrontOffsetZ());
}
示例15: func_145887_i
import net.minecraft.block.BlockHopper; //导入依赖的package包/类
public boolean func_145887_i()
{
if (this.worldObj != null && !this.worldObj.isRemote)
{
if (!this.func_145888_j() && BlockHopper.func_149917_c(this.getBlockMetadata()))
{
boolean flag = false;
if (!this.func_152104_k())
{
flag = this.func_145883_k();
}
if (!this.func_152105_l())
{
flag = func_145891_a(this) || flag;
}
if (flag)
{
this.func_145896_c(8);
this.markDirty();
return true;
}
}
return false;
}
else
{
return false;
}
}
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:34,代码来源:TileEntityBlockChristmasPresents_Red.java