content: package mod.acgaming.universaltweaks.tweaks.blocks.fencewalljump;
  
  import java.util.Arrays;
  import java.util.HashSet;
  import java.util.Set;
  
  import net.minecraft.client.entity.EntityPlayerSP;
  import net.minecraft.util.math.AxisAlignedBB;
  import net.minecraft.util.math.BlockPos;
  import net.minecraft.world.World;
  import net.minecraftforge.event.entity.living.LivingEvent;
  import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
  
  import mod.acgaming.universaltweaks.UniversalTweaks;
  import mod.acgaming.universaltweaks.config.UTConfigGeneral;
  
  // Courtesy of TheRealp455w0rd
  public class UTFenceWallJump
  {
      protected static final AxisAlignedBB[] FENCE_WALL_AABBS = new AxisAlignedBB[]
          {
              new AxisAlignedBB(0.375D, 0.0D, 0.375D, 0.625D, 1.0D, 0.625D),
              new AxisAlignedBB(0.375D, 0.0D, 0.375D, 0.625D, 1.0D, 1.0D),
              new AxisAlignedBB(0.0D, 0.0D, 0.375D, 0.625D, 1.0D, 0.625D),
              new AxisAlignedBB(0.0D, 0.0D, 0.375D, 0.625D, 1.0D, 1.0D),
              new AxisAlignedBB(0.375D, 0.0D, 0.0D, 0.625D, 1.0D, 0.625D),
              new AxisAlignedBB(0.375D, 0.0D, 0.0D, 0.625D, 1.0D, 1.0D),
              new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.625D, 1.0D, 0.625D),
              new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.625D, 1.0D, 1.0D),
              new AxisAlignedBB(0.375D, 0.0D, 0.375D, 1.0D, 1.0D, 0.625D),
              new AxisAlignedBB(0.375D, 0.0D, 0.375D, 1.0D, 1.0D, 1.0D),
              new AxisAlignedBB(0.0D, 0.0D, 0.375D, 1.0D, 1.0D, 0.625D),
              new AxisAlignedBB(0.0D, 0.0D, 0.375D, 1.0D, 1.0D, 1.0D),
              new AxisAlignedBB(0.375D, 0.0D, 0.0D, 1.0D, 1.0D, 0.625D),
              new AxisAlignedBB(0.375D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D),
              new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.625D),
              new AxisAlignedBB(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D),
              new AxisAlignedBB(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 1.0D),
              new AxisAlignedBB(0.0D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D),
              new AxisAlignedBB(0.0D, 0.0D, 0.25D, 0.75D, 1.0D, 1.0D),
              new AxisAlignedBB(0.25D, 0.0D, 0.0D, 0.75D, 1.0D, 0.75D),
              new AxisAlignedBB(0.3125D, 0.0D, 0.0D, 0.6875D, 0.875D, 1.0D),
              new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.75D, 1.0D, 0.75D),
              new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.75D, 1.0D, 1.0D),
              new AxisAlignedBB(0.25D, 0.0D, 0.25D, 1.0D, 1.0D, 0.75D),
              new AxisAlignedBB(0.25D, 0.0D, 0.25D, 1.0D, 1.0D, 1.0D),
              new AxisAlignedBB(0.0D, 0.0D, 0.3125D, 1.0D, 0.875D, 0.6875D),
              new AxisAlignedBB(0.0D, 0.0D, 0.25D, 1.0D, 1.0D, 1.0D),
              new AxisAlignedBB(0.25D, 0.0D, 0.0D, 1.0D, 1.0D, 0.75D),
              new AxisAlignedBB(0.25D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D),
              new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.75D)
          };
  
      public static final Set<AxisAlignedBB> FENCE_WALL_SET = new HashSet<>(Arrays.asList(FENCE_WALL_AABBS));
  
      @SubscribeEvent
      public static void utOnJump(LivingEvent.LivingJumpEvent event)
      {
          if (UTConfigGeneral.DEBUG.utDebugToggle) UniversalTweaks.LOGGER.debug("UTFenceWallJump ::: Jump event");
          if (event.getEntity() instanceof EntityPlayerSP)
          {
              EntityPlayerSP player = (EntityPlayerSP) event.getEntity();
              if (player.movementInput.jump && isPlayerNextToFence(player)) player.motionY += 0.05;
          }
      }
  
      public static boolean isPlayerNextToFence(EntityPlayerSP player)
      {
          World world = player.getEntityWorld();
          double x = player.posX - 1.0D;
          double y = player.posY;
          double z = player.posZ - 1.0D;
          for (int i = 0; i < 3; i++)
          {
              for (int j = 0; j < 3; j++)
              {
                  if (i != x || j != z)
                  {
                      BlockPos pos = new BlockPos(x + i, y, z + j);
                      AxisAlignedBB boundingBox = world.getBlockState(pos).getBoundingBox(world, pos);
                      if (FENCE_WALL_SET.contains(boundingBox)) return true;
                  }
              }
          }
          return false;
      }
  }