Skip to content

Commit

Permalink
Client: Remove all redundant casts
Browse files Browse the repository at this point in the history
This is an automated change done by IntelliJ.
  • Loading branch information
StenAL committed May 31, 2024
1 parent d5b8529 commit b186c14
Show file tree
Hide file tree
Showing 47 changed files with 116 additions and 116 deletions.
2 changes: 1 addition & 1 deletion client/src/main/java/agolf/Conn.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void dataReceived(String var1) {
;
}

this.gameContainer.gameApplet.setEndState((Throwable) var4);
this.gameContainer.gameApplet.setEndState(var4);
this.connection.closeConnection();
}
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/agolf/LobbySelectPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ else if (evtSource == this.buttonDual) {
this.writeData("qmpt");
} else {
if (evtSource == this.buttonQuit) {
this.gameContainer.gameApplet.quit((String) null);
this.gameContainer.gameApplet.quit(null);
}

}
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/agolf/LobbySelectRNOPspammer.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void run() {

do {
this.lobbySelectPanel.requestNumberOfPlayers();
Tools.sleep((long) sleepTime);
Tools.sleep(sleepTime);
if (sleepTime < 120000) {
sleepTime += 5000;
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/agolf/game/ChatPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ private void method323() {
}

if (var1 != ChatBase.CIDR_NONE) {
ChatBase.setInputByCIDR(var1, this, this.textFieldMessage, this.buttonSay, (UrlLabel) null, this.gameContainer.textManager, this.gameContainer.params);
ChatBase.setInputByCIDR(var1, this, this.textFieldMessage, this.buttonSay, null, this.gameContainer.textManager, this.gameContainer.params);
}
}

Expand Down
14 changes: 7 additions & 7 deletions client/src/main/java/agolf/game/GameCanvas.java
Original file line number Diff line number Diff line change
Expand Up @@ -785,9 +785,9 @@ protected boolean init(String commandLines, String playerStatuses, int gameId) {

for (int magnetIndex = 0; magnetIndex < magnetVecLen; ++magnetIndex) {
// [ x, y, blockid ]
int[] magnet = (int[]) magnetVec.elementAt(magnetIndex);
double forceTemp2X = (double) (magnet[0] - magnetLoopX);
double forcetemp2Y = (double) (magnet[1] - magnetLoopY);
int[] magnet = magnetVec.elementAt(magnetIndex);
double forceTemp2X = magnet[0] - magnetLoopX;
double forcetemp2Y = magnet[1] - magnetLoopY;
double force = Math.sqrt(forceTemp2X * forceTemp2X + forcetemp2Y * forcetemp2Y);
if (force <= 127.0D) {
double var35 = Math.abs(forceTemp2X) / force;
Expand Down Expand Up @@ -1394,7 +1394,7 @@ private void handleTeleport(int teleportId, int playerId, int x, int y) {
do {
i = startLen - 1;
random = this.rngSeed.next() % (i + 1);
teleportPos = (double[]) this.teleportStarts[teleportId].elementAt(random);
teleportPos = this.teleportStarts[teleportId].elementAt(random);
if (Math.abs(teleportPos[0] - (double) x) >= 15.0D || Math.abs(teleportPos[1] - (double) y) >= 15.0D) {
this.playerX[playerId] = teleportPos[0];
this.playerY[playerId] = teleportPos[1];
Expand Down Expand Up @@ -1429,7 +1429,7 @@ private void handleTeleport(int teleportId, int playerId, int x, int y) {
}

//finally move player to exit position
teleportPos = (double[]) this.teleportExists[var13].elementAt(random);
teleportPos = this.teleportExists[var13].elementAt(random);
this.playerX[playerId] = teleportPos[0];
this.playerY[playerId] = teleportPos[1];
}
Expand Down Expand Up @@ -1666,8 +1666,8 @@ private void drawDashedLine(Graphics var1, int var2, int var3, int var4, int var
int var6 = var4 >= 0 ? var4 : -var4;
int var7 = var5 >= 0 ? var5 : -var5;
int var8 = Math.max(var6, var7) / 10;
double var9 = (double) var2;
double var11 = (double) var3;
double var9 = var2;
double var11 = var3;
double var13 = (double) var4 / ((double) var8 * 2.0D);
double var15 = (double) var5 / ((double) var8 * 2.0D);
var9 += var13;
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/agolf/game/GameControlPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected GameControlPanel(GameContainer var1, PlayerInfoPanel var2, int var3, i
this.anInt342 = var3;
this.anInt343 = var4;
this.setSize(var3, var4);
this.setLayout((LayoutManager) null);
this.setLayout(null);
this.skipButtonVisible = false;
}

Expand Down
4 changes: 2 additions & 2 deletions client/src/main/java/agolf/lobby/LobbyDualPlayerPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void itemStateChanged(ItemEvent evt) {
}

this.gameContainer.lobbyPanel.writeData("nc\t" + (noChallenges ? 't' : 'f'));
this.gameContainer.lobbyPanel.getUser((String) null, noChallenges);
this.gameContainer.lobbyPanel.getUser(null, noChallenges);
}

}
Expand Down Expand Up @@ -369,7 +369,7 @@ protected void allowChallenges() {
}

private void create() {
this.setLayout((LayoutManager) null);
this.setLayout(null);
/*if(isUsingCustomServer) {
choicerTrackCategory = this.gameContainer.lobbyPanel.addChoicerTrackCategory(this, this.width / 2 - 170, 81, 150, 20);
}*/
Expand Down
4 changes: 2 additions & 2 deletions client/src/main/java/agolf/lobby/LobbyGamePasswordPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void actionPerformed(ActionEvent evt) {
}

if (evtSource == this.buttonCancel) {
this.lobbyMultiPlayerPanel.joinMultiPlayerGame(this.gameId, (String) null);
this.lobbyMultiPlayerPanel.joinMultiPlayerGame(this.gameId, null);
}

}
Expand Down Expand Up @@ -102,7 +102,7 @@ private void joinGame() {
if (!this.emptyField && password.length() != 0) {
this.lobbyMultiPlayerPanel.joinMultiPlayerGame(this.gameId, password);
} else {
this.lobbyMultiPlayerPanel.joinMultiPlayerGame(this.gameId, (String) null);
this.lobbyMultiPlayerPanel.joinMultiPlayerGame(this.gameId, null);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ protected boolean handlePacket(String[] args) {
}

protected void create() {
this.setLayout((LayoutManager) null);
this.setLayout(null);
this.choicerNumPlayers = new Choicer();

for (int num = 2; num <= 4; ++num) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/agolf/lobby/LobbyPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ protected Choicer addChoicerTrackCategory(Panel container, int x, int y, int wid
}

protected String getTime(int var1) {
return var1 == 0 ? this.gameContainer.textManager.getGame("LobbyReal_TimeLimitNo") : this.gameContainer.textManager.getTime((long) var1);
return var1 == 0 ? this.gameContainer.textManager.getGame("LobbyReal_TimeLimitNo") : this.gameContainer.textManager.getTime(var1);
}

protected void addMessage(String var1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ protected void requestTrackSetList() {
}

private void create() {
this.setLayout((LayoutManager) null);
this.setLayout(null);
/*if(isUsingCustomServer) {
this.choicerTrackCategory = this.gameContainer.lobbyPanel.addChoicerTrackCategory(this, this.width / 2 - 170, 175, 150, 20);
}*/
Expand Down
8 changes: 4 additions & 4 deletions client/src/main/java/com/aapeli/applet/AdCanvas.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void update(Graphics var1) {
}
}

var1.drawImage(this.anImage122, 0, 0, (ImageObserver) null);
var1.drawImage(this.anImage122, 0, 0, null);
int var5 = this.aVector118.size();

for (int var6 = 0; var6 < var5; ++var6) {
Expand Down Expand Up @@ -134,12 +134,12 @@ protected boolean method213() {
this.aBoolean125 = true;
}

if (!this.aBoolean125 && !this.gameApplet.prepareImage(this.anImage122, (ImageObserver) null)) {
if (!this.aBoolean125 && !this.gameApplet.prepareImage(this.anImage122, null)) {
return false;
} else {
if (!this.aBoolean125) {
int var1 = this.anImage122.getWidth((ImageObserver) null);
int var2 = this.anImage122.getHeight((ImageObserver) null);
int var1 = this.anImage122.getWidth(null);
int var2 = this.anImage122.getHeight(null);
this.setSize(var1, var2);
} else {
this.setSize(20, 20);
Expand Down
4 changes: 2 additions & 2 deletions client/src/main/java/com/aapeli/bigtext/BigText.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public BigText(String var1, Color var2) {
}

public BigText(String var1, Color var2, int var3) {
this(var1, var2, var3, anIntArray1317, anIntArray1318, 1, (Component) null);
this(var1, var2, var3, anIntArray1317, anIntArray1318, 1, null);
}

public BigText(String var1, Color var2, int var3, Component var4) {
Expand All @@ -82,7 +82,7 @@ protected BigText(String var1, Color var2, int var3, int[] var4, int[] var5, int
}

public void setAlpha(int var1) {
this.method1558(var1, (Component) null);
this.method1558(var1, null);
}

public void drawText(Graphics var1, int var2, int var3, int var4, int var5) {
Expand Down
10 changes: 5 additions & 5 deletions client/src/main/java/com/aapeli/bigtext/MediumText.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ public MediumText(String var1, Color var2) {
}

public MediumText(String var1, Color var2, int var3) {
super(var1, var2, var3, anIntArray3591, anIntArray3592, 2, (Component) null);
super(var1, var2, var3, anIntArray3591, anIntArray3592, 2, null);
}

private static int method1560(int[] var0, int var1, int var2) {
long var3 = (long) var0[var2 * 1432 + var1];
long var5 = (long) var0[var2 * 1432 + var1 + 1];
long var7 = (long) var0[(var2 + 1) * 1432 + var1];
long var9 = (long) var0[(var2 + 1) * 1432 + var1 + 1];
long var3 = var0[var2 * 1432 + var1];
long var5 = var0[var2 * 1432 + var1 + 1];
long var7 = var0[(var2 + 1) * 1432 + var1];
long var9 = var0[(var2 + 1) * 1432 + var1 + 1];
long var11 = ((var3 & 4278190080L) >> 24) + ((var5 & 4278190080L) >> 24) + ((var7 & 4278190080L) >> 24) + ((var9 & 4278190080L) >> 24);
long var13 = ((var3 & 16711680L) >> 16) + ((var5 & 16711680L) >> 16) + ((var7 & 16711680L) >> 16) + ((var9 & 16711680L) >> 16);
long var15 = ((var3 & 65280L) >> 8) + ((var5 & 65280L) >> 8) + ((var7 & 65280L) >> 8) + ((var9 & 65280L) >> 8);
Expand Down
4 changes: 2 additions & 2 deletions client/src/main/java/com/aapeli/client/BadWordFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ public final class BadWordFilter {


public BadWordFilter(TextManager var1) {
this(var1, true, (String) null);
this(var1, true, null);
}

protected BadWordFilter(TextManager var1, boolean var2) {
this(var1, var2, (String) null);
this(var1, var2, null);
}

protected BadWordFilter(TextManager var1, boolean var2, String var3) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/com/aapeli/client/Frame_Sub3.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected void method238(Component var1, String var2, Panel var3) {
Dimension var7 = var1.getSize();
this.setLocation(var6.x + var7.width / 2 - this.anInt188 / 2, var6.y + var7.height / 2 - this.anInt189 / 2);
this.setBackground(Panel_Sub24.aColor616);
this.setLayout((LayoutManager) null);
this.setLayout(null);
var3.setLocation(var4.left, var4.top);
this.add(var3);
this.addWindowListener(this);
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/com/aapeli/client/IPanel_Sub40.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected String method820() {
}

private void method821() {
this.setLayout((LayoutManager) null);
this.setLayout(null);
if (this.anInt3212 == 0) {
this.aRoundButton3215 = new RoundButton(this.anAApplet3210.textManager.getShared("GameFin_W_CreateAccount"));
this.aRoundButton3215.setBounds(210, 225, 220, 30);
Expand Down
4 changes: 2 additions & 2 deletions client/src/main/java/com/aapeli/client/ImageTracker.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ protected void removeAllImageResources() {

while (this.aThread1401 != null && var1 > 0) {
var1 -= var2;
Tools.sleep((long) var2);
Tools.sleep(var2);
}
}

Expand Down Expand Up @@ -263,7 +263,7 @@ private boolean method1645() {
return true;
}

Tools.sleep((long) var5);
Tools.sleep(var5);
}

if (this.anAApplet1400 != null) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/com/aapeli/client/InputTextField.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void keyReleased(KeyEvent evt) {

String var4;
if (this.anInt727 < this.userInputzCount) {
var4 = (String) this.userInputz.elementAt(this.anInt727);
var4 = this.userInputz.elementAt(this.anInt727);
} else {
var4 = this.finalInput;
}
Expand Down
6 changes: 3 additions & 3 deletions client/src/main/java/com/aapeli/client/Panel_Sub24.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected Panel_Sub24(TextManager var1, ImageManager var2, Class88 var3, Frame_S
this.anInt638 = 0;
this.aBoolean640 = false;
this.anInt639 = 1;
this.method481((InputTextField) null);
this.method481(null);
}

public void addNotify() {
Expand Down Expand Up @@ -241,7 +241,7 @@ public synchronized void focusLost(FocusEvent var1) {
}

private void method480() {
this.setLayout((LayoutManager) null);
this.setLayout(null);
this.anInputTextFieldArray632 = new InputTextField[4];

int var1;
Expand Down Expand Up @@ -317,7 +317,7 @@ private void method481(InputTextField var1) {

private void method482(boolean var1) {
++this.anInt639;
this.method481((InputTextField) null);
this.method481(null);
if (var1) {
this.anInputTextFieldArray632[this.anInt639 - 1].requestFocus();
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/com/aapeli/client/Parameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public boolean showPlayerCard(String var1) {
}

public void showPlayerList(String[] var1) {
this.showPlayerList(var1, (String) null);
this.showPlayerList(var1, null);
}

public void showPlayerList(String[] nicks, String var2) {
Expand Down
4 changes: 2 additions & 2 deletions client/src/main/java/com/aapeli/colorgui/Class91.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ private void method1743(Graphics var1, ColorList var2) {
var1.fillRect(this.anInt1536, this.anInt1537, this.anInt1538, this.anInt1539);
}

this.method1744(var1, var2, this.anImage1547, this.aColor1545, this.aFont1542, this.aString1546, (Image) null);
this.method1744(var1, var2, this.anImage1547, this.aColor1545, this.aFont1542, this.aString1546, null);
}

private void method1744(Graphics var1, ColorList var2, Image var3, Color var4, Font var5, String var6, Image var7) {
int var8 = 4;
if (var3 != null) {
var1.drawImage(var3, var8, this.anInt1537 + this.anInt1539 / 2 - var3.getHeight(var2) / 2, var2);
int var9 = this.anInt1540 > 0 ? this.anInt1540 : var3.getWidth((ImageObserver) null);
int var9 = this.anInt1540 > 0 ? this.anInt1540 : var3.getWidth(null);
var8 += var9 + 3;
}

Expand Down
2 changes: 1 addition & 1 deletion client/src/main/java/com/aapeli/colorgui/Class92.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected Class92(ColorSpinner var1, ColorSpinner var2, int var3) {
}

public void run() {
Tools.sleep((long) this.anInt1550);
Tools.sleep(this.anInt1550);
if (this.aBoolean1551) {
this.aColorSpinner1549.method846();
}
Expand Down
10 changes: 5 additions & 5 deletions client/src/main/java/com/aapeli/colorgui/ColorButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class ColorButton extends IPanel implements MouseMotionListener, MouseLis
public static boolean aBoolean3287;

public ColorButton() {
this((String) null);
this(null);
}

public ColorButton(String var1) {
Expand All @@ -69,7 +69,7 @@ public ColorButton(String var1) {
this.setFont(Class94.aFont1575);
this.setLabel(var1);
this.setSecondaryFont(new Font("Dialog", 0, 11));
this.setSecondaryLabel((String) null);
this.setSecondaryLabel(null);
this.aBoolean3276 = true;
this.aBoolean3277 = this.aBoolean3278 = false;
this.anInt3279 = 1;
Expand Down Expand Up @@ -282,9 +282,9 @@ public void setForegroundImage(Image var1, Image var2, int var3, int var4) {

public void setIconImage(Image var1) {
if (var1 != null) {
this.setIconImage(var1, var1.getWidth((ImageObserver) null), var1.getHeight((ImageObserver) null));
this.setIconImage(var1, var1.getWidth(null), var1.getHeight(null));
} else {
this.setIconImage((Image) null, -1, -1);
this.setIconImage(null, -1, -1);
}

}
Expand Down Expand Up @@ -341,7 +341,7 @@ public void setBorderColor(Color var1) {

public void click() {
this.aBoolean3278 = true;
this.mouseReleased((MouseEvent) null);
this.mouseReleased(null);
}

public Dimension getPreferredSize() {
Expand Down
6 changes: 3 additions & 3 deletions client/src/main/java/com/aapeli/colorgui/ColorCheckbox.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public class ColorCheckbox extends IPanel implements ItemSelectable, MouseListen


public ColorCheckbox() {
this((String) null, false);
this(null, false);
}

public ColorCheckbox(boolean var1) {
this((String) null, var1);
this(null, var1);
}

public ColorCheckbox(String var1) {
Expand Down Expand Up @@ -249,7 +249,7 @@ public boolean getState() {
}

public void click() {
this.mouseReleased((MouseEvent) null);
this.mouseReleased(null);
}

public Dimension getPreferredSize() {
Expand Down
Loading

0 comments on commit b186c14

Please sign in to comment.