mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 17:14:44 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7305783e14 | ||
|
|
224597aa3a | ||
|
|
9f31de24aa | ||
|
|
86a5cfd48b | ||
|
|
52a18ab02b | ||
|
|
a560c7bf9a | ||
|
|
b767ce84ab | ||
|
|
3bb04f70ca | ||
|
|
2319eec68b | ||
|
|
3b5b9c5d1e | ||
|
|
43a89e61e9 | ||
|
|
078d3c2750 | ||
|
|
0be5c34f01 | ||
|
|
779d34372b | ||
|
|
5190e0c927 | ||
|
|
bfd0cfe506 | ||
|
|
87d4c2134c | ||
|
|
dda5880360 | ||
|
|
2309163d92 | ||
|
|
e5a16e25df | ||
|
|
ad378151cf | ||
|
|
bdda88d74e | ||
|
|
61d9b78704 | ||
|
|
f3e56e0273 | ||
|
|
e26f1ab671 | ||
|
|
dda9f474af | ||
|
|
df3449534f | ||
|
|
906cb8ee39 | ||
|
|
d541e492c4 | ||
|
|
d7d0f241ff | ||
|
|
c8fca39895 | ||
|
|
dd1eb6924d | ||
|
|
3f8d830899 | ||
|
|
a4475c9e9a | ||
|
|
90a4744130 | ||
|
|
f4eec04eba | ||
|
|
dbb5a37449 | ||
|
|
348a6fe03c | ||
|
|
6e1442e8e6 | ||
|
|
b91eb1ceac | ||
|
|
a38c8bd427 | ||
|
|
2936697302 | ||
|
|
52de732b8e | ||
|
|
c2f165f211 | ||
|
|
4c6e03e4ad | ||
|
|
c84b8740b4 | ||
|
|
8c9762fd9a | ||
|
|
d8a14ee928 | ||
|
|
8bb73671ba | ||
|
|
46a9ba178f | ||
|
|
5c60c2246c | ||
|
|
e79b5d1937 | ||
|
|
9bf4f67d9d | ||
|
|
c726e219d7 | ||
|
|
707a07511f | ||
|
|
d64c332266 | ||
|
|
800bb21bc8 | ||
|
|
1931d4fc09 | ||
|
|
17c9f9bf9b | ||
|
|
db1f438c2d | ||
|
|
d67cda76b8 | ||
|
|
b883254220 | ||
|
|
8a4636cba3 | ||
|
|
9c6f5bd8ee | ||
|
|
a2c606e98c | ||
|
|
6c578cd84d | ||
|
|
e35435abd5 | ||
|
|
5c7978d347 | ||
|
|
68cc1d315b | ||
|
|
96c05bbd25 | ||
|
|
d2cf70f8d5 | ||
|
|
f1a6f45353 | ||
|
|
8acaaa0e53 | ||
|
|
384da1b222 | ||
|
|
2be3e5845a | ||
|
|
600b2b86a6 | ||
|
|
6fb7b777ce | ||
|
|
28345bf839 | ||
|
|
56f612c186 | ||
|
|
80882bec9c | ||
|
|
f1f672b5fd | ||
|
|
bf5e706f06 | ||
|
|
c12b2c5b11 | ||
|
|
a64a47b24c | ||
|
|
8a7c087e34 | ||
|
|
756c3ce812 | ||
|
|
b8a84f2c29 | ||
|
|
ebc09a72db | ||
|
|
579f4de295 | ||
|
|
9f56b1cc03 | ||
|
|
141805d5bb | ||
|
|
d00a837635 | ||
|
|
da695e774f | ||
|
|
b3d605cd9d | ||
|
|
56438eb585 | ||
|
|
b763c73b74 | ||
|
|
ff7055fdb2 | ||
|
|
07dfc35e0e | ||
|
|
d290970b49 | ||
|
|
47749d454a | ||
|
|
ed7c343647 | ||
|
|
a386d0a8dc | ||
|
|
1a8d32f7de | ||
|
|
7a242e9562 | ||
|
|
afdbc4064b | ||
|
|
0392ecd8da | ||
|
|
cab70ce17a | ||
|
|
9fa40cb432 | ||
|
|
c9b6cdef1f | ||
|
|
5ecff4e5a1 | ||
|
|
115de819b3 | ||
|
|
bb6751cc59 | ||
|
|
0a874de91d | ||
|
|
3b61068a3c | ||
|
|
cfe5a542fc | ||
|
|
4f4a75d865 | ||
|
|
5c74f5efb9 | ||
|
|
878cac2697 | ||
|
|
8b5440b351 | ||
|
|
71c77d9e9a | ||
|
|
8ced84d8d3 | ||
|
|
3e09d92cd4 | ||
|
|
17132962c9 | ||
|
|
e7ca40009e | ||
|
|
62e7bdf805 | ||
|
|
705e5e62a0 | ||
|
|
a6ed5709ef | ||
|
|
aead41197f | ||
|
|
e9cd63abf7 | ||
|
|
d2878faa33 | ||
|
|
1c11f0eeb0 | ||
|
|
33bd0947e3 | ||
|
|
0457d8057f | ||
|
|
b0efd106bd | ||
|
|
9d22e76927 | ||
|
|
6ac2161f36 | ||
|
|
4cdb1cb3d0 | ||
|
|
651af86795 | ||
|
|
622f536f80 | ||
|
|
231c65da06 | ||
|
|
72864e4bc2 | ||
|
|
1d19069203 | ||
|
|
12b64fa287 | ||
|
|
fb5f9373c5 | ||
|
|
08b0913f04 | ||
|
|
8d9e0879d8 | ||
|
|
adf31e33fd | ||
|
|
61b8107ba4 | ||
|
|
cfda01b9ff | ||
|
|
4c259ce5d5 | ||
|
|
53dd73f2a5 | ||
|
|
691b87e876 | ||
|
|
b813f609a6 | ||
|
|
cbcdfbcfdb | ||
|
|
6c19a22244 | ||
|
|
f530d9f2b2 | ||
|
|
6accd6dfee | ||
|
|
f54eecb455 | ||
|
|
4bc2f86ea8 | ||
|
|
6d0e031989 | ||
|
|
d23812cb4c | ||
|
|
ee1f04bd58 | ||
|
|
98fbe565b3 |
No files matched your search
@@ -0,0 +1,11 @@
|
||||
package net.minecraft.src;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface MLProp {
|
||||
String name() default "";
|
||||
String info() default "";
|
||||
double min() default Double.NEGATIVE_INFINITY;
|
||||
double max() default Double.POSITIVE_INFINITY;
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
asdfsnb -a -v "svn"+
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+7
-9
@@ -1,18 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
pushd ..
|
||||
cd ..
|
||||
|
||||
rm -rf src
|
||||
cp -a src_work src
|
||||
rm -rf bin
|
||||
rm -rf src bin src_forge
|
||||
|
||||
popd
|
||||
cp -a src_work src_forge
|
||||
|
||||
cp -a forge_client/src/net/* ../src/minecraft/net/
|
||||
cp -a forge_common/net/* ../src/minecraft/net/
|
||||
cp -a forge_common/net/* ../src/minecraft_server/net/
|
||||
cp -a forge/forge_client/src/net/* src_forge/minecraft/net/
|
||||
cp -a forge/forge_common/net/* src_forge/minecraft/net/
|
||||
cp -a forge/forge_common/net/* src_forge/minecraft_server/net/
|
||||
|
||||
pushd ..
|
||||
cp -a src_forge src
|
||||
|
||||
./recompile.sh
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,231 @@
|
||||
net/minecraft/client/Minecraft.func_6257_q()V=org/lwjgl/LWJGLException
|
||||
net/minecraft/client/Minecraft.func_6271_a()V=org/lwjgl/LWJGLException
|
||||
net/minecraft/src/ChunkLoader.func_812_a(Lnet/minecraft/src/World;Lnet/minecraft/src/Chunk;)V=java/io/IOException
|
||||
net/minecraft/src/ChunkLoader.func_813_a(Lnet/minecraft/src/World;II)Lnet/minecraft/src/Chunk;=java/io/IOException
|
||||
net/minecraft/src/ChunkLoader.func_815_b(Lnet/minecraft/src/World;Lnet/minecraft/src/Chunk;)V=java/io/IOException
|
||||
net/minecraft/src/CompressedStreamTools.func_1138_a(Ljava/io/InputStream;)Lnet/minecraft/src/NBTTagCompound;=java/io/IOException
|
||||
net/minecraft/src/CompressedStreamTools.func_1139_a(Lnet/minecraft/src/NBTTagCompound;Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/CompressedStreamTools.func_1141_a(Ljava/io/DataInput;)Lnet/minecraft/src/NBTTagCompound;=java/io/IOException
|
||||
net/minecraft/src/CompressedStreamTools.func_1143_a(Lnet/minecraft/src/NBTTagCompound;Ljava/io/OutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/CompressedStreamTools.func_35620_b(Lnet/minecraft/src/NBTTagCompound;Ljava/io/File;)V=java/io/IOException
|
||||
net/minecraft/src/CompressedStreamTools.func_35621_a(Lnet/minecraft/src/NBTTagCompound;Ljava/io/File;)V=java/io/IOException
|
||||
net/minecraft/src/CompressedStreamTools.func_35622_a(Ljava/io/File;)Lnet/minecraft/src/NBTTagCompound;=java/io/IOException
|
||||
net/minecraft/src/CompressedStreamTools.func_40591_a(Lnet/minecraft/src/NBTTagCompound;)[B=java/io/IOException
|
||||
net/minecraft/src/CompressedStreamTools.func_40592_a([B)Lnet/minecraft/src/NBTTagCompound;=java/io/IOException
|
||||
net/minecraft/src/DataWatcher.func_21125_a(Ljava/util/List;Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/DataWatcher.func_21127_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/DataWatcher.func_21128_a(Ljava/io/DataOutputStream;Lnet/minecraft/src/WatchableObject;)V=java/io/IOException
|
||||
net/minecraft/src/DataWatcher.func_21131_a(Ljava/io/DataInputStream;)Ljava/util/List;=java/io/IOException
|
||||
net/minecraft/src/GuiMultiplayer.func_35328_b(Lnet/minecraft/src/ServerNBTStorage;)V=java/io/IOException
|
||||
net/minecraft/src/GuiMultiplayer.func_35336_a(Lnet/minecraft/src/GuiMultiplayer;Lnet/minecraft/src/ServerNBTStorage;)V=java/io/IOException
|
||||
net/minecraft/src/IChunkLoader.func_812_a(Lnet/minecraft/src/World;Lnet/minecraft/src/Chunk;)V=java/io/IOException
|
||||
net/minecraft/src/IChunkLoader.func_813_a(Lnet/minecraft/src/World;II)Lnet/minecraft/src/Chunk;=java/io/IOException
|
||||
net/minecraft/src/IChunkLoader.func_815_b(Lnet/minecraft/src/World;Lnet/minecraft/src/Chunk;)V=java/io/IOException
|
||||
net/minecraft/src/J_CompactJsonFormatter.func_27328_a(Lnet/minecraft/src/J_JsonNode;Ljava/io/Writer;)V=java/io/IOException
|
||||
net/minecraft/src/J_CompactJsonFormatter.func_27329_a(Lnet/minecraft/src/J_JsonRootNode;Ljava/io/Writer;)V=java/io/IOException
|
||||
net/minecraft/src/J_JdomParser.func_27366_a(Ljava/io/Reader;)Lnet/minecraft/src/J_JsonRootNode;=net/minecraft/src/J_InvalidSyntaxException,java/io/IOException
|
||||
net/minecraft/src/J_JdomParser.func_27367_a(Ljava/lang/String;)Lnet/minecraft/src/J_JsonRootNode;=net/minecraft/src/J_InvalidSyntaxException
|
||||
net/minecraft/src/J_PositionTrackingPushbackReader.func_27333_c()I=java/io/IOException
|
||||
net/minecraft/src/J_PositionTrackingPushbackReader.func_27334_a(C)V=java/io/IOException
|
||||
net/minecraft/src/J_PositionTrackingPushbackReader.func_27336_b([C)I=java/io/IOException
|
||||
net/minecraft/src/J_SajParser.func_27448_l(Lnet/minecraft/src/J_PositionTrackingPushbackReader;)I=java/io/IOException
|
||||
net/minecraft/src/J_SajParser.func_27449_c(Lnet/minecraft/src/J_PositionTrackingPushbackReader;Lnet/minecraft/src/J_JsonListener;)V=net/minecraft/src/J_InvalidSyntaxException,java/io/IOException
|
||||
net/minecraft/src/J_SajParser.func_27450_k(Lnet/minecraft/src/J_PositionTrackingPushbackReader;)I=java/io/IOException,net/minecraft/src/J_InvalidSyntaxException
|
||||
net/minecraft/src/J_SajParser.func_27451_b(Lnet/minecraft/src/J_PositionTrackingPushbackReader;)Ljava/lang/String;=java/io/IOException,net/minecraft/src/J_InvalidSyntaxException
|
||||
net/minecraft/src/J_SajParser.func_27452_i(Lnet/minecraft/src/J_PositionTrackingPushbackReader;)Ljava/lang/String;=net/minecraft/src/J_InvalidSyntaxException,java/io/IOException
|
||||
net/minecraft/src/J_SajParser.func_27453_b(Lnet/minecraft/src/J_PositionTrackingPushbackReader;Lnet/minecraft/src/J_JsonListener;)V=net/minecraft/src/J_InvalidSyntaxException,java/io/IOException
|
||||
net/minecraft/src/J_SajParser.func_27454_g(Lnet/minecraft/src/J_PositionTrackingPushbackReader;)Ljava/lang/String;=java/io/IOException,net/minecraft/src/J_InvalidSyntaxException
|
||||
net/minecraft/src/J_SajParser.func_27455_a(Lnet/minecraft/src/J_PositionTrackingPushbackReader;Lnet/minecraft/src/J_JsonListener;)V=net/minecraft/src/J_InvalidSyntaxException,java/io/IOException
|
||||
net/minecraft/src/J_SajParser.func_27456_e(Lnet/minecraft/src/J_PositionTrackingPushbackReader;)Ljava/lang/String;=java/io/IOException
|
||||
net/minecraft/src/J_SajParser.func_27457_j(Lnet/minecraft/src/J_PositionTrackingPushbackReader;)C=java/io/IOException,net/minecraft/src/J_InvalidSyntaxException
|
||||
net/minecraft/src/J_SajParser.func_27458_d(Lnet/minecraft/src/J_PositionTrackingPushbackReader;)C=java/io/IOException,net/minecraft/src/J_InvalidSyntaxException
|
||||
net/minecraft/src/J_SajParser.func_27459_a(Lnet/minecraft/src/J_PositionTrackingPushbackReader;)Ljava/lang/String;=java/io/IOException,net/minecraft/src/J_InvalidSyntaxException
|
||||
net/minecraft/src/J_SajParser.func_27460_c(Lnet/minecraft/src/J_PositionTrackingPushbackReader;)C=java/io/IOException,net/minecraft/src/J_InvalidSyntaxException
|
||||
net/minecraft/src/J_SajParser.func_27461_h(Lnet/minecraft/src/J_PositionTrackingPushbackReader;)Ljava/lang/String;=java/io/IOException
|
||||
net/minecraft/src/J_SajParser.func_27462_f(Lnet/minecraft/src/J_PositionTrackingPushbackReader;)Ljava/lang/String;=java/io/IOException,net/minecraft/src/J_InvalidSyntaxException
|
||||
net/minecraft/src/J_SajParser.func_27463_a(Ljava/io/Reader;Lnet/minecraft/src/J_JsonListener;)V=net/minecraft/src/J_InvalidSyntaxException,java/io/IOException
|
||||
net/minecraft/src/J_SajParser.func_27464_d(Lnet/minecraft/src/J_PositionTrackingPushbackReader;Lnet/minecraft/src/J_JsonListener;)V=net/minecraft/src/J_InvalidSyntaxException,java/io/IOException
|
||||
net/minecraft/src/NBTBase.func_734_b(Ljava/io/DataInput;)Lnet/minecraft/src/NBTBase;=java/io/IOException
|
||||
net/minecraft/src/NBTBase.func_735_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTBase.func_736_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTBase.func_738_a(Lnet/minecraft/src/NBTBase;Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagByte.func_735_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagByte.func_736_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagByteArray.func_735_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagByteArray.func_736_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagCompound.func_735_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagCompound.func_736_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagDouble.func_735_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagDouble.func_736_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagEnd.func_735_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagEnd.func_736_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagFloat.func_735_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagFloat.func_736_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagInt.func_735_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagInt.func_736_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagList.func_735_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagList.func_736_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagLong.func_735_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagLong.func_736_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagShort.func_735_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagShort.func_736_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagString.func_735_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagString.func_736_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NetClientHandler.<init>(Lnet/minecraft/client/Minecraft;Ljava/lang/String;I)V=java/net/UnknownHostException,java/io/IOException
|
||||
net/minecraft/src/NetworkManager.<init>(Ljava/net/Socket;Ljava/lang/String;Lnet/minecraft/src/NetHandler;)V=java/io/IOException
|
||||
net/minecraft/src/Packet.func_27048_a(Ljava/io/DataInputStream;I)Ljava/lang/String;=java/io/IOException
|
||||
net/minecraft/src/Packet.func_27049_a(Ljava/lang/String;Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet.func_324_b(Ljava/io/DataInputStream;Z)Lnet/minecraft/src/Packet;=java/io/IOException
|
||||
net/minecraft/src/Packet.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet.func_328_a(Lnet/minecraft/src/Packet;Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet.func_40186_c(Ljava/io/DataInputStream;)Lnet/minecraft/src/NBTTagCompound;=java/io/IOException
|
||||
net/minecraft/src/Packet.func_40187_b(Ljava/io/DataInputStream;)Lnet/minecraft/src/ItemStack;=java/io/IOException
|
||||
net/minecraft/src/Packet.func_40188_a(Lnet/minecraft/src/ItemStack;Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet.func_40189_a(Lnet/minecraft/src/NBTTagCompound;Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet0KeepAlive.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet0KeepAlive.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet100OpenWindow.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet100OpenWindow.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet101CloseWindow.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet101CloseWindow.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet102WindowClick.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet102WindowClick.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet103SetSlot.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet103SetSlot.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet104WindowItems.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet104WindowItems.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet105UpdateProgressbar.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet105UpdateProgressbar.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet106Transaction.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet106Transaction.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet107CreativeSetSlot.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet107CreativeSetSlot.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet108EnchantItem.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet108EnchantItem.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet10Flying.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet10Flying.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet11PlayerPosition.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet11PlayerPosition.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet12PlayerLook.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet12PlayerLook.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet130UpdateSign.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet130UpdateSign.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet131MapData.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet131MapData.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet13PlayerLookMove.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet13PlayerLookMove.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet14BlockDig.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet14BlockDig.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet15Place.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet15Place.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet16BlockItemSwitch.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet16BlockItemSwitch.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet17Sleep.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet17Sleep.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet18Animation.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet18Animation.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet19EntityAction.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet19EntityAction.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet1Login.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet1Login.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet200Statistic.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet200Statistic.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet201PlayerInfo.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet201PlayerInfo.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet20NamedEntitySpawn.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet20NamedEntitySpawn.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet21PickupSpawn.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet21PickupSpawn.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet22Collect.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet22Collect.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet23VehicleSpawn.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet23VehicleSpawn.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet24MobSpawn.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet24MobSpawn.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet254ServerPing.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet254ServerPing.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet255KickDisconnect.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet255KickDisconnect.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet25EntityPainting.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet25EntityPainting.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet26EntityExpOrb.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet26EntityExpOrb.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet27Position.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet27Position.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet28EntityVelocity.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet28EntityVelocity.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet29DestroyEntity.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet29DestroyEntity.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet2Handshake.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet2Handshake.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet30Entity.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet30Entity.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet31RelEntityMove.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet31RelEntityMove.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet32EntityLook.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet32EntityLook.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet33RelEntityMoveLook.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet33RelEntityMoveLook.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet34EntityTeleport.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet34EntityTeleport.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet38EntityStatus.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet38EntityStatus.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet39AttachEntity.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet39AttachEntity.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet3Chat.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet3Chat.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet40EntityMetadata.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet40EntityMetadata.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet41EntityEffect.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet41EntityEffect.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet42RemoveEntityEffect.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet42RemoveEntityEffect.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet43Experience.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet43Experience.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet4UpdateTime.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet4UpdateTime.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet50PreChunk.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet50PreChunk.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet51MapChunk.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet51MapChunk.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet52MultiBlockChange.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet52MultiBlockChange.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet53BlockChange.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet53BlockChange.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet54PlayNoteBlock.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet54PlayNoteBlock.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet5PlayerInventory.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet5PlayerInventory.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet60Explosion.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet60Explosion.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet61DoorChange.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet61DoorChange.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet6SpawnPosition.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet6SpawnPosition.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet70Bed.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet70Bed.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet71Weather.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet71Weather.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet7UseEntity.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet7UseEntity.func_327_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet8UpdateHealth.func_322_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
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
|
||||
net/minecraft/src/RegionFile.func_22208_b(III)V=java/io/IOException
|
||||
net/minecraft/src/RenderEngine.func_6526_a(Ljava/io/InputStream;)Ljava/awt/image/BufferedImage;=java/io/IOException
|
||||
net/minecraft/src/StatsSyncher.func_27410_a(Ljava/util/Map;Ljava/io/File;Ljava/io/File;Ljava/io/File;)V=java/io/IOException
|
||||
net/minecraft/src/StatsSyncher.func_27412_a(Lnet/minecraft/src/StatsSyncher;Ljava/util/Map;Ljava/io/File;Ljava/io/File;Ljava/io/File;)V=java/io/IOException
|
||||
net/minecraft/src/TexturePackBase.func_6485_a(Lnet/minecraft/client/Minecraft;)V=java/io/IOException
|
||||
net/minecraft/src/TexturePackCustom.func_6485_a(Lnet/minecraft/client/Minecraft;)V=java/io/IOException
|
||||
net/minecraft/src/ThreadDownloadResources.func_1212_a(Ljava/net/URL;Ljava/io/File;J)V=java/io/IOException
|
||||
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
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,141 @@
|
||||
[DEFAULT]
|
||||
DirTemp = temp
|
||||
DirSrc = src
|
||||
DirLogs = logs
|
||||
DirBin = bin
|
||||
DirJars = jars
|
||||
DirReobf = reobf
|
||||
DirConf = conf
|
||||
DirRuntime = runtime
|
||||
DirLib = lib
|
||||
DirFFOut = temp/ffout
|
||||
DirBinOut = temp/bin
|
||||
DirModSrc = modsrc
|
||||
DirEclipse = eclipse
|
||||
|
||||
[CSV]
|
||||
Classes = %(DirConf)s/classes.csv
|
||||
Methods = %(DirConf)s/methods.csv
|
||||
Fields = %(DirConf)s/fields.csv
|
||||
|
||||
[SRGS]
|
||||
Client = %(DirTemp)s/client_rg.srg
|
||||
Server = %(DirTemp)s/server_rg.srg
|
||||
|
||||
[JAR]
|
||||
DirNatives = %(DirJars)s/bin/natives
|
||||
Client = %(DirJars)s/bin/minecraft.jar
|
||||
Server = %(DirJars)s/minecraft_server.jar
|
||||
MD5Client = e92302d2acdba7c97e0d8df1e10d2006
|
||||
MD5Server = b0f4fb91f9723104adf35944bbf3d3cf
|
||||
|
||||
[RETROGUARD]
|
||||
Location = %(DirRuntime)s/bin/retroguard.jar
|
||||
RetroConf = %(DirTemp)s/retroguard.cfg
|
||||
RetroReobConf = %(DirTemp)s/retroguard_ro.cfg
|
||||
ClientConf = %(DirTemp)s/client_rg.cfg
|
||||
ServerConf = %(DirTemp)s/server_rg.cfg
|
||||
ClientReobConf = %(DirTemp)s/client_ro.cfg
|
||||
ServerReobConf = %(DirTemp)s/server_ro.cfg
|
||||
ClientOut = %(DirTemp)s/minecraft_rg.jar
|
||||
ServerOut = %(DirTemp)s/minecraft_server_rg.jar
|
||||
ClientLog = %(DirLogs)s/client_rg.log
|
||||
ServerLog = %(DirLogs)s/server_rg.log
|
||||
ClientDeobLog = %(DirLogs)s/client_deob.log
|
||||
ServerDeobLog = %(DirLogs)s/server_deob.log
|
||||
|
||||
[EXCEPTOR]
|
||||
XClientCfg = %(DirConf)s/client.exc
|
||||
XServerCfg = %(DirConf)s/server.exc
|
||||
XClientOut = %(DirTemp)s/minecraft_exc.jar
|
||||
XServerOut = %(DirTemp)s/minecraft_server_exc.jar
|
||||
XClientLog = %(DirLogs)s/client_exc.log
|
||||
XServerLog = %(DirLogs)s/server_exc.log
|
||||
|
||||
[DECOMPILE]
|
||||
FFClientOut = %(DirFFOut)s/client
|
||||
FFServerOut = %(DirFFOut)s/server
|
||||
FFClientSrc = %(DirFFOut)s/minecraft_exc.jar
|
||||
FFServerSrc = %(DirFFOut)s/minecraft_server_exc.jar
|
||||
FFSource = net
|
||||
|
||||
[OUTPUT]
|
||||
BinClient = %(DirBinOut)s/minecraft
|
||||
BinServer = %(DirBinOut)s/minecraft_server
|
||||
SrcClient = %(DirSrc)s/minecraft
|
||||
SrcServer = %(DirSrc)s/minecraft_server
|
||||
TestClient = net/minecraft/client/Minecraft
|
||||
TestServer = net/minecraft/server/MinecraftServer
|
||||
|
||||
[PATCHES]
|
||||
PatchClient = %(DirConf)s/patches/minecraft.patch
|
||||
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
|
||||
BinServer = %(DirBin)s/minecraft_server
|
||||
ClassPathClient = %(DirLib)s/,%(DirLib)s/*,%(DirJars)s/bin/minecraft.jar,%(DirJars)s/bin/jinput.jar,%(DirJars)s/bin/lwjgl.jar,%(DirJars)s/bin/lwjgl_util.jar
|
||||
ClassPathServer = %(DirLib)s/,%(DirLib)s/*,%(DirJars)s/minecraft_server.jar
|
||||
ClientFixes = %(DirConf)s/patches
|
||||
|
||||
[REOBF]
|
||||
MD5Client = %(DirTemp)s/client.md5
|
||||
MD5Server = %(DirTemp)s/server.md5
|
||||
MD5PreReobfClient = %(DirTemp)s/client_reobf.md5
|
||||
MD5PreReobfServer = %(DirTemp)s/server_reobf.md5
|
||||
ObfSRGClient = %(DirTemp)s/client_ro.srg
|
||||
ObfSRGServer = %(DirTemp)s/server_ro.srg
|
||||
RecompJarClient = %(DirTemp)s/client_recomp.jar
|
||||
RecompJarServer = %(DirTemp)s/server_recomp.jar
|
||||
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
|
||||
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
|
||||
|
||||
[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
|
||||
JadRetro = %(DirRuntime)s/bin/jadretro.jar
|
||||
Fernflower = %(DirRuntime)s/bin/fernflower.jar
|
||||
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}
|
||||
CmdStartSrv = %s -Xincgc -Xms1024M -Xmx1024M -cp "{classpath}" net.minecraft.server.MinecraftServer
|
||||
CmdStartClt = %s -Xincgc -Xms1024M -Xmx1024M -cp "{classpath}" -Djava.library.path={natives} Start
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,27 @@
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public class Start
|
||||
{
|
||||
public static void main(String[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
// set new minecraft data folder to prevent it from using the .minecraft folder
|
||||
// this makes it a portable version
|
||||
Field f = Minecraft.class.getDeclaredField("minecraftDir");
|
||||
Field.setAccessible(new Field[] { f }, true);
|
||||
f.set(null, new File("."));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
// start minecraft game application
|
||||
Minecraft.main(args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// this is needed for the sound engine to work with deobfuscated sourcecode without crashing
|
||||
|
||||
public class ga
|
||||
{
|
||||
public static int c(double d)
|
||||
{
|
||||
int i = (int)d;
|
||||
return d >= (double)i ? i : i - 1;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,109 @@
|
||||
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 @@
|
||||
|
||||
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()) {
|
||||
+/*
|
||||
while(true) {
|
||||
if(this.field_6324_e.func_6465_g()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
+*/
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
+import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import net.minecraft.src.MusInputStream;
|
||||
import paulscode.sound.codecs.CodecJOrbis;
|
||||
@@ -7,6 +8,11 @@
|
||||
public class CodecMus extends CodecJOrbis {
|
||||
|
||||
protected InputStream openInputStream() {
|
||||
- return new MusInputStream(this, this.url, this.urlConnection.getInputStream());
|
||||
+ try {
|
||||
+ return new MusInputStream(this, this.url, this.urlConnection.getInputStream());
|
||||
+ }
|
||||
+ catch (IOException e) {
|
||||
+ return null;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
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
|
||||
@@ -19,7 +19,6 @@
|
||||
}
|
||||
|
||||
public static MapData func_28013_a(short var0, World var1) {
|
||||
- "map_" + var0;
|
||||
MapData var3 = (MapData)var1.func_28103_a(MapData.class, "map_" + var0);
|
||||
if(var3 == null) {
|
||||
int var4 = var1.func_28101_b("map");
|
||||
@@ -32,7 +31,6 @@
|
||||
}
|
||||
|
||||
public MapData func_28012_a(ItemStack var1, World var2) {
|
||||
- "map_" + var1.func_21181_i();
|
||||
MapData var4 = (MapData)var2.func_28103_a(MapData.class, "map_" + var1.func_21181_i());
|
||||
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
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
+import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import net.minecraft.src.CodecMus;
|
||||
@@ -28,7 +29,12 @@
|
||||
}
|
||||
|
||||
public int read(byte[] var1, int var2, int var3) {
|
||||
- var3 = this.field_1515_d.read(var1, var2, var3);
|
||||
+ try {
|
||||
+ var3 = this.field_1515_d.read(var1, var2, var3);
|
||||
+ }
|
||||
+ catch (IOException e) {
|
||||
+ return 0;
|
||||
+ }
|
||||
|
||||
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
|
||||
@@ -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;
|
||||
double var19 = this.field_1439_t.field_22009_h.field_609_am - var6;
|
||||
- Object var21 = null;
|
||||
+ EntityFX var21 = null;
|
||||
if(var1.equals("hugeexplosion")) {
|
||||
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
|
||||
@@ -21,7 +21,9 @@
|
||||
}
|
||||
|
||||
public void run() {
|
||||
- this.func_40568_b();
|
||||
+ while (true) {
|
||||
+ this.func_40568_b();
|
||||
+ }
|
||||
}
|
||||
|
||||
private void func_40568_b() {
|
||||
@@ -0,0 +1,54 @@
|
||||
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;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,26 @@
|
||||
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
|
||||
@@ -22,7 +22,6 @@
|
||||
}
|
||||
|
||||
public MapData func_28023_a(ItemStack var1, World var2) {
|
||||
- "map_" + var1.func_21125_h();
|
||||
MapData var4 = (MapData)var2.func_28103_a(MapData.class, "map_" + var1.func_21125_h());
|
||||
if(var4 == null) {
|
||||
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
|
||||
@@ -21,7 +21,9 @@
|
||||
}
|
||||
|
||||
public void run() {
|
||||
- this.func_40509_b();
|
||||
+ while (true) {
|
||||
+ this.func_40509_b();
|
||||
+ }
|
||||
}
|
||||
|
||||
private void func_40509_b() {
|
||||
@@ -0,0 +1,60 @@
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
Now it is YOURCRAFT!
|
||||
@@ -0,0 +1,205 @@
|
||||
net/minecraft/server/MinecraftServer.func_6008_d()Z=java/net/UnknownHostException
|
||||
net/minecraft/src/ChunkLoader.func_4104_b(Lnet/minecraft/src/World;Lnet/minecraft/src/Chunk;)V=java/io/IOException
|
||||
net/minecraft/src/ChunkLoader.func_659_a(Lnet/minecraft/src/World;II)Lnet/minecraft/src/Chunk;=java/io/IOException
|
||||
net/minecraft/src/ChunkLoader.func_662_a(Lnet/minecraft/src/World;Lnet/minecraft/src/Chunk;)V=java/io/IOException
|
||||
net/minecraft/src/CompressedStreamTools.func_40515_a([B)Lnet/minecraft/src/NBTTagCompound;=java/io/IOException
|
||||
net/minecraft/src/CompressedStreamTools.func_40516_a(Lnet/minecraft/src/NBTTagCompound;)[B=java/io/IOException
|
||||
net/minecraft/src/CompressedStreamTools.func_769_a(Lnet/minecraft/src/NBTTagCompound;Ljava/io/OutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/CompressedStreamTools.func_770_a(Ljava/io/InputStream;)Lnet/minecraft/src/NBTTagCompound;=java/io/IOException
|
||||
net/minecraft/src/CompressedStreamTools.func_771_a(Lnet/minecraft/src/NBTTagCompound;Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/CompressedStreamTools.func_774_a(Ljava/io/DataInput;)Lnet/minecraft/src/NBTTagCompound;=java/io/IOException
|
||||
net/minecraft/src/DataWatcher.func_21149_a(Ljava/io/DataInputStream;)Ljava/util/List;=java/io/IOException
|
||||
net/minecraft/src/DataWatcher.func_21151_a(Ljava/util/List;Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/DataWatcher.func_21152_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/DataWatcher.func_21154_a(Ljava/io/DataOutputStream;Lnet/minecraft/src/WatchableObject;)V=java/io/IOException
|
||||
net/minecraft/src/IChunkLoader.func_4104_b(Lnet/minecraft/src/World;Lnet/minecraft/src/Chunk;)V=java/io/IOException
|
||||
net/minecraft/src/IChunkLoader.func_659_a(Lnet/minecraft/src/World;II)Lnet/minecraft/src/Chunk;=java/io/IOException
|
||||
net/minecraft/src/IChunkLoader.func_662_a(Lnet/minecraft/src/World;Lnet/minecraft/src/Chunk;)V=java/io/IOException
|
||||
net/minecraft/src/NBTBase.func_380_a(Lnet/minecraft/src/NBTBase;Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTBase.func_381_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTBase.func_382_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTBase.func_383_b(Ljava/io/DataInput;)Lnet/minecraft/src/NBTBase;=java/io/IOException
|
||||
net/minecraft/src/NBTTagByte.func_381_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagByte.func_382_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagByteArray.func_381_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagByteArray.func_382_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagCompound.func_381_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagCompound.func_382_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagDouble.func_381_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagDouble.func_382_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagEnd.func_381_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagEnd.func_382_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagFloat.func_381_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagFloat.func_382_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagInt.func_381_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagInt.func_382_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagList.func_381_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagList.func_382_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagLong.func_381_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagLong.func_382_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagShort.func_381_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagShort.func_382_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagString.func_381_a(Ljava/io/DataOutput;)V=java/io/IOException
|
||||
net/minecraft/src/NBTTagString.func_382_a(Ljava/io/DataInput;)V=java/io/IOException
|
||||
net/minecraft/src/NetLoginHandler.<init>(Lnet/minecraft/server/MinecraftServer;Ljava/net/Socket;Ljava/lang/String;)V=java/io/IOException
|
||||
net/minecraft/src/NetworkListenThread.<init>(Lnet/minecraft/server/MinecraftServer;Ljava/net/InetAddress;I)V=java/io/IOException
|
||||
net/minecraft/src/NetworkManager.<init>(Ljava/net/Socket;Ljava/lang/String;Lnet/minecraft/src/NetHandler;)V=java/io/IOException
|
||||
net/minecraft/src/Packet.func_27037_a(Ljava/io/DataInputStream;I)Ljava/lang/String;=java/io/IOException
|
||||
net/minecraft/src/Packet.func_27038_a(Ljava/lang/String;Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet.func_40259_c(Ljava/io/DataInputStream;)Lnet/minecraft/src/NBTTagCompound;=java/io/IOException
|
||||
net/minecraft/src/Packet.func_40260_a(Lnet/minecraft/src/NBTTagCompound;Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet.func_40261_a(Lnet/minecraft/src/ItemStack;Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet.func_40262_b(Ljava/io/DataInputStream;)Lnet/minecraft/src/ItemStack;=java/io/IOException
|
||||
net/minecraft/src/Packet.func_65_b(Ljava/io/DataInputStream;Z)Lnet/minecraft/src/Packet;=java/io/IOException
|
||||
net/minecraft/src/Packet.func_66_a(Lnet/minecraft/src/Packet;Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet0KeepAlive.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet0KeepAlive.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet100OpenWindow.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet100OpenWindow.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet101CloseWindow.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet101CloseWindow.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet102WindowClick.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet102WindowClick.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet103SetSlot.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet103SetSlot.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet104WindowItems.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet104WindowItems.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet105UpdateProgressbar.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet105UpdateProgressbar.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet106Transaction.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet106Transaction.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet107CreativeSetSlot.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet107CreativeSetSlot.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet108EnchantItem.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet108EnchantItem.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet10Flying.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet10Flying.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet11PlayerPosition.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet11PlayerPosition.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet12PlayerLook.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet12PlayerLook.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet130UpdateSign.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet130UpdateSign.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet131MapData.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet131MapData.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet13PlayerLookMove.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet13PlayerLookMove.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet14BlockDig.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet14BlockDig.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet15Place.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet15Place.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet16BlockItemSwitch.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet16BlockItemSwitch.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet17Sleep.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet17Sleep.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet18Animation.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet18Animation.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet19EntityAction.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet19EntityAction.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet1Login.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet1Login.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet200Statistic.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet200Statistic.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet201PlayerInfo.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet201PlayerInfo.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet20NamedEntitySpawn.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet20NamedEntitySpawn.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet21PickupSpawn.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet21PickupSpawn.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet22Collect.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet22Collect.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet23VehicleSpawn.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet23VehicleSpawn.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet24MobSpawn.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet24MobSpawn.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet255KickDisconnect.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet255KickDisconnect.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet25EntityPainting.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet25EntityPainting.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet26EntityExpOrb.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet26EntityExpOrb.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet27Position.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet27Position.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet28EntityVelocity.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet28EntityVelocity.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet29DestroyEntity.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet29DestroyEntity.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet2Handshake.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet2Handshake.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet30Entity.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet30Entity.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet31RelEntityMove.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet31RelEntityMove.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet32EntityLook.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet32EntityLook.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet33RelEntityMoveLook.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet33RelEntityMoveLook.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet34EntityTeleport.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet34EntityTeleport.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet38EntityStatus.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet38EntityStatus.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet39AttachEntity.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet39AttachEntity.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet3Chat.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet3Chat.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet40EntityMetadata.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet40EntityMetadata.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet41EntityEffect.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet41EntityEffect.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet42RemoveEntityEffect.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet42RemoveEntityEffect.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet43Experience.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet43Experience.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet4UpdateTime.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet4UpdateTime.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet50PreChunk.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet50PreChunk.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet51MapChunk.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet51MapChunk.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet52MultiBlockChange.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet52MultiBlockChange.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet53BlockChange.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet53BlockChange.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet54PlayNoteBlock.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet54PlayNoteBlock.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet5PlayerInventory.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet5PlayerInventory.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet60Explosion.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet60Explosion.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet61DoorChange.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet61DoorChange.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet6SpawnPosition.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet6SpawnPosition.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet70Bed.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet70Bed.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet71Weather.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet71Weather.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet7UseEntity.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet7UseEntity.func_70_a(Ljava/io/DataInputStream;)V=java/io/IOException
|
||||
net/minecraft/src/Packet8UpdateHealth.func_68_a(Ljava/io/DataOutputStream;)V=java/io/IOException
|
||||
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
|
||||
net/minecraft/src/RConOutputStream.func_40397_a(Ljava/lang/String;)V=java/io/IOException
|
||||
net/minecraft/src/RConThreadClient.func_40453_a(IILjava/lang/String;)V=java/io/IOException
|
||||
net/minecraft/src/RConThreadClient.func_40454_e()V=java/io/IOException
|
||||
net/minecraft/src/RConThreadClient.func_40455_a(ILjava/lang/String;)V=java/io/IOException
|
||||
net/minecraft/src/RConThreadQuery.func_40428_a([BLjava/net/DatagramPacket;)V=java/net/SocketException,java/io/IOException
|
||||
net/minecraft/src/RConThreadQuery.func_40430_a(Ljava/net/DatagramPacket;)Z=java/io/IOException
|
||||
net/minecraft/src/RConThreadQuery.func_40431_d(Ljava/net/DatagramPacket;)V=java/net/SocketException,java/io/IOException
|
||||
net/minecraft/src/RConThreadQuery.func_40434_b(Ljava/net/DatagramPacket;)[B=java/io/IOException
|
||||
net/minecraft/src/RegionFile.func_22126_b()V=java/io/IOException
|
||||
net/minecraft/src/RegionFile.func_22128_a(III)V=java/io/IOException
|
||||
net/minecraft/src/RegionFile.func_22130_a(I[BI)V=java/io/IOException
|
||||
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.6
|
||||
ClientVersion = 1.1
|
||||
ServerVersion = 1.1
|
||||
@@ -1,12 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry including="*.java" kind="src" path="start"/>
|
||||
<classpathentry kind="src" path="forge_common"/>
|
||||
<classpathentry kind="src" path="minecraft"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
|
||||
<classpathentry kind="lib" path="../../jars/bin/jinput.jar"/>
|
||||
<classpathentry kind="lib" path="../../jars/bin/lwjgl.jar"/>
|
||||
<classpathentry kind="lib" path="../../jars/bin/lwjgl_util.jar"/>
|
||||
<classpathentry kind="lib" path="../../jars/bin/jinput.jar">
|
||||
<attributes>
|
||||
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="forge_client/jars/bin/natives"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="../../jars/bin/lwjgl.jar">
|
||||
<attributes>
|
||||
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="forge_client/jars/bin/natives"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="../../jars/bin/lwjgl_util.jar">
|
||||
<attributes>
|
||||
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="forge_client/jars/bin/natives"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="../../jars/bin/minecraft.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
@@ -20,10 +20,64 @@
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-1-PROJECT_LOC/forge_common</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>jars</name>
|
||||
<type>2</type>
|
||||
<locationURI>MCP_LOC/jars</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>minecraft</name>
|
||||
<type>2</type>
|
||||
<locationURI>PARENT-1-WORKSPACE_LOC/src_work/minecraft</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>start</name>
|
||||
<type>2</type>
|
||||
<locationURI>MCP_LOC/conf/patches</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1324024223159</id>
|
||||
<name>jars</name>
|
||||
<type>9</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||
<arguments>1.0-name-matches-false-false-bin</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
<filter>
|
||||
<id>1324024223163</id>
|
||||
<name>jars</name>
|
||||
<type>6</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||
<arguments>1.0-name-matches-false-false-*</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
<filter>
|
||||
<id>1324022795404</id>
|
||||
<name>start</name>
|
||||
<type>5</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||
<arguments>1.0-name-matches-false-false-*.java</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
<filter>
|
||||
<id>1324024144075</id>
|
||||
<name>jars/bin</name>
|
||||
<type>5</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.ui.ide.multiFilter</id>
|
||||
<arguments>1.0-name-matches-false-false-*.jar</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
<variableList>
|
||||
<variable>
|
||||
<name>MCP_LOC</name>
|
||||
<value>$%7BPARENT-1-WORKSPACE_LOC%7D</value>
|
||||
</variable>
|
||||
</variableList>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,99 @@
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.EnumJsonNodeType;
|
||||
import net.minecraft.src.EnumOS2;
|
||||
import net.minecraft.src.EnumOptions;
|
||||
import net.minecraft.src.EnumRarity;
|
||||
|
||||
public class EnumHelperClient extends EnumHelper {
|
||||
|
||||
private static Class[][] ctrs = {
|
||||
{EnumJsonNodeType.class},
|
||||
{EnumOptions.class, String.class, boolean.class, boolean.class},
|
||||
{EnumOS2.class},
|
||||
{EnumRarity.class, int.class, String.class}
|
||||
};
|
||||
|
||||
private static boolean[] decompiled = new boolean[ctrs.length];
|
||||
private static boolean isSetup = false;
|
||||
|
||||
public static EnumJsonNodeType addJsonNodeType(String name)
|
||||
{
|
||||
if (!isSetup)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
return addEnum(decompiled[0], EnumJsonNodeType.class, name,
|
||||
new Class[] {},
|
||||
new Object[]{});
|
||||
}
|
||||
public static EnumOptions addOptions(String name, String langName, boolean isSlider, boolean isToggle)
|
||||
{
|
||||
if (!isSetup)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
return addEnum(decompiled[1], EnumOptions.class, name,
|
||||
new Class[] {String.class, boolean.class, boolean.class},
|
||||
new Object[]{langName, isSlider, isToggle });
|
||||
}
|
||||
public static EnumOS2 addOS2(String name)
|
||||
{
|
||||
if (!isSetup)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
return addEnum(decompiled[2], EnumOS2.class, name,
|
||||
new Class[] {},
|
||||
new Object[]{});
|
||||
}
|
||||
public static EnumRarity addRarity(String name, int color, String displayName)
|
||||
{
|
||||
if (!isSetup)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
return addEnum(decompiled[3], EnumRarity.class, name,
|
||||
new Class[] {int.class, String.class},
|
||||
new Object[]{color, displayName });
|
||||
}
|
||||
|
||||
private static void setup()
|
||||
{
|
||||
//System.out.println("Enum Helper Initalizing: ");
|
||||
for(int x = 0; x < ctrs.length; x++)
|
||||
{
|
||||
try {
|
||||
Class<?>[] enumHeaders = new Class[ctrs[x].length + 3];
|
||||
enumHeaders[0] = String.class;
|
||||
enumHeaders[1] = int.class;
|
||||
enumHeaders[2] = String.class;
|
||||
enumHeaders[3] = int.class;
|
||||
|
||||
for (int y = 1; y < ctrs[x].length; y++)
|
||||
enumHeaders[3 + y] = ctrs[x][y];
|
||||
|
||||
ctrs[x][0].getDeclaredConstructor(enumHeaders);
|
||||
decompiled[x] = true;
|
||||
|
||||
} catch(Exception e) {
|
||||
//Nom Nom Nom
|
||||
}
|
||||
//System.out.format("\t%-25s %s\r\n", ctrs[x][0].getName().replace("net.minecraft.src.", ""), decompiled[x]);
|
||||
}
|
||||
isSetup = true;
|
||||
}
|
||||
|
||||
static
|
||||
{
|
||||
if (!isSetup)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,245 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.ModLoader;
|
||||
import net.minecraft.src.RenderBlocks;
|
||||
import net.minecraft.src.Tessellator;
|
||||
import net.minecraft.src.RenderGlobal;
|
||||
import net.minecraft.src.EntityPlayer;
|
||||
import net.minecraft.src.MovingObjectPosition;
|
||||
import net.minecraft.src.ItemStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class ForgeHooksClient {
|
||||
|
||||
public static boolean onBlockHighlight(RenderGlobal renderglobal,
|
||||
EntityPlayer player, MovingObjectPosition mop, int i,
|
||||
ItemStack itemstack, float f) {
|
||||
for (IHighlightHandler handler : highlightHandlers) {
|
||||
if(handler.onBlockHighlight(renderglobal,player,mop,
|
||||
i,itemstack,f))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void onRenderWorldLast(RenderGlobal rg, float f) {
|
||||
for (IRenderWorldLastHandler handler : renderWorldLastHandlers) {
|
||||
handler.onRenderWorldLast(rg,f);
|
||||
}
|
||||
}
|
||||
|
||||
static LinkedList<IHighlightHandler> highlightHandlers =
|
||||
new LinkedList<IHighlightHandler>();
|
||||
static LinkedList<IRenderWorldLastHandler> renderWorldLastHandlers =
|
||||
new LinkedList<IRenderWorldLastHandler>();
|
||||
|
||||
public static boolean canRenderInPass(Block block, int pass) {
|
||||
if(block instanceof IMultipassRender) {
|
||||
IMultipassRender impr = (IMultipassRender) block;
|
||||
return impr.canRenderInPass(pass);
|
||||
}
|
||||
if(pass==block.getRenderBlockPass()) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
private static class TesKey implements Comparable<TesKey> {
|
||||
public TesKey(int t, int s) { tex=t; sub=s; }
|
||||
public int compareTo(TesKey key) {
|
||||
if(sub==key.sub) return tex-key.tex;
|
||||
return sub-key.sub;
|
||||
}
|
||||
public boolean equals(Object obj) {
|
||||
return compareTo((TesKey)obj)==0;
|
||||
}
|
||||
public int hashCode() {
|
||||
int c1=Integer.valueOf(tex).hashCode();
|
||||
int c2=Integer.valueOf(sub).hashCode();
|
||||
return c1+31*c2;
|
||||
}
|
||||
public int tex, sub;
|
||||
}
|
||||
|
||||
static HashMap<TesKey,Tessellator> tessellators=
|
||||
new HashMap<TesKey,Tessellator>();
|
||||
static HashMap<String,Integer> textures=new HashMap<String,Integer>();
|
||||
static boolean inWorld=false;
|
||||
static TreeSet<TesKey> renderTextures=new TreeSet<TesKey>();
|
||||
static Tessellator defaultTessellator=null;
|
||||
static HashMap<TesKey,IRenderContextHandler> renderHandlers=new
|
||||
HashMap<TesKey,IRenderContextHandler>();
|
||||
|
||||
protected static void registerRenderContextHandler(String tex, int sub,
|
||||
IRenderContextHandler handler) {
|
||||
Integer n;
|
||||
n=textures.get(tex);
|
||||
if(n==null) {
|
||||
n=ModLoader.getMinecraftInstance().renderEngine
|
||||
.getTexture(tex);
|
||||
textures.put(tex,n);
|
||||
}
|
||||
renderHandlers.put(new TesKey(n,sub),handler);
|
||||
}
|
||||
|
||||
protected static void bindTessellator(int tex, int sub) {
|
||||
TesKey key=new TesKey(tex,sub);
|
||||
Tessellator t;
|
||||
t=tessellators.get(key);
|
||||
if(t==null) {
|
||||
t=new Tessellator();
|
||||
tessellators.put(key,t);
|
||||
}
|
||||
if(inWorld && !renderTextures.contains(key)) {
|
||||
renderTextures.add(key);
|
||||
t.startDrawingQuads();
|
||||
t.setTranslationD(defaultTessellator.xOffset,
|
||||
defaultTessellator.yOffset,
|
||||
defaultTessellator.zOffset);
|
||||
}
|
||||
Tessellator.instance=t;
|
||||
}
|
||||
|
||||
static IRenderContextHandler unbindContext=null;
|
||||
protected static void bindTexture(String name, int sub) {
|
||||
Integer n;
|
||||
n=textures.get(name);
|
||||
if(n==null) {
|
||||
n=ModLoader.getMinecraftInstance().renderEngine
|
||||
.getTexture(name);
|
||||
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);
|
||||
}
|
||||
|
||||
protected static void unbindTexture() {
|
||||
if(inWorld) {
|
||||
Tessellator.instance=defaultTessellator;
|
||||
} else {
|
||||
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
|
||||
.getMinecraftInstance().renderEngine
|
||||
.getTexture("/terrain.png"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static int renderPass=-1;
|
||||
public static void beforeRenderPass(int pass) {
|
||||
renderPass=pass;
|
||||
defaultTessellator=Tessellator.instance;
|
||||
Tessellator.renderingWorldRenderer=true;
|
||||
GL11.glBindTexture(3553 /* GL_TEXTURE_2D */, ModLoader
|
||||
.getMinecraftInstance().renderEngine
|
||||
.getTexture("/terrain.png"));
|
||||
renderTextures.clear();
|
||||
inWorld=true;
|
||||
}
|
||||
|
||||
public static void afterRenderPass(int pass) {
|
||||
renderPass=-1;
|
||||
inWorld=false;
|
||||
for(TesKey tk : renderTextures) {
|
||||
IRenderContextHandler irch=renderHandlers.get(tk);
|
||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D,tk.tex);
|
||||
Tessellator t=tessellators.get(tk);
|
||||
if(irch==null) {
|
||||
t.draw();
|
||||
} else {
|
||||
Tessellator.instance=t;
|
||||
irch.beforeRenderContext();
|
||||
t.draw();
|
||||
irch.afterRenderContext();
|
||||
}
|
||||
}
|
||||
GL11.glBindTexture(3553 /* GL_TEXTURE_2D */, ModLoader
|
||||
.getMinecraftInstance().renderEngine
|
||||
.getTexture("/terrain.png"));
|
||||
Tessellator.renderingWorldRenderer=false;
|
||||
Tessellator.instance=defaultTessellator;
|
||||
}
|
||||
|
||||
public static void beforeBlockRender(Block block,
|
||||
RenderBlocks renderblocks) {
|
||||
if (block instanceof ITextureProvider
|
||||
&& renderblocks.overrideBlockTexture == -1) {
|
||||
ITextureProvider itp=(ITextureProvider)block;
|
||||
bindTexture(itp.getTextureFile(),0);
|
||||
}
|
||||
}
|
||||
|
||||
public static void afterBlockRender(Block block,
|
||||
RenderBlocks renderblocks) {
|
||||
if (block instanceof ITextureProvider
|
||||
&& renderblocks.overrideBlockTexture == -1) {
|
||||
unbindTexture();
|
||||
}
|
||||
}
|
||||
|
||||
public static void overrideTexture (Object o) {
|
||||
if (o instanceof ITextureProvider) {
|
||||
GL11.glBindTexture(3553 /* GL_TEXTURE_2D */, ModLoader
|
||||
.getMinecraftInstance().renderEngine
|
||||
.getTexture(((ITextureProvider) (o))
|
||||
.getTextureFile()));
|
||||
}
|
||||
}
|
||||
|
||||
public static String getTexture(String def, Object item)
|
||||
{
|
||||
if (item instanceof ITextureProvider)
|
||||
{
|
||||
return ((ITextureProvider)item).getTextureFile();
|
||||
}
|
||||
else
|
||||
{
|
||||
return def;
|
||||
}
|
||||
}
|
||||
|
||||
public static void renderCustomItem(ICustomItemRenderer customRenderer, RenderBlocks renderBlocks,int itemID, int meta, float f) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
if (renderBlocks.useInventoryTint) {
|
||||
int j = 0xffffff;//block.getRenderColor(i);
|
||||
float f1 = (float) (j >> 16 & 0xff) / 255F;
|
||||
float f3 = (float) (j >> 8 & 0xff) / 255F;
|
||||
float f5 = (float) (j & 0xff) / 255F;
|
||||
GL11.glColor4f(f1 * f, f3 * f, f5 * f, 1.0F);
|
||||
}
|
||||
|
||||
// ModLoader.RenderInvBlock(this, block, i, k);
|
||||
customRenderer.renderInventory(renderBlocks, itemID, meta);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.ItemStack;
|
||||
|
||||
/**
|
||||
* This interface has to be implemented by an instance of ItemArmor.
|
||||
* It allows for the application of a custom texture file to the player skin
|
||||
* when the armor is worn.
|
||||
*/
|
||||
public interface IArmorTextureProvider {
|
||||
|
||||
/**
|
||||
* This interface has to return the path to a file that is the same
|
||||
* format as iron_1.png (or any of the other armor files). It will be
|
||||
* applied to the player skin when the armor is worn.
|
||||
*/
|
||||
public String getArmorTextureFile(ItemStack itemstack);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.RenderBlocks;
|
||||
|
||||
public interface ICustomItemRenderer {
|
||||
public void renderInventory (RenderBlocks renderblocks, int itemID, int meta);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.EntityPlayer;
|
||||
import net.minecraft.src.EnumStatus;
|
||||
import net.minecraft.src.RenderGlobal;
|
||||
import net.minecraft.src.EntityPlayer;
|
||||
import net.minecraft.src.MovingObjectPosition;
|
||||
import net.minecraft.src.ItemStack;
|
||||
|
||||
public interface IHighlightHandler {
|
||||
/**
|
||||
* Allow custom handling of highlights. Return true if the hilight has
|
||||
* been handled.
|
||||
*/
|
||||
public boolean onBlockHighlight(RenderGlobal renderglobal,
|
||||
EntityPlayer player, MovingObjectPosition mop, int i,
|
||||
ItemStack itemstack, float f);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
public interface IRenderContextHandler {
|
||||
/** Run before the specified rendering context.
|
||||
*/
|
||||
public void beforeRenderContext();
|
||||
|
||||
/** Run after the specified rendering context.
|
||||
*/
|
||||
public void afterRenderContext();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.RenderGlobal;
|
||||
|
||||
public interface IRenderWorldLastHandler {
|
||||
/** Called after rendering all the 3D data of the world. This is
|
||||
* called before the user's tool is rendered, but otherwise after all
|
||||
* 3D content. It is called twice in anaglyph mode. This is intended
|
||||
* for rendering visual effect overlays into the world.
|
||||
*/
|
||||
void onRenderWorldLast(RenderGlobal rg, float f);
|
||||
}
|
||||
|
||||
@@ -6,47 +6,85 @@
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.Item;
|
||||
import net.minecraft.src.ModLoader;
|
||||
import net.minecraft.src.RenderBlocks;
|
||||
import net.minecraft.src.Tessellator;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class MinecraftForgeClient {
|
||||
|
||||
public static void beforeBlockRender(Block block, RenderBlocks renderblocks) {
|
||||
if (block instanceof ITextureProvider
|
||||
&& renderblocks.overrideBlockTexture == -1) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, -1F, 0.0F);
|
||||
/**
|
||||
* Registers a new block highlight handler.
|
||||
*/
|
||||
public static void registerHighlightHandler(IHighlightHandler handler) {
|
||||
ForgeHooksClient.highlightHandlers.add(handler);
|
||||
}
|
||||
|
||||
GL11.glBindTexture(3553 /* GL_TEXTURE_2D */, ModLoader
|
||||
.getMinecraftInstance().renderEngine
|
||||
.getTexture(((ITextureProvider) (block)).getTextureFile()));
|
||||
/** Register a new render context handler. A render context is a block
|
||||
* of rendering performed with similar OpenGL modes, for example,
|
||||
* texture name.
|
||||
* @param tex The name of the texture for this render context.
|
||||
* @param sub The subid of this render context. 0 is the default pass
|
||||
* for normal rendering, higher subids render later. All subids of 0
|
||||
* will render before all subids of 1, etc.
|
||||
* @param handler The handler to register.
|
||||
*/
|
||||
public static void registerRenderContextHandler(String tex, int sub,
|
||||
IRenderContextHandler handler) {
|
||||
ForgeHooksClient.registerRenderContextHandler(tex,sub,handler);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void afterBlockRender(Block block, RenderBlocks renderblocks) {
|
||||
if (block instanceof ITextureProvider
|
||||
&& renderblocks.overrideBlockTexture == -1) {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
/** Bind a texture. This is used to bind a texture file when
|
||||
* performing your own rendering, rather than using ITextureProvider.
|
||||
*
|
||||
* This variation is reserved for future expansion.
|
||||
*/
|
||||
public static void bindTexture(String name, int sub) {
|
||||
ForgeHooksClient.bindTexture(name,sub);
|
||||
}
|
||||
|
||||
GL11.glBindTexture(3553 /* GL_TEXTURE_2D */, ModLoader
|
||||
.getMinecraftInstance().renderEngine
|
||||
.getTexture("/terrain.png"));
|
||||
}
|
||||
}
|
||||
|
||||
public static void overrideTexture (Object o) {
|
||||
if (o instanceof ITextureProvider) {
|
||||
GL11.glBindTexture(3553 /* GL_TEXTURE_2D */, ModLoader
|
||||
.getMinecraftInstance().renderEngine
|
||||
.getTexture(((ITextureProvider) (o))
|
||||
.getTextureFile()));
|
||||
}
|
||||
}
|
||||
/** Bind a texture. This is used to bind a texture file when
|
||||
* performing your own rendering, rather than using ITextureProvider.
|
||||
*/
|
||||
public static void bindTexture(String name) {
|
||||
ForgeHooksClient.bindTexture(name,0);
|
||||
}
|
||||
|
||||
/** Unbind a texture. This binds the default texture, when you are
|
||||
* finished performing custom rendering.
|
||||
*/
|
||||
public static void unbindTexture() {
|
||||
ForgeHooksClient.unbindTexture();
|
||||
}
|
||||
|
||||
/** Preload a texture. Textures must be preloaded before the first
|
||||
* use, or they will cause visual anomalies.
|
||||
*/
|
||||
public static void preloadTexture(String texture) {
|
||||
ModLoader.getMinecraftInstance().renderEngine
|
||||
.getTexture(texture);
|
||||
}
|
||||
|
||||
/** Render a block. Render a block which may have a custom texture.
|
||||
*/
|
||||
public static void renderBlock(RenderBlocks rb, Block bl, int i, int
|
||||
j, int k) {
|
||||
ForgeHooksClient.beforeBlockRender(bl,rb);
|
||||
rb.renderBlockByRenderType(bl,i,j,k);
|
||||
ForgeHooksClient.afterBlockRender(bl,rb);
|
||||
}
|
||||
|
||||
/** Get the current render pass.
|
||||
*/
|
||||
public static int getRenderPass() {
|
||||
return ForgeHooksClient.renderPass;
|
||||
}
|
||||
|
||||
private static ICustomItemRenderer [] customItemRenderers = new ICustomItemRenderer [Item.itemsList.length];
|
||||
|
||||
public static void registerCustomItemRenderer (int itemID, ICustomItemRenderer renderer) {
|
||||
customItemRenderers [itemID] = renderer;
|
||||
}
|
||||
|
||||
public static ICustomItemRenderer getCustomItemRenderer (int itemID) {
|
||||
return customItemRenderers [itemID];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
public class ArmorProperties {
|
||||
public int damageRemove = 0;
|
||||
public boolean allowRegularComputation = false;
|
||||
|
||||
public ArmorProperties () {
|
||||
|
||||
}
|
||||
|
||||
public ArmorProperties (int damageRemove, boolean allowRegularCompuation) {
|
||||
this.damageRemove = damageRemove;
|
||||
this.allowRegularComputation = allowRegularCompuation;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import java.util.Random;
|
||||
import net.minecraft.src.ItemStack;
|
||||
|
||||
/**
|
||||
*
|
||||
* Used to hold a list of all items that can be spawned in a world dungeon
|
||||
*
|
||||
*/
|
||||
public class DungeonLoot
|
||||
{
|
||||
private ItemStack item;
|
||||
private int minCount = 1;
|
||||
private int maxCount = 1;
|
||||
|
||||
/**
|
||||
* @param item A item stack
|
||||
* @param min Minimum stack size when randomly generating
|
||||
* @param max Maximum stack size when randomly generating
|
||||
*/
|
||||
public DungeonLoot(ItemStack item, int min, int max)
|
||||
{
|
||||
this.item = item;
|
||||
minCount = min;
|
||||
maxCount = max;
|
||||
}
|
||||
|
||||
/**
|
||||
* Grabs a ItemStack ready to be added to the dungeon chest,
|
||||
* the stack size will be between minCount and maxCount
|
||||
* @param rand World gen random number generator
|
||||
* @return The ItemStack to be added to the chest
|
||||
*/
|
||||
public ItemStack generateStack(Random rand)
|
||||
{
|
||||
ItemStack ret = this.item.copy();
|
||||
ret.stackSize = minCount + (rand.nextInt(maxCount - minCount + 1));
|
||||
return ret;
|
||||
}
|
||||
|
||||
public boolean equals(ItemStack item, int min, int max)
|
||||
{
|
||||
return (min == minCount && max == maxCount && item.isItemEqual(this.item));
|
||||
}
|
||||
|
||||
public boolean equals(ItemStack item)
|
||||
{
|
||||
return item.isItemEqual(this.item);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,342 @@
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.*;
|
||||
import java.lang.reflect.*;
|
||||
import java.util.*;
|
||||
|
||||
public class EnumHelper {
|
||||
private static Object reflectionFactory = null;
|
||||
private static Method newConstructorAccessor = null;
|
||||
private static Method newInstance = null;
|
||||
private static Method newFieldAccessor = null;
|
||||
private static Method fieldAccessorSet = null;
|
||||
private static boolean isSetup = false;
|
||||
|
||||
//Some enums are decompiled with extra arguments, so lets check for that
|
||||
private static Class[][] ctrs = {
|
||||
{EnumAction.class},
|
||||
{EnumArmorMaterial.class, int.class, int[].class, int.class},
|
||||
{EnumArt.class, String.class, int.class, int.class, int.class, int.class},
|
||||
{EnumCreatureAttribute.class},
|
||||
{EnumCreatureType.class, Class.class, int.class, Material.class, boolean.class},
|
||||
{EnumDoor.class},
|
||||
{EnumEnchantmentType.class},
|
||||
{EnumMobType.class},
|
||||
{EnumMovingObjectType.class},
|
||||
{EnumSkyBlock.class, int.class},
|
||||
{EnumStatus.class},
|
||||
{EnumToolMaterial.class, int.class, int.class, float.class, int.class, int.class}
|
||||
};
|
||||
|
||||
private static boolean[] decompiled = new boolean[ctrs.length];
|
||||
|
||||
public static EnumAction addAction(String name)
|
||||
{
|
||||
if (!isSetup)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
return addEnum(decompiled[0], EnumAction.class, name,
|
||||
new Class[] {},
|
||||
new Object[]{});
|
||||
}
|
||||
public static EnumArmorMaterial addArmorMaterial(String name, int durability, int[] reductionAmounts, int enchantability)
|
||||
{
|
||||
if (!isSetup)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
return addEnum(decompiled[1], EnumArmorMaterial.class, name,
|
||||
new Class[] { int.class, int[].class, int.class },
|
||||
new Object[]{ durability, reductionAmounts, enchantability });
|
||||
}
|
||||
public static EnumArt addArt(String name, String tile, int sizeX, int sizeY, int offsetX, int offsetY)
|
||||
{
|
||||
if (!isSetup)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
return addEnum(decompiled[2], EnumArt.class, name,
|
||||
new Class[] {String.class, int.class, int.class, int.class, int.class},
|
||||
new Object[]{tile, sizeX, sizeY, offsetX, offsetY});
|
||||
}
|
||||
public static EnumCreatureAttribute addCreatureAttribute(String name)
|
||||
{
|
||||
if (!isSetup)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
return addEnum(decompiled[3], EnumCreatureAttribute.class, name,
|
||||
new Class[] {},
|
||||
new Object[]{});
|
||||
}
|
||||
public static EnumCreatureType addCreatureType(String name, Class typeClass, int maxNumber, Material material, boolean peaceful)
|
||||
{
|
||||
if (!isSetup)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
return addEnum(decompiled[4], EnumCreatureType.class, name,
|
||||
new Class[] {Class.class, int.class, Material.class, boolean.class},
|
||||
new Object[]{typeClass, maxNumber, material, peaceful});
|
||||
}
|
||||
public static EnumDoor addDoor(String name)
|
||||
{
|
||||
if (!isSetup)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
return addEnum(decompiled[5], EnumDoor.class, name,
|
||||
new Class[] {},
|
||||
new Object[]{});
|
||||
}
|
||||
public static EnumEnchantmentType addEnchantmentType(String name)
|
||||
{
|
||||
if (!isSetup)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
return addEnum(decompiled[6], EnumEnchantmentType.class, name,
|
||||
new Class[] {},
|
||||
new Object[]{});
|
||||
}
|
||||
public static EnumMobType addMobType(String name)
|
||||
{
|
||||
if (!isSetup)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
return addEnum(decompiled[7], EnumMobType.class, name,
|
||||
new Class[] {},
|
||||
new Object[]{});
|
||||
}
|
||||
public static EnumMovingObjectType addMovingObjectType(String name)
|
||||
{
|
||||
if (!isSetup)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
return addEnum(decompiled[8], EnumMovingObjectType.class, name,
|
||||
new Class[] {},
|
||||
new Object[]{});
|
||||
}
|
||||
public static EnumSkyBlock addSkyBlock(String name, int lightValue)
|
||||
{
|
||||
if (!isSetup)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
return addEnum(decompiled[9], EnumSkyBlock.class, name,
|
||||
new Class[] {int.class },
|
||||
new Object[]{lightValue});
|
||||
}
|
||||
public static EnumStatus addStatus(String name)
|
||||
{
|
||||
if (!isSetup)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
return addEnum(decompiled[10], EnumStatus.class, name,
|
||||
new Class[] {},
|
||||
new Object[]{});
|
||||
}
|
||||
public static EnumToolMaterial addToolMaterial(String name, int harvestLevel, int maxUses, float efficiency, int damage, int enchantability)
|
||||
{
|
||||
if (!isSetup)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
return addEnum(decompiled[11], EnumToolMaterial.class, name,
|
||||
new Class[] { int.class, int.class, float.class, int.class, int.class },
|
||||
new Object[]{ harvestLevel, maxUses, efficiency, damage, enchantability });
|
||||
}
|
||||
|
||||
private static void setup()
|
||||
{
|
||||
if (isSetup)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//System.out.println("Enum Helper Initalizing: ");
|
||||
for(int x = 0; x < ctrs.length; x++)
|
||||
{
|
||||
try {
|
||||
Class<?>[] enumHeaders = new Class[ctrs[x].length + 3];
|
||||
enumHeaders[0] = String.class;
|
||||
enumHeaders[1] = int.class;
|
||||
enumHeaders[2] = String.class;
|
||||
enumHeaders[3] = int.class;
|
||||
|
||||
for (int y = 1; y < ctrs[x].length; y++)
|
||||
enumHeaders[3 + y] = ctrs[x][y];
|
||||
|
||||
ctrs[x][0].getDeclaredConstructor(enumHeaders);
|
||||
decompiled[x] = true;
|
||||
|
||||
} catch(Exception e) {
|
||||
//Nom Nom Nom
|
||||
}
|
||||
//System.out.format("\t%-25s %s\r\n", ctrs[x][0].getName().replace("net.minecraft.src.", ""), decompiled[x]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
try {
|
||||
Method getReflectionFactory = Class.forName("sun.reflect.ReflectionFactory").getDeclaredMethod("getReflectionFactory");
|
||||
reflectionFactory = getReflectionFactory.invoke(null);
|
||||
newConstructorAccessor = Class.forName("sun.reflect.ReflectionFactory").getDeclaredMethod("newConstructorAccessor", Constructor.class);
|
||||
newInstance = Class.forName("sun.reflect.ConstructorAccessor").getDeclaredMethod("newInstance", Object[].class);
|
||||
newFieldAccessor = Class.forName("sun.reflect.ReflectionFactory").getDeclaredMethod("newFieldAccessor", Field.class, boolean.class);
|
||||
fieldAccessorSet = Class.forName("sun.reflect.FieldAccessor").getDeclaredMethod("set", Object.class, Object.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
isSetup = true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Everything below this is found at the site below, and updated to be able to compile in Eclipse/Java 1.6+
|
||||
* Also modified for use in decompiled code.
|
||||
* Found at: http://niceideas.ch/roller2/badtrash/entry/java_create_enum_instances_dynamically
|
||||
*/
|
||||
|
||||
private static Object getConstructorAccessor(boolean decompiled, Class<?> enumClass, Class<?>[] additionalParameterTypes) throws Exception {
|
||||
Class<?>[] parameterTypes = null;
|
||||
if (decompiled)
|
||||
{
|
||||
parameterTypes = new Class[additionalParameterTypes.length + 4];
|
||||
parameterTypes[0] = String.class;
|
||||
parameterTypes[1] = int.class;
|
||||
parameterTypes[2] = String.class;
|
||||
parameterTypes[3] = int.class;
|
||||
System.arraycopy(additionalParameterTypes, 0, parameterTypes, 4, additionalParameterTypes.length);
|
||||
}
|
||||
else
|
||||
{
|
||||
parameterTypes = new Class[additionalParameterTypes.length + 2];
|
||||
parameterTypes[0] = String.class;
|
||||
parameterTypes[1] = int.class;
|
||||
System.arraycopy(additionalParameterTypes, 0, parameterTypes, 2, additionalParameterTypes.length);
|
||||
}
|
||||
return newConstructorAccessor.invoke(reflectionFactory, enumClass.getDeclaredConstructor(parameterTypes));
|
||||
}
|
||||
|
||||
private static <T extends Enum<?>> T makeEnum(boolean decompiled, Class<T> enumClass, String value, int ordinal, Class<?>[] additionalTypes, Object[] additionalValues) throws Exception {
|
||||
Object[] parms = null;
|
||||
if (decompiled)
|
||||
{
|
||||
parms = new Object[additionalValues.length + 4];
|
||||
parms[0] = value;
|
||||
parms[1] = Integer.valueOf(ordinal);
|
||||
parms[2] = value;
|
||||
parms[3] = Integer.valueOf(ordinal);
|
||||
System.arraycopy(additionalValues, 0, parms, 4, additionalValues.length);
|
||||
}
|
||||
else
|
||||
{
|
||||
parms = new Object[additionalValues.length + 2];
|
||||
parms[0] = value;
|
||||
parms[1] = Integer.valueOf(ordinal);
|
||||
System.arraycopy(additionalValues, 0, parms, 2, additionalValues.length);
|
||||
}
|
||||
return enumClass.cast(newInstance.invoke(getConstructorAccessor(decompiled, enumClass, additionalTypes), new Object[]{parms}));
|
||||
}
|
||||
|
||||
private static void setFailsafeFieldValue(Field field, Object target, Object value) throws Exception {
|
||||
field.setAccessible(true);
|
||||
Field modifiersField = Field.class.getDeclaredField("modifiers");
|
||||
modifiersField.setAccessible(true);
|
||||
modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL);
|
||||
Object fieldAccessor = newFieldAccessor.invoke(reflectionFactory, field, false);
|
||||
fieldAccessorSet.invoke(fieldAccessor, target, value);
|
||||
}
|
||||
|
||||
private static void blankField(Class<?> enumClass, String fieldName) throws Exception {
|
||||
for (Field field : Class.class.getDeclaredFields()) {
|
||||
if (field.getName().contains(fieldName)) {
|
||||
field.setAccessible(true);
|
||||
setFailsafeFieldValue(field, enumClass, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void cleanEnumCache(Class<?> enumClass) throws Exception {
|
||||
blankField(enumClass, "enumConstantDirectory");
|
||||
blankField(enumClass, "enumConstants");
|
||||
}
|
||||
|
||||
public static <T extends Enum<?>> T addEnum(Class<T> enumType, String enumName, boolean decompiled) {
|
||||
return addEnum(decompiled, enumType, enumName, new Class<?>[]{}, new Object[]{});
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T extends Enum<?>> T addEnum(boolean decompiled, Class<T> enumType, String enumName, Class<?>[] paramTypes, Object[] paramValues) {
|
||||
if (!isSetup)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
|
||||
Field valuesField = null;
|
||||
Field[] fields = enumType.getDeclaredFields();
|
||||
int flags = Modifier.PRIVATE | Modifier.STATIC | Modifier.FINAL | 0x1000 /*SYNTHETIC*/;
|
||||
String valueType = String.format("[L%s;", enumType.getName().replace('.', '/'));
|
||||
|
||||
for (Field field : fields) {
|
||||
if (decompiled)
|
||||
{
|
||||
if (field.getName().contains("$VALUES"))
|
||||
{
|
||||
valuesField = field;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((field.getModifiers() & flags) == flags &&
|
||||
field.getType().getName().replace('.', '/').equals(valueType)) //Apparently some JVMs return .'s and some don't..
|
||||
{
|
||||
valuesField = field;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
valuesField.setAccessible(true);
|
||||
|
||||
try {
|
||||
T[] previousValues = (T[])valuesField.get(enumType);
|
||||
List<T> values = new ArrayList<T>(Arrays.asList(previousValues));
|
||||
T newValue = (T)makeEnum(decompiled, enumType, enumName, values.size(), paramTypes, paramValues);
|
||||
values.add(newValue);
|
||||
setFailsafeFieldValue(valuesField, null, values.toArray((T[]) Array.newInstance(enumType, 0)));
|
||||
cleanEnumCache(enumType);
|
||||
|
||||
return newValue;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
if (!isSetup)
|
||||
{
|
||||
setup();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,316 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
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.*;
|
||||
|
||||
public class ForgeHooks {
|
||||
// TODO: move all app-side hooks from MinecraftForge
|
||||
|
||||
|
||||
// List Handling Hooks
|
||||
// ------------------------------------------------------------
|
||||
public static void onTakenFromCrafting(EntityPlayer player, ItemStack ist,
|
||||
IInventory craftMatrix) {
|
||||
for (ICraftingHandler handler : craftingHandlers) {
|
||||
handler.onTakenFromCrafting(player,ist,craftMatrix);
|
||||
}
|
||||
}
|
||||
|
||||
static LinkedList<ICraftingHandler> craftingHandlers = new LinkedList<ICraftingHandler>();
|
||||
|
||||
public static void onDestroyCurrentItem(EntityPlayer player, ItemStack orig) {
|
||||
for (IDestroyToolHandler handler : destroyToolHandlers) {
|
||||
handler.onDestroyCurrentItem(player,orig);
|
||||
}
|
||||
}
|
||||
|
||||
static LinkedList<IDestroyToolHandler> destroyToolHandlers = new LinkedList<IDestroyToolHandler>();
|
||||
|
||||
public static boolean onUseBonemeal(World world,
|
||||
int bid, int i, int j, int k) {
|
||||
for(IBonemealHandler handler : bonemealHandlers) {
|
||||
if(handler.onUseBonemeal(world,bid,i,j,k))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static LinkedList<IBonemealHandler> bonemealHandlers = new LinkedList<IBonemealHandler>();
|
||||
|
||||
public static boolean onUseHoe(ItemStack hoe, EntityPlayer player,
|
||||
World world, int i, int j, int k) {
|
||||
for(IHoeHandler handler : hoeHandlers) {
|
||||
if(handler.onUseHoe(hoe,player,world,i,j,k))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static LinkedList<IHoeHandler> hoeHandlers = new LinkedList<IHoeHandler>();
|
||||
|
||||
public static EnumStatus sleepInBedAt(EntityPlayer player, int i, int j, int k) {
|
||||
for (ISleepHandler handler : sleepHandlers) {
|
||||
EnumStatus status = handler.sleepInBedAt(player, i, j, k);
|
||||
if (status != null)
|
||||
return status;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
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
|
||||
// ------------------------------------------------------------
|
||||
static class ProbableItem {
|
||||
public ProbableItem(int item, int md, int q, int st, int e) {
|
||||
wstart=st; wend=e;
|
||||
itemid=item; meta=md;
|
||||
qty=q;
|
||||
}
|
||||
int wstart, wend;
|
||||
int itemid, meta;
|
||||
int qty;
|
||||
}
|
||||
|
||||
static ProbableItem getRandomItem(List<ProbableItem> list, int prop) {
|
||||
int n=Collections.binarySearch(list,prop,new Comparator(){
|
||||
public int compare(Object o1, Object o2) {
|
||||
ProbableItem pi=(ProbableItem)o1;
|
||||
Integer i1=(Integer)o2;
|
||||
if(i1<pi.wstart) return 1;
|
||||
if(i1>=pi.wend) return -1;
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
if(n<0) return null;
|
||||
return list.get(n);
|
||||
}
|
||||
|
||||
static List<ProbableItem> plantGrassList;
|
||||
static int plantGrassWeight;
|
||||
|
||||
static List<ProbableItem> seedGrassList;
|
||||
static int seedGrassWeight;
|
||||
|
||||
static {
|
||||
plantGrassList=new ArrayList<ProbableItem>();
|
||||
plantGrassList.add(new ProbableItem(
|
||||
Block.plantYellow.blockID,0,1,0,20));
|
||||
plantGrassList.add(new ProbableItem(
|
||||
Block.plantRed.blockID,0,1,20,30));
|
||||
plantGrassWeight=30;
|
||||
|
||||
seedGrassList=new ArrayList<ProbableItem>();
|
||||
seedGrassList.add(new ProbableItem(
|
||||
Item.seeds.shiftedIndex,0,1,0,10));
|
||||
seedGrassWeight=10;
|
||||
}
|
||||
|
||||
public static void plantGrassPlant(World world, int i, int j, int k) {
|
||||
int n=world.rand.nextInt(plantGrassWeight);
|
||||
ProbableItem pi=getRandomItem(plantGrassList,n);
|
||||
if(pi==null) return;
|
||||
world.setBlockAndMetadataWithNotify(i,j,k,pi.itemid,pi.meta);
|
||||
}
|
||||
|
||||
public static void addPlantGrass(int item, int md, int prop) {
|
||||
plantGrassList.add(new ProbableItem(
|
||||
item,md,1,plantGrassWeight,plantGrassWeight+prop));
|
||||
plantGrassWeight+=prop;
|
||||
}
|
||||
|
||||
public static ItemStack getGrassSeed(World world) {
|
||||
int n=world.rand.nextInt(seedGrassWeight);
|
||||
ProbableItem pi=getRandomItem(seedGrassList,n);
|
||||
if(pi==null) return null;
|
||||
return new ItemStack(pi.itemid,pi.qty,pi.meta);
|
||||
}
|
||||
|
||||
public static void addGrassSeed(int item, int md, int qty, int prop) {
|
||||
seedGrassList.add(new ProbableItem(
|
||||
item,md,qty,seedGrassWeight,seedGrassWeight+prop));
|
||||
seedGrassWeight+=prop;
|
||||
}
|
||||
|
||||
// Tool Path
|
||||
// ------------------------------------------------------------
|
||||
public static boolean canHarvestBlock(Block bl,
|
||||
EntityPlayer player, int md) {
|
||||
if(bl.blockMaterial.getIsHarvestable())
|
||||
return true;
|
||||
ItemStack itemstack = player.inventory.getCurrentItem();
|
||||
if(itemstack == null) return false;
|
||||
|
||||
List tc=(List)toolClasses.get(itemstack.itemID);
|
||||
if(tc==null) return itemstack.canHarvestBlock(bl);
|
||||
Object[] ta=tc.toArray();
|
||||
String cls=(String)ta[0]; int hvl=(Integer)ta[1];
|
||||
|
||||
Integer bhl=(Integer)toolHarvestLevels.get(Arrays.asList(
|
||||
bl.blockID,md,cls));
|
||||
if(bhl==null) return itemstack.canHarvestBlock(bl);
|
||||
if(bhl>hvl) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public static float blockStrength(Block bl,
|
||||
EntityPlayer player, int md) {
|
||||
float bh=bl.getHardness(md);
|
||||
if(bh < 0.0F) return 0.0F;
|
||||
|
||||
if(!canHarvestBlock(bl,player,md)) {
|
||||
return 1.0F / bh / 100F;
|
||||
} else {
|
||||
return player.getCurrentPlayerStrVsBlock(bl,md) /
|
||||
bh / 30F;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isToolEffective(ItemStack ist, Block bl, int md) {
|
||||
List tc = (List)toolClasses.get(ist.itemID);
|
||||
if (tc == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Object[] ta = tc.toArray();
|
||||
String cls = (String)ta[0];
|
||||
return toolEffectiveness.contains(Arrays.asList(bl.blockID, md, cls));
|
||||
}
|
||||
|
||||
static void initTools() {
|
||||
if(toolInit)
|
||||
{
|
||||
return;
|
||||
}
|
||||
toolInit = true;
|
||||
|
||||
MinecraftForge.setToolClass(Item.pickaxeWood, "pickaxe", 0);
|
||||
MinecraftForge.setToolClass(Item.pickaxeStone, "pickaxe", 1);
|
||||
MinecraftForge.setToolClass(Item.pickaxeSteel, "pickaxe", 2);
|
||||
MinecraftForge.setToolClass(Item.pickaxeGold, "pickaxe", 0);
|
||||
MinecraftForge.setToolClass(Item.pickaxeDiamond, "pickaxe", 3);
|
||||
|
||||
MinecraftForge.setToolClass(Item.axeWood, "axe", 0);
|
||||
MinecraftForge.setToolClass(Item.axeStone, "axe", 1);
|
||||
MinecraftForge.setToolClass(Item.axeSteel, "axe", 2);
|
||||
MinecraftForge.setToolClass(Item.axeGold, "axe", 0);
|
||||
MinecraftForge.setToolClass(Item.axeDiamond, "axe", 3);
|
||||
|
||||
MinecraftForge.setToolClass(Item.shovelWood, "shovel", 0);
|
||||
MinecraftForge.setToolClass(Item.shovelStone, "shovel", 1);
|
||||
MinecraftForge.setToolClass(Item.shovelSteel, "shovel", 2);
|
||||
MinecraftForge.setToolClass(Item.shovelGold, "shovel", 0);
|
||||
MinecraftForge.setToolClass(Item.shovelDiamond, "shovel", 3);
|
||||
|
||||
MinecraftForge.setBlockHarvestLevel(Block.obsidian, "pickaxe", 3);
|
||||
MinecraftForge.setBlockHarvestLevel(Block.oreDiamond, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(Block.blockDiamond, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(Block.oreGold, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(Block.blockGold, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(Block.oreIron, "pickaxe", 1);
|
||||
MinecraftForge.setBlockHarvestLevel(Block.blockSteel, "pickaxe", 1);
|
||||
MinecraftForge.setBlockHarvestLevel(Block.oreLapis, "pickaxe", 1);
|
||||
MinecraftForge.setBlockHarvestLevel(Block.blockLapis, "pickaxe", 1);
|
||||
MinecraftForge.setBlockHarvestLevel(Block.oreRedstone, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(Block.oreRedstoneGlowing, "pickaxe", 2);
|
||||
MinecraftForge.removeBlockEffectiveness(Block.oreRedstone, "pickaxe");
|
||||
MinecraftForge.removeBlockEffectiveness(Block.obsidian, "pickaxe");
|
||||
MinecraftForge.removeBlockEffectiveness(Block.oreRedstoneGlowing, "pickaxe");
|
||||
|
||||
Block[] pickeff = {
|
||||
Block.cobblestone, Block.stairDouble,
|
||||
Block.stairSingle, Block.stone,
|
||||
Block.sandStone, Block.cobblestoneMossy,
|
||||
Block.oreCoal, Block.ice,
|
||||
Block.netherrack, Block.oreLapis,
|
||||
Block.blockLapis
|
||||
};
|
||||
for (Block bl : pickeff)
|
||||
{
|
||||
MinecraftForge.setBlockHarvestLevel(bl, "pickaxe", 0);
|
||||
}
|
||||
|
||||
Block[] spadeEff = {
|
||||
Block.grass, Block.dirt,
|
||||
Block.sand, Block.gravel,
|
||||
Block.snow, Block.blockSnow,
|
||||
Block.blockClay, Block.tilledField,
|
||||
Block.slowSand, Block.mycelium
|
||||
};
|
||||
for (Block bl : spadeEff)
|
||||
{
|
||||
MinecraftForge.setBlockHarvestLevel(bl, "shovel", 0);
|
||||
}
|
||||
|
||||
Block[] axeEff = {
|
||||
Block.planks, Block.bookShelf,
|
||||
Block.wood, Block.chest,
|
||||
Block.stairDouble, Block.stairSingle,
|
||||
Block.pumpkin, Block.pumpkinLantern
|
||||
};
|
||||
for (Block bl : axeEff)
|
||||
{
|
||||
MinecraftForge.setBlockHarvestLevel(bl, "axe", 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static final int majorVersion=1;
|
||||
public static final int minorVersion=3;
|
||||
public static final int revisionVersion=1;
|
||||
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;
|
||||
static HashMap toolClasses=new HashMap();
|
||||
static HashMap toolHarvestLevels=new HashMap();
|
||||
static HashSet toolEffectiveness=new HashSet();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.World;
|
||||
|
||||
/**
|
||||
* This interface provides access to a number of secondary block properties through providing
|
||||
* overrides to methods within world.class.
|
||||
*
|
||||
* This interface is DEPRECATED. The functions are now provided directly by
|
||||
* Block.
|
||||
*/
|
||||
|
||||
public interface IBlockSecondaryProperties
|
||||
{
|
||||
/**
|
||||
* Return true if this block should be treated as a normal cube by game logic
|
||||
* (this is independant of rendering), false otherwise. This allows for things like secondary
|
||||
* blocks (torches, rails, redstone dust, etc.) being attached to the surface of
|
||||
* the block regardless of whether it is opaque, or posesses other rendering properties that
|
||||
* would not normally make this possible.
|
||||
*/
|
||||
public boolean isBlockNormalCube( World world, int i, int j, int k );
|
||||
|
||||
/**
|
||||
* Return true if this block can be replaced by another by the player, false otherwise. This provides
|
||||
* a means of allowing blocks to not be considered when the player attempts to place another within
|
||||
* their bounds, in the same way that water, lava, fire, and some other blocks behave within the game.
|
||||
* Provides an override to the coresponding section in canBlockBePlacedAt() in world.class
|
||||
*/
|
||||
public boolean isBlockReplaceable( World world, int i, int j, int k );
|
||||
|
||||
/**
|
||||
* Return true if this block should set fire and deal fire damage to entities coming into contact with
|
||||
* it, false otherwise. Provides an override to the related test within isBoundingBoxBurning() within
|
||||
* world.class
|
||||
*/
|
||||
public boolean isBlockBurning( World world, int i, int j, int k );
|
||||
|
||||
/**
|
||||
* Return true if this block should be treated as an air block by the rest of the code, false
|
||||
* otherwise. This method is primarily useful for creating pure logic-blocks that will be invisible
|
||||
* to the player and otherwise interact as air would.
|
||||
* Provides an override to isAirBlock() within world.class
|
||||
*/
|
||||
public boolean isAirBlock( World world, int i, int j, int k );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.World;
|
||||
|
||||
public interface IBonemealHandler {
|
||||
/** Called when bonemeal is used on a block. This is also called for
|
||||
* multiplayer servers, which must still return true if appropriate but
|
||||
* shouldn't actually perform world manipulation.
|
||||
* @return true to use up the bonemeal and stop processing.
|
||||
*/
|
||||
public boolean onUseBonemeal(World world, int bid, int i, int j, int k);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.IInventory;
|
||||
import net.minecraft.src.EntityPlayer;
|
||||
import net.minecraft.src.ItemStack;
|
||||
|
||||
public interface ICraftingHandler {
|
||||
|
||||
/**
|
||||
* Called after an item is taken from crafting.
|
||||
*/
|
||||
public void onTakenFromCrafting(EntityPlayer player, ItemStack ist,
|
||||
IInventory craftMatrix);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.ItemStack;
|
||||
import net.minecraft.src.EntityPlayer;
|
||||
|
||||
public interface IDestroyToolHandler {
|
||||
/** Called when the user's currently equipped item is destroyed.
|
||||
*/
|
||||
public void onDestroyCurrentItem(EntityPlayer player, ItemStack orig);
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.ItemTool;
|
||||
|
||||
public interface IHarvestHandler {
|
||||
|
||||
/**
|
||||
* Return true if the tool in parameter is known to be able to harvest
|
||||
* the given block, false if this handler does not know of any particular
|
||||
* harvesting. Other rules may activate the harvesting outside of this
|
||||
* handler. This is typically used to add e.g. blocks only extracted by
|
||||
* diamond pickaxe
|
||||
*
|
||||
* @see MinecraftForge#registerHarvestHandler(IHarvestHandler)
|
||||
*/
|
||||
public boolean canHarvestBlock(ItemTool item, Block block);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.World;
|
||||
import net.minecraft.src.ItemStack;
|
||||
import net.minecraft.src.EntityPlayer;
|
||||
|
||||
public interface IHoeHandler {
|
||||
/** Called when a hoe is used on a block. This is called on both sides
|
||||
* in SMP.
|
||||
* @return true to consume a use of the hoe and return.
|
||||
*/
|
||||
public boolean onUseHoe(ItemStack hoe, EntityPlayer player, World world,
|
||||
int i, int j, int k);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
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);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.ItemStack;
|
||||
|
||||
/** The current list of known classes.
|
||||
* oreTin, oreCopper, oreSilver, oreUranium
|
||||
* ingotTin, ingotCopper, ingotSilver, ingotBrass, ingotBronze
|
||||
* ingotUranium, ingotRefinedIron
|
||||
* dyeBlue
|
||||
* gemRuby, gemEmerald, gemSapphire
|
||||
* itemDropUranium
|
||||
* woodRubber
|
||||
* itemRubber
|
||||
*/
|
||||
|
||||
public interface IOreHandler {
|
||||
/** Called when a new ore is registered with the ore dictionary.
|
||||
* @param oreClass The string class of the ore.
|
||||
* @param ore The ItemStack for the ore.
|
||||
*/
|
||||
public void registerOre(String oreClass, ItemStack ore);
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import net.minecraft.src.World;
|
||||
* to control how it can be replaced
|
||||
*
|
||||
* @see Block
|
||||
* @deprecated. This functionality will be removed soon.
|
||||
*/
|
||||
public interface IOverrideReplace {
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.IInventory;
|
||||
|
||||
/** Inventory ranges mapped by side. This class is implemented by TileEntities
|
||||
* that provide different inventory slot ranges to different sides.
|
||||
*/
|
||||
public interface ISidedInventory extends IInventory {
|
||||
|
||||
/**
|
||||
* Get the start of the side inventory.
|
||||
* @param side The global side to get the start of range.
|
||||
* 0: -Y (bottom side)
|
||||
* 1: +Y (top side)
|
||||
* 2: -Z
|
||||
* 3: +Z
|
||||
* 4: -X
|
||||
* 5: +x
|
||||
*/
|
||||
int getStartInventorySide(int side);
|
||||
|
||||
/**
|
||||
* Get the size of the side inventory.
|
||||
* @param side The global side.
|
||||
*/
|
||||
int getSizeInventorySide(int side);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* This software is provided under the terms of the Minecraft Forge Public
|
||||
* License v1.0.
|
||||
*/
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.EntityPlayer;
|
||||
import net.minecraft.src.EnumStatus;
|
||||
|
||||
public interface ISleepHandler {
|
||||
/**
|
||||
* This is called before a player sleeps in a bed. If it returns a
|
||||
* non-null result, then the normal sleeping process will be skipped, and
|
||||
* the value returned by this method will be returned to
|
||||
* BlockBed.blockActivated.
|
||||
*
|
||||
* @see MinecraftForge#registerSleepHandler(ISleepHandler)
|
||||
*/
|
||||
public EnumStatus sleepInBedAt(EntityPlayer player, int i, int j, int k);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import net.minecraft.src.EntityPlayer;
|
||||
import net.minecraft.src.ItemArmor;
|
||||
|
||||
/**
|
||||
@@ -15,13 +16,10 @@ import net.minecraft.src.ItemArmor;
|
||||
* @see ItemArmor
|
||||
*/
|
||||
public interface ISpecialArmor {
|
||||
/**
|
||||
* This interface will adjust the amount of damage received by the entity.
|
||||
*/
|
||||
public int adjustArmorDamage (int damage);
|
||||
|
||||
/**
|
||||
* When this return true, the regular armor computation will be cancelled
|
||||
* Return extra properties for the armor
|
||||
*/
|
||||
public boolean allowRegularComputation ();
|
||||
public ArmorProperties getProperties(EntityPlayer player,
|
||||
int intitialDamage, int currentDamage);
|
||||
}
|
||||
@@ -14,6 +14,9 @@ import net.minecraft.src.World;
|
||||
* This interface is to be implemented by item classes. It will allow an item
|
||||
* to perform a use before the block is activated.
|
||||
*
|
||||
* @deprecated This interface is no longer used, the function has been moved to
|
||||
* Item. The functionality remains, it simply does not require this interface
|
||||
* any further.
|
||||
* @see Item
|
||||
*/
|
||||
public interface IUseItemFirst {
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -5,32 +5,66 @@
|
||||
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
import net.minecraft.src.BiomeGenBase;
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.EntityMinecart;
|
||||
import net.minecraft.src.Item;
|
||||
import net.minecraft.src.ItemStack;
|
||||
import net.minecraft.src.ItemTool;
|
||||
import net.minecraft.src.World;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class MinecraftForge {
|
||||
|
||||
private static LinkedList<IBucketHandler> bucketHandlers = new LinkedList<IBucketHandler>();
|
||||
private static LinkedList<IHarvestHandler> harvestHandlers = new LinkedList<IHarvestHandler>();
|
||||
/**
|
||||
* Register a new custom bucket handler.
|
||||
*/
|
||||
public static void registerCustomBucketHandler(IBucketHandler handler) {
|
||||
bucketHandlers.add(handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a new custom bucket handler.
|
||||
* Registers a new sleeping handler.
|
||||
*/
|
||||
public static void registerCustomBucketHander(IBucketHandler handler) {
|
||||
bucketHandlers.add(handler);
|
||||
public static void registerSleepHandler(ISleepHandler handler) {
|
||||
ForgeHooks.sleepHandlers.add(handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a new bonemeal handler.
|
||||
*/
|
||||
public static void registerBonemealHandler(IBonemealHandler handler) {
|
||||
ForgeHooks.bonemealHandlers.add(handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a new hoe handler.
|
||||
*/
|
||||
public static void registerHoeHandler(IHoeHandler handler) {
|
||||
ForgeHooks.hoeHandlers.add(handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a new destroy tool handler.
|
||||
*/
|
||||
public static void registerDestroyToolHandler(IDestroyToolHandler handler) {
|
||||
ForgeHooks.destroyToolHandlers.add(handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a new crafting handler.
|
||||
*/
|
||||
public static void registerCraftingHandler(ICraftingHandler handler) {
|
||||
ForgeHooks.craftingHandlers.add(handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a new harvest handler.
|
||||
* Registers a new minecart handler
|
||||
* @param handler The Handler to be registered
|
||||
*/
|
||||
public static void registerHarvestHandler(IHarvestHandler handler) {
|
||||
harvestHandlers.add(handler);
|
||||
public static void registerMinecartHandler(IMinecartHandler handler)
|
||||
{
|
||||
ForgeHooks.minecartHandlers.add(handler);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,28 +82,701 @@ public class MinecraftForge {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is not supposed to be called outside of Minecraft internals.
|
||||
// Ore Dictionary
|
||||
// ------------------------------------------------------------
|
||||
private static LinkedList<IOreHandler> oreHandlers = new LinkedList<IOreHandler>();
|
||||
private static TreeMap<String,List<ItemStack>> oreDict=
|
||||
new TreeMap<String,List<ItemStack>>();
|
||||
|
||||
/** Register a new ore handler. This will automatically call the handler
|
||||
* with all current ores during registration, and every time a new ore is
|
||||
* added later.
|
||||
*/
|
||||
public static boolean canHarvestBlock(ItemTool item, Block block) {
|
||||
for (IHarvestHandler handler : harvestHandlers) {
|
||||
if (handler.canHarvestBlock(item, block)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
public static void registerOreHandler(IOreHandler handler) {
|
||||
oreHandlers.add(handler);
|
||||
|
||||
for(String key : oreDict.keySet()) {
|
||||
List<ItemStack> val=oreDict.get(key);
|
||||
for(ItemStack ist : val) {
|
||||
handler.registerOre(key,ist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Register a new item with the ore dictionary.
|
||||
* @param oreClass The string class of the ore.
|
||||
* @param ore The ItemStack for the ore.
|
||||
*/
|
||||
public static void registerOre(String oreClass, ItemStack ore) {
|
||||
List<ItemStack> orelist=oreDict.get(oreClass);
|
||||
if(orelist==null) {
|
||||
orelist=new ArrayList<ItemStack>();
|
||||
oreDict.put(oreClass,orelist);
|
||||
}
|
||||
orelist.add(ore);
|
||||
for(IOreHandler ioh : oreHandlers) {
|
||||
ioh.registerOre(oreClass,ore);
|
||||
}
|
||||
}
|
||||
|
||||
/** Get the list of ores in a given class.
|
||||
*/
|
||||
public static List<ItemStack> getOreClass(String oreClass) {
|
||||
return oreDict.get(oreClass);
|
||||
}
|
||||
|
||||
public static class OreQuery implements Iterable<Object[]> {
|
||||
Object[] proto;
|
||||
|
||||
public class OreQueryIterator implements Iterator<Object[]> {
|
||||
LinkedList itering;
|
||||
LinkedList output;
|
||||
|
||||
private OreQueryIterator() {
|
||||
itering=new LinkedList();
|
||||
output=new LinkedList();
|
||||
|
||||
for(int i=0; i<proto.length; i++) {
|
||||
if(proto[i] instanceof Collection) {
|
||||
Iterator it=((Collection)proto[i])
|
||||
.iterator();
|
||||
if(!it.hasNext()) {
|
||||
output=null; break;
|
||||
}
|
||||
itering.addLast(it);
|
||||
output.addLast(it.next());
|
||||
} else {
|
||||
itering.addLast(proto[i]);
|
||||
output.addLast(proto[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasNext() {
|
||||
return output!=null;
|
||||
}
|
||||
|
||||
public Object[] next() {
|
||||
Object[] tr=output.toArray();
|
||||
|
||||
Object to;
|
||||
while(true) {
|
||||
if(itering.size()==0) {
|
||||
output=null;
|
||||
return tr;
|
||||
}
|
||||
to=itering.getLast();
|
||||
output.removeLast();
|
||||
if(to instanceof Iterator) {
|
||||
Iterator it=(Iterator)to;
|
||||
if(it.hasNext()) {
|
||||
output.addLast(it.next());
|
||||
break;
|
||||
}
|
||||
}
|
||||
itering.removeLast();
|
||||
}
|
||||
for(int i=itering.size(); i<proto.length; i++) {
|
||||
if(proto[i] instanceof Collection) {
|
||||
Iterator it=((Collection)proto[i])
|
||||
.iterator();
|
||||
if(!it.hasNext()) {
|
||||
output=null; break;
|
||||
}
|
||||
itering.addLast(it);
|
||||
output.addLast(it.next());
|
||||
} else {
|
||||
itering.addLast(proto[i]);
|
||||
output.addLast(proto[i]);
|
||||
}
|
||||
}
|
||||
return tr;
|
||||
}
|
||||
|
||||
public void remove() {}
|
||||
}
|
||||
|
||||
private OreQuery(Object[] pattern) {
|
||||
proto=pattern;
|
||||
}
|
||||
|
||||
public Iterator<Object[]> iterator() {
|
||||
return new OreQueryIterator();
|
||||
}
|
||||
}
|
||||
|
||||
/** Generate all valid legal recipe combinations. Any Lists in pattern
|
||||
* will be fully expanded to all valid combinations.
|
||||
*/
|
||||
public static OreQuery generateRecipes(Object... pattern) {
|
||||
return new OreQuery(pattern);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
|
||||
/** Register a new plant to be planted when bonemeal is used on grass.
|
||||
* @param bid The block ID to plant.
|
||||
* @param md The metadata to plant.
|
||||
* @param prop The relative probability of the plant, where red flowers are
|
||||
* 10 and yellow flowers are 20.
|
||||
*/
|
||||
public static void addGrassPlant(int item, int md, int prop) {
|
||||
ForgeHooks.addPlantGrass(item,md,prop);
|
||||
}
|
||||
|
||||
/** Register a new seed to be dropped when breaking tall grass.
|
||||
* @param bid The item ID of the seeds.
|
||||
* @param md The metadata of the seeds.
|
||||
* @param qty The quantity of seeds to drop.
|
||||
* @param prop The relative probability of the seeds, where wheat seeds are
|
||||
* 10.
|
||||
*/
|
||||
public static void addGrassSeed(int item, int md, int qty, int prop) {
|
||||
ForgeHooks.addGrassSeed(item,md,qty,prop);
|
||||
}
|
||||
|
||||
/** Register a tool as a tool class with a given harvest level.
|
||||
*
|
||||
* @param tool The custom tool to register.
|
||||
* @param tclass The tool class to register as. The predefined tool
|
||||
* clases are "pickaxe", "shovel", "axe". You can add others for custom
|
||||
* tools.
|
||||
* @param hlevel The harvest level of the tool.
|
||||
*/
|
||||
public static void setToolClass(Item tool, String tclass, int hlevel) {
|
||||
ForgeHooks.initTools();
|
||||
ForgeHooks.toolClasses.put(tool.shiftedIndex,
|
||||
Arrays.asList(tclass,hlevel));
|
||||
}
|
||||
|
||||
/** Register a block to be harvested by a tool class. This is the metadata
|
||||
* sensitive version, use it if your blocks are using metadata variants.
|
||||
* By default, this sets the block class as effective against that type.
|
||||
*
|
||||
* @param bl The block to register.
|
||||
* @param md The metadata for the block subtype.
|
||||
* @param tclass The tool class to register as able to remove this block.
|
||||
* You may register the same block multiple times with different tool
|
||||
* classes, if multiple tool types can be used to harvest this block.
|
||||
* @param hlevel The minimum tool harvest level required to successfully
|
||||
* harvest the block.
|
||||
* @see setToolClass for details on tool classes.
|
||||
*/
|
||||
public static void setBlockHarvestLevel(Block bl, int md, String tclass,
|
||||
int hlevel) {
|
||||
ForgeHooks.initTools();
|
||||
List key=Arrays.asList(bl.blockID,md,tclass);
|
||||
ForgeHooks.toolHarvestLevels.put(key,hlevel);
|
||||
ForgeHooks.toolEffectiveness.add(key);
|
||||
}
|
||||
|
||||
/** Remove a block effectiveness mapping. Since setBlockHarvestLevel
|
||||
* makes the tool class effective against the block by default, this can be
|
||||
* used to remove that mapping. This will force a block to be harvested at
|
||||
* the same speed regardless of tool quality, while still requiring a given
|
||||
* harvesting level.
|
||||
* @param bl The block to remove effectiveness from.
|
||||
* @param md The metadata for the block subtype.
|
||||
* @param tclass The tool class to remove the effectiveness mapping from.
|
||||
* @see setToolClass for details on tool classes.
|
||||
*/
|
||||
public static void removeBlockEffectiveness(Block bl, int md,
|
||||
String tclass) {
|
||||
ForgeHooks.initTools();
|
||||
List key=Arrays.asList(bl.blockID,md,tclass);
|
||||
ForgeHooks.toolEffectiveness.remove(key);
|
||||
}
|
||||
|
||||
/** Register a block to be harvested by a tool class.
|
||||
* By default, this sets the block class as effective against that type.
|
||||
*
|
||||
* @param bl The block to register.
|
||||
* @param tclass The tool class to register as able to remove this block.
|
||||
* You may register the same block multiple times with different tool
|
||||
* classes, if multiple tool types can be used to harvest this block.
|
||||
* @param hlevel The minimum tool harvest level required to successfully
|
||||
* harvest the block.
|
||||
* @see setToolClass for details on tool classes.
|
||||
*/
|
||||
public static void setBlockHarvestLevel(Block bl, String tclass,
|
||||
int hlevel) {
|
||||
ForgeHooks.initTools();
|
||||
for(int md=0; md<16; md++) {
|
||||
List key=Arrays.asList(bl.blockID,md,tclass);
|
||||
ForgeHooks.toolHarvestLevels.put(key,hlevel);
|
||||
ForgeHooks.toolEffectiveness.add(key);
|
||||
}
|
||||
}
|
||||
|
||||
/** Remove a block effectiveness mapping. Since setBlockHarvestLevel
|
||||
* makes the tool class effective against the block by default, this can be
|
||||
* used to remove that mapping. This will force a block to be harvested at
|
||||
* the same speed regardless of tool quality, while still requiring a given
|
||||
* harvesting level.
|
||||
* @param bl The block to remove effectiveness from.
|
||||
* @param tclass The tool class to remove the effectiveness mapping from.
|
||||
* @see setToolClass for details on tool classes.
|
||||
*/
|
||||
public static void removeBlockEffectiveness(Block bl, String tclass) {
|
||||
ForgeHooks.initTools();
|
||||
for(int md=0; md<16; md++) {
|
||||
List key=Arrays.asList(bl.blockID,md,tclass);
|
||||
ForgeHooks.toolEffectiveness.remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a block to the list of blocks to which the pickaxe is know to be
|
||||
* effective.
|
||||
* Kill minecraft with an error message.
|
||||
*/
|
||||
public static void addPickaxeBlockEffectiveAgainst (Block block) {
|
||||
((ItemTool) Item.pickaxeWood).addBlockEffectiveAgainst(block);
|
||||
((ItemTool) Item.pickaxeStone).addBlockEffectiveAgainst(block);
|
||||
((ItemTool) Item.pickaxeSteel).addBlockEffectiveAgainst(block);
|
||||
((ItemTool) Item.pickaxeGold).addBlockEffectiveAgainst(block);
|
||||
((ItemTool) Item.pickaxeDiamond).addBlockEffectiveAgainst(block);
|
||||
public static void killMinecraft(String modname, String msg) {
|
||||
throw new RuntimeException(modname+": "+msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Version checking. Ensures that a sufficiently recent version of Forge
|
||||
* is installed. Will result in a fatal error if the major versions
|
||||
* mismatch or if the version is too old. Will print a warning message if
|
||||
* the minor versions don't match.
|
||||
*/
|
||||
public static void versionDetect(String modname,
|
||||
int major, int minor, int revision) {
|
||||
if(major!=ForgeHooks.majorVersion) {
|
||||
killMinecraft(modname,"MinecraftForge Major Version Mismatch, expecting "+major+".x.x");
|
||||
} else if(minor!=ForgeHooks.minorVersion) {
|
||||
if(minor>ForgeHooks.minorVersion) {
|
||||
killMinecraft(modname,"MinecraftForge Too Old, need at least "+major+"."+minor+"."+revision);
|
||||
} else {
|
||||
System.out.println(modname + ": MinecraftForge minor version mismatch, expecting "+major+"."+minor+".x, may lead to unexpected behavior");
|
||||
}
|
||||
} else if(revision>ForgeHooks.revisionVersion) {
|
||||
killMinecraft(modname,"MinecraftForge Too Old, need at least "+major+"."+minor+"."+revision);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Strict version checking. Ensures that a sufficiently recent version of
|
||||
* Forge is installed. Will result in a fatal error if the major or minor
|
||||
* versions mismatch or if the version is too old. Use this function for
|
||||
* mods that use recent, new, or unstable APIs to prevent
|
||||
* incompatibilities.
|
||||
*/
|
||||
public static void versionDetectStrict(String modname,
|
||||
int major, int minor, int revision) {
|
||||
if(major!=ForgeHooks.majorVersion) {
|
||||
killMinecraft(modname,"MinecraftForge Major Version Mismatch, expecting "+major+".x.x");
|
||||
} else if(minor!=ForgeHooks.minorVersion) {
|
||||
if(minor>ForgeHooks.minorVersion) {
|
||||
killMinecraft(modname,"MinecraftForge Too Old, need at least "+major+"."+minor+"."+revision);
|
||||
} else {
|
||||
killMinecraft(modname,"MinecraftForge minor version mismatch, expecting "+major+"."+minor+".x");
|
||||
}
|
||||
} else if(revision>ForgeHooks.revisionVersion) {
|
||||
killMinecraft(modname,"MinecraftForge Too Old, need at least "+major+"."+minor+"."+revision);
|
||||
}
|
||||
}
|
||||
|
||||
private static int dungeonLootAttempts = 8;
|
||||
private static ArrayList<ObjectPair<Float, String>> dungeonMobs = new ArrayList<ObjectPair<Float, String>>();
|
||||
private static ArrayList<ObjectPair<Float, DungeonLoot>> dungeonLoot = new ArrayList<ObjectPair<Float, DungeonLoot>>();
|
||||
/**
|
||||
* Set the number of item stacks that will be attempted to be added to each Dungeon chest.
|
||||
* Note: Due to random number generation, you will not always get this amount per chest.
|
||||
* @param number The maximum number of item stacks to add to a chest.
|
||||
*/
|
||||
public static void setDungeonLootTries(int number)
|
||||
{
|
||||
dungeonLootAttempts = number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The max number of item stacks found in each dungeon chest.
|
||||
*/
|
||||
public static int getDungeonLootTries()
|
||||
{
|
||||
return dungeonLootAttempts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a mob to the possible list of creatures the spawner will create.
|
||||
* If the mob is already in the spawn list, the rarity will be added to the existing one,
|
||||
* causing the mob to be more common.
|
||||
*
|
||||
* @param name The name of the monster, use the same name used when registering the entity.
|
||||
* @param rarity The rarity of selecting this mob over others. Must be greater then 0.
|
||||
* Vanilla Minecraft has the following mobs:
|
||||
* Spider 1
|
||||
* Skeleton 1
|
||||
* Zombie 2
|
||||
* Meaning, Zombies are twice as common as spiders or skeletons.
|
||||
* @return The new rarity of the monster,
|
||||
*/
|
||||
public static float addDungeonMob(String name, float rarity)
|
||||
{
|
||||
if (rarity <= 0)
|
||||
{
|
||||
throw new IllegalArgumentException("Rarity must be greater then zero");
|
||||
}
|
||||
|
||||
for(ObjectPair<Float, String> mob : dungeonMobs)
|
||||
{
|
||||
if (name.equals(mob.getValue2()))
|
||||
{
|
||||
mob.setValue1(mob.getValue1() + rarity);
|
||||
return mob.getValue1();
|
||||
}
|
||||
}
|
||||
|
||||
dungeonMobs.add(new ObjectPair<Float, String>(rarity, name));
|
||||
return rarity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Will completely remove a Mob from the dungeon spawn list.
|
||||
*
|
||||
* @param name The name of the mob to remove
|
||||
* @return The rarity of the removed mob, prior to being removed.
|
||||
*/
|
||||
public static float removeDungeonMob(String name)
|
||||
{
|
||||
for (ObjectPair<Float, String> mob : dungeonMobs)
|
||||
{
|
||||
if (name.equals(name))
|
||||
{
|
||||
dungeonMobs.remove(mob);
|
||||
return mob.getValue1();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a random mob name from the list.
|
||||
* @param rand World generation random number generator
|
||||
* @return The mob name
|
||||
*/
|
||||
public static String getRandomDungeonMob(Random rand)
|
||||
{
|
||||
float maxRarity = 0f;
|
||||
for (ObjectPair<Float, String> mob : dungeonMobs)
|
||||
{
|
||||
maxRarity += mob.getValue1();
|
||||
}
|
||||
|
||||
float targetRarity = rand.nextFloat() * maxRarity;
|
||||
for (ObjectPair<Float, String> mob : dungeonMobs)
|
||||
{
|
||||
if (targetRarity < mob.getValue1())
|
||||
{
|
||||
return mob.getValue2();
|
||||
}
|
||||
targetRarity -= mob.getValue1();
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a item stack to the dungeon loot list with a stack size
|
||||
* of 1.
|
||||
*
|
||||
* @param item The ItemStack to be added to the loot list
|
||||
* @param rarity The relative chance that this item will spawn, Vanilla has
|
||||
* most of its items set to 1. Like the saddle, bread, silk, wheat, etc..
|
||||
* Rarer items are set to lower values, EXA: Golden Apple 0.01
|
||||
*/
|
||||
public static void addDungeonLoot(ItemStack item, float rarity)
|
||||
{
|
||||
addDungeonLoot(item, rarity, 1, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a item stack, with a range of sizes, to the dungeon loot list.
|
||||
* If a stack matching the same item, and size range, is already in the list
|
||||
* the rarities will be added together making the item more common.
|
||||
*
|
||||
* @param item The ItemStack to be added to the loot list
|
||||
* @param rarity The relative chance that this item will spawn, Vanilla has
|
||||
* most of its items set to 1. Like the saddle, bread, silk, wheat, etc..
|
||||
* Rarer items are set to lower values, EXA: Golden Apple 0.01
|
||||
* @param minCount When this item does generate, the minimum number that is in the stack
|
||||
* @param maxCount When this item does generate, the maximum number that can bein the stack
|
||||
* @return The new rarity of the loot.
|
||||
*/
|
||||
public static float addDungeonLoot(ItemStack item, float rarity, int minCount, int maxCount)
|
||||
{
|
||||
for (ObjectPair<Float, DungeonLoot> loot : dungeonLoot)
|
||||
{
|
||||
if (loot.getValue2().equals(item, minCount, maxCount))
|
||||
{
|
||||
loot.setValue1(loot.getValue1() + rarity);
|
||||
return loot.getValue1();
|
||||
}
|
||||
}
|
||||
|
||||
dungeonLoot.add(new ObjectPair<Float, DungeonLoot>(rarity, new DungeonLoot(item, minCount, maxCount)));
|
||||
return rarity;
|
||||
}
|
||||
/**
|
||||
* Removes a item stack from the dungeon loot list, this will remove all items
|
||||
* as long as the item stack matches, it will not care about matching the stack
|
||||
* size ranges perfectly.
|
||||
*
|
||||
* @param item The item stack to remove
|
||||
* @return The total rarity of all items removed
|
||||
*/
|
||||
public static float removeDungeonLoot(ItemStack item)
|
||||
{
|
||||
return removeDungeonLoot(item, -1, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a item stack from the dungeon loot list. If 'minCount' parameter
|
||||
* is greater then 0, it will only remove loot items that have the same exact
|
||||
* stack size range as passed in by parameters.
|
||||
*
|
||||
* @param item The item stack to remove
|
||||
* @param minCount The minimum count for the match check, if less then 0,
|
||||
* the size check is skipped
|
||||
* @param maxCount The max count used in match check when 'minCount' is >= 0
|
||||
* @return The total rarity of all items removed
|
||||
*/
|
||||
public static float removeDungeonLoot(ItemStack item, int minCount, int maxCount)
|
||||
{
|
||||
float rarity = 0;
|
||||
ArrayList<ObjectPair<Float, DungeonLoot>> lootTmp = (ArrayList<ObjectPair<Float, DungeonLoot>>)dungeonLoot.clone();
|
||||
if (minCount < 0)
|
||||
{
|
||||
for (ObjectPair<Float, DungeonLoot> loot : lootTmp)
|
||||
{
|
||||
if (loot.getValue2().equals(item))
|
||||
{
|
||||
dungeonLoot.remove(loot);
|
||||
rarity += loot.getValue1();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (ObjectPair<Float, DungeonLoot> loot : lootTmp)
|
||||
{
|
||||
if (loot.getValue2().equals(item, minCount, maxCount))
|
||||
{
|
||||
dungeonLoot.remove(loot);
|
||||
rarity += loot.getValue1();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return rarity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a random item stack to place in a dungeon chest during world generation
|
||||
* @param rand World generation random number generator
|
||||
* @return The item stack
|
||||
*/
|
||||
public static ItemStack getRandomDungeonLoot(Random rand)
|
||||
{
|
||||
float maxRarity = 0f;
|
||||
for (ObjectPair<Float, DungeonLoot> loot : dungeonLoot)
|
||||
{
|
||||
maxRarity += loot.getValue1();
|
||||
}
|
||||
|
||||
float targetRarity = rand.nextFloat() * maxRarity;
|
||||
for (ObjectPair<Float, DungeonLoot> loot : dungeonLoot)
|
||||
{
|
||||
if (targetRarity < loot.getValue1())
|
||||
{
|
||||
return loot.getValue2().generateStack(rand);
|
||||
}
|
||||
targetRarity -= loot.getValue1();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
//Minecart Dictionary --------------------------------------
|
||||
private static Map<MinecartKey, ItemStack> itemForMinecart = new HashMap<MinecartKey, ItemStack>();
|
||||
private static Map<ItemStack, MinecartKey> minecartForItem = new HashMap<ItemStack, MinecartKey>();
|
||||
/**
|
||||
* Registers a custom minecart and its corresponding item.
|
||||
* This should be the item used to place the minecart by the user,
|
||||
* not the item dropped by the cart.
|
||||
* @param cart The minecart.
|
||||
* @param item The item used to place the cart.
|
||||
*/
|
||||
public static void registerMinecart(Class<? extends EntityMinecart> cart, ItemStack item)
|
||||
{
|
||||
registerMinecart(cart, 0, item);
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers a minecart and its corresponding item.
|
||||
* This should be the item used to place the minecart by the user,
|
||||
* not the item dropped by the cart.
|
||||
* @param minecart The minecart.
|
||||
* @param type The minecart type, used to differentiate carts that have the same class.
|
||||
* @param item The item used to place the cart.
|
||||
*/
|
||||
public static void registerMinecart(Class<? extends EntityMinecart> minecart, int type, ItemStack item)
|
||||
{
|
||||
MinecartKey k = new MinecartKey(minecart, type);
|
||||
itemForMinecart.put(k, item);
|
||||
minecartForItem.put(item, k);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes a previously registered Minecart. Useful for replacing the vanilla minecarts.
|
||||
* @param minecart
|
||||
* @param type
|
||||
*/
|
||||
public static void removeMinecart(Class<? extends EntityMinecart> minecart, int type)
|
||||
{
|
||||
MinecartKey k = new MinecartKey(minecart, type);
|
||||
ItemStack item = itemForMinecart.remove(k);
|
||||
if(item != null)
|
||||
{
|
||||
minecartForItem.remove(item);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This function returns an ItemStack that represents this cart.
|
||||
* The player should be able to use this item to place the minecart.
|
||||
* 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.
|
||||
* @param minecart The cart class
|
||||
* @return An ItemStack that can be used to place the cart.
|
||||
*/
|
||||
public static ItemStack getItemForCart(Class<? extends EntityMinecart> minecart)
|
||||
{
|
||||
return getItemForCart(minecart, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function returns an ItemStack that represents this cart.
|
||||
* The player should be able to use this item to place the minecart.
|
||||
* 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.
|
||||
* @param minecart The cart class
|
||||
* @param type The minecartType value
|
||||
* @return An ItemStack that can be used to place the cart.
|
||||
*/
|
||||
public static ItemStack getItemForCart(Class<? extends EntityMinecart> minecart, int type)
|
||||
{
|
||||
ItemStack item = itemForMinecart.get(new MinecartKey(minecart, type));
|
||||
if (item == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return item.copy();
|
||||
}
|
||||
|
||||
/**
|
||||
* This function returns an ItemStack that represents this cart.
|
||||
* The player should be able to use this item to place the minecart.
|
||||
* 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.
|
||||
* @param cart The cart entity
|
||||
* @return An ItemStack that can be used to place the cart.
|
||||
*/
|
||||
public static ItemStack getItemForCart(EntityMinecart cart)
|
||||
{
|
||||
if(cart.getClass() == EntityMinecart.class)
|
||||
{
|
||||
return getItemForCart(cart.getClass(), cart.getMinecartType());
|
||||
}
|
||||
return getItemForCart(cart.getClass(), 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* The function will return the cart class for a given item.
|
||||
* If the item was not registered via the registerMinecart function it will return null.
|
||||
* @param item The item to test.
|
||||
* @return Cart if mapping exists, null if not.
|
||||
*/
|
||||
public static Class<? extends EntityMinecart> getCartClassForItem(ItemStack item)
|
||||
{
|
||||
MinecartKey k = null;
|
||||
for (ItemStack key : minecartForItem.keySet())
|
||||
{
|
||||
if (key.isItemEqual(item))
|
||||
{
|
||||
k = minecartForItem.get(k);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(k != null)
|
||||
{
|
||||
return k.minecart;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The function will return the cart type for a given item.
|
||||
* Will return -1 if the mapping doesn't exist.
|
||||
* If the item was not registered via the registerMinecart function it will return null.
|
||||
* @param item The item to test.
|
||||
* @return the cart minecartType value.
|
||||
*/
|
||||
public static int getCartTypeForItem(ItemStack item)
|
||||
{
|
||||
MinecartKey k = null;
|
||||
for (ItemStack key : minecartForItem.keySet())
|
||||
{
|
||||
if (key.isItemEqual(item))
|
||||
{
|
||||
k = minecartForItem.get(k);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(k != null)
|
||||
{
|
||||
return k.type;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Will return a set of all registered minecart items.
|
||||
* @return a copy of the set of all minecart items
|
||||
*/
|
||||
public static Set<ItemStack> getAllCartItems()
|
||||
{
|
||||
Set<ItemStack> ret = new HashSet<ItemStack>();
|
||||
for(ItemStack item : minecartForItem.keySet())
|
||||
{
|
||||
ret.add(item.copy());
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static
|
||||
{
|
||||
addDungeonMob("Skeleton", 1.0f);
|
||||
addDungeonMob("Zombie", 2.0f);
|
||||
addDungeonMob("Spider", 1.0f);
|
||||
|
||||
addDungeonLoot(new ItemStack(Item.saddle), 1.00f );
|
||||
addDungeonLoot(new ItemStack(Item.ingotIron), 1.00f, 1, 4);
|
||||
addDungeonLoot(new ItemStack(Item.bread), 1.00f );
|
||||
addDungeonLoot(new ItemStack(Item.wheat), 1.00f, 1, 4);
|
||||
addDungeonLoot(new ItemStack(Item.gunpowder), 1.00f, 1, 4);
|
||||
addDungeonLoot(new ItemStack(Item.silk), 1.00f, 1, 4);
|
||||
addDungeonLoot(new ItemStack(Item.bucketEmpty), 1.00f );
|
||||
addDungeonLoot(new ItemStack(Item.appleGold), 0.01f );
|
||||
addDungeonLoot(new ItemStack(Item.redstone), 0.50f, 1, 4);
|
||||
addDungeonLoot(new ItemStack(Item.record13), 0.05f );
|
||||
addDungeonLoot(new ItemStack(Item.recordCat), 0.05f );
|
||||
addDungeonLoot(new ItemStack(Item.dyePowder, 1, 3), 1.00f );
|
||||
|
||||
registerMinecart(EntityMinecart.class, 0, new ItemStack(Item.minecartEmpty));
|
||||
registerMinecart(EntityMinecart.class, 1, new ItemStack(Item.minecartCrate));
|
||||
registerMinecart(EntityMinecart.class, 2, new ItemStack(Item.minecartPowered));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package net.minecraft.src.forge;
|
||||
|
||||
/**
|
||||
* A class that holds two generic values, can be used as a Key/Value pair,
|
||||
* but is used in forge as a frequency/object pair.
|
||||
*
|
||||
* @param <T1> The type of the first value
|
||||
* @param <T2> The Type of the second value
|
||||
*/
|
||||
public class ObjectPair<T1, T2>
|
||||
{
|
||||
private T1 object1;
|
||||
private T2 object2;
|
||||
|
||||
public ObjectPair(T1 obj1, T2 obj2)
|
||||
{
|
||||
this.object1 = obj1;
|
||||
this.object2 = obj2;
|
||||
}
|
||||
|
||||
public T1 getValue1()
|
||||
{
|
||||
return this.object1;
|
||||
}
|
||||
|
||||
public T2 getValue2()
|
||||
{
|
||||
return this.object2;
|
||||
}
|
||||
|
||||
public void setValue1(T1 value)
|
||||
{
|
||||
object1 = value;
|
||||
}
|
||||
|
||||
public void setValue2(T2 value)
|
||||
{
|
||||
object2 = value;
|
||||
}
|
||||
}
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
*** HOW TO INSTALL ***
|
||||
|
||||
Extract the download archive directly into your MCP-directiory.
|
||||
It should create a folder "forge" within that directory, containing all
|
||||
extracted files.
|
||||
|
||||
You should use freshly downloaded jars, solely including ModLoader &
|
||||
ModLoaderMP. Anything else can eventually cause conflicts.
|
||||
|
||||
Now just start the install.cmd/.sh, MCForge will install itself into the proper
|
||||
locations and copy all needed files, as well as modifying the needed baseclasses.
|
||||
|
||||
Forge also includes a snapshot of the MCP mapings, this may not be the current
|
||||
version of the mapings. But you must use the provided mapings in order for the
|
||||
patch files to work together.
|
||||
|
||||
The install scripts should take care of everything for you, so you should not need
|
||||
to run ANY MCP script before installing forge.
|
||||
|
||||
Executable
+57
@@ -0,0 +1,57 @@
|
||||
echo off
|
||||
|
||||
echo MinecraftForge Windows Setup Program
|
||||
echo:
|
||||
|
||||
set PATH=%PATH%;%SystemDir%\system32;%SystemRoot%\System32
|
||||
|
||||
pushd .. >nul
|
||||
|
||||
xcopy /Y /E /I forge\conf\* conf
|
||||
|
||||
if exist runtime\bin\fernflower.jar move runtime\bin\fernflower.jar runtime\bin\fernflower.jar-backup
|
||||
|
||||
cmd /C cleanup.bat
|
||||
cmd /C decompile.bat
|
||||
|
||||
if exist runtime\bin\fernflower.jar-backup move runtime\bin\fernflower.jar-backup runtime\bin\fernflower.jar
|
||||
|
||||
pushd src >nul
|
||||
|
||||
if exist ..\jars\bin\minecraft.jar (
|
||||
del minecraft\net\minecraft\src\MLProp.java
|
||||
copy ..\forge\MLProp.java minecraft\net\minecraft\src\MLProp.java
|
||||
|
||||
for /f "delims=" %%a in ('dir /a -d /b /S ..\forge\patches\minecraft') do (
|
||||
pushd "%%a" 2>nul
|
||||
if errorlevel 1 (
|
||||
..\runtime\bin\python\python_mcp ..\forge\lfcr.py "%%a" "%%a"
|
||||
..\runtime\bin\applydiff.exe -uf -p2 -i "%%a"
|
||||
) else popd
|
||||
)
|
||||
)
|
||||
|
||||
if exist ..\jars\minecraft_server.jar (
|
||||
del minecraft_server\net\minecraft\src\MLProp.java
|
||||
copy ..\forge\MLProp.java minecraft_server\net\minecraft\src\MLProp.java
|
||||
|
||||
..\runtime\bin\python\python_mcp ..\forge\lfcr.py ../forge/modLoaderMP.patch ../forge/modLoaderMP.patch
|
||||
..\runtime\bin\applydiff.exe -uf -p2 -i ../forge/modLoaderMP.patch
|
||||
|
||||
for /f "delims=" %%a in ('dir /a -d /b /S ..\forge\patches\minecraft_server') do (
|
||||
pushd "%%a" 2>nul
|
||||
if errorlevel 1 (
|
||||
..\runtime\bin\python\python_mcp ..\forge\lfcr.py "%%a" "%%a"
|
||||
..\runtime\bin\applydiff.exe -uf -p2 -i "%%a"
|
||||
) else popd
|
||||
)
|
||||
|
||||
)
|
||||
popd >nul
|
||||
|
||||
xcopy /Y /E forge\src\* src
|
||||
|
||||
rem Removed until MCP's Update Names is fixed
|
||||
rem cmd /C updatemcp.bat
|
||||
rem cmd /C updatenames.bat
|
||||
cmd /C updatemd5.bat
|
||||
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "MinecraftForge Linux Setup Program"
|
||||
echo
|
||||
|
||||
pushd .. > /dev/null
|
||||
|
||||
rm -rf conf
|
||||
mkdir conf
|
||||
cp -r forge/conf/* conf
|
||||
|
||||
if [ -f runtime/bin/fernflower.jar ];
|
||||
then
|
||||
mv runtime/bin/fernflower.jar runtime/bin/fernflower.jar-backup
|
||||
fi
|
||||
|
||||
./cleanup.sh
|
||||
./decompile.sh
|
||||
|
||||
if [ -f runtime/bin/fernflower.jar-backup ];
|
||||
then
|
||||
mv runtime/bin/fernflower.jar-backup runtime/bin/fernflower.jar
|
||||
fi
|
||||
|
||||
|
||||
pushd src > /dev/null
|
||||
find . -name *.java -exec sed -i 's/\r//g' \{\} \;
|
||||
find ../forge/ -name *.patch -exec sed -i 's/\r//g' \{\} \;
|
||||
|
||||
if [ -f ../jars/bin/minecraft.jar ];
|
||||
then
|
||||
cp ../forge/MLProp.java minecraft/net/minecraft/src/MLProp.java
|
||||
|
||||
for i in `find ../forge/patches/minecraft/ -type f`
|
||||
do
|
||||
patch -p2 -i $i
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
if [ -f ../jars/minecraft_server.jar ];
|
||||
then
|
||||
cp ../forge/MLProp.java minecraft_server/net/minecraft/src/MLProp.java
|
||||
|
||||
patch -p2 -i ../forge/modLoaderMP.patch
|
||||
|
||||
for i in `find ../forge/patches/minecraft_server/ -type f`
|
||||
do
|
||||
patch -p2 -i $i
|
||||
done
|
||||
fi
|
||||
popd > /dev/null
|
||||
|
||||
cp -r forge/src/* src
|
||||
|
||||
# Removed until MCP's UpdateNames Is fixed
|
||||
#./updatemcp.sh
|
||||
#./updatenames.sh
|
||||
./updatemd5.sh
|
||||
@@ -0,0 +1,8 @@
|
||||
#! /usr/bin/env python
|
||||
|
||||
import sys, re, os
|
||||
data = open(sys.argv[1], "rb").read()
|
||||
newdata = re.sub("\r?\n", "\r\n", data)
|
||||
f = open(sys.argv[2], "wb")
|
||||
f.write(newdata)
|
||||
f.close()
|
||||
@@ -1,742 +0,0 @@
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/BlockRedstoneWire.java ../src_work/minecraft/net/minecraft/src/BlockRedstoneWire.java
|
||||
--- ../src_base/minecraft/net/minecraft/src/BlockRedstoneWire.java 2011-07-29 16:35:27.000000000 -0400
|
||||
+++ ../src_work/minecraft/net/minecraft/src/BlockRedstoneWire.java 2011-07-31 21:44:50.000000000 -0400
|
||||
@@ -3,6 +3,7 @@
|
||||
// Decompiler options: packimports(3) braces deadcode
|
||||
|
||||
package net.minecraft.src;
|
||||
+import net.minecraft.src.forge.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -451,6 +452,10 @@
|
||||
{
|
||||
return false;
|
||||
}
|
||||
+ if (Block.blocksList[i1] instanceof IConnectRedstone) {
|
||||
+ IConnectRedstone icr = (IConnectRedstone) Block.blocksList[i1];
|
||||
+ return icr.canConnectRedstone(iblockaccess, i, j, k, l);
|
||||
+ }
|
||||
if(Block.blocksList[i1].canProvidePower())
|
||||
{
|
||||
return true;
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/Chunk.java ../src_work/minecraft/net/minecraft/src/Chunk.java
|
||||
--- ../src_base/minecraft/net/minecraft/src/Chunk.java 2011-07-29 16:35:26.000000000 -0400
|
||||
+++ ../src_work/minecraft/net/minecraft/src/Chunk.java 2011-07-31 21:44:50.000000000 -0400
|
||||
@@ -3,6 +3,7 @@
|
||||
// Decompiler options: packimports(3) braces deadcode
|
||||
|
||||
package net.minecraft.src;
|
||||
+import net.minecraft.src.forge.*;
|
||||
|
||||
import java.io.PrintStream;
|
||||
import java.util.*;
|
||||
@@ -249,6 +250,13 @@
|
||||
}
|
||||
int l1 = xPosition * 16 + i;
|
||||
int i2 = zPosition * 16 + k;
|
||||
+
|
||||
+ if (Block.blocksList[k1] instanceof IOverrideReplace) {
|
||||
+ IOverrideReplace iovr = (IOverrideReplace) Block.blocksList[k1];
|
||||
+ if (!iovr.canReplaceBlock(worldObj, l1, j, i2, l))
|
||||
+ return iovr.getReplacedSuccess();
|
||||
+ }
|
||||
+
|
||||
blocks[i << 11 | k << 7 | j] = (byte)(byte0 & 0xff);
|
||||
if(k1 != 0 && !worldObj.multiplayerWorld)
|
||||
{
|
||||
@@ -292,6 +300,13 @@
|
||||
}
|
||||
int k1 = xPosition * 16 + i;
|
||||
int l1 = zPosition * 16 + k;
|
||||
+
|
||||
+ if (Block.blocksList[j1] instanceof IOverrideReplace) {
|
||||
+ IOverrideReplace iovr = (IOverrideReplace) Block.blocksList[j1];
|
||||
+ if (!iovr.canReplaceBlock(worldObj, k1, j, l1, l))
|
||||
+ return iovr.getReplacedSuccess();
|
||||
+ }
|
||||
+
|
||||
blocks[i << 11 | k << 7 | j] = (byte)(byte0 & 0xff);
|
||||
if(j1 != 0)
|
||||
{
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/EffectRenderer.java ../src_work/minecraft/net/minecraft/src/EffectRenderer.java
|
||||
--- ../src_base/minecraft/net/minecraft/src/EffectRenderer.java 2011-07-29 16:35:27.000000000 -0400
|
||||
+++ ../src_work/minecraft/net/minecraft/src/EffectRenderer.java 2011-07-31 21:44:50.000000000 -0400
|
||||
@@ -7,6 +7,9 @@
|
||||
import java.util.*;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
+import net.minecraft.src.forge.BlockTextureParticles;
|
||||
+import net.minecraft.src.forge.ITextureProvider;
|
||||
+
|
||||
// Referenced classes of package net.minecraft.src:
|
||||
// EntityFX, Entity, MathHelper, RenderEngine,
|
||||
// Tessellator, Block, EntityDiggingFX, World
|
||||
@@ -16,6 +19,7 @@
|
||||
|
||||
public EffectRenderer(World world, RenderEngine renderengine)
|
||||
{
|
||||
+ effectList = new ArrayList();
|
||||
fxLayers = new List[4];
|
||||
rand = new Random();
|
||||
if(world != null)
|
||||
@@ -55,6 +59,18 @@
|
||||
}
|
||||
|
||||
}
|
||||
+ for (int x = 0; x < effectList.size(); x++) {
|
||||
+ BlockTextureParticles entry = (BlockTextureParticles) effectList
|
||||
+ .get(x);
|
||||
+ for (int y = 0; y < entry.effects.size(); y++) {
|
||||
+ EntityFX entityfx = (EntityFX) entry.effects.get(y);
|
||||
+ if (entityfx.isDead) {
|
||||
+ entry.effects.remove(y--);
|
||||
+ }
|
||||
+ }
|
||||
+ if (effectList.size() == 0)
|
||||
+ effectList.remove(x--);
|
||||
+ }
|
||||
|
||||
}
|
||||
|
||||
@@ -93,11 +109,26 @@
|
||||
for(int k = 0; k < fxLayers[i].size(); k++)
|
||||
{
|
||||
EntityFX entityfx = (EntityFX)fxLayers[i].get(k);
|
||||
+ if(entityfx instanceof EntityDiggingFX) continue;
|
||||
entityfx.renderParticle(tessellator, f, f1, f5, f2, f3, f4);
|
||||
}
|
||||
|
||||
tessellator.draw();
|
||||
}
|
||||
+ Tessellator tessellator = Tessellator.instance;
|
||||
+
|
||||
+ for (int x = 0; x < effectList.size(); x++) {
|
||||
+ BlockTextureParticles entry = (BlockTextureParticles) effectList
|
||||
+ .get(x);
|
||||
+ GL11.glBindTexture(3553 /* GL_TEXTURE_2D */,
|
||||
+ renderer.getTexture(entry.texture));
|
||||
+ tessellator.startDrawingQuads();
|
||||
+ for (int y = 0; y < entry.effects.size(); y++) {
|
||||
+ EntityFX entityfx = (EntityFX) entry.effects.get(y);
|
||||
+ entityfx.renderParticle(tessellator, f, f1, f5, f2, f3, f4);
|
||||
+ }
|
||||
+ tessellator.draw();
|
||||
+ }
|
||||
|
||||
}
|
||||
|
||||
@@ -124,6 +155,13 @@
|
||||
{
|
||||
fxLayers[i].clear();
|
||||
}
|
||||
+
|
||||
+ for (int x = 0; x < effectList.size(); x++) {
|
||||
+ BlockTextureParticles entry = (BlockTextureParticles) effectList
|
||||
+ .get(x);
|
||||
+ entry.effects.clear();
|
||||
+ }
|
||||
+ effectList.clear();
|
||||
|
||||
}
|
||||
|
||||
@@ -145,7 +183,12 @@
|
||||
double d1 = (double)j + ((double)l1 + 0.5D) / (double)j1;
|
||||
double d2 = (double)k + ((double)i2 + 0.5D) / (double)j1;
|
||||
int j2 = rand.nextInt(6);
|
||||
- addEffect((new EntityDiggingFX(worldObj, d, d1, d2, d - (double)i - 0.5D, d1 - (double)j - 0.5D, d2 - (double)k - 0.5D, block, j2, i1)).func_4041_a(i, j, k));
|
||||
+ EntityDiggingFX dig_effect = new EntityDiggingFX(worldObj,
|
||||
+ d, d1, d2, d - (double) i - 0.5D, d1 - (double) j
|
||||
+ - 0.5D, d2 - (double) k - 0.5D, block, j2,
|
||||
+ i1);
|
||||
+ dig_effect.func_4041_a(i, j, k);
|
||||
+ addDigParticleEffect(dig_effect, block);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -190,16 +233,48 @@
|
||||
{
|
||||
d = (double)i + block.maxX + (double)f;
|
||||
}
|
||||
- addEffect((new EntityDiggingFX(worldObj, d, d1, d2, 0.0D, 0.0D, 0.0D, block, l, worldObj.getBlockMetadata(i, j, k))).func_4041_a(i, j, k).func_407_b(0.2F).func_405_d(0.6F));
|
||||
+ EntityDiggingFX dig_effect = new EntityDiggingFX(worldObj, d, d1, d2,
|
||||
+ 0.0D, 0.0D, 0.0D, block, l, worldObj.getBlockMetadata(i, j, k));
|
||||
+ dig_effect.func_4041_a(i, j, k);
|
||||
+ dig_effect.func_407_b(0.2F);
|
||||
+ dig_effect.func_405_d(0.6F);
|
||||
+ addDigParticleEffect(dig_effect, block);
|
||||
}
|
||||
|
||||
public String getStatistics()
|
||||
{
|
||||
return (new StringBuilder()).append("").append(fxLayers[0].size() + fxLayers[1].size() + fxLayers[2].size()).toString();
|
||||
}
|
||||
+
|
||||
+ public void addDigParticleEffect(EntityDiggingFX dig_effect, Block block) {
|
||||
+ boolean added = false;
|
||||
+ String comp;
|
||||
+
|
||||
+ if (block instanceof ITextureProvider) {
|
||||
+ comp = ((ITextureProvider) block).getTextureFile();
|
||||
+ } else {
|
||||
+ comp = "/terrain.png";
|
||||
+ }
|
||||
+ for (int x = 0; x < effectList.size(); x++) {
|
||||
+ BlockTextureParticles entry = (BlockTextureParticles) effectList
|
||||
+ .get(x);
|
||||
+ if (entry.texture.equals(comp)) {
|
||||
+ entry.effects.add(dig_effect);
|
||||
+ added = true;
|
||||
+ }
|
||||
+ }
|
||||
+ if (!added) {
|
||||
+ BlockTextureParticles entry = new BlockTextureParticles();
|
||||
+ entry.texture = comp;
|
||||
+ entry.effects.add(dig_effect);
|
||||
+ effectList.add(entry);
|
||||
+ }
|
||||
+ addEffect(dig_effect);
|
||||
+ }
|
||||
|
||||
protected World worldObj;
|
||||
private List fxLayers[];
|
||||
+ private List effectList;
|
||||
private RenderEngine renderer;
|
||||
private Random rand;
|
||||
}
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/EntityPlayer.java ../src_work/minecraft/net/minecraft/src/EntityPlayer.java
|
||||
--- ../src_base/minecraft/net/minecraft/src/EntityPlayer.java 2011-07-29 16:35:27.000000000 -0400
|
||||
+++ ../src_work/minecraft/net/minecraft/src/EntityPlayer.java 2011-07-31 21:44:50.000000000 -0400
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
import java.util.*;
|
||||
|
||||
+import net.minecraft.src.forge.ISpecialArmor;
|
||||
+
|
||||
// Referenced classes of package net.minecraft.src:
|
||||
// EntityLiving, InventoryPlayer, ContainerPlayer, World,
|
||||
// ChunkCoordinates, DataWatcher, Container, StatList,
|
||||
@@ -477,6 +479,21 @@
|
||||
|
||||
protected void damageEntity(int i)
|
||||
{
|
||||
+ boolean doRegularComputation = true;
|
||||
+ for (ItemStack stack : inventory.armorInventory) {
|
||||
+ if (stack != null && stack.getItem() instanceof ISpecialArmor) {
|
||||
+ ISpecialArmor armor = (ISpecialArmor) stack.getItem();
|
||||
+
|
||||
+ i = armor.adjustArmorDamage(i);
|
||||
+ doRegularComputation = doRegularComputation
|
||||
+ && armor.allowRegularComputation();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!doRegularComputation) {
|
||||
+ super.damageEntity(i);
|
||||
+ }
|
||||
+
|
||||
int j = 25 - inventory.getTotalArmorValue();
|
||||
int k = i * j + damageRemainder;
|
||||
inventory.damageArmor(i);
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/Explosion.java ../src_work/minecraft/net/minecraft/src/Explosion.java
|
||||
--- ../src_base/minecraft/net/minecraft/src/Explosion.java 2011-07-29 16:35:27.000000000 -0400
|
||||
+++ ../src_work/minecraft/net/minecraft/src/Explosion.java 2011-07-31 21:44:50.000000000 -0400
|
||||
@@ -3,6 +3,7 @@
|
||||
// Decompiler options: packimports(3) braces deadcode
|
||||
|
||||
package net.minecraft.src;
|
||||
+import net.minecraft.src.forge.ISpecialResistance;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -65,7 +66,17 @@
|
||||
int i5 = worldObj.getBlockId(j4, k4, l4);
|
||||
if(i5 > 0)
|
||||
{
|
||||
- f1 -= (Block.blocksList[i5].getExplosionResistance(exploder) + 0.3F) * f2;
|
||||
+ if (Block.blocksList[i5] instanceof ISpecialResistance) {
|
||||
+ ISpecialResistance isr = (ISpecialResistance) Block.blocksList[i5];
|
||||
+ f1 -= (isr.getSpecialExplosionResistance(
|
||||
+ worldObj, j4, k4, l4, explosionX,
|
||||
+ explosionY, explosionZ, exploder) + 0.3F)
|
||||
+ * f2;
|
||||
+ } else {
|
||||
+ f1 -= (Block.blocksList[i5]
|
||||
+ .getExplosionResistance(exploder) + 0.3F)
|
||||
+ * f2;
|
||||
+ }
|
||||
}
|
||||
if(f1 > 0.0F)
|
||||
{
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/ItemBucket.java ../src_work/minecraft/net/minecraft/src/ItemBucket.java
|
||||
--- ../src_base/minecraft/net/minecraft/src/ItemBucket.java 2011-07-29 16:35:27.000000000 -0400
|
||||
+++ ../src_work/minecraft/net/minecraft/src/ItemBucket.java 2011-07-31 21:44:50.000000000 -0400
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
+import net.minecraft.src.forge.MinecraftForge;
|
||||
+
|
||||
// Referenced classes of package net.minecraft.src:
|
||||
// Item, EntityPlayer, Vec3D, MathHelper,
|
||||
// World, MovingObjectPosition, EnumMovingObjectType, Material,
|
||||
@@ -55,6 +57,13 @@
|
||||
}
|
||||
if(isFull == 0)
|
||||
{
|
||||
+ ItemStack customBucket = MinecraftForge.fillCustomBucket(world,
|
||||
+ i, j, k);
|
||||
+
|
||||
+ if (customBucket != null) {
|
||||
+ return customBucket;
|
||||
+ }
|
||||
+
|
||||
if(world.getBlockMaterial(i, j, k) == Material.water && world.getBlockMetadata(i, j, k) == 0)
|
||||
{
|
||||
world.setBlockWithNotify(i, j, k, 0);
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/ItemPickaxe.java ../src_work/minecraft/net/minecraft/src/ItemPickaxe.java
|
||||
--- ../src_base/minecraft/net/minecraft/src/ItemPickaxe.java 2011-07-29 16:35:26.000000000 -0400
|
||||
+++ ../src_work/minecraft/net/minecraft/src/ItemPickaxe.java 2011-07-31 21:44:50.000000000 -0400
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
package net.minecraft.src;
|
||||
|
||||
+import net.minecraft.src.forge.MinecraftForge;
|
||||
+
|
||||
|
||||
// Referenced classes of package net.minecraft.src:
|
||||
// ItemTool, Block, EnumToolMaterial, Material
|
||||
@@ -42,6 +44,9 @@
|
||||
{
|
||||
return toolMaterial.getHarvestLevel() >= 2;
|
||||
}
|
||||
+ if (MinecraftForge.canHarvestBlock(this, block)) {
|
||||
+ return true;
|
||||
+ }
|
||||
if(block.blockMaterial == Material.rock)
|
||||
{
|
||||
return true;
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/ItemRenderer.java ../src_work/minecraft/net/minecraft/src/ItemRenderer.java
|
||||
--- ../src_base/minecraft/net/minecraft/src/ItemRenderer.java 2011-07-29 16:35:27.000000000 -0400
|
||||
+++ ../src_work/minecraft/net/minecraft/src/ItemRenderer.java 2011-07-31 21:44:50.000000000 -0400
|
||||
@@ -5,6 +5,8 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
+import net.minecraft.src.forge.MinecraftForgeClient;
|
||||
+
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
// Referenced classes of package net.minecraft.src:
|
||||
@@ -34,15 +36,18 @@
|
||||
if(itemstack.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
|
||||
{
|
||||
GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/terrain.png"));
|
||||
+ MinecraftForgeClient.overrideTexture (Block.blocksList[itemstack.itemID]);
|
||||
renderBlocksInstance.renderBlockOnInventory(Block.blocksList[itemstack.itemID], itemstack.getItemDamage(), entityliving.getEntityBrightness(1.0F));
|
||||
} else
|
||||
{
|
||||
if(itemstack.itemID < 256)
|
||||
{
|
||||
GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/terrain.png"));
|
||||
+ MinecraftForgeClient.overrideTexture (Block.blocksList[itemstack.itemID]);
|
||||
} else
|
||||
{
|
||||
GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/gui/items.png"));
|
||||
+ MinecraftForgeClient.overrideTexture (Item.itemsList[itemstack.itemID]);
|
||||
}
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
int i = entityliving.getItemIcon(itemstack);
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/ItemTool.java ../src_work/minecraft/net/minecraft/src/ItemTool.java
|
||||
--- ../src_base/minecraft/net/minecraft/src/ItemTool.java 2011-07-29 16:35:27.000000000 -0400
|
||||
+++ ../src_work/minecraft/net/minecraft/src/ItemTool.java 2011-07-31 21:49:24.000000000 -0400
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
package net.minecraft.src;
|
||||
|
||||
+import java.util.Arrays;
|
||||
|
||||
// Referenced classes of package net.minecraft.src:
|
||||
// Item, EnumToolMaterial, ItemStack, Block,
|
||||
@@ -63,4 +64,11 @@
|
||||
private float efficiencyOnProperMaterial;
|
||||
private int damageVsEntity;
|
||||
protected EnumToolMaterial toolMaterial;
|
||||
+
|
||||
+ public void addBlockEffectiveAgainst (Block block) {
|
||||
+ blocksEffectiveAgainst = Arrays.copyOf(blocksEffectiveAgainst,
|
||||
+ blocksEffectiveAgainst.length + 1);
|
||||
+
|
||||
+ blocksEffectiveAgainst [blocksEffectiveAgainst.length-1] = block;
|
||||
+ }
|
||||
}
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/PlayerController.java ../src_work/minecraft/net/minecraft/src/PlayerController.java
|
||||
--- ../src_base/minecraft/net/minecraft/src/PlayerController.java 2011-07-29 16:35:27.000000000 -0400
|
||||
+++ ../src_work/minecraft/net/minecraft/src/PlayerController.java 2011-07-31 21:44:50.000000000 -0400
|
||||
@@ -3,6 +3,7 @@
|
||||
// Decompiler options: packimports(3) braces deadcode
|
||||
|
||||
package net.minecraft.src;
|
||||
+import net.minecraft.src.forge.*;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
@@ -98,6 +99,12 @@
|
||||
|
||||
public boolean sendPlaceBlock(EntityPlayer entityplayer, World world, ItemStack itemstack, int i, int j, int k, int l)
|
||||
{
|
||||
+ if (itemstack != null && itemstack.getItem() instanceof IUseItemFirst) {
|
||||
+ IUseItemFirst iuif = (IUseItemFirst) itemstack.getItem();
|
||||
+ if (iuif.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))
|
||||
{
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/RenderItem.java ../src_work/minecraft/net/minecraft/src/RenderItem.java
|
||||
--- ../src_base/minecraft/net/minecraft/src/RenderItem.java 2011-07-29 16:35:27.000000000 -0400
|
||||
+++ ../src_work/minecraft/net/minecraft/src/RenderItem.java 2011-07-31 21:44:50.000000000 -0400
|
||||
@@ -5,6 +5,9 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
+
|
||||
+import net.minecraft.src.forge.MinecraftForgeClient;
|
||||
+
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
// Referenced classes of package net.minecraft.src:
|
||||
@@ -51,6 +54,7 @@
|
||||
{
|
||||
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
|
||||
loadTexture("/terrain.png");
|
||||
+ MinecraftForgeClient.overrideTexture(Block.blocksList[itemstack.itemID]);
|
||||
float f4 = 0.25F;
|
||||
if(!Block.blocksList[itemstack.itemID].renderAsNormalBlock() && itemstack.itemID != Block.stairSingle.blockID && Block.blocksList[itemstack.itemID].getRenderType() != 16)
|
||||
{
|
||||
@@ -78,10 +82,12 @@
|
||||
if(itemstack.itemID < 256)
|
||||
{
|
||||
loadTexture("/terrain.png");
|
||||
+ MinecraftForgeClient.overrideTexture(Block.blocksList[itemstack.itemID]);
|
||||
} else
|
||||
{
|
||||
loadTexture("/gui/items.png");
|
||||
- }
|
||||
+ MinecraftForgeClient.overrideTexture(Item.itemsList[itemstack.itemID]);
|
||||
+ }
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
float f6 = (float)((i % 16) * 16 + 0) / 256F;
|
||||
float f8 = (float)((i % 16) * 16 + 16) / 256F;
|
||||
@@ -92,6 +98,7 @@
|
||||
float f14 = 0.25F;
|
||||
if(field_27004_a)
|
||||
{
|
||||
+
|
||||
int k = Item.itemsList[itemstack.itemID].getColorFromDamage(itemstack.getItemDamage());
|
||||
float f15 = (float)(k >> 16 & 0xff) / 255F;
|
||||
float f17 = (float)(k >> 8 & 0xff) / 255F;
|
||||
@@ -131,6 +138,7 @@
|
||||
{
|
||||
int j1 = i;
|
||||
renderengine.bindTexture(renderengine.getTexture("/terrain.png"));
|
||||
+ MinecraftForgeClient.overrideTexture (Block.blocksList[i]);
|
||||
Block block = Block.blocksList[j1];
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(l - 2, i1 + 3, -3F);
|
||||
@@ -159,9 +167,11 @@
|
||||
if(i < 256)
|
||||
{
|
||||
renderengine.bindTexture(renderengine.getTexture("/terrain.png"));
|
||||
+ MinecraftForgeClient.overrideTexture (Block.blocksList[i]);
|
||||
} else
|
||||
{
|
||||
renderengine.bindTexture(renderengine.getTexture("/gui/items.png"));
|
||||
+ MinecraftForgeClient.overrideTexture(Item.itemsList[i]);
|
||||
}
|
||||
int k1 = Item.itemsList[i].getColorFromDamage(j);
|
||||
float f = (float)(k1 >> 16 & 0xff) / 255F;
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/WorldRenderer.java ../src_work/minecraft/net/minecraft/src/WorldRenderer.java
|
||||
--- ../src_base/minecraft/net/minecraft/src/WorldRenderer.java 2011-07-29 16:35:27.000000000 -0400
|
||||
+++ ../src_work/minecraft/net/minecraft/src/WorldRenderer.java 2011-07-31 21:44:50.000000000 -0400
|
||||
@@ -3,8 +3,12 @@
|
||||
// Decompiler options: packimports(3) braces deadcode
|
||||
|
||||
package net.minecraft.src;
|
||||
+import net.minecraft.src.forge.*;
|
||||
|
||||
import java.util.*;
|
||||
+
|
||||
+import net.minecraft.src.forge.MinecraftForgeClient;
|
||||
+
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
// Referenced classes of package net.minecraft.src:
|
||||
@@ -138,14 +142,27 @@
|
||||
}
|
||||
Block block = Block.blocksList[i3];
|
||||
int j3 = block.getRenderBlockPass();
|
||||
+
|
||||
+ if (block instanceof IMultipassRender) {
|
||||
+ if (j3 != i2) {
|
||||
+ flag = true;
|
||||
+ }
|
||||
+ IMultipassRender impr = (IMultipassRender) block;
|
||||
+ if (impr.canRenderInPass(i2)) {
|
||||
+ j3 = i2;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if(j3 != i2)
|
||||
{
|
||||
flag = true;
|
||||
continue;
|
||||
}
|
||||
if(j3 == i2)
|
||||
- {
|
||||
+ {
|
||||
+ MinecraftForgeClient.beforeBlockRender(block, renderblocks);
|
||||
flag1 |= renderblocks.renderBlockByRenderType(block, l2, j2, k2);
|
||||
+ MinecraftForgeClient.afterBlockRender(block, renderblocks);
|
||||
}
|
||||
}
|
||||
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/BlockRedstoneWire.java ../src_work/minecraft_server/net/minecraft/src/BlockRedstoneWire.java
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/BlockRedstoneWire.java 2011-07-29 16:35:28.000000000 -0400
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/BlockRedstoneWire.java 2011-07-31 21:44:50.000000000 -0400
|
||||
@@ -3,6 +3,7 @@
|
||||
// Decompiler options: packimports(3) braces deadcode
|
||||
|
||||
package net.minecraft.src;
|
||||
+import net.minecraft.src.forge.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -413,6 +414,10 @@
|
||||
{
|
||||
return false;
|
||||
}
|
||||
+ if(Block.blocksList[i1] instanceof IConnectRedstone) {
|
||||
+ IConnectRedstone icr=(IConnectRedstone)Block.blocksList[i1];
|
||||
+ return icr.canConnectRedstone(iblockaccess,i,j,k,l);
|
||||
+ }
|
||||
if(Block.blocksList[i1].canProvidePower())
|
||||
{
|
||||
return true;
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/Chunk.java ../src_work/minecraft_server/net/minecraft/src/Chunk.java
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/Chunk.java 2011-07-29 16:35:28.000000000 -0400
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/Chunk.java 2011-07-31 21:44:50.000000000 -0400
|
||||
@@ -3,6 +3,7 @@
|
||||
// Decompiler options: packimports(3) braces deadcode
|
||||
|
||||
package net.minecraft.src;
|
||||
+import net.minecraft.src.forge.*;
|
||||
|
||||
import java.io.PrintStream;
|
||||
import java.util.*;
|
||||
@@ -227,6 +228,13 @@
|
||||
}
|
||||
int l1 = xPosition * 16 + i;
|
||||
int i2 = zPosition * 16 + k;
|
||||
+
|
||||
+ if(Block.blocksList[k1] instanceof IOverrideReplace) {
|
||||
+ IOverrideReplace iovr=(IOverrideReplace)Block.blocksList[k1];
|
||||
+ if(!iovr.canReplaceBlock(worldObj,l1,j,i2,l))
|
||||
+ return iovr.getReplacedSuccess();
|
||||
+ }
|
||||
+
|
||||
blocks[i << 11 | k << 7 | j] = (byte)(byte0 & 0xff);
|
||||
if(k1 != 0 && !worldObj.singleplayerWorld)
|
||||
{
|
||||
@@ -270,6 +278,13 @@
|
||||
}
|
||||
int k1 = xPosition * 16 + i;
|
||||
int l1 = zPosition * 16 + k;
|
||||
+
|
||||
+ if(Block.blocksList[j1] instanceof IOverrideReplace) {
|
||||
+ IOverrideReplace iovr=(IOverrideReplace)Block.blocksList[j1];
|
||||
+ if(!iovr.canReplaceBlock(worldObj,k1,j,l1,l))
|
||||
+ return iovr.getReplacedSuccess();
|
||||
+ }
|
||||
+
|
||||
blocks[i << 11 | k << 7 | j] = (byte)(byte0 & 0xff);
|
||||
if(j1 != 0)
|
||||
{
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/EntityPlayer.java ../src_work/minecraft_server/net/minecraft/src/EntityPlayer.java
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/EntityPlayer.java 2011-07-29 16:35:28.000000000 -0400
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/EntityPlayer.java 2011-07-31 21:44:50.000000000 -0400
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
import java.util.*;
|
||||
|
||||
+import net.minecraft.src.forge.ISpecialArmor;
|
||||
+
|
||||
// Referenced classes of package net.minecraft.src:
|
||||
// EntityLiving, InventoryPlayer, ContainerPlayer, World,
|
||||
// ChunkCoordinates, DataWatcher, Container, StatList,
|
||||
@@ -457,6 +459,21 @@
|
||||
|
||||
protected void damageEntity(int i)
|
||||
{
|
||||
+ boolean doRegularComputation = true;
|
||||
+ for (ItemStack stack : inventory.armorInventory) {
|
||||
+ if (stack != null && stack.getItem() instanceof ISpecialArmor) {
|
||||
+ ISpecialArmor armor = (ISpecialArmor) stack.getItem();
|
||||
+
|
||||
+ i = armor.adjustArmorDamage(i);
|
||||
+ doRegularComputation = doRegularComputation
|
||||
+ && armor.allowRegularComputation();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!doRegularComputation) {
|
||||
+ super.damageEntity(i);
|
||||
+ }
|
||||
+
|
||||
int j = 25 - inventory.getTotalArmorValue();
|
||||
int k = i * j + damageRemainder;
|
||||
inventory.damageArmor(i);
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/Explosion.java ../src_work/minecraft_server/net/minecraft/src/Explosion.java
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/Explosion.java 2011-07-29 16:35:28.000000000 -0400
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/Explosion.java 2011-07-31 21:44:50.000000000 -0400
|
||||
@@ -3,6 +3,7 @@
|
||||
// Decompiler options: packimports(3) braces deadcode
|
||||
|
||||
package net.minecraft.src;
|
||||
+import net.minecraft.src.forge.ISpecialResistance;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -65,7 +66,16 @@
|
||||
int i5 = worldObj.getBlockId(j4, k4, l4);
|
||||
if(i5 > 0)
|
||||
{
|
||||
- f1 -= (Block.blocksList[i5].getExplosionResistance(exploder) + 0.3F) * f2;
|
||||
+ if(Block.blocksList[i5] instanceof ISpecialResistance) {
|
||||
+ ISpecialResistance isr=(ISpecialResistance)
|
||||
+ Block.blocksList[i5];
|
||||
+ f1-=(isr.getSpecialExplosionResistance(
|
||||
+ worldObj,j4,k4,l4,
|
||||
+ explosionX,explosionY,explosionZ,
|
||||
+ exploder) + 0.3F) * f2;
|
||||
+ } else {
|
||||
+ f1 -= (Block.blocksList[i5].getExplosionResistance(exploder) + 0.3F) * f2;
|
||||
+ }
|
||||
}
|
||||
if(f1 > 0.0F)
|
||||
{
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/ItemBucket.java ../src_work/minecraft_server/net/minecraft/src/ItemBucket.java
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/ItemBucket.java 2011-07-29 16:35:28.000000000 -0400
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/ItemBucket.java 2011-07-31 21:44:50.000000000 -0400
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
+import net.minecraft.src.forge.MinecraftForge;
|
||||
+
|
||||
// Referenced classes of package net.minecraft.src:
|
||||
// Item, EntityPlayer, Vec3D, MathHelper,
|
||||
// World, MovingObjectPosition, EnumMovingObjectType, Material,
|
||||
@@ -55,6 +57,13 @@
|
||||
}
|
||||
if(isFull == 0)
|
||||
{
|
||||
+ ItemStack customBucket = MinecraftForge.fillCustomBucket(world,
|
||||
+ i, j, k);
|
||||
+
|
||||
+ if (customBucket != null) {
|
||||
+ return customBucket;
|
||||
+ }
|
||||
+
|
||||
if(world.getBlockMaterial(i, j, k) == Material.water && world.getBlockMetadata(i, j, k) == 0)
|
||||
{
|
||||
world.setBlockWithNotify(i, j, k, 0);
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/ItemInWorldManager.java ../src_work/minecraft_server/net/minecraft/src/ItemInWorldManager.java
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/ItemInWorldManager.java 2011-07-29 16:35:28.000000000 -0400
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/ItemInWorldManager.java 2011-07-31 21:44:50.000000000 -0400
|
||||
@@ -3,6 +3,7 @@
|
||||
// Decompiler options: packimports(3) braces deadcode
|
||||
|
||||
package net.minecraft.src;
|
||||
+import net.minecraft.src.forge.*;
|
||||
|
||||
|
||||
// Referenced classes of package net.minecraft.src:
|
||||
@@ -145,6 +146,11 @@
|
||||
|
||||
public boolean activeBlockOrUseItem(EntityPlayer entityplayer, World world, ItemStack itemstack, int i, int j, int k, int l)
|
||||
{
|
||||
+ if(itemstack!=null && itemstack.getItem() instanceof IUseItemFirst) {
|
||||
+ IUseItemFirst iuif=(IUseItemFirst)itemstack.getItem();
|
||||
+ if(iuif.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))
|
||||
{
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/ItemPickaxe.java ../src_work/minecraft_server/net/minecraft/src/ItemPickaxe.java
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/ItemPickaxe.java 2011-07-29 16:35:28.000000000 -0400
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/ItemPickaxe.java 2011-07-31 21:44:50.000000000 -0400
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
package net.minecraft.src;
|
||||
|
||||
+import net.minecraft.src.forge.MinecraftForge;
|
||||
+
|
||||
|
||||
// Referenced classes of package net.minecraft.src:
|
||||
// ItemTool, Block, EnumToolMaterial, Material
|
||||
@@ -42,6 +44,9 @@
|
||||
{
|
||||
return toolMaterial.getHarvestLevel() >= 2;
|
||||
}
|
||||
+ if (MinecraftForge.canHarvestBlock(this, block)) {
|
||||
+ return true;
|
||||
+ }
|
||||
if(block.blockMaterial == Material.rock)
|
||||
{
|
||||
return true;
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/ItemTool.java ../src_work/minecraft_server/net/minecraft/src/ItemTool.java
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/ItemTool.java 2011-07-29 16:35:28.000000000 -0400
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/ItemTool.java 2011-07-31 21:49:37.000000000 -0400
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
package net.minecraft.src;
|
||||
|
||||
+import java.util.Arrays;
|
||||
+
|
||||
|
||||
// Referenced classes of package net.minecraft.src:
|
||||
// Item, EnumToolMaterial, ItemStack, Block,
|
||||
@@ -58,4 +60,11 @@
|
||||
private float efficiencyOnProperMaterial;
|
||||
private int damageVsEntity;
|
||||
protected EnumToolMaterial toolMaterial;
|
||||
+
|
||||
+ public void addBlockEffectiveAgainst (Block block) {
|
||||
+ blocksEffectiveAgainst = Arrays.copyOf(blocksEffectiveAgainst,
|
||||
+ blocksEffectiveAgainst.length + 1);
|
||||
+
|
||||
+ blocksEffectiveAgainst [blocksEffectiveAgainst.length-1] = block;
|
||||
+ }
|
||||
}
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/PlayerInstance.java ../src_work/minecraft_server/net/minecraft/src/PlayerInstance.java
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/PlayerInstance.java 2011-07-29 16:35:28.000000000 -0400
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/PlayerInstance.java 2011-07-31 21:44:50.000000000 -0400
|
||||
@@ -169,12 +169,11 @@
|
||||
sendPacketToPlayersInInstance(new Packet52MultiBlockChange(chunkX, chunkZ, blocksToUpdate, numBlocksToUpdate, worldserver));
|
||||
for(int k = 0; k < numBlocksToUpdate; k++)
|
||||
{
|
||||
- int j1 = chunkX * 16 + (numBlocksToUpdate >> 12 & 0xf);
|
||||
- int i2 = numBlocksToUpdate & 0xff;
|
||||
- int k2 = chunkZ * 16 + (numBlocksToUpdate >> 8 & 0xf);
|
||||
+ int j1 = chunkX * 16 + (blocksToUpdate[k] >> 12 & 0xf);
|
||||
+ int i2 = blocksToUpdate[k] & 0xff;
|
||||
+ int k2 = chunkZ * 16 + (blocksToUpdate[k] >> 8 & 0xf);
|
||||
if(Block.isBlockContainer[worldserver.getBlockId(j1, i2, k2)])
|
||||
{
|
||||
- System.out.println("Sending!");
|
||||
updateTileEntity(worldserver.getBlockTileEntity(j1, i2, k2));
|
||||
}
|
||||
}
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
* Eloraam *
|
||||
|
||||
* FlowerChild *
|
||||
|
||||
* Hawkye *
|
||||
|
||||
* MALfunction84 *
|
||||
|
||||
Submitted the sleep handler code for his mod (Somnia) and others to use.
|
||||
|
||||
* Scokeev9 *
|
||||
|
||||
Gave permission for ScotTools API to be integrated into MCF, and also supported the Forge by converting his mods to use it.
|
||||
|
||||
ScotTools Background: ScotTools was an API that enabled modders to add blocks to harvesting levels (and many other ease-of-use features to create new tools), and the first tool API that used block material for block breaking efficiency which allowed blocks from mods that didn't use ScotTools API to break with the correct speed.
|
||||
|
||||
* SpaceToad *
|
||||
|
||||
* LexManos *
|
||||
|
||||
+17
-22
@@ -1,33 +1,18 @@
|
||||
diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/server/MinecraftServer.java ../src_work/minecraft_server/net/minecraft/server/MinecraftServer.java
|
||||
--- ../src_base/minecraft_server/net/minecraft/server/MinecraftServer.java 2011-07-17 00:28:07.755771900 +0200
|
||||
+++ ../src_work/minecraft_server/net/minecraft/server/MinecraftServer.java 2011-07-17 00:28:09.485870900 +0200
|
||||
@@ -333,41 +333,22 @@
|
||||
}
|
||||
finally
|
||||
@@ -397,38 +397,7 @@
|
||||
{
|
||||
- System.exit(0);
|
||||
+ try
|
||||
+ {
|
||||
+ stopServer();
|
||||
+ serverStopped = true;
|
||||
+ }
|
||||
+ catch(Throwable throwable2)
|
||||
+ {
|
||||
+ throwable2.printStackTrace();
|
||||
+ }
|
||||
+ finally
|
||||
+ {
|
||||
+ System.exit(0);
|
||||
+ }
|
||||
System.exit(0);
|
||||
}
|
||||
- break MISSING_BLOCK_LABEL_350;
|
||||
- }
|
||||
}
|
||||
- try
|
||||
- {
|
||||
- stopServer();
|
||||
- serverStopped = true;
|
||||
- }
|
||||
- catch(Throwable throwable)
|
||||
- catch (Throwable throwable)
|
||||
- {
|
||||
- throwable.printStackTrace();
|
||||
- }
|
||||
@@ -43,7 +28,7 @@ diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/server
|
||||
- stopServer();
|
||||
- serverStopped = true;
|
||||
- }
|
||||
- catch(Throwable throwable3)
|
||||
- catch (Throwable throwable3)
|
||||
- {
|
||||
- throwable3.printStackTrace();
|
||||
- }
|
||||
@@ -53,7 +38,17 @@ diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/server
|
||||
- }
|
||||
- throw exception2;
|
||||
}
|
||||
+}
|
||||
|
||||
private void doTick()
|
||||
{
|
||||
|
||||
diff U3 ../src_base/minecraft_server/net/minecraft/src/MLProp.java ../src_work/minecraft_server/net/minecraft/src/MLProp.java
|
||||
--- ../src_base/minecraft_server/net/minecraft/src/MLProp.java Wed Nov 30 22:27:22 2011
|
||||
+++ ../src_work/minecraft_server/net/minecraft/src/MLProp.java Sun Dec 04 14:31:04 2011
|
||||
@@ -8,4 +8,6 @@
|
||||
String info() default "";
|
||||
double min() default Double.NEGATIVE_INFINITY;
|
||||
double max() default Double.POSITIVE_INFINITY;
|
||||
+
|
||||
+ public int reobf() default 0;
|
||||
}
|
||||
\ No newline at end of file
|
||||
+29
-7
@@ -22,7 +22,10 @@ function remove_svn () {
|
||||
function package_all () {
|
||||
qual=$1
|
||||
|
||||
cp $build_dir/minecraftforge_credits.txt .
|
||||
|
||||
zip -r $dir/minecraftforge$qual-$version.zip \
|
||||
minecraftforge_credits.txt \
|
||||
*.class \
|
||||
forge
|
||||
}
|
||||
@@ -46,18 +49,37 @@ rm -rf reobf
|
||||
|
||||
cd $build_dir
|
||||
|
||||
mkdir forge
|
||||
cd forge
|
||||
mkdir src
|
||||
mkdir src/minecraft
|
||||
mkdir src/minecraft_server
|
||||
cp -r forge_client/src/* src/minecraft
|
||||
cp -r forge_server/src/* src/minecraft_server
|
||||
cp -r forge_common/* src/minecraft
|
||||
cp -r forge_common/* src/minecraft_server
|
||||
cp minecraft.patch src
|
||||
mkdir patches
|
||||
mkdir conf
|
||||
cp -r ../forge_client/src/* src/minecraft
|
||||
cp -r ../forge_server/src/* src/minecraft_server
|
||||
cp -r ../forge_common/* src/minecraft
|
||||
cp -r ../forge_common/* src/minecraft_server
|
||||
cp -r ../patches/* patches
|
||||
cp -r ../conf/* conf
|
||||
cp ../lfcr.py .
|
||||
cp ../install/install.cmd .
|
||||
cp ../install/install.sh .
|
||||
cp ../modLoaderMP.patch .
|
||||
cp ../MLProp.java .
|
||||
cp ../install/README.txt .
|
||||
cp ../minecraftforge_credits.txt .
|
||||
cp -r ../doc .
|
||||
|
||||
cd src
|
||||
remove_svn .
|
||||
cd ../patches
|
||||
remove_svn .
|
||||
cd ../conf
|
||||
remove_svn .
|
||||
cd ..
|
||||
|
||||
zip -r $dir/minecraftforge-src-$version.zip src doc
|
||||
rm -rf src
|
||||
cd ..
|
||||
|
||||
zip -r $dir/minecraftforge-src-$version.zip forge
|
||||
rm -rf forge
|
||||
@@ -0,0 +1,358 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/Block.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/Block.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
+import net.minecraft.src.forge.ForgeHooks;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
@@ -277,12 +278,12 @@
|
||||
|
||||
public float getBlockBrightness(IBlockAccess iblockaccess, int i, int j, int k)
|
||||
{
|
||||
- return iblockaccess.getBrightness(i, j, k, lightValue[blockID]);
|
||||
+ return iblockaccess.getBrightness(i, j, k, getLightValue(iblockaccess,i,j,k));
|
||||
}
|
||||
|
||||
public int getMixedBrightnessForBlock(IBlockAccess iblockaccess, int i, int j, int k)
|
||||
{
|
||||
- return iblockaccess.getLightBrightnessForSkyBlocks(i, j, k, lightValue[blockID]);
|
||||
+ return iblockaccess.getLightBrightnessForSkyBlocks(i, j, k, getLightValue(iblockaccess,i,j,k));
|
||||
}
|
||||
|
||||
public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l)
|
||||
@@ -410,20 +411,15 @@
|
||||
return blockID;
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Deprecated in favor of a metadata sensitive version
|
||||
+ * @param entityplayer Entity attacking the block
|
||||
+ * @return
|
||||
+ */
|
||||
+ @Deprecated
|
||||
public float blockStrength(EntityPlayer entityplayer)
|
||||
{
|
||||
- if (blockHardness < 0.0F)
|
||||
- {
|
||||
- return 0.0F;
|
||||
- }
|
||||
- if (!entityplayer.canHarvestBlock(this))
|
||||
- {
|
||||
- return 1.0F / blockHardness / 100F;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- return entityplayer.getCurrentPlayerStrVsBlock(this) / blockHardness / 30F;
|
||||
- }
|
||||
+ return blockStrength(entityplayer, 0);
|
||||
}
|
||||
|
||||
public final void dropBlockAsItem(World world, int i, int j, int k, int l, int i1)
|
||||
@@ -437,18 +433,15 @@
|
||||
{
|
||||
return;
|
||||
}
|
||||
- int j1 = quantityDroppedWithBonus(i1, world.rand);
|
||||
- for (int k1 = 0; k1 < j1; k1++)
|
||||
+
|
||||
+ ArrayList<ItemStack> items = getBlockDropped(world, i, j, k, l, i1);
|
||||
+ for(ItemStack item : items)
|
||||
{
|
||||
if (world.rand.nextFloat() > f)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
- int l1 = idDropped(l, world.rand, i1);
|
||||
- if (l1 > 0)
|
||||
- {
|
||||
- dropBlockAsItem_do(world, i, j, k, new ItemStack(l1, 1, damageDropped(l)));
|
||||
- }
|
||||
+ dropBlockAsItem_do(world, i, j, k, item);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -696,7 +689,7 @@
|
||||
{
|
||||
entityplayer.addStat(StatList.mineBlockStatArray[blockID], 1);
|
||||
entityplayer.addExhaustion(0.025F);
|
||||
- if (renderAsNormalBlock() && !isBlockContainer[blockID] && EnchantmentHelper.getSilkTouchModifier(entityplayer.inventory))
|
||||
+ if (renderAsNormalBlock() && !hasTileEntity(l) && EnchantmentHelper.getSilkTouchModifier(entityplayer.inventory))
|
||||
{
|
||||
ItemStack itemstack = createStackedBlock(l);
|
||||
if (itemstack != null)
|
||||
@@ -780,6 +773,273 @@
|
||||
{
|
||||
}
|
||||
|
||||
+ /* FORGE: Allow a block to set illumination on a coordinate basis.
|
||||
+ */
|
||||
+ public int getLightValue(IBlockAccess iba, int i, int j, int k) {
|
||||
+ return lightValue[blockID];
|
||||
+ }
|
||||
+
|
||||
+ /* FORGE: Implement and return true if you wish this block to behave
|
||||
+ * like a ladder when the player is inside.
|
||||
+ */
|
||||
+ public boolean isLadder(World world, int i, int j, int k) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ /* FORGE: Return true if the block is a normal, solid cube. This
|
||||
+ * determines indirect power state, entity ejection from blocks, and a few
|
||||
+ * others.
|
||||
+ */
|
||||
+ public boolean isBlockNormalCube(World world, int i, int j, int k) {
|
||||
+ return blockMaterial.getIsOpaque() && renderAsNormalBlock();
|
||||
+ }
|
||||
+
|
||||
+ /* FORGE: Return true if the block is solid on the given side. This
|
||||
+ * is used by placement logic. */
|
||||
+ public boolean isBlockSolidOnSide( World world, int i, int j, int k,
|
||||
+ int side ) {
|
||||
+ return isBlockNormalCube(world,i,j,k);
|
||||
+ }
|
||||
+
|
||||
+ /* FORGE: Return true if the player can place a new block in the block
|
||||
+ * occupied by this one, like water, lava, fire, etc.
|
||||
+ */
|
||||
+ public boolean isBlockReplaceable( World world, int i, int j, int k ) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ /* FORGE: Return true if this block should set fire and deal fire damage
|
||||
+ * to entities coming into contact with it, false otherwise.
|
||||
+ */
|
||||
+ public boolean isBlockBurning( World world, int i, int j, int k ) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ /* FORGE: Return true if this block should be treated as an air block
|
||||
+ * by the rest of the code, false otherwise. This method is primarily
|
||||
+ * useful for creating pure logic-blocks that will be invisible
|
||||
+ * to the player and otherwise interact as air would.
|
||||
+ */
|
||||
+ public boolean isAirBlock( World world, int i, int j, int k ) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ /* FORGE: Return the block hardness with metadata md.
|
||||
+ */
|
||||
+ public float getHardness(int md) {
|
||||
+ return blockHardness;
|
||||
+ }
|
||||
+
|
||||
+ /* FORGE: Return the block strength of the block at i,j,k against the
|
||||
+ * player.
|
||||
+ */
|
||||
+ public float blockStrength(World world, EntityPlayer player,
|
||||
+ int i, int j, int k) {
|
||||
+ int md=world.getBlockMetadata(i,j,k);
|
||||
+ return blockStrength(player,md);
|
||||
+ }
|
||||
+
|
||||
+ /* FORGE: Return the block strength of a prototypical block with metadata
|
||||
+ * md against the player.
|
||||
+ */
|
||||
+ public float blockStrength(EntityPlayer player, int md) {
|
||||
+ return ForgeHooks.blockStrength(this,player,md);
|
||||
+ }
|
||||
+
|
||||
+ /* FORGE: Return true if the player can harvest a prototypical block with
|
||||
+ * metadata md.
|
||||
+ */
|
||||
+ public boolean canHarvestBlock(EntityPlayer player, int md) {
|
||||
+ return ForgeHooks.canHarvestBlock(this,player,md);
|
||||
+ }
|
||||
+
|
||||
+ /* FORGE: Called when a player removes a block. This is responsible for
|
||||
+ * actually destroying the block, and the block is intact at time of call.
|
||||
+ * This is called regardless of whether the player can harvest the block or
|
||||
+ * not. Return true if the block is actually destroyed.
|
||||
+ *
|
||||
+ * Note: When used in multiplayer, this is called on both client and
|
||||
+ * server sides!
|
||||
+ */
|
||||
+ public boolean removeBlockByPlayer(World world, EntityPlayer player,
|
||||
+ int i, int j, int k) {
|
||||
+ return world.setBlockWithNotify(i, j, k, 0);
|
||||
+ }
|
||||
+
|
||||
+ /* FORGE: Called when a new CreativeContainer is opened, populate the list
|
||||
+ * with all of the items for this block you want a player in creative mode
|
||||
+ * to have access to.
|
||||
+ */
|
||||
+ public void addCreativeItems(ArrayList itemList)
|
||||
+ {
|
||||
+ }
|
||||
+
|
||||
+ protected static int blockFireSpreadSpeed[] = new int[256];
|
||||
+ protected static int blockFlammability[] = new int[256];
|
||||
+
|
||||
+ /**
|
||||
+ * Chance that fire will spread and consume this block.
|
||||
+ * 300 being a 100% chance, 0, being a 0% chance.
|
||||
+ *
|
||||
+ * @param world The current world
|
||||
+ * @param x The blocks X position
|
||||
+ * @param y The blocks Y position
|
||||
+ * @param z The blocks Z position
|
||||
+ * @param metadata The blocks current metadata
|
||||
+ * @param face The face that the fire is coming from
|
||||
+ * @return A number ranging from 0 to 300 relating used to determine if the block will be consumed by fire
|
||||
+ */
|
||||
+ public int getFlammability(IBlockAccess world, int x, int y, int z, int metadata, int face)
|
||||
+ {
|
||||
+ return blockFlammability[blockID];
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Called when fire is updating, checks if a block face can catch fire.
|
||||
+ *
|
||||
+ *
|
||||
+ * @param world The current world
|
||||
+ * @param x The blocks X position
|
||||
+ * @param y The blocks Y position
|
||||
+ * @param z The blocks Z position
|
||||
+ * @param metadata The blocks current metadata
|
||||
+ * @param face The face that the fire is coming from
|
||||
+ * @return True if the face can be on fire, false otherwise.
|
||||
+ */
|
||||
+ public boolean isFlammable(IBlockAccess world, int x, int y, int z, int metadata, int face)
|
||||
+ {
|
||||
+ return getFlammability(world, x, y, z, metadata, face) > 0;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Called when fire is updating on a neighbor block.
|
||||
+ * The higher the number returned, the faster fire will spread around this block.
|
||||
+ *
|
||||
+ * @param world The current world
|
||||
+ * @param x The blocks X position
|
||||
+ * @param y The blocks Y position
|
||||
+ * @param z The blocks Z position
|
||||
+ * @param metadata The blocks current metadata
|
||||
+ * @param face The face that the fire is coming from
|
||||
+ * @return A number that is used to determine the speed of fire growth around the block
|
||||
+ */
|
||||
+ public int getFireSpreadSpeed(World world, int x, int y, int z, int metadata, int face)
|
||||
+ {
|
||||
+ return blockFireSpreadSpeed[blockID];
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Currently only called by fire when it is on top of this block.
|
||||
+ * Returning true will prevent the fire from naturally dying during updating.
|
||||
+ * Also prevents firing from dying from rain.
|
||||
+ *
|
||||
+ * @param world The current world
|
||||
+ * @param x The blocks X position
|
||||
+ * @param y The blocks Y position
|
||||
+ * @param z The blocks Z position
|
||||
+ * @param metadata The blocks current metadata
|
||||
+ * @param face The face that the fire is coming from
|
||||
+ * @return
|
||||
+ */
|
||||
+ public boolean isFireSource(World world, int x, int y, int z, int metadata, int face)
|
||||
+ {
|
||||
+ if (blockID == Block.netherrack.blockID && face == 0)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+ if ((world.worldProvider instanceof WorldProviderEnd) && blockID == Block.bedrock.blockID && face == 0)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Called by BlockFire to setup the burn values of vanilla blocks.
|
||||
+ * @param id The block id
|
||||
+ * @param encouragement How much the block encourages fire to spread
|
||||
+ * @param flammability how easy a block is to catch fire
|
||||
+ */
|
||||
+ public static void setBurnProperties(int id, int encouragement, int flammability)
|
||||
+ {
|
||||
+ blockFireSpreadSpeed[id] = encouragement;
|
||||
+ blockFlammability[id] = flammability;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Called throughout the code as a replacement for block instanceof BlockContainer
|
||||
+ * Moving this to the Block base class allows for mods that wish to extend vinella
|
||||
+ * blocks, and also want to have a tile entity on that block, may.
|
||||
+ *
|
||||
+ * Return true from this function to specify this block has a tile entity.
|
||||
+ *
|
||||
+ * @param metadata Metadata of the current block
|
||||
+ * @return True if block has a tile entity, false otherwise
|
||||
+ */
|
||||
+ public boolean hasTileEntity(int metadata)
|
||||
+ {
|
||||
+ return isBlockContainer[blockID];
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Called throughout the code as a replacement for BlockContainer.getBlockEntity
|
||||
+ * Return the same thing you would from that function.
|
||||
+ * This will fall back to BlockContainer.getBlockEntity if this block is a BlockContainer.
|
||||
+ *
|
||||
+ * @param metadata The Metadata of the current block
|
||||
+ * @return A instance of a class extending TileEntity
|
||||
+ */
|
||||
+ public TileEntity getTileEntity(int metadata)
|
||||
+ {
|
||||
+ if (this instanceof BlockContainer)
|
||||
+ {
|
||||
+ return ((BlockContainer)this).getBlockEntity(metadata);
|
||||
+ }
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Metadata and fortune sensitive version, this replaces the old (int meta, Random rand)
|
||||
+ * version in 1.1.
|
||||
+ *
|
||||
+ * @param meta Blocks Metadata
|
||||
+ * @param fortune Current item fortune level
|
||||
+ * @param random Random number generator
|
||||
+ * @return The number of items to drop
|
||||
+ */
|
||||
+ public int quantityDropped(int meta, int fortune, Random random)
|
||||
+ {
|
||||
+ return quantityDroppedWithBonus(fortune, random);
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * This returns a complete list of items dropped from this block.
|
||||
+ *
|
||||
+ * @param world The current world
|
||||
+ * @param X X Position
|
||||
+ * @param Y Y Position
|
||||
+ * @param Z Z Position
|
||||
+ * @param metadata Current metadata
|
||||
+ * @param fortune Breakers fortune level
|
||||
+ * @return A ArrayList containing all items this block drops
|
||||
+ */
|
||||
+ public ArrayList<ItemStack> getBlockDropped(World world, int X, int Y, int Z, int metadata, int fortune)
|
||||
+ {
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+
|
||||
+ int count = quantityDropped(metadata, fortune, world.rand);
|
||||
+ for(int i = 0; i < count; i++)
|
||||
+ {
|
||||
+ int id = idDropped(metadata, world.rand, 0);
|
||||
+ if (id > 0)
|
||||
+ {
|
||||
+ ret.add(new ItemStack(id, 1, damageDropped(metadata)));
|
||||
+ }
|
||||
+ }
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
static Class _mthclass$(String s)
|
||||
{
|
||||
try
|
||||
@@ -0,0 +1,119 @@
|
||||
--- ../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;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
--- ../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;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/BlockContainer.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/BlockContainer.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -17,7 +17,7 @@
|
||||
public void onBlockAdded(World world, int i, int j, int k)
|
||||
{
|
||||
super.onBlockAdded(world, i, j, k);
|
||||
- world.setBlockTileEntity(i, j, k, getBlockEntity());
|
||||
+ world.setBlockTileEntity(i, j, k, getBlockEntity(world.getBlockMetadata(i,j,k)));
|
||||
}
|
||||
|
||||
public void onBlockRemoval(World world, int i, int j, int k)
|
||||
@@ -28,6 +28,18 @@
|
||||
|
||||
public abstract TileEntity getBlockEntity();
|
||||
|
||||
+ /* FORGE: Metadata-sensitive version, to fix 1.8.1 regression.
|
||||
+ */
|
||||
+ /**
|
||||
+ * Metadata-sensitive version, to fix 1.8.1 regression.
|
||||
+ * @param metadata The current Metadata
|
||||
+ * @return And instance of the TileEntity class for this block
|
||||
+ */
|
||||
+ public TileEntity getBlockEntity(int md)
|
||||
+ {
|
||||
+ return getBlockEntity();
|
||||
+ }
|
||||
+
|
||||
public void powerBlock(World world, int i, int j, int k, int l, int i1)
|
||||
{
|
||||
super.powerBlock(world, i, j, k, l, i1);
|
||||
@@ -0,0 +1,48 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/BlockCrops.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/BlockCrops.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
+import java.util.ArrayList;
|
||||
|
||||
public class BlockCrops extends BlockFlower
|
||||
{
|
||||
@@ -98,27 +99,23 @@
|
||||
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)
|
||||
{
|
||||
- super.dropBlockAsItemWithChance(world, i, j, k, l, f, 0);
|
||||
- if (world.isRemote)
|
||||
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
+ if (meta == 7)
|
||||
{
|
||||
- return;
|
||||
+ ret.add(new ItemStack(Item.wheat));
|
||||
}
|
||||
- int j1 = 3 + i1;
|
||||
- for (int k1 = 0; k1 < j1; k1++)
|
||||
+
|
||||
+ for (int n = 0; n < 3 + fortune; n++)
|
||||
{
|
||||
- if (world.rand.nextInt(15) <= l)
|
||||
+ if (world.rand.nextInt(15) <= meta)
|
||||
{
|
||||
- float f1 = 0.7F;
|
||||
- float f2 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
|
||||
- float f3 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
|
||||
- float f4 = world.rand.nextFloat() * f1 + (1.0F - f1) * 0.5F;
|
||||
- EntityItem entityitem = new EntityItem(world, (float)i + f2, (float)j + f3, (float)k + f4, new ItemStack(Item.seeds));
|
||||
- entityitem.delayBeforeCanPickup = 10;
|
||||
- world.spawnEntityInWorld(entityitem);
|
||||
+ ret.add(new ItemStack(Item.seeds));
|
||||
}
|
||||
}
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
public int idDropped(int i, Random random, int j)
|
||||
@@ -0,0 +1,29 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/BlockDoor.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/BlockDoor.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -101,7 +101,7 @@
|
||||
{
|
||||
if (blockMaterial == Material.iron)
|
||||
{
|
||||
- return true;
|
||||
+ return false;
|
||||
}
|
||||
int l = world.getBlockMetadata(i, j, k);
|
||||
if ((l & 8) != 0)
|
||||
@@ -169,7 +169,7 @@
|
||||
world.setBlockWithNotify(i, j, k, 0);
|
||||
flag = true;
|
||||
}
|
||||
- if (!world.isBlockNormalCube(i, j - 1, k))
|
||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1))
|
||||
{
|
||||
world.setBlockWithNotify(i, j, k, 0);
|
||||
flag = true;
|
||||
@@ -238,7 +238,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- return world.isBlockNormalCube(i, j - 1, k) && super.canPlaceBlockAt(world, i, j, k) && super.canPlaceBlockAt(world, i, j + 1, k);
|
||||
+ return world.isBlockSolidOnSide(i, j - 1, k, 1) && super.canPlaceBlockAt(world, i, j, k) && super.canPlaceBlockAt(world, i, j + 1, k);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,297 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/BlockFire.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/BlockFire.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -10,8 +10,8 @@
|
||||
protected BlockFire(int i, int j)
|
||||
{
|
||||
super(i, j, Material.fire);
|
||||
- chanceToEncourageFire = new int[256];
|
||||
- abilityToCatchFire = new int[256];
|
||||
+ chanceToEncourageFire = Block.blockFireSpreadSpeed;
|
||||
+ abilityToCatchFire = Block.blockFlammability;
|
||||
setTickOnLoad(true);
|
||||
}
|
||||
|
||||
@@ -28,11 +28,10 @@
|
||||
setBurnRate(Block.cloth.blockID, 30, 60);
|
||||
setBurnRate(Block.vine.blockID, 15, 100);
|
||||
}
|
||||
-
|
||||
+
|
||||
private void setBurnRate(int i, int j, int k)
|
||||
{
|
||||
- chanceToEncourageFire[i] = j;
|
||||
- abilityToCatchFire[i] = k;
|
||||
+ Block.setBurnProperties(i, j, k);
|
||||
}
|
||||
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
|
||||
@@ -67,7 +66,9 @@
|
||||
|
||||
public void updateTick(World world, int i, int j, int k, Random random)
|
||||
{
|
||||
- boolean flag = world.getBlockId(i, j - 1, k) == Block.netherrack.blockID;
|
||||
+ Block base = Block.blocksList[world.getBlockId(i, j - 1, k)];
|
||||
+ boolean flag = (base != null && base.isFireSource(world, i, j - 1, k, world.getBlockMetadata(i, j - 1, k), 0));
|
||||
+
|
||||
if ((world.worldProvider instanceof WorldProviderEnd) && world.getBlockId(i, j - 1, k) == Block.bedrock.blockID)
|
||||
{
|
||||
flag = true;
|
||||
@@ -89,23 +90,23 @@
|
||||
world.scheduleBlockUpdate(i, j, k, blockID, tickRate());
|
||||
if (!flag && !canNeighborBurn(world, i, j, k))
|
||||
{
|
||||
- if (!world.isBlockNormalCube(i, j - 1, k) || l > 3)
|
||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) || l > 3)
|
||||
{
|
||||
world.setBlockWithNotify(i, j, k, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
- if (!flag && !canBlockCatchFire(world, i, j - 1, k) && l == 15 && random.nextInt(4) == 0)
|
||||
+ if (!flag && !canBlockCatchFire(world, i, j - 1, k, 1) && l == 15 && random.nextInt(4) == 0)
|
||||
{
|
||||
world.setBlockWithNotify(i, j, k, 0);
|
||||
return;
|
||||
}
|
||||
- tryToCatchBlockOnFire(world, i + 1, j, k, 300, random, l);
|
||||
- tryToCatchBlockOnFire(world, i - 1, j, k, 300, random, l);
|
||||
- tryToCatchBlockOnFire(world, i, j - 1, k, 250, random, l);
|
||||
- tryToCatchBlockOnFire(world, i, j + 1, k, 250, random, l);
|
||||
- tryToCatchBlockOnFire(world, i, j, k - 1, 300, random, l);
|
||||
- tryToCatchBlockOnFire(world, i, j, k + 1, 300, random, l);
|
||||
+ tryToCatchBlockOnFire(world, i + 1, j, k, 300, random, l, 4);
|
||||
+ tryToCatchBlockOnFire(world, i - 1, j, k, 300, random, l, 5);
|
||||
+ tryToCatchBlockOnFire(world, i, j - 1, k, 250, random, l, 1);
|
||||
+ tryToCatchBlockOnFire(world, i, j + 1, k, 250, random, l, 0);
|
||||
+ tryToCatchBlockOnFire(world, i, j, k - 1, 300, random, l, 3);
|
||||
+ tryToCatchBlockOnFire(world, i, j, k + 1, 300, random, l, 2);
|
||||
for (int i1 = i - 1; i1 <= i + 1; i1++)
|
||||
{
|
||||
for (int j1 = k - 1; j1 <= k + 1; j1++)
|
||||
@@ -142,9 +143,24 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Deprecated for a side-sensitive version
|
||||
+ */
|
||||
+ @Deprecated
|
||||
private void tryToCatchBlockOnFire(World world, int i, int j, int k, int l, Random random, int i1)
|
||||
{
|
||||
- int j1 = abilityToCatchFire[world.getBlockId(i, j, k)];
|
||||
+ tryToCatchBlockOnFire(world, i, j, k, l, random, i1, 0);
|
||||
+ }
|
||||
+
|
||||
+ private void tryToCatchBlockOnFire(World world, int i, int j, int k, int l, Random random, int i1, int face)
|
||||
+ {
|
||||
+ int j1 = 0;
|
||||
+ Block block = Block.blocksList[world.getBlockId(i, j, k)];
|
||||
+ if (block != null)
|
||||
+ {
|
||||
+ j1 = block.getFlammability(world, i, j, k, world.getBlockMetadata(i, j, k), face);
|
||||
+ }
|
||||
+
|
||||
if (random.nextInt(l) < j1)
|
||||
{
|
||||
boolean flag = world.getBlockId(i, j, k) == Block.tnt.blockID;
|
||||
@@ -170,27 +186,27 @@
|
||||
|
||||
private boolean canNeighborBurn(World world, int i, int j, int k)
|
||||
{
|
||||
- if (canBlockCatchFire(world, i + 1, j, k))
|
||||
+ if (canBlockCatchFire(world, i + 1, j, k, 4))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (canBlockCatchFire(world, i - 1, j, k))
|
||||
+ if (canBlockCatchFire(world, i - 1, j, k, 5))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (canBlockCatchFire(world, i, j - 1, k))
|
||||
+ if (canBlockCatchFire(world, i, j - 1, k, 1))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (canBlockCatchFire(world, i, j + 1, k))
|
||||
+ if (canBlockCatchFire(world, i, j + 1, k, 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if (canBlockCatchFire(world, i, j, k - 1))
|
||||
+ if (canBlockCatchFire(world, i, j, k - 1, 3))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- return canBlockCatchFire(world, i, j, k + 1);
|
||||
+ return canBlockCatchFire(world, i, j, k + 1, 2);
|
||||
}
|
||||
|
||||
private int getChanceOfNeighborsEncouragingFire(World world, int i, int j, int k)
|
||||
@@ -202,12 +218,12 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- l = getChanceToEncourageFire(world, i + 1, j, k, l);
|
||||
- l = getChanceToEncourageFire(world, i - 1, j, k, l);
|
||||
- l = getChanceToEncourageFire(world, i, j - 1, k, l);
|
||||
- l = getChanceToEncourageFire(world, i, j + 1, k, l);
|
||||
- l = getChanceToEncourageFire(world, i, j, k - 1, l);
|
||||
- l = getChanceToEncourageFire(world, i, j, k + 1, l);
|
||||
+ l = getChanceToEncourageFire(world, i + 1, j, k, l, 4);
|
||||
+ l = getChanceToEncourageFire(world, i - 1, j, k, l, 5);
|
||||
+ l = getChanceToEncourageFire(world, i, j - 1, k, l, 1);
|
||||
+ l = getChanceToEncourageFire(world, i, j + 1, k, l, 0);
|
||||
+ l = getChanceToEncourageFire(world, i, j, k - 1, l, 3);
|
||||
+ l = getChanceToEncourageFire(world, i, j, k + 1, l, 2);
|
||||
return l;
|
||||
}
|
||||
}
|
||||
@@ -217,32 +233,32 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Deprecated for a side-sensitive version
|
||||
+ */
|
||||
+ @Deprecated
|
||||
public boolean canBlockCatchFire(IBlockAccess iblockaccess, int i, int j, int k)
|
||||
{
|
||||
- return chanceToEncourageFire[iblockaccess.getBlockId(i, j, k)] > 0;
|
||||
+ return canBlockCatchFire(iblockaccess, i, j, k, 0);
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Deprecated for a side-sensitive version
|
||||
+ */
|
||||
+ @Deprecated
|
||||
public int getChanceToEncourageFire(World world, int i, int j, int k, int l)
|
||||
{
|
||||
- int i1 = chanceToEncourageFire[world.getBlockId(i, j, k)];
|
||||
- if (i1 > l)
|
||||
- {
|
||||
- return i1;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- return l;
|
||||
- }
|
||||
+ return getChanceToEncourageFire(world, i, j, k, l, 0);
|
||||
}
|
||||
|
||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
||||
{
|
||||
- return world.isBlockNormalCube(i, j - 1, k) || canNeighborBurn(world, i, j, k);
|
||||
+ return world.isBlockSolidOnSide(i, j - 1, k, 1) || canNeighborBurn(world, i, j, k);
|
||||
}
|
||||
|
||||
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
|
||||
{
|
||||
- if (!world.isBlockNormalCube(i, j - 1, k) && !canNeighborBurn(world, i, j, k))
|
||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && !canNeighborBurn(world, i, j, k))
|
||||
{
|
||||
world.setBlockWithNotify(i, j, k, 0);
|
||||
return;
|
||||
@@ -259,7 +275,7 @@
|
||||
{
|
||||
return;
|
||||
}
|
||||
- if (!world.isBlockNormalCube(i, j - 1, k) && !canNeighborBurn(world, i, j, k))
|
||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && !canNeighborBurn(world, i, j, k))
|
||||
{
|
||||
world.setBlockWithNotify(i, j, k, 0);
|
||||
return;
|
||||
@@ -277,7 +293,7 @@
|
||||
{
|
||||
world.playSoundEffect((float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, "fire.fire", 1.0F + random.nextFloat(), random.nextFloat() * 0.7F + 0.3F);
|
||||
}
|
||||
- if (world.isBlockNormalCube(i, j - 1, k) || Block.fire.canBlockCatchFire(world, i, j - 1, k))
|
||||
+ if (world.isBlockSolidOnSide(i, j - 1, k, 1) || Block.fire.canBlockCatchFire(world, i, j - 1, k, 1))
|
||||
{
|
||||
for (int l = 0; l < 3; l++)
|
||||
{
|
||||
@@ -289,7 +305,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
- if (Block.fire.canBlockCatchFire(world, i - 1, j, k))
|
||||
+ if (Block.fire.canBlockCatchFire(world, i - 1, j, k, 5))
|
||||
{
|
||||
for (int i1 = 0; i1 < 2; i1++)
|
||||
{
|
||||
@@ -299,7 +315,7 @@
|
||||
world.spawnParticle("largesmoke", f1, f7, f13, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
- if (Block.fire.canBlockCatchFire(world, i + 1, j, k))
|
||||
+ if (Block.fire.canBlockCatchFire(world, i + 1, j, k, 4))
|
||||
{
|
||||
for (int j1 = 0; j1 < 2; j1++)
|
||||
{
|
||||
@@ -309,7 +325,7 @@
|
||||
world.spawnParticle("largesmoke", f2, f8, f14, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
- if (Block.fire.canBlockCatchFire(world, i, j, k - 1))
|
||||
+ if (Block.fire.canBlockCatchFire(world, i, j, k - 1, 3))
|
||||
{
|
||||
for (int k1 = 0; k1 < 2; k1++)
|
||||
{
|
||||
@@ -319,7 +335,7 @@
|
||||
world.spawnParticle("largesmoke", f3, f9, f15, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
- if (Block.fire.canBlockCatchFire(world, i, j, k + 1))
|
||||
+ if (Block.fire.canBlockCatchFire(world, i, j, k + 1, 2))
|
||||
{
|
||||
for (int l1 = 0; l1 < 2; l1++)
|
||||
{
|
||||
@@ -329,7 +345,7 @@
|
||||
world.spawnParticle("largesmoke", f4, f10, f16, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
- if (Block.fire.canBlockCatchFire(world, i, j + 1, k))
|
||||
+ if (Block.fire.canBlockCatchFire(world, i, j + 1, k, 0))
|
||||
{
|
||||
for (int i2 = 0; i2 < 2; i2++)
|
||||
{
|
||||
@@ -341,4 +357,39 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
+ /**
|
||||
+ * Forge: Side sensitive version
|
||||
+ */
|
||||
+ public boolean canBlockCatchFire(IBlockAccess world, int i, int j, int k, int face)
|
||||
+ {
|
||||
+ Block block = Block.blocksList[world.getBlockId(i, j, k)];
|
||||
+ if (block != null)
|
||||
+ {
|
||||
+ return block.isFlammable(world, i, j, k, world.getBlockMetadata(i, j, k), face);
|
||||
+ }
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Forge: Side sensitive version
|
||||
+ */
|
||||
+ public int getChanceToEncourageFire(World world, int i, int j, int k, int l, int face)
|
||||
+ {
|
||||
+ int i1 = 0;
|
||||
+ Block block = Block.blocksList[world.getBlockId(i, j, k)];
|
||||
+ if (block != null)
|
||||
+ {
|
||||
+ i1 = block.getFireSpreadSpeed(world, i, j, k, world.getBlockMetadata(i, j, k), face);
|
||||
+ }
|
||||
+
|
||||
+ if (i1 > l)
|
||||
+ {
|
||||
+ return i1;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ return l;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
--- ../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;
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
--- ../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;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
--- ../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)
|
||||
@@ -0,0 +1,11 @@
|
||||
--- ../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)
|
||||
@@ -0,0 +1,20 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/BlockPressurePlate.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/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)
|
||||
@@ -48,7 +48,7 @@
|
||||
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
|
||||
{
|
||||
boolean flag = false;
|
||||
- if (!world.isBlockNormalCube(i, j - 1, k) && world.getBlockId(i, j - 1, k) != Block.fence.blockID)
|
||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1) && world.getBlockId(i, j - 1, k) != Block.fence.blockID)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
--- ../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;
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/BlockRedstoneRepeater.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/BlockRedstoneRepeater.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
public boolean canPlaceBlockAt(World world, int i, int j, int k)
|
||||
{
|
||||
- if (!world.isBlockNormalCube(i, j - 1, k))
|
||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
public boolean canBlockStay(World world, int i, int j, int k)
|
||||
{
|
||||
- if (!world.isBlockNormalCube(i, j - 1, k))
|
||||
+ if (!world.isBlockSolidOnSide(i, j - 1, k, 1))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
--- ../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;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/BlockSnow.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/BlockSnow.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -63,7 +63,6 @@
|
||||
{
|
||||
if (!canPlaceBlockAt(world, i, j, k))
|
||||
{
|
||||
- dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
|
||||
world.setBlockWithNotify(i, j, k, 0);
|
||||
return false;
|
||||
}
|
||||
@@ -75,15 +74,7 @@
|
||||
|
||||
public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l)
|
||||
{
|
||||
- int i1 = Item.snowball.shiftedIndex;
|
||||
- float f = 0.7F;
|
||||
- double d = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||
- double d1 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||
- double d2 = (double)(world.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
|
||||
- EntityItem entityitem = new EntityItem(world, (double)i + d, (double)j + d1, (double)k + d2, new ItemStack(i1, 1, 0));
|
||||
- entityitem.delayBeforeCanPickup = 10;
|
||||
- world.spawnEntityInWorld(entityitem);
|
||||
- world.setBlockWithNotify(i, j, k, 0);
|
||||
+ dropBlockAsItem(world, i, j, k, l, 0);
|
||||
entityplayer.addStat(StatList.mineBlockStatArray[blockID], 1);
|
||||
}
|
||||
|
||||
@@ -94,14 +85,13 @@
|
||||
|
||||
public int quantityDropped(Random random)
|
||||
{
|
||||
- return 0;
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
public void updateTick(World world, int i, int j, int k, Random random)
|
||||
{
|
||||
if (world.getSavedLightValue(EnumSkyBlock.Block, i, j, k) > 11)
|
||||
{
|
||||
- dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0);
|
||||
world.setBlockWithNotify(i, j, k, 0);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
--- ../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)
|
||||
@@ -0,0 +1,107 @@
|
||||
--- ../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;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/BlockTrapDoor.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/BlockTrapDoor.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
public class BlockTrapDoor extends Block
|
||||
{
|
||||
+ /* FORGE: Set this to allow trapdoors to remain free-floating */
|
||||
+ public static boolean disableValidation = false;
|
||||
+
|
||||
protected BlockTrapDoor(int i, Material material)
|
||||
{
|
||||
super(i, material);
|
||||
@@ -139,7 +142,7 @@
|
||||
{
|
||||
j1--;
|
||||
}
|
||||
- if (!func_41052_f(world.getBlockId(j1, j, k1)))
|
||||
+ if (!(func_41052_f(world.getBlockId(j1, j, k1)) || world.isBlockSolidOnSide(j1, j, k1, (i1 & 3) + 2)))
|
||||
{
|
||||
world.setBlockWithNotify(i, j, k, 0);
|
||||
dropBlockAsItem(world, i, j, k, i1, 0);
|
||||
@@ -181,6 +184,10 @@
|
||||
|
||||
public boolean canPlaceBlockOnSide(World world, int i, int j, int k, int l)
|
||||
{
|
||||
+ if (disableValidation)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
if (l == 0)
|
||||
{
|
||||
return false;
|
||||
@@ -205,7 +212,7 @@
|
||||
{
|
||||
i--;
|
||||
}
|
||||
- return func_41052_f(world.getBlockId(i, j, k));
|
||||
+ return func_41052_f(world.getBlockId(i, j, k)) || world.isBlockSolidOnSide(i, j, k, l);
|
||||
}
|
||||
|
||||
public static boolean isTrapdoorOpen(int i)
|
||||
@@ -215,6 +222,11 @@
|
||||
|
||||
private static boolean func_41052_f(int i)
|
||||
{
|
||||
+ if (disableValidation)
|
||||
+ {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
if (i <= 0)
|
||||
{
|
||||
return false;
|
||||
@@ -0,0 +1,233 @@
|
||||
--- ../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);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
--- ../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;
|
||||
@@ -0,0 +1,11 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/CraftingManager.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/CraftingManager.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -423,7 +423,7 @@
|
||||
i++;
|
||||
}
|
||||
|
||||
- if (i == 2 && itemstack.itemID == itemstack1.itemID && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && Item.itemsList[itemstack.itemID].isDamageable())
|
||||
+ if (i == 2 && itemstack.itemID == itemstack1.itemID && itemstack.stackSize == 1 && itemstack1.stackSize == 1 && Item.itemsList[itemstack.itemID].isRepairable())
|
||||
{
|
||||
Item item = Item.itemsList[itemstack.itemID];
|
||||
int l = item.getMaxDamage() - itemstack.getItemDamageForDisplay();
|
||||
@@ -0,0 +1,153 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/EffectRenderer.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/EffectRenderer.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -1,17 +1,23 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.util.*;
|
||||
+
|
||||
+import net.minecraft.src.forge.BlockTextureParticles;
|
||||
+import net.minecraft.src.forge.ITextureProvider;
|
||||
+
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class EffectRenderer
|
||||
{
|
||||
protected World worldObj;
|
||||
private List fxLayers[];
|
||||
+ private List effectList;
|
||||
private RenderEngine renderer;
|
||||
private Random rand;
|
||||
|
||||
public EffectRenderer(World world, RenderEngine renderengine)
|
||||
{
|
||||
+ effectList = new ArrayList();
|
||||
fxLayers = new List[4];
|
||||
rand = new Random();
|
||||
if (world != null)
|
||||
@@ -49,6 +55,23 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
+ for (int x = 0; x < effectList.size(); x++)
|
||||
+ {
|
||||
+ BlockTextureParticles entry = (BlockTextureParticles)effectList.get(x);
|
||||
+ for (int y = 0; y < entry.effects.size(); y++)
|
||||
+ {
|
||||
+ EntityFX entityfx = (EntityFX) entry.effects.get(y);
|
||||
+ if (entityfx.isDead)
|
||||
+ {
|
||||
+ entry.effects.remove(y--);
|
||||
+ }
|
||||
+ }
|
||||
+ if (effectList.size() == 0)
|
||||
+ {
|
||||
+ effectList.remove(x--);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
public void renderParticles(Entity entity, float f)
|
||||
@@ -87,12 +110,31 @@
|
||||
for (int k = 0; k < fxLayers[i].size(); k++)
|
||||
{
|
||||
EntityFX entityfx = (EntityFX)fxLayers[i].get(k);
|
||||
+ if (entityfx instanceof EntityDiggingFX)
|
||||
+ {
|
||||
+ continue;
|
||||
+ }
|
||||
tessellator.setBrightness(entityfx.getEntityBrightnessForRender(f));
|
||||
entityfx.renderParticle(tessellator, f, f1, f5, f2, f3, f4);
|
||||
}
|
||||
|
||||
tessellator.draw();
|
||||
}
|
||||
+
|
||||
+ Tessellator tessellator = Tessellator.instance;
|
||||
+ for (int x = 0; x < effectList.size(); x++)
|
||||
+ {
|
||||
+ BlockTextureParticles entry = (BlockTextureParticles) effectList.get(x);
|
||||
+ GL11.glBindTexture(3553 /* GL_TEXTURE_2D */, renderer.getTexture(entry.texture));
|
||||
+ tessellator.startDrawingQuads();
|
||||
+ for (int y = 0; y < entry.effects.size(); y++)
|
||||
+ {
|
||||
+ EntityFX entityfx = (EntityFX) entry.effects.get(y);
|
||||
+ tessellator.setBrightness(entityfx.getEntityBrightnessForRender(f));
|
||||
+ entityfx.renderParticle(tessellator, f, f1, f5, f2, f3, f4);
|
||||
+ }
|
||||
+ tessellator.draw();
|
||||
+ }
|
||||
}
|
||||
|
||||
public void func_1187_b(Entity entity, float f)
|
||||
@@ -123,6 +165,12 @@
|
||||
{
|
||||
fxLayers[i].clear();
|
||||
}
|
||||
+ for (int x = 0; x < effectList.size(); x++)
|
||||
+ {
|
||||
+ BlockTextureParticles entry = (BlockTextureParticles)effectList.get(x);
|
||||
+ entry.effects.clear();
|
||||
+ }
|
||||
+ effectList.clear();
|
||||
}
|
||||
|
||||
public void addBlockDestroyEffects(int i, int j, int k, int l, int i1)
|
||||
@@ -143,7 +191,11 @@
|
||||
double d1 = (double)j + ((double)l1 + 0.5D) / (double)j1;
|
||||
double d2 = (double)k + ((double)i2 + 0.5D) / (double)j1;
|
||||
int j2 = rand.nextInt(6);
|
||||
- addEffect((new EntityDiggingFX(worldObj, d, d1, d2, d - (double)i - 0.5D, d1 - (double)j - 0.5D, d2 - (double)k - 0.5D, block, j2, i1)).func_4041_a(i, j, k));
|
||||
+ EntityDiggingFX dig_effect = new EntityDiggingFX(worldObj, d, d1, d2,
|
||||
+ d - (double)i - 0.5D, d1 - (double)j - 0.5D,
|
||||
+ d2 - (double)k - 0.5D, block, j2, i1);
|
||||
+ dig_effect.func_4041_a(i, j, k);
|
||||
+ addDigParticleEffect(dig_effect, block);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -185,11 +237,43 @@
|
||||
{
|
||||
d = (double)i + block.maxX + (double)f;
|
||||
}
|
||||
- addEffect((new EntityDiggingFX(worldObj, d, d1, d2, 0.0D, 0.0D, 0.0D, block, l, worldObj.getBlockMetadata(i, j, k))).func_4041_a(i, j, k).multiplyVelocity(0.2F).func_405_d(0.6F));
|
||||
+ EntityDiggingFX dig_effect = new EntityDiggingFX(worldObj, d, d1, d2, 0.0D, 0.0D, 0.0D, block, l, worldObj.getBlockMetadata(i, j, k));
|
||||
+ dig_effect.func_4041_a(i, j, k);
|
||||
+ dig_effect.multiplyVelocity(0.4F);
|
||||
+ dig_effect.func_405_d(0.6F);
|
||||
+ addDigParticleEffect(dig_effect, block);
|
||||
}
|
||||
|
||||
public String getStatistics()
|
||||
{
|
||||
return (new StringBuilder()).append("").append(fxLayers[0].size() + fxLayers[1].size() + fxLayers[2].size()).toString();
|
||||
}
|
||||
+
|
||||
+ public void addDigParticleEffect(EntityDiggingFX dig_effect, Block block)
|
||||
+ {
|
||||
+ boolean added = false;
|
||||
+ String comp = "/terrain.png";
|
||||
+
|
||||
+ if (block instanceof ITextureProvider)
|
||||
+ {
|
||||
+ comp = ((ITextureProvider)block).getTextureFile();
|
||||
+ }
|
||||
+ for (int x = 0; x < effectList.size(); x++)
|
||||
+ {
|
||||
+ BlockTextureParticles entry = (BlockTextureParticles)effectList.get(x);
|
||||
+ if (entry.texture.equals(comp))
|
||||
+ {
|
||||
+ entry.effects.add(dig_effect);
|
||||
+ added = true;
|
||||
+ }
|
||||
+ }
|
||||
+ if (!added)
|
||||
+ {
|
||||
+ BlockTextureParticles entry = new BlockTextureParticles();
|
||||
+ entry.texture = comp;
|
||||
+ entry.effects.add(dig_effect);
|
||||
+ effectList.add(entry);
|
||||
+ }
|
||||
+ addEffect(dig_effect);
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
--- ../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);
|
||||
@@ -0,0 +1,11 @@
|
||||
--- ../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;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
--- ../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);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/EntityLiving.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/EntityLiving.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -835,7 +835,13 @@
|
||||
int i = MathHelper.floor_double(posX);
|
||||
int j = MathHelper.floor_double(boundingBox.minY);
|
||||
int k = MathHelper.floor_double(posZ);
|
||||
- return worldObj.getBlockId(i, j, k) == Block.ladder.blockID;
|
||||
+
|
||||
+ Block block = Block.blocksList[worldObj.getBlockId(i, j, k)];
|
||||
+ if (block == null)
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ return block.isLadder(worldObj, i, j, k);
|
||||
}
|
||||
|
||||
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
|
||||
@@ -0,0 +1,940 @@
|
||||
--- ../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;
|
||||
+ }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/EntityPigZombie.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/EntityPigZombie.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -90,7 +90,7 @@
|
||||
return super.attackEntityFrom(damagesource, i);
|
||||
}
|
||||
|
||||
- private void becomeAngryAt(Entity entity)
|
||||
+ public void becomeAngryAt(Entity entity)
|
||||
{
|
||||
entityToAttack = entity;
|
||||
angerLevel = 400 + rand.nextInt(400);
|
||||
@@ -0,0 +1,145 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/EntityPlayer.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/EntityPlayer.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
import java.util.*;
|
||||
|
||||
+import net.minecraft.src.forge.ArmorProperties;
|
||||
+import net.minecraft.src.forge.ForgeHooks;
|
||||
+import net.minecraft.src.forge.ISpecialArmor;
|
||||
+
|
||||
public abstract class EntityPlayer extends EntityLiving
|
||||
{
|
||||
public InventoryPlayer inventory;
|
||||
@@ -149,6 +153,7 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
+ itemInUse.getItem().onUsingItemTick(itemInUse, this, itemInUseCount);
|
||||
if (itemInUseCount <= 25 && itemInUseCount % 4 == 0)
|
||||
{
|
||||
func_35201_a(itemstack, 5);
|
||||
@@ -490,7 +495,16 @@
|
||||
|
||||
public void dropCurrentItem()
|
||||
{
|
||||
- dropPlayerItemWithRandomChoice(inventory.decrStackSize(inventory.currentItem, 1), false);
|
||||
+ ItemStack stack = inventory.getCurrentItem();
|
||||
+ if (stack == null)
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (stack.getItem().onDroppedByPlayer(stack, this))
|
||||
+ {
|
||||
+ dropPlayerItemWithRandomChoice(inventory.decrStackSize(inventory.currentItem, 1), false);
|
||||
+ }
|
||||
}
|
||||
|
||||
public void dropPlayerItem(ItemStack itemstack)
|
||||
@@ -537,6 +551,9 @@
|
||||
worldObj.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
|
||||
+ /* FORGE: This isnt called anymore
|
||||
+ */
|
||||
+ @Deprecated
|
||||
public float getCurrentPlayerStrVsBlock(Block block)
|
||||
{
|
||||
float f = inventory.getStrVsBlock(block);
|
||||
@@ -565,6 +582,45 @@
|
||||
return f1;
|
||||
}
|
||||
|
||||
+ /* FORGE: Extended to allow metadata.
|
||||
+ */
|
||||
+ public float getCurrentPlayerStrVsBlock(Block block, int md)
|
||||
+ {
|
||||
+ float f = 1.0F;
|
||||
+ ItemStack ist = inventory.getCurrentItem();
|
||||
+ if(ist != null)
|
||||
+ {
|
||||
+ f = ist.getItem().getStrVsBlock(ist, block, md);
|
||||
+ }
|
||||
+
|
||||
+ int i = EnchantmentHelper.getEfficiencyModifier(inventory);
|
||||
+ if (i > 0 && ForgeHooks.canHarvestBlock(block, this, md))
|
||||
+ {
|
||||
+ f += i * i + 1;
|
||||
+ }
|
||||
+
|
||||
+ if(isPotionActive(Potion.digSpeed))
|
||||
+ {
|
||||
+ f *= 1.0F + (float)(getActivePotionEffect(Potion.digSpeed).getAmplifier() + 1) * 0.2F;
|
||||
+ }
|
||||
+
|
||||
+ if(isPotionActive(Potion.digSlowdown))
|
||||
+ {
|
||||
+ f *= 1.0F - (float)(getActivePotionEffect(Potion.digSlowdown).getAmplifier() + 1) * 0.2F;
|
||||
+ }
|
||||
+
|
||||
+ if(isInsideOfMaterial(Material.water) && !EnchantmentHelper.getAquaAffinityModifier(inventory))
|
||||
+ {
|
||||
+ f /= 5F;
|
||||
+ }
|
||||
+
|
||||
+ if(!onGround)
|
||||
+ {
|
||||
+ f /= 5F;
|
||||
+ }
|
||||
+ return f;
|
||||
+ }
|
||||
+
|
||||
public boolean canHarvestBlock(Block block)
|
||||
{
|
||||
return inventory.canHarvestBlock(block);
|
||||
@@ -764,6 +820,27 @@
|
||||
|
||||
protected void damageEntity(DamageSource damagesource, int i)
|
||||
{
|
||||
+ boolean doRegularComputation = true;
|
||||
+ int initialDamage = i;
|
||||
+
|
||||
+ for (ItemStack stack : inventory.armorInventory)
|
||||
+ {
|
||||
+ if (stack != null && stack.getItem() instanceof ISpecialArmor)
|
||||
+ {
|
||||
+ ISpecialArmor armor = (ISpecialArmor) stack.getItem();
|
||||
+
|
||||
+ ArmorProperties props = armor.getProperties(this, initialDamage, i);
|
||||
+ i = i - props.damageRemove;
|
||||
+ doRegularComputation = doRegularComputation && props.allowRegularComputation;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (!doRegularComputation)
|
||||
+ {
|
||||
+ super.damageEntity(damagesource, i);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (!damagesource.isUnblockable() && isBlocking())
|
||||
{
|
||||
i = 1 + i >> 1;
|
||||
@@ -815,7 +892,9 @@
|
||||
|
||||
public void destroyCurrentEquippedItem()
|
||||
{
|
||||
+ ItemStack orig = inventory.getCurrentItem();
|
||||
inventory.setInventorySlotContents(inventory.currentItem, null);
|
||||
+ ForgeHooks.onDestroyCurrentItem(this, orig);
|
||||
}
|
||||
|
||||
public double getYOffset()
|
||||
@@ -947,6 +1026,11 @@
|
||||
|
||||
public EnumStatus sleepInBedAt(int i, int j, int k)
|
||||
{
|
||||
+ EnumStatus customSleep = ForgeHooks.sleepInBedAt(this, i, j, k);
|
||||
+ if (customSleep != null)
|
||||
+ {
|
||||
+ return customSleep;
|
||||
+ }
|
||||
if (!worldObj.isRemote)
|
||||
{
|
||||
if (isPlayerSleeping() || !isEntityAlive())
|
||||
@@ -0,0 +1,48 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/EntityRenderer.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/EntityRenderer.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -4,6 +4,8 @@
|
||||
import java.nio.FloatBuffer;
|
||||
import java.util.Random;
|
||||
import net.minecraft.client.Minecraft;
|
||||
+import net.minecraft.src.forge.ForgeHooksClient;
|
||||
+
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.ContextCapabilities;
|
||||
import org.lwjgl.opengl.Display;
|
||||
@@ -911,8 +913,11 @@
|
||||
EntityPlayer entityplayer = (EntityPlayer)entityliving;
|
||||
GL11.glDisable(3008 /*GL_ALPHA_TEST*/);
|
||||
Profiler.endStartSection("outline");
|
||||
- renderglobal.drawBlockBreaking(entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), f);
|
||||
- renderglobal.drawSelectionBox(entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), f);
|
||||
+ if (!ForgeHooksClient.onBlockHighlight(renderglobal, entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), f))
|
||||
+ {
|
||||
+ renderglobal.drawBlockBreaking(entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), f);
|
||||
+ renderglobal.drawSelectionBox(entityplayer, mc.objectMouseOver, 0, entityplayer.inventory.getCurrentItem(), f);
|
||||
+ }
|
||||
GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
|
||||
}
|
||||
}
|
||||
@@ -967,8 +972,11 @@
|
||||
EntityPlayer entityplayer1 = (EntityPlayer)entityliving;
|
||||
GL11.glDisable(3008 /*GL_ALPHA_TEST*/);
|
||||
Profiler.endStartSection("outline");
|
||||
- renderglobal.drawBlockBreaking(entityplayer1, mc.objectMouseOver, 0, entityplayer1.inventory.getCurrentItem(), f);
|
||||
- renderglobal.drawSelectionBox(entityplayer1, mc.objectMouseOver, 0, entityplayer1.inventory.getCurrentItem(), f);
|
||||
+ if (!ForgeHooksClient.onBlockHighlight(renderglobal, entityplayer1, mc.objectMouseOver, 0, entityplayer1.inventory.getCurrentItem(), f))
|
||||
+ {
|
||||
+ renderglobal.drawBlockBreaking(entityplayer1, mc.objectMouseOver, 0, entityplayer1.inventory.getCurrentItem(), f);
|
||||
+ renderglobal.drawSelectionBox(entityplayer1, mc.objectMouseOver, 0, entityplayer1.inventory.getCurrentItem(), f);
|
||||
+ }
|
||||
GL11.glEnable(3008 /*GL_ALPHA_TEST*/);
|
||||
}
|
||||
Profiler.endStartSection("weather");
|
||||
@@ -986,6 +994,8 @@
|
||||
setupFog(1, f);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
+ Profiler.endStartSection("fhooks");
|
||||
+ ForgeHooksClient.onRenderWorldLast(renderglobal,f);
|
||||
Profiler.endStartSection("hand");
|
||||
if (cameraZoom == 1.0D)
|
||||
{
|
||||
@@ -0,0 +1,27 @@
|
||||
--- ../src_base/minecraft/net/minecraft/src/Explosion.java 0000-00-00 00:00:00.000000000 -0000
|
||||
+++ ../src_work/minecraft/net/minecraft/src/Explosion.java 0000-00-00 00:00:00.000000000 -0000
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.util.*;
|
||||
+import net.minecraft.src.forge.ISpecialResistance;
|
||||
|
||||
public class Explosion
|
||||
{
|
||||
@@ -66,7 +67,15 @@
|
||||
int k3 = worldObj.getBlockId(l2, i3, j3);
|
||||
if (k3 > 0)
|
||||
{
|
||||
- f1 -= (Block.blocksList[k3].getExplosionResistance(exploder) + 0.3F) * f2;
|
||||
+ if (Block.blocksList[k3] instanceof ISpecialResistance)
|
||||
+ {
|
||||
+ ISpecialResistance isr = (ISpecialResistance)Block.blocksList[k3];
|
||||
+ f1 -= (isr.getSpecialExplosionResistance(worldObj, l2, i3, j3, explosionX, explosionY, explosionZ, exploder) + 0.3F) * f2;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ f1 -= (Block.blocksList[k3].getExplosionResistance(exploder) + 0.3F) * f2;
|
||||
+ }
|
||||
}
|
||||
if (f1 > 0.0F)
|
||||
{
|
||||
Loaded 100 of 184 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user