From 4dcac290282ab382d1a004521e25937c1c475671 Mon Sep 17 00:00:00 2001 From: MattBDev Date: Wed, 6 Apr 2016 00:17:30 -0400 Subject: [PATCH] Weaken Declaration --- .../bukkit/object/entity/AgeableStats.java | 9 +++-- .../bukkit/object/entity/ArmorStandStats.java | 24 ++++++------ .../bukkit/object/entity/EntityBaseStats.java | 17 ++++---- .../bukkit/object/entity/EntityWrapper.java | 15 +++---- .../bukkit/object/entity/HorseStats.java | 15 ++++--- .../object/entity/LivingEntityStats.java | 39 ++++++++++--------- .../bukkit/object/entity/TameableStats.java | 7 ++-- 7 files changed, 65 insertions(+), 61 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/AgeableStats.java b/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/AgeableStats.java index 068fde881..a7016efb6 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/AgeableStats.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/AgeableStats.java @@ -1,7 +1,8 @@ package com.plotsquared.bukkit.object.entity; -public class AgeableStats { - public int age; - public boolean locked; - public boolean adult; +class AgeableStats { + + int age; + boolean locked; + boolean adult; } diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/ArmorStandStats.java b/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/ArmorStandStats.java index 20377192e..b75feb488 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/ArmorStandStats.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/ArmorStandStats.java @@ -1,16 +1,16 @@ package com.plotsquared.bukkit.object.entity; -public class ArmorStandStats { +class ArmorStandStats { - public final float[] head = new float[3]; - public final float[] body = new float[3]; - public final float[] leftLeg = new float[3]; - public final float[] rightLeg = new float[3]; - public final float[] leftArm = new float[3]; - public final float[] rightArm = new float[3]; - public boolean arms; - public boolean noplate; - public boolean nogravity; - public boolean invisible; - public boolean small; + final float[] head = new float[3]; + final float[] body = new float[3]; + final float[] leftLeg = new float[3]; + final float[] rightLeg = new float[3]; + final float[] leftArm = new float[3]; + final float[] rightArm = new float[3]; + boolean arms; + boolean noplate; + boolean nogravity; + boolean invisible; + boolean small; } diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/EntityBaseStats.java b/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/EntityBaseStats.java index 444a363e3..10623cc76 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/EntityBaseStats.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/EntityBaseStats.java @@ -1,12 +1,13 @@ package com.plotsquared.bukkit.object.entity; -public class EntityBaseStats { - public EntityWrapper passenger; - public float fall; - public short fire; - public int age; - public double v_z; - public double v_y; - public double v_x; +class EntityBaseStats { + + EntityWrapper passenger; + float fall; + short fire; + int age; + double v_z; + double v_y; + double v_x; } diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/EntityWrapper.java b/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/EntityWrapper.java index 71291c0a8..076754b39 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/EntityWrapper.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/EntityWrapper.java @@ -15,9 +15,6 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Guardian; import org.bukkit.entity.Horse; -import org.bukkit.entity.Horse.Color; -import org.bukkit.entity.Horse.Style; -import org.bukkit.entity.Horse.Variant; import org.bukkit.entity.IronGolem; import org.bukkit.entity.Item; import org.bukkit.entity.ItemFrame; @@ -167,9 +164,9 @@ public class EntityWrapper { this.horse = new HorseStats(); this.horse.jump = horse.getJumpStrength(); this.horse.chest = horse.isCarryingChest(); - this.horse.variant = getOrdinal(Variant.values(), horse.getVariant()); - this.horse.style = getOrdinal(Style.values(), horse.getStyle()); - this.horse.color = getOrdinal(Color.values(), horse.getColor()); + this.horse.variant = horse.getVariant(); + this.horse.style = horse.getStyle(); + this.horse.color = horse.getColor(); storeTameable(horse); storeAgeable(horse); storeLiving(horse); @@ -546,9 +543,9 @@ public class EntityWrapper { Horse horse = (Horse) entity; horse.setJumpStrength(this.horse.jump); horse.setCarryingChest(this.horse.chest); - horse.setVariant(Variant.values()[this.horse.variant]); - horse.setStyle(Style.values()[this.horse.style]); - horse.setColor(Color.values()[this.horse.color]); + horse.setVariant(this.horse.variant); + horse.setStyle(this.horse.style); + horse.setColor(this.horse.color); restoreTameable(horse); restoreAgeable(horse); restoreLiving(horse); diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/HorseStats.java b/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/HorseStats.java index 2c9f7b465..2253136d4 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/HorseStats.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/HorseStats.java @@ -1,9 +1,12 @@ package com.plotsquared.bukkit.object.entity; -public class HorseStats { - public double jump; - public boolean chest; - public int variant; - public int color; - public int style; +import org.bukkit.entity.Horse; + +class HorseStats { + + double jump; + boolean chest; + Horse.Variant variant; + Horse.Color color; + Horse.Style style; } diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/LivingEntityStats.java b/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/LivingEntityStats.java index e6717eb47..fef2558c1 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/LivingEntityStats.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/LivingEntityStats.java @@ -5,23 +5,24 @@ import org.bukkit.potion.PotionEffect; import java.util.Collection; -public class LivingEntityStats { - public boolean loot; - public String name; - public boolean visible; - public float health; - public short air; - public boolean persistent; - public boolean leashed; - public short leash_x; - public short leash_y; - public short leash_z; - public boolean equipped; - public ItemStack mainHand; - public ItemStack helmet; - public ItemStack boots; - public ItemStack leggings; - public ItemStack chestplate; - public Collection potions; - public ItemStack offHand; +class LivingEntityStats { + + boolean loot; + String name; + boolean visible; + float health; + short air; + boolean persistent; + boolean leashed; + short leash_x; + short leash_y; + short leash_z; + boolean equipped; + ItemStack mainHand; + ItemStack helmet; + ItemStack boots; + ItemStack leggings; + ItemStack chestplate; + Collection potions; + ItemStack offHand; } diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/TameableStats.java b/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/TameableStats.java index dae91b121..217952e49 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/TameableStats.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/object/entity/TameableStats.java @@ -2,7 +2,8 @@ package com.plotsquared.bukkit.object.entity; import org.bukkit.entity.AnimalTamer; -public class TameableStats { - public AnimalTamer owner; - public boolean tamed; +class TameableStats { + + AnimalTamer owner; + boolean tamed; }