mirror of
https://github.com/GTNewHorizons/Tainted-Magic.git
synced 2026-11-25 06:14:24 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
1eaf9b7991
commit
62390a0d0f
79 files changed
+3118
-1929
No files matched your search
@@ -2,8 +2,6 @@ package taintedmagic.common.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -12,14 +10,17 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import taintedmagic.common.blocks.tile.TileLumos;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXSparkle;
|
||||
import thaumcraft.common.config.Config;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockLumos extends Block implements ITileEntityProvider {
|
||||
|
||||
public BlockLumos () {
|
||||
public BlockLumos() {
|
||||
super(Config.airyMaterial);
|
||||
setStepSound(new Block.SoundType("stone", -1, -1));
|
||||
setBlockName("BlockLumos");
|
||||
@@ -30,7 +31,7 @@ public class BlockLumos extends Block implements ITileEntityProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockDestroyedByPlayer (final World world, final int x, final int y, final int z, final int meta) {
|
||||
public void onBlockDestroyedByPlayer(final World world, final int x, final int y, final int z, final int meta) {
|
||||
super.onBlockDestroyedByPlayer(world, x, y, z, meta);
|
||||
|
||||
world.playSound(x, y, z, "thaumcraft:ice", 0.3F, 1.1F + world.rand.nextFloat() * 0.1F, true);
|
||||
@@ -42,10 +43,16 @@ public class BlockLumos extends Block implements ITileEntityProvider {
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
void spawnBreakParticles (final World world, final double x, final double y, final double z) {
|
||||
final FXSparkle fx = new FXSparkle(world, x + world.rand.nextFloat(), y + world.rand.nextFloat(),
|
||||
z + world.rand.nextFloat(), 1.75F, 6, 3 + world.rand.nextInt(3));
|
||||
@SideOnly(Side.CLIENT)
|
||||
void spawnBreakParticles(final World world, final double x, final double y, final double z) {
|
||||
final FXSparkle fx = new FXSparkle(
|
||||
world,
|
||||
x + world.rand.nextFloat(),
|
||||
y + world.rand.nextFloat(),
|
||||
z + world.rand.nextFloat(),
|
||||
1.75F,
|
||||
6,
|
||||
3 + world.rand.nextInt(3));
|
||||
fx.motionX += world.rand.nextGaussian() * 0.1D;
|
||||
fx.motionY += world.rand.nextGaussian() * 0.1D;
|
||||
fx.motionZ += world.rand.nextGaussian() * 0.1D;
|
||||
@@ -54,57 +61,58 @@ public class BlockLumos extends Block implements ITileEntityProvider {
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool (final World world, final int x, final int y, final int z) {
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(final World world, final int x, final int y, final int z) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType () {
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSideSolid (final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection side) {
|
||||
public boolean isSideSolid(final IBlockAccess world, final int x, final int y, final int z,
|
||||
final ForgeDirection side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlockNormalCube () {
|
||||
public boolean isBlockNormalCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube () {
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReplaceable (final IBlockAccess world, final int x, final int y, final int z) {
|
||||
public boolean isReplaceable(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeReplacedByLeaves (final IBlockAccess world, final int x, final int y, final int z) {
|
||||
public boolean canBeReplacedByLeaves(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock () {
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped (final int a, final Random random, final int b) {
|
||||
public Item getItemDropped(final int a, final Random random, final int b) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItem (final World world, final int x, final int y, final int z) {
|
||||
public Item getItem(final World world, final int x, final int y, final int z) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity (final World world, final int m) {
|
||||
public TileEntity createNewTileEntity(final World world, final int m) {
|
||||
return new TileLumos();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package taintedmagic.common.blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.block.BlockBush;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -18,13 +17,15 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.world.BlockEvent;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.BlockRegistry;
|
||||
import taintedmagic.common.registry.ItemRegistry;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class BlockNightshadeBush extends BlockBush {
|
||||
|
||||
public BlockNightshadeBush () {
|
||||
public BlockNightshadeBush() {
|
||||
super(Material.plants);
|
||||
setBlockName("BlockNightshadeBush");
|
||||
setBlockTextureName("taintedmagic:BlockNightshadeBush");
|
||||
@@ -34,17 +35,18 @@ public class BlockNightshadeBush extends BlockBush {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped (final int a, final Random random, final int b) {
|
||||
public Item getItemDropped(final int a, final Random random, final int b) {
|
||||
return ItemRegistry.ItemNightshadeBerries;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped (final Random random) {
|
||||
public int quantityDropped(final Random random) {
|
||||
return 1 + random.nextInt(3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock (final World world, final int x, final int y, final int z, final Entity entity) {
|
||||
public void onEntityCollidedWithBlock(final World world, final int x, final int y, final int z,
|
||||
final Entity entity) {
|
||||
super.onEntityCollidedWithBlock(world, x, y, z, entity);
|
||||
|
||||
if (entity instanceof EntityLivingBase) {
|
||||
@@ -54,18 +56,21 @@ public class BlockNightshadeBush extends BlockBush {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability (final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z,
|
||||
final ForgeDirection face) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed (final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z,
|
||||
final ForgeDirection face) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreak (final BlockEvent.HarvestDropsEvent event) {
|
||||
if (event.block instanceof BlockNightshadeBush && event.harvester != null && event.harvester.getHeldItem() != null
|
||||
public void onBreak(final BlockEvent.HarvestDropsEvent event) {
|
||||
if (event.block instanceof BlockNightshadeBush && event.harvester != null
|
||||
&& event.harvester.getHeldItem() != null
|
||||
&& event.harvester.getHeldItem().getItem() instanceof ItemShears) {
|
||||
event.drops.clear();
|
||||
event.drops.add(new ItemStack(BlockRegistry.BlockNightshadeBush, 1, 0));
|
||||
|
||||
@@ -3,8 +3,6 @@ package taintedmagic.common.blocks;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -18,8 +16,11 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.registry.BlockRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockWarpwoodLeaves extends Block implements IShearable {
|
||||
|
||||
@@ -27,7 +28,7 @@ public class BlockWarpwoodLeaves extends Block implements IShearable {
|
||||
private IIcon opaqueIcon;
|
||||
private IIcon transparentIcon;
|
||||
|
||||
public BlockWarpwoodLeaves () {
|
||||
public BlockWarpwoodLeaves() {
|
||||
super(Material.leaves);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setLightOpacity(0);
|
||||
@@ -37,30 +38,32 @@ public class BlockWarpwoodLeaves extends Block implements IShearable {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public boolean shouldSideBeRendered (final IBlockAccess world, final int x, final int y, final int z, final int side) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(final IBlockAccess world, final int x, final int y, final int z,
|
||||
final int side) {
|
||||
return !Blocks.leaves.isOpaqueCube() || super.shouldSideBeRendered(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube () {
|
||||
public boolean isOpaqueCube() {
|
||||
return Blocks.leaves.isOpaqueCube();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon (final int side, final int meta) {
|
||||
public IIcon getIcon(final int side, final int meta) {
|
||||
return !Blocks.leaves.isOpaqueCube() ? transparentIcon : opaqueIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerBlockIcons (final IIconRegister ir) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(final IIconRegister ir) {
|
||||
opaqueIcon = ir.registerIcon("taintedmagic:BlockWarpwoodLeaves_opaque");
|
||||
transparentIcon = ir.registerIcon("taintedmagic:BlockWarpwoodLeaves_transparent");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock (final World world, final int x, final int y, final int z, final Block block, final int meta) {
|
||||
public void breakBlock(final World world, final int x, final int y, final int z, final Block block,
|
||||
final int meta) {
|
||||
final byte dist = 1;
|
||||
final int off = dist + 1;
|
||||
|
||||
@@ -81,11 +84,11 @@ public class BlockWarpwoodLeaves extends Block implements IShearable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick (final World world, final int x, final int y, final int z, final Random random) {
|
||||
public void updateTick(final World world, final int x, final int y, final int z, final Random random) {
|
||||
if (!world.isRemote) {
|
||||
final int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if ( (meta & 0x8) != 0 && (meta & 0x4) == 0) {
|
||||
if ((meta & 0x8) != 0 && (meta & 0x4) == 0) {
|
||||
final byte pos = 4;
|
||||
final int off = pos + 1;
|
||||
final byte dist = 32;
|
||||
@@ -103,13 +106,11 @@ public class BlockWarpwoodLeaves extends Block implements IShearable {
|
||||
final Block block = world.getBlock(x + i, y + j, z + k);
|
||||
|
||||
if (block != null && block.canSustainLeaves(world, x + i, y + j, z + k)) {
|
||||
adjacentTreeBlocks[ (i + half) * dist2 + (j + half) * dist + k + half] = 0;
|
||||
}
|
||||
else if (block != null && block.isLeaves(world, x + i, y + j, z + k)) {
|
||||
adjacentTreeBlocks[ (i + half) * dist2 + (j + half) * dist + k + half] = -2;
|
||||
}
|
||||
else {
|
||||
adjacentTreeBlocks[ (i + half) * dist2 + (j + half) * dist + k + half] = -1;
|
||||
adjacentTreeBlocks[(i + half) * dist2 + (j + half) * dist + k + half] = 0;
|
||||
} else if (block != null && block.isLeaves(world, x + i, y + j, z + k)) {
|
||||
adjacentTreeBlocks[(i + half) * dist2 + (j + half) * dist + k + half] = -2;
|
||||
} else {
|
||||
adjacentTreeBlocks[(i + half) * dist2 + (j + half) * dist + k + half] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -118,33 +119,40 @@ public class BlockWarpwoodLeaves extends Block implements IShearable {
|
||||
for (int j = -pos; j <= pos; j++) {
|
||||
for (int k = -pos; k <= pos; k++) {
|
||||
for (int l = -pos; l <= pos; l++) {
|
||||
if (adjacentTreeBlocks[ (j + half) * dist2 + (k + half) * dist + l + half] != i - 1) {
|
||||
if (adjacentTreeBlocks[(j + half) * dist2 + (k + half) * dist + l + half]
|
||||
!= i - 1) {
|
||||
continue;
|
||||
}
|
||||
if (adjacentTreeBlocks[ (j + half - 1) * dist2 + (k + half) * dist + l + half] == -2) {
|
||||
adjacentTreeBlocks[ (j + half - 1) * dist2 + (k + half) * dist + l + half] = i;
|
||||
if (adjacentTreeBlocks[(j + half - 1) * dist2 + (k + half) * dist + l + half]
|
||||
== -2) {
|
||||
adjacentTreeBlocks[(j + half - 1) * dist2 + (k + half) * dist + l + half] = i;
|
||||
}
|
||||
|
||||
if (adjacentTreeBlocks[ (j + half + 1) * dist2 + (k + half) * dist + l + half] == -2) {
|
||||
adjacentTreeBlocks[ (j + half + 1) * dist2 + (k + half) * dist + l + half] = i;
|
||||
if (adjacentTreeBlocks[(j + half + 1) * dist2 + (k + half) * dist + l + half]
|
||||
== -2) {
|
||||
adjacentTreeBlocks[(j + half + 1) * dist2 + (k + half) * dist + l + half] = i;
|
||||
}
|
||||
|
||||
if (adjacentTreeBlocks[ (j + half) * dist2 + (k + half - 1) * dist + l + half] == -2) {
|
||||
adjacentTreeBlocks[ (j + half) * dist2 + (k + half - 1) * dist + l + half] = i;
|
||||
if (adjacentTreeBlocks[(j + half) * dist2 + (k + half - 1) * dist + l + half]
|
||||
== -2) {
|
||||
adjacentTreeBlocks[(j + half) * dist2 + (k + half - 1) * dist + l + half] = i;
|
||||
}
|
||||
|
||||
if (adjacentTreeBlocks[ (j + half) * dist2 + (k + half + 1) * dist + l + half] == -2) {
|
||||
adjacentTreeBlocks[ (j + half) * dist2 + (k + half + 1) * dist + l + half] = i;
|
||||
if (adjacentTreeBlocks[(j + half) * dist2 + (k + half + 1) * dist + l + half]
|
||||
== -2) {
|
||||
adjacentTreeBlocks[(j + half) * dist2 + (k + half + 1) * dist + l + half] = i;
|
||||
}
|
||||
|
||||
if (adjacentTreeBlocks[ (j + half) * dist2 + (k + half) * dist + l + half - 1] == -2) {
|
||||
adjacentTreeBlocks[ (j + half) * dist2 + (k + half) * dist + l + half - 1] = i;
|
||||
if (adjacentTreeBlocks[(j + half) * dist2 + (k + half) * dist + l + half - 1]
|
||||
== -2) {
|
||||
adjacentTreeBlocks[(j + half) * dist2 + (k + half) * dist + l + half - 1] = i;
|
||||
}
|
||||
|
||||
if (adjacentTreeBlocks[ (j + half) * dist2 + (k + half) * dist + l + half + 1] != -2) {
|
||||
if (adjacentTreeBlocks[(j + half) * dist2 + (k + half) * dist + l + half + 1]
|
||||
!= -2) {
|
||||
continue;
|
||||
}
|
||||
adjacentTreeBlocks[ (j + half) * dist2 + (k + half) * dist + l + half + 1] = i;
|
||||
adjacentTreeBlocks[(j + half) * dist2 + (k + half) * dist + l + half + 1] = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -155,91 +163,91 @@ public class BlockWarpwoodLeaves extends Block implements IShearable {
|
||||
|
||||
if (adj >= 0) {
|
||||
world.setBlock(x, y, z, this, meta & 0xFFFFFFF7, 3);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
removeLeaves(world, x, y, z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void removeLeaves (final World world, final int x, final int y, final int z) {
|
||||
private void removeLeaves(final World world, final int x, final int y, final int z) {
|
||||
dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance (final World world, final int x, final int y, final int z, final int m, final float f,
|
||||
final int i) {
|
||||
public void dropBlockAsItemWithChance(final World world, final int x, final int y, final int z, final int m,
|
||||
final float f, final int i) {
|
||||
if (!world.isRemote && (m & 0x8) != 0 && (m & 0x4) == 0) {
|
||||
if ( (m & 0x1) == 0 && world.rand.nextInt(50) == 0) {
|
||||
if ((m & 0x1) == 0 && world.rand.nextInt(50) == 0) {
|
||||
dropBlockAsItem(world, x, y, z, new ItemStack(BlockRegistry.BlockWarpwoodSapling));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestBlock (final World world, final EntityPlayer player, final int x, final int y, final int z,
|
||||
public void harvestBlock(final World world, final EntityPlayer player, final int x, final int y, final int z,
|
||||
final int i) {
|
||||
super.harvestBlock(world, player, x, y, z, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped (final int i) {
|
||||
public int damageDropped(final int i) {
|
||||
return i & 0x1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped (final Random random) {
|
||||
public int quantityDropped(final Random random) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped (final int i, final Random random, final int i2) {
|
||||
public Item getItemDropped(final int i, final Random random, final int i2) {
|
||||
return Item.getItemById(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isLeaves (final IBlockAccess world, final int x, final int y, final int z) {
|
||||
public boolean isLeaves(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beginLeavesDecay (final World world, final int x, final int y, final int z) {
|
||||
public void beginLeavesDecay(final World world, final int x, final int y, final int z) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, world.getBlockMetadata(x, y, z) | 0x8, 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public int getBlockColor () {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBlockColor() {
|
||||
return 0xFFFFFF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock (final MovingObjectPosition mop, final World world, final int x, final int y, final int z) {
|
||||
public ItemStack getPickBlock(final MovingObjectPosition mop, final World world, final int x, final int y,
|
||||
final int z) {
|
||||
final int m = world.getBlockMetadata(x, y, z);
|
||||
return new ItemStack(this, 1, m & 0x1);
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int getRenderColor (final int m) {
|
||||
public int getRenderColor(final int m) {
|
||||
return 0xFFFFFF;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public int colorMultiplier (final IBlockAccess world, final int x, final int y, final int z) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
return 0xFFFFFF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShearable (final ItemStack stack, final IBlockAccess world, final int x, final int y, final int z) {
|
||||
public boolean isShearable(final ItemStack stack, final IBlockAccess world, final int x, final int y, final int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> onSheared (final ItemStack stack, final IBlockAccess world, final int x, final int y,
|
||||
public ArrayList<ItemStack> onSheared(final ItemStack stack, final IBlockAccess world, final int x, final int y,
|
||||
final int z, final int fortune) {
|
||||
final ArrayList drops = new ArrayList();
|
||||
drops.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z) & 0x3));
|
||||
@@ -247,12 +255,14 @@ public class BlockWarpwoodLeaves extends Block implements IShearable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability (final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z,
|
||||
final ForgeDirection face) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed (final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z,
|
||||
final ForgeDirection face) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,6 @@ package taintedmagic.common.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockRotatedPillar;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.particle.EffectRenderer;
|
||||
@@ -13,10 +11,13 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXWisp;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockWarpwoodLog extends BlockRotatedPillar {
|
||||
|
||||
@@ -24,7 +25,7 @@ public class BlockWarpwoodLog extends BlockRotatedPillar {
|
||||
private IIcon side;
|
||||
private IIcon knot;
|
||||
|
||||
public BlockWarpwoodLog () {
|
||||
public BlockWarpwoodLog() {
|
||||
super(Material.wood);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setHardness(2.5F);
|
||||
@@ -33,48 +34,46 @@ public class BlockWarpwoodLog extends BlockRotatedPillar {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
protected IIcon getTopIcon (final int meta) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
protected IIcon getTopIcon(final int meta) {
|
||||
return top;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
protected IIcon getSideIcon (final int meta) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
protected IIcon getSideIcon(final int meta) {
|
||||
return meta == 2 ? knot : side;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void registerBlockIcons (final IIconRegister ir) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(final IIconRegister ir) {
|
||||
side = ir.registerIcon("taintedmagic:BlockWarpwoodLog_side");
|
||||
top = ir.registerIcon("taintedmagic:BlockWarpwoodLog_top");
|
||||
knot = ir.registerIcon("taintedmagic:BlockWarpwoodLog_knot");
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBlockHardness (final World world, final int x, final int y, final int z) {
|
||||
if (world.getBlockMetadata(x, y, z) == 2)
|
||||
return 25.0F;
|
||||
public float getBlockHardness(final World world, final int x, final int y, final int z) {
|
||||
if (world.getBlockMetadata(x, y, z) == 2) return 25.0F;
|
||||
return super.getBlockHardness(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops (final World world, final int x, final int y, final int z, final int meta,
|
||||
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int meta,
|
||||
final int fortune) {
|
||||
final ArrayList<ItemStack> drops = new ArrayList<>();
|
||||
|
||||
if (meta == 2) {
|
||||
drops.add(new ItemStack(ConfigItems.itemResource, world.rand.nextInt(5) + 1, 17));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
drops.add(new ItemStack(this, 1, 0));
|
||||
}
|
||||
return drops;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addDestroyEffects (final World world, final int x, final int y, final int z, final int meta,
|
||||
public boolean addDestroyEffects(final World world, final int x, final int y, final int z, final int meta,
|
||||
final EffectRenderer ef) {
|
||||
if (meta == 2) {
|
||||
if (world.isRemote) {
|
||||
@@ -85,12 +84,16 @@ public class BlockWarpwoodLog extends BlockRotatedPillar {
|
||||
return super.addDestroyEffects(world, x, y, z, meta, ef);
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
private void particles (final World world, final int x, final int y, final int z) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void particles(final World world, final int x, final int y, final int z) {
|
||||
for (int i = 0; i < 15; i++) {
|
||||
final FXWisp fx = new FXWisp(world, x + 0.5D + (Math.random() - Math.random()) * 0.5D,
|
||||
y + 0.5D + (Math.random() - Math.random()) * 0.5D, z + 0.5D + (Math.random() - Math.random()) * 0.5D,
|
||||
0.25F + (float) Math.random() * 0.25F, 5);
|
||||
final FXWisp fx = new FXWisp(
|
||||
world,
|
||||
x + 0.5D + (Math.random() - Math.random()) * 0.5D,
|
||||
y + 0.5D + (Math.random() - Math.random()) * 0.5D,
|
||||
z + 0.5D + (Math.random() - Math.random()) * 0.5D,
|
||||
0.25F + (float) Math.random() * 0.25F,
|
||||
5);
|
||||
|
||||
fx.setGravity(0.01F);
|
||||
|
||||
@@ -102,22 +105,24 @@ public class BlockWarpwoodLog extends BlockRotatedPillar {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSustainLeaves (final IBlockAccess world, final int x, final int y, final int z) {
|
||||
public boolean canSustainLeaves(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWood (final IBlockAccess world, final int x, final int y, final int z) {
|
||||
public boolean isWood(final IBlockAccess world, final int x, final int y, final int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability (final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFlammability(final IBlockAccess world, final int x, final int y, final int z,
|
||||
final ForgeDirection face) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed (final IBlockAccess world, final int x, final int y, final int z, final ForgeDirection face) {
|
||||
public int getFireSpreadSpeed(final IBlockAccess world, final int x, final int y, final int z,
|
||||
final ForgeDirection face) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,12 @@ package taintedmagic.common.blocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
|
||||
public class BlockWarpwoodPlanks extends Block {
|
||||
|
||||
public BlockWarpwoodPlanks () {
|
||||
public BlockWarpwoodPlanks() {
|
||||
super(Material.wood);
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setBlockName("BlockWarpwoodPlanks");
|
||||
|
||||
@@ -3,8 +3,6 @@ package taintedmagic.common.blocks;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockSapling;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -12,19 +10,22 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import taintedmagic.common.TaintedMagic;
|
||||
import taintedmagic.common.world.WorldGenWarpwoodTree;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockWarpwoodSapling extends BlockSapling {
|
||||
|
||||
public BlockWarpwoodSapling () {
|
||||
public BlockWarpwoodSapling() {
|
||||
setCreativeTab(TaintedMagic.tabTM);
|
||||
setBlockName("BlockWarpwoodSapling");
|
||||
setStepSound(soundTypeGrass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_149878_d (final World world, final int x, final int y, final int z, final Random random) {
|
||||
public void func_149878_d(final World world, final int x, final int y, final int z, final Random random) {
|
||||
if (!world.isRemote) {
|
||||
final int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
@@ -39,25 +40,25 @@ public class BlockWarpwoodSapling extends BlockSapling {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly (Side.CLIENT)
|
||||
public void getSubBlocks (final Item item, final CreativeTabs tab, final List list) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) {
|
||||
list.add(new ItemStack(this, 1, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped (final int i, final Random random, final int i2) {
|
||||
public Item getItemDropped(final int i, final Random random, final int i2) {
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerBlockIcons (final IIconRegister ir) {
|
||||
public void registerBlockIcons(final IIconRegister ir) {
|
||||
blockIcon = ir.registerIcon("taintedmagic:BlockWarpwoodSapling");
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public IIcon getIcon (final int side, final int meta) {
|
||||
public IIcon getIcon(final int side, final int meta) {
|
||||
return blockIcon;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,39 @@
|
||||
package taintedmagic.common.blocks.tile;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import taintedmagic.common.blocks.BlockLumos;
|
||||
import thaumcraft.client.fx.ParticleEngine;
|
||||
import thaumcraft.client.fx.particles.FXSparkle;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class TileLumos extends TileEntity {
|
||||
|
||||
@Override
|
||||
public boolean canUpdate () {
|
||||
public boolean canUpdate() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity () {
|
||||
public void updateEntity() {
|
||||
if (getBlockType() instanceof BlockLumos && worldObj.rand.nextInt(15) == 0 && worldObj.isRemote) {
|
||||
spawnParticles();
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly (Side.CLIENT)
|
||||
private void spawnParticles () {
|
||||
final FXSparkle fx = new FXSparkle(worldObj, xCoord + 0.5D + worldObj.rand.nextGaussian() * 0.1D,
|
||||
yCoord + 0.5D + worldObj.rand.nextGaussian() * 0.1D, zCoord + 0.5D + worldObj.rand.nextGaussian() * 0.1D, 1.75F,
|
||||
6, 3 + worldObj.rand.nextInt(2));
|
||||
@SideOnly(Side.CLIENT)
|
||||
private void spawnParticles() {
|
||||
final FXSparkle fx = new FXSparkle(
|
||||
worldObj,
|
||||
xCoord + 0.5D + worldObj.rand.nextGaussian() * 0.1D,
|
||||
yCoord + 0.5D + worldObj.rand.nextGaussian() * 0.1D,
|
||||
zCoord + 0.5D + worldObj.rand.nextGaussian() * 0.1D,
|
||||
1.75F,
|
||||
6,
|
||||
3 + worldObj.rand.nextInt(2));
|
||||
fx.slowdown = true;
|
||||
fx.setGravity(-0.5F);
|
||||
ParticleEngine.instance.addEffect(worldObj, fx);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user