Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.retrodaredevil;
- import org.bukkit.Location;
- import org.bukkit.entity.Entity;
- import org.bukkit.entity.Player;
- public class Hitbox { // class made by retrodaredevil. Feel free to use in your own plugin without permission. Feel free to edit this.
- Entity e = null;
- Location low = null;
- Location high = null;
- public Hitbox(Player p){
- e = p;
- low = p.getLocation().clone().add(-0.3, 0, -0.3);
- high = p.getLocation().clone().add(0.3, 1.8, 0.3);
- }
- public Hitbox(Location low, Location high){
- this.low = low;
- this.high = high;
- }
- public boolean contains(Location l){
- if(low.getX() <= l.getX() && low.getY() <= l.getY() && l.getZ() <= l.getZ() && high.getX() >= l.getX() && high.getY() >= l.getY() && high.getZ() >= l.getZ()){
- return true;
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement