本文整理汇总了Java中com.enderio.core.common.TileEntityEnder类的典型用法代码示例。如果您正苦于以下问题:Java TileEntityEnder类的具体用法?Java TileEntityEnder怎么用?Java TileEntityEnder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TileEntityEnder类属于com.enderio.core.common包,在下文中一共展示了TileEntityEnder类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processDrop
import com.enderio.core.common.TileEntityEnder; //导入依赖的package包/类
@Override
protected void processDrop(World world, int x, int y, int z, TileEntityEnder te, ItemStack itemstack) {
if (te instanceof TileFlag) {
if (te.getWorldObj().rand.nextDouble() < flagDemagnetizingChance.getDouble()) {
((TileFlag) te).setCharged(false);
itemstack.setItemDamage(1);
((TileFlag) te).writeItemStackNBT(itemstack);
spawnParticle(world, "reddust", x, y, z, 0, 0, 0);
} else if (!((TileFlag) te).isCharged()) {
itemstack.setItemDamage(1);
((TileFlag) te).writeItemStackNBT(itemstack);
} else if (flagKeepTargetOnBreaking.getBoolean()) {
((TileFlag) te).writeItemStackNBT(itemstack);
}
}
}
示例2: onMessage
import com.enderio.core.common.TileEntityEnder; //导入依赖的package包/类
@Override
public IMessage onMessage(PacketGhostSlot msg, MessageContext ctx) {
TileEntityEnder te = msg.getTileEntity(ctx.getServerHandler().playerEntity.worldObj);
if (te != null) {
te.setGhostSlotContents(msg.slot, msg.stack);
te.getWorldObj().markBlockForUpdate(msg.x, msg.y, msg.z);
}
return null;
}
示例3: PacketGhostSlot
import com.enderio.core.common.TileEntityEnder; //导入依赖的package包/类
private PacketGhostSlot(TileEntityEnder tile) {
super(tile);
}
示例4: setGhostSlotContents
import com.enderio.core.common.TileEntityEnder; //导入依赖的package包/类
public static PacketGhostSlot setGhostSlotContents(TileEntityEnder te, int slot, ItemStack stack) {
PacketGhostSlot msg = new PacketGhostSlot(te);
msg.slot = slot;
msg.stack = stack;
return msg;
}
示例5: isFireSource
import com.enderio.core.common.TileEntityEnder; //导入依赖的package包/类
@Override
public boolean isFireSource(final World world, final int x, final int y, final int z, ForgeDirection side) {
if (side == ForgeDirection.UP) {
TileEntityEnder te = getTileEntityEio(world, x, y, z);
if (te instanceof TileDrain) {
final SmartTank tank = ((TileDrain) te).tank;
if (tank.getFluidAmount() > 0) {
FluidStack fluidStack = tank.getFluid();
if (fluidStack != null && fluidStack.getFluid() != null) {
if (fluidStack.getFluid() == EnderIO.fluidHootch) {
tank.addFluidAmount(-5);
((TileDrain) te).setTanksDirty();
return true;
} else if (fluidStack.getFluid() == EnderIO.fluidFireWater) {
tank.addFluidAmount(-2);
((TileDrain) te).setTanksDirty();
return true;
} else if (fluidStack.getFluid() == EnderIO.fluidRocketFuel) {
int power = tank.getFluidAmount();
tank.setFluid(null);
world.setBlockToAir(x, y, z);
world.newExplosion(null, x + .5f, y + 1.5f, z + .5f, 3, true, true);
float range = 1.5f;
int delay = 0;
while (power > 0) {
range += 1.5f * power / 500;
final float range2 = range;
final float kaboom = power / (2000f / 6.66f);
delay += 7;
if (y + range2 < 255) {
Scheduler.instance().schedule(delay, new Runnable() {
@Override
public void run() {
world.newExplosion(null, x + .5f, y + range2, z + .5f, kaboom, true, true);
}
});
}
power -= 333;
}
return true;
} else if (fluidStack.getFluid() == FluidRegistry.WATER) {
for (BlockCoord bc1 : getAround(te.getLocation())) {
if (world.blockExists(bc1.x, bc1.y, bc1.z) && bc1.getBlock(world) == Blocks.fire) {
world.setBlockToAir(bc1.x, bc1.y, bc1.z);
world.playSoundEffect(bc1.x + 0.5F, bc1.y + 0.1F, bc1.z + 0.5F, "random.fizz", 0.5F,
2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
tank.addFluidAmount(-20);
}
}
((TileDrain) te).setTanksDirty();
return false;
} else if (fluidStack.getFluid() == FluidRegistry.LAVA) {
return world.rand.nextInt(5) != 0;
}
}
}
}
}
return false;
}