net.minecraft.block.BlockPane Java Examples

The following examples show how to use net.minecraft.block.BlockPane. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HighJump.java    From LiquidBounce with GNU General Public License v3.0 6 votes vote down vote up
@EventTarget
public void onUpdate(final UpdateEvent event) {
    if(glassValue.get() && !(BlockUtils.getBlock(new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ)) instanceof BlockPane))
        return;

    switch(modeValue.get().toLowerCase()) {
        case "damage":
            if(mc.thePlayer.hurtTime > 0 && mc.thePlayer.onGround)
                mc.thePlayer.motionY += 0.42F * heightValue.get();
            break;
        case "aacv3":
            if(!mc.thePlayer.onGround) mc.thePlayer.motionY += 0.059D;
            break;
        case "dac":
            if(!mc.thePlayer.onGround) mc.thePlayer.motionY += 0.049999;
            break;
        case "mineplex":
            if(!mc.thePlayer.onGround) MovementUtils.strafe(0.35F);
            break;
    }
}
 
Example #2
Source File: HighJump.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@EventTarget
public void onMove(final MoveEvent event) {
    if(glassValue.get() && !(BlockUtils.getBlock(new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ)) instanceof BlockPane))
        return;

    if(!mc.thePlayer.onGround) {
        if ("mineplex".equals(modeValue.get().toLowerCase())) {
            mc.thePlayer.motionY += mc.thePlayer.fallDistance == 0 ? 0.0499D : 0.05D;
        }
    }
}
 
Example #3
Source File: HighJump.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@EventTarget
public void onJump(final JumpEvent event) {
    if(glassValue.get() && !(BlockUtils.getBlock(new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ)) instanceof BlockPane))
        return;

    switch(modeValue.get().toLowerCase()) {
        case "vanilla":
            event.setMotion(event.getMotion() * heightValue.get());
            break;
        case "mineplex":
            event.setMotion(0.47F);
            break;
    }
}
 
Example #4
Source File: TileEntityQuantumComputer.java    From qcraft-mod with Apache License 2.0 5 votes vote down vote up
private boolean isGlass( int x, int y, int z )
{
    if( y < 0 || y >= 256 )
    {
        return false;
    }

    Block block = worldObj.getBlock( x, y, z );
    if( block.getMaterial() == Material.glass && !(block instanceof BlockPane) )
    {
        return true;
    }
    return false;
}
 
Example #5
Source File: CarvableHelper.java    From Chisel with GNU General Public License v2.0 4 votes vote down vote up
public void registerBlockIcons(String modName, Block block, IIconRegister register)
{
    for(CarvableVariation variation : variations)
    {
        if(variation.block != null)
        {
            variation.block.registerBlockIcons(register);

            if(variation.block instanceof BlockPane)
            {
                variation.icon = variation.block.getBlockTextureFromSide(2);
                variation.iconTop = ((BlockPane) variation.block).getBlockTextureFromSide(0);
                variation.iconBot = ((BlockPane) variation.block).getBlockTextureFromSide(0);

            } else
            {
                switch(variation.kind)
                {
                    case 0:
                        variation.icon = variation.block.getIcon(2, variation.blockMeta);
                        break;
                    case 1:
                        variation.icon = variation.block.getIcon(2, variation.blockMeta);
                        variation.iconTop = variation.block.getIcon(0, variation.blockMeta);
                        break;
                    case 2:
                        variation.icon = variation.block.getIcon(2, variation.blockMeta);
                        variation.iconTop = variation.block.getIcon(1, variation.blockMeta);
                        variation.iconBot = variation.block.getIcon(0, variation.blockMeta);
                        break;
                }
            }
        } else
        {
            switch(variation.kind)
            {
                case 0:
                    variation.icon = register.registerIcon(modName + ":" + variation.texture);
                    break;
                case 1:
                    variation.icon = register.registerIcon(modName + ":" + variation.texture + "-side");
                    variation.iconTop = register.registerIcon(modName + ":" + variation.texture + "-top");
                    break;
                case 2:
                    variation.icon = register.registerIcon(modName + ":" + variation.texture + "-side");
                    variation.iconTop = register.registerIcon(modName + ":" + variation.texture + "-top");
                    variation.iconBot = register.registerIcon(modName + ":" + variation.texture + "-bottom");
                    break;
                case 3:
                    CarvableVariationCTM ctm = new CarvableVariationCTM();
                    ctm.seams[0] = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctm1"), 4, 4);
                    ctm.seams[1] = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctm2"), 4, 4);
                    ctm.seams[2] = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctm3"), 4, 4);
                    variation.ctm = ctm;
                    break;
                case 4:
                    variation.seamsCtmVert = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctmv"), 2, 2);
                    variation.iconTop = register.registerIcon(modName + ":" + variation.texture + "-top");
                    break;
                case 5:
                    variation.seamsCtmVert = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctmh"), 2, 2);
                    variation.iconTop = register.registerIcon(modName + ":" + variation.texture + "-top");
                    break;
                case V9:
                    variation.variations9 = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-v9"), 3, 3);
                    break;
                case V4:
                    variation.variations9 = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-v4"), 2, 2);
                    break;
                case CTMX:
                    variation.icon = register.registerIcon(modName + ":" + variation.texture);
                    variation.submap = new TextureSubmap(register.registerIcon(modName + ":" + variation.texture + "-ctm"), 4, 4);
                    variation.submapSmall = new TextureSubmap(variation.icon, 2, 2);
                    break;
            }
        }
    }
}