Skip to content

Commit 4da04e0

Browse files
committed
+ Adds GT ores support
* Fixed id meta store
1 parent 45ccf26 commit 4da04e0

8 files changed

Lines changed: 144 additions & 66 deletions

File tree

.run/Minecraft Client.run.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,18 @@
33
<option name="MAIN_CLASS_NAME" value="GradleStart" />
44
<module name="XRay-Mod.main" />
55
<option name="PROGRAM_PARAMETERS" value="--username Johnson" />
6-
<option name="VM_PARAMETERS" value="-Xincgc -Xmx1024M -Xms1024M" />
6+
<option name="VM_PARAMETERS" value="-Xincgc -Xmx4092M -Xms4092M" />
77
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/eclipse" />
8+
<extension name="net.ashald.envfile">
9+
<option name="IS_ENABLED" value="false" />
10+
<option name="IS_SUBST" value="false" />
11+
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
12+
<option name="IS_IGNORE_MISSING_FILES" value="false" />
13+
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
14+
<ENTRIES>
15+
<ENTRY IS_ENABLED="true" PARSER="runconfig" />
16+
</ENTRIES>
17+
</extension>
818
<RunnerSettings RunnerId="Run" />
919
<ConfigurationWrapper RunnerId="Run" />
1020
<method v="2">

.run/Minecraft Server.run.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
<module name="XRay-Mod.main" />
55
<option name="VM_PARAMETERS" value="-Xincgc -Dfml.ignoreInvalidMinecraftCertificates=true" />
66
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/eclipse" />
7+
<extension name="net.ashald.envfile">
8+
<option name="IS_ENABLED" value="false" />
9+
<option name="IS_SUBST" value="false" />
10+
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
11+
<option name="IS_IGNORE_MISSING_FILES" value="false" />
12+
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
13+
<ENTRIES>
14+
<ENTRY IS_ENABLED="true" PARSER="runconfig" />
15+
</ENTRIES>
16+
</extension>
717
<RunnerSettings RunnerId="Run" />
818
<ConfigurationWrapper RunnerId="Run" />
919
<method v="2">

.run/XRay-Mod [build].run.xml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="XRay-Mod [build]" type="GradleRunConfiguration" factoryName="Gradle">
3+
<ExternalSystemSettings>
4+
<option name="executionName" />
5+
<option name="externalProjectPath" value="$PROJECT_DIR$" />
6+
<option name="externalSystemIdString" value="GRADLE" />
7+
<option name="scriptParameters" value="" />
8+
<option name="taskDescriptions">
9+
<list />
10+
</option>
11+
<option name="taskNames">
12+
<list>
13+
<option value="build" />
14+
</list>
15+
</option>
16+
<option name="vmOptions" />
17+
</ExternalSystemSettings>
18+
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
19+
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
20+
<EXTENSION ID="com.intellij.execution.ExternalSystemRunConfigurationJavaExtension">
21+
<extension name="net.ashald.envfile">
22+
<option name="IS_ENABLED" value="false" />
23+
<option name="IS_SUBST" value="false" />
24+
<option name="IS_PATH_MACRO_SUPPORTED" value="false" />
25+
<option name="IS_IGNORE_MISSING_FILES" value="false" />
26+
<option name="IS_ENABLE_EXPERIMENTAL_INTEGRATIONS" value="false" />
27+
<ENTRIES>
28+
<ENTRY IS_ENABLED="true" PARSER="runconfig" />
29+
</ENTRIES>
30+
</extension>
31+
</EXTENSION>
32+
<DebugAllEnabled>false</DebugAllEnabled>
33+
<method v="2" />
34+
</configuration>
35+
</component>

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,51 @@
11
## Minecraft advanced X-Ray cheat
2+
23
Minecraft Forge XRay mod for 1.7.10
34

45
I WILL NOT port this mod to MC version 1.8+ until GTNH don't (never).
56

67
Mod id and file name DO NOT CONTAIN 'xray' or 'cheat' words and sometime will be changed.
78

89
## Features:
10+
911
- Awesome GUI
1012
- Customizable search radius
1113
- Fancy detection render
1214
- Able to add/remove/edit ores/blocks
1315
- Color selector (RGB)
1416
- Hotkeys to enable/disable options
1517
- Can limit height of blocks searching
18+
- GregTech ores detection (at leaset for GT5Unoficial, GTNH pack)
1619

