mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-28 15:56:10 +00:00
Proper Reformating
This commit is contained in:
1 parent
ce75880aba
commit
180d257024
1179 files changed
+59847
-61583
No files matched your search
@@ -16,10 +16,10 @@ public class ScriptOverlay implements ICustomOverlay {
|
||||
int defaultAlignment = 0;
|
||||
List<ICustomOverlayComponent> components = new ArrayList();
|
||||
|
||||
public ScriptOverlay(){
|
||||
public ScriptOverlay() {
|
||||
}
|
||||
|
||||
public ScriptOverlay(int id){
|
||||
public ScriptOverlay(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ScriptOverlay implements ICustomOverlay {
|
||||
return this.components;
|
||||
}
|
||||
|
||||
public int getDefaultAlignment(){
|
||||
public int getDefaultAlignment() {
|
||||
return this.defaultAlignment;
|
||||
}
|
||||
|
||||
@@ -42,25 +42,25 @@ public class ScriptOverlay implements ICustomOverlay {
|
||||
public IOverlayTexturedRect addTexturedRect(int id, String texture, int x, int y, int width, int height) {
|
||||
ScriptOverlayTexturedRect component = new ScriptOverlayTexturedRect(id, texture, x, y, width, height);
|
||||
this.components.add(component);
|
||||
return (IOverlayTexturedRect)this.components.get(this.components.size() - 1);
|
||||
return (IOverlayTexturedRect) this.components.get(this.components.size() - 1);
|
||||
}
|
||||
|
||||
public IOverlayTexturedRect addTexturedRect(int id, String texture, int x, int y, int width, int height, int textureX, int textureY) {
|
||||
ScriptOverlayTexturedRect component = new ScriptOverlayTexturedRect(id, texture, x, y, width, height, textureX, textureY);
|
||||
this.components.add(component);
|
||||
return (IOverlayTexturedRect)this.components.get(this.components.size() - 1);
|
||||
return (IOverlayTexturedRect) this.components.get(this.components.size() - 1);
|
||||
}
|
||||
|
||||
public IOverlayLabel addLabel(int id, String label, int x, int y, int width, int height) {
|
||||
ScriptOverlayLabel component = new ScriptOverlayLabel(id, label, x, y, width, height);
|
||||
this.components.add(component);
|
||||
return (IOverlayLabel)this.components.get(this.components.size() - 1);
|
||||
return (IOverlayLabel) this.components.get(this.components.size() - 1);
|
||||
}
|
||||
|
||||
public IOverlayLabel addLabel(int id, String label, int x, int y, int width, int height, int color) {
|
||||
ScriptOverlayLabel component = new ScriptOverlayLabel(id, label, x, y, width, height, color);
|
||||
this.components.add(component);
|
||||
return (IOverlayLabel)this.components.get(this.components.size() - 1);
|
||||
return (IOverlayLabel) this.components.get(this.components.size() - 1);
|
||||
}
|
||||
|
||||
public IOverlayLine addLine(int id, int x1, int y1, int x2, int y2, int color, int thickness) {
|
||||
@@ -84,15 +84,15 @@ public class ScriptOverlay implements ICustomOverlay {
|
||||
return null;
|
||||
}
|
||||
|
||||
component = (ICustomOverlayComponent)var2.next();
|
||||
} while(component.getID() != componentID);
|
||||
component = (ICustomOverlayComponent) var2.next();
|
||||
} while (component.getID() != componentID);
|
||||
|
||||
return component;
|
||||
}
|
||||
|
||||
public void removeComponent(int componentID) {
|
||||
for(int i = 0; i < this.components.size(); ++i) {
|
||||
if (((ICustomOverlayComponent)this.components.get(i)).getID() == componentID) {
|
||||
for (int i = 0; i < this.components.size(); ++i) {
|
||||
if (((ICustomOverlayComponent) this.components.get(i)).getID() == componentID) {
|
||||
this.components.remove(i);
|
||||
return;
|
||||
}
|
||||
@@ -101,8 +101,8 @@ public class ScriptOverlay implements ICustomOverlay {
|
||||
}
|
||||
|
||||
public void updateComponent(ICustomOverlayComponent component) {
|
||||
for(int i = 0; i < this.components.size(); ++i) {
|
||||
ICustomOverlayComponent c = (ICustomOverlayComponent)this.components.get(i);
|
||||
for (int i = 0; i < this.components.size(); ++i) {
|
||||
ICustomOverlayComponent c = (ICustomOverlayComponent) this.components.get(i);
|
||||
if (c.getID() == component.getID()) {
|
||||
this.components.set(i, component);
|
||||
return;
|
||||
@@ -120,9 +120,9 @@ public class ScriptOverlay implements ICustomOverlay {
|
||||
List<ICustomOverlayComponent> components = new ArrayList();
|
||||
|
||||
NBTTagList list = tag.getTagList("components", 10);
|
||||
for(int i = 0; i < list.tagCount(); i++){
|
||||
for (int i = 0; i < list.tagCount(); i++) {
|
||||
NBTBase b = list.getCompoundTagAt(i);
|
||||
ScriptOverlayComponent component = ScriptOverlayComponent.createFromNBT((NBTTagCompound)b);
|
||||
ScriptOverlayComponent component = ScriptOverlayComponent.createFromNBT((NBTTagCompound) b);
|
||||
components.add(component);
|
||||
}
|
||||
|
||||
@@ -139,9 +139,9 @@ public class ScriptOverlay implements ICustomOverlay {
|
||||
Iterator var3 = this.components.iterator();
|
||||
|
||||
ICustomOverlayComponent c;
|
||||
while(var3.hasNext()) {
|
||||
c = (ICustomOverlayComponent)var3.next();
|
||||
list.appendTag(((ScriptOverlayComponent)c).toNBT(new NBTTagCompound()));
|
||||
while (var3.hasNext()) {
|
||||
c = (ICustomOverlayComponent) var3.next();
|
||||
list.appendTag(((ScriptOverlayComponent) c).toNBT(new NBTTagCompound()));
|
||||
}
|
||||
|
||||
tag.setTag("components", list);
|
||||
|
||||
@@ -19,7 +19,7 @@ public abstract class ScriptOverlayComponent implements ICustomOverlayComponent
|
||||
6 7 8
|
||||
*/
|
||||
|
||||
public ScriptOverlayComponent(){
|
||||
public ScriptOverlayComponent() {
|
||||
}
|
||||
|
||||
public int getID() {
|
||||
@@ -83,10 +83,10 @@ public abstract class ScriptOverlayComponent implements ICustomOverlayComponent
|
||||
public NBTTagCompound toNBT(NBTTagCompound nbt) {
|
||||
nbt.setInteger("id", this.id);
|
||||
nbt.setIntArray("pos", new int[]{this.posX, this.posY});
|
||||
nbt.setInteger("alignment",this.alignment);
|
||||
nbt.setInteger("alignment", this.alignment);
|
||||
nbt.setInteger("color", this.color);
|
||||
nbt.setFloat("alpha",this.alpha);
|
||||
nbt.setFloat("rotation",this.rotation);
|
||||
nbt.setFloat("alpha", this.alpha);
|
||||
nbt.setFloat("rotation", this.rotation);
|
||||
|
||||
nbt.setInteger("type", this.getType());
|
||||
return nbt;
|
||||
@@ -104,7 +104,7 @@ public abstract class ScriptOverlayComponent implements ICustomOverlayComponent
|
||||
}
|
||||
|
||||
public static ScriptOverlayComponent createFromNBT(NBTTagCompound nbt) {
|
||||
switch(nbt.getInteger("type")) {
|
||||
switch (nbt.getInteger("type")) {
|
||||
case 0:
|
||||
return (new ScriptOverlayTexturedRect()).fromNBT(nbt);
|
||||
case 1:
|
||||
|
||||
@@ -62,11 +62,11 @@ public class ScriptOverlayLabel extends ScriptOverlayComponent implements IOverl
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean getShadow(){
|
||||
public boolean getShadow() {
|
||||
return this.shadow;
|
||||
}
|
||||
|
||||
public void setShadow(boolean shadow){
|
||||
public void setShadow(boolean shadow) {
|
||||
this.shadow = shadow;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class ScriptOverlayLabel extends ScriptOverlayComponent implements IOverl
|
||||
nbt.setString("label", this.label);
|
||||
nbt.setIntArray("size", new int[]{this.width, this.height});
|
||||
nbt.setFloat("scale", this.scale);
|
||||
nbt.setBoolean("shadow",this.shadow);
|
||||
nbt.setBoolean("shadow", this.shadow);
|
||||
return nbt;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@ public class ScriptOverlayLine extends ScriptOverlayComponent implements IOverla
|
||||
int y2;
|
||||
int thickness = 2;
|
||||
|
||||
public ScriptOverlayLine(){
|
||||
public ScriptOverlayLine() {
|
||||
}
|
||||
|
||||
public ScriptOverlayLine(int id, int x1, int y1, int x2, int y2){
|
||||
public ScriptOverlayLine(int id, int x1, int y1, int x2, int y2) {
|
||||
this.setPos(x1, y1);
|
||||
this.setID(id);
|
||||
|
||||
@@ -23,7 +23,7 @@ public class ScriptOverlayLine extends ScriptOverlayComponent implements IOverla
|
||||
this.y2 = y2;
|
||||
}
|
||||
|
||||
public ScriptOverlayLine(int id, int x1, int y1, int x2, int y2, int color, int thickness){
|
||||
public ScriptOverlayLine(int id, int x1, int y1, int x2, int y2, int color, int thickness) {
|
||||
this.setPos(x1, y1);
|
||||
this.setID(id);
|
||||
|
||||
@@ -42,11 +42,11 @@ public class ScriptOverlayLine extends ScriptOverlayComponent implements IOverla
|
||||
|
||||
public NBTTagCompound toNBT(NBTTagCompound nbt) {
|
||||
super.toNBT(nbt);
|
||||
nbt.setInteger("X1",x1);
|
||||
nbt.setInteger("Y1",y1);
|
||||
nbt.setInteger("X2",x2);
|
||||
nbt.setInteger("Y2",y2);
|
||||
nbt.setInteger("Thickness",thickness);
|
||||
nbt.setInteger("X1", x1);
|
||||
nbt.setInteger("Y1", y1);
|
||||
nbt.setInteger("X2", x2);
|
||||
nbt.setInteger("Y2", y2);
|
||||
nbt.setInteger("Thickness", thickness);
|
||||
|
||||
return nbt;
|
||||
}
|
||||
@@ -62,35 +62,43 @@ public class ScriptOverlayLine extends ScriptOverlayComponent implements IOverla
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getX1(){
|
||||
public int getX1() {
|
||||
return this.x1;
|
||||
}
|
||||
public int getY1(){
|
||||
|
||||
public int getY1() {
|
||||
return this.y1;
|
||||
}
|
||||
public int getX2(){
|
||||
|
||||
public int getX2() {
|
||||
return this.x2;
|
||||
}
|
||||
public int getY2(){
|
||||
|
||||
public int getY2() {
|
||||
return this.y2;
|
||||
}
|
||||
public int getThickness(){
|
||||
|
||||
public int getThickness() {
|
||||
return this.thickness;
|
||||
}
|
||||
|
||||
public void setX1(int x1){
|
||||
public void setX1(int x1) {
|
||||
this.x1 = x1;
|
||||
}
|
||||
public void setY1(int y1){
|
||||
|
||||
public void setY1(int y1) {
|
||||
this.y1 = y1;
|
||||
}
|
||||
public void setX2(int x2){
|
||||
|
||||
public void setX2(int x2) {
|
||||
this.x2 = x2;
|
||||
}
|
||||
public void setY2(int y2){
|
||||
|
||||
public void setY2(int y2) {
|
||||
this.y2 = y2;
|
||||
}
|
||||
public void setThickness(int thickness){
|
||||
|
||||
public void setThickness(int thickness) {
|
||||
this.thickness = thickness;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user