本文整理汇总了Java中net.minecraft.client.particle.EntityDiggingFX.setParticleIcon方法的典型用法代码示例。如果您正苦于以下问题:Java EntityDiggingFX.setParticleIcon方法的具体用法?Java EntityDiggingFX.setParticleIcon怎么用?Java EntityDiggingFX.setParticleIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.particle.EntityDiggingFX
的用法示例。
在下文中一共展示了EntityDiggingFX.setParticleIcon方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addDestroyEffects
import net.minecraft.client.particle.EntityDiggingFX; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public boolean addDestroyEffects (World world, int x, int y, int z, int meta, EffectRenderer effectRenderer) {
TileEntityWoodProxy te = getTileEntity(world, x, y, z);
BlockThinLog block = getBlock(world, x, y, z);
if (te == null || block == null)
return false;
int protoMeta = te.getProtoMeta();
Block protoBlock = te.getProtoBlock();
if (protoBlock == null) {
protoBlock = Blocks.log;
protoMeta = world.getBlockMetadata(x, y, z);
}
try {
byte count = 4;
for (int ix = 0; ix < count; ++ix) {
for (int iy = 0; iy < count; ++iy) {
for (int iz = 0; iz < count; ++iz) {
double xOff = (double)x + ((double)ix + 0.5D) / (double)count;
double yOff = (double)y + ((double)iy + 0.5D) / (double)count;
double zOff = (double)z + ((double)iz + 0.5D) / (double)count;
EntityDiggingFX fx = new EntityDiggingFX(world, xOff, yOff, zOff, xOff - (double) x - 0.5D, yOff - (double) y - 0.5D, zOff - (double) z - 0.5D, this, meta);
fx.setParticleIcon(block.getIcon(world.rand.nextInt(6), te.composeMetadata(protoBlock, protoMeta)));
effectRenderer.addEffect(fx.applyColourMultiplier(x, y, z));
}
}
}
}
catch (Exception e) { }
return true;
}
示例2: addDestroyEffects
import net.minecraft.client.particle.EntityDiggingFX; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public boolean addDestroyEffects (World world, int x, int y, int z, int meta, EffectRenderer effectRenderer) {
TileEntityWoodProxy te = getTileEntity(world, x, y, z);
BlockThinLogFence block = getBlock(world, x, y, z);
if (te == null || block == null)
return false;
int protoMeta = te.getProtoMeta();
Block protoBlock = te.getProtoBlock();
if (protoBlock == null) {
protoBlock = Blocks.log;
protoMeta = world.getBlockMetadata(x, y, z);
}
try {
byte count = 4;
for (int ix = 0; ix < count; ++ix) {
for (int iy = 0; iy < count; ++iy) {
for (int iz = 0; iz < count; ++iz) {
double xOff = (double)x + ((double)ix + 0.5D) / (double)count;
double yOff = (double)y + ((double)iy + 0.5D) / (double)count;
double zOff = (double)z + ((double)iz + 0.5D) / (double)count;
EntityDiggingFX fx = new EntityDiggingFX(world, xOff, yOff, zOff, xOff - (double) x - 0.5D, yOff - (double) y - 0.5D, zOff - (double) z - 0.5D, this, meta);
fx.setParticleIcon(block.getIcon(world.rand.nextInt(6), te.composeMetadata(protoBlock, protoMeta)));
effectRenderer.addEffect(fx.applyColourMultiplier(x, y, z));
}
}
}
}
catch (Exception e) { }
return true;
}
示例3: addDestroyEffects
import net.minecraft.client.particle.EntityDiggingFX; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public boolean addDestroyEffects (World world, int x, int y, int z, int meta, EffectRenderer effectRenderer) {
TileEntityLargePot te = getAttachedPotEntity(world, x, y, z);
if (te == null || te.getFlowerPotItem() == null)
return true;
Block proxy = Block.getBlockFromItem(te.getFlowerPotItem());
if (proxy == null || proxy == Blocks.air)
return true;
try {
byte count = 4;
for (int ix = 0; ix < count; ++ix)
{
for (int iy = 0; iy < count; ++iy)
{
for (int iz = 0; iz < count; ++iz)
{
double xOff = (double)x + ((double)ix + 0.5D) / (double)count;
double yOff = (double)y + ((double)iy + 0.5D) / (double)count;
double zOff = (double)z + ((double)iz + 0.5D) / (double)count;
EntityDiggingFX fx = new EntityDiggingFX(world, xOff, yOff, zOff, xOff - (double) x - 0.5D, yOff - (double) y - 0.5D, zOff - (double) z - 0.5D, this, meta);
fx.setParticleIcon(proxy.getIcon(world.rand.nextInt(6), te.getFlowerPotData()));
effectRenderer.addEffect(fx.applyColourMultiplier(x, y, z));
}
}
}
}
catch (Exception e) {
FMLLog.log(ModularPots.MOD_ID, Level.WARN, "Exception passing through addDestroyEffects(): " + e.getMessage());
}
return true;
}
示例4: addDestroyEffects
import net.minecraft.client.particle.EntityDiggingFX; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public boolean addDestroyEffects(World world, int x, int y, int z, int meta, EffectRenderer effectRenderer)
{
Block block = world.getBlock(x, y, z);
TileEntity tileentity = world.getTileEntity(x, y, z);
if (block != null && block == this && tileentity != null && tileentity instanceof TileClayOven)
{
TileClayOven te = (TileClayOven)tileentity;
int buildStage = te.getBuildStage();
int curingStage = te.getCuringStage();
byte b0 = 4;
for (int i1 = 0; i1 < b0; ++i1)
{
for (int j1 = 0; j1 < b0; ++j1)
{
for (int k1 = 0; k1 < b0; ++k1)
{
double d0 = (double)x + ((double)i1 + 0.5D) / (double)b0;
double d1 = (double)y + ((double)j1 + 0.5D) / (double)b0;
double d2 = (double)z + ((double)k1 + 0.5D) / (double)b0;
EntityDiggingFX digging = new EntityDiggingFX(world, d0, d1, d2, d0 - (double)x - 0.5D, d1 - (double)y - 0.5D, d2 - (double)z - 0.5D, block, meta);
digging.applyColourMultiplier(x, y, z);
if(buildStage <= Constants.CHIMNEY && curingStage == 2)
digging.setParticleIcon(ClayOven[1]);
else if(buildStage <= Constants.CHIMNEY && curingStage >= 3)
digging.setParticleIcon(ClayOven[2]);
else if(buildStage == Constants.INTERIOR && (curingStage == 1 || curingStage == 4))
digging.setParticleIcon(ClayOven[2]);
else if(buildStage == Constants.INTERIOR && curingStage == 2)
digging.setParticleIcon(ClayOven[3]);
else if(buildStage == Constants.CURED)
digging.setParticleIcon(ClayOven[4]);
else
digging.setParticleIcon(ClayOven[0]);
effectRenderer.addEffect(digging);
}
}
}
}
return true;
}
示例5: addDestroyEffects
import net.minecraft.client.particle.EntityDiggingFX; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public boolean addDestroyEffects(World world, int x, int y, int z, int meta, EffectRenderer effectRenderer)
{
Block block = world.getBlock(x, y, z);
TileEntity tileentity = world.getTileEntity(x, y, z);
if (block != null && block == this && tileentity != null && tileentity instanceof TileSandwich)
{
TileSandwich te = (TileSandwich)tileentity;
Item toast = (te.getSandwichContents()[0]).getItem();
byte b0 = 2;
for (int i1 = 0; i1 < b0; ++i1)
{
for (int j1 = 0; j1 < b0; ++j1)
{
for (int k1 = 0; k1 < b0; ++k1)
{
double d0 = (double)x + ((double)i1 + 0.5D) / (double)b0;
double d1 = (double)y + ((double)j1 + 0.5D) / (double)b0;
double d2 = (double)z + ((double)k1 + 0.5D) / (double)b0;
EntityDiggingFX digging = new EntityDiggingFX(world, d0, d1, d2, d0 - (double)x - 0.5D, d1 - (double)y - 0.5D, d2 - (double)z - 0.5D, block, meta);
digging.applyColourMultiplier(x, y, z);
if(toast == TFCItems.barleyBread)
digging.setParticleIcon(ToastTop[0]);
else if(toast == TFCItems.cornBread)
digging.setParticleIcon(ToastTop[1]);
else if(toast == TFCItems.oatBread)
digging.setParticleIcon(ToastTop[2]);
else if(toast == TFCItems.riceBread)
digging.setParticleIcon(ToastTop[3]);
else if(toast == TFCItems.ryeBread)
digging.setParticleIcon(ToastTop[4]);
else
digging.setParticleIcon(ToastTop[5]);
effectRenderer.addEffect(digging);
}
}
}
}
return true;
}
示例6: addHitEffects
import net.minecraft.client.particle.EntityDiggingFX; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public boolean addHitEffects (World worldObj, MovingObjectPosition target, EffectRenderer effectRenderer) {
TileEntityWoodProxy te = getTileEntity(worldObj, target.blockX, target.blockY, target.blockZ);
BlockThinLog block = getBlock(worldObj, target.blockX, target.blockY, target.blockZ);
if (te == null || block == null)
return false;
int protoMeta = te.getProtoMeta();
Block protoBlock = te.getProtoBlock();
if (protoBlock == null) {
protoBlock = Blocks.log;
protoMeta = worldObj.getBlockMetadata(target.blockX, target.blockY, target.blockZ);
}
float f = 0.1F;
double xPos = target.blockX + worldObj.rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - (f * 2.0F)) + f + block.getBlockBoundsMinX();
double yPos = target.blockY + worldObj.rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - (f * 2.0F)) + f + block.getBlockBoundsMinY();
double zPos = target.blockZ + worldObj.rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - (f * 2.0F)) + f + block.getBlockBoundsMinZ();
if (target.sideHit == 0)
yPos = target.blockY + block.getBlockBoundsMinY() - f;
if (target.sideHit == 1)
yPos = target.blockY + block.getBlockBoundsMaxY() + f;
if (target.sideHit == 2)
zPos = target.blockZ + block.getBlockBoundsMinZ() - f;
if (target.sideHit == 3)
zPos = target.blockZ + block.getBlockBoundsMaxZ() + f;
if (target.sideHit == 4)
xPos = target.blockX + block.getBlockBoundsMinX() - f;
if (target.sideHit == 5)
xPos = target.blockX + block.getBlockBoundsMaxX() + f;
EntityDiggingFX fx = new EntityDiggingFX(worldObj, xPos, yPos, zPos, 0.0D, 0.0D, 0.0D, block, worldObj.getBlockMetadata(target.blockX, target.blockY, target.blockZ));
fx.applyColourMultiplier(target.blockX, target.blockY, target.blockZ);
fx.multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F);
fx.setParticleIcon(block.getIcon(worldObj.rand.nextInt(6), te.composeMetadata(protoBlock, protoMeta)));
effectRenderer.addEffect(fx);
return true;
}
示例7: addHitEffects
import net.minecraft.client.particle.EntityDiggingFX; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public boolean addHitEffects (World worldObj, MovingObjectPosition target, EffectRenderer effectRenderer) {
TileEntityWoodProxy te = getTileEntity(worldObj, target.blockX, target.blockY, target.blockZ);
BlockThinLogFence block = getBlock(worldObj, target.blockX, target.blockY, target.blockZ);
if (te == null || block == null)
return false;
int protoMeta = te.getProtoMeta();
Block protoBlock = te.getProtoBlock();
if (protoBlock == null) {
protoBlock = Blocks.log;
protoMeta = worldObj.getBlockMetadata(target.blockX, target.blockY, target.blockZ);
}
float f = 0.1F;
double xPos = target.blockX + worldObj.rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - (f * 2.0F)) + f + block.getBlockBoundsMinX();
double yPos = target.blockY + worldObj.rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - (f * 2.0F)) + f + block.getBlockBoundsMinY();
double zPos = target.blockZ + worldObj.rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - (f * 2.0F)) + f + block.getBlockBoundsMinZ();
if (target.sideHit == 0)
yPos = target.blockY + block.getBlockBoundsMinY() - f;
if (target.sideHit == 1)
yPos = target.blockY + block.getBlockBoundsMaxY() + f;
if (target.sideHit == 2)
zPos = target.blockZ + block.getBlockBoundsMinZ() - f;
if (target.sideHit == 3)
zPos = target.blockZ + block.getBlockBoundsMaxZ() + f;
if (target.sideHit == 4)
xPos = target.blockX + block.getBlockBoundsMinX() - f;
if (target.sideHit == 5)
xPos = target.blockX + block.getBlockBoundsMaxX() + f;
EntityDiggingFX fx = new EntityDiggingFX(worldObj, xPos, yPos, zPos, 0.0D, 0.0D, 0.0D, block, worldObj.getBlockMetadata(target.blockX, target.blockY, target.blockZ));
fx.applyColourMultiplier(target.blockX, target.blockY, target.blockZ);
fx.multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F);
fx.setParticleIcon(block.getIcon(worldObj.rand.nextInt(6), te.composeMetadata(protoBlock, protoMeta)));
effectRenderer.addEffect(fx);
return true;
}
示例8: addDestroyEffects
import net.minecraft.client.particle.EntityDiggingFX; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public boolean addDestroyEffects (World world, int x, int y, int z, int meta, EffectRenderer effectRenderer) {
TileEntityGarden te = getGardenEntity(world, x, y, z);
BlockGarden garden = getGardenBlock(world, x, y, z);
if (te == null || garden == null)
return true;
for (int slot : garden.getSlotProfile().getPlantSlots()) {
Block block = getPlantBlock(te, slot);
int blockData = getPlantData(te, slot);
if (block == null)
continue;
bindSlot(world, x, y, z, te, slot);
try {
byte count = 4;
for (int ix = 0; ix < count; ++ix) {
for (int iy = 0; iy < count; ++iy) {
for (int iz = 0; iz < count; ++iz) {
double xOff = (double)x + ((double)ix + 0.5D) / (double)count;
double yOff = (double)y + ((double)iy + 0.5D) / (double)count;
double zOff = (double)z + ((double)iz + 0.5D) / (double)count;
EntityDiggingFX fx = new EntityDiggingFX(world, xOff, yOff, zOff, xOff - (double) x - 0.5D, yOff - (double) y - 0.5D, zOff - (double) z - 0.5D, this, meta);
fx.setParticleIcon(block.getIcon(world.rand.nextInt(6), blockData));
effectRenderer.addEffect(fx.applyColourMultiplier(x, y, z));
}
}
}
}
catch (Exception e) {
continue;
}
finally {
unbindSlot(world, x, y, z, te);
}
}
return true;
}