Renamed the commonly used Position POJO into AdvancedPosition, as it also hold pitch, yaw and roll

Made GuiDropdown only accept instances of GuiEntryListEntry to avoid unneccessary toString() methods returning the name
Added GuiEntryListValueEntry which holds a Value and a Name to be displayed
Continued work on GuiObjectManager
This commit is contained in:
CrushedPixel
2015-07-10 04:27:15 +02:00
parent 30ebfe96bd
commit ef39c7466d
28 changed files with 260 additions and 164 deletions

View File

@@ -5,8 +5,6 @@ import eu.crushedpixel.replaymod.interpolation.KeyframeValue;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.Entity;
@Data
@AllArgsConstructor
@@ -15,36 +13,10 @@ public class Position implements KeyframeValue {
@Interpolate
public double x, y, z;
@Interpolate
public double pitch, yaw, roll;
private Integer spectatedEntityID;
public Position(int entityID, boolean spectate) {
this(Minecraft.getMinecraft().theWorld.getEntityByID(entityID), spectate);
}
public Position(Entity e, boolean spectate) {
this(e.posX, e.posY, e.posZ, e.rotationPitch, e.rotationYaw, spectate ? e.getEntityId() : null);
}
public Position(double x, double y, double z, float pitch, float yaw, Integer spectatedEntityID) {
this(x, y, z, pitch, yaw, 0, spectatedEntityID);
}
public Position(double x, double y, double z, float pitch, float yaw) {
this(x, y, z, pitch, yaw, 0, null);
}
public double distanceSquared(double x, double y, double z) {
double dx = this.x - x;
double dy = this.y - y;
double dz = this.z - z;
return dx * dx + dy * dy + dz * dz;
}
@Override
public Position newInstance() {
return new Position();
}
}