mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 19:39:07 +00:00
Change to Hitbox to use Scale instead
This commit is contained in:
1 parent
e3c41ad856
commit
1e51d6b243
4 files changed
+26
-25
No files matched your search
@@ -4,15 +4,15 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class HitboxData {
|
||||
|
||||
private float width = 1f;
|
||||
private float height = 1.8f;
|
||||
private float widthScale = 1f;
|
||||
private float heightScale = 1f;
|
||||
private boolean hitboxEnabled = false;
|
||||
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
nbttagcompound.setBoolean("HitboxEnabled", hitboxEnabled);
|
||||
if(hitboxEnabled) {
|
||||
nbttagcompound.setFloat("HitboxWidth", width);
|
||||
nbttagcompound.setFloat("HitboxHeight", height);
|
||||
nbttagcompound.setFloat("HitboxWidthScale", widthScale);
|
||||
nbttagcompound.setFloat("HitboxHeightScale", heightScale);
|
||||
}
|
||||
return nbttagcompound;
|
||||
}
|
||||
@@ -20,25 +20,25 @@ public class HitboxData {
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
hitboxEnabled = nbttagcompound.getBoolean("HitboxEnabled");
|
||||
if(hitboxEnabled) {
|
||||
width = nbttagcompound.getFloat("HitboxWidth");
|
||||
height = nbttagcompound.getFloat("HitboxHeight");
|
||||
widthScale = nbttagcompound.getFloat("HitboxWidthScale");
|
||||
heightScale = nbttagcompound.getFloat("HitboxHeightScale");
|
||||
}
|
||||
}
|
||||
|
||||
public float getWidth() {
|
||||
return width;
|
||||
public float getWidthScale() {
|
||||
return widthScale;
|
||||
}
|
||||
|
||||
public void setWidth(float width) {
|
||||
this.width = width;
|
||||
public void setWidthScale(float widthScale) {
|
||||
this.widthScale = widthScale;
|
||||
}
|
||||
|
||||
public float getHeight() {
|
||||
return height;
|
||||
public float getHeightScale() {
|
||||
return heightScale;
|
||||
}
|
||||
|
||||
public void setHeight(float height) {
|
||||
this.height = height;
|
||||
public void setHeightScale(float heightScale) {
|
||||
this.heightScale = heightScale;
|
||||
}
|
||||
|
||||
public boolean isHitboxEnabled() {
|
||||
|
||||
Reference in new issue
Block a user