mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-22 21:20:12 +00:00
Added MinecraftForge.isClient() function that returns true if you are in the Minecraft Client, (As defined as net.minecraft.client.Minecraft existing) false otherwise.
Fixed a typo on PacketEntitySpawn that caused speed to be assigned improperly. A little code cleanup.
This commit is contained in:
1 parent
96b698dc85
commit
65b3742636
3 files changed
+22
-3
No files matched your search
@@ -121,7 +121,8 @@ public class MinecraftForgeClient
|
||||
public static IItemRenderer getItemRenderer(ItemStack item, ItemRenderType type)
|
||||
{
|
||||
IItemRenderer renderer = customItemRenderers[item.itemID];
|
||||
if (renderer != null && renderer.handleRenderType(item, type)) {
|
||||
if (renderer != null && renderer.handleRenderType(item, type))
|
||||
{
|
||||
return customItemRenderers[item.itemID];
|
||||
}
|
||||
return null;
|
||||
@@ -149,7 +150,7 @@ public class MinecraftForgeClient
|
||||
* If they do not match (such is the case in different versionf of MC) it exits the process with a error
|
||||
*
|
||||
* @param version The version to find, usually "Minecraft Minecraft 1.2.3"
|
||||
* @param message The error message to display int eh crash log
|
||||
* @param message The error message to display in the crash log
|
||||
*/
|
||||
public static void checkMinecraftVersion(String version, String message)
|
||||
{
|
||||
|
||||
@@ -1006,6 +1006,24 @@ public class MinecraftForge
|
||||
ForgeHooks.arrowLooseHandlers.add(handler);
|
||||
}
|
||||
|
||||
private static int isClient = -1;
|
||||
public static boolean isClient()
|
||||
{
|
||||
if (isClient == -1)
|
||||
{
|
||||
try
|
||||
{
|
||||
Class.forName("net.minecraft.client.Minecraft", false, MinecraftForge.class.getClassLoader());
|
||||
isClient = 1;
|
||||
}
|
||||
catch (ClassNotFoundException e)
|
||||
{
|
||||
isClient = 0;
|
||||
}
|
||||
}
|
||||
return isClient == 1;
|
||||
}
|
||||
|
||||
static
|
||||
{
|
||||
addDungeonMob("Skeleton", 1.0f);
|
||||
|
||||
@@ -94,7 +94,7 @@ public class PacketEntitySpawn extends ForgePacket
|
||||
{
|
||||
speedX = data.readShort();
|
||||
speedY = data.readShort();
|
||||
speedX = data.readShort();
|
||||
speedZ = data.readShort();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user