mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 22:15:06 +00:00
More Class Refactoring for TintData and HitboxData
This commit is contained in:
1 parent
982ceb4aa4
commit
0b73ae91bb
10 files changed
+379
-387
No files matched your search
@@ -0,0 +1,51 @@
|
||||
package noppes.npcs.controllers.data;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class HitboxData {
|
||||
|
||||
private float width = 1f;
|
||||
private float height = 1.8f;
|
||||
private boolean hitboxEnabled = false;
|
||||
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
nbttagcompound.setBoolean("HitboxEnabled", hitboxEnabled);
|
||||
if(hitboxEnabled) {
|
||||
nbttagcompound.setFloat("HitboxWidth", width);
|
||||
nbttagcompound.setFloat("HitboxHeight", height);
|
||||
}
|
||||
return nbttagcompound;
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
hitboxEnabled = nbttagcompound.getBoolean("CustomHitbox");
|
||||
if(hitboxEnabled) {
|
||||
width = nbttagcompound.getFloat("HitboxWidth");
|
||||
height = nbttagcompound.getFloat("HitboxHeight");
|
||||
}
|
||||
}
|
||||
|
||||
public float getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public void setWidth(float width) {
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
public float getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public void setHeight(float height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public boolean isHitboxEnabled() {
|
||||
return hitboxEnabled;
|
||||
}
|
||||
|
||||
public void setHitboxEnabled(boolean hitboxEnabled) {
|
||||
this.hitboxEnabled = hitboxEnabled;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user