Damian_RastMan
Members-
Posts
10 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
Damian_RastMan's Achievements
Tree Puncher (2/8)
0
Reputation
-
It's couldron server with newest build.. I reported this issue there, but my thread got closed. So now I'm here. There is console output: http://pastebin.com/Tx9sty2V There is what's going on in server's console while this player is trying to join: [23:38:23 INFO]: UUID of player Cass is 54854d47-def8-34f2-b35d-cdc58a56d147 [23:38:53 INFO]: Cass lost connection: Timed out
-
Cast custom entity class object into EntityLivingBase
Damian_RastMan replied to Damian_RastMan's topic in Modder Support
So names like Pig/Zombie/Skeleton/MoCreatures.Whatever doesn't exists? Even if they didnt return null minute ago? -
Cast custom entity class object into EntityLivingBase
Damian_RastMan replied to Damian_RastMan's topic in Modder Support
It's me again. I have an issue with createEntityByName method.. sometimes it returns null. Maybe it's because of specified time or world? Is there any way to force creating entity using this method? -
Cast custom entity class object into EntityLivingBase
Damian_RastMan replied to Damian_RastMan's topic in Modder Support
Thank you Solved. -
Cast custom entity class object into EntityLivingBase
Damian_RastMan replied to Damian_RastMan's topic in Modder Support
How can i cast Entity into EntityLivingBase? EntityLivingBase living = (EntityLivingBase) EntityList.createEntityByName(args[1], player.getEntityWorld()); throws nullPointerException for args[1] = zombie, skeleton etc. -
Cast custom entity class object into EntityLivingBase
Damian_RastMan replied to Damian_RastMan's topic in Modder Support
What about modded entites? It's the biggest feature of Morph that it supports most modifications entities.. So, can I use your method with entites added with mods, like this: drzhark.mocreatures.entity.passive.MoCEntityBird -
Cast custom entity class object into EntityLivingBase
Damian_RastMan replied to Damian_RastMan's topic in Modder Support
So I'm making a improvement to Morph modification. I added command which takes entity class as an argument and use it to invoke morphPlayer method.. but i need to give EntityLivingBase as argument there.. That's extended version of my code i have at the moment: public void processCommand(ICommandSender sender, String[] args) { if(args[0].equalsIgnoreCase("morph")) { EntityPlayerMP player; if(args.length > 2) { player = PlayerSelector.matchOnePlayer(sender, args[2]); } else { player = getCommandSenderAsPlayer(sender); } Object o = null; EntityLivingBase living = null; try { o = Class.forName(args[1]).getConstructor(); living = (EntityLivingBase) o; Class<?> EH = Class.forName("morph.common.core.EntityHelper"); Method method = EH.getMethod("morphPlayer", EntityPlayerMP.class, EntityLivingBase.class, boolean.class); method.invoke(null, player, living, true); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (SecurityException e) { e.printStackTrace(); } } } So now I'm getting here o = Class.forName(args[1]).getConstructor(); -
Cast custom entity class object into EntityLivingBase
Damian_RastMan replied to Damian_RastMan's topic in Modder Support
I'm trying to create EntityLivingBase variable while i only have it's class path string. Could you please explain me with some code how to do this? -
Hi. I want to cast (or convert) object with path given as string into EntityLivingBase variable. I'm newbie with modding, so please could you help me? I have tried this: Object o = Class.forName("net.minecraft.entity.monster.EntitySkeleton"); EntityLivingBase living = (EntityLivingBase) o; but it cant be just casted..