Skip to content

Commit

Permalink
* Debug Tool Enable
Browse files Browse the repository at this point in the history
  • Loading branch information
bioastroiner committed Sep 12, 2023
1 parent 1ea2268 commit a14eb96
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/main/java/bioast/mods/gt6scan/ScannerMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void onModInit2(FMLInitializationEvent aEvent) {
MinecraftForge.EVENT_BUS.register(this);
proxy.init(aEvent);

if(config.get("core","useCheatTool",false)){
if(config.get("core","useCheatTool",true)){
CS.ItemsGT.TOOLS.addItemBehavior(9001,new ScannerBehavior());
}
}
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/bioast/mods/gt6scan/item/ScannerBehavior.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public class ScannerBehavior extends IBehavior.AbstractBehaviorDefault implement
int z_origin;
boolean usePower = false;

/* CLIENT ONLY*/ int[][] block = new int[16 * chunkSize][16 * chunkSize]; // store color
/* CLIENT ONLY*/ short[][] blockMat = new short[16 * chunkSize][16 * chunkSize]; // like blocks but stores materialID
/* CLIENT ONLY*/ int[][] blockColorStorage = new int[16 * chunkSize][16 * chunkSize]; // store color
/* CLIENT ONLY*/ short[][] blockMatStorage = new short[16 * chunkSize][16 * chunkSize]; // like blocks but stores materialID

public ScannerBehavior(int sizeIn) {
chunkSize = sizeIn;
Expand Down Expand Up @@ -388,7 +388,7 @@ private void clientLogic() {
//ScannerMod.debug.info(z_origin);

/* CLIENT CODE */
blockMat = new short[chunkSize * 16][chunkSize * 16];
blockMatStorage = new short[chunkSize * 16][chunkSize * 16];
int borderColor = col(MT.Gray);
int backgroundColor = col(MT.White);
int oreColor = 0;
Expand All @@ -415,22 +415,22 @@ private void clientLogic() {
int lastCount = sortedOres.get(data.matID);
sortedOres.put(data.matID, lastCount + 1);
} else sortedOres.put(data.matID, 1);
blockMat[blockGridX][blockGridZ] = data.matID;
blockMatStorage[blockGridX][blockGridZ] = data.matID;
isOre = true;
}
}
} catch (Exception e) {
e.printStackTrace();
}

block[blockGridX][blockGridZ] = backgroundColor;
blockColorStorage[blockGridX][blockGridZ] = backgroundColor;
if (isOre) {
block[blockGridX][blockGridZ] = oreColor;
blockColorStorage[blockGridX][blockGridZ] = oreColor;
}
if (x == 15 || z == 15 || x == 0 || z == 0) // We Skip 16th block to draw Borders
block[blockGridX][blockGridZ] = borderColor;
blockColorStorage[blockGridX][blockGridZ] = borderColor;
if (chunkGridZ == (chunkSize - 1) / 2 && chunkGridX == (chunkSize - 1) / 2 && x == 7 && z == 7)
block[blockGridX][blockGridZ] = col(MT.Red);
blockColorStorage[blockGridX][blockGridZ] = col(MT.Red);
}
}
}
Expand All @@ -455,12 +455,12 @@ public ModularScreen createGuiScreen(EntityPlayer player, ItemStack itemStack) {
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
for (int i = 0; i < 16 * chunkSize; i++) {
for (int j = 16 * chunkSize - 1; j >= 0; j--) {
if (block[i][j] == col(MT.White)) continue;
if (blockColorStorage[i][j] == col(MT.White)) continue;
// GuiDraw.drawRect(i, j, 1, 1, block[i][j]);
//

GL11.glShadeModel(GL11.GL_SMOOTH);
int color = block[i][j];
int color = blockColorStorage[i][j];
Tessellator.instance.startDrawingQuads();
// Tessellator.instance.addVertex(i+0.5,j+0.5,0);
// Tessellator.instance.setColorOpaque_I(color);
Expand All @@ -482,7 +482,7 @@ public ModularScreen createGuiScreen(EntityPlayer player, ItemStack itemStack) {
String corN = " ";
int text_color = col(MT.White);
try {
short mat = blockMat[(guiContext.getAbsMouseX() - panel.getArea().x - x - 10)][(guiContext.getAbsMouseY() - panel.getArea().y - y - 10)];
short mat = blockMatStorage[(guiContext.getAbsMouseX() - panel.getArea().x - x - 10)][(guiContext.getAbsMouseY() - panel.getArea().y - y - 10)];
if (mat != 0) {
corN = OreDictMaterial.MATERIAL_ARRAY[mat].mNameLocal;
text_color = col(OreDictMaterial.MATERIAL_ARRAY[mat]);
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/bioast/mods/gt6scan/utils/VALs.java

This file was deleted.

0 comments on commit a14eb96

Please sign in to comment.