1720
Tested with:
18-
- Vanilla Minecraft 1.7.10 with Forge
19-
- GT: New Horizins modpack
20-
21+
22+
- Vanilla Minecraft 1.7.10 with Forge
23+
- GT: New Horizins modpack
24+
2125
<details>
2226
<summary>Screenshots</summary>
23-
27+
2428
![image](https://user-images.githubusercontent.com/4003026/154060596-d7078d2a-8c50-4f83-8df4-2f353b312ddb.png)
2529
![image](https://user-images.githubusercontent.com/4003026/154060841-21fbdb89-3bf4-4eb9-b8f2-6eb5743c16af.png)
26-
30+
2731
</details>
28-
32+
2933
## Todo:
34+
3035
- Add entity detection
3136
- Add dropped item detection
32-
- Add GT ores detection
33-
- Add fast commands menu
3437

3538
## Gradle build
39+
3640
If you dont have cached mc files (that was removed from the amazon) read this (russian): https://forum.mcmodding.ru/resources/fajly-dlja-forgegradle.300/
37-
1. Run graddle task `setupDecompWorkspace`
38-
2. Update graddle project
41+
42+
1. Run gradle task `setupDecompWorkspace`
43+
2. Update gradle project
3944
3. Create directory `eclipse` if needed
4045
4. Run `minecraft client` debugging
4146

4247
## License
48+
4349
Licensed under the [DBaJ (Don't Be a Jerk) non-commercial care-free license](http://www.dbad-license.org/).
4450

4551
The rendering is copied off of CJB's MoreInfo mod. Thanks CJB!

build.gradle

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,60 @@
11
buildscript {
2-
repositories {
3-
mavenCentral()
4-
maven {
5-
name = "forge"
6-
url = "https://files.minecraftforge.net/maven"
7-
}
8-
maven {
9-
name = "sonatype"
10-
url = "https://oss.sonatype.org/content/repositories/snapshots/"
11-
}
12-
maven {
13-
name = "maven"
14-
url = "https://repo1.maven.org/maven2"
15-
}
16-
}
17-
dependencies {
18-
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
19-
}
2+
repositories {
3+
mavenCentral()
4+
maven { url = "https://files.minecraftforge.net/maven" }
5+
maven { url = "https://repo1.maven.org/maven2" }
6+
maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
7+
}
8+
dependencies {
9+
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
10+
}
2011
}
2112

2213
repositories {
23-
maven {
24-
name = "maven"
25-
url = "https://repo1.maven.org/maven2"
26-
}
14+
maven { url = "https://repo1.maven.org/maven2" }
15+
maven { url = "https://gregtech.overminddl1.com/" }
16+
maven { url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" }
17+
maven { url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases" }
2718
}
2819

2920
apply plugin: 'forge'
3021
sourceCompatibility = 1.8
3122
targetCompatibility = 1.8
3223

3324
group = "io.github.relvl"
34-
version = "1.0.2"
25+
version = "1.0.3"
3526
archivesBaseName = "schematica-advancement-1.7.10"
3627

3728
minecraft {
38-
version = "1.7.10-10.13.4.1558-1.7.10"
39-
runDir = "eclipse"
29+
version = "1.7.10-10.13.4.1558-1.7.10"
30+
runDir = "eclipse"
31+
}
32+
33+
dependencies {
34+
// this mod ONLY for confortable testing and do not required in any case
35+
compile('com.github.GTNewHorizons:StructureLib:1.2.0-beta.2:dev')
36+
compile('com.github.GTNewHorizons:GT5-Unofficial:5.09.40.17:dev')
37+
compile('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
38+
compile('com.github.GTNewHorizons:WAWLA:1.1.3-GTNH:dev')
39+
compile('com.github.GTNewHorizons:WAILAPlugins:0.2.5:dev')
40+
compile('com.github.GTNewHorizons:waila:1.5.22:dev')
4041
}
4142

4243
processResources {
43-
// this will ensure that this task is redone when the versions change.
44-
inputs.property "version", project.version
45-
inputs.property "mcversion", project.minecraft.version
46-
47-
// replace stuff in mcmod.info, nothing else
48-
from(sourceSets.main.resources.srcDirs) {
49-
include 'mcmod.info'
50-
51-
// replace version and mcversion
52-
expand 'version': project.version, 'mcversion': project.minecraft.version
53-
}
54-
55-
// copy everything else, thats not the mcmod.info
56-
from(sourceSets.main.resources.srcDirs) {
57-
exclude 'mcmod.info'
58-
}
44+
// this will ensure that this task is redone when the versions change.
45+
inputs.property "version", project.version
46+
inputs.property "mcversion", project.minecraft.version
47+
48+
// replace stuff in mcmod.info, nothing else
49+
from(sourceSets.main.resources.srcDirs) {
50+
include 'mcmod.info'
51+
52+
// replace version and mcversion
53+
expand 'version': project.version, 'mcversion': project.minecraft.version
54+
}
55+
56+
// copy everything else, thats not the mcmod.info
57+
from(sourceSets.main.resources.srcDirs) {
58+
exclude 'mcmod.info'
59+
}
5960
}

src/main/java/io/github/relvl/schematicaadvancement/client/ClientTick.java

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.github.relvl.schematicaadvancement.client;
22

3+
import java.lang.reflect.Field;
34
import java.util.ArrayList;
45
import java.util.List;
56

@@ -10,13 +11,13 @@
1011
import io.github.relvl.schematicaadvancement.reference.ColoredPosition;
1112
import net.minecraft.block.Block;
1213
import net.minecraft.client.Minecraft;
14+
import net.minecraft.tileentity.TileEntity;
1315
import net.minecraft.util.MathHelper;
1416

1517
public class ClientTick implements Runnable {
1618
private static final int DELAY = 200;
1719

1820
private volatile int localPlyX;
19-
private volatile int localPlyY;
2021
private volatile int localPlyZ;
2122

2223
private final Minecraft mc = Minecraft.getMinecraft();
@@ -27,7 +28,6 @@ public class ClientTick implements Runnable {
2728
public void tickEnd(TickEvent.ClientTickEvent event) {
2829
if ((event.phase == TickEvent.Phase.END) && (mc.thePlayer != null)) {
2930
localPlyX = MathHelper.floor_double(mc.thePlayer.posX);
30-
localPlyY = MathHelper.floor_double(mc.thePlayer.posY);
3131
localPlyZ = MathHelper.floor_double(mc.thePlayer.posZ);
3232

3333
if (ConfigHandler.globalEnabled && ((this.thread == null) || !this.thread.isAlive()) && ((mc.theWorld != null))) {
@@ -45,21 +45,42 @@ public void run() {
4545
while (!this.thread.isInterrupted()) {
4646
if (ConfigHandler.globalEnabled && !ConfigHandler.blocks.isEmpty() && (mc != null) && (mc.theWorld != null) && (mc.thePlayer != null)) {
4747
if (nextTimeMs > System.currentTimeMillis()) {
48+
//noinspection BusyWait
4849
Thread.sleep(1);
4950
continue;
5051
}
5152

52-
List<ColoredPosition> temp = new ArrayList<ColoredPosition>();
53+
List<ColoredPosition> temp = new ArrayList<>();
5354
int radius = ConfigHandler.getRadius();
5455
int px = localPlyX;
55-
int py = localPlyY;
5656
int pz = localPlyZ;
5757
for (int y = ConfigHandler.getLowHeight(); y <= ConfigHandler.getHighHeight(); y++) {
5858
for (int x = px - radius; x < px + radius; x++) {
5959
for (int z = pz - radius; z < pz + radius; z++) {
6060
int id = Block.getIdFromBlock(mc.theWorld.getBlock(x, y, z));
6161
int meta = mc.theWorld.getBlockMetadata(x, y, z);
6262

63+
if (mc.theWorld.getBlock(x, y, z).getUnlocalizedName().equals("gt.blockores")) {
64+
TileEntity et = mc.theWorld.getTileEntity(x, y, z);
65+
if (et != null) {
66+
Field f = et.getClass().getDeclaredField("mMetaData");
67+
//noinspection ConstantConditions
68+
if (f == null) {
69+
for (Field field : et.getClass().getDeclaredFields()) {
70+
if (field.getType() == Short.TYPE) {
71+
f = field;
72+
break;
73+
}
74+
}
75+
}
76+
//noinspection ConstantConditions
77+
if (f != null) {
78+
f.setAccessible(true);
79+
meta = f.getShort(et);
80+
}
81+
}
82+
}
83+
6384
for (BlockInfo ore : ConfigHandler.blocks) {
6485
if (ore.enabled && ore.getIdent().equals(id, meta)) {
6586
temp.add(new ColoredPosition(x, y, z, ore.color));

src/main/java/io/github/relvl/schematicaadvancement/config/ConfigHandler.java

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,10 @@ public static void addBlock(String name, Ident ident, int color) {
101101

102102
public static void update(BlockInfo info) {
103103
String categoryName = "blocks." + info.getIdent().getIdentPair();
104-
for (String category : config.getCategoryNames()) {
105-
if (category.startsWith("blocks.")) {
106-
config.get(categoryName, "name", "").set(info.name);
107-
config.get(categoryName, "color", -1).set(info.color);
108-
config.get(categoryName, "enabled", false).set(info.enabled);
109-
config.save();
110-
break;
111-
}
112-
}
104+
config.get(categoryName, "name", "").set(info.name);
105+
config.get(categoryName, "color", -1).set(info.color);
106+
config.get(categoryName, "enabled", false).set(info.enabled);
107+
config.save();
113108
}
114109

115110
public static void remove(BlockInfo info) {

src/main/resources/mcmod.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"modid": "schematica-advancement",
44
"name": "Schematica Advancement",
55
"description": "An advanced Schematica plugin",
6-
"version": "1.0.2",
6+
"version": "1.0.3",
77
"mcversion": "1.7.10",
88
"url": "https://github.com/Relvl/XRay-Mod",
99
"updateUrl": "",

0 commit comments

Comments
 (0)