├── .gitignore
├── lib
├── lwjgl.jar
├── lwjgl_util.jar
├── log4j-1.2.16.jar
├── native
│ ├── lwjgl.dll
│ ├── OpenAL32.dll
│ ├── OpenAL64.dll
│ ├── liblwjgl.so
│ ├── libopenal.so
│ ├── lwjgl64.dll
│ ├── openal.dylib
│ ├── jinput-dx8.dll
│ ├── jinput-raw.dll
│ ├── liblwjgl64.so
│ ├── libopenal64.so
│ ├── jinput-dx8_64.dll
│ ├── jinput-raw_64.dll
│ ├── liblwjgl.jnilib
│ ├── libjinput-linux.so
│ ├── libjinput-linux64.so
│ └── libjinput-osx.jnilib
└── snakeyaml-1.9.jar
├── textures
├── art
│ └── kz.png
├── terrain.png
├── misc
│ └── water.png
└── particles.png
├── support
├── xray_icon.ico
├── xray_icon.png
├── launch4j-dist
│ ├── bin
│ │ ├── ld
│ │ └── windres
│ ├── head
│ │ ├── head.o
│ │ └── guihead.o
│ ├── xstream.jar
│ ├── launch4j.jar
│ └── w32api
│ │ ├── crt2.o
│ │ ├── libgcc.a
│ │ ├── libmsvcrt.a
│ │ ├── libuser32.a
│ │ ├── libadvapi32.a
│ │ ├── libkernel32.a
│ │ ├── libmingw32.a
│ │ └── libshell32.a
├── minecraft_xray.bat
├── minecraft_xray.sh
├── minecraft_xray_osx.command
├── launch4j.xml
└── log4j.properties
├── META-INF
└── MANIFEST.MF
├── .project
├── .classpath
├── .settings
└── org.eclipse.jdt.core.prefs
├── COPYING-lwjgl.txt
├── src
└── com
│ └── apocalyptech
│ └── minecraft
│ └── xray
│ ├── DimensionFilterException.java
│ ├── dtf
│ ├── EndTag.java
│ ├── IntTag.java
│ ├── ByteTag.java
│ ├── LongTag.java
│ ├── FloatTag.java
│ ├── ShortTag.java
│ ├── StringTag.java
│ ├── DoubleTag.java
│ ├── Tag.java
│ ├── IntArrayTag.java
│ ├── ListTag.java
│ ├── ByteArrayTag.java
│ ├── ShortArrayTag.java
│ ├── CompoundTag.java
│ └── DTFReader.java
│ ├── CameraPreset.java
│ ├── RegionFileFilter.java
│ ├── PaintingEntity.java
│ ├── DimensionFilter.java
│ ├── dialog
│ ├── BlockBindChooserButton.java
│ ├── BlockBindMainButton.java
│ ├── BlockBindButton.java
│ ├── KeyField.java
│ ├── KeyPanel.java
│ └── WarningDialog.java
│ ├── IntegerPair.java
│ ├── PaintingInfo.java
│ ├── Block.java
│ ├── BlockTypeLoadException.java
│ ├── LightSourceRegistry.java
│ ├── XRayProperties.java
│ ├── FirstPersonCameraController.java
│ ├── BlockTypeRegular.java
│ ├── TextureDecorationStats.java
│ ├── SpriteTool.java
│ ├── RegionFileCache.java
│ ├── BlockTypeFilename.java
│ ├── ChunkOriginal.java
│ └── WorldInfo.java
├── COPYING-launch4j.txt
├── COPYING.txt
├── BUILDING.txt
├── TODO.txt
├── COPYING-snakeyaml.txt
└── COPYING-log4j.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | build
2 | dist
3 | *.swp
4 | minecraft_xray_output_log.txt
5 |
--------------------------------------------------------------------------------
/lib/lwjgl.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/lwjgl.jar
--------------------------------------------------------------------------------
/lib/lwjgl_util.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/lwjgl_util.jar
--------------------------------------------------------------------------------
/lib/log4j-1.2.16.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/log4j-1.2.16.jar
--------------------------------------------------------------------------------
/lib/native/lwjgl.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/native/lwjgl.dll
--------------------------------------------------------------------------------
/textures/art/kz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/textures/art/kz.png
--------------------------------------------------------------------------------
/textures/terrain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/textures/terrain.png
--------------------------------------------------------------------------------
/lib/native/OpenAL32.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/native/OpenAL32.dll
--------------------------------------------------------------------------------
/lib/native/OpenAL64.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/native/OpenAL64.dll
--------------------------------------------------------------------------------
/lib/native/liblwjgl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/native/liblwjgl.so
--------------------------------------------------------------------------------
/lib/native/libopenal.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/native/libopenal.so
--------------------------------------------------------------------------------
/lib/native/lwjgl64.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/native/lwjgl64.dll
--------------------------------------------------------------------------------
/lib/native/openal.dylib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/native/openal.dylib
--------------------------------------------------------------------------------
/lib/snakeyaml-1.9.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/snakeyaml-1.9.jar
--------------------------------------------------------------------------------
/support/xray_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/support/xray_icon.ico
--------------------------------------------------------------------------------
/support/xray_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/support/xray_icon.png
--------------------------------------------------------------------------------
/textures/misc/water.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/textures/misc/water.png
--------------------------------------------------------------------------------
/textures/particles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/textures/particles.png
--------------------------------------------------------------------------------
/lib/native/jinput-dx8.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/native/jinput-dx8.dll
--------------------------------------------------------------------------------
/lib/native/jinput-raw.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/native/jinput-raw.dll
--------------------------------------------------------------------------------
/lib/native/liblwjgl64.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/native/liblwjgl64.so
--------------------------------------------------------------------------------
/lib/native/libopenal64.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/native/libopenal64.so
--------------------------------------------------------------------------------
/lib/native/jinput-dx8_64.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/native/jinput-dx8_64.dll
--------------------------------------------------------------------------------
/lib/native/jinput-raw_64.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/native/jinput-raw_64.dll
--------------------------------------------------------------------------------
/lib/native/liblwjgl.jnilib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/native/liblwjgl.jnilib
--------------------------------------------------------------------------------
/support/launch4j-dist/bin/ld:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/support/launch4j-dist/bin/ld
--------------------------------------------------------------------------------
/lib/native/libjinput-linux.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/native/libjinput-linux.so
--------------------------------------------------------------------------------
/lib/native/libjinput-linux64.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/native/libjinput-linux64.so
--------------------------------------------------------------------------------
/lib/native/libjinput-osx.jnilib:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/lib/native/libjinput-osx.jnilib
--------------------------------------------------------------------------------
/support/launch4j-dist/bin/windres:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/support/launch4j-dist/bin/windres
--------------------------------------------------------------------------------
/support/launch4j-dist/head/head.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/support/launch4j-dist/head/head.o
--------------------------------------------------------------------------------
/support/launch4j-dist/xstream.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/support/launch4j-dist/xstream.jar
--------------------------------------------------------------------------------
/support/launch4j-dist/launch4j.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/support/launch4j-dist/launch4j.jar
--------------------------------------------------------------------------------
/support/launch4j-dist/w32api/crt2.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/support/launch4j-dist/w32api/crt2.o
--------------------------------------------------------------------------------
/support/launch4j-dist/head/guihead.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/support/launch4j-dist/head/guihead.o
--------------------------------------------------------------------------------
/support/launch4j-dist/w32api/libgcc.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/support/launch4j-dist/w32api/libgcc.a
--------------------------------------------------------------------------------
/support/launch4j-dist/w32api/libmsvcrt.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/support/launch4j-dist/w32api/libmsvcrt.a
--------------------------------------------------------------------------------
/support/launch4j-dist/w32api/libuser32.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/support/launch4j-dist/w32api/libuser32.a
--------------------------------------------------------------------------------
/support/launch4j-dist/w32api/libadvapi32.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/support/launch4j-dist/w32api/libadvapi32.a
--------------------------------------------------------------------------------
/support/launch4j-dist/w32api/libkernel32.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/support/launch4j-dist/w32api/libkernel32.a
--------------------------------------------------------------------------------
/support/launch4j-dist/w32api/libmingw32.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/support/launch4j-dist/w32api/libmingw32.a
--------------------------------------------------------------------------------
/support/launch4j-dist/w32api/libshell32.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apocalyptech/minecraftxray/HEAD/support/launch4j-dist/w32api/libshell32.a
--------------------------------------------------------------------------------
/META-INF/MANIFEST.MF:
--------------------------------------------------------------------------------
1 | Manifest-Version: 1.2
2 | Main-Class: com.apocalyptech.minecraft.xray.XRay
3 | Class-Path: lib/lwjgl.jar lib/lwjgl_util.jar lib/snakeyaml-1.9.jar lib/log4j-1.2.16.jar
4 |
--------------------------------------------------------------------------------
/support/minecraft_xray.bat:
--------------------------------------------------------------------------------
1 | java -Xms256m -Xmx1024m -Djava.library.path=lib/native -Dlog4j.configuration=file:log4j.properties -jar xray.jar
2 | @echo.
3 | @echo X-Ray log saved to minecraft_xray_output_log.txt
4 | @echo.
5 | @pause
6 |
--------------------------------------------------------------------------------
/support/minecraft_xray.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | cd "`dirname "$0"`"
3 | java -Xms256m -Xmx1024m -Djava.library.path=lib/native -Dlog4j.configuration=file:log4j.properties -jar xray.jar
4 |
5 | echo
6 | echo "X-Ray log saved to minecraft_xray_output_log.txt"
7 | echo
8 |
--------------------------------------------------------------------------------
/support/minecraft_xray_osx.command:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | cd "`dirname "$0"`"
3 | java -Xms256m -Xmx1024m -Djava.library.path=lib/native -Dlog4j.configuration=file:log4j.properties -jar xray.jar
4 |
5 | echo
6 | echo "X-Ray log saved to minecraft_xray_output_log.txt"
7 | echo
8 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | xray
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.jdt.core.javanature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/support/launch4j.xml:
--------------------------------------------------------------------------------
1 |
2 | gui
3 | minecraft_xray.exe
4 | xray.jar
5 | true
6 | http://java.com/download
7 | xray_icon.ico
8 |
9 | 1.6.0
10 | -Djava.library.path=lib\\native
11 | -Dlog4j.configuration=file:log4j.properties
12 |
13 |
14 |
--------------------------------------------------------------------------------
/support/log4j.properties:
--------------------------------------------------------------------------------
1 | log4j.rootLogger = INFO, STDOUT, LOGFILE
2 |
3 | log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender
4 | log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout
5 | log4j.appender.STDOUT.layout.ConversionPattern=%5p | %m%n
6 |
7 | log4j.appender.LOGFILE=org.apache.log4j.FileAppender
8 | log4j.appender.LOGFILE.File=minecraft_xray_output_log.txt
9 | log4j.appender.LOGFILE.Append=false
10 | log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
11 | log4j.appender.LOGFILE.layout.ConversionPattern=%d - %p | %m%n
12 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | #Mon Oct 04 20:54:23 CEST 2010
2 | eclipse.preferences.version=1
3 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
4 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6 | org.eclipse.jdt.core.compiler.compliance=1.5
7 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
9 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12 | org.eclipse.jdt.core.compiler.source=1.5
13 |
--------------------------------------------------------------------------------
/COPYING-lwjgl.txt:
--------------------------------------------------------------------------------
1 | LWJGL is provided under the New/Modified BSD License. For LWJGL sourcecode
2 | and the like, see http://www.lwjgl.org/
3 |
4 | /*
5 | * Copyright (c) 2002-2008 Lightweight Java Game Library Project
6 | * All rights reserved.
7 | *
8 | * Redistribution and use in source and binary forms, with or without
9 | * modification, are permitted provided that the following conditions are
10 | * met:
11 | *
12 | * * Redistributions of source code must retain the above copyright
13 | * notice, this list of conditions and the following disclaimer.
14 | *
15 | * * Redistributions in binary form must reproduce the above copyright
16 | * notice, this list of conditions and the following disclaimer in the
17 | * documentation and/or other materials provided with the distribution.
18 | *
19 | * * Neither the name of 'Light Weight Java Game Library' nor the names of
20 | * its contributors may be used to endorse or promote products derived
21 | * from this software without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
25 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
27 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 | */
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/DimensionFilterException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Christopher J. Kucera
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS OR CJ KUCERA BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray;
28 |
29 | public class DimensionFilterException extends Exception {
30 | public DimensionFilterException()
31 | {
32 | super();
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/dtf/EndTag.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Vincent Vollers
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray.dtf;
28 |
29 | public class EndTag extends Tag {
30 | public EndTag() {
31 |
32 | }
33 | public String toString(int tab) {
34 | return tab(tab) + "TAG_End()\n";
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/dtf/IntTag.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Vincent Vollers
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray.dtf;
28 |
29 | public class IntTag extends Tag {
30 | public int value;
31 | public IntTag(String name, int value) {
32 | this.name = name;
33 | this.value = value;
34 | }
35 | public String toString(int tab) {
36 | return tab(tab) + "TAG_Int(\"" + name + "\"): " + value + "\n";
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/dtf/ByteTag.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Vincent Vollers
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray.dtf;
28 |
29 | public class ByteTag extends Tag {
30 | public byte value;
31 | public ByteTag(String name, byte b) {
32 | this.name = name;
33 | this.value = b;
34 | }
35 |
36 | public String toString(int tab) {
37 | return tab(tab) + "TAG_Byte(\"" + name + "\"): " + value + "\n";
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/dtf/LongTag.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Vincent Vollers
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray.dtf;
28 |
29 | public class LongTag extends Tag {
30 | public long value;
31 | public LongTag(String name, long value) {
32 | this.name = name;
33 | this.value = value;
34 | }
35 | public String toString(int tab) {
36 | return tab(tab) + "TAG_Long(\"" + name + "\"): " + value + "\n";
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/dtf/FloatTag.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Vincent Vollers
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray.dtf;
28 |
29 | public class FloatTag extends Tag {
30 | public float value;
31 | public FloatTag(String name, float value) {
32 | this.name = name;
33 | this.value = value;
34 | }
35 | public String toString(int tab) {
36 | return tab(tab) + "TAG_Float(\"" + name + "\"): " + value + "\n";
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/dtf/ShortTag.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Vincent Vollers
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray.dtf;
28 |
29 | public class ShortTag extends Tag {
30 | public short value;
31 | public ShortTag(String name, short value) {
32 | this.name = name;
33 | this.value = value;
34 | }
35 | public String toString(int tab) {
36 | return tab(tab) + "TAG_Short(\"" + this.name + "\"): " + this.value + "\n";
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/dtf/StringTag.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Vincent Vollers
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray.dtf;
28 |
29 | public class StringTag extends Tag {
30 | public String value;
31 | public StringTag(String name, String value) {
32 | this.name = name;
33 | this.value = value;
34 | }
35 | public String toString(int tab) {
36 | return tab(tab) + "TAG_String(\"" + name + "\"): " + value + "\n";
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/dtf/DoubleTag.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Vincent Vollers
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray.dtf;
28 |
29 | public class DoubleTag extends Tag {
30 | public double value;
31 | public DoubleTag(String name, double value) {
32 | this.name = name;
33 | this.value = value;
34 | }
35 |
36 | public String toString(int tab) {
37 | return tab(tab) + "TAG_Double(\"" + name + "\"): " + value + "\n";
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/dtf/Tag.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Vincent Vollers
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray.dtf;
28 |
29 | public abstract class Tag {
30 | public Tag nextTag;
31 | public String name;
32 |
33 | public String tab(int t) {
34 | String f = "";
35 | for(int i=0;i value;
33 | public ListTag(String name, ArrayList value) {
34 | this.name = name;
35 | this.value = value;
36 | }
37 | public String toString(int tab) {
38 | String f = tab(tab);
39 | f += "TAG_List(\"" + name + "\")\n";
40 | f += tab(tab) + "(\n";
41 | for(Tag t : value) {
42 | f += t.toString(tab+1);
43 | }
44 | f += tab(tab) + "}\n";
45 |
46 | return f;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/dtf/ByteArrayTag.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Vincent Vollers
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray.dtf;
28 |
29 | public class ByteArrayTag extends Tag {
30 | public byte[] value;
31 | public ByteArrayTag(String name, byte[] value) {
32 | this.name = name;
33 | this.value = value;
34 | }
35 |
36 | public String toString(int tab) {
37 | String f = tab(tab) + "TAG_ByteArray(\"" + name + "\"): [";
38 | /* for(byte b : value) {
39 | f += Integer.toHexString(b) + ", ";
40 | }*/
41 |
42 | //f = f.substring(0,f.length()-2);
43 | f += "" + value.length + " bytes";
44 | f += "]\n";
45 | return f;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/dtf/ShortArrayTag.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Vincent Vollers
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray.dtf;
28 |
29 | public class ShortArrayTag extends Tag {
30 | public short[] value;
31 | public ShortArrayTag(String name, short[] value) {
32 | this.name = name;
33 | this.value = value;
34 | }
35 |
36 | public String toString(int tab) {
37 | String f = tab(tab) + "TAG_ShortArray(\"" + name + "\"): [";
38 | /* for(byte b : value) {
39 | f += Integer.toHexString(b) + ", ";
40 | }*/
41 |
42 | //f = f.substring(0,f.length()-2);
43 | f += "" + (value.length*2) + " bytes";
44 | f += "]\n";
45 | return f;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/CameraPreset.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Vincent Vollers and Christopher J. Kucera
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS OR CJ KUCERA BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray;
28 |
29 | /**
30 | * Simple data container to hold information about a player's location. Used so
31 | * that we can switch between users when loading multiplayer maps, though it's
32 | * also intended to hold the singleplayer location, if available.
33 | */
34 | class CameraPreset
35 | {
36 | public int idx;
37 | public String name;
38 | public Block block;
39 | public float yaw;
40 | public float pitch;
41 |
42 | CameraPreset(int idx, String name, Block block, float yaw, float pitch)
43 | {
44 | this.idx = idx;
45 | this.name = name;
46 | this.block = block;
47 | this.yaw = yaw;
48 | this.pitch = pitch;
49 | }
50 | }
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/dtf/CompoundTag.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Vincent Vollers
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray.dtf;
28 |
29 | import java.util.ArrayList;
30 |
31 | public class CompoundTag extends Tag {
32 | public ArrayList value;
33 | public CompoundTag(String name, ArrayList value) {
34 | this.name = name;
35 | this.value = value;
36 | }
37 | public Tag getTagWithName(String name) {
38 | for(Tag t : value) {
39 | if(t.name != null && t.name.equals(name)) {
40 | return t;
41 | }
42 | }
43 | return null;
44 | }
45 | public String toString(int tab) {
46 | String f = tab(tab);
47 | f += "TAG_Compound(\"" + name + "\")\n";
48 | f += tab(tab) + "(\n";
49 | for(Tag t : value) {
50 | f += t.toString(tab+1);
51 | }
52 | f += tab(tab) + "}\n";
53 |
54 | return f;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/RegionFileFilter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Christopher J. Kucera
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS OR CJ KUCERA BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 |
28 | package com.apocalyptech.minecraft.xray;
29 |
30 | import java.io.File;
31 | import java.io.FilenameFilter;
32 |
33 | /**
34 | * Simple class to filter on region files
35 | */
36 | public class RegionFileFilter implements FilenameFilter
37 | {
38 | public static String match_regex;
39 |
40 | public RegionFileFilter(WorldInfo world) {
41 | switch (world.data_format)
42 | {
43 | case ANVIL:
44 | RegionFileFilter.match_regex = "^r\\.(-?\\d+)\\.(-?\\d+)\\.mca$";
45 | break;
46 |
47 | case ORIGINAL:
48 | default:
49 | RegionFileFilter.match_regex = "^r\\.(-?\\d+)\\.(-?\\d+)\\.mcr$";
50 | break;
51 | }
52 | }
53 |
54 | public boolean accept(File directory, String filename) {
55 | return (filename.matches(this.match_regex));
56 | //return (filename.endsWith(".mcr"));
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/PaintingEntity.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Vincent Vollers and Christopher J. Kucera
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS OR CJ KUCERA BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray;
28 |
29 | import com.apocalyptech.minecraft.xray.dtf.CompoundTag;
30 | import com.apocalyptech.minecraft.xray.dtf.StringTag;
31 | import com.apocalyptech.minecraft.xray.dtf.ByteTag;
32 | import com.apocalyptech.minecraft.xray.dtf.IntTag;
33 |
34 | public class PaintingEntity
35 | {
36 | public float tile_x;
37 | public float tile_y;
38 | public float tile_z;
39 | public String name;
40 | public byte dir;
41 |
42 | public PaintingEntity(CompoundTag t)
43 | {
44 | IntTag tile_x = (IntTag) t.getTagWithName("TileX");
45 | IntTag tile_y = (IntTag) t.getTagWithName("TileY");
46 | IntTag tile_z = (IntTag) t.getTagWithName("TileZ");
47 | StringTag name = (StringTag) t.getTagWithName("Motive");
48 | ByteTag dir = (ByteTag) t.getTagWithName("Dir");
49 |
50 | this.tile_x = tile_x.value;
51 | this.tile_y = tile_y.value;
52 | this.tile_z = tile_z.value;
53 | this.name = name.value;
54 | this.dir = dir.value;
55 | }
56 | }
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/DimensionFilter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Christopher J. Kucera
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS OR CJ KUCERA BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray;
28 |
29 | import java.io.File;
30 | import java.io.FilenameFilter;
31 | import java.lang.NumberFormatException;
32 |
33 | public class DimensionFilter implements FilenameFilter
34 | {
35 | public DimensionFilter() {
36 | // Nothing, really
37 | }
38 |
39 | public static int get_dimension(String filename) throws DimensionFilterException {
40 | if (filename.startsWith("DIM"))
41 | {
42 | try
43 | {
44 | return Integer.parseInt(filename.substring(3));
45 | }
46 | catch (NumberFormatException e)
47 | {
48 | // pass, will throw down below
49 | }
50 | }
51 | throw new DimensionFilterException();
52 | }
53 |
54 | public boolean accept(File directory, String filename) {
55 | File combfile = new File(directory, filename);
56 | if (combfile.exists() && combfile.isDirectory())
57 | {
58 | try
59 | {
60 | get_dimension(filename);
61 | return true;
62 | }
63 | catch (DimensionFilterException e)
64 | {
65 | return false;
66 | }
67 | }
68 | return false;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/dialog/BlockBindChooserButton.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Christopher J. Kucera
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS OR CJ KUCERA BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray.dialog;
28 |
29 | import com.apocalyptech.minecraft.xray.BlockType;
30 |
31 | import java.util.HashMap;
32 | import javax.swing.ImageIcon;
33 |
34 | import java.awt.event.ActionListener;
35 | import java.awt.event.ActionEvent;
36 |
37 | /**
38 | * A single button describing a block
39 | */
40 | public class BlockBindChooserButton
41 | extends BlockBindButton
42 | implements ActionListener
43 | {
44 | private BlockBindChooserDialog parent;
45 |
46 | /**
47 | * Constructor, takes in our currently-assigned block, and a map of icons.
48 | *
49 | * @param block The currently assigned block
50 | * @param icon_map A map of block IDs to icons
51 | * @param parent our parent to callback to when clicked
52 | */
53 | public BlockBindChooserButton(BlockType block, HashMap icon_map, BlockBindChooserDialog parent)
54 | {
55 | super(block, icon_map);
56 | this.parent = parent;
57 | this.addActionListener(this);
58 | }
59 |
60 | /**
61 | * What to do when we're clicked, for the ActionListener interface
62 | */
63 | public void actionPerformed(ActionEvent e)
64 | {
65 | parent.notifyHighlightClicked(this);
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/IntegerPair.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2005-2006, The ParticleReality Project
3 | * Copyright (c) 2010-2012, Vincent Vollers and Christopher J. Kucera
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Minecraft X-Ray team nor the
14 | * names of its contributors may be used to endorse or promote products
15 | * derived from this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS OR CJ KUCERA BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | package com.apocalyptech.minecraft.xray;
30 |
31 | /***
32 | * Class holding a pair of two integers where the order is determined
33 | * first by the first integer and when these are equal, by the second
34 | * integer. This is used for holding resolution information
35 | * @author Vincent Vollers
36 | */
37 | @SuppressWarnings("rawtypes")
38 | public class IntegerPair implements Comparable {
39 | private int valueOne;
40 | private int valueTwo;
41 |
42 | public IntegerPair(int valueOne, int valueTwo) {
43 | this.valueOne = valueOne;
44 | this.valueTwo = valueTwo;
45 | }
46 |
47 | public int getValueOne() {
48 | return this.valueOne;
49 | }
50 |
51 | public int getValueTwo() {
52 | return this.valueTwo;
53 | }
54 |
55 | public int compareTo(Object o) {
56 | if(!(o instanceof IntegerPair)) {
57 | return -1;
58 | }
59 | IntegerPair i = (IntegerPair) o;
60 |
61 | if(i.getValueOne()>valueOne)
62 | return 1;
63 |
64 | if(i.getValueOne()valueTwo)
68 | return 1;
69 |
70 | if(i.getValueTwo() icon_map, BlockBindDialog parent, int position)
55 | {
56 | super(block, icon_map);
57 | this.position = position;
58 | this.parent = parent;
59 | this.addActionListener(this);
60 | }
61 |
62 | /**
63 | * Returns our highlight position
64 | */
65 | public int getPosition()
66 | {
67 | return this.position;
68 | }
69 |
70 | /**
71 | * What to do when we're clicked, for the ActionListener interface
72 | */
73 | public void actionPerformed(ActionEvent e)
74 | {
75 | parent.notifyHighlightClicked(this);
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/Block.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Vincent Vollers and Christopher J. Kucera
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS OR CJ KUCERA BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray;
28 |
29 | /**
30 | * @author Vincent Vollers
31 | *
32 | * A Block in the minecraft world
33 | * wildly abused :( for its 'simple' integer x,y,z properties
34 | */
35 | public class Block implements Comparable {
36 |
37 |
38 | public int x;
39 | public int y;
40 | public int z;
41 | public int t;
42 | public int cx;
43 | public int cz;
44 |
45 | public Block(int x, int y, int z) {
46 | this.x =x;
47 | this.y =y;
48 | this.z =z;
49 | this.cx = -x/16;
50 | this.cz = -z/16;
51 | }
52 |
53 | public int compareTo(Block a) {
54 | // TODO Auto-generated method stub
55 |
56 | Block b = (Block) a;
57 | if(b.x > x) {
58 | return 1;
59 | }
60 | if(b.x < x) {
61 | return -1;
62 | }
63 | if(b.z > z) {
64 | return 1;
65 | }
66 | if(b.z < z) {
67 | return -1;
68 | }
69 | if(b.y > y) {
70 | return 1;
71 | }
72 | if(b.y < y) {
73 | return -1;
74 | }
75 | return 0;
76 | }
77 |
78 | public boolean equals(Object o) {
79 | if(!(o instanceof Block)) {
80 | return false;
81 | }
82 | Block p = (Block) o;
83 | return this.x == p.x && this.y == p.y && this.z == p.z;
84 | }
85 |
86 | public boolean equals(Block p) {
87 | return this.x == p.x && this.y == p.y && this.z == p.z;
88 | }
89 | public String toString() {
90 | return "Point( x=" + x + ", y=" + y + ", z=" + z + ")";
91 | }
92 |
93 |
94 | }
95 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/dialog/BlockBindButton.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Christopher J. Kucera
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS OR CJ KUCERA BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray.dialog;
28 |
29 | import com.apocalyptech.minecraft.xray.BlockType;
30 |
31 | import java.util.HashMap;
32 | import javax.swing.JButton;
33 | import javax.swing.ImageIcon;
34 |
35 | /**
36 | * A single button describing a block
37 | */
38 | public class BlockBindButton
39 | extends JButton
40 | {
41 | private BlockType block;
42 | private HashMap icon_map;
43 |
44 | /**
45 | * Constructor, takes in our currently-assigned block, and a map of icons.
46 | *
47 | * @param block The currently assigned block
48 | * @param icon_map A map of block IDs to icons
49 | */
50 | public BlockBindButton(BlockType block, HashMap icon_map)
51 | {
52 | super();
53 | this.icon_map = icon_map;
54 | this.setBlock(block);
55 | }
56 |
57 | /**
58 | * Sets a new BlockType for this button to represent. Will update its
59 | * text and icon.
60 | *
61 | * @param block The new BlockType
62 | */
63 | public void setBlock(BlockType block)
64 | {
65 | this.block = block;
66 |
67 | if (block == null)
68 | {
69 | this.setText("(none)");
70 | }
71 | else
72 | {
73 | if (block.aka != null && !block.name.equalsIgnoreCase(block.aka))
74 | {
75 | this.setText(block.name + " (" + block.aka + ")");
76 | }
77 | else
78 | {
79 | this.setText(block.name);
80 | }
81 | if (icon_map.containsKey(block.getId()))
82 | {
83 | this.setIcon(icon_map.get(block.getId()));
84 | }
85 | }
86 | }
87 |
88 | /**
89 | * Gets the currently-assigned block
90 | */
91 | public BlockType getBlock()
92 | {
93 | return this.block;
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/BlockTypeLoadException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Christopher J. Kucera
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS OR CJ KUCERA BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray;
28 |
29 | import com.apocalyptech.minecraft.xray.dialog.ExceptionDialog;
30 |
31 | public class BlockTypeLoadException extends Exception {
32 | private Exception origException;
33 | private String extraStatus1;
34 | private String extraStatus2;
35 | public BlockTypeLoadException()
36 | {
37 | this.origException = null;
38 | this.extraStatus1 = ExceptionDialog.getExtraStatus1();
39 | this.extraStatus2 = ExceptionDialog.getExtraStatus2();
40 | }
41 | public BlockTypeLoadException(String message)
42 | {
43 | super(message);
44 | this.origException = null;
45 | this.extraStatus1 = ExceptionDialog.getExtraStatus1();
46 | this.extraStatus2 = ExceptionDialog.getExtraStatus2();
47 | }
48 | public BlockTypeLoadException(String message, Exception origException)
49 | {
50 | super(message);
51 | this.origException = origException;
52 | this.extraStatus1 = ExceptionDialog.getExtraStatus1();
53 | this.extraStatus2 = ExceptionDialog.getExtraStatus2();
54 | }
55 | public Exception getOrigException()
56 | {
57 | return this.origException;
58 | }
59 | public String toString()
60 | {
61 | StringBuffer errStr = new StringBuffer();
62 | if (this.extraStatus1 != null)
63 | {
64 | errStr.append(this.extraStatus1 + " - ");
65 | }
66 | if (this.extraStatus2 != null)
67 | {
68 | errStr.append(this.extraStatus2 + " - ");
69 | }
70 | if (this.getMessage() != null)
71 | {
72 | errStr.append(this.getMessage() + " - ");
73 | }
74 | if (this.origException != null && this.origException.toString() != null)
75 | {
76 | errStr.append(this.origException.toString());
77 | }
78 | if (errStr.toString().endsWith(" - "))
79 | {
80 | return errStr.toString().substring(0, errStr.length() - 3);
81 | }
82 | else
83 | {
84 | return errStr.toString();
85 | }
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/COPYING-launch4j.txt:
--------------------------------------------------------------------------------
1 | As mentioned on http://launch4j.sourceforge.net/ -
2 |
3 | launch4j is free software licensed under the BSD license, the head subproject (the
4 | code which is attached to the wrapped jars) is licensed under the MIT license.
5 | Launch4j may be used for wrapping closed source, commercial applications.
6 |
7 | Additionally, launch4j (and thus this distribution) requires a couple of utilities
8 | from the MinGW project, which appear to be under the GPLv2 license. See "COPYING"
9 | inside support/launch4j-dist/bin for more information on that.
10 |
11 | All of the files redistributed here were taken from the launch4j 3.0.2 Linux
12 | distribution.
13 |
14 | The license for launch4j follows, and the license for "head" follows afterwards.
15 |
16 | launch4j
17 | --------
18 |
19 | Launch4j (http://launch4j.sourceforge.net/)
20 | Cross-platform Java application wrapper for creating Windows native executables.
21 |
22 | Copyright (c) 2004, 2011 Grzegorz Kowal
23 |
24 | All rights reserved.
25 |
26 | Redistribution and use in source and binary forms, with or without modification,
27 | are permitted provided that the following conditions are met:
28 |
29 | * Redistributions of source code must retain the above copyright notice,
30 | this list of conditions and the following disclaimer.
31 | * Redistributions in binary form must reproduce the above copyright notice,
32 | this list of conditions and the following disclaimer in the documentation
33 | and/or other materials provided with the distribution.
34 | * Neither the name of the Launch4j nor the names of its contributors
35 | may be used to endorse or promote products derived from this software without
36 | specific prior written permission.
37 |
38 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
39 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
40 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
41 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
42 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
43 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
44 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
45 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
46 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
47 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
48 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
49 |
50 | head
51 | ----
52 |
53 | Copyright (c) 2004, 2007 Grzegorz Kowal
54 |
55 | Permission is hereby granted, free of charge, to any person obtaining a copy
56 | of this software and associated documentation files (the "Software"), to deal
57 | in the Software without restriction, including without limitation the rights
58 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
59 | copies of the Software, and to permit persons to whom the Software is
60 | furnished to do so, subject to the following conditions:
61 |
62 | The above copyright notice and this permission notice shall be included in
63 | all copies or substantial portions of the Software.
64 |
65 | Except as contained in this notice, the name(s) of the above copyright holders
66 | shall not be used in advertising or otherwise to promote the sale, use or other
67 | dealings in this Software without prior written authorization.
68 |
69 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
70 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
71 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
72 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
73 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
74 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
75 | THE SOFTWARE.
76 |
--------------------------------------------------------------------------------
/COPYING.txt:
--------------------------------------------------------------------------------
1 | X-Ray itself is available under the New/Modified BSD License. Full text
2 | is below.
3 |
4 | X-Ray redistributes the following components:
5 |
6 | * LWJGL
7 | http://lwjgl.org/
8 | This is also distributed under the the new/modified BSD license, though
9 | specific details can be found in COPYING-lwjgl.txt.
10 |
11 | * launch4j
12 | http://launch4j.sourceforge.net/
13 | This is used for Windows EXE generation, and is available under a BSD
14 | license. It also appears to include code under the MIT license, and
15 | includes some binaries licensed under the GPL. See COPYING-launch4j.txt
16 | for more details on that.
17 |
18 | * SnakeYAML
19 | http://code.google.com/p/snakeyaml/
20 | Available under the Apache License 2.0. See COPYING-snakeyaml.txt for more
21 | details on that.
22 |
23 | * log4j
24 | http://logging.apache.org/log4j/1.2/
25 | Also available under the Apache License 2.0. See COPYING-log4j.txt for
26 | more details on that.
27 |
28 | * Various files from Minecraft's builtin texturepack
29 | http://www.minecraft.net/
30 | Specifically: terrain.png, particles.png, art/kz.png, and misc/water.png
31 | Technically this redistribution is in violation of Mojang's stated
32 | "Do not distribute anything we've made" rule, but I'm pretty sure that
33 | this kind of usage would be acceptible regardless, especially given that
34 | the bundled texturepack is only used in extreme corner cases where the
35 | user's installed minecraft.jar can't be found on the drive. Plus, many
36 | other prominent community tools have been bundling terrain.png for some
37 | time now (INVedit, MCEdit, etc). Ah, the "everyone else was doing it"
38 | argument! Anyway, I will of course readily cease using the official
39 | texturepack in here if asked.
40 |
41 | * RegionFile.java and RegionFileCache.java, courtesy Jens Bergensten of Mojang
42 | http://mojang.com/2011/02/16/minecraft-save-file-format-in-beta-1-3/
43 | They appear to be under a sort of generic public domain license.
44 |
45 | In general, the X-Ray sourcecode files here will list a copyright for both
46 | Vincent Vollers and CJ Kucera, though the actual distribution of code copyright
47 | would probably be more complicated than that. Please forgive any instances of
48 | code misattribution!
49 |
50 | ----
51 |
52 | Copyright (c) 2010-2012, Vincent Vollers and Christopher J. Kucera
53 | All rights reserved.
54 |
55 | Redistribution and use in source and binary forms, with or without
56 | modification, are permitted provided that the following conditions are met:
57 | * Redistributions of source code must retain the above copyright
58 | notice, this list of conditions and the following disclaimer.
59 | * Redistributions in binary form must reproduce the above copyright
60 | notice, this list of conditions and the following disclaimer in the
61 | documentation and/or other materials provided with the distribution.
62 | * Neither the name of the Minecraft X-Ray team nor the
63 | names of its contributors may be used to endorse or promote products
64 | derived from this software without specific prior written permission.
65 |
66 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
67 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
68 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
69 | DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS OR CJ KUCERA BE LIABLE FOR ANY
70 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
71 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
72 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
73 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
74 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
75 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
76 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/dialog/KeyField.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Christopher J. Kucera, Eleazar Vega-Gonzalez,
3 | * and Saxon Parker
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | * * Redistributions of source code must retain the above copyright
9 | * notice, this list of conditions and the following disclaimer.
10 | * * Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * * Neither the name of the Minecraft X-Ray team nor the
14 | * names of its contributors may be used to endorse or promote products
15 | * derived from this software without specific prior written permission.
16 | *
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS OR CJ KUCERA BE LIABLE FOR ANY
21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package com.apocalyptech.minecraft.xray.dialog;
29 |
30 | import java.awt.Color;
31 | import java.awt.event.MouseEvent;
32 | import java.awt.event.MouseListener;
33 |
34 | import javax.swing.JTextField;
35 |
36 | import com.apocalyptech.minecraft.xray.MinecraftConstants.KEY_ACTION;
37 |
38 | /***
39 | * KeyField class is used for the KeyHelpDialog. It is a Field that
40 | * will contain the LWJGL string for the keyboard button that is pressed
41 | * while the field is in focus.
42 | *
43 | * @author Eleazar
44 | */
45 | public class KeyField extends JTextField{
46 | private KEY_ACTION keyAction;
47 | private KeyPanel panel;
48 | private Color bgColorNormal;
49 | private Color bgColorActive;
50 |
51 | /**
52 | * Constructs a new KeyField given the string to populate it with
53 | * and the KEY_ACTION it represents
54 | * @param ka
55 | * @param s
56 | */
57 | public KeyField(KEY_ACTION ka, KeyPanel panel) {
58 | super(10);
59 | this.keyAction = ka;
60 | this.panel = panel;
61 | this.setEditable(false);
62 | this.bgColorNormal = Color.WHITE;
63 | this.bgColorActive = new Color(144, 204, 255);
64 | this.setBackground(this.bgColorNormal);
65 | this.setFocusable(false);
66 | this.addMouseListener(new KeyFieldMouseListener(this));
67 | }
68 |
69 | /**
70 | * What to do when we're clicked
71 | */
72 | public void clicked()
73 | {
74 | this.panel.notifyClicked();
75 | this.setBackground(this.bgColorActive);
76 | }
77 |
78 | /**
79 | * What to do when we're no longer in a "clicked" state
80 | */
81 | public void clickFinish()
82 | {
83 | this.setBackground(this.bgColorNormal);
84 | }
85 |
86 | /*Inner classes below*/
87 |
88 | private class KeyFieldMouseListener implements MouseListener
89 | {
90 | KeyField kf;
91 | KeyFieldMouseListener(KeyField kf)
92 | {
93 | this.kf = kf;
94 | }
95 | public void mouseClicked(MouseEvent e)
96 | {
97 | this.kf.clicked();
98 | }
99 | public void mouseEntered(MouseEvent e)
100 | {
101 | }
102 | public void mouseExited(MouseEvent e)
103 | {
104 | }
105 | public void mousePressed(MouseEvent e)
106 | {
107 | }
108 | public void mouseReleased(MouseEvent e)
109 | {
110 | }
111 | }
112 | }
113 |
--------------------------------------------------------------------------------
/BUILDING.txt:
--------------------------------------------------------------------------------
1 | You're best off checking out the project from Git, rather than
2 | using the bundled sourcecode in the release .zip and .tbz2 archives.
3 | If you do want to use the bundled source rather than checking out the
4 | project, you'll have to do some file copying:
5 |
6 | The build expects the LWJGL libraries and a few other Jar files in
7 | the "lib" directory. Specifically it's looking for:
8 |
9 | AppleJavaExtensions.jar (presumably just for OSX)
10 | jinput.jar
11 | lwjgl_test.jar
12 | lwjgl_util_applet.jar
13 | lwjgl_util.jar
14 | lwjgl.jar
15 | lzma.jar
16 | snakeyaml-1.9.jar
17 | log4j-1.2.16.jar
18 |
19 | ... Possibly some of those are optional, but you may as well leave them
20 | in. Inside lib/native, make sure that you've got the "native" LWJGL
21 | files, as well. These will be .dll if you're on Windows, and .so on
22 | Linux.
23 |
24 | Additionally, technically speaking you'd want to copy the "textures"
25 | directory over into the source tree as well.
26 |
27 | At that point, you should theoretically be good to go.
28 |
29 | You should be able to develop (or just use) the source either from
30 | the commandline or Eclipse. The tool was originally developed in
31 | Eclipse, but EGit (Eclipse's Git interface) turned out to be kind of
32 | annoying, which was all the urging I needed to abandon the crutch of
33 | handy autocompletion for the warm comforts of my beloved vim (which,
34 | yes, I know, can do autocompletes if you coerce it into doing so).
35 |
36 | COMMANDLINE
37 | -----------
38 |
39 | If you're on the commandline, you can use Ant to build/run,
40 | etc. "ant run" should be sufficient to run the app (it will compile up
41 | a debug version automatically). "ant dist" will package it up as if you're
42 | doing a release, though note that right now that step will only work
43 | on Linux. I've never taken the time to figure out how to get launch4j to
44 | work on other platforms. See build.xml for other ant targets.
45 |
46 | ECLIPSE
47 | -------
48 |
49 | First, a disclaimer: as I mentioned above, I haven't actually used Eclipse
50 | with this project in some time, so it's possible that you'll need to do
51 | more work than is mentioned here. I believe that these docs should be
52 | sufficient, but let me know if it's not.
53 |
54 | If you want to use Eclipse, there's a couple of extra steps. I feel that
55 | both of them really *should* have workarounds which would prevent them from
56 | being needed, but I never did figure it out. Anyway:
57 |
58 | 1) In Eclipse, go to Window -> Preferences -> Java -> Build Path -> Classpath
59 | Variables, then click the "New" button and create a variable called
60 | "XRAY_CLASSPATH". Point that directory at the "lib" dir underneath the
61 | X-Ray project. This should let you compile the app.
62 |
63 | (As an aside, the ".classpath" file distributed with the original X-Ray
64 | distribution specified its jar files with relative paths, such as
65 | "lib/lwjgl.jar". I could never get that to actually work, though, which
66 | is why they're all prefixed with that XRAY_CLASSPATH var now. It'd be
67 | nice to know why, and equally nice to be able to get rid of having to
68 | set up that variable.)
69 |
70 | 2) To actually RUN the app through Eclipse, right-click on the top project
71 | in Package Explorer, go to Properties -> Run/Debug Settings -> XRay, and
72 | click on "Edit". In the Arguments tab, set the VM arguments to:
73 |
74 | -Xms256m -Xmx1024m -Djava.library.path=/path/to/workspace/xray/lib/native -Dlog4j.configuration=file:support/log4j.properties
75 |
76 | ... replacing the "/path/to/workspace" with the path to your actual
77 | Eclipse workspace. If anyone's got a way around having to do that, let
78 | me know.
79 |
80 | You MIGHT have to go into the Classpath tab there, as well, and add in
81 | the JARs under lib/ again (which would show up under that XRAY_CLASSPATH
82 | var), though I don't remember if that automatically happens or not.
83 |
84 | The various build.xml targets should work fine inside Eclipse, too, of course.
85 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/LightSourceRegistry.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Christopher J. Kucera
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS OR CJ KUCERA BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray;
28 |
29 | import java.util.HashMap;
30 |
31 | /**
32 | * Class to aid in our "explored" highlight. Basically just a wrapper
33 | * around a big ol' HashMap. Note that there's currently no API to
34 | * expire information in here. Technically that means that if a user
35 | * were to load X-Ray, travel a ways away, then load Minecraft and make
36 | * some changes, then go BACK into X-Ray and travel back to the original
37 | * location, this registry might differ from what's being shown.
38 | *
39 | * I'm not exactly overly concerned about that.
40 | */
41 | public class LightSourceRegistry
42 | {
43 | private HashMap>> registry;
44 | private final int radius = 3;
45 |
46 | public LightSourceRegistry()
47 | {
48 | // Note that the order will be: x, z, y
49 | registry = new HashMap>>();
50 | }
51 |
52 | /**
53 | * Adds a new entry to the registry. Will also add all "adjacent" blocks
54 | * based on the radius, though note that we're adding a cube centered around
55 | * the given coordinates, not a sphere.
56 | */
57 | public void add(int x, int y, int z)
58 | {
59 | for (int lx = x - this.radius;
60 | lx <= x + this.radius;
61 | lx++)
62 | {
63 | for (int lz = z - this.radius;
64 | lz <= z + this.radius;
65 | lz++)
66 | {
67 | for (int ly = y - this.radius;
68 | ly <= y + this.radius;
69 | ly++)
70 | {
71 | this._add(lx, ly, lz);
72 | }
73 | }
74 | }
75 | }
76 |
77 | /**
78 | * The private function that actually adds a single point to our structure.
79 | */
80 | private void _add(int x, int y, int z)
81 | {
82 | if (!this.registry.containsKey(x))
83 | {
84 | this.registry.put(x, new HashMap>());
85 | }
86 | HashMap> hm_x = this.registry.get(x);
87 |
88 | if (!hm_x.containsKey(z))
89 | {
90 | hm_x.put(z, new HashMap());
91 | }
92 | HashMap hm_z = hm_x.get(z);
93 |
94 | hm_z.put(y, true);
95 | }
96 |
97 | /**
98 | * Checks to see if the given coordinate is in our registry
99 | */
100 | public boolean check(int x, int y, int z)
101 | {
102 | if (!this.registry.containsKey(x))
103 | {
104 | return false;
105 | }
106 | HashMap> hm_x = this.registry.get(x);
107 |
108 | if (!hm_x.containsKey(z))
109 | {
110 | return false;
111 | }
112 | HashMap hm_z = hm_x.get(z);
113 |
114 | if (!hm_z.containsKey(y))
115 | {
116 | return false;
117 | }
118 |
119 | return true;
120 | }
121 | }
122 |
--------------------------------------------------------------------------------
/TODO.txt:
--------------------------------------------------------------------------------
1 | * Figure out transparency rendering glitches, and start using the
2 | transparent leaf texture for trees once that's been figured out. Right
3 | now they look better with the solid texture. In particular, all the
4 | "decorative" blocks like torches, flowers, reed, etc, look weird, as
5 | does water and portals. As it turns out, this is all to do with OpenGL
6 | alpha blending; in addition to a couple quick calls to glDepthMask (see
7 | renderSolid() in Chunk.java), we then need to make sure that all GL
8 | objects are rendered from far-away to near, which will take some doing.
9 |
10 | * Proper rendering support for redstone wire
11 |
12 | * Draw messages on signs like you'd expect.
13 |
14 | * Find a way to eliminate the stuttering when new map chunks are loading
15 |
16 | * Home/End will wipe the minimap and load chunks, even if we're already
17 | "in range" and might even have those chunks cached. Should fix that.
18 |
19 | * Minimap effective size has been cut quite a bit, would like to increase that
20 |
21 | * There are various conditions where the player position and spawn position
22 | markers won't show up properly on the minimap; should fix those.
23 |
24 | * As I've been editing the X-Ray code, I've been using underscore_variables like
25 | that, mostly, instead of the camelCase which was more prevalent. Should really
26 | reformat everything to a single style (and retab the whole thing, and clean up
27 | formatting and style in general). And really, I've been pretty lazy all around
28 | with doing things the "right way." The code could use cleanup in general. Also
29 | I think most of the files are still using DOS line-endings.
30 |
31 | * And, of course, completing the mod support - UI to select extra mod files, etc.
32 | "override" to explicitly override a previously-defined blocktype (this is
33 | technically in there already but completely untested), "version" so that people
34 | could override the builtin blockdef more efficiently, if they want, etc...
35 |
36 | * Technically the minimap colors for a few block types should vary based on the
37 | data value.
38 |
39 | * There's attributes in BlockType which use ArrayList, and I think I'd rather they
40 | just be arrays. Should look into that.
41 |
42 | * Pull the grass colorization color from a point on misc/grasscolor.png
43 |
44 | * Snow has data, as it turns out... Also, it would be nice to have grass+mycelium
45 | react to snow properly (by changing their side image). It seems fairly awkward to
46 | pull off with YAML definitions, though, so we'll just leave it for now.
47 |
48 | * Figure out why loading in nonexistant chunks seems to glitch the app so much
49 |
50 | * Update position information popup in realtime rather than after a delay
51 |
52 | * The resolution-picking dialog has some issues in Java7. One, the dropdowns
53 | seem very sluggish, whereas on previous JDKs they're quite fast. Two (and
54 | possibly relatedly), our hotkeys (enter and escape) only work so long as the
55 | dialog has NEVER actually had the mouse pointer focused on top of it, at
56 | least on my WM. This could potentially have something to do with my
57 | focus-follows-mouse type setup, but it works totally fine in both Java5 and
58 | Java6, so...
59 |
60 | * One of these days I need to just break down and start using some GUI library
61 | like TWL, rather than calling out to AWT windows. Alas.
62 |
63 | * It's entirely possible I should be calling .dispose() on Graphics2D objects
64 | I don't need anymore, and vice-versa. Possibly cut back on memory a bit?
65 |
66 | * Camera presets for bed positions
67 |
68 | * Doors should be rendered "properly"
69 |
70 | * Now that there's region data of some sort in the data files, we should
71 | look into doing some more accurate foliage highlighting.
72 |
73 | * I have never understood why our camera position seems to be the negative
74 | of what it should be. Like where we're storing the player position 'round
75 | line 132 in MinecraftLevel.java, or when we're reading out the camera
76 | position 'round line 2346 in XRay.java (in render()). It makes no sense to
77 | me, but I've been afraid to rip it apart to force it to make more sense.
78 | One of these days... For that matter, it might be a good idea to convert to
79 | using Minecraft's coordinate system, which differs from our own by .5f. In
80 | X-Ray, a block's coordinate (x, z) is found right at the very center of
81 | the block, whereas in Minecraft, it's found at one of the corners. So we're
82 | constantly doing some fudging to report the coordinates in a way that's
83 | consistent with what you get in Minecraft with F3.
84 |
85 | * Now that mobs are much more permanent than they used to be, it might make
86 | sense to have them in X-Ray. Would be nice to be able to highlight Ocelots
87 | hiding around in the jungle, for instance...
88 |
--------------------------------------------------------------------------------
/src/com/apocalyptech/minecraft/xray/XRayProperties.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2010-2012, Christopher J. Kucera
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | * * Redistributions of source code must retain the above copyright
8 | * notice, this list of conditions and the following disclaimer.
9 | * * Redistributions in binary form must reproduce the above copyright
10 | * notice, this list of conditions and the following disclaimer in the
11 | * documentation and/or other materials provided with the distribution.
12 | * * Neither the name of the Minecraft X-Ray team nor the
13 | * names of its contributors may be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 | * DISCLAIMED. IN NO EVENT SHALL VINCENT VOLLERS OR CJ KUCERA BE LIABLE FOR ANY
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 | */
27 | package com.apocalyptech.minecraft.xray;
28 |
29 | import java.util.Vector;
30 | import java.util.Properties;
31 | import java.util.Enumeration;
32 | import java.util.Collections;
33 |
34 | /**
35 | * Class to provide a sorted properties list in our config file,
36 | * with a couple of extra functions that I want.
37 | *
38 | * The sorting functionality in here taken from
39 | * http://www.rgagnon.com/javadetails/java-0614.html
40 | */
41 | public class XRayProperties extends Properties
42 | {
43 |
44 | // Added at the behest of Eclipse (or, well, presumably Java itself)
45 | private static final long serialVersionUID = 2578311914423692774L;
46 |
47 | /**
48 | * Overrides, called by the store method.
49 | */
50 | @SuppressWarnings({ "unchecked", "rawtypes" })
51 | public synchronized Enumeration