Skip to content

Commit

Permalink
cleaned up files
Browse files Browse the repository at this point in the history
  • Loading branch information
DavieDoo committed May 18, 2022
1 parent 42088bd commit 94e7ad3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 63 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
package com.spectrobes.spectrobesmod.client.gui.prizmod.Components;

import com.mojang.blaze3d.systems.RenderSystem;
import com.spectrobes.spectrobesmod.client.gui.prizmod.Pages.PrizmodPage;
import com.spectrobes.spectrobesmod.client.gui.prizmod.PrizmodScreen;
import com.spectrobes.spectrobesmod.common.spectrobes.Spectrobe;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.widget.Widget;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

import java.util.ArrayList;
import java.util.HashMap;
Expand All @@ -27,13 +21,10 @@ public class AllSpectrobesList extends Widget {

public int currentPage = 0;

private PrizmodPage parent;

public AllSpectrobesList(PrizmodPage parent) {
super(parent.x, parent.y, 0, 0, new StringTextComponent(""));
this.parent = parent;
gridData_paged = new HashMap<>();
int specCount = this.parent.parent.getMenu().getOwnedSpectrobesCount();
int specCount = parent.parent.getMenu().getOwnedSpectrobesCount();
int remainder = specCount % 25;
this.pages = specCount / 25;
if(remainder > 0) {
Expand All @@ -54,25 +45,9 @@ public AllSpectrobesList(PrizmodPage parent) {
gridData = gridData_paged.get(currentPage);
}

@OnlyIn(Dist.CLIENT)
public void draw() {
for (int i = 0; i < GRID_SIZE; i++) {
for (int j = 0; j < GRID_SIZE; j++) {
// SpectrobePiece p = gridData[i][j];
//
// RenderSystem.pushMatrix();
// Minecraft.getInstance().textureManager.bind(PrizmodScreen.SPECTROBE_SLOT_TEXTURE);
// RenderSystem.enableAlphaTest();
// RenderSystem.translatef(i * 32, j * 32, 0);
// //p.draw();
// RenderSystem.popMatrix();
}
}
}

public void addSpectrobe(Spectrobe piece) {
int i = 0;
int j = 0;
int i;
int j;
boolean added = false;

for(int a = 0; a < this.pages && !added; a++) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
package com.spectrobes.spectrobesmod.client.gui.prizmod.Components;

import com.mojang.blaze3d.systems.RenderSystem;
import com.spectrobes.spectrobesmod.SpectrobesInfo;
import com.spectrobes.spectrobesmod.client.gui.prizmod.Pages.PrizmodPage;
import com.spectrobes.spectrobesmod.client.gui.prizmod.PrizmodScreen;
import com.spectrobes.spectrobesmod.common.spectrobes.Spectrobe;
import com.spectrobes.spectrobesmod.common.spectrobes.SpectrobeProperties;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.widget.Widget;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class TeamSpectrobesList extends Widget {
Expand All @@ -21,7 +17,7 @@ public class TeamSpectrobesList extends Widget {

public SpectrobePiece[] gridData;

private PrizmodPage parent;
private final PrizmodPage parent;

public TeamSpectrobesList(PrizmodPage parent) {
super(parent.x, parent.y, 64, 128, new StringTextComponent(""));
Expand All @@ -36,25 +32,6 @@ public TeamSpectrobesList(PrizmodPage parent) {
gridData[6] = new SpectrobePiece(null, 6, 3);
}

@OnlyIn(Dist.CLIENT)
public void draw() {
for (int i = 0; i < GRID_SIZE; i++) {
// SpectrobePiece p = gridData[i];
//
// RenderSystem.pushMatrix();
// Minecraft.getInstance().textureManager.bind(PrizmodScreen.SPECTROBE_SLOT_TEXTURE);
// RenderSystem.enableAlphaTest();
// RenderSystem.translatef(i * 32, p.posY, 0);
// //p.draw();
// RenderSystem.popMatrix();

}
}

public static boolean exists(int x) {
return x >= 0 && x < GRID_SIZE;
}

public void populateSlot(int index, Spectrobe piece) {
gridData[index].spectrobe = piece;
}
Expand Down Expand Up @@ -85,22 +62,14 @@ public void clear() {
}

public List<SpectrobePiece> getAll() {
List<SpectrobePiece> toReturn = new ArrayList<>();
for (int i = 0; i < GRID_SIZE; i++) {
toReturn.add(gridData[i]);
}
return toReturn;
return new ArrayList<>(Arrays.asList(gridData).subList(0, GRID_SIZE));
}

public boolean swapSpectrobes(int i, int j) {
SpectrobePiece s1 = gridData[i];
SpectrobePiece s2 = gridData[j];

if(i >= 0
&& i < 6
&& j >= 0
&& j < 6
&& i != j) {
if(i < 6 && j < 6 && i != j) {

Spectrobe temp;
temp = s1.spectrobe;
Expand Down

0 comments on commit 94e7ad3

Please sign in to comment.