Everything posted by Spaceboy Ross
- 
	
		
		GUI shows then hides [Solved]
		
		I haven't updated the github but I changed the code from displayGuiScreen to setting currentScreen in the PacketHumantype class.
 - 
	
		
		GUI shows then hides [Solved]
		
		Changing the variable did nothing.
 - 
	
		
		GUI shows then hides [Solved]
		
		https://github.com/SpaceboyRoss01/MSGundam is the correct link.
 - 
	
		
		GUI shows then hides [Solved]
		
		Well, I made it easier so people wouldn't have to go looking through github. https://github.com/SpaceboyRoss01/MSGundamMod is the repository.
 - 
	
		
		GUI shows then hides [Solved]
		
		I've added a GUI to show when the world is created but it only shows for like 2 seconds. Sometimes the GUI doesn't even show at all. I've attached some files that may be the cause. Files: HumantypeGUI.java EHumantypes.java Newtype.java
 - 
	
		
		Custom GUI show when world is created [Solved]
		
		Ok, I got it to work. I figured it out and now I just need to program the UI.
 - 
	
		
		Spawn entity from block [Solved]
		
		Ok, I got it to work. Also, I'll fix the performance later, this mod is for a school computer project class.
 - 
	
		
		Spawn entity from block [Solved]
		
		If I didn't use getIntLE/writeIntLE, then I get an exception and the index value would be set to a negative number. Also buf.getIntLE(this.index) was a typo. Also, I was following the code from https://github.com/McJtyMods/ModTutorials/blob/1.12/src/main/java/mcjty/modtut/network/PacketSendKey.java#L46. The MSRegistry is required for my mod to add the entities that I was trying to spawn from a block. All fields for the PacketMobileSuit are correct. Eclipse doesn't like me and when I tried to use a different method it was giving me errors.
 - 
	
		
		Spawn entity from block [Solved]
		
		Eclipse wouldn't let me not use a reflection. I've attacked my packet class's source code. PacketMobileSuit.java
 - 
	
		
		Spawn entity from block [Solved]
		
		It was the only way for me to get it to work also I have it designed that way so I can easily make more mobile suits using the same class. The entity still doesn't spawn. private void handle(PacketMobileSuit message,MessageContext ctx) { EntityPlayerMP playerEntity = ctx.getServerHandler().player; World world = playerEntity.getEntityWorld(); MobileSuit ms = MSRegistry.getMobileSuitFromIndex(message.index); try { MobileSuit.MSMob mob = ms.MOB.getConstructor(World.class).newInstance(world); mob.posX = message.pos.x+1.0; mob.posY = message.pos.y+1.0; mob.posZ = message.pos.z+1.0; world.spawnEntity(mob); } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException | SecurityException e) { e.printStackTrace(); } }
 - 
	
		
		Spawn entity from block [Solved]
		
		MobileSuit.MSMob mob = ms.MOB.getConstructor(World.class).newInstance(this.mc.world); That is a special thing internally used in my mod, check the github (https://github.com/SpaceboyRoss01/MSGundamMod) to see what it does.
 - 
	
		
		Spawn entity from block [Solved]
		
		I'm trying to spawn an entity from a button being clicked in a gui container. The entity appears for a second then despawns. Does anyone know how to fix this? Code: try { MobileSuit.MSMob mob = ms.MOB.getConstructor(World.class).newInstance(this.mc.world); mob.posX = this.mc.player.posX+1.0; mob.posY = this.mc.player.posY+1.0; mob.posZ = this.mc.player.posZ+1.0; if(!this.mc.world.isRemote) this.mc.world.spawnEntity(mob); } catch(InstantiationException 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(); }
 - 
	
		
		Custom GUI show when world is created [Solved]
		
		@SubscribeEvent public static void hasConnected(PlayerEvent.PlayerLoggedInEvent event) { INewtypeCapability nt = CapabilityUtils.getCapability(event.player,MAX_NEWTYPE_CAPABILITY,DEFAULT_FACING); if(!nt.hasShownHumantypeMenu()) { event.player.openGui(GundamMod.instance,HumantypeGUI.GUI_ID,event.player.getEntityWorld(),event.player.getPosition().getX(),event.player.getPosition().getY(),event.player.getPosition().getZ()); } } This snippet is the code that should open the ui but it doesn't work. Loggin works so that means the function is being called.
 - 
	
		
		Custom GUI show when world is created [Solved]
		
		When every player joins the world for the first time.
 - 
	
		
		Custom GUI show when world is created [Solved]
		
		I'm wanting a GUI to show when the user enters a world for the first time and not when they click "Create New World".
 - 
	
		
		Custom GUI show when world is created [Solved]
		
		Code example please?
 - 
	
		
		Custom GUI show when world is created [Solved]
		
		I'm trying to add a menu that shows when you load a world for the first time, how do I do that in 1.12?
 
IPS spam blocked by CleanTalk.