mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 01:04:24 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82c0731888 | ||
|
|
a0b0faf693 | ||
|
|
ed3fe86454 | ||
|
|
5bf8a30ab8 | ||
|
|
663ed58610 | ||
|
|
d1909d30ac | ||
|
|
5013991fa4 | ||
|
|
1ed1d233c7 | ||
|
|
3fb9b988d9 | ||
|
|
10f8c2c426 | ||
|
|
8d43d859c7 | ||
|
|
106b9dc4c9 | ||
|
|
8735d92ecd | ||
|
|
87ea7289cb | ||
|
|
8a08602dc3 | ||
|
|
2995f1c072 | ||
|
|
812be37f5f | ||
|
|
4928e3b059 | ||
|
|
3262b656a3 | ||
|
|
5fc1ee844d | ||
|
|
1be3e18a9d | ||
|
|
e511ba7db8 | ||
|
|
e08cec3bc0 | ||
|
|
d6a5cf2828 | ||
|
|
03c5d8aeb4 | ||
|
|
3c3654b576 | ||
|
|
fb30b67adb | ||
|
|
d08641aae5 | ||
|
|
99542f5ef5 | ||
|
|
5decee87d6 | ||
|
|
590072e636 | ||
|
|
fb1cd9be88 | ||
|
|
576ff2fadb | ||
|
|
9e28c51d23 | ||
|
|
6d5dffa458 | ||
|
|
30b1f4c2ed | ||
|
|
0e221f098c | ||
|
|
e835fd2a46 | ||
|
|
55f599e2b3 | ||
|
|
68c3a5675f | ||
|
|
a31f983e6a | ||
|
|
a2fac655b4 | ||
|
|
670180a0b6 | ||
|
|
54da114945 | ||
|
|
ebd92e094d | ||
|
|
7f67f1f13a | ||
|
|
b719f6142c | ||
|
|
18795572fe | ||
|
|
fba7f7d1ab | ||
|
|
1c253966c8 | ||
|
|
effbaa0c74 | ||
|
|
321c8196e7 | ||
|
|
024ebad54a | ||
|
|
d58587a016 | ||
|
|
249d607397 | ||
|
|
5a3585adaa | ||
|
|
8fb9ad4687 | ||
|
|
6715ccd14a | ||
|
|
cf456f9f3d | ||
|
|
a19394d48a | ||
|
|
e233005138 | ||
|
|
f579b2db69 | ||
|
|
fe62372429 | ||
|
|
12853df285 | ||
|
|
9034062c8c | ||
|
|
2a950f3e80 | ||
|
|
fb0ccd3618 | ||
|
|
a6214f2d45 | ||
|
|
3135a0650a | ||
|
|
d2c6244ca8 | ||
|
|
74e7431ab6 | ||
|
|
086b155e6b | ||
|
|
f82ee17e48 | ||
|
|
ae02a73c67 | ||
|
|
561e3c773f | ||
|
|
4127a60d3f | ||
|
|
e7c2b0506f | ||
|
|
65e1544168 | ||
|
|
e9ae3a0a82 | ||
|
|
b4fa5f58db | ||
|
|
eda99a16fb | ||
|
|
721b3015db | ||
|
|
297b35a136 | ||
|
|
29a712e0f9 | ||
|
|
81802108ca | ||
|
|
0908fdfe5c | ||
|
|
fb070104a2 | ||
|
|
e85d4af5da | ||
|
|
54bb9a6efb | ||
|
|
ca979fe391 | ||
|
|
f59a0f61aa | ||
|
|
2a1342dc75 | ||
|
|
f264295d12 | ||
|
|
fb4bbaa85b | ||
|
|
c25a08e946 | ||
|
|
a6a1bcf402 | ||
|
|
0ae9be4710 | ||
|
|
4f7c0b73f8 | ||
|
|
87a9cc96cb | ||
|
|
07dd048d50 | ||
|
|
47bf6357c3 | ||
|
|
705fc5b26c | ||
|
|
7b35ba5be4 | ||
|
|
1a04139657 | ||
|
|
6cfbc34940 | ||
|
|
8fcc2a1f9f | ||
|
|
d3323f547c | ||
|
|
ad3d08f0ee | ||
|
|
f7a3157174 | ||
|
|
7de8218e4a | ||
|
|
0aeb6f1eab | ||
|
|
08beffb945 | ||
|
|
ff6a314cf8 | ||
|
|
5a9c5b4b67 | ||
|
|
0d6fbf063b | ||
|
|
b9a56c48b1 | ||
|
|
b9d42053b2 | ||
|
|
00cd110fae | ||
|
|
36ed659b17 | ||
|
|
be3b4cc3bc | ||
|
|
da26ee2422 | ||
|
|
92d0d6f4e1 | ||
|
|
44992f9b69 | ||
|
|
c9bcb73636 | ||
|
|
cd865a256b | ||
|
|
01c34eb0be | ||
|
|
c9c2bbef1d | ||
|
|
606e0d8e80 | ||
|
|
bedcc2fc64 | ||
|
|
c7db47d528 | ||
|
|
f50d35ce3f | ||
|
|
112adbef8f | ||
|
|
0d917cfdcc | ||
|
|
8f03e6cd24 | ||
|
|
e507f90276 | ||
|
|
dae71d0b7a | ||
|
|
5b2be7903c | ||
|
|
6389b16609 | ||
|
|
902f8918a3 | ||
|
|
73d19ef0a3 | ||
|
|
80ab9a98bb | ||
|
|
7837e4d3a1 | ||
|
|
423490e1c8 | ||
|
|
deae2de0eb | ||
|
|
821cc3ec54 | ||
|
|
9cb5f47805 | ||
|
|
c51848db5b | ||
|
|
20c30d541c | ||
|
|
d9e4d13d69 | ||
|
|
1822dfd896 | ||
|
|
8df7df145b | ||
|
|
f89a1210df | ||
|
|
50c30fce23 | ||
|
|
ad56d1c879 | ||
|
|
65aa6d6b43 | ||
|
|
6aa32def11 | ||
|
|
7be20d9c4d | ||
|
|
3cf1792bec | ||
|
|
d1a79c2a66 | ||
|
|
5b06661835 | ||
|
|
a7e950e7c2 | ||
|
|
341cfc0cf7 | ||
|
|
ba6aa3368d | ||
|
|
81e5a85a36 | ||
|
|
050d0ac294 | ||
|
|
c0c4830ed4 | ||
|
|
9eed4e19f2 | ||
|
|
e8c2895042 |
No files matched your search
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1591
File diff suppressed because it is too large.
Load diff
@@ -213,8 +213,6 @@ net/minecraft/src/Packet8UpdateHealth.func_322_a(Ljava/io/DataOutputStream;)V=ja
|
||||
net/minecraft/src/Packet8UpdateHealth.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet9Respawn.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet9Respawn.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet250CustomPayload.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet250CustomPayload.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/RegionFile.func_22196_b()V=java/io/IOException
|
||||
net/minecraft/src/RegionFile.func_22198_a(III)V=java/io/IOException
|
||||
net/minecraft/src/RegionFile.func_22200_a(I[BI)V=java/io/IOException
|
||||
@@ -228,4 +226,3 @@ net/minecraft/src/ThreadDownloadResources.func_1212_a(Ljava/net/URL;Ljava/io/Fil
|
||||
net/minecraft/src/ThreadedChunkLoader.func_40551_a(Lnet/minecraft/src/ThreadedChunkLoaderPending;)V=java/io/IOException
|
||||
net/minecraft/src/ThreadedChunkLoader.func_813_a(Lnet/minecraft/src/World;II)Lnet/minecraft/src/Chunk;=java/io/IOException
|
||||
net/minecraft/src/ThreadedFileIOBase.func_40566_a()V=java/lang/InterruptedException
|
||||
net/minecraft/src/StringTranslate.func_44025_a(Ljava/util/Properties;Ljava/lang/String;)V=java/io/IOException
|
||||
+5999
File diff suppressed because it is too large.
Load diff
@@ -9,9 +9,6 @@ DirConf = conf
|
||||
DirRuntime = runtime
|
||||
DirLib = lib
|
||||
DirFFOut = temp/ffout
|
||||
DirBinOut = temp/bin
|
||||
DirModSrc = modsrc
|
||||
DirEclipse = eclipse
|
||||
|
||||
[CSV]
|
||||
Classes = %(DirConf)s/classes.csv
|
||||
@@ -26,8 +23,8 @@ Server = %(DirTemp)s/server_rg.srg
|
||||
DirNatives = %(DirJars)s/bin/natives
|
||||
Client = %(DirJars)s/bin/minecraft.jar
|
||||
Server = %(DirJars)s/minecraft_server.jar
|
||||
MD5Client = e92302d2acdba7c97e0d8df1e10d2006
|
||||
MD5Server = b0f4fb91f9723104adf35944bbf3d3cf
|
||||
MD5Client = 3820d222b95d0b8c520d9596a756a6e6
|
||||
MD5Server = 934b6010999daa1f1b1ccdf4cb77e052
|
||||
|
||||
[RETROGUARD]
|
||||
Location = %(DirRuntime)s/bin/retroguard.jar
|
||||
@@ -53,6 +50,8 @@ XClientLog = %(DirLogs)s/client_exc.log
|
||||
XServerLog = %(DirLogs)s/server_exc.log
|
||||
|
||||
[DECOMPILE]
|
||||
FFClientConf = -rbr=0 -dgs=1 -asc=1
|
||||
FFServerConf = -rbr=0 -dgs=1 -asc=1
|
||||
FFClientOut = %(DirFFOut)s/client
|
||||
FFServerOut = %(DirFFOut)s/server
|
||||
FFClientSrc = %(DirFFOut)s/minecraft_exc.jar
|
||||
@@ -60,12 +59,15 @@ FFServerSrc = %(DirFFOut)s/minecraft_server_exc.jar
|
||||
FFSource = net
|
||||
|
||||
[OUTPUT]
|
||||
BinClient = %(DirBinOut)s/minecraft
|
||||
BinServer = %(DirBinOut)s/minecraft_server
|
||||
BinOut = %(DirTemp)s/bin
|
||||
BinClient = %(DirTemp)s/bin/minecraft
|
||||
BinServer = %(DirTemp)s/bin/minecraft_server
|
||||
SrcClient = %(DirSrc)s/minecraft
|
||||
SrcServer = %(DirSrc)s/minecraft_server
|
||||
TestClient = net/minecraft/client/Minecraft
|
||||
TestServer = net/minecraft/server/MinecraftServer
|
||||
|
||||
[PACKAGES]
|
||||
PkgClient = net/minecraft/src,net/minecraft/client
|
||||
PkgServer = net/minecraft/src,net/minecraft/server
|
||||
|
||||
[PATCHES]
|
||||
PatchClient = %(DirConf)s/patches/minecraft.patch
|
||||
@@ -73,8 +75,6 @@ PatchServer = %(DirConf)s/patches/minecraft_server.patch
|
||||
PatchTemp = %(DirTemp)s/temp.patch
|
||||
FFPatchClient = %(DirConf)s/patches/minecraft_ff.patch
|
||||
FFPatchServer = %(DirConf)s/patches/minecraft_server_ff.patch
|
||||
PatchClient_osx = %(DirConf)s/patches/minecraft_osx.patch
|
||||
PatchServer_osx = %(DirConf)s/patches/minecraft_server_osx.patch
|
||||
|
||||
[RECOMPILE]
|
||||
BinClient = %(DirBin)s/minecraft
|
||||
@@ -84,6 +84,8 @@ ClassPathServer = %(DirLib)s/,%(DirLib)s/*,%(DirJars)s/minecraft_server.jar
|
||||
ClientFixes = %(DirConf)s/patches
|
||||
|
||||
[REOBF]
|
||||
SAFFXClient = %(DirTemp)s/minecraft.saffx
|
||||
SAFFXServer = %(DirTemp)s/minecraft_server.saffx
|
||||
MD5Client = %(DirTemp)s/client.md5
|
||||
MD5Server = %(DirTemp)s/server.md5
|
||||
MD5PreReobfClient = %(DirTemp)s/client_reobf.md5
|
||||
@@ -96,46 +98,42 @@ ObfJarClient = %(DirTemp)s/client_reobf.jar
|
||||
ObfJarServer = %(DirTemp)s/server_reobf.jar
|
||||
ReobfDirClient = %(DirReobf)s/minecraft
|
||||
ReobfDirServer = %(DirReobf)s/minecraft_server
|
||||
ClientRoLog = %(DirLogs)s/client_ro.log
|
||||
ServerRoLog = %(DirLogs)s/server_ro.log
|
||||
ReobfClientLog = %(DirLogs)s/client_reob.log
|
||||
ReobfServerLog = %(DirLogs)s/server_reob.log
|
||||
FixSound = ga
|
||||
FixStart = Start
|
||||
FixSound = minecraft/me.class
|
||||
FixStart = minecraft/Start.class
|
||||
NullPkg = net/minecraft/src
|
||||
IgnorePkg = paulscode,com/jcraft,isom,ibxm,de/matthiasmann/twl,org/xmlpull,javax/xml
|
||||
|
||||
[GETMODSOURCE]
|
||||
OutSRCClient = %(DirModSrc)s/minecraft
|
||||
OutSRCServer = %(DirModSrc)s/minecraft_server
|
||||
OutSRCClient = modsrc/client
|
||||
OutSRCServer = modsrc/server
|
||||
OutSRC = modsrc
|
||||
|
||||
[MCP]
|
||||
LogFile = %(DirLogs)s/mcp.log
|
||||
LogFileErr = %(DirLogs)s/mcperr.log
|
||||
UpdateUrl = http://mcp.ocean-labs.de/files/mcprolling_{version}/
|
||||
IgnoreUpdate = %(DirBin)s,%(DirLib)s,%(DirLogs)s,%(DirModSrc)s,%(DirReobf)s,%(DirSrc)s,%(DirTemp)s,%(DirEclipse)s/Client/bin,%(DirEclipse)s/Server/bin,%(DirJars)s/world,%(DirJars)s/saves,%(DirJars)s/resources
|
||||
|
||||
[COMMANDS]
|
||||
Patcher_win = %(DirRuntime)s/bin/applydiff.exe
|
||||
Patcher_linux = patch
|
||||
Patcher_osx = patch
|
||||
Jad_win = %(DirRuntime)s/bin/jad.exe
|
||||
Jad_linux = wine %(DirRuntime)s/bin/jad.exe
|
||||
Jad_osx = %(DirRuntime)s/bin/jad-osx
|
||||
AStyle_win = %(DirRuntime)s/bin/astyle.exe
|
||||
AStyle_linux = wine %(DirRuntime)s/bin/astyle.exe
|
||||
AStyle_osx = %(DirRuntime)s/bin/astyle-osx
|
||||
Patcher = %(DirRuntime)s/bin/applydiff.exe
|
||||
JadRetro = %(DirRuntime)s/bin/jadretro.jar
|
||||
Fernflower = %(DirRuntime)s/bin/fernflower.jar
|
||||
Jadwin = %(DirRuntime)s/bin/jad.exe
|
||||
Jadlinux = %(DirRuntime)s/bin/jad.exe
|
||||
Jadosx = %(DirRuntime)s/bin/jad-osx
|
||||
Exceptor = %(DirRuntime)s/bin/exceptor.jar
|
||||
CmdPatch = %s -p1 -u -i {patchfile} -d {srcdir}
|
||||
CmdJad = %s -b -d {outdir} -dead -o -r -s .java -stat -ff {classes}
|
||||
CmdAStyle = %s -A1s4CSKYm1M1pHjcnqz2 {classes}
|
||||
CmdRG = %s -cp "{classpath}" RetroGuard -searge {conffile}
|
||||
CmdRGReobf = %s -cp "{classpath}" RetroGuard -notch {conffile}
|
||||
CmdJadretro = %s -jar %s {targetdir}
|
||||
CmdFernflower = %s -jar %s -rbr=0 -dgs=1 -asc=1 -log=WARN {jarin} {jarout}
|
||||
CmdExceptor = %s -jar %s {input} {output} {conf} {log}
|
||||
CmdRecomp = %s -g -source 1.6 -target 1.6 -classpath "{classpath}" -sourcepath {sourcepath} -d {outpath} {pkgs}
|
||||
CmdRG = %s -cp {classpath} RetroGuard -searge {conffile}
|
||||
CmdRGReobf = %s -cp {classpath} RetroGuard -notch {conffile}
|
||||
CmdJadretro = %s -jar {jarjr} {targetdir}
|
||||
CmdRecompClt = %s -g -source 1.6 -target 1.6 -classpath "{classpath}" -sourcepath {sourcepath} -d {outpath} {pkgs} {fixes}/*.java
|
||||
CmdRecompSrv = %s -g -source 1.6 -target 1.6 -classpath "{classpath}" -sourcepath {sourcepath} -d {outpath} {pkgs}
|
||||
CmdStartSrv = %s -Xincgc -Xms1024M -Xmx1024M -cp "{classpath}" net.minecraft.server.MinecraftServer
|
||||
CmdStartClt = %s -Xincgc -Xms1024M -Xmx1024M -cp "{classpath}" -Djava.library.path={natives} Start
|
||||
CmdJadwin = .\{binjad} -b -d {outdir} -dead -o -r -s .java -stat -v -ff {classes}
|
||||
CmdJadlinux = wine {binjad} -b -d {outdir} -dead -o -r -s .java -stat -v -ff "{classes}"
|
||||
CmdJadosx = {binjad} -b -d {outdir} -dead -o -r -s .java -stat -v -ff {classes}
|
||||
CmdPatchwin = .\%(Patcher)s --binary -p1 -u -i ..\..\{patchfile} -d {srcdir}
|
||||
CmdPatchlinux = patch --binary -p1 -u -i ../../{patchfile} -d {srcdir}
|
||||
CmdPatchosx = patch --binary -p1 -u -i ../../{patchfile} -d {srcdir}
|
||||
CmdFernflower = %s -jar {jarff} {conf} {jarin} {jarout}
|
||||
CmdExceptor = %s -jar {jarexc} {input} {output} {conf} {log}
|
||||
+4880
File diff suppressed because it is too large.
Load diff
File renamed without changes.
@@ -1,6 +1,6 @@
|
||||
// this is needed for the sound engine to work with deobfuscated sourcecode without crashing
|
||||
|
||||
public class ga
|
||||
public class me
|
||||
{
|
||||
public static int c(double d)
|
||||
{
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,7 +1,7 @@
|
||||
diff -r -U 3 minecraft\net\minecraft\client\Minecraft.java minecraft_patched\net\minecraft\client\Minecraft.java
|
||||
--- minecraft\net\minecraft\client\Minecraft.java Fri Jan 13 17:44:46 2012
|
||||
+++ minecraft_patched\net\minecraft\client\Minecraft.java Fri Jan 13 17:35:06 2012
|
||||
@@ -1609,11 +1609,13 @@
|
||||
--- minecraft\net\minecraft\client\Minecraft.java Tue Nov 22 23:21:44 2011
|
||||
+++ minecraft_patched\net\minecraft\client\Minecraft.java Wed Nov 23 00:09:14 2011
|
||||
@@ -1600,11 +1600,13 @@
|
||||
|
||||
this.field_6324_e.func_600_a(var6.field_22395_a + var10, 64, var6.field_22396_c + var8);
|
||||
if(!this.field_6327_b.func_35643_e()) {
|
||||
@@ -16,8 +16,8 @@ diff -r -U 3 minecraft\net\minecraft\client\Minecraft.java minecraft_patched\net
|
||||
}
|
||||
}
|
||||
diff -r -U 3 minecraft\net\minecraft\src\CodecMus.java minecraft_patched\net\minecraft\src\CodecMus.java
|
||||
--- minecraft\net\minecraft\src\CodecMus.java Fri Jan 13 17:44:20 2012
|
||||
+++ minecraft_patched\net\minecraft\src\CodecMus.java Fri Jan 13 17:35:06 2012
|
||||
--- minecraft\net\minecraft\src\CodecMus.java Tue Nov 22 23:21:36 2011
|
||||
+++ minecraft_patched\net\minecraft\src\CodecMus.java Wed Nov 23 00:09:14 2011
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
@@ -39,8 +39,8 @@ diff -r -U 3 minecraft\net\minecraft\src\CodecMus.java minecraft_patched\net\min
|
||||
}
|
||||
}
|
||||
diff -r -U 3 minecraft\net\minecraft\src\ItemMap.java minecraft_patched\net\minecraft\src\ItemMap.java
|
||||
--- minecraft\net\minecraft\src\ItemMap.java Fri Jan 13 17:43:42 2012
|
||||
+++ minecraft_patched\net\minecraft\src\ItemMap.java Fri Jan 13 17:35:06 2012
|
||||
--- minecraft\net\minecraft\src\ItemMap.java Tue Nov 22 23:21:24 2011
|
||||
+++ minecraft_patched\net\minecraft\src\ItemMap.java Wed Nov 23 00:09:14 2011
|
||||
@@ -19,7 +19,6 @@
|
||||
}
|
||||
|
||||
@@ -58,8 +58,8 @@ diff -r -U 3 minecraft\net\minecraft\src\ItemMap.java minecraft_patched\net\mine
|
||||
if(var4 == null) {
|
||||
var1.func_28156_b(var2.func_28101_b("map"));
|
||||
diff -r -U 3 minecraft\net\minecraft\src\MusInputStream.java minecraft_patched\net\minecraft\src\MusInputStream.java
|
||||
--- minecraft\net\minecraft\src\MusInputStream.java Fri Jan 13 17:42:36 2012
|
||||
+++ minecraft_patched\net\minecraft\src\MusInputStream.java Fri Jan 13 17:35:06 2012
|
||||
--- minecraft\net\minecraft\src\MusInputStream.java Tue Nov 22 23:21:24 2011
|
||||
+++ minecraft_patched\net\minecraft\src\MusInputStream.java Wed Nov 23 00:09:14 2011
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
@@ -82,8 +82,8 @@ diff -r -U 3 minecraft\net\minecraft\src\MusInputStream.java minecraft_patched\n
|
||||
for(int var4 = 0; var4 < var3; ++var4) {
|
||||
byte var5 = var1[var2 + var4] = (byte)(var1[var2 + var4] ^ this.field_1516_c >> 8);
|
||||
diff -r -U 3 minecraft\net\minecraft\src\RenderGlobal.java minecraft_patched\net\minecraft\src\RenderGlobal.java
|
||||
--- minecraft\net\minecraft\src\RenderGlobal.java Fri Jan 13 17:43:24 2012
|
||||
+++ minecraft_patched\net\minecraft\src\RenderGlobal.java Fri Jan 13 17:35:06 2012
|
||||
--- minecraft\net\minecraft\src\RenderGlobal.java Tue Nov 22 23:21:20 2011
|
||||
+++ minecraft_patched\net\minecraft\src\RenderGlobal.java Wed Nov 23 00:10:20 2011
|
||||
@@ -1466,7 +1466,7 @@
|
||||
double var15 = this.field_1439_t.field_22009_h.field_611_ak - var2;
|
||||
double var17 = this.field_1439_t.field_22009_h.field_610_al - var4;
|
||||
@@ -94,8 +94,8 @@ diff -r -U 3 minecraft\net\minecraft\src\RenderGlobal.java minecraft_patched\net
|
||||
this.field_1439_t.field_6321_h.func_1192_a(var21 = new EntityHugeExplodeFX(this.field_1448_k, var2, var4, var6, var8, var10, var12));
|
||||
} else if(var1.equals("largeexplode")) {
|
||||
diff -r -U 3 minecraft\net\minecraft\src\ThreadedFileIOBase.java minecraft_patched\net\minecraft\src\ThreadedFileIOBase.java
|
||||
--- minecraft\net\minecraft\src\ThreadedFileIOBase.java Fri Jan 13 17:43:00 2012
|
||||
+++ minecraft_patched\net\minecraft\src\ThreadedFileIOBase.java Fri Jan 13 17:35:06 2012
|
||||
--- minecraft\net\minecraft\src\ThreadedFileIOBase.java Tue Nov 22 23:21:30 2011
|
||||
+++ minecraft_patched\net\minecraft\src\ThreadedFileIOBase.java Wed Nov 23 00:09:14 2011
|
||||
@@ -21,7 +21,9 @@
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
+4
-4
@@ -1,6 +1,6 @@
|
||||
diff -r -U 3 minecraft_server\net\minecraft\src\ItemMap.java minecraft_server_patched\net\minecraft\src\ItemMap.java
|
||||
--- minecraft_server\net\minecraft\src\ItemMap.java Fri Jan 13 17:46:22 2012
|
||||
+++ minecraft_server_patched\net\minecraft\src\ItemMap.java Fri Jan 13 17:37:00 2012
|
||||
--- minecraft_server\net\minecraft\src\ItemMap.java Tue Nov 22 23:21:56 2011
|
||||
+++ minecraft_server_patched\net\minecraft\src\ItemMap.java Wed Nov 23 00:09:45 2011
|
||||
@@ -22,7 +22,6 @@
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ diff -r -U 3 minecraft_server\net\minecraft\src\ItemMap.java minecraft_server_pa
|
||||
var1.func_28145_b(var2.func_28104_b("map"));
|
||||
diff -r -U 3 minecraft_server\net\minecraft\src\RConThreadClient.java minecraft_server_patched\net\minecraft\src\RConThreadClient.java
|
||||
diff -r -U 3 minecraft_server\net\minecraft\src\ThreadedFileIOBase.java minecraft_server_patched\net\minecraft\src\ThreadedFileIOBase.java
|
||||
--- minecraft_server\net\minecraft\src\ThreadedFileIOBase.java Fri Jan 13 17:45:20 2012
|
||||
+++ minecraft_server_patched\net\minecraft\src\ThreadedFileIOBase.java Fri Jan 13 17:37:00 2012
|
||||
--- minecraft_server\net\minecraft\src\ThreadedFileIOBase.java Tue Nov 22 23:22:10 2011
|
||||
+++ minecraft_server_patched\net\minecraft\src\ThreadedFileIOBase.java Wed Nov 23 00:09:45 2011
|
||||
@@ -21,7 +21,9 @@
|
||||
}
|
||||
|
||||
File renamed without changes.
@@ -182,8 +182,6 @@ net/minecraft/src/Packet8UpdateHealth.func_68_a(Ljava/io/DataOutputStream;)V=jav
|
||||
net/minecraft/src/Packet8UpdateHealth.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet9Respawn.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet9Respawn.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet250CustomPayload.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet250CustomPayload.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/RConOutputStream.func_40393_a(I)V=java/io/IOException
|
||||
net/minecraft/src/RConOutputStream.func_40394_a(S)V=java/io/IOException
|
||||
net/minecraft/src/RConOutputStream.func_40396_a([B)V=java/io/IOException
|
||||
@@ -202,4 +200,3 @@ net/minecraft/src/RegionFile.func_22138_b(III)V=java/io/IOException
|
||||
net/minecraft/src/ThreadedChunkLoader.func_40325_a(Lnet/minecraft/src/ThreadedChunkLoaderPending;)V=java/io/IOException
|
||||
net/minecraft/src/ThreadedChunkLoader.func_659_a(Lnet/minecraft/src/World;II)Lnet/minecraft/src/Chunk;=java/io/IOException
|
||||
net/minecraft/src/ThreadedFileIOBase.func_40508_a()V=java/lang/InterruptedException
|
||||
net/minecraft/src/StringTranslate.func_44011_a(Ljava/util/Properties;Ljava/lang/String;)V=java/io/IOException
|
||||
@@ -0,0 +1,4 @@
|
||||
[VERSION]
|
||||
MCPVersion = 5.0
|
||||
ClientVersion = 1.0.0
|
||||
ServerVersion = 1.0.1
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,54 +0,0 @@
|
||||
diff -r -U 3 minecraft\net\minecraft\src\EntityMinecart.java minecraft_patched\net\minecraft\src\EntityMinecart.java
|
||||
--- minecraft\net\minecraft\src\EntityMinecart.java Sat Jan 14 16:05:10 2012
|
||||
+++ minecraft_patched\net\minecraft\src\EntityMinecart.java Sat Jan 14 16:07:41 2012
|
||||
@@ -811,7 +811,7 @@
|
||||
double d = entity.field_611_ak - field_611_ak;
|
||||
double d1 = entity.field_609_am - field_609_am;
|
||||
double d2 = d * d + d1 * d1;
|
||||
- if(d2 >= 9.9999997473787516E-05D)
|
||||
+ if(d2 >= 9.9999997473787516E-005D)
|
||||
{
|
||||
d2 = MathHelper.func_1109_a(d2);
|
||||
d /= d2;
|
||||
diff -r -U 3 minecraft\net\minecraft\src\RenderGlobal.java minecraft_patched\net\minecraft\src\RenderGlobal.java
|
||||
--- minecraft\net\minecraft\src\RenderGlobal.java Sat Jan 14 16:05:10 2012
|
||||
+++ minecraft_patched\net\minecraft\src\RenderGlobal.java Sat Jan 14 16:07:41 2012
|
||||
@@ -968,7 +968,7 @@
|
||||
f3 = f7;
|
||||
f4 = f8;
|
||||
}
|
||||
- float f6 = 0.0004882812F;
|
||||
+ float f6 = 0.0004882813F;
|
||||
double d = (float)field_1435_x + f;
|
||||
double d1 = field_1439_t.field_22009_h.field_9285_at + (field_1439_t.field_22009_h.field_611_ak - field_1439_t.field_22009_h.field_9285_at) * (double)f + d * 0.029999999329447746D;
|
||||
double d2 = field_1439_t.field_22009_h.field_9283_av + (field_1439_t.field_22009_h.field_609_am - field_1439_t.field_22009_h.field_9283_av) * (double)f;
|
||||
diff -r -U 3 minecraft\net\minecraft\src\Vec3D.java minecraft_patched\net\minecraft\src\Vec3D.java
|
||||
--- minecraft\net\minecraft\src\Vec3D.java Sat Jan 14 16:05:10 2012
|
||||
+++ minecraft_patched\net\minecraft\src\Vec3D.java Sat Jan 14 16:07:41 2012
|
||||
@@ -137,7 +137,7 @@
|
||||
double d1 = vec3d.field_1776_a - field_1776_a;
|
||||
double d2 = vec3d.field_1775_b - field_1775_b;
|
||||
double d3 = vec3d.field_1779_c - field_1779_c;
|
||||
- if(d1 * d1 < 1.0000000116860974E-07D)
|
||||
+ if(d1 * d1 < 1.0000000116860974E-007D)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -156,7 +156,7 @@
|
||||
double d1 = vec3d.field_1776_a - field_1776_a;
|
||||
double d2 = vec3d.field_1775_b - field_1775_b;
|
||||
double d3 = vec3d.field_1779_c - field_1779_c;
|
||||
- if(d2 * d2 < 1.0000000116860974E-07D)
|
||||
+ if(d2 * d2 < 1.0000000116860974E-007D)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -175,7 +175,7 @@
|
||||
double d1 = vec3d.field_1776_a - field_1776_a;
|
||||
double d2 = vec3d.field_1775_b - field_1775_b;
|
||||
double d3 = vec3d.field_1779_c - field_1779_c;
|
||||
- if(d3 * d3 < 1.0000000116860974E-07D)
|
||||
+ if(d3 * d3 < 1.0000000116860974E-007D)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
diff -r -U 3 minecraft_server\net\minecraft\src\EntityMinecart.java minecraft_server_patched\net\minecraft\src\EntityMinecart.java
|
||||
--- minecraft_server\net\minecraft\src\EntityMinecart.java Sat Jan 14 16:05:25 2012
|
||||
+++ minecraft_server_patched\net\minecraft\src\EntityMinecart.java Sat Jan 14 16:07:50 2012
|
||||
@@ -751,7 +751,7 @@
|
||||
double d = entity.field_322_l - field_322_l;
|
||||
double d1 = entity.field_320_n - field_320_n;
|
||||
double d2 = d * d + d1 * d1;
|
||||
- if(d2 >= 9.9999997473787516E-05D)
|
||||
+ if(d2 >= 9.9999997473787516E-005D)
|
||||
{
|
||||
d2 = MathHelper.func_583_a(d2);
|
||||
d /= d2;
|
||||
diff -r -U 3 minecraft_server\net\minecraft\src\GuiStatsComponent.java minecraft_server_patched\net\minecraft\src\GuiStatsComponent.java
|
||||
--- minecraft_server\net\minecraft\src\GuiStatsComponent.java Sat Jan 14 16:05:25 2012
|
||||
+++ minecraft_server_patched\net\minecraft\src\GuiStatsComponent.java Sat Jan 14 16:07:50 2012
|
||||
@@ -43,12 +43,12 @@
|
||||
System.gc();
|
||||
field_768_c[0] = (new StringBuilder()).append("Memory use: ").append(l / 1024L / 1024L).append(" mb (").append((Runtime.getRuntime().freeMemory() * 100L) / Runtime.getRuntime().maxMemory()).append("% free)").toString();
|
||||
field_768_c[1] = (new StringBuilder()).append("Threads: ").append(NetworkManager.field_1052_b).append(" + ").append(NetworkManager.field_1051_c).toString();
|
||||
- field_768_c[2] = (new StringBuilder()).append("Avg tick: ").append(field_40573_a.format(func_40571_a(field_40572_e.field_40027_f) * 9.9999999999999995E-07D)).append(" ms").toString();
|
||||
+ field_768_c[2] = (new StringBuilder()).append("Avg tick: ").append(field_40573_a.format(func_40571_a(field_40572_e.field_40027_f) * 9.9999999999999995E-007D)).append(" ms").toString();
|
||||
i = 0;
|
||||
_L3:
|
||||
if(i >= field_40572_e.field_6034_e.length) goto _L2; else goto _L1
|
||||
_L1:
|
||||
- field_768_c[3 + i] = (new StringBuilder()).append("Lvl ").append(i).append(" tick: ").append(field_40573_a.format(func_40571_a(field_40572_e.field_40028_g[i]) * 9.9999999999999995E-07D)).append(" ms").toString();
|
||||
+ field_768_c[3 + i] = (new StringBuilder()).append("Lvl ").append(i).append(" tick: ").append(field_40573_a.format(func_40571_a(field_40572_e.field_40028_g[i]) * 9.9999999999999995E-007D)).append(" ms").toString();
|
||||
if(field_40572_e.field_6034_e[i] == null || field_40572_e.field_6034_e[i].field_20911_y == null)
|
||||
{
|
||||
continue; /* Loop/switch isn't completed */
|
||||
diff -r -U 3 minecraft_server\net\minecraft\src\Vec3D.java minecraft_server_patched\net\minecraft\src\Vec3D.java
|
||||
--- minecraft_server\net\minecraft\src\Vec3D.java Sat Jan 14 16:05:25 2012
|
||||
+++ minecraft_server_patched\net\minecraft\src\Vec3D.java Sat Jan 14 16:07:50 2012
|
||||
@@ -121,7 +121,7 @@
|
||||
double d1 = vec3d.field_1055_a - field_1055_a;
|
||||
double d2 = vec3d.field_1054_b - field_1054_b;
|
||||
double d3 = vec3d.field_1058_c - field_1058_c;
|
||||
- if(d1 * d1 < 1.0000000116860974E-07D)
|
||||
+ if(d1 * d1 < 1.0000000116860974E-007D)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -140,7 +140,7 @@
|
||||
double d1 = vec3d.field_1055_a - field_1055_a;
|
||||
double d2 = vec3d.field_1054_b - field_1054_b;
|
||||
double d3 = vec3d.field_1058_c - field_1058_c;
|
||||
- if(d2 * d2 < 1.0000000116860974E-07D)
|
||||
+ if(d2 * d2 < 1.0000000116860974E-007D)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -159,7 +159,7 @@
|
||||
double d1 = vec3d.field_1055_a - field_1055_a;
|
||||
double d2 = vec3d.field_1054_b - field_1054_b;
|
||||
double d3 = vec3d.field_1058_c - field_1058_c;
|
||||
- if(d3 * d3 < 1.0000000116860974E-07D)
|
||||
+ if(d3 * d3 < 1.0000000116860974E-007D)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
[VERSION]
|
||||
MCPVersion = 5.6
|
||||
ClientVersion = 1.1
|
||||
ServerVersion = 1.1
|
||||
@@ -1,123 +0,0 @@
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.src.GameSettings;
|
||||
import net.minecraft.src.GuiControls;
|
||||
import net.minecraft.src.GuiSlot;
|
||||
import net.minecraft.src.KeyBinding;
|
||||
import net.minecraft.src.Tessellator;
|
||||
|
||||
public class GuiControlsScrollPanel extends GuiSlot
|
||||
{
|
||||
private GuiControls controls;
|
||||
private GameSettings options;
|
||||
private Minecraft mc;
|
||||
private String[] message;
|
||||
private int mouseX;
|
||||
private int mouseY;
|
||||
private int selected = -1;
|
||||
|
||||
public GuiControlsScrollPanel(GuiControls controls, GameSettings options, Minecraft mc)
|
||||
{
|
||||
super(mc, controls.width, controls.height, 16, (controls.height - 32) + 4, 25);
|
||||
this.controls = controls;
|
||||
this.options = options;
|
||||
this.mc = mc;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getSize() {
|
||||
return options.keyBindings.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void elementClicked(int i, boolean flag)
|
||||
{
|
||||
if (!flag)
|
||||
{
|
||||
if (selected == -1)
|
||||
{
|
||||
selected = i;
|
||||
}
|
||||
else
|
||||
{
|
||||
options.setKeyBinding(selected, -100);
|
||||
selected = -1;
|
||||
KeyBinding.resetKeyBindingArrayAndHash();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isSelected(int i)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawBackground() {}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mX, int mY, float f)
|
||||
{
|
||||
mouseX = mX;
|
||||
mouseY = mY;
|
||||
|
||||
if (selected != -1 && !Mouse.isButtonDown(0) && Mouse.getDWheel() == 0)
|
||||
{
|
||||
if (Mouse.next() && Mouse.getEventButtonState())
|
||||
{
|
||||
System.out.println(Mouse.getEventButton());
|
||||
options.setKeyBinding(selected, -100 + Mouse.getEventButton());
|
||||
selected = -1;
|
||||
KeyBinding.resetKeyBindingArrayAndHash();
|
||||
}
|
||||
}
|
||||
|
||||
super.drawScreen(mX, mY, f);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawSlot(int index, int xPosition, int yPosition, int l, Tessellator tessellator)
|
||||
{
|
||||
int width = 70;
|
||||
int height = 20;
|
||||
xPosition -= 20;
|
||||
boolean flag = mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + width && mouseY < yPosition + height;
|
||||
int k = (flag ? 2 : 1);
|
||||
|
||||
GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/gui/gui.png"));
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
controls.drawTexturedModalRect(xPosition, yPosition, 0, 46 + k * 20, width / 2, height);
|
||||
controls.drawTexturedModalRect(xPosition + width / 2, yPosition, 200 - width / 2, 46 + k * 20, width / 2, height);
|
||||
controls.drawString(mc.fontRenderer, options.getKeyBindingDescription(index), xPosition + width + 4, yPosition + 6, 0xFFFFFFFF);
|
||||
|
||||
boolean conflict = false;
|
||||
for (int x = 0; x < options.keyBindings.length; x++)
|
||||
{
|
||||
if (x != index && options.keyBindings[x].keyCode == options.keyBindings[index].keyCode)
|
||||
{
|
||||
conflict = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
String str = (conflict ? "\247c" : "") + options.getOptionDisplayString(index);
|
||||
str = (index == selected ? "\247f> \247e??? \247f<" : str);
|
||||
controls.drawCenteredString(mc.fontRenderer, str, xPosition + (width / 2), yPosition + (height - 8) / 2, 0xFFFFFFFF);
|
||||
}
|
||||
|
||||
public boolean keyTyped(char c, int i)
|
||||
{
|
||||
if (selected != -1)
|
||||
{
|
||||
options.setKeyBinding(selected, i);
|
||||
selected = -1;
|
||||
KeyBinding.resetKeyBindingArrayAndHash();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.AxisAlignedBB;
|
||||
import net.minecraft.src.Entity;
|
||||
import net.minecraft.src.EntityMinecart;
|
||||
|
||||
/**
|
||||
* This class defines a replacement for the default minecart collision code.
|
||||
* Only one handler can be registered at a time. It it registered with EntityMinecart.registerCollisionHandler().
|
||||
* If you use this, make it a configuration option.
|
||||
* @author CovertJaguar
|
||||
*/
|
||||
public interface IMinecartCollisionHandler
|
||||
{
|
||||
|
||||
/**
|
||||
* This basically replaces the function of the same name in EnityMinecart.
|
||||
* Code in IMinecartHooks.applyEntityCollisionHook is still run.
|
||||
* @param cart The cart that called the collision.
|
||||
* @param other The object it collided with.
|
||||
*/
|
||||
public void onEntityCollision(EntityMinecart cart, Entity other);
|
||||
|
||||
/**
|
||||
* This function replaced the function of the same name in EntityMinecart.
|
||||
* It is used to define whether minecarts collide with specific entities,
|
||||
* for example items.
|
||||
* @param cart The cart for which the collision box was requested.
|
||||
* @param other The entity requesting the collision box.
|
||||
* @return The collision box or null.
|
||||
*/
|
||||
public AxisAlignedBB getCollisionBox(EntityMinecart cart, Entity other);
|
||||
|
||||
/**
|
||||
* This function is used to define the box used for detecting minecart collisions.
|
||||
* It is generally bigger that the normal collision box.
|
||||
* @param cart The cart for which the collision box was requested.
|
||||
* @return The collision box, cannot be null.
|
||||
*/
|
||||
public AxisAlignedBB getMinecartCollisionBox(EntityMinecart cart);
|
||||
|
||||
/**
|
||||
* This function replaces the function of the same name in EntityMinecart.
|
||||
* It defines whether minecarts are solid to the player.
|
||||
* @param cart The cart for which the bounding box was requested.
|
||||
* @return The bounding box or null.
|
||||
*/
|
||||
public AxisAlignedBB getBoundingBox(EntityMinecart cart);
|
||||
}
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.Entity;
|
||||
import net.minecraft.src.EntityMinecart;
|
||||
import net.minecraft.src.EntityPlayer;
|
||||
|
||||
public interface IMinecartHandler {
|
||||
|
||||
/**
|
||||
* This functions is called at the end of every minecart's doUpdate loop.
|
||||
* If you override EntityMinecart.doUpdate(), is recommended that you retain the code that calls this function.
|
||||
* @param cart The cart that called the function.
|
||||
* @param i X coordinate of the rail
|
||||
* @param j Y coordinate of the rail
|
||||
* @param k Z coordinate of the rail
|
||||
*/
|
||||
public void onMinecartUpdate(EntityMinecart minecart, int x, int y, int z);
|
||||
|
||||
/**
|
||||
* This function allows several mods to add code into the collision routine at the same time regardless of the collision handler registered.
|
||||
* If you override EntityMinecart.applyEntityCollision(), is recommended that you retain the code that calls this function.
|
||||
* @param cart The cart that called the function.
|
||||
* @param other
|
||||
*/
|
||||
public void onMinecartEntityCollision(EntityMinecart minecart, Entity entity);
|
||||
|
||||
/**
|
||||
* This function is called whenever a player attempts to interact with a minecart.
|
||||
* The primary reason for this hook is to fix a few bugs and put restrictions on how a minecart can be used under certain circumstances.
|
||||
* If you override EntityMinecart.interact(), is recommended that you retain the code that calls this function.
|
||||
* @param cart The cart that called the function.
|
||||
* @param player The player that tried to interact with the minecart.
|
||||
* @param canceled Wither or not a pervious hook has canceled the interaction of a player.
|
||||
* @return Whether the player can interact with the minecart.
|
||||
*/
|
||||
public boolean onMinecartInteract(EntityMinecart minecart, EntityPlayer player, boolean canceled);
|
||||
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.EntityMinecart;
|
||||
|
||||
/**
|
||||
* Used to create hashmap values for Minecart/type pairs
|
||||
* Written by CovertJaguar
|
||||
*/
|
||||
public class MinecartKey {
|
||||
public final Class<? extends EntityMinecart> minecart;
|
||||
public final int type;
|
||||
|
||||
public MinecartKey(Class<? extends EntityMinecart> c, int t)
|
||||
{
|
||||
minecart = c;
|
||||
type = t;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj)
|
||||
{
|
||||
if(obj == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(getClass() != obj.getClass())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final MinecartKey other = (MinecartKey)obj;
|
||||
if(this.minecart != other.minecart && (this.minecart == null || !this.minecart.equals(other.minecart)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return (this.type == other.type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
int hash = 7;
|
||||
hash = 59 * hash + (this.minecart != null ? this.minecart.hashCode() : 0);
|
||||
hash = 59 * hash + this.type;
|
||||
return hash;
|
||||
}
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/BlockButton.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/BlockButton.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -32,36 +32,36 @@
|
||||
|
||||
public boolean canPlaceBlockOnSide(World world, int i, int j, int k, int l)
|
||||
{
|
||||
- if (l == 2 && world.isBlockNormalCube(i, j, k + 1))
|
||||
+ if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (l == 3 && world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (l == 4 && world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- return l == 5 && world.isBlockNormalCube(i - 1, j, k);
|
||||
+ return l == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5);
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
||||
{
|
||||
- if (world.isBlockNormalCube(i - 1, j, k))
|
||||
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if (world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if (world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- return world.isBlockNormalCube(i, j, k + 1);
|
||||
+ return world.isBlockSolidOnSide(i, j, k + 1, 2);
|
||||
}
|
||||
|
||||
public void onBlockPlaced(World world, int i, int j, int k, int l)
|
||||
@@ -69,19 +69,19 @@
|
||||
int i1 = world.getBlockMetadata(i, j, k);
|
||||
int j1 = i1 & 8;
|
||||
i1 &= 7;
|
||||
- if (l == 2 && world.isBlockNormalCube(i, j, k + 1))
|
||||
+ if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
i1 = 4;
|
||||
}
|
||||
- else if (l == 3 && world.isBlockNormalCube(i, j, k - 1))
|
||||
+ else if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
i1 = 3;
|
||||
}
|
||||
- else if (l == 4 && world.isBlockNormalCube(i + 1, j, k))
|
||||
+ else if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
i1 = 2;
|
||||
}
|
||||
- else if (l == 5 && world.isBlockNormalCube(i - 1, j, k))
|
||||
+ else if (l == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
i1 = 1;
|
||||
}
|
||||
@@ -94,19 +94,19 @@
|
||||
|
||||
private int getOrientation(World world, int i, int j, int k)
|
||||
{
|
||||
- if (world.isBlockNormalCube(i - 1, j, k))
|
||||
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if (world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if (world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
- return !world.isBlockNormalCube(i, j, k + 1) ? 1 : 4;
|
||||
+ return !world.isBlockSolidOnSide(i, j, k + 1, 2) ? 1 : 4;
|
||||
}
|
||||
|
||||
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
|
||||
@@ -115,19 +115,19 @@
|
||||
{
|
||||
int i1 = world.getBlockMetadata(i, j, k) & 7;
|
||||
boolean flag = false;
|
||||
- if (!world.isBlockNormalCube(i - 1, j, k) && i1 == 1)
|
||||
+ if (!world.isBlockSolidOnSide(i - 1, j, k, 5) && i1 == 1)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCube(i + 1, j, k) && i1 == 2)
|
||||
+ if (!world.isBlockSolidOnSide(i + 1, j, k, 4) && i1 == 2)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCube(i, j, k - 1) && i1 == 3)
|
||||
+ if (!world.isBlockSolidOnSide(i, j, k - 1, 3) && i1 == 3)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCube(i, j, k + 1) && i1 == 4)
|
||||
+ if (!world.isBlockSolidOnSide(i, j, k + 1, 2) && i1 == 4)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/BlockChest.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/BlockChest.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -424,23 +424,23 @@
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i, j + 1, k))
|
||||
+ if (world.isBlockSolidOnSide(i, j + 1, k, 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.getBlockId(i - 1, j, k) == blockID && world.isBlockNormalCube(i - 1, j + 1, k))
|
||||
+ if (world.getBlockId(i - 1, j, k) == blockID && world.isBlockSolidOnSide(i - 1, j + 1, k, 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.getBlockId(i + 1, j, k) == blockID && world.isBlockNormalCube(i + 1, j + 1, k))
|
||||
+ if (world.getBlockId(i + 1, j, k) == blockID && world.isBlockSolidOnSide(i + 1, j + 1, k, 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.getBlockId(i, j, k - 1) == blockID && world.isBlockNormalCube(i, j + 1, k - 1))
|
||||
+ if (world.getBlockId(i, j, k - 1) == blockID && world.isBlockSolidOnSide(i, j + 1, k - 1, 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.getBlockId(i, j, k + 1) == blockID && world.isBlockNormalCube(i, j + 1, k + 1))
|
||||
+ if (world.getBlockId(i, j, k + 1) == blockID && world.isBlockSolidOnSide(i, j + 1, k + 1, 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/BlockLadder.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/BlockLadder.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -35,7 +35,7 @@
|
||||
setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F);
|
||||
}
|
||||
return super.getSelectedBoundingBoxFromPool(world, i, j, k);
|
||||
- }
|
||||
+ }
|
||||
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
@@ -54,37 +54,37 @@
|
||||
|
||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
||||
{
|
||||
- if (world.isBlockNormalCube(i - 1, j, k))
|
||||
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if (world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if (world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- return world.isBlockNormalCube(i, j, k + 1);
|
||||
+ return world.isBlockSolidOnSide(i, j, k + 1, 2);
|
||||
}
|
||||
|
||||
public void onBlockPlaced(World world, int i, int j, int k, int l)
|
||||
{
|
||||
int i1 = world.getBlockMetadata(i, j, k);
|
||||
- if ((i1 == 0 || l == 2) && world.isBlockNormalCube(i, j, k + 1))
|
||||
+ if ((i1 == 0 || l == 2) && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
i1 = 2;
|
||||
}
|
||||
- if ((i1 == 0 || l == 3) && world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if ((i1 == 0 || l == 3) && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
i1 = 3;
|
||||
}
|
||||
- if ((i1 == 0 || l == 4) && world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if ((i1 == 0 || l == 4) && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
i1 = 4;
|
||||
}
|
||||
- if ((i1 == 0 || l == 5) && world.isBlockNormalCube(i - 1, j, k))
|
||||
+ if ((i1 == 0 || l == 5) && world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
i1 = 5;
|
||||
}
|
||||
@@ -95,19 +95,19 @@
|
||||
{
|
||||
int i1 = world.getBlockMetadata(i, j, k);
|
||||
boolean flag = false;
|
||||
- if (i1 == 2 && world.isBlockNormalCube(i, j, k + 1))
|
||||
+ if (i1 == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (i1 == 3 && world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if (i1 == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (i1 == 4 && world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if (i1 == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (i1 == 5 && world.isBlockNormalCube(i - 1, j, k))
|
||||
+ if (i1 == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -123,4 +123,11 @@
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
+
|
||||
+ /* FORGE: Implemented base method, see Block.isLadder */
|
||||
+ @Override
|
||||
+ public boolean isLadder(World world, int X, int Y, int Z)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/BlockLever.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/BlockLever.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -31,44 +31,44 @@
|
||||
|
||||
public boolean canPlaceBlockOnSide(World world, int i, int j, int k, int l)
|
||||
{
|
||||
- if (l == 1 && world.isBlockNormalCube(i, j - 1, k))
|
||||
+ if (l == 1 && world.isBlockSolidOnSide(i, j - 1, k, 1))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (l == 2 && world.isBlockNormalCube(i, j, k + 1))
|
||||
+ if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (l == 3 && world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (l == 4 && world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- return l == 5 && world.isBlockNormalCube(i - 1, j, k);
|
||||
+ return l == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5);
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
||||
{
|
||||
- if (world.isBlockNormalCube(i - 1, j, k))
|
||||
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if (world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if (world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i, j, k + 1))
|
||||
+ if (world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- return world.isBlockNormalCube(i, j - 1, k);
|
||||
+ return world.isBlockSolidOnSide(i, j - 1, k, 1);
|
||||
}
|
||||
|
||||
public void onBlockPlaced(World world, int i, int j, int k, int l)
|
||||
@@ -77,23 +77,23 @@
|
||||
int j1 = i1 & 8;
|
||||
i1 &= 7;
|
||||
i1 = -1;
|
||||
- if (l == 1 && world.isBlockNormalCube(i, j - 1, k))
|
||||
+ if (l == 1 && world.isBlockSolidOnSide(i, j - 1, k, 1))
|
||||
{
|
||||
i1 = 5 + world.rand.nextInt(2);
|
||||
}
|
||||
- if (l == 2 && world.isBlockNormalCube(i, j, k + 1))
|
||||
+ if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
i1 = 4;
|
||||
}
|
||||
- if (l == 3 && world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
i1 = 3;
|
||||
}
|
||||
- if (l == 4 && world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
i1 = 2;
|
||||
}
|
||||
- if (l == 5 && world.isBlockNormalCube(i - 1, j, k))
|
||||
+ if (l == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
i1 = 1;
|
||||
}
|
||||
@@ -116,27 +116,27 @@
|
||||
{
|
||||
int i1 = world.getBlockMetadata(i, j, k) & 7;
|
||||
boolean flag = false;
|
||||
- if (!world.isBlockNormalCube(i - 1, j, k) && i1 == 1)
|
||||
+ if (!world.isBlockSolidOnSide(i - 1, j, k, 5) && i1 == 1)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCube(i + 1, j, k) && i1 == 2)
|
||||
+ if (!world.isBlockSolidOnSide(i + 1, j, k, 4) && i1 == 2)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCube(i, j, k - 1) && i1 == 3)
|
||||
+ if (!world.isBlockSolidOnSide(i, j, k - 1, 3) && i1 == 3)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCube(i, j, k + 1) && i1 == 4)
|
||||
+ if (!world.isBlockSolidOnSide(i, j, k + 1, 2) && i1 == 4)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCube(i, j - 1, k) && i1 == 5)
|
||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && i1 == 5)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCube(i, j - 1, k) && i1 == 6)
|
||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && i1 == 6)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/BlockNetherStalk.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/BlockNetherStalk.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockNetherStalk extends BlockFlower
|
||||
@@ -57,25 +58,24 @@
|
||||
return 6;
|
||||
}
|
||||
|
||||
- public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int i1)
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> getBlockDropped(World world, int i, int j, int k, int meta, int fortune)
|
||||
{
|
||||
- if (world.isRemote)
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
int j1 = 1;
|
||||
- if (l >= 3)
|
||||
+ if (meta >= 3)
|
||||
{
|
||||
j1 = 2 + world.rand.nextInt(3);
|
||||
- if (i1 > 0)
|
||||
+ if (fortune > 0)
|
||||
{
|
||||
- j1 += world.rand.nextInt(i1 + 1);
|
||||
+ j1 += world.rand.nextInt(fortune + 1);
|
||||
}
|
||||
}
|
||||
for (int k1 = 0; k1 < j1; k1++)
|
||||
{
|
||||
- dropBlockAsItem_do(world, i, j, k, new ItemStack(Item.netherStalkSeeds));
|
||||
+ ret.add(new ItemStack(Item.netherStalkSeeds));
|
||||
}
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
public int idDropped(int i, Random random, int j)
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/BlockPistonBase.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/BlockPistonBase.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -355,7 +355,7 @@
|
||||
return false;
|
||||
}
|
||||
}
|
||||
- return !(Block.blocksList[i] instanceof BlockContainer);
|
||||
+ return !(Block.blocksList[i] != null && Block.blocksList[i].hasTileEntity(world.getBlockMetadata(j, k, l)));
|
||||
}
|
||||
|
||||
private static boolean canExtend(World world, int i, int j, int k, int l)
|
||||
@@ -1,201 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/BlockRail.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/BlockRail.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -5,16 +5,29 @@
|
||||
public class BlockRail extends Block
|
||||
{
|
||||
private final boolean isPowered;
|
||||
+
|
||||
+ /**
|
||||
+ * Forge: Moved render type to a field and a setter.
|
||||
+ * This allows for a mod to change the render type
|
||||
+ * for vanilla rails, and any mod rails that extend
|
||||
+ * this class.
|
||||
+ */
|
||||
+ private int renderType = 9;
|
||||
+
|
||||
+ public void setRenderType(int value)
|
||||
+ {
|
||||
+ renderType = value;
|
||||
+ }
|
||||
|
||||
public static final boolean isRailBlockAt(World world, int i, int j, int k)
|
||||
{
|
||||
int l = world.getBlockId(i, j, k);
|
||||
- return l == Block.rail.blockID || l == Block.railPowered.blockID || l == Block.railDetector.blockID;
|
||||
+ return Block.blocksList[l] instanceof BlockRail;
|
||||
}
|
||||
|
||||
public static final boolean isRailBlock(int i)
|
||||
{
|
||||
- return i == Block.rail.blockID || i == Block.railPowered.blockID || i == Block.railDetector.blockID;
|
||||
+ return Block.blocksList[i] instanceof BlockRail;
|
||||
}
|
||||
|
||||
protected BlockRail(int i, int j, boolean flag)
|
||||
@@ -81,7 +94,7 @@
|
||||
|
||||
public int getRenderType()
|
||||
{
|
||||
- return 9;
|
||||
+ return renderType;
|
||||
}
|
||||
|
||||
public int quantityDropped(Random random)
|
||||
@@ -91,7 +104,7 @@
|
||||
|
||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
||||
{
|
||||
- return world.isBlockNormalCube(i, j - 1, k);
|
||||
+ return world.isBlockSolidOnSide(i, j - 1, k, 1);
|
||||
}
|
||||
|
||||
public void onBlockAdded(World world, int i, int j, int k)
|
||||
@@ -119,23 +132,23 @@
|
||||
j1 &= 7;
|
||||
}
|
||||
boolean flag = false;
|
||||
- if (!world.isBlockNormalCube(i, j - 1, k))
|
||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (j1 == 2 && !world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if (j1 == 2 && !world.isBlockSolidOnSide(i + 1, j, k, 1))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (j1 == 3 && !world.isBlockNormalCube(i - 1, j, k))
|
||||
+ if (j1 == 3 && !world.isBlockSolidOnSide(i - 1, j, k, 1))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (j1 == 4 && !world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if (j1 == 4 && !world.isBlockSolidOnSide(i, j, k - 1, 1))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (j1 == 5 && !world.isBlockNormalCube(i, j, k + 1))
|
||||
+ if (j1 == 5 && !world.isBlockSolidOnSide(i, j, k + 1, 1))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -317,8 +330,119 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * This function is no longer called by Minecraft
|
||||
+ */
|
||||
+ @Deprecated
|
||||
static boolean isPoweredBlockRail(BlockRail blockrail)
|
||||
{
|
||||
return blockrail.isPowered;
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * Return true if the rail can make corners.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
+ * @param i The rail X coordinate.
|
||||
+ * @param j The rail Y coordinate.
|
||||
+ * @param k The rail Z coordinate.
|
||||
+ * @return True if the rail can make corners.
|
||||
+ */
|
||||
+ public boolean isFlexibleRail(World world, int i, int j, int k)
|
||||
+ {
|
||||
+ return !isPowered;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if the rail can make up and down slopes.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
+ * @param i The rail X coordinate.
|
||||
+ * @param j The rail Y coordinate.
|
||||
+ * @param k The rail Z coordinate.
|
||||
+ * @return True if the rail can make slopes.
|
||||
+ */
|
||||
+ public boolean canMakeSlopes(World world, int i, int j, int k)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return the rails metadata (without the power bit if the rail uses one).
|
||||
+ * Can be used to make the cart think the rail something other than it is,
|
||||
+ * for example when making diamond junctions or switches.
|
||||
+ * The cart parameter will often be null unless it it called from EntityMinecart.
|
||||
+ *
|
||||
+ * Valid rail metadata is defined as follows:
|
||||
+ * 0x0: flat track going North-South
|
||||
+ * 0x1: flat track going West-East
|
||||
+ * 0x2: track ascending to the East
|
||||
+ * 0x3: track ascending to the West
|
||||
+ * 0x4: track ascending to the North
|
||||
+ * 0x5: track ascending to the South
|
||||
+ * 0x6: WestNorth corner (connecting East and South)
|
||||
+ * 0x7: EastNorth corner (connecting West and South)
|
||||
+ * 0x8: EastSouth corner (connecting West and North)
|
||||
+ * 0x9: WestSouth corner (connecting East and North)
|
||||
+ *
|
||||
+ * All directions are Notch defined.
|
||||
+ * In MC Beta 1.8.3 the Sun rises in the North.
|
||||
+ * In MC 1.0.0 the Sun rises in the East.
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart.
|
||||
+ * @param i The rail X coordinate.
|
||||
+ * @param j The rail Y coordinate.
|
||||
+ * @param k The rail Z coordinate.
|
||||
+ * @return The metadata.
|
||||
+ */
|
||||
+ public int getBasicRailMetadata(IBlockAccess world, EntityMinecart cart, int i, int j, int k)
|
||||
+ {
|
||||
+ int meta = world.getBlockMetadata(i, j, k);
|
||||
+ if(isPowered) {
|
||||
+ meta = meta & 7;
|
||||
+ }
|
||||
+ return meta;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the max speed of the rail at [i, j, k].
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart on the rail, may be null.
|
||||
+ * @param i The rail X coordinate.
|
||||
+ * @param j The rail Y coordinate.
|
||||
+ * @param k The rail Z coordinate.
|
||||
+ * @return The max speed of the current rail.
|
||||
+ */
|
||||
+ public float getRailMaxSpeed(World world, EntityMinecart cart, int i, int j, int k)
|
||||
+ {
|
||||
+ return 0.4f;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * This function is called by any minecart that passes over this rail.
|
||||
+ * It is called once per update tick that the minecart is on the rail.
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart on the rail.
|
||||
+ * @param i The rail X coordinate.
|
||||
+ * @param j The rail Y coordinate.
|
||||
+ * @param k The rail Z coordinate.
|
||||
+ */
|
||||
+ public void onMinecartPass(World world, EntityMinecart cart, int i, int j, int k)
|
||||
+ {
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return true if this rail uses the 4th bit as a power bit.
|
||||
+ * Avoid using this function when getBasicRailMetadata() can be used instead.
|
||||
+ * The only reason to use this function is if you wish to change the rails metadata.
|
||||
+ * @param world The world.
|
||||
+ * @param i The rail X coordinate.
|
||||
+ * @param j The rail Y coordinate.
|
||||
+ * @param k The rail Z coordinate.
|
||||
+ * @return True if the 4th bit is a power bit.
|
||||
+ */
|
||||
+ public boolean hasPowerBit(World world, int i, int j, int k)
|
||||
+ {
|
||||
+ return isPowered;
|
||||
+ }
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/BlockRedstoneWire.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/BlockRedstoneWire.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
import java.util.*;
|
||||
|
||||
+import net.minecraft.src.forge.IConnectRedstone;
|
||||
+
|
||||
public class BlockRedstoneWire extends Block
|
||||
{
|
||||
private boolean wiresProvidePower;
|
||||
@@ -47,7 +49,7 @@
|
||||
|
||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
||||
{
|
||||
- return world.isBlockNormalCube(i, j - 1, k);
|
||||
+ return world.isBlockSolidOnSide(i, j - 1, k, 1);
|
||||
}
|
||||
|
||||
private void updateAndPropagateCurrentStrength(World world, int i, int j, int k)
|
||||
@@ -467,6 +469,12 @@
|
||||
int j1 = iblockaccess.getBlockMetadata(i, j, k);
|
||||
return l == (j1 & 3) || l == Direction.footInvisibleFaceRemap[j1 & 3];
|
||||
}
|
||||
+
|
||||
+ if (Block.blocksList[i1] instanceof IConnectRedstone)
|
||||
+ {
|
||||
+ return ((IConnectRedstone)Block.blocksList[i1]).canConnectRedstone(iblockaccess, i, j, k, l);
|
||||
+ }
|
||||
+
|
||||
return Block.blocksList[i1].canProvidePower() && l != -1;
|
||||
}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/BlockTallGrass.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/BlockTallGrass.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -1,7 +1,10 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
+import net.minecraft.src.forge.ForgeHooks;
|
||||
+
|
||||
public class BlockTallGrass extends BlockFlower
|
||||
{
|
||||
protected BlockTallGrass(int i, int j)
|
||||
@@ -65,14 +68,7 @@
|
||||
|
||||
public int idDropped(int i, Random random, int j)
|
||||
{
|
||||
- if (random.nextInt(8) == 0)
|
||||
- {
|
||||
- return Item.seeds.shiftedIndex;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- return -1;
|
||||
- }
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
public int quantityDroppedWithBonus(int i, Random random)
|
||||
@@ -80,6 +76,23 @@
|
||||
return 1 + random.nextInt(i * 2 + 1);
|
||||
}
|
||||
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> getBlockDropped(World world, int i, int j, int k, int md, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+ if (world.rand.nextInt(8) != 0)
|
||||
+ {
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ ItemStack item = ForgeHooks.getGrassSeed(world);
|
||||
+ if (item != null)
|
||||
+ {
|
||||
+ ret.add(item);
|
||||
+ }
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l)
|
||||
{
|
||||
if (!world.isRemote && entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex)
|
||||
@@ -1,107 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/BlockTorch.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/BlockTorch.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
private boolean canPlaceTorchOn(World world, int i, int j, int k)
|
||||
{
|
||||
- if (world.isBlockNormalCubeDefault(i, j, k, true))
|
||||
+ if (world.isBlockSolidOnSide(i, j, k, 1))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -45,19 +45,19 @@
|
||||
|
||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
||||
{
|
||||
- if (world.isBlockNormalCubeDefault(i - 1, j, k, true))
|
||||
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCubeDefault(i + 1, j, k, true))
|
||||
+ if (world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCubeDefault(i, j, k - 1, true))
|
||||
+ if (world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCubeDefault(i, j, k + 1, true))
|
||||
+ if (world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -71,19 +71,19 @@
|
||||
{
|
||||
i1 = 5;
|
||||
}
|
||||
- if (l == 2 && world.isBlockNormalCubeDefault(i, j, k + 1, true))
|
||||
+ if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
i1 = 4;
|
||||
}
|
||||
- if (l == 3 && world.isBlockNormalCubeDefault(i, j, k - 1, true))
|
||||
+ if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
i1 = 3;
|
||||
}
|
||||
- if (l == 4 && world.isBlockNormalCubeDefault(i + 1, j, k, true))
|
||||
+ if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
i1 = 2;
|
||||
}
|
||||
- if (l == 5 && world.isBlockNormalCubeDefault(i - 1, j, k, true))
|
||||
+ if (l == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
i1 = 1;
|
||||
}
|
||||
@@ -101,19 +101,19 @@
|
||||
|
||||
public void onBlockAdded(World world, int i, int j, int k)
|
||||
{
|
||||
- if (world.isBlockNormalCubeDefault(i - 1, j, k, true))
|
||||
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
world.setBlockMetadataWithNotify(i, j, k, 1);
|
||||
}
|
||||
- else if (world.isBlockNormalCubeDefault(i + 1, j, k, true))
|
||||
+ else if (world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
world.setBlockMetadataWithNotify(i, j, k, 2);
|
||||
}
|
||||
- else if (world.isBlockNormalCubeDefault(i, j, k - 1, true))
|
||||
+ else if (world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
world.setBlockMetadataWithNotify(i, j, k, 3);
|
||||
}
|
||||
- else if (world.isBlockNormalCubeDefault(i, j, k + 1, true))
|
||||
+ else if (world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
world.setBlockMetadataWithNotify(i, j, k, 4);
|
||||
}
|
||||
@@ -130,19 +130,19 @@
|
||||
{
|
||||
int i1 = world.getBlockMetadata(i, j, k);
|
||||
boolean flag = false;
|
||||
- if (!world.isBlockNormalCubeDefault(i - 1, j, k, true) && i1 == 1)
|
||||
+ if (!world.isBlockSolidOnSide(i - 1, j, k, 5) && i1 == 1)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCubeDefault(i + 1, j, k, true) && i1 == 2)
|
||||
+ if (!world.isBlockSolidOnSide(i + 1, j, k, 4) && i1 == 2)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCubeDefault(i, j, k - 1, true) && i1 == 3)
|
||||
+ if (!world.isBlockSolidOnSide(i, j, k - 1, 3) && i1 == 3)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCubeDefault(i, j, k + 1, true) && i1 == 4)
|
||||
+ if (!world.isBlockSolidOnSide(i, j, k + 1, 2) && i1 == 4)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -1,233 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/Chunk.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/Chunk.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -338,7 +338,7 @@
|
||||
{
|
||||
Block.blocksList[l1].onBlockRemoval(worldObj, i2, j, j2);
|
||||
}
|
||||
- else if ((Block.blocksList[l1] instanceof BlockContainer) && l1 != l)
|
||||
+ else if (Block.blocksList[l1] != null && Block.blocksList[l1].hasTileEntity(getBlockMetadata(i, j, k)) && l1 != l)
|
||||
{
|
||||
worldObj.removeBlockTileEntity(i2, j, j2);
|
||||
}
|
||||
@@ -368,12 +368,12 @@
|
||||
{
|
||||
Block.blocksList[l].onBlockAdded(worldObj, i2, j, j2);
|
||||
}
|
||||
- if (Block.blocksList[l] instanceof BlockContainer)
|
||||
+ if (Block.blocksList[l] != null && Block.blocksList[l].hasTileEntity(i1))
|
||||
{
|
||||
TileEntity tileentity = getChunkBlockTileEntity(i, j, k);
|
||||
if (tileentity == null)
|
||||
{
|
||||
- tileentity = ((BlockContainer)Block.blocksList[l]).getBlockEntity();
|
||||
+ tileentity = Block.blocksList[l].getTileEntity(i1);
|
||||
worldObj.setBlockTileEntity(i2, j, j2, tileentity);
|
||||
}
|
||||
if (tileentity != null)
|
||||
@@ -382,14 +382,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
- else if (l1 > 0 && (Block.blocksList[l1] instanceof BlockContainer))
|
||||
- {
|
||||
- TileEntity tileentity1 = getChunkBlockTileEntity(i, j, k);
|
||||
- if (tileentity1 != null)
|
||||
- {
|
||||
- tileentity1.updateContainingBlockInfo();
|
||||
- }
|
||||
- }
|
||||
isModified = true;
|
||||
return true;
|
||||
}
|
||||
@@ -413,7 +405,11 @@
|
||||
blocks[i << worldObj.xShift | k << worldObj.heightShift | j] = (byte)(byte0 & 0xff);
|
||||
if (k1 != 0)
|
||||
{
|
||||
- Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2);
|
||||
+ if (!worldObj.isRemote)
|
||||
+ {
|
||||
+ Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2);
|
||||
+ }
|
||||
+ removeChunkBlockTileEntity(i, j, k);
|
||||
}
|
||||
data.setNibble(i, j, k, 0);
|
||||
if (Block.lightOpacity[byte0 & 0xff] != 0)
|
||||
@@ -436,28 +432,22 @@
|
||||
{
|
||||
Block.blocksList[l].onBlockAdded(worldObj, l1, j, i2);
|
||||
}
|
||||
- if (l > 0 && (Block.blocksList[l] instanceof BlockContainer))
|
||||
+ int meta = getBlockMetadata(i, j, k);
|
||||
+ if (l > 0 && Block.blocksList[l] != null && Block.blocksList[l].hasTileEntity(meta))
|
||||
{
|
||||
TileEntity tileentity = getChunkBlockTileEntity(i, j, k);
|
||||
if (tileentity == null)
|
||||
{
|
||||
- tileentity = ((BlockContainer)Block.blocksList[l]).getBlockEntity();
|
||||
+ tileentity = Block.blocksList[l].getTileEntity(meta);
|
||||
worldObj.setBlockTileEntity(l1, j, i2, tileentity);
|
||||
}
|
||||
if (tileentity != null)
|
||||
{
|
||||
tileentity.updateContainingBlockInfo();
|
||||
+ tileentity.blockMetadata = meta;
|
||||
}
|
||||
}
|
||||
}
|
||||
- else if (k1 > 0 && (Block.blocksList[k1] instanceof BlockContainer))
|
||||
- {
|
||||
- TileEntity tileentity1 = getChunkBlockTileEntity(i, j, k);
|
||||
- if (tileentity1 != null)
|
||||
- {
|
||||
- tileentity1.updateContainingBlockInfo();
|
||||
- }
|
||||
- }
|
||||
isModified = true;
|
||||
return true;
|
||||
}
|
||||
@@ -477,7 +467,7 @@
|
||||
}
|
||||
data.setNibble(i, j, k, l);
|
||||
int j1 = getBlockID(i, j, k);
|
||||
- if (j1 > 0 && (Block.blocksList[j1] instanceof BlockContainer))
|
||||
+ if (j1 > 0 && Block.blocksList[j1] != null && Block.blocksList[j1].hasTileEntity(i1))
|
||||
{
|
||||
TileEntity tileentity = getChunkBlockTileEntity(i, j, k);
|
||||
if (tileentity != null)
|
||||
@@ -594,29 +584,27 @@
|
||||
{
|
||||
ChunkPosition chunkposition = new ChunkPosition(i, j, k);
|
||||
TileEntity tileentity = (TileEntity)chunkTileEntityMap.get(chunkposition);
|
||||
+ if (tileentity != null && tileentity.isInvalid())
|
||||
+ {
|
||||
+ chunkTileEntityMap.remove(chunkposition);
|
||||
+ tileentity = null;
|
||||
+ }
|
||||
if (tileentity == null)
|
||||
{
|
||||
int l = getBlockID(i, j, k);
|
||||
- if (!Block.isBlockContainer[l])
|
||||
+ int meta = getBlockMetadata(i, j, k);
|
||||
+ if (Block.blocksList[l] == null || !Block.blocksList[l].hasTileEntity(meta))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (tileentity == null)
|
||||
{
|
||||
- tileentity = ((BlockContainer)Block.blocksList[l]).getBlockEntity();
|
||||
+ tileentity = Block.blocksList[l].getTileEntity(meta);
|
||||
worldObj.setBlockTileEntity(xPosition * 16 + i, j, zPosition * 16 + k, tileentity);
|
||||
}
|
||||
tileentity = (TileEntity)chunkTileEntityMap.get(chunkposition);
|
||||
}
|
||||
- if (tileentity != null && tileentity.isInvalid())
|
||||
- {
|
||||
- chunkTileEntityMap.remove(chunkposition);
|
||||
- return null;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- return tileentity;
|
||||
- }
|
||||
+ return tileentity;
|
||||
}
|
||||
|
||||
public void addTileEntity(TileEntity tileentity)
|
||||
@@ -627,7 +615,7 @@
|
||||
setChunkBlockTileEntity(i, j, k, tileentity);
|
||||
if (isChunkLoaded)
|
||||
{
|
||||
- worldObj.loadedTileEntityList.add(tileentity);
|
||||
+ worldObj.addTileEntity(tileentity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -638,12 +626,18 @@
|
||||
tileentity.xCoord = xPosition * 16 + i;
|
||||
tileentity.yCoord = j;
|
||||
tileentity.zCoord = zPosition * 16 + k;
|
||||
- if (getBlockID(i, j, k) == 0 || !(Block.blocksList[getBlockID(i, j, k)] instanceof BlockContainer))
|
||||
+ int id = getBlockID(i, j, k);
|
||||
+ if (id == 0 || Block.blocksList[id] == null || !Block.blocksList[id].hasTileEntity(getBlockMetadata(i, j, k)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
+ TileEntity old = (TileEntity)chunkTileEntityMap.get(chunkposition);
|
||||
+ if (old != null)
|
||||
+ {
|
||||
+ old.invalidate();
|
||||
+ }
|
||||
tileentity.validate();
|
||||
chunkTileEntityMap.put(chunkposition, tileentity);
|
||||
return;
|
||||
@@ -790,6 +784,16 @@
|
||||
public int setChunkData(byte abyte0[], int i, int j, int k, int l, int i1, int j1,
|
||||
int k1)
|
||||
{
|
||||
+ TileEntity te;
|
||||
+ Iterator iterator = chunkTileEntityMap.values().iterator();
|
||||
+ while (iterator.hasNext())
|
||||
+ {
|
||||
+ te = (TileEntity)iterator.next();
|
||||
+ te.updateContainingBlockInfo();
|
||||
+ te.getBlockMetadata();
|
||||
+ te.getBlockType();
|
||||
+ }
|
||||
+
|
||||
for (int l1 = i; l1 < l; l1++)
|
||||
{
|
||||
for (int l2 = k; l2 < j1; l2++)
|
||||
@@ -835,10 +839,29 @@
|
||||
}
|
||||
}
|
||||
|
||||
- TileEntity tileentity;
|
||||
- for (Iterator iterator = chunkTileEntityMap.values().iterator(); iterator.hasNext(); tileentity.updateContainingBlockInfo())
|
||||
+ List<TileEntity> invalidList=new ArrayList();
|
||||
+ iterator = chunkTileEntityMap.values().iterator();
|
||||
+ while(iterator.hasNext())
|
||||
{
|
||||
- tileentity = (TileEntity)iterator.next();
|
||||
+ te = (TileEntity)iterator.next();
|
||||
+ if ((te.xCoord & 15) >= i && (te.xCoord & 15) <= l &&
|
||||
+ (te.yCoord >= j) && (te.yCoord <= i1) &&
|
||||
+ (te.zCoord & 15) >= k && (te.zCoord & 15) <=j1)
|
||||
+ {
|
||||
+
|
||||
+ Block bl = te.getBlockType();
|
||||
+ if (bl != null &&
|
||||
+ bl.blockID == worldObj.getBlockId(te.xCoord, te.yCoord, te.zCoord) &&
|
||||
+ te.getBlockMetadata() == worldObj.getBlockMetadata(te.xCoord, te.yCoord, te.zCoord))
|
||||
+ continue;
|
||||
+
|
||||
+ invalidList.add(te);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ for(TileEntity te2 : invalidList)
|
||||
+ {
|
||||
+ te2.invalidate();
|
||||
}
|
||||
|
||||
return k1;
|
||||
@@ -917,4 +940,18 @@
|
||||
{
|
||||
return new ChunkCoordIntPair(xPosition, zPosition);
|
||||
}
|
||||
+
|
||||
+ /* FORGE: Used to remove only invalid TileEntities */
|
||||
+ public void cleanChunkBlockTileEntity(int i, int j, int k)
|
||||
+ {
|
||||
+ ChunkPosition chunkposition = new ChunkPosition(i, j, k);
|
||||
+ if (isChunkLoaded)
|
||||
+ {
|
||||
+ TileEntity tileentity = (TileEntity)chunkTileEntityMap.get(chunkposition);
|
||||
+ if (tileentity != null && tileentity.isInvalid())
|
||||
+ {
|
||||
+ chunkTileEntityMap.remove(chunkposition);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/ContainerCreative.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/ContainerCreative.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -65,17 +65,20 @@
|
||||
itemList.add(new ItemStack(ablock[l1], 1, k2));
|
||||
}
|
||||
|
||||
- for (int i2 = 256; i2 < Item.itemsList.length; i2++)
|
||||
+ for(int x = 0; x < Block.blocksList.length; x++)
|
||||
{
|
||||
- if (Item.itemsList[i2] != null && Item.itemsList[i2].shiftedIndex != Item.potion.shiftedIndex && Item.itemsList[i2].shiftedIndex != Item.monsterPlacer.shiftedIndex)
|
||||
+ if (Block.blocksList[x] != null)
|
||||
{
|
||||
- itemList.add(new ItemStack(Item.itemsList[i2]));
|
||||
+ Block.blocksList[x].addCreativeItems((ArrayList)itemList);
|
||||
}
|
||||
}
|
||||
|
||||
- for (int j2 = 1; j2 < 16; j2++)
|
||||
+ for (int i2 = Block.blocksList.length; i2 < Item.itemsList.length; i2++)
|
||||
{
|
||||
- itemList.add(new ItemStack(Item.dyePowder.shiftedIndex, 1, j2));
|
||||
+ if (Item.itemsList[i2] != null)
|
||||
+ {
|
||||
+ Item.itemsList[i2].addCreativeItems((ArrayList)itemList);
|
||||
+ }
|
||||
}
|
||||
|
||||
Integer integer;
|
||||
@@ -1,19 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/Enchantment.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/Enchantment.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -102,6 +102,16 @@
|
||||
return (new StringBuilder()).append(s).append(" ").append(StatCollector.translateToLocal((new StringBuilder()).append("enchantment.level.").append(i).toString())).toString();
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Called to determine if this enchantment can be applied to a ItemStack
|
||||
+ * @param item The ItemStack that the enchantment might be put on
|
||||
+ * @return True if the item is valid, false otherwise
|
||||
+ */
|
||||
+ public boolean canEnchantItem(ItemStack item)
|
||||
+ {
|
||||
+ return type.canEnchantItem(item.getItem());
|
||||
+ }
|
||||
+
|
||||
static
|
||||
{
|
||||
looting = new EnchantmentLootBonus(21, 2, EnumEnchantmentType.weapon);
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/EnchantmentHelper.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/EnchantmentHelper.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -261,7 +261,7 @@
|
||||
for (int k = 0; k < j; k++)
|
||||
{
|
||||
Enchantment enchantment = aenchantment[k];
|
||||
- if (enchantment == null || !enchantment.type.canEnchantItem(item))
|
||||
+ if (enchantment == null || !enchantment.canEnchantItem(itemstack))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/Entity.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/Entity.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -70,6 +70,9 @@
|
||||
public int serverPosZ;
|
||||
public boolean ignoreFrustumCheck;
|
||||
public boolean isAirBorne;
|
||||
+
|
||||
+ //Forge: Used to store custom data for each entity.
|
||||
+ private NBTTagCompound customEntityData;
|
||||
|
||||
public Entity(World world)
|
||||
{
|
||||
@@ -110,6 +113,20 @@
|
||||
}
|
||||
|
||||
protected abstract void entityInit();
|
||||
+
|
||||
+ /**
|
||||
+ * Returns a NBTTagCompound that can be used to store custom data for this entity.
|
||||
+ * It will be written, and read from disc, so it persists over world saves.
|
||||
+ * @return A NBTTagCompound
|
||||
+ */
|
||||
+ public NBTTagCompound getEntityData()
|
||||
+ {
|
||||
+ if (customEntityData == null)
|
||||
+ {
|
||||
+ customEntityData = new NBTTagCompound();
|
||||
+ }
|
||||
+ return customEntityData;
|
||||
+ }
|
||||
|
||||
public DataWatcher getDataWatcher()
|
||||
{
|
||||
@@ -967,6 +984,10 @@
|
||||
nbttagcompound.setShort("Fire", (short)fire);
|
||||
nbttagcompound.setShort("Air", (short)getAir());
|
||||
nbttagcompound.setBoolean("OnGround", onGround);
|
||||
+ if (customEntityData != null)
|
||||
+ {
|
||||
+ nbttagcompound.setCompoundTag("ForgeData", customEntityData);
|
||||
+ }
|
||||
writeEntityToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@@ -1001,6 +1022,10 @@
|
||||
onGround = nbttagcompound.getBoolean("OnGround");
|
||||
setPosition(posX, posY, posZ);
|
||||
setRotation(rotationYaw, rotationPitch);
|
||||
+ if (nbttagcompound.hasKey("ForgeData"))
|
||||
+ {
|
||||
+ customEntityData = nbttagcompound.getCompoundTag("ForgeData");
|
||||
+ }
|
||||
readEntityFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@@ -1,940 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/EntityMinecart.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/EntityMinecart.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -1,18 +1,23 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
+import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
+import net.minecraft.src.forge.ForgeHooks;
|
||||
+import net.minecraft.src.forge.IMinecartCollisionHandler;
|
||||
+import net.minecraft.src.forge.MinecraftForge;
|
||||
+
|
||||
public class EntityMinecart extends Entity
|
||||
implements IInventory
|
||||
{
|
||||
- private ItemStack cargoItems[];
|
||||
- private int fuel;
|
||||
- private boolean field_856_i;
|
||||
+ protected ItemStack cargoItems[];
|
||||
+ protected int fuel;
|
||||
+ protected boolean field_856_i;
|
||||
public int minecartType;
|
||||
public double pushX;
|
||||
public double pushZ;
|
||||
- private static final int field_855_j[][][] =
|
||||
+ protected static final int field_855_j[][][] =
|
||||
{
|
||||
{
|
||||
{
|
||||
@@ -76,16 +81,36 @@
|
||||
}
|
||||
}
|
||||
};
|
||||
- private int minecartPosRotationIncrements;
|
||||
- private double minecartX;
|
||||
- private double minecartY;
|
||||
- private double minecartZ;
|
||||
- private double minecartYaw;
|
||||
- private double minecartPitch;
|
||||
- private double velocityX;
|
||||
- private double velocityY;
|
||||
- private double velocityZ;
|
||||
-
|
||||
+ protected int minecartPosRotationIncrements;
|
||||
+ protected double minecartX;
|
||||
+ protected double minecartY;
|
||||
+ protected double minecartZ;
|
||||
+ protected double minecartYaw;
|
||||
+ protected double minecartPitch;
|
||||
+ protected double velocityX;
|
||||
+ protected double velocityY;
|
||||
+ protected double velocityZ;
|
||||
+
|
||||
+ /*Forge: Minecart Compatibility Layer Integration.
|
||||
+ */
|
||||
+ public static float defaultMaxSpeedRail = 0.4f;
|
||||
+ public static float defaultMaxSpeedGround = 0.4f;
|
||||
+ public static float defaultMaxSpeedAirLateral = 0.4f;
|
||||
+ public static float defaultMaxSpeedAirVertical = -1f;
|
||||
+ public static double defaultDragAir = 0.94999998807907104D;
|
||||
+ protected boolean canUseRail = true;
|
||||
+ protected boolean canBePushed = true;
|
||||
+ private static IMinecartCollisionHandler collisionHandler = null;
|
||||
+
|
||||
+ /*
|
||||
+ * Instance versions of the above physics properties
|
||||
+ */
|
||||
+ protected float maxSpeedRail;
|
||||
+ protected float maxSpeedGround;
|
||||
+ protected float maxSpeedAirLateral;
|
||||
+ protected float maxSpeedAirVertical;
|
||||
+ protected double dragAir;
|
||||
+
|
||||
public EntityMinecart(World world)
|
||||
{
|
||||
super(world);
|
||||
@@ -95,6 +120,18 @@
|
||||
preventEntitySpawning = true;
|
||||
setSize(0.98F, 0.7F);
|
||||
yOffset = height / 2.0F;
|
||||
+
|
||||
+ maxSpeedRail = defaultMaxSpeedRail;
|
||||
+ maxSpeedGround = defaultMaxSpeedGround;
|
||||
+ maxSpeedAirLateral = defaultMaxSpeedAirLateral;
|
||||
+ maxSpeedAirVertical = defaultMaxSpeedAirVertical;
|
||||
+ dragAir = defaultDragAir;
|
||||
+ }
|
||||
+
|
||||
+ public EntityMinecart(World world, int type)
|
||||
+ {
|
||||
+ this(world);
|
||||
+ minecartType = type;
|
||||
}
|
||||
|
||||
protected boolean canTriggerWalking()
|
||||
@@ -112,17 +149,27 @@
|
||||
|
||||
public AxisAlignedBB getCollisionBox(Entity entity)
|
||||
{
|
||||
+ if (getCollisionHandler() != null)
|
||||
+ {
|
||||
+ return getCollisionHandler().getCollisionBox(this, entity);
|
||||
+ }
|
||||
+
|
||||
return entity.boundingBox;
|
||||
}
|
||||
|
||||
public AxisAlignedBB getBoundingBox()
|
||||
{
|
||||
+ if (getCollisionHandler() != null)
|
||||
+ {
|
||||
+ return getCollisionHandler().getBoundingBox(this);
|
||||
+ }
|
||||
+
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean canBePushed()
|
||||
{
|
||||
- return true;
|
||||
+ return canBePushed;
|
||||
}
|
||||
|
||||
public EntityMinecart(World world, double d, double d1, double d2,
|
||||
@@ -161,49 +208,8 @@
|
||||
riddenByEntity.mountEntity(this);
|
||||
}
|
||||
setEntityDead();
|
||||
- dropItemWithOffset(Item.minecartEmpty.shiftedIndex, 1, 0.0F);
|
||||
- if (minecartType == 1)
|
||||
- {
|
||||
- EntityMinecart entityminecart = this;
|
||||
- label0:
|
||||
- for (int j = 0; j < entityminecart.getSizeInventory(); j++)
|
||||
- {
|
||||
- ItemStack itemstack = entityminecart.getStackInSlot(j);
|
||||
- if (itemstack == null)
|
||||
- {
|
||||
- continue;
|
||||
- }
|
||||
- float f = rand.nextFloat() * 0.8F + 0.1F;
|
||||
- float f1 = rand.nextFloat() * 0.8F + 0.1F;
|
||||
- float f2 = rand.nextFloat() * 0.8F + 0.1F;
|
||||
- do
|
||||
- {
|
||||
- if (itemstack.stackSize <= 0)
|
||||
- {
|
||||
- continue label0;
|
||||
- }
|
||||
- int k = rand.nextInt(21) + 10;
|
||||
- if (k > itemstack.stackSize)
|
||||
- {
|
||||
- k = itemstack.stackSize;
|
||||
- }
|
||||
- itemstack.stackSize -= k;
|
||||
- EntityItem entityitem = new EntityItem(worldObj, posX + (double)f, posY + (double)f1, posZ + (double)f2, new ItemStack(itemstack.itemID, k, itemstack.getItemDamage()));
|
||||
- float f3 = 0.05F;
|
||||
- entityitem.motionX = (float)rand.nextGaussian() * f3;
|
||||
- entityitem.motionY = (float)rand.nextGaussian() * f3 + 0.2F;
|
||||
- entityitem.motionZ = (float)rand.nextGaussian() * f3;
|
||||
- worldObj.spawnEntityInWorld(entityitem);
|
||||
- }
|
||||
- while (true);
|
||||
- }
|
||||
-
|
||||
- dropItemWithOffset(Block.chest.blockID, 1, 0.0F);
|
||||
- }
|
||||
- else if (minecartType == 2)
|
||||
- {
|
||||
- dropItemWithOffset(Block.stoneOvenIdle.blockID, 1, 0.0F);
|
||||
- }
|
||||
+
|
||||
+ dropCartAsItem();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -268,7 +274,7 @@
|
||||
{
|
||||
func_41024_b(func_41025_i() - 1);
|
||||
}
|
||||
- if (isMinecartPowered() && rand.nextInt(4) == 0)
|
||||
+ if (isMinecartPowered() && rand.nextInt(4) == 0 && minecartType == 2 && getClass() == EntityMinecart.class)
|
||||
{
|
||||
worldObj.spawnParticle("largesmoke", posX, posY + 0.80000000000000004D, posZ, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
@@ -309,22 +315,18 @@
|
||||
double d2 = 0.40000000000000002D;
|
||||
double d4 = 0.0078125D;
|
||||
int l = worldObj.getBlockId(i, j, k);
|
||||
- if (BlockRail.isRailBlock(l))
|
||||
+ if (canUseRail() && BlockRail.isRailBlock(l))
|
||||
{
|
||||
Vec3D vec3d = func_514_g(posX, posY, posZ);
|
||||
- int i1 = worldObj.getBlockMetadata(i, j, k);
|
||||
+ int i1 = ((BlockRail)Block.blocksList[l]).getBasicRailMetadata(worldObj, this, i, j, k);
|
||||
posY = j;
|
||||
boolean flag = false;
|
||||
boolean flag1 = false;
|
||||
if (l == Block.railPowered.blockID)
|
||||
{
|
||||
- flag = (i1 & 8) != 0;
|
||||
+ flag = (worldObj.getBlockMetadata(i, j, k) & 8) != 0;
|
||||
flag1 = !flag;
|
||||
}
|
||||
- if (((BlockRail)Block.blocksList[l]).getIsPowered())
|
||||
- {
|
||||
- i1 &= 7;
|
||||
- }
|
||||
if (i1 >= 2 && i1 <= 5)
|
||||
{
|
||||
posY = j + 1;
|
||||
@@ -358,7 +360,7 @@
|
||||
double d13 = Math.sqrt(motionX * motionX + motionZ * motionZ);
|
||||
motionX = (d13 * d9) / d11;
|
||||
motionZ = (d13 * d10) / d11;
|
||||
- if (flag1)
|
||||
+ if (flag1 && shouldDoRailFunctions())
|
||||
{
|
||||
double d16 = Math.sqrt(motionX * motionX + motionZ * motionZ);
|
||||
if (d16 < 0.029999999999999999D)
|
||||
@@ -401,30 +403,9 @@
|
||||
posX = d18 + d9 * d17;
|
||||
posZ = d19 + d10 * d17;
|
||||
setPosition(posX, posY + (double)yOffset, posZ);
|
||||
- double d23 = motionX;
|
||||
- double d25 = motionZ;
|
||||
- if (riddenByEntity != null)
|
||||
- {
|
||||
- d23 *= 0.75D;
|
||||
- d25 *= 0.75D;
|
||||
- }
|
||||
- if (d23 < -d2)
|
||||
- {
|
||||
- d23 = -d2;
|
||||
- }
|
||||
- if (d23 > d2)
|
||||
- {
|
||||
- d23 = d2;
|
||||
- }
|
||||
- if (d25 < -d2)
|
||||
- {
|
||||
- d25 = -d2;
|
||||
- }
|
||||
- if (d25 > d2)
|
||||
- {
|
||||
- d25 = d2;
|
||||
- }
|
||||
- moveEntity(d23, 0.0D, d25);
|
||||
+
|
||||
+ moveMinecartOnRail(i, j, k);
|
||||
+
|
||||
if (ai[0][1] != 0 && MathHelper.floor_double(posX) - i == ai[0][0] && MathHelper.floor_double(posZ) - k == ai[0][2])
|
||||
{
|
||||
setPosition(posX, posY + (double)ai[0][1], posZ);
|
||||
@@ -433,39 +414,9 @@
|
||||
{
|
||||
setPosition(posX, posY + (double)ai[1][1], posZ);
|
||||
}
|
||||
- if (riddenByEntity != null)
|
||||
- {
|
||||
- motionX *= 0.99699997901916504D;
|
||||
- motionY *= 0.0D;
|
||||
- motionZ *= 0.99699997901916504D;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- if (minecartType == 2)
|
||||
- {
|
||||
- double d27 = MathHelper.sqrt_double(pushX * pushX + pushZ * pushZ);
|
||||
- if (d27 > 0.01D)
|
||||
- {
|
||||
- pushX /= d27;
|
||||
- pushZ /= d27;
|
||||
- double d29 = 0.040000000000000001D;
|
||||
- motionX *= 0.80000001192092896D;
|
||||
- motionY *= 0.0D;
|
||||
- motionZ *= 0.80000001192092896D;
|
||||
- motionX += pushX * d29;
|
||||
- motionZ += pushZ * d29;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- motionX *= 0.89999997615814209D;
|
||||
- motionY *= 0.0D;
|
||||
- motionZ *= 0.89999997615814209D;
|
||||
- }
|
||||
- }
|
||||
- motionX *= 0.95999997854232788D;
|
||||
- motionY *= 0.0D;
|
||||
- motionZ *= 0.95999997854232788D;
|
||||
- }
|
||||
+
|
||||
+ applyDragAndPushForces();
|
||||
+
|
||||
Vec3D vec3d1 = func_514_g(posX, posY, posZ);
|
||||
if (vec3d1 != null && vec3d != null)
|
||||
{
|
||||
@@ -486,26 +437,14 @@
|
||||
motionX = d15 * (double)(k1 - i);
|
||||
motionZ = d15 * (double)(l1 - k);
|
||||
}
|
||||
- if (minecartType == 2)
|
||||
+
|
||||
+ updatePushForces();
|
||||
+
|
||||
+ if (shouldDoRailFunctions())
|
||||
{
|
||||
- double d30 = MathHelper.sqrt_double(pushX * pushX + pushZ * pushZ);
|
||||
- if (d30 > 0.01D && motionX * motionX + motionZ * motionZ > 0.001D)
|
||||
- {
|
||||
- pushX /= d30;
|
||||
- pushZ /= d30;
|
||||
- if (pushX * motionX + pushZ * motionZ < 0.0D)
|
||||
- {
|
||||
- pushX = 0.0D;
|
||||
- pushZ = 0.0D;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- pushX = motionX;
|
||||
- pushZ = motionZ;
|
||||
- }
|
||||
- }
|
||||
+ ((BlockRail)Block.blocksList[l]).onMinecartPass(worldObj, this, i, j, k);
|
||||
}
|
||||
- if (flag)
|
||||
+ if (flag && shouldDoRailFunctions())
|
||||
{
|
||||
double d31 = Math.sqrt(motionX * motionX + motionZ * motionZ);
|
||||
if (d31 > 0.01D)
|
||||
@@ -540,35 +479,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- if (motionX < -d2)
|
||||
- {
|
||||
- motionX = -d2;
|
||||
- }
|
||||
- if (motionX > d2)
|
||||
- {
|
||||
- motionX = d2;
|
||||
- }
|
||||
- if (motionZ < -d2)
|
||||
- {
|
||||
- motionZ = -d2;
|
||||
- }
|
||||
- if (motionZ > d2)
|
||||
- {
|
||||
- motionZ = d2;
|
||||
- }
|
||||
- if (onGround)
|
||||
- {
|
||||
- motionX *= 0.5D;
|
||||
- motionY *= 0.5D;
|
||||
- motionZ *= 0.5D;
|
||||
- }
|
||||
- moveEntity(motionX, motionY, motionZ);
|
||||
- if (!onGround)
|
||||
- {
|
||||
- motionX *= 0.94999998807907104D;
|
||||
- motionY *= 0.94999998807907104D;
|
||||
- motionZ *= 0.94999998807907104D;
|
||||
- }
|
||||
+ moveMinecartOffRail(i, j, k);
|
||||
}
|
||||
rotationPitch = 0.0F;
|
||||
double d6 = prevPosX - posX;
|
||||
@@ -590,7 +501,20 @@
|
||||
field_856_i = !field_856_i;
|
||||
}
|
||||
setRotation(rotationYaw, rotationPitch);
|
||||
- List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
||||
+
|
||||
+ AxisAlignedBB box = null;
|
||||
+
|
||||
+ if (getCollisionHandler() != null)
|
||||
+ {
|
||||
+ box = getCollisionHandler().getMinecartCollisionBox(this);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+
|
||||
+ box = boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D);
|
||||
+ }
|
||||
+
|
||||
+ List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, box);
|
||||
if (list != null && list.size() > 0)
|
||||
{
|
||||
for (int j1 = 0; j1 < list.size(); j1++)
|
||||
@@ -610,15 +534,8 @@
|
||||
}
|
||||
riddenByEntity = null;
|
||||
}
|
||||
- if (fuel > 0)
|
||||
- {
|
||||
- fuel--;
|
||||
- }
|
||||
- if (fuel <= 0)
|
||||
- {
|
||||
- pushX = pushZ = 0.0D;
|
||||
- }
|
||||
- setMinecartPowered(fuel > 0);
|
||||
+ updateFuel();
|
||||
+ ForgeHooks.onMinecartUpdate(this, i, j, k);
|
||||
}
|
||||
|
||||
public Vec3D func_515_a(double d, double d1, double d2, double d3)
|
||||
@@ -633,11 +550,7 @@
|
||||
int l = worldObj.getBlockId(i, j, k);
|
||||
if (BlockRail.isRailBlock(l))
|
||||
{
|
||||
- int i1 = worldObj.getBlockMetadata(i, j, k);
|
||||
- if (((BlockRail)Block.blocksList[l]).getIsPowered())
|
||||
- {
|
||||
- i1 &= 7;
|
||||
- }
|
||||
+ int i1 = ((BlockRail)Block.blocksList[l]).getBasicRailMetadata(worldObj, this, i, j, k);
|
||||
d1 = j;
|
||||
if (i1 >= 2 && i1 <= 5)
|
||||
{
|
||||
@@ -679,12 +592,8 @@
|
||||
int l = worldObj.getBlockId(i, j, k);
|
||||
if (BlockRail.isRailBlock(l))
|
||||
{
|
||||
- int i1 = worldObj.getBlockMetadata(i, j, k);
|
||||
+ int i1 = ((BlockRail)Block.blocksList[l]).getBasicRailMetadata(worldObj, this, i, j, k);
|
||||
d1 = j;
|
||||
- if (((BlockRail)Block.blocksList[l]).getIsPowered())
|
||||
- {
|
||||
- i1 &= 7;
|
||||
- }
|
||||
if (i1 >= 2 && i1 <= 5)
|
||||
{
|
||||
d1 = j + 1;
|
||||
@@ -739,13 +648,13 @@
|
||||
protected void writeEntityToNBT(NBTTagCompound nbttagcompound)
|
||||
{
|
||||
nbttagcompound.setInteger("Type", minecartType);
|
||||
- if (minecartType == 2)
|
||||
+ if (isPoweredCart())
|
||||
{
|
||||
nbttagcompound.setDouble("PushX", pushX);
|
||||
nbttagcompound.setDouble("PushZ", pushZ);
|
||||
- nbttagcompound.setShort("Fuel", (short)fuel);
|
||||
+ nbttagcompound.setInteger("Fuel", fuel);
|
||||
}
|
||||
- else if (minecartType == 1)
|
||||
+ if (getSizeInventory() > 0)
|
||||
{
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
for (int i = 0; i < cargoItems.length; i++)
|
||||
@@ -766,13 +675,13 @@
|
||||
protected void readEntityFromNBT(NBTTagCompound nbttagcompound)
|
||||
{
|
||||
minecartType = nbttagcompound.getInteger("Type");
|
||||
- if (minecartType == 2)
|
||||
+ if (isPoweredCart())
|
||||
{
|
||||
pushX = nbttagcompound.getDouble("PushX");
|
||||
pushZ = nbttagcompound.getDouble("PushZ");
|
||||
- fuel = nbttagcompound.getShort("Fuel");
|
||||
+ fuel = nbttagcompound.getInteger("Fuel");
|
||||
}
|
||||
- else if (minecartType == 1)
|
||||
+ if (getSizeInventory() > 0)
|
||||
{
|
||||
NBTTagList nbttaglist = nbttagcompound.getTagList("Items");
|
||||
cargoItems = new ItemStack[getSizeInventory()];
|
||||
@@ -795,6 +704,12 @@
|
||||
|
||||
public void applyEntityCollision(Entity entity)
|
||||
{
|
||||
+ ForgeHooks.onMinecartEntityCollision(this, entity);
|
||||
+ if (getCollisionHandler() != null)
|
||||
+ {
|
||||
+ getCollisionHandler().onEntityCollision(this, entity);
|
||||
+ return;
|
||||
+ }
|
||||
if (worldObj.isRemote)
|
||||
{
|
||||
return;
|
||||
@@ -803,7 +718,7 @@
|
||||
{
|
||||
return;
|
||||
}
|
||||
- if ((entity instanceof EntityLiving) && !(entity instanceof EntityPlayer) && minecartType == 0 && motionX * motionX + motionZ * motionZ > 0.01D && riddenByEntity == null && entity.ridingEntity == null)
|
||||
+ if ((entity instanceof EntityLiving) && !(entity instanceof EntityPlayer) && canBeRidden() && motionX * motionX + motionZ * motionZ > 0.01D && riddenByEntity == null && entity.ridingEntity == null)
|
||||
{
|
||||
entity.mountEntity(this);
|
||||
}
|
||||
@@ -841,7 +756,7 @@
|
||||
}
|
||||
double d7 = entity.motionX + motionX;
|
||||
double d8 = entity.motionZ + motionZ;
|
||||
- if (((EntityMinecart)entity).minecartType == 2 && minecartType != 2)
|
||||
+ if (((EntityMinecart)entity).isPoweredCart() && !isPoweredCart())
|
||||
{
|
||||
motionX *= 0.20000000298023224D;
|
||||
motionZ *= 0.20000000298023224D;
|
||||
@@ -849,7 +764,7 @@
|
||||
entity.motionX *= 0.94999998807907104D;
|
||||
entity.motionZ *= 0.94999998807907104D;
|
||||
}
|
||||
- else if (((EntityMinecart)entity).minecartType != 2 && minecartType == 2)
|
||||
+ else if (!((EntityMinecart)entity).isPoweredCart() && isPoweredCart())
|
||||
{
|
||||
entity.motionX *= 0.20000000298023224D;
|
||||
entity.motionZ *= 0.20000000298023224D;
|
||||
@@ -879,7 +794,7 @@
|
||||
|
||||
public int getSizeInventory()
|
||||
{
|
||||
- return 27;
|
||||
+ return (minecartType == 1 && getClass() == EntityMinecart.class ? 27 : 0);
|
||||
}
|
||||
|
||||
public ItemStack getStackInSlot(int i)
|
||||
@@ -935,7 +850,11 @@
|
||||
|
||||
public boolean interact(EntityPlayer entityplayer)
|
||||
{
|
||||
- if (minecartType == 0)
|
||||
+ if (!ForgeHooks.onMinecartInteract(this, entityplayer))
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+ if (canBeRidden())
|
||||
{
|
||||
if (riddenByEntity != null && (riddenByEntity instanceof EntityPlayer) && riddenByEntity != entityplayer)
|
||||
{
|
||||
@@ -946,14 +865,14 @@
|
||||
entityplayer.mountEntity(this);
|
||||
}
|
||||
}
|
||||
- else if (minecartType == 1)
|
||||
+ else if (getSizeInventory() > 0)
|
||||
{
|
||||
if (!worldObj.isRemote)
|
||||
{
|
||||
entityplayer.displayGUIChest(this);
|
||||
}
|
||||
}
|
||||
- else if (minecartType == 2)
|
||||
+ else if (minecartType == 2 && getClass() == EntityMinecart.class)
|
||||
{
|
||||
ItemStack itemstack = entityplayer.inventory.getCurrentItem();
|
||||
if (itemstack != null && itemstack.itemID == Item.coal.shiftedIndex)
|
||||
@@ -1000,7 +919,7 @@
|
||||
return entityplayer.getDistanceSqToEntity(this) <= 64D;
|
||||
}
|
||||
|
||||
- protected boolean isMinecartPowered()
|
||||
+ public boolean isMinecartPowered()
|
||||
{
|
||||
return (dataWatcher.getWatchableObjectByte(16) & 1) != 0;
|
||||
}
|
||||
@@ -1054,4 +973,382 @@
|
||||
{
|
||||
return dataWatcher.getWatchableObjectInt(18);
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * Drops the cart as a item. The exact item dropped is defined by getItemDropped().
|
||||
+ */
|
||||
+ public void dropCartAsItem()
|
||||
+ {
|
||||
+ for(ItemStack item : getItemsDropped())
|
||||
+ {
|
||||
+ entityDropItem(item, 0);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Override this to define which items your cart drops when broken.
|
||||
+ * This does not include items contained in the inventory,
|
||||
+ * that is handled elsewhere.
|
||||
+ * @return A list of items dropped.
|
||||
+ */
|
||||
+ public List<ItemStack> getItemsDropped()
|
||||
+ {
|
||||
+ List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
+ items.add(new ItemStack(Item.minecartEmpty));
|
||||
+
|
||||
+ switch(minecartType)
|
||||
+ {
|
||||
+ case 1:
|
||||
+ items.add(new ItemStack(Block.chest));
|
||||
+ break;
|
||||
+ case 2:
|
||||
+ items.add(new ItemStack(Block.stoneOvenIdle));
|
||||
+ break;
|
||||
+ }
|
||||
+ return items;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * This function returns an ItemStack that represents this cart.
|
||||
+ * This should be an ItemStack that can be used by the player to place the cart.
|
||||
+ * This is the item that was registered with the cart via the registerMinecart function,
|
||||
+ * but is not necessary the item the cart drops when destroyed.
|
||||
+ * @return An ItemStack that can be used to place the cart.
|
||||
+ */
|
||||
+ public ItemStack getCartItem()
|
||||
+ {
|
||||
+ return MinecraftForge.getItemForCart(this);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if this cart is self propelled.
|
||||
+ * @return True if powered.
|
||||
+ */
|
||||
+ public boolean isPoweredCart()
|
||||
+ {
|
||||
+ return minecartType == 2 && getClass() == EntityMinecart.class;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if this cart is a storage cart
|
||||
+ * Some carts may have inventories but not be storage carts
|
||||
+ * and some carts without inventories may be storage carts.
|
||||
+ * @return True if this cart should be classified as a storage cart.
|
||||
+ */
|
||||
+ public boolean isStorageCart()
|
||||
+ {
|
||||
+ return minecartType == 1 && getClass() == EntityMinecart.class;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if this cart can be ridden by an Entity.
|
||||
+ * @return True if this cart can be ridden.
|
||||
+ */
|
||||
+ public boolean canBeRidden()
|
||||
+ {
|
||||
+ if(minecartType == 0 && getClass() == EntityMinecart.class)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if this cart can currently use rails.
|
||||
+ * This function is mainly used to gracefully detach a minecart from a rail.
|
||||
+ * @return True if the minecart can use rails.
|
||||
+ */
|
||||
+ public boolean canUseRail()
|
||||
+ {
|
||||
+ return canUseRail;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Set whether the minecart can use rails.
|
||||
+ * This function is mainly used to gracefully detach a minecart from a rail.
|
||||
+ * @param use Whether the minecart can currently use rails.
|
||||
+ */
|
||||
+ public void setCanUseRail(boolean use)
|
||||
+ {
|
||||
+ canUseRail = use;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return false if this cart should not call IRail.onMinecartPass() and should ignore Powered Rails.
|
||||
+ * @return True if this cart should call IRail.onMinecartPass().
|
||||
+ */
|
||||
+ public boolean shouldDoRailFunctions()
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Simply returns the minecartType variable.
|
||||
+ * @return minecartType
|
||||
+ */
|
||||
+ public int getMinecartType()
|
||||
+ {
|
||||
+ return minecartType;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the current global Minecart Collision handler if none
|
||||
+ * is registered, returns null
|
||||
+ * @return The collision handler or null
|
||||
+ */
|
||||
+ public static IMinecartCollisionHandler getCollisionHandler()
|
||||
+ {
|
||||
+ return collisionHandler;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the global Minecart Collision handler, overwrites any
|
||||
+ * that is currently set.
|
||||
+ * @param handler The new handler
|
||||
+ */
|
||||
+ public static void setCollisionHandler(IMinecartCollisionHandler handler)
|
||||
+ {
|
||||
+ collisionHandler = handler;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Carts should return their drag factor here
|
||||
+ * @return The drag rate.
|
||||
+ */
|
||||
+ protected double getDrag()
|
||||
+ {
|
||||
+ if(riddenByEntity != null)
|
||||
+ {
|
||||
+ return 0.99699997901916504D;
|
||||
+ }
|
||||
+ return 0.95999997854232788D;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Moved to allow overrides.
|
||||
+ * This code applies drag and updates push forces.
|
||||
+ */
|
||||
+ protected void applyDragAndPushForces()
|
||||
+ {
|
||||
+ if(isPoweredCart())
|
||||
+ {
|
||||
+ double d27 = MathHelper.sqrt_double(pushX * pushX + pushZ * pushZ);
|
||||
+ if(d27 > 0.01D)
|
||||
+ {
|
||||
+ pushX /= d27;
|
||||
+ pushZ /= d27;
|
||||
+ double d29 = 0.040000000000000001D;
|
||||
+ motionX *= 0.80000001192092896D;
|
||||
+ motionY *= 0.0D;
|
||||
+ motionZ *= 0.80000001192092896D;
|
||||
+ motionX += pushX * d29;
|
||||
+ motionZ += pushZ * d29;
|
||||
+ } else
|
||||
+ {
|
||||
+ motionX *= 0.89999997615814209D;
|
||||
+ motionY *= 0.0D;
|
||||
+ motionZ *= 0.89999997615814209D;
|
||||
+ }
|
||||
+ }
|
||||
+ motionX *= getDrag();
|
||||
+ motionY *= 0.0D;
|
||||
+ motionZ *= getDrag();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Moved to allow overrides.
|
||||
+ * This code updates push forces.
|
||||
+ */
|
||||
+ protected void updatePushForces()
|
||||
+ {
|
||||
+ if(isPoweredCart())
|
||||
+ {
|
||||
+ double push = MathHelper.sqrt_double(pushX * pushX + pushZ * pushZ);
|
||||
+ if(push > 0.01D && motionX * motionX + motionZ * motionZ > 0.001D)
|
||||
+ {
|
||||
+ pushX /= push;
|
||||
+ pushZ /= push;
|
||||
+ if(pushX * motionX + pushZ * motionZ < 0.0D)
|
||||
+ {
|
||||
+ pushX = 0.0D;
|
||||
+ pushZ = 0.0D;
|
||||
+ } else
|
||||
+ {
|
||||
+ pushX = motionX;
|
||||
+ pushZ = motionZ;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Moved to allow overrides.
|
||||
+ * This code handles minecart movement and speed capping when on a rail.
|
||||
+ */
|
||||
+ protected void moveMinecartOnRail(int i, int j, int k)
|
||||
+ {
|
||||
+ int id = worldObj.getBlockId(i, j, k);
|
||||
+ if (!BlockRail.isRailBlock(id))
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
+ float railMaxSpeed = ((BlockRail)Block.blocksList[id]).getRailMaxSpeed(worldObj, this, i, j, k);
|
||||
+
|
||||
+ double maxSpeed = Math.min(railMaxSpeed, getMaxSpeedRail());
|
||||
+ double d23 = motionX;
|
||||
+ double d25 = motionZ;
|
||||
+ if(riddenByEntity != null)
|
||||
+ {
|
||||
+ d23 *= 0.75D;
|
||||
+ d25 *= 0.75D;
|
||||
+ }
|
||||
+ if(d23 < -maxSpeed)
|
||||
+ {
|
||||
+ d23 = -maxSpeed;
|
||||
+ }
|
||||
+ if(d23 > maxSpeed)
|
||||
+ {
|
||||
+ d23 = maxSpeed;
|
||||
+ }
|
||||
+ if(d25 < -maxSpeed)
|
||||
+ {
|
||||
+ d25 = -maxSpeed;
|
||||
+ }
|
||||
+ if(d25 > maxSpeed)
|
||||
+ {
|
||||
+ d25 = maxSpeed;
|
||||
+ }
|
||||
+ moveEntity(d23, 0.0D, d25);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Moved to allow overrides.
|
||||
+ * This code handles minecart movement and speed capping when not on a rail.
|
||||
+ */
|
||||
+ protected void moveMinecartOffRail(int i, int j, int k)
|
||||
+ {
|
||||
+ double d2 = getMaxSpeedGround();
|
||||
+ if(!onGround)
|
||||
+ {
|
||||
+ d2 = getMaxSpeedAirLateral();
|
||||
+ }
|
||||
+ if(motionX < -d2)
|
||||
+ {
|
||||
+ motionX = -d2;
|
||||
+ }
|
||||
+ if(motionX > d2)
|
||||
+ {
|
||||
+ motionX = d2;
|
||||
+ }
|
||||
+ if(motionZ < -d2)
|
||||
+ {
|
||||
+ motionZ = -d2;
|
||||
+ }
|
||||
+ if(motionZ > d2)
|
||||
+ {
|
||||
+ motionZ = d2;
|
||||
+ }
|
||||
+ double moveY = motionY;
|
||||
+ if(getMaxSpeedAirVertical() > 0 && motionY > getMaxSpeedAirVertical())
|
||||
+ {
|
||||
+ moveY = getMaxSpeedAirVertical();
|
||||
+ if(Math.abs(motionX) < 0.3f && Math.abs(motionZ) < 0.3f)
|
||||
+ {
|
||||
+ moveY = 0.15f;
|
||||
+ motionY = moveY;
|
||||
+ }
|
||||
+ }
|
||||
+ if(onGround)
|
||||
+ {
|
||||
+ motionX *= 0.5D;
|
||||
+ motionY *= 0.5D;
|
||||
+ motionZ *= 0.5D;
|
||||
+ }
|
||||
+ moveEntity(motionX, moveY, motionZ);
|
||||
+ if(!onGround)
|
||||
+ {
|
||||
+ motionX *= getDragAir();
|
||||
+ motionY *= getDragAir();
|
||||
+ motionZ *= getDragAir();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Moved to allow overrides.
|
||||
+ * This code applies fuel consumption.
|
||||
+ */
|
||||
+ protected void updateFuel()
|
||||
+ {
|
||||
+ if (fuel > 0)
|
||||
+ {
|
||||
+ fuel--;
|
||||
+ }
|
||||
+ if (fuel <= 0)
|
||||
+ {
|
||||
+ pushX = pushZ = 0.0D;
|
||||
+ }
|
||||
+ setMinecartPowered(fuel > 0);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Getters/setters for physics variables
|
||||
+ */
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the carts max speed.
|
||||
+ * Carts going faster than 1.1 cause issues with chunk loading.
|
||||
+ * Carts cant traverse slopes or corners at greater than 0.5 - 0.6.
|
||||
+ * This value is compared with the rails max speed to determine
|
||||
+ * the carts current max speed. A normal rails max speed is 0.4.
|
||||
+ * @return Carts max speed.
|
||||
+ */
|
||||
+ public float getMaxSpeedRail()
|
||||
+ {
|
||||
+ return maxSpeedRail;
|
||||
+ }
|
||||
+
|
||||
+ public void setMaxSpeedRail(float value)
|
||||
+ {
|
||||
+ maxSpeedRail = value;
|
||||
+ }
|
||||
+
|
||||
+ public float getMaxSpeedGround()
|
||||
+ {
|
||||
+ return maxSpeedGround;
|
||||
+ }
|
||||
+
|
||||
+ public void setMaxSpeedGround(float value)
|
||||
+ {
|
||||
+ maxSpeedGround = value;
|
||||
+ }
|
||||
+
|
||||
+ public float getMaxSpeedAirLateral()
|
||||
+ {
|
||||
+ return maxSpeedAirLateral;
|
||||
+ }
|
||||
+
|
||||
+ public void setMaxSpeedAirLateral(float value)
|
||||
+ {
|
||||
+ maxSpeedAirLateral = value;
|
||||
+ }
|
||||
+
|
||||
+ public float getMaxSpeedAirVertical()
|
||||
+ {
|
||||
+ return maxSpeedAirVertical;
|
||||
+ }
|
||||
+
|
||||
+ public void setMaxSpeedAirVertical(float value)
|
||||
+ {
|
||||
+ maxSpeedAirVertical = value;
|
||||
+ }
|
||||
+
|
||||
+ public double getDragAir()
|
||||
+ {
|
||||
+ return dragAir;
|
||||
+ }
|
||||
+
|
||||
+ public void setDragAir(double value)
|
||||
+ {
|
||||
+ dragAir = value;
|
||||
+ }
|
||||
}
|
||||
@@ -1,122 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/GuiControls.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/GuiControls.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import java.util.List;
|
||||
import net.minecraft.client.Minecraft;
|
||||
+import net.minecraft.src.forge.GuiControlsScrollPanel;
|
||||
|
||||
public class GuiControls extends GuiScreen
|
||||
{
|
||||
@@ -9,6 +10,7 @@
|
||||
protected String screenTitle;
|
||||
private GameSettings options;
|
||||
private int buttonId;
|
||||
+ private GuiControlsScrollPanel scrollPane;
|
||||
|
||||
public GuiControls(GuiScreen guiscreen, GameSettings gamesettings)
|
||||
{
|
||||
@@ -25,60 +27,30 @@
|
||||
|
||||
public void initGui()
|
||||
{
|
||||
+ scrollPane = new GuiControlsScrollPanel(this, options, mc);
|
||||
StringTranslate stringtranslate = StringTranslate.getInstance();
|
||||
int i = func_20080_j();
|
||||
- for (int j = 0; j < options.keyBindings.length; j++)
|
||||
- {
|
||||
- controlList.add(new GuiSmallButton(j, i + (j % 2) * 160, height / 6 + 24 * (j >> 1), 70, 20, options.getOptionDisplayString(j)));
|
||||
- }
|
||||
-
|
||||
- controlList.add(new GuiButton(200, width / 2 - 100, height / 6 + 168, stringtranslate.translateKey("gui.done")));
|
||||
+ controlList.add(new GuiButton(200, width / 2 - 100, height - 28, stringtranslate.translateKey("gui.done")));
|
||||
+ scrollPane.registerScrollButtons(controlList, 7, 8);
|
||||
screenTitle = stringtranslate.translateKey("controls.title");
|
||||
}
|
||||
|
||||
protected void actionPerformed(GuiButton guibutton)
|
||||
{
|
||||
- for (int i = 0; i < options.keyBindings.length; i++)
|
||||
- {
|
||||
- ((GuiButton)controlList.get(i)).displayString = options.getOptionDisplayString(i);
|
||||
- }
|
||||
-
|
||||
if (guibutton.id == 200)
|
||||
{
|
||||
mc.displayGuiScreen(parentScreen);
|
||||
}
|
||||
- else
|
||||
- {
|
||||
- buttonId = guibutton.id;
|
||||
- guibutton.displayString = (new StringBuilder()).append("> ").append(options.getOptionDisplayString(guibutton.id)).append(" <").toString();
|
||||
- }
|
||||
}
|
||||
|
||||
protected void mouseClicked(int i, int j, int k)
|
||||
{
|
||||
- if (buttonId >= 0)
|
||||
- {
|
||||
- options.setKeyBinding(buttonId, -100 + k);
|
||||
- ((GuiButton)controlList.get(buttonId)).displayString = options.getOptionDisplayString(buttonId);
|
||||
- buttonId = -1;
|
||||
- KeyBinding.resetKeyBindingArrayAndHash();
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- super.mouseClicked(i, j, k);
|
||||
- }
|
||||
+ super.mouseClicked(i, j, k);
|
||||
}
|
||||
|
||||
protected void keyTyped(char c, int i)
|
||||
{
|
||||
- if (buttonId >= 0)
|
||||
- {
|
||||
- options.setKeyBinding(buttonId, i);
|
||||
- ((GuiButton)controlList.get(buttonId)).displayString = options.getOptionDisplayString(buttonId);
|
||||
- buttonId = -1;
|
||||
- KeyBinding.resetKeyBindingArrayAndHash();
|
||||
- }
|
||||
- else
|
||||
+ if (scrollPane.keyTyped(c, i))
|
||||
{
|
||||
super.keyTyped(c, i);
|
||||
}
|
||||
@@ -87,35 +59,8 @@
|
||||
public void drawScreen(int i, int j, float f)
|
||||
{
|
||||
drawDefaultBackground();
|
||||
- drawCenteredString(fontRenderer, screenTitle, width / 2, 20, 0xffffff);
|
||||
- int k = func_20080_j();
|
||||
- for (int l = 0; l < options.keyBindings.length; l++)
|
||||
- {
|
||||
- boolean flag = false;
|
||||
- for (int i1 = 0; i1 < options.keyBindings.length; i1++)
|
||||
- {
|
||||
- if (i1 != l && options.keyBindings[l].keyCode == options.keyBindings[i1].keyCode)
|
||||
- {
|
||||
- flag = true;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- int j1 = l;
|
||||
- if (buttonId == l)
|
||||
- {
|
||||
- ((GuiButton)controlList.get(j1)).displayString = "\247f> \247e??? \247f<";
|
||||
- }
|
||||
- else if (flag)
|
||||
- {
|
||||
- ((GuiButton)controlList.get(j1)).displayString = (new StringBuilder()).append("\247c").append(options.getOptionDisplayString(j1)).toString();
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- ((GuiButton)controlList.get(j1)).displayString = options.getOptionDisplayString(j1);
|
||||
- }
|
||||
- drawString(fontRenderer, options.getKeyBindingDescription(l), k + (l % 2) * 160 + 70 + 6, height / 6 + 24 * (l >> 1) + 7, -1);
|
||||
- }
|
||||
-
|
||||
+ scrollPane.drawScreen(i, j, f);
|
||||
+ drawCenteredString(fontRenderer, screenTitle, width / 2, 4, 0xffffff);
|
||||
super.drawScreen(i, j, f);
|
||||
}
|
||||
}
|
||||
@@ -1,139 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/Item.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/Item.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.io.PrintStream;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@@ -157,6 +158,9 @@
|
||||
private String potionModifier;
|
||||
private String itemName;
|
||||
|
||||
+ // FORGE: To disable repair recipes.
|
||||
+ protected boolean canRepair = true;
|
||||
+
|
||||
protected Item(int i)
|
||||
{
|
||||
maxStackSize = 64;
|
||||
@@ -449,7 +453,7 @@
|
||||
float f7 = f4 * f5;
|
||||
float f8 = f6;
|
||||
float f9 = f3 * f5;
|
||||
- double d3 = 5D;
|
||||
+ double d3 = ModLoader.getMinecraftInstance().playerController.getBlockReachDistance();
|
||||
Vec3D vec3d1 = vec3d.addVector((double)f7 * d3, (double)f8 * d3, (double)f9 * d3);
|
||||
MovingObjectPosition movingobjectposition = world.rayTraceBlocks_do_do(vec3d, vec3d1, flag, !flag);
|
||||
return movingobjectposition;
|
||||
@@ -469,6 +473,109 @@
|
||||
{
|
||||
return getIconFromDamage(i);
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * Called when a new CreativeContainer is opened, populate the list
|
||||
+ * with all of the items for this item you want a player in creative mode
|
||||
+ * to have access to.
|
||||
+ *
|
||||
+ * @param itemList The list of items currently in the creative inventory
|
||||
+ */
|
||||
+ public void addCreativeItems(ArrayList itemList)
|
||||
+ {
|
||||
+ if (this.shiftedIndex != Item.potion.shiftedIndex && this.shiftedIndex != Item.monsterPlacer.shiftedIndex)
|
||||
+ {
|
||||
+ itemList.add(new ItemStack(this, 1));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Called when a player drops the item into the world,
|
||||
+ * returning false from this will prevent the item from
|
||||
+ * being removed from the players inventory and spawning
|
||||
+ * in the world
|
||||
+ *
|
||||
+ * @param player The player that dropped the item
|
||||
+ * @param item The item stack, before the item is removed.
|
||||
+ */
|
||||
+ public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * This is called when the item is used, before the block is activated.
|
||||
+ * @param stack The Item Stack
|
||||
+ * @param player The Player that used the item
|
||||
+ * @param world The Current World
|
||||
+ * @param X Target X Position
|
||||
+ * @param Y Target Y Position
|
||||
+ * @param Z Target Z Position
|
||||
+ * @param side The side of the target hit
|
||||
+ * @return Return true to prevent any further processing.
|
||||
+ */
|
||||
+ public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int X, int Y, int Z, int side)
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Metadata-sensitive version of getStrVsBlock
|
||||
+ * @param itemstack The Item Stack
|
||||
+ * @param block The block the item is trying to break
|
||||
+ * @param metadata The items current metadata
|
||||
+ * @return The damage strength
|
||||
+ */
|
||||
+ public float getStrVsBlock(ItemStack itemstack, Block block, int metadata)
|
||||
+ {
|
||||
+ return getStrVsBlock(itemstack, block);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Called by CraftingManager to determine if an item is reparable.
|
||||
+ * @return True if reparable
|
||||
+ */
|
||||
+ public boolean isRepairable()
|
||||
+ {
|
||||
+ return canRepair && isDamageable();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Call to disable repair recipes.
|
||||
+ * @return The current Item instance
|
||||
+ */
|
||||
+ public Item setNoRepair()
|
||||
+ {
|
||||
+ canRepair = false;
|
||||
+ return this;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Called before a block is broken. Return true to prevent default block harvesting.
|
||||
+ *
|
||||
+ * Note: In SMP, this is called on both client and server sides!
|
||||
+ *
|
||||
+ * @param itemstack The current ItemStack
|
||||
+ * @param X The X Position
|
||||
+ * @param Y The X Position
|
||||
+ * @param Z The X Position
|
||||
+ * @param player The Player that is wielding the item
|
||||
+ * @return True to prevent harvesting, false to continue as normal
|
||||
+ */
|
||||
+ public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player)
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Called each tick while using an item.
|
||||
+ * @param stack The Item being used
|
||||
+ * @param player The Player using the item
|
||||
+ * @param count The amount of time in tick the item has been used for continuously
|
||||
+ */
|
||||
+ public void onUsingItemTick(ItemStack stack, EntityPlayer player, int count)
|
||||
+ {
|
||||
+ }
|
||||
|
||||
static
|
||||
{
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/Packet250CustomPayload.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/Packet250CustomPayload.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -20,7 +20,7 @@
|
||||
if (length > 0 && length < 32767)
|
||||
{
|
||||
data = new byte[length];
|
||||
- datainputstream.read(data);
|
||||
+ datainputstream.readFully(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/RailLogic.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/RailLogic.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -3,7 +3,7 @@
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
-class RailLogic
|
||||
+public class RailLogic
|
||||
{
|
||||
private World worldObj;
|
||||
private int trackX;
|
||||
@@ -12,6 +12,7 @@
|
||||
private final boolean isPoweredRail;
|
||||
private List connectedTracks;
|
||||
final BlockRail rail;
|
||||
+ private final boolean canMakeSlopes;
|
||||
|
||||
public RailLogic(BlockRail blockrail, World world, int i, int j, int k)
|
||||
{
|
||||
@@ -23,16 +24,12 @@
|
||||
trackY = j;
|
||||
trackZ = k;
|
||||
int l = world.getBlockId(i, j, k);
|
||||
- int i1 = world.getBlockMetadata(i, j, k);
|
||||
- if (BlockRail.isPoweredBlockRail((BlockRail)Block.blocksList[l]))
|
||||
- {
|
||||
- isPoweredRail = true;
|
||||
- i1 &= -9;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- isPoweredRail = false;
|
||||
- }
|
||||
+
|
||||
+ BlockRail target = (BlockRail)Block.blocksList[l];
|
||||
+ int i1 = target.getBasicRailMetadata(world, null, i, j, k);
|
||||
+ isPoweredRail = !target.isFlexibleRail(world, i, j, k);
|
||||
+ canMakeSlopes = target.canMakeSlopes(world, i, j, k);
|
||||
+
|
||||
setConnections(i1);
|
||||
}
|
||||
|
||||
@@ -243,7 +240,7 @@
|
||||
byte0 = 9;
|
||||
}
|
||||
}
|
||||
- if (byte0 == 0)
|
||||
+ if (byte0 == 0 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRail.isRailBlockAt(worldObj, trackX, trackY + 1, trackZ - 1))
|
||||
{
|
||||
@@ -254,7 +251,7 @@
|
||||
byte0 = 5;
|
||||
}
|
||||
}
|
||||
- if (byte0 == 1)
|
||||
+ if (byte0 == 1 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRail.isRailBlockAt(worldObj, trackX + 1, trackY + 1, trackZ))
|
||||
{
|
||||
@@ -377,7 +374,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
- if (byte0 == 0)
|
||||
+ if (byte0 == 0 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRail.isRailBlockAt(worldObj, trackX, trackY + 1, trackZ - 1))
|
||||
{
|
||||
@@ -388,7 +385,7 @@
|
||||
byte0 = 5;
|
||||
}
|
||||
}
|
||||
- if (byte0 == 1)
|
||||
+ if (byte0 == 1 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRail.isRailBlockAt(worldObj, trackX + 1, trackY + 1, trackZ))
|
||||
{
|
||||
@@ -428,7 +425,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- static int getNAdjacentTracks(RailLogic raillogic)
|
||||
+ public static int getNAdjacentTracks(RailLogic raillogic)
|
||||
{
|
||||
return raillogic.getAdjacentTracks();
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/BlockButton.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/BlockButton.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -32,36 +32,36 @@
|
||||
|
||||
public boolean canPlaceBlockOnSide(World world, int i, int j, int k, int l)
|
||||
{
|
||||
- if (l == 2 && world.isBlockNormalCube(i, j, k + 1))
|
||||
+ if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (l == 3 && world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (l == 4 && world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- return l == 5 && world.isBlockNormalCube(i - 1, j, k);
|
||||
+ return l == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5);
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
||||
{
|
||||
- if (world.isBlockNormalCube(i - 1, j, k))
|
||||
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if (world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if (world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- return world.isBlockNormalCube(i, j, k + 1);
|
||||
+ return world.isBlockSolidOnSide(i, j, k + 1, 2);
|
||||
}
|
||||
|
||||
public void onBlockPlaced(World world, int i, int j, int k, int l)
|
||||
@@ -69,19 +69,19 @@
|
||||
int i1 = world.getBlockMetadata(i, j, k);
|
||||
int j1 = i1 & 8;
|
||||
i1 &= 7;
|
||||
- if (l == 2 && world.isBlockNormalCube(i, j, k + 1))
|
||||
+ if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
i1 = 4;
|
||||
}
|
||||
- else if (l == 3 && world.isBlockNormalCube(i, j, k - 1))
|
||||
+ else if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
i1 = 3;
|
||||
}
|
||||
- else if (l == 4 && world.isBlockNormalCube(i + 1, j, k))
|
||||
+ else if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
i1 = 2;
|
||||
}
|
||||
- else if (l == 5 && world.isBlockNormalCube(i - 1, j, k))
|
||||
+ else if (l == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
i1 = 1;
|
||||
}
|
||||
@@ -94,19 +94,19 @@
|
||||
|
||||
private int getOrientation(World world, int i, int j, int k)
|
||||
{
|
||||
- if (world.isBlockNormalCube(i - 1, j, k))
|
||||
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if (world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if (world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
- return !world.isBlockNormalCube(i, j, k + 1) ? 1 : 4;
|
||||
+ return !world.isBlockSolidOnSide(i, j, k + 1, 2) ? 1 : 4;
|
||||
}
|
||||
|
||||
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
|
||||
@@ -115,19 +115,19 @@
|
||||
{
|
||||
int i1 = world.getBlockMetadata(i, j, k) & 7;
|
||||
boolean flag = false;
|
||||
- if (!world.isBlockNormalCube(i - 1, j, k) && i1 == 1)
|
||||
+ if (!world.isBlockSolidOnSide(i - 1, j, k, 5) && i1 == 1)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCube(i + 1, j, k) && i1 == 2)
|
||||
+ if (!world.isBlockSolidOnSide(i + 1, j, k, 4) && i1 == 2)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCube(i, j, k - 1) && i1 == 3)
|
||||
+ if (!world.isBlockSolidOnSide(i, j, k - 1, 3) && i1 == 3)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCube(i, j, k + 1) && i1 == 4)
|
||||
+ if (!world.isBlockSolidOnSide(i, j, k + 1, 2) && i1 == 4)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/BlockChest.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/BlockChest.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -334,23 +334,23 @@
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i, j + 1, k))
|
||||
+ if (world.isBlockSolidOnSide(i, j + 1, k, 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.getBlockId(i - 1, j, k) == blockID && world.isBlockNormalCube(i - 1, j + 1, k))
|
||||
+ if (world.getBlockId(i - 1, j, k) == blockID && world.isBlockSolidOnSide(i - 1, j + 1, k, 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.getBlockId(i + 1, j, k) == blockID && world.isBlockNormalCube(i + 1, j + 1, k))
|
||||
+ if (world.getBlockId(i + 1, j, k) == blockID && world.isBlockSolidOnSide(i + 1, j + 1, k, 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.getBlockId(i, j, k - 1) == blockID && world.isBlockNormalCube(i, j + 1, k - 1))
|
||||
+ if (world.getBlockId(i, j, k - 1) == blockID && world.isBlockSolidOnSide(i, j + 1, k - 1, 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.getBlockId(i, j, k + 1) == blockID && world.isBlockNormalCube(i, j + 1, k + 1))
|
||||
+ if (world.getBlockId(i, j, k + 1) == blockID && world.isBlockSolidOnSide(i, j + 1, k + 1, 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/BlockLadder.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/BlockLadder.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -31,37 +31,37 @@
|
||||
|
||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
||||
{
|
||||
- if (world.isBlockNormalCube(i - 1, j, k))
|
||||
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if (world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if (world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- return world.isBlockNormalCube(i, j, k + 1);
|
||||
+ return world.isBlockSolidOnSide(i, j, k + 1, 2);
|
||||
}
|
||||
|
||||
public void onBlockPlaced(World world, int i, int j, int k, int l)
|
||||
{
|
||||
int i1 = world.getBlockMetadata(i, j, k);
|
||||
- if ((i1 == 0 || l == 2) && world.isBlockNormalCube(i, j, k + 1))
|
||||
+ if ((i1 == 0 || l == 2) && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
i1 = 2;
|
||||
}
|
||||
- if ((i1 == 0 || l == 3) && world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if ((i1 == 0 || l == 3) && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
i1 = 3;
|
||||
}
|
||||
- if ((i1 == 0 || l == 4) && world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if ((i1 == 0 || l == 4) && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
i1 = 4;
|
||||
}
|
||||
- if ((i1 == 0 || l == 5) && world.isBlockNormalCube(i - 1, j, k))
|
||||
+ if ((i1 == 0 || l == 5) && world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
i1 = 5;
|
||||
}
|
||||
@@ -72,19 +72,19 @@
|
||||
{
|
||||
int i1 = world.getBlockMetadata(i, j, k);
|
||||
boolean flag = false;
|
||||
- if (i1 == 2 && world.isBlockNormalCube(i, j, k + 1))
|
||||
+ if(i1 == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (i1 == 3 && world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if(i1 == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (i1 == 4 && world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if(i1 == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (i1 == 5 && world.isBlockNormalCube(i - 1, j, k))
|
||||
+ if(i1 == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -100,4 +100,10 @@
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
+
|
||||
+ /* FORGE: Implemented base method, see Block.isLadder */
|
||||
+ public boolean isLadder(World world, int i, int j, int k)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/BlockLever.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/BlockLever.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -31,44 +31,44 @@
|
||||
|
||||
public boolean canPlaceBlockOnSide(World world, int i, int j, int k, int l)
|
||||
{
|
||||
- if (l == 1 && world.isBlockNormalCube(i, j - 1, k))
|
||||
+ if (l == 1 && world.isBlockSolidOnSide(i, j - 1, k, 1))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (l == 2 && world.isBlockNormalCube(i, j, k + 1))
|
||||
+ if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (l == 3 && world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (l == 4 && world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- return l == 5 && world.isBlockNormalCube(i - 1, j, k);
|
||||
+ return l == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5);
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
||||
{
|
||||
- if (world.isBlockNormalCube(i - 1, j, k))
|
||||
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if (world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if (world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCube(i, j, k + 1))
|
||||
+ if (world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- return world.isBlockNormalCube(i, j - 1, k);
|
||||
+ return world.isBlockSolidOnSide(i, j - 1, k, 1);
|
||||
}
|
||||
|
||||
public void onBlockPlaced(World world, int i, int j, int k, int l)
|
||||
@@ -77,23 +77,23 @@
|
||||
int j1 = i1 & 8;
|
||||
i1 &= 7;
|
||||
i1 = -1;
|
||||
- if (l == 1 && world.isBlockNormalCube(i, j - 1, k))
|
||||
+ if (l == 1 && world.isBlockSolidOnSide(i, j - 1, k, 1))
|
||||
{
|
||||
i1 = 5 + world.rand.nextInt(2);
|
||||
}
|
||||
- if (l == 2 && world.isBlockNormalCube(i, j, k + 1))
|
||||
+ if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
i1 = 4;
|
||||
}
|
||||
- if (l == 3 && world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
i1 = 3;
|
||||
}
|
||||
- if (l == 4 && world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
i1 = 2;
|
||||
}
|
||||
- if (l == 5 && world.isBlockNormalCube(i - 1, j, k))
|
||||
+ if (l == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
i1 = 1;
|
||||
}
|
||||
@@ -116,27 +116,27 @@
|
||||
{
|
||||
int i1 = world.getBlockMetadata(i, j, k) & 7;
|
||||
boolean flag = false;
|
||||
- if (!world.isBlockNormalCube(i - 1, j, k) && i1 == 1)
|
||||
+ if (!world.isBlockSolidOnSide(i - 1, j, k, 5) && i1 == 1)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCube(i + 1, j, k) && i1 == 2)
|
||||
+ if (!world.isBlockSolidOnSide(i + 1, j, k, 4) && i1 == 2)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCube(i, j, k - 1) && i1 == 3)
|
||||
+ if (!world.isBlockSolidOnSide(i, j, k - 1, 3) && i1 == 3)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCube(i, j, k + 1) && i1 == 4)
|
||||
+ if (!world.isBlockSolidOnSide(i, j, k + 1, 2) && i1 == 4)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCube(i, j - 1, k) && i1 == 5)
|
||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && i1 == 5)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCube(i, j - 1, k) && i1 == 6)
|
||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && i1 == 6)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/BlockNetherStalk.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/BlockNetherStalk.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockNetherStalk extends BlockFlower
|
||||
@@ -57,25 +58,24 @@
|
||||
return 6;
|
||||
}
|
||||
|
||||
- public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int i1)
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> getBlockDropped(World world, int i, int j, int k, int meta, int fortune)
|
||||
{
|
||||
- if (world.isRemote)
|
||||
- {
|
||||
- return;
|
||||
- }
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
int j1 = 1;
|
||||
- if (l >= 3)
|
||||
+ if (meta >= 3)
|
||||
{
|
||||
j1 = 2 + world.rand.nextInt(3);
|
||||
- if (i1 > 0)
|
||||
+ if (fortune > 0)
|
||||
{
|
||||
- j1 += world.rand.nextInt(i1 + 1);
|
||||
+ j1 += world.rand.nextInt(fortune + 1);
|
||||
}
|
||||
}
|
||||
for (int k1 = 0; k1 < j1; k1++)
|
||||
{
|
||||
- dropBlockAsItem_do(world, i, j, k, new ItemStack(Item.netherStalkSeeds));
|
||||
+ ret.add(new ItemStack(Item.netherStalkSeeds));
|
||||
}
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
public int idDropped(int i, Random random, int j)
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/BlockPistonBase.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/BlockPistonBase.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -350,7 +350,7 @@
|
||||
return false;
|
||||
}
|
||||
}
|
||||
- return !(Block.blocksList[i] instanceof BlockContainer);
|
||||
+ return !(Block.blocksList[i] != null && Block.blocksList[i].hasTileEntity(world.getBlockMetadata(j, l, l)));
|
||||
}
|
||||
|
||||
private static boolean canExtend(World world, int i, int j, int k, int l)
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/BlockPressurePlate.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/BlockPressurePlate.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
||||
{
|
||||
- return world.isBlockNormalCube(i, j - 1, k) || world.getBlockId(i, j - 1, k) == Block.fence.blockID;
|
||||
+ return world.isBlockSolidOnSide(i, j - 1, k, 1) || world.getBlockId(i, j - 1, k) == Block.fence.blockID;
|
||||
}
|
||||
|
||||
public void onBlockAdded(World world, int i, int j, int k)
|
||||
@@ -1,196 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/BlockRail.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/BlockRail.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -5,16 +5,29 @@
|
||||
public class BlockRail extends Block
|
||||
{
|
||||
private final boolean isPowered;
|
||||
+
|
||||
+ /**
|
||||
+ * Forge: Moved render type to a field and a setter.
|
||||
+ * This allows for a mod to change the render type
|
||||
+ * for vanilla rails, and any mod rails that extend
|
||||
+ * this class.
|
||||
+ */
|
||||
+ private int renderType = 9;
|
||||
+
|
||||
+ public void setRenderType(int value)
|
||||
+ {
|
||||
+ renderType = value;
|
||||
+ }
|
||||
|
||||
public static final boolean isRailBlockAt(World world, int i, int j, int k)
|
||||
{
|
||||
int l = world.getBlockId(i, j, k);
|
||||
- return l == Block.rail.blockID || l == Block.railPowered.blockID || l == Block.railDetector.blockID;
|
||||
+ return Block.blocksList[l] instanceof BlockRail;
|
||||
}
|
||||
|
||||
public static final boolean isRailBlock(int i)
|
||||
{
|
||||
- return i == Block.rail.blockID || i == Block.railPowered.blockID || i == Block.railDetector.blockID;
|
||||
+ return Block.blocksList[i] instanceof BlockRail;
|
||||
}
|
||||
|
||||
protected BlockRail(int i, int j, boolean flag)
|
||||
@@ -81,7 +94,7 @@
|
||||
|
||||
public int getRenderType()
|
||||
{
|
||||
- return 9;
|
||||
+ return renderType;
|
||||
}
|
||||
|
||||
public int quantityDropped(Random random)
|
||||
@@ -91,7 +104,7 @@
|
||||
|
||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
||||
{
|
||||
- return world.isBlockNormalCube(i, j - 1, k);
|
||||
+ return world.isBlockSolidOnSide(i, j - 1, k, 1);
|
||||
}
|
||||
|
||||
public void onBlockAdded(World world, int i, int j, int k)
|
||||
@@ -123,19 +136,19 @@
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (j1 == 2 && !world.isBlockNormalCube(i + 1, j, k))
|
||||
+ if (j1 == 2 && !world.isBlockSolidOnSide(i + 1, j, k, 1))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (j1 == 3 && !world.isBlockNormalCube(i - 1, j, k))
|
||||
+ if (j1 == 3 && !world.isBlockSolidOnSide(i - 1, j, k, 1))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (j1 == 4 && !world.isBlockNormalCube(i, j, k - 1))
|
||||
+ if (j1 == 4 && !world.isBlockSolidOnSide(i, j, k - 1, 1))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (j1 == 5 && !world.isBlockNormalCube(i, j, k + 1))
|
||||
+ if (j1 == 5 && !world.isBlockSolidOnSide(i, j, k + 1, 1))
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -317,8 +330,119 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * This function is no longer called by Minecraft
|
||||
+ */
|
||||
+ @Deprecated
|
||||
static boolean isPoweredBlockRail(BlockRail blockrail)
|
||||
{
|
||||
return blockrail.isPowered;
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * Return true if the rail can make corners.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
+ * @param i The rail X coordinate.
|
||||
+ * @param j The rail Y coordinate.
|
||||
+ * @param k The rail Z coordinate.
|
||||
+ * @return True if the rail can make corners.
|
||||
+ */
|
||||
+ public boolean isFlexibleRail(World world, int i, int j, int k)
|
||||
+ {
|
||||
+ return !isPowered;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if the rail can make up and down slopes.
|
||||
+ * Used by placement logic.
|
||||
+ * @param world The world.
|
||||
+ * @param i The rail X coordinate.
|
||||
+ * @param j The rail Y coordinate.
|
||||
+ * @param k The rail Z coordinate.
|
||||
+ * @return True if the rail can make slopes.
|
||||
+ */
|
||||
+ public boolean canMakeSlopes(World world, int i, int j, int k)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return the rails metadata (without the power bit if the rail uses one).
|
||||
+ * Can be used to make the cart think the rail something other than it is,
|
||||
+ * for example when making diamond junctions or switches.
|
||||
+ * The cart parameter will often be null unless it it called from EntityMinecart.
|
||||
+ *
|
||||
+ * Valid rail metadata is defined as follows:
|
||||
+ * 0x0: flat track going North-South
|
||||
+ * 0x1: flat track going West-East
|
||||
+ * 0x2: track ascending to the East
|
||||
+ * 0x3: track ascending to the West
|
||||
+ * 0x4: track ascending to the North
|
||||
+ * 0x5: track ascending to the South
|
||||
+ * 0x6: WestNorth corner (connecting East and South)
|
||||
+ * 0x7: EastNorth corner (connecting West and South)
|
||||
+ * 0x8: EastSouth corner (connecting West and North)
|
||||
+ * 0x9: WestSouth corner (connecting East and North)
|
||||
+ *
|
||||
+ * All directions are Notch defined.
|
||||
+ * In MC Beta 1.8.3 the Sun rises in the North.
|
||||
+ * In MC 1.0.0 the Sun rises in the East.
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart asking for the metadata, null if it is not called by EntityMinecart.
|
||||
+ * @param i The rail X coordinate.
|
||||
+ * @param j The rail Y coordinate.
|
||||
+ * @param k The rail Z coordinate.
|
||||
+ * @return The metadata.
|
||||
+ */
|
||||
+ public int getBasicRailMetadata(IBlockAccess world, EntityMinecart cart, int i, int j, int k)
|
||||
+ {
|
||||
+ int meta = world.getBlockMetadata(i, j, k);
|
||||
+ if(isPowered) {
|
||||
+ meta = meta & 7;
|
||||
+ }
|
||||
+ return meta;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the max speed of the rail at [i, j, k].
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart on the rail, may be null.
|
||||
+ * @param i The rail X coordinate.
|
||||
+ * @param j The rail Y coordinate.
|
||||
+ * @param k The rail Z coordinate.
|
||||
+ * @return The max speed of the current rail.
|
||||
+ */
|
||||
+ public float getRailMaxSpeed(World world, EntityMinecart cart, int i, int j, int k)
|
||||
+ {
|
||||
+ return 0.4f;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * This function is called by any minecart that passes over this rail.
|
||||
+ * It is called once per update tick that the minecart is on the rail.
|
||||
+ * @param world The world.
|
||||
+ * @param cart The cart on the rail.
|
||||
+ * @param i The rail X coordinate.
|
||||
+ * @param j The rail Y coordinate.
|
||||
+ * @param k The rail Z coordinate.
|
||||
+ */
|
||||
+ public void onMinecartPass(World world, EntityMinecart cart, int i, int j, int k)
|
||||
+ {
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return true if this rail uses the 4th bit as a power bit.
|
||||
+ * Avoid using this function when getBasicRailMetadata() can be used instead.
|
||||
+ * The only reason to use this function is if you wish to change the rails metadata.
|
||||
+ * @param world The world.
|
||||
+ * @param i The rail X coordinate.
|
||||
+ * @param j The rail Y coordinate.
|
||||
+ * @param k The rail Z coordinate.
|
||||
+ * @return True if the 4th bit is a power bit.
|
||||
+ */
|
||||
+ public boolean hasPowerBit(World world, int i, int j, int k)
|
||||
+ {
|
||||
+ return isPowered;
|
||||
+ }
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/BlockTallGrass.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/BlockTallGrass.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -1,7 +1,10 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
+import net.minecraft.src.forge.ForgeHooks;
|
||||
+
|
||||
public class BlockTallGrass extends BlockFlower
|
||||
{
|
||||
protected BlockTallGrass(int i, int j)
|
||||
@@ -33,15 +36,25 @@
|
||||
|
||||
public int idDropped(int i, Random random, int j)
|
||||
{
|
||||
- if (random.nextInt(8) == 0)
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public ArrayList<ItemStack> getBlockDropped(World world, int i, int j, int k, int md, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+ if (world.rand.nextInt(8) != 0)
|
||||
{
|
||||
- return Item.seeds.shiftedIndex;
|
||||
+ return ret;
|
||||
}
|
||||
- else
|
||||
+
|
||||
+ ItemStack item = ForgeHooks.getGrassSeed(world);
|
||||
+ if (item != null)
|
||||
{
|
||||
- return -1;
|
||||
+ ret.add(item);
|
||||
}
|
||||
- }
|
||||
+ return ret;
|
||||
+ }
|
||||
|
||||
public int quantityDroppedWithBonus(int i, Random random)
|
||||
{
|
||||
@@ -1,107 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/BlockTorch.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/BlockTorch.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
private boolean canPlaceTorchOn(World world, int i, int j, int k)
|
||||
{
|
||||
- if (world.isBlockNormalCubeDefault(i, j, k, true))
|
||||
+ if (world.isBlockSolidOnSide(i, j, k, 1))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -45,19 +45,19 @@
|
||||
|
||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
||||
{
|
||||
- if (world.isBlockNormalCubeDefault(i - 1, j, k, true))
|
||||
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCubeDefault(i + 1, j, k, true))
|
||||
+ if (world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCubeDefault(i, j, k - 1, true))
|
||||
+ if (world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (world.isBlockNormalCubeDefault(i, j, k + 1, true))
|
||||
+ if (world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -71,19 +71,19 @@
|
||||
{
|
||||
i1 = 5;
|
||||
}
|
||||
- if (l == 2 && world.isBlockNormalCubeDefault(i, j, k + 1, true))
|
||||
+ if (l == 2 && world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
i1 = 4;
|
||||
}
|
||||
- if (l == 3 && world.isBlockNormalCubeDefault(i, j, k - 1, true))
|
||||
+ if (l == 3 && world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
i1 = 3;
|
||||
}
|
||||
- if (l == 4 && world.isBlockNormalCubeDefault(i + 1, j, k, true))
|
||||
+ if (l == 4 && world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
i1 = 2;
|
||||
}
|
||||
- if (l == 5 && world.isBlockNormalCubeDefault(i - 1, j, k, true))
|
||||
+ if (l == 5 && world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
i1 = 1;
|
||||
}
|
||||
@@ -101,19 +101,19 @@
|
||||
|
||||
public void onBlockAdded(World world, int i, int j, int k)
|
||||
{
|
||||
- if (world.isBlockNormalCubeDefault(i - 1, j, k, true))
|
||||
+ if (world.isBlockSolidOnSide(i - 1, j, k, 5))
|
||||
{
|
||||
world.setBlockMetadataWithNotify(i, j, k, 1);
|
||||
}
|
||||
- else if (world.isBlockNormalCubeDefault(i + 1, j, k, true))
|
||||
+ else if (world.isBlockSolidOnSide(i + 1, j, k, 4))
|
||||
{
|
||||
world.setBlockMetadataWithNotify(i, j, k, 2);
|
||||
}
|
||||
- else if (world.isBlockNormalCubeDefault(i, j, k - 1, true))
|
||||
+ else if (world.isBlockSolidOnSide(i, j, k - 1, 3))
|
||||
{
|
||||
world.setBlockMetadataWithNotify(i, j, k, 3);
|
||||
}
|
||||
- else if (world.isBlockNormalCubeDefault(i, j, k + 1, true))
|
||||
+ else if (world.isBlockSolidOnSide(i, j, k + 1, 2))
|
||||
{
|
||||
world.setBlockMetadataWithNotify(i, j, k, 4);
|
||||
}
|
||||
@@ -130,19 +130,19 @@
|
||||
{
|
||||
int i1 = world.getBlockMetadata(i, j, k);
|
||||
boolean flag = false;
|
||||
- if (!world.isBlockNormalCubeDefault(i - 1, j, k, true) && i1 == 1)
|
||||
+ if (!world.isBlockSolidOnSide(i - 1, j, k, 5) && i1 == 1)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCubeDefault(i + 1, j, k, true) && i1 == 2)
|
||||
+ if (!world.isBlockSolidOnSide(i + 1, j, k, 4) && i1 == 2)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCubeDefault(i, j, k - 1, true) && i1 == 3)
|
||||
+ if (!world.isBlockSolidOnSide(i, j, k - 1, 3) && i1 == 3)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCubeDefault(i, j, k + 1, true) && i1 == 4)
|
||||
+ if (!world.isBlockSolidOnSide(i, j, k + 1, 2) && i1 == 4)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -1,182 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/Chunk.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/Chunk.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -316,7 +316,7 @@
|
||||
{
|
||||
Block.blocksList[l1].onBlockRemoval(worldObj, i2, j, j2);
|
||||
}
|
||||
- else if ((Block.blocksList[l1] instanceof BlockContainer) && l1 != l)
|
||||
+ else if (Block.blocksList[l1] != null && Block.blocksList[l1].hasTileEntity(getBlockMetadata(i, j, k)) && l1 != l)
|
||||
{
|
||||
worldObj.removeBlockTileEntity(i2, j, j2);
|
||||
}
|
||||
@@ -346,12 +346,12 @@
|
||||
{
|
||||
Block.blocksList[l].onBlockAdded(worldObj, i2, j, j2);
|
||||
}
|
||||
- if (Block.blocksList[l] instanceof BlockContainer)
|
||||
+ if (Block.blocksList[l] != null && Block.blocksList[l].hasTileEntity(i1))
|
||||
{
|
||||
TileEntity tileentity = getChunkBlockTileEntity(i, j, k);
|
||||
if (tileentity == null)
|
||||
{
|
||||
- tileentity = ((BlockContainer)Block.blocksList[l]).getBlockEntity();
|
||||
+ tileentity = Block.blocksList[l].getTileEntity(i1);
|
||||
worldObj.setBlockTileEntity(i2, j, j2, tileentity);
|
||||
}
|
||||
if (tileentity != null)
|
||||
@@ -360,14 +360,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
- else if (l1 > 0 && (Block.blocksList[l1] instanceof BlockContainer))
|
||||
- {
|
||||
- TileEntity tileentity1 = getChunkBlockTileEntity(i, j, k);
|
||||
- if (tileentity1 != null)
|
||||
- {
|
||||
- tileentity1.updateContainingBlockInfo();
|
||||
- }
|
||||
- }
|
||||
isModified = true;
|
||||
return true;
|
||||
}
|
||||
@@ -392,6 +384,11 @@
|
||||
if (k1 != 0)
|
||||
{
|
||||
Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2);
|
||||
+ if (!worldObj.isRemote)
|
||||
+ {
|
||||
+ Block.blocksList[k1].onBlockRemoval(worldObj, l1, j, i2);
|
||||
+ }
|
||||
+ worldObj.removeBlockTileEntity(l1, j, i2);
|
||||
}
|
||||
data.setNibble(i, j, k, 0);
|
||||
if (Block.lightOpacity[byte0 & 0xff] != 0)
|
||||
@@ -414,28 +411,22 @@
|
||||
{
|
||||
Block.blocksList[l].onBlockAdded(worldObj, l1, j, i2);
|
||||
}
|
||||
- if (l > 0 && (Block.blocksList[l] instanceof BlockContainer))
|
||||
+ int meta = getBlockMetadata(i, j, k);
|
||||
+ if (l > 0 && Block.blocksList[l] != null && Block.blocksList[l].hasTileEntity(meta))
|
||||
{
|
||||
TileEntity tileentity = getChunkBlockTileEntity(i, j, k);
|
||||
if (tileentity == null)
|
||||
{
|
||||
- tileentity = ((BlockContainer)Block.blocksList[l]).getBlockEntity();
|
||||
+ tileentity = Block.blocksList[l].getTileEntity(meta);
|
||||
worldObj.setBlockTileEntity(l1, j, i2, tileentity);
|
||||
}
|
||||
if (tileentity != null)
|
||||
{
|
||||
tileentity.updateContainingBlockInfo();
|
||||
+ tileentity.blockMetadata = meta;
|
||||
}
|
||||
}
|
||||
}
|
||||
- else if (k1 > 0 && (Block.blocksList[k1] instanceof BlockContainer))
|
||||
- {
|
||||
- TileEntity tileentity1 = getChunkBlockTileEntity(i, j, k);
|
||||
- if (tileentity1 != null)
|
||||
- {
|
||||
- tileentity1.updateContainingBlockInfo();
|
||||
- }
|
||||
- }
|
||||
isModified = true;
|
||||
return true;
|
||||
}
|
||||
@@ -455,7 +446,7 @@
|
||||
}
|
||||
data.setNibble(i, j, k, l);
|
||||
int j1 = getBlockID(i, j, k);
|
||||
- if (j1 > 0 && (Block.blocksList[j1] instanceof BlockContainer))
|
||||
+ if (j1 > 0 && Block.blocksList[j1] != null && Block.blocksList[j1].hasTileEntity(l))
|
||||
{
|
||||
TileEntity tileentity = getChunkBlockTileEntity(i, j, k);
|
||||
if (tileentity != null)
|
||||
@@ -572,29 +563,27 @@
|
||||
{
|
||||
ChunkPosition chunkposition = new ChunkPosition(i, j, k);
|
||||
TileEntity tileentity = (TileEntity)chunkTileEntityMap.get(chunkposition);
|
||||
+ if(tileentity != null && tileentity.isInvalid())
|
||||
+ {
|
||||
+ chunkTileEntityMap.remove(chunkposition);
|
||||
+ tileentity = null;
|
||||
+ }
|
||||
if (tileentity == null)
|
||||
{
|
||||
int l = getBlockID(i, j, k);
|
||||
- if (!Block.isBlockContainer[l])
|
||||
+ int meta = getBlockMetadata(i, j, k);
|
||||
+ if(Block.blocksList[l] == null || !Block.blocksList[l].hasTileEntity(meta))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (tileentity == null)
|
||||
{
|
||||
- tileentity = ((BlockContainer)Block.blocksList[l]).getBlockEntity();
|
||||
+ tileentity = Block.blocksList[l].getTileEntity(meta);
|
||||
worldObj.setBlockTileEntity(xPosition * 16 + i, j, zPosition * 16 + k, tileentity);
|
||||
}
|
||||
tileentity = (TileEntity)chunkTileEntityMap.get(chunkposition);
|
||||
}
|
||||
- if (tileentity != null && tileentity.isInvalid())
|
||||
- {
|
||||
- chunkTileEntityMap.remove(chunkposition);
|
||||
- return null;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- return tileentity;
|
||||
- }
|
||||
+ return tileentity;
|
||||
}
|
||||
|
||||
public void addTileEntity(TileEntity tileentity)
|
||||
@@ -605,7 +594,7 @@
|
||||
setChunkBlockTileEntity(i, j, k, tileentity);
|
||||
if (isChunkLoaded)
|
||||
{
|
||||
- worldObj.loadedTileEntityList.add(tileentity);
|
||||
+ worldObj.addTileEntity(tileentity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -616,12 +605,18 @@
|
||||
tileentity.xCoord = xPosition * 16 + i;
|
||||
tileentity.yCoord = j;
|
||||
tileentity.zCoord = zPosition * 16 + k;
|
||||
- if (getBlockID(i, j, k) == 0 || !(Block.blocksList[getBlockID(i, j, k)] instanceof BlockContainer))
|
||||
+ int id = getBlockID(i, j, k);
|
||||
+ if(id == 0 || Block.blocksList[id] == null || !Block.blocksList[id].hasTileEntity(getBlockMetadata(i, j, k)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
+ TileEntity old = (TileEntity)chunkTileEntityMap.get(chunkposition);
|
||||
+ if (old != null)
|
||||
+ {
|
||||
+ old.invalidate();
|
||||
+ }
|
||||
tileentity.validate();
|
||||
chunkTileEntityMap.put(chunkposition, tileentity);
|
||||
return;
|
||||
@@ -903,4 +898,18 @@
|
||||
{
|
||||
return new ChunkCoordIntPair(xPosition, zPosition);
|
||||
}
|
||||
+
|
||||
+ /* FORGE: Used to remove only invalid TileEntities */
|
||||
+ public void cleanChunkBlockTileEntity(int i, int j, int k)
|
||||
+ {
|
||||
+ ChunkPosition chunkposition = new ChunkPosition(i, j, k);
|
||||
+ if (isChunkLoaded)
|
||||
+ {
|
||||
+ TileEntity tileentity = (TileEntity)chunkTileEntityMap.get(chunkposition);
|
||||
+ if (tileentity != null && tileentity.isInvalid())
|
||||
+ {
|
||||
+ chunkTileEntityMap.remove(chunkposition);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/Enchantment.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/Enchantment.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -91,6 +91,16 @@
|
||||
return this;
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Called to determine if this enchantment can be applied to a ItemStack
|
||||
+ * @param item The ItemStack that the enchantment might be put on
|
||||
+ * @return True if the item is valid, false otherwise
|
||||
+ */
|
||||
+ public boolean canEnchantItem(ItemStack item)
|
||||
+ {
|
||||
+ return type.canEnchantItem(item.getItem());
|
||||
+ }
|
||||
+
|
||||
static
|
||||
{
|
||||
looting = new EnchantmentLootBonus(21, 2, EnumEnchantmentType.weapon);
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/EnchantmentHelper.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/EnchantmentHelper.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -261,7 +261,7 @@
|
||||
for (int k = 0; k < j; k++)
|
||||
{
|
||||
Enchantment enchantment = aenchantment[k];
|
||||
- if (enchantment == null || !enchantment.type.canEnchantItem(item))
|
||||
+ if (enchantment == null || !enchantment.canEnchantItem(itemstack))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/Entity.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/Entity.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -106,6 +106,22 @@
|
||||
|
||||
protected abstract void entityInit();
|
||||
|
||||
+ //Forge: Used to store custom data for each entity.
|
||||
+ private NBTTagCompound customEntityData;
|
||||
+ /**
|
||||
+ * Returns a NBTTagCompound that can be used to store custom data for this entity.
|
||||
+ * It will be written, and read from disc, so it persists over world saves.
|
||||
+ * @return A NBTTagCompound
|
||||
+ */
|
||||
+ public NBTTagCompound getEntityData()
|
||||
+ {
|
||||
+ if (customEntityData == null)
|
||||
+ {
|
||||
+ customEntityData = new NBTTagCompound();
|
||||
+ }
|
||||
+ return customEntityData;
|
||||
+ }
|
||||
+
|
||||
public DataWatcher getDataWatcher()
|
||||
{
|
||||
return dataWatcher;
|
||||
@@ -883,6 +899,10 @@
|
||||
nbttagcompound.setShort("Fire", (short)fire);
|
||||
nbttagcompound.setShort("Air", (short)getAir());
|
||||
nbttagcompound.setBoolean("OnGround", onGround);
|
||||
+ if (customEntityData != null)
|
||||
+ {
|
||||
+ nbttagcompound.setCompoundTag("ForgeData", customEntityData);
|
||||
+ }
|
||||
writeEntityToNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@@ -917,6 +937,10 @@
|
||||
onGround = nbttagcompound.getBoolean("OnGround");
|
||||
setPosition(posX, posY, posZ);
|
||||
setRotation(rotationYaw, rotationPitch);
|
||||
+ if (nbttagcompound.hasKey("ForgeData"))
|
||||
+ {
|
||||
+ customEntityData = nbttagcompound.getCompoundTag("ForgeData");
|
||||
+ }
|
||||
readEntityFromNBT(nbttagcompound);
|
||||
}
|
||||
|
||||
@@ -1,937 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/EntityMinecart.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/EntityMinecart.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -1,18 +1,23 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
+import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
+import net.minecraft.src.forge.ForgeHooks;
|
||||
+import net.minecraft.src.forge.IMinecartCollisionHandler;
|
||||
+import net.minecraft.src.forge.MinecraftForge;
|
||||
+
|
||||
public class EntityMinecart extends Entity
|
||||
implements IInventory
|
||||
{
|
||||
- private ItemStack cargoItems[];
|
||||
- private int fuel;
|
||||
- private boolean field_469_aj;
|
||||
+ protected ItemStack cargoItems[];
|
||||
+ protected int fuel;
|
||||
+ protected boolean field_469_aj;
|
||||
public int minecartType;
|
||||
public double pushX;
|
||||
public double pushZ;
|
||||
- private static final int field_468_ak[][][] =
|
||||
+ protected static final int field_468_ak[][][] =
|
||||
{
|
||||
{
|
||||
{
|
||||
@@ -76,13 +81,36 @@
|
||||
}
|
||||
}
|
||||
};
|
||||
- private int turnProgress;
|
||||
- private double minecartX;
|
||||
- private double minecartY;
|
||||
- private double minecartZ;
|
||||
- private double field_9159_ar;
|
||||
- private double minecartPitch;
|
||||
-
|
||||
+ protected int turnProgress;
|
||||
+ protected double minecartX;
|
||||
+ protected double minecartY;
|
||||
+ protected double minecartZ;
|
||||
+ protected double field_9159_ar;
|
||||
+ protected double minecartPitch;
|
||||
+
|
||||
+ /*Forge: Minecart Compatibility Layer Integration.
|
||||
+ */
|
||||
+ protected double velocityX;
|
||||
+ protected double velocityY;
|
||||
+ protected double velocityZ;
|
||||
+ public static float defaultMaxSpeedRail = 0.4f;
|
||||
+ public static float defaultMaxSpeedGround = 0.4f;
|
||||
+ public static float defaultMaxSpeedAirLateral = 0.4f;
|
||||
+ public static float defaultMaxSpeedAirVertical = -1f;
|
||||
+ public static double defaultDragAir = 0.94999998807907104D;
|
||||
+ protected boolean canUseRail = true;
|
||||
+ protected boolean canBePushed = true;
|
||||
+ private static IMinecartCollisionHandler collisionHandler = null;
|
||||
+
|
||||
+ /*
|
||||
+ * Instance versions of the above physics properties
|
||||
+ */
|
||||
+ protected float maxSpeedRail;
|
||||
+ protected float maxSpeedGround;
|
||||
+ protected float maxSpeedAirLateral;
|
||||
+ protected float maxSpeedAirVertical;
|
||||
+ protected double dragAir;
|
||||
+
|
||||
public EntityMinecart(World world)
|
||||
{
|
||||
super(world);
|
||||
@@ -92,6 +120,18 @@
|
||||
preventEntitySpawning = true;
|
||||
setSize(0.98F, 0.7F);
|
||||
yOffset = height / 2.0F;
|
||||
+
|
||||
+ maxSpeedRail = defaultMaxSpeedRail;
|
||||
+ maxSpeedGround = defaultMaxSpeedGround;
|
||||
+ maxSpeedAirLateral = defaultMaxSpeedAirLateral;
|
||||
+ maxSpeedAirVertical = defaultMaxSpeedAirVertical;
|
||||
+ dragAir = defaultDragAir;
|
||||
+ }
|
||||
+
|
||||
+ public EntityMinecart(World world, int type)
|
||||
+ {
|
||||
+ this(world);
|
||||
+ minecartType = type;
|
||||
}
|
||||
|
||||
protected boolean canTriggerWalking()
|
||||
@@ -109,17 +149,27 @@
|
||||
|
||||
public AxisAlignedBB getCollisionBox(Entity entity)
|
||||
{
|
||||
+ if (getCollisionHandler() != null)
|
||||
+ {
|
||||
+ return getCollisionHandler().getCollisionBox(this, entity);
|
||||
+ }
|
||||
+
|
||||
return entity.boundingBox;
|
||||
}
|
||||
|
||||
public AxisAlignedBB getBoundingBox()
|
||||
{
|
||||
+ if (getCollisionHandler() != null)
|
||||
+ {
|
||||
+ return getCollisionHandler().getBoundingBox(this);
|
||||
+ }
|
||||
+
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean canBePushed()
|
||||
{
|
||||
- return true;
|
||||
+ return canBePushed;
|
||||
}
|
||||
|
||||
public EntityMinecart(World world, double d, double d1, double d2,
|
||||
@@ -158,49 +208,8 @@
|
||||
riddenByEntity.mountEntity(this);
|
||||
}
|
||||
setEntityDead();
|
||||
- dropItemWithOffset(Item.minecartEmpty.shiftedIndex, 1, 0.0F);
|
||||
- if (minecartType == 1)
|
||||
- {
|
||||
- EntityMinecart entityminecart = this;
|
||||
- label0:
|
||||
- for (int j = 0; j < entityminecart.getSizeInventory(); j++)
|
||||
- {
|
||||
- ItemStack itemstack = entityminecart.getStackInSlot(j);
|
||||
- if (itemstack == null)
|
||||
- {
|
||||
- continue;
|
||||
- }
|
||||
- float f = rand.nextFloat() * 0.8F + 0.1F;
|
||||
- float f1 = rand.nextFloat() * 0.8F + 0.1F;
|
||||
- float f2 = rand.nextFloat() * 0.8F + 0.1F;
|
||||
- do
|
||||
- {
|
||||
- if (itemstack.stackSize <= 0)
|
||||
- {
|
||||
- continue label0;
|
||||
- }
|
||||
- int k = rand.nextInt(21) + 10;
|
||||
- if (k > itemstack.stackSize)
|
||||
- {
|
||||
- k = itemstack.stackSize;
|
||||
- }
|
||||
- itemstack.stackSize -= k;
|
||||
- EntityItem entityitem = new EntityItem(worldObj, posX + (double)f, posY + (double)f1, posZ + (double)f2, new ItemStack(itemstack.itemID, k, itemstack.getItemDamage()));
|
||||
- float f3 = 0.05F;
|
||||
- entityitem.motionX = (float)rand.nextGaussian() * f3;
|
||||
- entityitem.motionY = (float)rand.nextGaussian() * f3 + 0.2F;
|
||||
- entityitem.motionZ = (float)rand.nextGaussian() * f3;
|
||||
- worldObj.spawnEntityInWorld(entityitem);
|
||||
- }
|
||||
- while (true);
|
||||
- }
|
||||
-
|
||||
- dropItemWithOffset(Block.chest.blockID, 1, 0.0F);
|
||||
- }
|
||||
- else if (minecartType == 2)
|
||||
- {
|
||||
- dropItemWithOffset(Block.stoneOvenIdle.blockID, 1, 0.0F);
|
||||
- }
|
||||
+
|
||||
+ dropCartAsItem();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -258,7 +267,7 @@
|
||||
{
|
||||
func_41018_e_(func_41020_o() - 1);
|
||||
}
|
||||
- if (isMinecartPowered() && rand.nextInt(4) == 0)
|
||||
+ if (isMinecartPowered() && rand.nextInt(4) == 0 && minecartType == 2 && getClass() == EntityMinecart.class)
|
||||
{
|
||||
worldObj.spawnParticle("largesmoke", posX, posY + 0.80000000000000004D, posZ, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
@@ -299,22 +308,18 @@
|
||||
double d2 = 0.40000000000000002D;
|
||||
double d4 = 0.0078125D;
|
||||
int l = worldObj.getBlockId(i, j, k);
|
||||
- if (BlockRail.isRailBlock(l))
|
||||
+ if (canUseRail() && BlockRail.isRailBlock(l))
|
||||
{
|
||||
Vec3D vec3d = func_182_g(posX, posY, posZ);
|
||||
- int i1 = worldObj.getBlockMetadata(i, j, k);
|
||||
+ int i1 = ((BlockRail)Block.blocksList[l]).getBasicRailMetadata(worldObj, this, i, j, k);
|
||||
posY = j;
|
||||
boolean flag = false;
|
||||
boolean flag1 = false;
|
||||
if (l == Block.railPowered.blockID)
|
||||
{
|
||||
- flag = (i1 & 8) != 0;
|
||||
+ flag = (worldObj.getBlockMetadata(i, j, k) & 8) != 0;
|
||||
flag1 = !flag;
|
||||
}
|
||||
- if (((BlockRail)Block.blocksList[l]).getIsPowered())
|
||||
- {
|
||||
- i1 &= 7;
|
||||
- }
|
||||
if (i1 >= 2 && i1 <= 5)
|
||||
{
|
||||
posY = j + 1;
|
||||
@@ -348,7 +353,7 @@
|
||||
double d13 = Math.sqrt(motionX * motionX + motionZ * motionZ);
|
||||
motionX = (d13 * d9) / d11;
|
||||
motionZ = (d13 * d10) / d11;
|
||||
- if (flag1)
|
||||
+ if (flag1 && shouldDoRailFunctions())
|
||||
{
|
||||
double d16 = Math.sqrt(motionX * motionX + motionZ * motionZ);
|
||||
if (d16 < 0.029999999999999999D)
|
||||
@@ -391,30 +396,9 @@
|
||||
posX = d18 + d9 * d17;
|
||||
posZ = d19 + d10 * d17;
|
||||
setPosition(posX, posY + (double)yOffset, posZ);
|
||||
- double d23 = motionX;
|
||||
- double d25 = motionZ;
|
||||
- if (riddenByEntity != null)
|
||||
- {
|
||||
- d23 *= 0.75D;
|
||||
- d25 *= 0.75D;
|
||||
- }
|
||||
- if (d23 < -d2)
|
||||
- {
|
||||
- d23 = -d2;
|
||||
- }
|
||||
- if (d23 > d2)
|
||||
- {
|
||||
- d23 = d2;
|
||||
- }
|
||||
- if (d25 < -d2)
|
||||
- {
|
||||
- d25 = -d2;
|
||||
- }
|
||||
- if (d25 > d2)
|
||||
- {
|
||||
- d25 = d2;
|
||||
- }
|
||||
- moveEntity(d23, 0.0D, d25);
|
||||
+
|
||||
+ moveMinecartOnRail(i, j, k);
|
||||
+
|
||||
if (ai[0][1] != 0 && MathHelper.floor_double(posX) - i == ai[0][0] && MathHelper.floor_double(posZ) - k == ai[0][2])
|
||||
{
|
||||
setPosition(posX, posY + (double)ai[0][1], posZ);
|
||||
@@ -423,39 +407,9 @@
|
||||
{
|
||||
setPosition(posX, posY + (double)ai[1][1], posZ);
|
||||
}
|
||||
- if (riddenByEntity != null)
|
||||
- {
|
||||
- motionX *= 0.99699997901916504D;
|
||||
- motionY *= 0.0D;
|
||||
- motionZ *= 0.99699997901916504D;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- if (minecartType == 2)
|
||||
- {
|
||||
- double d27 = MathHelper.sqrt_double(pushX * pushX + pushZ * pushZ);
|
||||
- if (d27 > 0.01D)
|
||||
- {
|
||||
- pushX /= d27;
|
||||
- pushZ /= d27;
|
||||
- double d29 = 0.040000000000000001D;
|
||||
- motionX *= 0.80000001192092896D;
|
||||
- motionY *= 0.0D;
|
||||
- motionZ *= 0.80000001192092896D;
|
||||
- motionX += pushX * d29;
|
||||
- motionZ += pushZ * d29;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- motionX *= 0.89999997615814209D;
|
||||
- motionY *= 0.0D;
|
||||
- motionZ *= 0.89999997615814209D;
|
||||
- }
|
||||
- }
|
||||
- motionX *= 0.95999997854232788D;
|
||||
- motionY *= 0.0D;
|
||||
- motionZ *= 0.95999997854232788D;
|
||||
- }
|
||||
+
|
||||
+ applyDragAndPushForces();
|
||||
+
|
||||
Vec3D vec3d1 = func_182_g(posX, posY, posZ);
|
||||
if (vec3d1 != null && vec3d != null)
|
||||
{
|
||||
@@ -476,26 +430,14 @@
|
||||
motionX = d15 * (double)(k1 - i);
|
||||
motionZ = d15 * (double)(l1 - k);
|
||||
}
|
||||
- if (minecartType == 2)
|
||||
+
|
||||
+ updatePushForces();
|
||||
+
|
||||
+ if (shouldDoRailFunctions())
|
||||
{
|
||||
- double d30 = MathHelper.sqrt_double(pushX * pushX + pushZ * pushZ);
|
||||
- if (d30 > 0.01D && motionX * motionX + motionZ * motionZ > 0.001D)
|
||||
- {
|
||||
- pushX /= d30;
|
||||
- pushZ /= d30;
|
||||
- if (pushX * motionX + pushZ * motionZ < 0.0D)
|
||||
- {
|
||||
- pushX = 0.0D;
|
||||
- pushZ = 0.0D;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- pushX = motionX;
|
||||
- pushZ = motionZ;
|
||||
- }
|
||||
- }
|
||||
+ ((BlockRail)Block.blocksList[l]).onMinecartPass(worldObj, this, i, j, k);
|
||||
}
|
||||
- if (flag)
|
||||
+ if (flag && shouldDoRailFunctions())
|
||||
{
|
||||
double d31 = Math.sqrt(motionX * motionX + motionZ * motionZ);
|
||||
if (d31 > 0.01D)
|
||||
@@ -530,35 +472,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- if (motionX < -d2)
|
||||
- {
|
||||
- motionX = -d2;
|
||||
- }
|
||||
- if (motionX > d2)
|
||||
- {
|
||||
- motionX = d2;
|
||||
- }
|
||||
- if (motionZ < -d2)
|
||||
- {
|
||||
- motionZ = -d2;
|
||||
- }
|
||||
- if (motionZ > d2)
|
||||
- {
|
||||
- motionZ = d2;
|
||||
- }
|
||||
- if (onGround)
|
||||
- {
|
||||
- motionX *= 0.5D;
|
||||
- motionY *= 0.5D;
|
||||
- motionZ *= 0.5D;
|
||||
- }
|
||||
- moveEntity(motionX, motionY, motionZ);
|
||||
- if (!onGround)
|
||||
- {
|
||||
- motionX *= 0.94999998807907104D;
|
||||
- motionY *= 0.94999998807907104D;
|
||||
- motionZ *= 0.94999998807907104D;
|
||||
- }
|
||||
+ moveMinecartOffRail(i, j, k);
|
||||
}
|
||||
rotationPitch = 0.0F;
|
||||
double d6 = prevPosX - posX;
|
||||
@@ -580,7 +494,19 @@
|
||||
field_469_aj = !field_469_aj;
|
||||
}
|
||||
setRotation(rotationYaw, rotationPitch);
|
||||
- List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D));
|
||||
+
|
||||
+ AxisAlignedBB box = null;
|
||||
+ if (getCollisionHandler() != null)
|
||||
+ {
|
||||
+ box = getCollisionHandler().getMinecartCollisionBox(this);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ box = boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D);
|
||||
+ }
|
||||
+
|
||||
+ List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, box);
|
||||
+
|
||||
if (list != null && list.size() > 0)
|
||||
{
|
||||
for (int j1 = 0; j1 < list.size(); j1++)
|
||||
@@ -600,15 +526,9 @@
|
||||
}
|
||||
riddenByEntity = null;
|
||||
}
|
||||
- if (fuel > 0)
|
||||
- {
|
||||
- fuel--;
|
||||
- }
|
||||
- if (fuel <= 0)
|
||||
- {
|
||||
- pushX = pushZ = 0.0D;
|
||||
- }
|
||||
- setMinecartPowered(fuel > 0);
|
||||
+
|
||||
+ updateFuel();
|
||||
+ ForgeHooks.onMinecartUpdate(this, i, j, k);
|
||||
}
|
||||
|
||||
public Vec3D func_182_g(double d, double d1, double d2)
|
||||
@@ -623,12 +543,8 @@
|
||||
int l = worldObj.getBlockId(i, j, k);
|
||||
if (BlockRail.isRailBlock(l))
|
||||
{
|
||||
- int i1 = worldObj.getBlockMetadata(i, j, k);
|
||||
+ int i1 = ((BlockRail)Block.blocksList[l]).getBasicRailMetadata(worldObj, this, i, j, k);
|
||||
d1 = j;
|
||||
- if (((BlockRail)Block.blocksList[l]).getIsPowered())
|
||||
- {
|
||||
- i1 &= 7;
|
||||
- }
|
||||
if (i1 >= 2 && i1 <= 5)
|
||||
{
|
||||
d1 = j + 1;
|
||||
@@ -683,13 +599,14 @@
|
||||
protected void writeEntityToNBT(NBTTagCompound nbttagcompound)
|
||||
{
|
||||
nbttagcompound.setInteger("Type", minecartType);
|
||||
- if (minecartType == 2)
|
||||
+ if (isPoweredCart())
|
||||
{
|
||||
nbttagcompound.setDouble("PushX", pushX);
|
||||
nbttagcompound.setDouble("PushZ", pushZ);
|
||||
- nbttagcompound.setShort("Fuel", (short)fuel);
|
||||
+ nbttagcompound.setInteger("Fuel", fuel);
|
||||
}
|
||||
- else if (minecartType == 1)
|
||||
+
|
||||
+ if (getSizeInventory() > 0)
|
||||
{
|
||||
NBTTagList nbttaglist = new NBTTagList();
|
||||
for (int i = 0; i < cargoItems.length; i++)
|
||||
@@ -702,7 +619,6 @@
|
||||
nbttaglist.setTag(nbttagcompound1);
|
||||
}
|
||||
}
|
||||
-
|
||||
nbttagcompound.setTag("Items", nbttaglist);
|
||||
}
|
||||
}
|
||||
@@ -710,13 +626,14 @@
|
||||
protected void readEntityFromNBT(NBTTagCompound nbttagcompound)
|
||||
{
|
||||
minecartType = nbttagcompound.getInteger("Type");
|
||||
- if (minecartType == 2)
|
||||
+ if (isPoweredCart())
|
||||
{
|
||||
pushX = nbttagcompound.getDouble("PushX");
|
||||
pushZ = nbttagcompound.getDouble("PushZ");
|
||||
- fuel = nbttagcompound.getShort("Fuel");
|
||||
+ fuel = nbttagcompound.getInteger("Fuel");
|
||||
}
|
||||
- else if (minecartType == 1)
|
||||
+
|
||||
+ if (getSizeInventory() > 0)
|
||||
{
|
||||
NBTTagList nbttaglist = nbttagcompound.getTagList("Items");
|
||||
cargoItems = new ItemStack[getSizeInventory()];
|
||||
@@ -734,6 +651,12 @@
|
||||
|
||||
public void applyEntityCollision(Entity entity)
|
||||
{
|
||||
+ ForgeHooks.onMinecartEntityCollision(this, entity);
|
||||
+ if (getCollisionHandler() != null)
|
||||
+ {
|
||||
+ getCollisionHandler().onEntityCollision(this, entity);
|
||||
+ return;
|
||||
+ }
|
||||
if (worldObj.isRemote)
|
||||
{
|
||||
return;
|
||||
@@ -742,7 +665,7 @@
|
||||
{
|
||||
return;
|
||||
}
|
||||
- if ((entity instanceof EntityLiving) && !(entity instanceof EntityPlayer) && minecartType == 0 && motionX * motionX + motionZ * motionZ > 0.01D && riddenByEntity == null && entity.ridingEntity == null)
|
||||
+ if ((entity instanceof EntityLiving) && !(entity instanceof EntityPlayer) && canBeRidden() && motionX * motionX + motionZ * motionZ > 0.01D && riddenByEntity == null && entity.ridingEntity == null)
|
||||
{
|
||||
entity.mountEntity(this);
|
||||
}
|
||||
@@ -780,7 +703,7 @@
|
||||
}
|
||||
double d7 = entity.motionX + motionX;
|
||||
double d8 = entity.motionZ + motionZ;
|
||||
- if (((EntityMinecart)entity).minecartType == 2 && minecartType != 2)
|
||||
+ if (((EntityMinecart)entity).isPoweredCart() && !isPoweredCart())
|
||||
{
|
||||
motionX *= 0.20000000298023224D;
|
||||
motionZ *= 0.20000000298023224D;
|
||||
@@ -788,7 +711,7 @@
|
||||
entity.motionX *= 0.94999998807907104D;
|
||||
entity.motionZ *= 0.94999998807907104D;
|
||||
}
|
||||
- else if (((EntityMinecart)entity).minecartType != 2 && minecartType == 2)
|
||||
+ else if (!((EntityMinecart)entity).isPoweredCart() && isPoweredCart())
|
||||
{
|
||||
entity.motionX *= 0.20000000298023224D;
|
||||
entity.motionZ *= 0.20000000298023224D;
|
||||
@@ -818,7 +741,7 @@
|
||||
|
||||
public int getSizeInventory()
|
||||
{
|
||||
- return 27;
|
||||
+ return (minecartType == 1 && getClass() == EntityMinecart.class ? 27 : 0);
|
||||
}
|
||||
|
||||
public ItemStack getStackInSlot(int i)
|
||||
@@ -874,7 +797,12 @@
|
||||
|
||||
public boolean interact(EntityPlayer entityplayer)
|
||||
{
|
||||
- if (minecartType == 0)
|
||||
+ if (!ForgeHooks.onMinecartInteract(this, entityplayer))
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ if(canBeRidden())
|
||||
{
|
||||
if (riddenByEntity != null && (riddenByEntity instanceof EntityPlayer) && riddenByEntity != entityplayer)
|
||||
{
|
||||
@@ -885,14 +813,14 @@
|
||||
entityplayer.mountEntity(this);
|
||||
}
|
||||
}
|
||||
- else if (minecartType == 1)
|
||||
+ else if (getSizeInventory() > 0)
|
||||
{
|
||||
if (!worldObj.isRemote)
|
||||
{
|
||||
entityplayer.displayGUIChest(this);
|
||||
}
|
||||
}
|
||||
- else if (minecartType == 2)
|
||||
+ else if (minecartType == 2 && getClass() == EntityMinecart.class)
|
||||
{
|
||||
ItemStack itemstack = entityplayer.inventory.getCurrentItem();
|
||||
if (itemstack != null && itemstack.itemID == Item.coal.shiftedIndex)
|
||||
@@ -918,7 +846,7 @@
|
||||
return entityplayer.getDistanceSqToEntity(this) <= 64D;
|
||||
}
|
||||
|
||||
- protected boolean isMinecartPowered()
|
||||
+ public boolean isMinecartPowered()
|
||||
{
|
||||
return (dataWatcher.getWatchableObjectByte(16) & 1) != 0;
|
||||
}
|
||||
@@ -971,5 +899,384 @@
|
||||
public int func_41021_q()
|
||||
{
|
||||
return dataWatcher.getWatchableObjectInt(18);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Carts should return their drag factor here
|
||||
+ * @return The drag rate.
|
||||
+ */
|
||||
+ protected double getDrag()
|
||||
+ {
|
||||
+ if(riddenByEntity != null)
|
||||
+ {
|
||||
+ return 0.99699997901916504D;
|
||||
+ }
|
||||
+ return 0.95999997854232788D;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Moved to allow overrides.
|
||||
+ * This code applies drag and updates push forces.
|
||||
+ */
|
||||
+ protected void applyDragAndPushForces()
|
||||
+ {
|
||||
+ if(isPoweredCart())
|
||||
+ {
|
||||
+ double d27 = MathHelper.sqrt_double(pushX * pushX + pushZ * pushZ);
|
||||
+ if(d27 > 0.01D)
|
||||
+ {
|
||||
+ pushX /= d27;
|
||||
+ pushZ /= d27;
|
||||
+ double d29 = 0.040000000000000001D;
|
||||
+ motionX *= 0.80000001192092896D;
|
||||
+ motionY *= 0.0D;
|
||||
+ motionZ *= 0.80000001192092896D;
|
||||
+ motionX += pushX * d29;
|
||||
+ motionZ += pushZ * d29;
|
||||
+ } else
|
||||
+ {
|
||||
+ motionX *= 0.89999997615814209D;
|
||||
+ motionY *= 0.0D;
|
||||
+ motionZ *= 0.89999997615814209D;
|
||||
+ }
|
||||
+ }
|
||||
+ motionX *= getDrag();
|
||||
+ motionY *= 0.0D;
|
||||
+ motionZ *= getDrag();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Moved to allow overrides.
|
||||
+ * This code updates push forces.
|
||||
+ */
|
||||
+ protected void updatePushForces()
|
||||
+ {
|
||||
+ if(isPoweredCart())
|
||||
+ {
|
||||
+ double push = MathHelper.sqrt_double(pushX * pushX + pushZ * pushZ);
|
||||
+ if(push > 0.01D && motionX * motionX + motionZ * motionZ > 0.001D)
|
||||
+ {
|
||||
+ pushX /= push;
|
||||
+ pushZ /= push;
|
||||
+ if(pushX * motionX + pushZ * motionZ < 0.0D)
|
||||
+ {
|
||||
+ pushX = 0.0D;
|
||||
+ pushZ = 0.0D;
|
||||
+ } else
|
||||
+ {
|
||||
+ pushX = motionX;
|
||||
+ pushZ = motionZ;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Moved to allow overrides.
|
||||
+ * This code handles minecart movement and speed capping when on a rail.
|
||||
+ */
|
||||
+ protected void moveMinecartOnRail(int i, int j, int k)
|
||||
+ {
|
||||
+ int id = worldObj.getBlockId(i, j, k);
|
||||
+ if (!BlockRail.isRailBlock(id))
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
+ float railMaxSpeed = ((BlockRail)Block.blocksList[id]).getRailMaxSpeed(worldObj, this, i, j, k);
|
||||
+
|
||||
+ double maxSpeed = Math.min(railMaxSpeed, getMaxSpeedRail());
|
||||
+ double d23 = motionX;
|
||||
+ double d25 = motionZ;
|
||||
+ if(riddenByEntity != null)
|
||||
+ {
|
||||
+ d23 *= 0.75D;
|
||||
+ d25 *= 0.75D;
|
||||
+ }
|
||||
+ if(d23 < -maxSpeed)
|
||||
+ {
|
||||
+ d23 = -maxSpeed;
|
||||
+ }
|
||||
+ if(d23 > maxSpeed)
|
||||
+ {
|
||||
+ d23 = maxSpeed;
|
||||
+ }
|
||||
+ if(d25 < -maxSpeed)
|
||||
+ {
|
||||
+ d25 = -maxSpeed;
|
||||
+ }
|
||||
+ if(d25 > maxSpeed)
|
||||
+ {
|
||||
+ d25 = maxSpeed;
|
||||
+ }
|
||||
+ moveEntity(d23, 0.0D, d25);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Moved to allow overrides.
|
||||
+ * This code handles minecart movement and speed capping when not on a rail.
|
||||
+ */
|
||||
+ protected void moveMinecartOffRail(int i, int j, int k)
|
||||
+ {
|
||||
+ double d2 = getMaxSpeedGround();
|
||||
+ if(!onGround)
|
||||
+ {
|
||||
+ d2 = getMaxSpeedAirLateral();
|
||||
+ }
|
||||
+ if(motionX < -d2)
|
||||
+ {
|
||||
+ motionX = -d2;
|
||||
+ }
|
||||
+ if(motionX > d2)
|
||||
+ {
|
||||
+ motionX = d2;
|
||||
+ }
|
||||
+ if(motionZ < -d2)
|
||||
+ {
|
||||
+ motionZ = -d2;
|
||||
+ }
|
||||
+ if(motionZ > d2)
|
||||
+ {
|
||||
+ motionZ = d2;
|
||||
+ }
|
||||
+ double moveY = motionY;
|
||||
+ if(getMaxSpeedAirVertical() > 0 && motionY > getMaxSpeedAirVertical())
|
||||
+ {
|
||||
+ moveY = getMaxSpeedAirVertical();
|
||||
+ if(Math.abs(motionX) < 0.3f && Math.abs(motionZ) < 0.3f)
|
||||
+ {
|
||||
+ moveY = 0.15f;
|
||||
+ motionY = moveY;
|
||||
+ }
|
||||
+ }
|
||||
+ if(onGround)
|
||||
+ {
|
||||
+ motionX *= 0.5D;
|
||||
+ motionY *= 0.5D;
|
||||
+ motionZ *= 0.5D;
|
||||
+ }
|
||||
+ moveEntity(motionX, moveY, motionZ);
|
||||
+ if(!onGround)
|
||||
+ {
|
||||
+ motionX *= getDragAir();
|
||||
+ motionY *= getDragAir();
|
||||
+ motionZ *= getDragAir();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Moved to allow overrides.
|
||||
+ * This code applies fuel consumption.
|
||||
+ */
|
||||
+ protected void updateFuel()
|
||||
+ {
|
||||
+ if(fuel > 0)
|
||||
+ {
|
||||
+ fuel--;
|
||||
+ }
|
||||
+ if(fuel <= 0)
|
||||
+ {
|
||||
+ pushX = pushZ = 0.0D;
|
||||
+ }
|
||||
+ setMinecartPowered(fuel > 0);
|
||||
+ }
|
||||
+
|
||||
+
|
||||
+ /**
|
||||
+ * Drops the cart as a item. The exact item dropped is defined by getItemDropped().
|
||||
+ */
|
||||
+ public void dropCartAsItem()
|
||||
+ {
|
||||
+ for(ItemStack item : getItemsDropped())
|
||||
+ {
|
||||
+ entityDropItem(item, 0);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Override this to define which items your cart drops when broken.
|
||||
+ * This does not include items contained in the inventory,
|
||||
+ * that is handled elsewhere.
|
||||
+ * @return A list of items dropped.
|
||||
+ */
|
||||
+ public List<ItemStack> getItemsDropped()
|
||||
+ {
|
||||
+ List<ItemStack> items = new ArrayList<ItemStack>();
|
||||
+ items.add(new ItemStack(Item.minecartEmpty));
|
||||
+
|
||||
+ switch(minecartType)
|
||||
+ {
|
||||
+ case 1:
|
||||
+ items.add(new ItemStack(Block.chest));
|
||||
+ break;
|
||||
+ case 2:
|
||||
+ items.add(new ItemStack(Block.stoneOvenIdle));
|
||||
+ break;
|
||||
+ }
|
||||
+ return items;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * This function returns an ItemStack that represents this cart.
|
||||
+ * This should be an ItemStack that can be used by the player to place the cart.
|
||||
+ * This is the item that was registered with the cart via the registerMinecart function,
|
||||
+ * but is not necessary the item the cart drops when destroyed.
|
||||
+ * @return An ItemStack that can be used to place the cart.
|
||||
+ */
|
||||
+ public ItemStack getCartItem()
|
||||
+ {
|
||||
+ return MinecraftForge.getItemForCart(this);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if this cart is self propelled.
|
||||
+ * @return True if powered.
|
||||
+ */
|
||||
+ public boolean isPoweredCart()
|
||||
+ {
|
||||
+ return minecartType == 2 && getClass() == EntityMinecart.class;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if this cart is a storage cart
|
||||
+ * Some carts may have inventories but not be storage carts
|
||||
+ * and some carts without inventories may be storage carts.
|
||||
+ * @return True if this cart should be classified as a storage cart.
|
||||
+ */
|
||||
+ public boolean isStorageCart()
|
||||
+ {
|
||||
+ return minecartType == 1 && getClass() == EntityMinecart.class;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if this cart can be ridden by an Entity.
|
||||
+ * @return True if this cart can be ridden.
|
||||
+ */
|
||||
+ public boolean canBeRidden()
|
||||
+ {
|
||||
+ if(minecartType == 0 && getClass() == EntityMinecart.class)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Returns true if this cart can currently use rails.
|
||||
+ * This function is mainly used to gracefully detach a minecart from a rail.
|
||||
+ * @return True if the minecart can use rails.
|
||||
+ */
|
||||
+ public boolean canUseRail()
|
||||
+ {
|
||||
+ return canUseRail;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Set whether the minecart can use rails.
|
||||
+ * This function is mainly used to gracefully detach a minecart from a rail.
|
||||
+ * @param use Whether the minecart can currently use rails.
|
||||
+ */
|
||||
+ public void setCanUseRail(boolean use)
|
||||
+ {
|
||||
+ canUseRail = use;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return false if this cart should not call IRail.onMinecartPass() and should ignore Powered Rails.
|
||||
+ * @return True if this cart should call IRail.onMinecartPass().
|
||||
+ */
|
||||
+ public boolean shouldDoRailFunctions()
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Simply returns the minecartType variable.
|
||||
+ * @return minecartType
|
||||
+ */
|
||||
+ public int getMinecartType()
|
||||
+ {
|
||||
+ return minecartType;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the current global Minecart Collision handler if none
|
||||
+ * is registered, returns null
|
||||
+ * @return The collision handler or null
|
||||
+ */
|
||||
+ public static IMinecartCollisionHandler getCollisionHandler()
|
||||
+ {
|
||||
+ return collisionHandler;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sets the global Minecart Collision handler, overwrites any
|
||||
+ * that is currently set.
|
||||
+ * @param handler The new handler
|
||||
+ */
|
||||
+ public static void setCollisionHandler(IMinecartCollisionHandler handler)
|
||||
+ {
|
||||
+ collisionHandler = handler;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Getters/setters for physics variables
|
||||
+ */
|
||||
+
|
||||
+ /**
|
||||
+ * Returns the carts max speed.
|
||||
+ * Carts going faster than 1.1 cause issues with chunk loading.
|
||||
+ * Carts cant traverse slopes or corners at greater than 0.5 - 0.6.
|
||||
+ * This value is compared with the rails max speed to determine
|
||||
+ * the carts current max speed. A normal rails max speed is 0.4.
|
||||
+ * @return Carts max speed.
|
||||
+ */
|
||||
+ public float getMaxSpeedRail()
|
||||
+ {
|
||||
+ return maxSpeedRail;
|
||||
+ }
|
||||
+
|
||||
+ public void setMaxSpeedRail(float value)
|
||||
+ {
|
||||
+ maxSpeedRail = value;
|
||||
+ }
|
||||
+
|
||||
+ public float getMaxSpeedGround()
|
||||
+ {
|
||||
+ return maxSpeedGround;
|
||||
+ }
|
||||
+
|
||||
+ public void setMaxSpeedGround(float value)
|
||||
+ {
|
||||
+ maxSpeedGround = value;
|
||||
+ }
|
||||
+
|
||||
+ public float getMaxSpeedAirLateral()
|
||||
+ {
|
||||
+ return maxSpeedAirLateral;
|
||||
+ }
|
||||
+
|
||||
+ public void setMaxSpeedAirLateral(float value)
|
||||
+ {
|
||||
+ maxSpeedAirLateral = value;
|
||||
+ }
|
||||
+
|
||||
+ public float getMaxSpeedAirVertical()
|
||||
+ {
|
||||
+ return maxSpeedAirVertical;
|
||||
+ }
|
||||
+
|
||||
+ public void setMaxSpeedAirVertical(float value)
|
||||
+ {
|
||||
+ maxSpeedAirVertical = value;
|
||||
+ }
|
||||
+
|
||||
+ public double getDragAir()
|
||||
+ {
|
||||
+ return dragAir;
|
||||
+ }
|
||||
+
|
||||
+ public void setDragAir(double value)
|
||||
+ {
|
||||
+ dragAir = value;
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/EntityPlayerMP.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/EntityPlayerMP.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -405,6 +405,7 @@
|
||||
public void displayWorkbenchGUI(int i, int j, int k)
|
||||
{
|
||||
getNextWidowId();
|
||||
+ closeCraftingGui();
|
||||
playerNetServerHandler.sendPacket(new Packet100OpenWindow(currentWindowId, 1, "Crafting", 9));
|
||||
currentCraftingInventory = new ContainerWorkbench(inventory, worldObj, i, j, k);
|
||||
currentCraftingInventory.windowId = currentWindowId;
|
||||
@@ -414,6 +415,7 @@
|
||||
public void displayGUIEnchantment(int i, int j, int k)
|
||||
{
|
||||
getNextWidowId();
|
||||
+ closeCraftingGui();
|
||||
playerNetServerHandler.sendPacket(new Packet100OpenWindow(currentWindowId, 4, "Enchanting", 9));
|
||||
currentCraftingInventory = new ContainerEnchantment(inventory, worldObj, i, j, k);
|
||||
currentCraftingInventory.windowId = currentWindowId;
|
||||
@@ -423,6 +425,7 @@
|
||||
public void displayGUIChest(IInventory iinventory)
|
||||
{
|
||||
getNextWidowId();
|
||||
+ closeCraftingGui();
|
||||
playerNetServerHandler.sendPacket(new Packet100OpenWindow(currentWindowId, 0, iinventory.getInvName(), iinventory.getSizeInventory()));
|
||||
currentCraftingInventory = new ContainerChest(inventory, iinventory);
|
||||
currentCraftingInventory.windowId = currentWindowId;
|
||||
@@ -432,6 +435,7 @@
|
||||
public void displayGUIFurnace(TileEntityFurnace tileentityfurnace)
|
||||
{
|
||||
getNextWidowId();
|
||||
+ closeCraftingGui();
|
||||
playerNetServerHandler.sendPacket(new Packet100OpenWindow(currentWindowId, 2, tileentityfurnace.getInvName(), tileentityfurnace.getSizeInventory()));
|
||||
currentCraftingInventory = new ContainerFurnace(inventory, tileentityfurnace);
|
||||
currentCraftingInventory.windowId = currentWindowId;
|
||||
@@ -441,6 +445,7 @@
|
||||
public void displayGUIDispenser(TileEntityDispenser tileentitydispenser)
|
||||
{
|
||||
getNextWidowId();
|
||||
+ closeCraftingGui();
|
||||
playerNetServerHandler.sendPacket(new Packet100OpenWindow(currentWindowId, 3, tileentitydispenser.getInvName(), tileentitydispenser.getSizeInventory()));
|
||||
currentCraftingInventory = new ContainerDispenser(inventory, tileentitydispenser);
|
||||
currentCraftingInventory.windowId = currentWindowId;
|
||||
@@ -450,6 +455,7 @@
|
||||
public void displayGUIBrewingStand(TileEntityBrewingStand tileentitybrewingstand)
|
||||
{
|
||||
getNextWidowId();
|
||||
+ closeCraftingGui();
|
||||
playerNetServerHandler.sendPacket(new Packet100OpenWindow(currentWindowId, 5, tileentitybrewingstand.getInvName(), tileentitybrewingstand.getSizeInventory()));
|
||||
currentCraftingInventory = new ContainerBrewingStand(inventory, tileentitybrewingstand);
|
||||
currentCraftingInventory.windowId = currentWindowId;
|
||||
@@ -1,138 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/Item.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/Item.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.io.PrintStream;
|
||||
+import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
public class Item
|
||||
@@ -156,6 +157,9 @@
|
||||
private String potionInfo;
|
||||
private String itemName;
|
||||
|
||||
+ // FORGE: To disable repair recipes.
|
||||
+ protected boolean canRepair = true;
|
||||
+
|
||||
protected Item(int i)
|
||||
{
|
||||
maxStackSize = 64;
|
||||
@@ -389,10 +393,117 @@
|
||||
float f8 = f6;
|
||||
float f9 = f3 * f5;
|
||||
double d3 = 5D;
|
||||
+ if (entityplayer instanceof EntityPlayerMP)
|
||||
+ {
|
||||
+ d3 = ((EntityPlayerMP)entityplayer).itemInWorldManager.getBlockReachDistance();
|
||||
+ }
|
||||
Vec3D vec3d1 = vec3d.addVector((double)f7 * d3, (double)f8 * d3, (double)f9 * d3);
|
||||
MovingObjectPosition movingobjectposition = world.rayTraceBlocks_do_do(vec3d, vec3d1, flag, !flag);
|
||||
return movingobjectposition;
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * Called when a new CreativeContainer is opened, populate the list
|
||||
+ * with all of the items for this item you want a player in creative mode
|
||||
+ * to have access to.
|
||||
+ *
|
||||
+ * @param itemList The list of items currently in the creative inventory
|
||||
+ */
|
||||
+ public void addCreativeItems(ArrayList itemList)
|
||||
+ {
|
||||
+ if (this.shiftedIndex != Item.potion.shiftedIndex && this.shiftedIndex != Item.monsterPlacer.shiftedIndex)
|
||||
+ {
|
||||
+ itemList.add(new ItemStack(this, 1));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Called when a player drops the item into the world,
|
||||
+ * returning false from this will prevent the item from
|
||||
+ * being removed from the players inventory and spawning
|
||||
+ * in the world
|
||||
+ *
|
||||
+ * @param player The player that dropped the item
|
||||
+ * @param item The item stack, before the item is removed.
|
||||
+ */
|
||||
+ public boolean onDroppedByPlayer(ItemStack item, EntityPlayer player)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * This is called when the item is used, before the block is activated.
|
||||
+ * @param stack The Item Stack
|
||||
+ * @param player The Player that used the item
|
||||
+ * @param world The Current World
|
||||
+ * @param X Target X Position
|
||||
+ * @param Y Target Y Position
|
||||
+ * @param Z Target Z Position
|
||||
+ * @param side The side of the target hit
|
||||
+ * @return Return true to prevent any further processing.
|
||||
+ */
|
||||
+ public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int X, int Y, int Z, int side)
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Metadata-sensitive version of getStrVsBlock
|
||||
+ * @param itemstack The Item Stack
|
||||
+ * @param block The block the item is trying to break
|
||||
+ * @param metadata The items current metadata
|
||||
+ * @return The damage strength
|
||||
+ */
|
||||
+ public float getStrVsBlock(ItemStack itemstack, Block block, int metadata)
|
||||
+ {
|
||||
+ return getStrVsBlock(itemstack, block);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Called by CraftingManager to determine if an item is reparable.
|
||||
+ * @return True if reparable
|
||||
+ */
|
||||
+ public boolean isRepairable()
|
||||
+ {
|
||||
+ return canRepair && isDamageable();
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Call to disable repair recipes.
|
||||
+ * @return The current Item instance
|
||||
+ */
|
||||
+ public Item setNoRepair()
|
||||
+ {
|
||||
+ canRepair = false;
|
||||
+ return this;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Called before a block is broken. Return true to prevent default block harvesting.
|
||||
+ *
|
||||
+ * Note: In SMP, this is called on both client and server sides!
|
||||
+ *
|
||||
+ * @param itemstack The current ItemStack
|
||||
+ * @param X The X Position
|
||||
+ * @param Y The X Position
|
||||
+ * @param Z The X Position
|
||||
+ * @param player The Player that is wielding the item
|
||||
+ * @return True to prevent harvesting, false to continue as normal
|
||||
+ */
|
||||
+ public boolean onBlockStartBreak(ItemStack itemstack, int X, int Y, int Z, EntityPlayer player)
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Called each tick while using an item.
|
||||
+ * @param stack The Item being used
|
||||
+ * @param player The Player using the item
|
||||
+ * @param count The amount of time in tick the item has been used for continuously
|
||||
+ */
|
||||
+ public void onUsingItemTick(ItemStack stack, EntityPlayer player, int count)
|
||||
+ {
|
||||
+ }
|
||||
|
||||
public int getItemEnchantability()
|
||||
{
|
||||
@@ -1,23 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/ItemBucket.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/ItemBucket.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
+import net.minecraft.src.forge.MinecraftForge;
|
||||
+
|
||||
public class ItemBucket extends Item
|
||||
{
|
||||
private int isFull;
|
||||
@@ -36,6 +38,11 @@
|
||||
}
|
||||
if (isFull == 0)
|
||||
{
|
||||
+ ItemStack customBucket = MinecraftForge.fillCustomBucket(world, i, j, k);
|
||||
+ if (customBucket != null)
|
||||
+ {
|
||||
+ return customBucket;
|
||||
+ }
|
||||
if (!entityplayer.canPlayerEdit(i, j, k))
|
||||
{
|
||||
return itemstack;
|
||||
@@ -1,132 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/ItemInWorldManager.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/ItemInWorldManager.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -1,7 +1,10 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
+import net.minecraft.src.forge.ForgeHooks;
|
||||
+
|
||||
public class ItemInWorldManager
|
||||
{
|
||||
+ private double blockReachDistance;
|
||||
public World thisWorld;
|
||||
public EntityPlayer thisPlayer;
|
||||
private int gameType;
|
||||
@@ -71,7 +74,7 @@
|
||||
if (j != 0)
|
||||
{
|
||||
Block block = Block.blocksList[j];
|
||||
- float f = block.blockStrength(thisPlayer) * (float)(i + 1);
|
||||
+ float f = block.blockStrength(thisWorld, thisPlayer, field_22049_l, field_22048_m, field_22047_n) * (float)(i + 1);
|
||||
if (f >= 1.0F)
|
||||
{
|
||||
field_22050_k = false;
|
||||
@@ -99,7 +102,7 @@
|
||||
{
|
||||
Block.blocksList[i1].onBlockClicked(thisWorld, i, j, k, thisPlayer);
|
||||
}
|
||||
- if (i1 > 0 && Block.blocksList[i1].blockStrength(thisPlayer) >= 1.0F)
|
||||
+ if (i1 > 0 && Block.blocksList[i1].blockStrength(thisWorld, thisPlayer, i, j, k) >= 1.0F)
|
||||
{
|
||||
blockHarvessted(i, j, k);
|
||||
}
|
||||
@@ -120,7 +123,7 @@
|
||||
if (i1 != 0)
|
||||
{
|
||||
Block block = Block.blocksList[i1];
|
||||
- float f = block.blockStrength(thisPlayer) * (float)(l + 1);
|
||||
+ float f = block.blockStrength(thisWorld, thisPlayer, i, j, k) * (float)(l + 1);
|
||||
if (f >= 0.7F)
|
||||
{
|
||||
blockHarvessted(i, j, k);
|
||||
@@ -142,8 +145,13 @@
|
||||
{
|
||||
Block block = Block.blocksList[thisWorld.getBlockId(i, j, k)];
|
||||
int l = thisWorld.getBlockMetadata(i, j, k);
|
||||
- boolean flag = thisWorld.setBlockWithNotify(i, j, k, 0);
|
||||
- if (block != null && flag)
|
||||
+
|
||||
+ if (block == null)
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ boolean flag = block.removeBlockByPlayer(thisWorld, thisPlayer, i, j, k);
|
||||
+ if (flag)
|
||||
{
|
||||
block.onBlockDestroyedByPlayer(thisWorld, i, j, k, l);
|
||||
}
|
||||
@@ -152,6 +160,11 @@
|
||||
|
||||
public boolean blockHarvessted(int i, int j, int k)
|
||||
{
|
||||
+ ItemStack itemstack = thisPlayer.getCurrentEquippedItem();
|
||||
+ if (itemstack != null && itemstack.getItem().onBlockStartBreak(itemstack, i, j, k, thisPlayer))
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
int l = thisWorld.getBlockId(i, j, k);
|
||||
int i1 = thisWorld.getBlockMetadata(i, j, k);
|
||||
thisWorld.playAuxSFXAtEntity(thisPlayer, 2001, i, j, k, l + thisWorld.getBlockMetadata(i, j, k) * 256);
|
||||
@@ -162,8 +175,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- ItemStack itemstack = thisPlayer.getCurrentEquippedItem();
|
||||
- boolean flag1 = thisPlayer.canHarvestBlock(Block.blocksList[l]);
|
||||
+ boolean flag1 = Block.blocksList[l].canHarvestBlock(thisPlayer, i1);
|
||||
if (itemstack != null)
|
||||
{
|
||||
itemstack.onDestroyBlock(l, i, j, k, thisPlayer);
|
||||
@@ -197,6 +209,7 @@
|
||||
if (itemstack1.stackSize == 0)
|
||||
{
|
||||
entityplayer.inventory.mainInventory[entityplayer.inventory.currentItem] = null;
|
||||
+ ForgeHooks.onDestroyCurrentItem(entityplayer,itemstack1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -208,6 +221,14 @@
|
||||
|
||||
public boolean activeBlockOrUseItem(EntityPlayer entityplayer, World world, ItemStack itemstack, int i, int j, int k, int l)
|
||||
{
|
||||
+ if (itemstack != null)
|
||||
+ {
|
||||
+ Item item = itemstack.getItem();
|
||||
+ if (item.onItemUseFirst(itemstack, entityplayer, world, i, j, k, l))
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
int i1 = world.getBlockId(i, j, k);
|
||||
if (i1 > 0 && Block.blocksList[i1].blockActivated(world, i, j, k, entityplayer))
|
||||
{
|
||||
@@ -228,7 +249,15 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- return itemstack.useItem(entityplayer, world, i, j, k, l);
|
||||
+ if (!itemstack.useItem(entityplayer, world, i, j, k, l))
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ if (itemstack.stackSize == 0)
|
||||
+ {
|
||||
+ ForgeHooks.onDestroyCurrentItem(entityplayer,itemstack);
|
||||
+ }
|
||||
+ return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,4 +265,13 @@
|
||||
{
|
||||
thisWorld = worldserver;
|
||||
}
|
||||
+
|
||||
+ public double getBlockReachDistance()
|
||||
+ {
|
||||
+ return blockReachDistance;
|
||||
+ }
|
||||
+ public void setBlockReachDistance(double distance)
|
||||
+ {
|
||||
+ blockReachDistance = distance;
|
||||
+ }
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/ModLoader.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/ModLoader.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -1317,6 +1317,7 @@
|
||||
{
|
||||
method_getNextWindowId.invoke(entityplayermp, new Object[0]);
|
||||
int j = field_currentWindowId.getInt(entityplayermp);
|
||||
+ entityplayermp.closeCraftingGui();
|
||||
entityplayermp.playerNetServerHandler.sendPacket(new Packet100OpenWindow(j, i, iinventory.getInvName(), iinventory.getSizeInventory()));
|
||||
entityplayermp.currentCraftingInventory = container;
|
||||
entityplayermp.currentCraftingInventory.windowId = j;
|
||||
@@ -1,24 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/NetServerHandler.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/NetServerHandler.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -295,7 +295,9 @@
|
||||
double d1 = (playerEntity.posY - ((double)j + 0.5D)) + 1.5D;
|
||||
double d3 = playerEntity.posZ - ((double)k + 0.5D);
|
||||
double d5 = d * d + d1 * d1 + d3 * d3;
|
||||
- if (d5 > 36D)
|
||||
+ double dist = playerEntity.itemInWorldManager.getBlockReachDistance() + 1;
|
||||
+ dist *= dist;
|
||||
+ if (d5 > dist)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -366,7 +368,9 @@
|
||||
{
|
||||
j1 = i1;
|
||||
}
|
||||
- if (hasMoved && playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < 64D && (j1 > 16 || flag))
|
||||
+ double dist = playerEntity.itemInWorldManager.getBlockReachDistance() + 3;
|
||||
+ dist *= dist;
|
||||
+ if (hasMoved && playerEntity.getDistanceSq((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D) < dist && (j1 > 16 || flag))
|
||||
{
|
||||
playerEntity.itemInWorldManager.activeBlockOrUseItem(playerEntity, worldserver, itemstack, i, j, k, l);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/Packet250CustomPayload.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/Packet250CustomPayload.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -20,7 +20,7 @@
|
||||
if (length > 0 && length < 32767)
|
||||
{
|
||||
data = new byte[length];
|
||||
- datainputstream.read(data);
|
||||
+ datainputstream.readFully(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/RailLogic.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/RailLogic.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -3,7 +3,7 @@
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
-class RailLogic
|
||||
+public class RailLogic
|
||||
{
|
||||
private World worldObj;
|
||||
private int trackX;
|
||||
@@ -12,6 +12,7 @@
|
||||
private final boolean isPoweredRail;
|
||||
private List connectedTracks;
|
||||
final BlockRail rail;
|
||||
+ private final boolean canMakeSlopes;
|
||||
|
||||
public RailLogic(BlockRail blockrail, World world, int i, int j, int k)
|
||||
{
|
||||
@@ -23,16 +24,12 @@
|
||||
trackY = j;
|
||||
trackZ = k;
|
||||
int l = world.getBlockId(i, j, k);
|
||||
- int i1 = world.getBlockMetadata(i, j, k);
|
||||
- if (BlockRail.isPoweredBlockRail((BlockRail)Block.blocksList[l]))
|
||||
- {
|
||||
- isPoweredRail = true;
|
||||
- i1 &= -9;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- isPoweredRail = false;
|
||||
- }
|
||||
+
|
||||
+ BlockRail target = (BlockRail)Block.blocksList[l];
|
||||
+ int i1 = target.getBasicRailMetadata(world, null, i, j, k);
|
||||
+ isPoweredRail = !target.isFlexibleRail(world, i, j, k);
|
||||
+ canMakeSlopes = target.canMakeSlopes(world, i, j, k);
|
||||
+
|
||||
setConnections(i1);
|
||||
}
|
||||
|
||||
@@ -243,7 +240,7 @@
|
||||
byte0 = 9;
|
||||
}
|
||||
}
|
||||
- if (byte0 == 0)
|
||||
+ if (byte0 == 0 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRail.isRailBlockAt(worldObj, trackX, trackY + 1, trackZ - 1))
|
||||
{
|
||||
@@ -254,7 +251,7 @@
|
||||
byte0 = 5;
|
||||
}
|
||||
}
|
||||
- if (byte0 == 1)
|
||||
+ if (byte0 == 1 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRail.isRailBlockAt(worldObj, trackX + 1, trackY + 1, trackZ))
|
||||
{
|
||||
@@ -377,7 +374,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
- if (byte0 == 0)
|
||||
+ if (byte0 == 0 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRail.isRailBlockAt(worldObj, trackX, trackY + 1, trackZ - 1))
|
||||
{
|
||||
@@ -388,7 +385,7 @@
|
||||
byte0 = 5;
|
||||
}
|
||||
}
|
||||
- if (byte0 == 1)
|
||||
+ if (byte0 == 1 && canMakeSlopes)
|
||||
{
|
||||
if (BlockRail.isRailBlockAt(worldObj, trackX + 1, trackY + 1, trackZ))
|
||||
{
|
||||
@@ -428,7 +425,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- static int getNAdjacentTracks(RailLogic raillogic)
|
||||
+ public static int getNAdjacentTracks(RailLogic raillogic)
|
||||
{
|
||||
return raillogic.getAdjacentTracks();
|
||||
}
|
||||
@@ -1,217 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/World.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/World.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -33,7 +33,7 @@
|
||||
public int lightningFlash;
|
||||
public boolean editingBlocks;
|
||||
private long lockTimestamp;
|
||||
- protected int autosavePeriod;
|
||||
+ public int autosavePeriod;
|
||||
public int difficultySetting;
|
||||
public Random rand;
|
||||
public boolean isNewWorld;
|
||||
@@ -236,7 +236,13 @@
|
||||
|
||||
public boolean isAirBlock(int i, int j, int k)
|
||||
{
|
||||
- return getBlockId(i, j, k) == 0;
|
||||
+ int iBlockID = getBlockId(i, j, k);
|
||||
+
|
||||
+ if (iBlockID == 0)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+ return Block.blocksList[iBlockID].isAirBlock(this, i, j, k);
|
||||
}
|
||||
|
||||
public boolean blockExists(int i, int j, int k)
|
||||
@@ -1205,7 +1211,7 @@
|
||||
Chunk chunk = getChunkFromChunkCoords(tileentity.xCoord >> 4, tileentity.zCoord >> 4);
|
||||
if (chunk != null)
|
||||
{
|
||||
- chunk.removeChunkBlockTileEntity(tileentity.xCoord & 0xf, tileentity.yCoord, tileentity.zCoord & 0xf);
|
||||
+ chunk.cleanChunkBlockTileEntity(tileentity.xCoord & 0xf, tileentity.yCoord, tileentity.zCoord & 0xf);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1234,12 +1240,15 @@
|
||||
{
|
||||
loadedTileEntityList.add(tileentity1);
|
||||
}
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
if (chunkExists(tileentity1.xCoord >> 4, tileentity1.zCoord >> 4))
|
||||
{
|
||||
Chunk chunk1 = getChunkFromChunkCoords(tileentity1.xCoord >> 4, tileentity1.zCoord >> 4);
|
||||
if (chunk1 != null)
|
||||
{
|
||||
- chunk1.setChunkBlockTileEntity(tileentity1.xCoord & 0xf, tileentity1.yCoord, tileentity1.zCoord & 0xf, tileentity1);
|
||||
+ chunk1.cleanChunkBlockTileEntity(tileentity1.xCoord & 0xf, tileentity1.yCoord, tileentity1.zCoord & 0xf);
|
||||
}
|
||||
}
|
||||
markBlockNeedsUpdate(tileentity1.xCoord, tileentity1.yCoord, tileentity1.zCoord);
|
||||
@@ -1254,13 +1263,13 @@
|
||||
|
||||
public void addTileEntity(Collection collection)
|
||||
{
|
||||
- if (scanningTileEntities)
|
||||
+ List dest = scanningTileEntities ? addedTileEntityList : loadedTileEntityList;
|
||||
+ for(Object entity : collection)
|
||||
{
|
||||
- addedTileEntityList.addAll(collection);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- loadedTileEntityList.addAll(collection);
|
||||
+ if(((TileEntity)entity).canUpdate())
|
||||
+ {
|
||||
+ dest.add(entity);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1460,6 +1469,13 @@
|
||||
if (j2 == Block.fire.blockID || j2 == Block.lavaMoving.blockID || j2 == Block.lavaStill.blockID)
|
||||
{
|
||||
return true;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if (j2 > 0 && Block.blocksList[j2].isBlockBurning(this, k1, l1, i2))
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1690,47 +1706,28 @@
|
||||
|
||||
public void setBlockTileEntity(int i, int j, int k, TileEntity tileentity)
|
||||
{
|
||||
- if (tileentity != null && !tileentity.isInvalid())
|
||||
+ if (tileentity == null || tileentity.isInvalid())
|
||||
{
|
||||
- if (scanningTileEntities)
|
||||
- {
|
||||
- tileentity.xCoord = i;
|
||||
- tileentity.yCoord = j;
|
||||
- tileentity.zCoord = k;
|
||||
- addedTileEntityList.add(tileentity);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- loadedTileEntityList.add(tileentity);
|
||||
- Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4);
|
||||
- if (chunk != null)
|
||||
- {
|
||||
- chunk.setChunkBlockTileEntity(i & 0xf, j, k & 0xf, tileentity);
|
||||
- }
|
||||
- }
|
||||
+ return;
|
||||
+ }
|
||||
+ List dest = scanningTileEntities ? addedTileEntityList : loadedTileEntityList;
|
||||
+ if (tileentity.canUpdate())
|
||||
+ {
|
||||
+ dest.add(tileentity);
|
||||
+ }
|
||||
+ Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4);
|
||||
+ if (chunk != null)
|
||||
+ {
|
||||
+ chunk.setChunkBlockTileEntity(i & 0xf, j, k & 0xf, tileentity);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeBlockTileEntity(int i, int j, int k)
|
||||
{
|
||||
- TileEntity tileentity = getBlockTileEntity(i, j, k);
|
||||
- if (tileentity != null && scanningTileEntities)
|
||||
+ Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4);
|
||||
+ if (chunk != null)
|
||||
{
|
||||
- tileentity.invalidate();
|
||||
- addedTileEntityList.remove(tileentity);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- if (tileentity != null)
|
||||
- {
|
||||
- addedTileEntityList.remove(tileentity);
|
||||
- loadedTileEntityList.remove(tileentity);
|
||||
- }
|
||||
- Chunk chunk = getChunkFromChunkCoords(i >> 4, k >> 4);
|
||||
- if (chunk != null)
|
||||
- {
|
||||
- chunk.removeChunkBlockTileEntity(i & 0xf, j, k & 0xf);
|
||||
- }
|
||||
+ chunk.removeChunkBlockTileEntity(i & 0xf, j, k & 0xf);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1761,7 +1758,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- return block.blockMaterial.getIsOpaque() && block.renderAsNormalBlock();
|
||||
+ return block.isBlockNormalCube(this, i, j, k);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2179,7 +2176,7 @@
|
||||
|
||||
private int computeBlockLightValue(int i, int j, int k, int l, int i1, int j1)
|
||||
{
|
||||
- int k1 = Block.lightValue[i1];
|
||||
+ int k1 = (i1 == 0 || Block.blocksList[i1] == null ? 0 : Block.blocksList[i1].getLightValue(this, j, k, l));
|
||||
int l1 = getSavedLightValue(EnumSkyBlock.Block, j - 1, k, l) - j1;
|
||||
int i2 = getSavedLightValue(EnumSkyBlock.Block, j + 1, k, l) - j1;
|
||||
int j2 = getSavedLightValue(EnumSkyBlock.Block, j, k - 1, l) - j1;
|
||||
@@ -2557,6 +2554,10 @@
|
||||
{
|
||||
block = null;
|
||||
}
|
||||
+ if (block != null && block.isBlockReplaceable(this, j, k, l))
|
||||
+ {
|
||||
+ block = null;
|
||||
+ }
|
||||
return i > 0 && block == null && block1.canPlaceBlockOnSide(this, j, k, l, i1);
|
||||
}
|
||||
|
||||
@@ -3028,4 +3029,38 @@
|
||||
{
|
||||
return getChunkProvider().func_40182_a(this, s, i, j, k);
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * Adds a single TileEntity to the world.
|
||||
+ * TODO: Eloraam fully describe the bug this fixes.
|
||||
+ * @param entity The TileEntity to be added.
|
||||
+ */
|
||||
+ public void addTileEntity(TileEntity entity)
|
||||
+ {
|
||||
+ List dest = scanningTileEntities ? addedTileEntityList : loadedTileEntityList;
|
||||
+ if(entity.canUpdate())
|
||||
+ {
|
||||
+ dest.add(entity);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Determine if the given block is considered solid on the
|
||||
+ * specified side. Used by placement logic.
|
||||
+ *
|
||||
+ * @param X Block X Position
|
||||
+ * @param Y Block Y Position
|
||||
+ * @param Z Block Z Position
|
||||
+ * @param side The Side in question
|
||||
+ * @return True if the side is solid
|
||||
+ */
|
||||
+ public boolean isBlockSolidOnSide(int X, int Y, int Z, int side)
|
||||
+ {
|
||||
+ Block block = Block.blocksList[getBlockId(X, Y, Z)];
|
||||
+ if(block == null)
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ return block.isBlockSolidOnSide(this, X, Y, Z, side);
|
||||
+ }
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/WorldServer.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/WorldServer.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -54,15 +54,30 @@
|
||||
public List getTileEntityList(int i, int j, int k, int l, int i1, int j1)
|
||||
{
|
||||
ArrayList arraylist = new ArrayList();
|
||||
- for (int k1 = 0; k1 < loadedTileEntityList.size(); k1++)
|
||||
+ for(int x = (i>>4); x <= (l>>4); x++)
|
||||
{
|
||||
- TileEntity tileentity = (TileEntity)loadedTileEntityList.get(k1);
|
||||
- if (tileentity.xCoord >= i && tileentity.yCoord >= j && tileentity.zCoord >= k && tileentity.xCoord < l && tileentity.yCoord < i1 && tileentity.zCoord < j1)
|
||||
+ for(int z = (k>>4); z <= (j1>>4); z++)
|
||||
{
|
||||
- arraylist.add(tileentity);
|
||||
+ Chunk chunk = getChunkFromChunkCoords(x,z);
|
||||
+ if (chunk == null)
|
||||
+ {
|
||||
+ continue;
|
||||
+ }
|
||||
+ for(Object obj : chunk.chunkTileEntityMap.values())
|
||||
+ {
|
||||
+ TileEntity entity = (TileEntity)obj;
|
||||
+ if(entity.isInvalid())
|
||||
+ {
|
||||
+ continue;
|
||||
+ }
|
||||
+ if (entity.xCoord >= i && entity.yCoord >= j && entity.zCoord >= k &&
|
||||
+ entity.xCoord <= l && entity.yCoord <= i1 && entity.zCoord <= j1)
|
||||
+ {
|
||||
+ arraylist.add(entity);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
}
|
||||
-
|
||||
return arraylist;
|
||||
}
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
-13
@@ -106,7 +106,6 @@ public class ForgeHooksClient {
|
||||
Tessellator.instance=t;
|
||||
}
|
||||
|
||||
static IRenderContextHandler unbindContext=null;
|
||||
protected static void bindTexture(String name, int sub) {
|
||||
Integer n;
|
||||
n=textures.get(name);
|
||||
@@ -116,20 +115,12 @@ public class ForgeHooksClient {
|
||||
textures.put(name,n);
|
||||
}
|
||||
if(!inWorld) {
|
||||
if(unbindContext!=null) {
|
||||
unbindContext.afterRenderContext();
|
||||
unbindContext=null;
|
||||
}
|
||||
if(Tessellator.instance.isDrawing) {
|
||||
int mode=Tessellator.instance.drawMode;
|
||||
Tessellator.instance.draw();
|
||||
Tessellator.instance.startDrawing(mode);
|
||||
}
|
||||
GL11.glBindTexture(3553 /* GL_TEXTURE_2D */,n);
|
||||
unbindContext=renderHandlers.get(new TesKey(n,sub));
|
||||
if(unbindContext!=null) {
|
||||
unbindContext.beforeRenderContext();
|
||||
}
|
||||
return;
|
||||
}
|
||||
bindTessellator(n,sub);
|
||||
@@ -142,10 +133,6 @@ public class ForgeHooksClient {
|
||||
if(Tessellator.instance.isDrawing) {
|
||||
int mode=Tessellator.instance.drawMode;
|
||||
Tessellator.instance.draw();
|
||||
if(unbindContext!=null) {
|
||||
unbindContext.afterRenderContext();
|
||||
unbindContext=null;
|
||||
}
|
||||
Tessellator.instance.startDrawing(mode);
|
||||
}
|
||||
GL11.glBindTexture(3553 /* GL_TEXTURE_2D */, ModLoader
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -309,7 +309,7 @@ public class EnumHelper {
|
||||
else
|
||||
{
|
||||
if ((field.getModifiers() & flags) == flags &&
|
||||
field.getType().getName().replace('.', '/').equals(valueType)) //Apparently some JVMs return .'s and some don't..
|
||||
field.getType().getName().equals(valueType))
|
||||
{
|
||||
valuesField = field;
|
||||
break;
|
||||
+2
-36
@@ -6,14 +6,11 @@
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.Entity;
|
||||
import net.minecraft.src.EntityMinecart;
|
||||
import net.minecraft.src.EntityPlayer;
|
||||
import net.minecraft.src.IInventory;
|
||||
import net.minecraft.src.ItemStack;
|
||||
import net.minecraft.src.Item;
|
||||
import net.minecraft.src.EnumStatus;
|
||||
import net.minecraft.src.ModLoader;
|
||||
import net.minecraft.src.World;
|
||||
|
||||
import java.util.*;
|
||||
@@ -73,36 +70,6 @@ public class ForgeHooks {
|
||||
}
|
||||
|
||||
static LinkedList<ISleepHandler> sleepHandlers = new LinkedList<ISleepHandler>();
|
||||
|
||||
|
||||
public static void onMinecartUpdate(EntityMinecart minecart, int x, int y, int z)
|
||||
{
|
||||
for (IMinecartHandler handler : minecartHandlers)
|
||||
{
|
||||
handler.onMinecartUpdate(minecart, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
public static void onMinecartEntityCollision(EntityMinecart minecart, Entity entity)
|
||||
{
|
||||
for (IMinecartHandler handler : minecartHandlers)
|
||||
{
|
||||
handler.onMinecartEntityCollision(minecart, entity);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean onMinecartInteract(EntityMinecart minecart, EntityPlayer player)
|
||||
{
|
||||
boolean canceled = true;
|
||||
for (IMinecartHandler handler : minecartHandlers)
|
||||
{
|
||||
boolean tmp = handler.onMinecartInteract(minecart, player, canceled);
|
||||
canceled = canceled && tmp;
|
||||
}
|
||||
return canceled;
|
||||
}
|
||||
|
||||
static LinkedList<IMinecartHandler> minecartHandlers = new LinkedList<IMinecartHandler>();
|
||||
|
||||
// Plant Management
|
||||
// ------------------------------------------------------------
|
||||
@@ -301,11 +268,10 @@ public class ForgeHooks {
|
||||
}
|
||||
|
||||
public static final int majorVersion=1;
|
||||
public static final int minorVersion=3;
|
||||
public static final int revisionVersion=1;
|
||||
public static final int minorVersion=2;
|
||||
public static final int revisionVersion=3;
|
||||
static {
|
||||
System.out.printf("MinecraftForge V%d.%d.%d Initialized\n", majorVersion, minorVersion, revisionVersion);
|
||||
ModLoader.getLogger().info(String.format("MinecraftForge V%d.%d.%d Initialized\n", majorVersion, minorVersion, revisionVersion));
|
||||
}
|
||||
|
||||
static boolean toolInit=false;
|
||||
Loaded 100 of 233 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user