Let the entire bounding box for non-players be edited so sayth the lord
This commit is contained in:
parent
631bc893f4
commit
62febe6d39
@ -9,6 +9,7 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class ReflectionManager {
|
public class ReflectionManager {
|
||||||
@ -267,13 +268,17 @@ public class ReflectionManager {
|
|||||||
z = field.getDouble(boundingBox);
|
z = field.getDouble(boundingBox);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
field.setDouble(boundingBox, x + newBox.getX());
|
if (entity.getType() != EntityType.PLAYER) {
|
||||||
|
field.setDouble(boundingBox, x + newBox.getX());
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
field.setDouble(boundingBox, y + newBox.getY());
|
field.setDouble(boundingBox, y + newBox.getY());
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
field.setDouble(boundingBox, z + newBox.getZ());
|
if (entity.getType() != EntityType.PLAYER) {
|
||||||
|
field.setDouble(boundingBox, z + newBox.getZ());
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Exception("Error while setting the bounding box, more doubles than I thought??");
|
throw new Exception("Error while setting the bounding box, more doubles than I thought??");
|
||||||
@ -289,8 +294,10 @@ public class ReflectionManager {
|
|||||||
public static void setSize(Entity entity, float[] size) {
|
public static void setSize(Entity entity, float[] size) {
|
||||||
try {
|
try {
|
||||||
getNmsClass("Entity").getField("length").setFloat(getNmsEntity(entity), size[0]);
|
getNmsClass("Entity").getField("length").setFloat(getNmsEntity(entity), size[0]);
|
||||||
// getNmsClass("Entity").getField("width").setFloat(getNmsEntity(entity), size[1]);
|
if (entity.getType() != EntityType.PLAYER) {
|
||||||
// getNmsClass("Entity").getField("height").setFloat(getNmsEntity(entity), size[2]);
|
getNmsClass("Entity").getField("width").setFloat(getNmsEntity(entity), size[1]);
|
||||||
|
getNmsClass("Entity").getField("height").setFloat(getNmsEntity(entity), size[2]);
|
||||||
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user