Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public void updateMainHand(GeyserSession session) {
ItemData helmet = ItemData.AIR; // TODO
ItemData chest = item;

if (custom && !config.getBoolean("hand")) {
if (custom && !(config != null && config.getBoolean("hand"))) {
MobArmorEquipmentPacket armorEquipmentPacket = new MobArmorEquipmentPacket();
armorEquipmentPacket.setRuntimeEntityId(geyserId);
armorEquipmentPacket.setHelmet(helmet);
Expand Down Expand Up @@ -290,7 +290,7 @@ private static int getColor(int argb) {

@Override
public void moveAbsoluteRaw(Vector3f position, float yaw, float pitch, float headYaw, boolean isOnGround, boolean teleported) {
double yOffset = config.getDouble("y-offset");
double yOffset = config != null ? config.getDouble("y-offset") : -0.5;
setPosition(position);
setYaw(yaw);
setPitch(pitch);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void initializeMetadata() {
propertyManager.addProperty(new FloatProperty(Identifier.of("geyser:s_y"), MAX_VALUE, MIN_VALUE, 0F), scale.getY());
propertyManager.addProperty(new FloatProperty(Identifier.of("geyser:s_z"), MAX_VALUE, MIN_VALUE, 0F), scale.getZ());

if (config.getBoolean("vanilla-scale")) applyScale();
if (config != null && config.getBoolean("vanilla-scale")) applyScale();

displayRotation = Vector3f.from(0, 0, 0);
displayTranslation = Vector3f.from(0, 0, 0);
Expand Down Expand Up @@ -127,7 +127,7 @@ protected void pushRotationProperties() {
public void setScale(EntityMetadata<Vector3f, ?> entityMetadata) {
this.scale = entityMetadata.getValue();

if (config.getBoolean("vanilla-scale")) applyScale();
if (config != null && config.getBoolean("vanilla-scale")) applyScale();

propertyManager.addProperty(new FloatProperty(Identifier.of("geyser:s_x"), MAX_VALUE, MIN_VALUE, 0F), scale.getX());
propertyManager.addProperty(new FloatProperty(Identifier.of("geyser:s_y"), MAX_VALUE, MIN_VALUE, 0F), scale.getY());
Expand All @@ -137,7 +137,7 @@ public void setScale(EntityMetadata<Vector3f, ?> entityMetadata) {
protected void applyScale() {
Vector3f vector3f = this.scale;
float scale = (vector3f.getX() + vector3f.getY() + vector3f.getZ()) / 3;
if (config.getBoolean("vanilla-scale")) scale *= (float) config.getDouble("vanilla-scale-multiplier");
if (config != null && config.getBoolean("vanilla-scale")) scale *= (float) config.getDouble("vanilla-scale-multiplier");
this.metadata.put(EntityDataTypes.SCALE, scale);
}

Expand Down