Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup detrav #3058

Merged
merged 29 commits into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d86fa49
remove Loader.isModLoaded calls
boubou19 Sep 4, 2024
1ad715f
tool IDs
boubou19 Sep 4, 2024
faed0f9
cleanup tools
boubou19 Sep 4, 2024
662bc30
cleanup behaviour and processing
boubou19 Sep 4, 2024
f24f029
move enum in enums package
boubou19 Sep 4, 2024
f2b598c
clean commands
boubou19 Sep 4, 2024
444ae55
clean proxies
boubou19 Sep 4, 2024
1d28383
clean utils
boubou19 Sep 4, 2024
ba82c74
spotless Apply
boubou19 Sep 4, 2024
255ddcd
Merge branch 'master' into cleanup/detrav
boubou19 Sep 4, 2024
4e46584
spotless Apply
boubou19 Sep 4, 2024
fbe39bb
Merge branch 'master' into cleanup/detrav
boubou19 Sep 4, 2024
af3e911
Spotless apply for branch cleanup/detrav for #3058 (#3059)
github-actions[bot] Sep 4, 2024
b102034
return 1.0f
boubou19 Sep 4, 2024
7260886
fix nulls
boubou19 Sep 4, 2024
432f176
put back the ductape where it was
boubou19 Sep 5, 2024
923d3c1
spotless
boubou19 Sep 5, 2024
01c0272
Merge branch 'cleanup/detrav' of github.com:GTNewHorizons/GT5-Unoffic…
boubou19 Sep 5, 2024
de3c122
Merge branch 'master' into cleanup/detrav
Dream-Master Sep 5, 2024
0a6138f
Merge branch 'master' into cleanup/detrav
Dream-Master Sep 5, 2024
ff6cb51
Merge branch 'master' into cleanup/detrav
Dream-Master Sep 5, 2024
7b6d363
Merge branch 'master' into cleanup/detrav
Dream-Master Sep 6, 2024
b9ce91e
fix typo
boubou19 Sep 7, 2024
2db3a4e
Merge branch 'master' into cleanup/detrav
boubou19 Sep 7, 2024
42bbca2
Merge branch 'master' into cleanup/detrav
Dream-Master Sep 7, 2024
9166f53
Merge branch 'master' into cleanup/detrav
Dream-Master Sep 7, 2024
efdbb5d
Merge branch 'master' into cleanup/detrav
boubou19 Sep 8, 2024
25a265d
Merge branch 'master' into cleanup/detrav
Dream-Master Sep 8, 2024
7e45ed8
Merge branch 'master' into cleanup/detrav
Dream-Master Sep 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 33 additions & 29 deletions src/main/java/detrav/commands/DetravScannerCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,21 @@ public List getCommandAliases() {

@Override
public void processCommand(ICommandSender sender, String[] args) {
int aX = 0;
int aZ = 0;
int aY = 0;
String name = null;

ArrayList<String> strs = new ArrayList<>();
for (int i = 0; i < args.length; i++) {
strs.add(args[i]);
if (args[i].startsWith("\"")) {
for (i++; i < args.length; i++) {
String temp = (String) strs.get(strs.size() - 1);
temp = temp + " " + args[i];
temp = temp.replace("\"", "");
strs.set(strs.size() - 1, temp);
if (args[i].endsWith("\"")) break;
}
if (!args[i].startsWith("\"")) {
continue;
}

for (i++; i < args.length; i++) {
String temp = (String) strs.get(strs.size() - 1);
temp = temp + " " + args[i];
temp = temp.replace("\"", "");
strs.set(strs.size() - 1, temp);
if (args[i].endsWith("\"")) break;
}
}
args = new String[strs.size()];
Expand All @@ -72,7 +71,7 @@ public void processCommand(ICommandSender sender, String[] args) {
case 0:
break;
case 1:
if (args[0].toLowerCase() == "help") {
if (args[0].equalsIgnoreCase("help")) {
sendHelpMessage(sender);
return;
}
Expand All @@ -96,23 +95,28 @@ private void process(ICommandSender sender, int aX, int aZ, String fName) {
int ySize = c.getHeightValue(x, z);
for (int y = 1; y < ySize; y++) {
Block b = c.getBlock(x, y, z);
if (b == GregTechAPI.sBlockOres1) {
TileEntity entity = c.getTileEntityUnsafe(x, y, z);
if (entity != null) {
TileEntityOres gt_entity = (TileEntityOres) entity;
short meta = gt_entity.getMetaData();
String name = Materials.getLocalizedNameForItem(
GTLanguageManager.getTranslation(b.getUnlocalizedName() + "." + meta + ".name"),
meta % 1000);
if (name.startsWith("Small")) continue;
if (fName == null || name.toLowerCase()
.contains(fName)) {
if (!ores.containsKey(name)) ores.put(name, 1);
else {
int val = ores.get(name);
ores.put(name, val + 1);
}
}
if (b != GregTechAPI.sBlockOres1) {
continue;
}

TileEntity entity = c.getTileEntityUnsafe(x, y, z);

if (entity == null) {
continue;
}

TileEntityOres gt_entity = (TileEntityOres) entity;
short meta = gt_entity.getMetaData();
String name = Materials.getLocalizedNameForItem(
GTLanguageManager.getTranslation(b.getUnlocalizedName() + "." + meta + ".name"),
meta % 1000);
if (name.startsWith("Small")) continue;
if (fName == null || name.toLowerCase()
.contains(fName)) {
if (!ores.containsKey(name)) ores.put(name, 1);
else {
int val = ores.get(name);
ores.put(name, val + 1);
}
}
}
Expand Down
25 changes: 25 additions & 0 deletions src/main/java/detrav/enums/IDDetraveMetaGeneratedTool01.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package detrav.enums;

public enum IDDetraveMetaGeneratedTool01 {

ProspectorScannerULV(0),
ProspectorScannerLV(2),
ProspectorScannerMV(4),
ProspectorScannerHV(6),
ProspectorScannerEV(8),
ProspectorScannerIV(10),
ProspectorScannerLuV(12),
ProspectorScannerZPM(14),
ProspectorScannerUV(16),
ProspectorScannerUHV(18),
ElectricProspectorScannerLuV(100),
ElectricProspectorScannerZPM(102),
ElectricProspectorScannerUV(104),
ElectricProspectorScannerUHV(106),;

public final int ID;

private IDDetraveMetaGeneratedTool01(int ID) {
this.ID = ID;
}
}
Loading