Fix a few minor TODOs in the blocks
This commit is contained in:
parent
d6d75d7e40
commit
34840dc692
8 changed files with 24 additions and 29 deletions
|
@ -15,6 +15,8 @@ import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.Entity;
|
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.item.Item;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.util.BlockPos;
|
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.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
//TODO: Commented methods and calls
|
|
||||||
public class BlockAsh extends BlockBOPGeneric
|
public class BlockAsh extends BlockBOPGeneric
|
||||||
{
|
{
|
||||||
public BlockAsh()
|
public BlockAsh()
|
||||||
|
@ -47,15 +48,12 @@ public class BlockAsh extends BlockBOPGeneric
|
||||||
@Override
|
@Override
|
||||||
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity)
|
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity)
|
||||||
{
|
{
|
||||||
/* TODO:
|
if (entity instanceof EntityPlayer) {
|
||||||
* if (entity instanceof EntityPlayer) { InventoryPlayer inventory =
|
InventoryPlayer inventory = ((EntityPlayer)entity).inventory;
|
||||||
* ((EntityPlayer)entity).inventory;
|
if (inventory.armorInventory[0] != null && inventory.armorInventory[0].getItem() == BOPItems.wading_boots) {
|
||||||
*
|
return;
|
||||||
* if (inventory.armorInventory[0] != null &&
|
}
|
||||||
* inventory.armorInventory[0].getItem() == BOPCItems.wadingBoots) {
|
}
|
||||||
* return; } }
|
|
||||||
*/
|
|
||||||
|
|
||||||
entity.motionX *= 0.4D;
|
entity.motionX *= 0.4D;
|
||||||
entity.motionZ *= 0.4D;
|
entity.motionZ *= 0.4D;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,9 +15,6 @@ import net.minecraft.block.properties.IProperty;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.item.ItemBlock;
|
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
|
public class BlockBOPFenceGate extends BlockFenceGate implements IBOPBlock
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -231,9 +231,9 @@ public class BlockBOPFlower1 extends BlockDecoration {
|
||||||
IBlockState groundState = world.getBlockState(pos.down());
|
IBlockState groundState = world.getBlockState(pos.down());
|
||||||
Block groundBlock = groundState.getBlock();
|
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 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;
|
boolean onSpectralMoss = false;
|
||||||
|
|
||||||
if (groundBlock instanceof BlockBOPGrass)
|
if (groundBlock instanceof BlockBOPGrass)
|
||||||
|
@ -243,9 +243,11 @@ public class BlockBOPFlower1 extends BlockDecoration {
|
||||||
case SPECTRAL_MOSS:
|
case SPECTRAL_MOSS:
|
||||||
onSpectralMoss = true;
|
onSpectralMoss = true;
|
||||||
break;
|
break;
|
||||||
case SMOLDERING: case ORIGIN: // origin should only support roses
|
case OVERGROWN_NETHERRACK:
|
||||||
|
onFertile = true;
|
||||||
|
onNetherrack = true;
|
||||||
break;
|
break;
|
||||||
case LOAMY: case SANDY: case SILTY: default:
|
case LOAMY: case SANDY: case SILTY: case ORIGIN: default:
|
||||||
onFertile = true;
|
onFertile = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
// TODO: where have lily flowers and lilyofthevalley gone?
|
// TODO: where have lily flowers and lilyofthevalley gone?
|
||||||
|
// TODO implement as paged block
|
||||||
public class BlockBOPFlower2 extends BlockDecoration {
|
public class BlockBOPFlower2 extends BlockDecoration {
|
||||||
|
|
||||||
// add properties
|
// add properties
|
||||||
|
@ -106,7 +107,7 @@ public class BlockBOPFlower2 extends BlockDecoration {
|
||||||
IBlockState groundState = world.getBlockState(pos.down());
|
IBlockState groundState = world.getBlockState(pos.down());
|
||||||
Block groundBlock = groundState.getBlock();
|
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 onStone = (groundBlock == Blocks.stone);
|
||||||
boolean onOrigin = false;
|
boolean onOrigin = false;
|
||||||
|
|
||||||
|
@ -116,10 +117,7 @@ public class BlockBOPFlower2 extends BlockDecoration {
|
||||||
{
|
{
|
||||||
case SPECTRAL_MOSS: case SMOLDERING:
|
case SPECTRAL_MOSS: case SMOLDERING:
|
||||||
break;
|
break;
|
||||||
case ORIGIN: // origin should only support rose
|
case LOAMY: case SANDY: case SILTY: case OVERGROWN_NETHERRACK: case ORIGIN: default:
|
||||||
onOrigin = true;
|
|
||||||
break;
|
|
||||||
case LOAMY: case SANDY: case SILTY: default:
|
|
||||||
onFertile = true;
|
onFertile = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ public class BlockBOPMushroom extends BlockDecoration
|
||||||
Block groundBlock = groundState.getBlock();
|
Block groundBlock = groundState.getBlock();
|
||||||
|
|
||||||
boolean onFertile = (groundBlock == Blocks.dirt || groundBlock == BOPBlocks.dirt || groundBlock == Blocks.mycelium || groundBlock == Blocks.grass);
|
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 onStone = (groundBlock == Blocks.stone || groundBlock == BOPBlocks.stone); // TODO: hard dirt too? the other edge cases?
|
||||||
boolean onEndstone = (groundBlock == Blocks.end_stone);
|
boolean onEndstone = (groundBlock == Blocks.end_stone);
|
||||||
|
|
||||||
|
@ -123,9 +123,12 @@ public class BlockBOPMushroom extends BlockDecoration
|
||||||
case SPECTRAL_MOSS:
|
case SPECTRAL_MOSS:
|
||||||
onEndstone = true;
|
onEndstone = true;
|
||||||
break;
|
break;
|
||||||
case SMOLDERING: case ORIGIN: // origin should only support roses
|
case SMOLDERING:
|
||||||
break;
|
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;
|
onFertile = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,6 @@ import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
// TODO: do we need LEVEL?
|
|
||||||
public class BlockCoral extends BlockDecoration
|
public class BlockCoral extends BlockDecoration
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -41,8 +41,6 @@ import net.minecraftforge.common.util.FakePlayer;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
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
|
public class BlockFoliage extends BlockDecoration implements IShearable
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ public class BlockFruit extends BlockDecoration
|
||||||
public boolean canBlockStay(World world, BlockPos pos, IBlockState state)
|
public boolean canBlockStay(World world, BlockPos pos, IBlockState state)
|
||||||
{
|
{
|
||||||
Block blockAbove = world.getBlockState(pos.up()).getBlock();
|
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
|
// map states to the corresponding fruit item
|
||||||
|
|
Loading…
Reference in a new issue