Thanks to visit codestin.com
Credit goes to github.com

Skip to content

irv77/EaglerBlockBounds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

EBB LogoEagler Block Bounds Tool v1.0

Simple tool for converting blockbench hitboxes to eaglercraft.
With bonus hitbox rotation code! (Please credit if used)

Preview


Versions

v1.0 - Base source code


Ussage

  1. Use java model inside of blockbench
  2. Create box around model for desired hitbox
  3. Copy the box's position and size and input into tool
  4. Copy exported eaglercraft code
  5. Use the code!

Hitbock Rotation Code

Replace values inside of float[] bounds = {}; with output from tool.

float[] bounds = {0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F};

public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) {
    EnumFacing enumfacing = worldIn.getBlockState(pos).getValue(FACING);
    this.setBlockBounds(bounds[0], bounds[1], bounds[2], bounds[3], bounds[4], bounds[5]);
    if (enumfacing == EnumFacing.NORTH) {
        this.setBlockBounds(bounds[0], bounds[1], bounds[2], bounds[3], bounds[4], bounds[5]);
    } else if (enumfacing == EnumFacing.SOUTH) {
        this.setBlockBounds(1.0F - bounds[3], bounds[1], 1.0F - bounds[5], 1.0F - bounds[0], bounds[4], 1.0F - bounds[2]);
    } else if (enumfacing == EnumFacing.EAST) {
        this.setBlockBounds(1.0F - bounds[5], bounds[1], bounds[0], 1.0F - bounds[2], bounds[4], bounds[3]);
    } else if (enumfacing == EnumFacing.WEST) {
        this.setBlockBounds(bounds[2], bounds[1], 1.0F - bounds[3], bounds[5], bounds[4], 1.0F - bounds[0]);
    }
}

Finally here is the live version of the code!

About

Tool for making Eaglercraft hitboxes.

Resources

Stars

Watchers

Forks