Fixes defaults for pasting entities. Gravity default is true not false

This commit is contained in:
tastybento 2024-12-29 17:08:34 -08:00
parent 629e65d0d4
commit de39aa8b43

View File

@ -132,15 +132,15 @@ public class BlueprintEntity {
@Expose @Expose
private double z; private double z;
@Expose @Expose
private boolean glowing; private Boolean glowing;
@Expose @Expose
private boolean gravity; private Boolean gravity;
@Expose @Expose
private boolean visualFire; private Boolean visualFire;
@Expose @Expose
private boolean silent; private Boolean silent;
@Expose @Expose
private boolean invulnerable; private Boolean invulnerable;
@Expose @Expose
private int fireTicks; private int fireTicks;
@ -149,6 +149,7 @@ public class BlueprintEntity {
* @param entity entity to serialize * @param entity entity to serialize
* @since 3.2.0 * @since 3.2.0
*/ */
@SuppressWarnings("deprecation")
public BlueprintEntity(Entity entity) { public BlueprintEntity(Entity entity) {
this.setType(entity.getType()); this.setType(entity.getType());
this.setCustomName(entity.getCustomName()); this.setCustomName(entity.getCustomName());
@ -568,6 +569,9 @@ public class BlueprintEntity {
* @return the glowing * @return the glowing
*/ */
public boolean isGlowing() { public boolean isGlowing() {
if (glowing == null) {
glowing = false; // Default
}
return glowing; return glowing;
} }
@ -582,6 +586,9 @@ public class BlueprintEntity {
* @return the gravity * @return the gravity
*/ */
public boolean isGravity() { public boolean isGravity() {
if (gravity == null) {
gravity = true;
}
return gravity; return gravity;
} }
@ -596,6 +603,9 @@ public class BlueprintEntity {
* @return the visualFire * @return the visualFire
*/ */
public boolean isVisualFire() { public boolean isVisualFire() {
if (visualFire == null) {
visualFire = true;
}
return visualFire; return visualFire;
} }
@ -610,6 +620,9 @@ public class BlueprintEntity {
* @return the silent * @return the silent
*/ */
public boolean isSilent() { public boolean isSilent() {
if (silent == null) {
silent = false;
}
return silent; return silent;
} }
@ -624,6 +637,9 @@ public class BlueprintEntity {
* @return the invulnerable * @return the invulnerable
*/ */
public boolean isInvulnerable() { public boolean isInvulnerable() {
if (invulnerable == null) {
invulnerable = false;
}
return invulnerable; return invulnerable;
} }