Fix a few minor TODOs in the blocks

This commit is contained in:
Cheeserolls 2015-04-06 19:57:02 +01:00
parent d6d75d7e40
commit 34840dc692
8 changed files with 24 additions and 29 deletions

View file

@ -15,6 +15,8 @@ import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.Item;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
@ -24,7 +26,6 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
//TODO: Commented methods and calls
public class BlockAsh extends BlockBOPGeneric
{
public BlockAsh()
@ -47,15 +48,12 @@ public class BlockAsh extends BlockBOPGeneric
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity)
{
/* TODO:
* if (entity instanceof EntityPlayer) { InventoryPlayer inventory =
* ((EntityPlayer)entity).inventory;
*
* if (inventory.armorInventory[0] != null &&
* inventory.armorInventory[0].getItem() == BOPCItems.wadingBoots) {
* return; } }
*/
if (entity instanceof EntityPlayer) {
InventoryPlayer inventory = ((EntityPlayer)entity).inventory;
if (inventory.armorInventory[0] != null && inventory.armorInventory[0].getItem() == BOPItems.wading_boots) {
return;
}
}
entity.motionX *= 0.4D;
entity.motionZ *= 0.4D;
}

View file

@ -15,9 +15,6 @@ import net.minecraft.block.properties.IProperty;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemBlock;
//TODO: work out how statemapper works, use it to ignore the powered property when generating models
//see: package net.minecraft.client.renderer BlockModelShapes registerAllBlocks
//this kind of thing going on: this.registerBlockWithStateMapper(Blocks.oak_fence_gate, (new StateMap.Builder()).addPropertiesToIgnore(new IProperty[] {BlockFenceGate.POWERED}).build());
public class BlockBOPFenceGate extends BlockFenceGate implements IBOPBlock
{

View file

@ -231,9 +231,9 @@ public class BlockBOPFlower1 extends BlockDecoration {
IBlockState groundState = world.getBlockState(pos.down());
Block groundBlock = groundState.getBlock();
boolean onFertile = (groundBlock == Blocks.dirt || groundBlock == Blocks.farmland || groundBlock == BOPBlocks.dirt || groundBlock == Blocks.grass /* TODO: || groundBlock == BOPBlocks.overgrown_netherrack */);
boolean onFertile = (groundBlock == Blocks.dirt || groundBlock == Blocks.farmland || groundBlock == BOPBlocks.dirt || groundBlock == Blocks.grass);
boolean onDry = (groundBlock == BOPBlocks.hard_dirt || groundBlock == Blocks.hardened_clay || groundBlock == Blocks.sand || groundBlock == BOPBlocks.hard_sand);
boolean onNetherrack = (groundBlock == Blocks.netherrack /* TODO: || groundBlock == BOPBlocks.overgrown_netherrack */);
boolean onNetherrack = (groundBlock == Blocks.netherrack);
boolean onSpectralMoss = false;
if (groundBlock instanceof BlockBOPGrass)
@ -243,9 +243,11 @@ public class BlockBOPFlower1 extends BlockDecoration {
case SPECTRAL_MOSS:
onSpectralMoss = true;
break;
case SMOLDERING: case ORIGIN: // origin should only support roses
case OVERGROWN_NETHERRACK:
onFertile = true;
onNetherrack = true;
break;
case LOAMY: case SANDY: case SILTY: default:
case LOAMY: case SANDY: case SILTY: case ORIGIN: default:
onFertile = true;
break;
}

View file

@ -23,6 +23,7 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
// TODO: where have lily flowers and lilyofthevalley gone?
// TODO implement as paged block
public class BlockBOPFlower2 extends BlockDecoration {
// add properties
@ -106,7 +107,7 @@ public class BlockBOPFlower2 extends BlockDecoration {
IBlockState groundState = world.getBlockState(pos.down());
Block groundBlock = groundState.getBlock();
boolean onFertile = (groundBlock == Blocks.dirt || groundBlock == Blocks.farmland || groundBlock == BOPBlocks.dirt || groundBlock == Blocks.grass /* TODO: || groundBlock == BOPBlocks.overgrown_netherrack */);
boolean onFertile = (groundBlock == Blocks.dirt || groundBlock == Blocks.farmland || groundBlock == BOPBlocks.dirt || groundBlock == Blocks.grass);
boolean onStone = (groundBlock == Blocks.stone);
boolean onOrigin = false;
@ -116,10 +117,7 @@ public class BlockBOPFlower2 extends BlockDecoration {
{
case SPECTRAL_MOSS: case SMOLDERING:
break;
case ORIGIN: // origin should only support rose
onOrigin = true;
break;
case LOAMY: case SANDY: case SILTY: default:
case LOAMY: case SANDY: case SILTY: case OVERGROWN_NETHERRACK: case ORIGIN: default:
onFertile = true;
break;
}

View file

@ -112,7 +112,7 @@ public class BlockBOPMushroom extends BlockDecoration
Block groundBlock = groundState.getBlock();
boolean onFertile = (groundBlock == Blocks.dirt || groundBlock == BOPBlocks.dirt || groundBlock == Blocks.mycelium || groundBlock == Blocks.grass);
boolean onNetherrack = (groundBlock == Blocks.netherrack /* TODO: || groundBlock == BOPBlocks.overgrown_netherrack */);
boolean onNetherrack = (groundBlock == Blocks.netherrack);
boolean onStone = (groundBlock == Blocks.stone || groundBlock == BOPBlocks.stone); // TODO: hard dirt too? the other edge cases?
boolean onEndstone = (groundBlock == Blocks.end_stone);
@ -123,9 +123,12 @@ public class BlockBOPMushroom extends BlockDecoration
case SPECTRAL_MOSS:
onEndstone = true;
break;
case SMOLDERING: case ORIGIN: // origin should only support roses
case SMOLDERING:
break;
case LOAMY: case SANDY: case SILTY: default:
case OVERGROWN_NETHERRACK:
onFertile = true;
onNetherrack = true;
case LOAMY: case SANDY: case SILTY: case ORIGIN: default:
onFertile = true;
break;
}

View file

@ -24,7 +24,6 @@ import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
// TODO: do we need LEVEL?
public class BlockCoral extends BlockDecoration
{

View file

@ -41,8 +41,6 @@ import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
// TODO use a different class for flax (FLAXBOTTOM and FLAXTOP) as it's so unusual
public class BlockFoliage extends BlockDecoration implements IShearable
{

View file

@ -86,7 +86,7 @@ public class BlockFruit extends BlockDecoration
public boolean canBlockStay(World world, BlockPos pos, IBlockState state)
{
Block blockAbove = world.getBlockState(pos.up()).getBlock();
return blockAbove == Blocks.leaves || blockAbove == Blocks.leaves2; /* TODO: add BOP leave types - maybe check the material instead? */
return (blockAbove instanceof BlockBOPLeaves) || blockAbove == Blocks.leaves || blockAbove == Blocks.leaves2;
}
// map states to the corresponding fruit item