
StreakyFox
Members-
Posts
14 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
StreakyFox's Achievements

Tree Puncher (2/8)
1
Reputation
-
[1.6.4] Replacing the entire player inventory with a custome one
StreakyFox replied to StreakyFox's topic in Modder Support
So, where do call that player.openContainer ? made it fully functional -
I would like to replace the entire player inventory with a custom Gui and Container (Slot layout). What should happen: Pressing "E" opens a customized inventory: new GUI texure and new slot and button layout. What works: Pressing "E" opens a customized GUI texture. What does not work: The Slotlayout is still from vanilla, which means: all the interactive Slots and Crafting (2x2) needs to be replaced with my custom Container. How do i do that? I already know how to create an Inventory for a Block and open it with FMLNetworkHandler.openGui(player, Mod.instance, GuiID, world, x, y, z); But that refers only for Blocks and TileEntities, how do i overwrite / register the ContainerPlayer.class with my custom ContainerClass? Additional Info: I replaced the vanilla background texture for the GUI by checking the "GuiOpenEvent" and changing the corresponding GUI to my custome one. See this pic for the issue: The GUI is replaced, but the vanilla slot layout is still there (Hotbar, Crafting Slots, all are still highlighted when hovering over their location)
-
[1.6.4] Rendering details on the playermodel
StreakyFox replied to StreakyFox's topic in Modder Support
Me again: i finally figured out how to render additional extras like backpacks etc on the player BUT i have some texturing problems now The screenshot here shows an example: The green box is a simple textured rectangle that should be rendered on the left shoulder. The red marked little textures thingies are the rendering errors, could someone help me to get rid of these or tell me what is going on? Nevermind, i got everything working fine! Man, that was quiete difficult to figure out! -
[1.6.4] Rendering details on the playermodel
StreakyFox replied to StreakyFox's topic in Modder Support
i tried something like: yOffset = 0.4F*sin(player.prevRotationPitch); GL11.glTranslatef(yOffset, 0F, 1F, 0F); Which did not work as i wanted^^ All this animation thingy seems to confusing to me, is there anyone around here who can can teach me the details of rendering tools and armor around a playermodel and animations? -
How would you get your Blender model in game as a Mob?
StreakyFox replied to Thornack's topic in Modder Support
As i refered to in another thread like this: I stumpled uppon this tutorial here: http://minalien.com/tutorial-advancedmodelloader/ Maybe it can help you out -
[1.6.4] Rendering details on the playermodel
StreakyFox replied to StreakyFox's topic in Modder Support
i managed to get the rotation working for the pitch and yaw but still needs some tweaking since the hat is still fixed on the location above the head, only rotating instead of moving with the head when looking up and down. Any suggestions? -
without any code snippets it is hard to tell what your problem is.
-
your solution is explained here: http://minalien.com/tutorial-advancedmodelloader/
-
[1.6.4]Custom mob not spawning / rendering
StreakyFox replied to StreakyFox's topic in Modder Support
mod is no longer used, read the code above for the updated EntityRegistry -
[1.6.4] Rendering details on the playermodel
StreakyFox replied to StreakyFox's topic in Modder Support
I already use these two: GL11.glTranslatef((float)x, (float)y-0.04F, (float)z); -> translates the box exactly above the playerhead GL11.glRotatef(f1, f2, f3, f4); -> not sure about the rotations in here, my thoughts after some testing: f1 = Angle to rotate; f2 = rotation around X-Axis; f3 = rotation around Y-Axis; f4 = rotation around Z-Axis; GL11.glRotatef(180F-yaw, 0F, 1F, 0F); rotates perfect around horizontal axis when looking left / right. //GL11.glDisable(GL11.GL_TEXTURE_2D); The problem is: i need the angle on which the player looks up/down, but dont know where to get that from. -
I try to modify the player model and give the player a hat when a certain condition is: true. What works: The hat is rendered fine and moves with the player (checked with f5 view / backview). Looking to the left and right (yaw angle) rotate the hat correct. The problem: When looking up/down, the head rotates on the pitch angle, but i don't know how to pitch the corresponding hat too, it just stays right above the player model without rotating with the head up and down. The rotation is done inside a RenderCustomPlayer.class which overwrites the vanilla RenderPlayer.class Corresponding classes: 1. ModelHat (just block for testing purposes) 2. RenderCustomPlayer extends RenderPlayer (checks boolean RenderCustomPlayer.class @SideOnly(Side.CLIENT) public class RenderCustomPlayer extends RenderPlayer { private ModelHat hat; public RenderCustomPlayer() { super(); hat = new ModelHat(); } @Override public void doRender(Entity entity, double x, double y, double z, float yaw, float partialTickTime) { super.doRender(entity, x, y, z, yaw, partialTickTime); //boolean check for testing purposes if(1==1) { this.renderHat((EntityPlayer)entity, x, y, z, yaw, partialTickTime); } } public void renderHat(EntityPlayer player, double x, double y, double z, float yaw, float partialTickTime) { GL11.glPushMatrix(); GL11.glTranslatef((float)x, (float)y-0.04F, (float)z); GL11.glRotatef(180F-yaw, 0F, 1F, 0F); GL11.glScalef(-1.0F, -0.8F, 1.0F); Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("testmod", "textures/npc/Hat.png")); hat.render(player, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0525F); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glPopMatrix(); } } Screenshots: Rendering fine when looking to the left and right (turning with the player head on horizontal axis) Problem here: not rotating on the vertical axis with the player hat Can somebody help me out how to rotate it on the vertical axis too? Thanks in advance StreakyFox
-
[1.6.4]Custom mob not spawning / rendering
StreakyFox replied to StreakyFox's topic in Modder Support
@GotoLink: mod was a constant, i replaced the codeMobEntity: EntityRegistry.registerModEntity(EntityWorm.class, NpcInfo.WORM_NAME, NpcInfo.WORM_ID, mod, 80, 1, true); with globalEntityID (to get a spawner egg in creative tab) : EntityRegistry.registerGlobalEntityID(EntityWorm.class, "Worm", EntityRegistry.findGlobalUniqueEntityId(), 8207116, 11760454); Now i get a spawner Egg registered and a global Entity id. When using the new custom spawner egg ingame the mob spawns and renders fine. When using my custom item it does not, which means there must be a problem with the rightclicking of the ItemWand item in the ItemWand.class. The thing is: the console prints the rightclick is registered, it prints the EntityWorm is created, but it does not print that the renderWorm.class is used. ItemWand.class //RIGHTCLICK @Override public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) { if(!world.isRemote) { EntityWorm worm = new EntityWorm(world); int x = player.serverPosX; int y = player.serverPosY; int z = player.serverPosZ; worm.posX = x; worm.posY = y; worm.posZ = z; world.spawnEntityInWorld((EntityWorm)worm); System.out.println("spawning Worm"); return item; } return item; } -
Hello Modder Community! I am currently learning how to create custom mobs and have the following problem: Update: The spawnegg works, only the spawning on rightclick not! What should happen: On rightclicking with a custom item in the player's hand a new custom mob should spawn at the players location. I have 3 console outputs to track the process: 1) Registering rightclick with custom item -> works and prints ("spawning Worm") 2) Creating a custom EntityWorm -> works and prints ("Creating Worm entity") 3) Rendering the Entity -> not called somehow, nothing printed in console, nothing spawning Console output after two rightclicks with ItemWormEgg: Problem: The rightclick is registered, the Entity is created, but the model is not rendered = nothing visual spawns. The RenderWorm.class should print "Rendering Worm" in console after "Creating Worm Entity", but seems to be never called?? The RenderWorm.class is registered in the RenderingHandler during the main load() of Testmod.class: ClientProxy.init( Class reference: 1. ItemWormEgg 2. ModelWorm 3. RenderWorm 4. EntityWorm 5. Mainmod.class (Testmod) ItemWormEgg public class ItemWormSpawnEgg extends Item { [...] //RIGHTCLICK @Override public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) { if(!world.isRemote) { EntityWorm worm = new EntityWorm(world); int x = player.serverPosX; int y = player.serverPosY; int z = player.serverPosZ; worm.posX = x; worm.posY = y; worm.posZ = z; world.spawnEntityInWorld(worm); System.out.println("spawning Worm"); return item; } return item; } } ModelWorm public class ModelWorm extends ModelBase { //fields ModelRenderer Body; ModelRenderer Shape1; ModelRenderer Shape2; public ModelWorm() { textureWidth = 128; textureHeight = 32; Body = new ModelRenderer(this, 0, 0); Body.addBox(0F, 0F, 0F, 7, 6, 6); Body.setRotationPoint(0F, 18F, 0F); Body.setTextureSize(128, 32); Body.mirror = true; setRotation(Body, 0F, 0F, 0F); Shape1 = new ModelRenderer(this, 27, 0); Shape1.addBox(0F, 0F, 0F, 2, 2, 2); Shape1.setRotationPoint(1F, 16F, 1F); Shape1.setTextureSize(128, 32); Shape1.mirror = true; setRotation(Shape1, 0F, 0F, 0F); Shape2 = new ModelRenderer(this, 36, 0); Shape2.addBox(0F, 0F, 0F, 2, 2, 2); Shape2.setRotationPoint(4F, 16F, 1F); Shape2.setTextureSize(128, 32); Shape2.mirror = true; setRotation(Shape2, 0F, 0F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); Body.render(f5); Shape1.render(f5); Shape2.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); } RenderWorm @SideOnly(Side.CLIENT) public class RenderWorm extends RenderLiving { protected ModelWorm model; public RenderWorm(ModelBase modelBase, float par2) { super(modelBase, par2); System.out.println("Rendering worm..."); } @Override protected ResourceLocation getEntityTexture(Entity par1Entity) { return new ResourceLocation("zkymod:textures/npc/Worm.png"); } } EntityWorm public class EntityWorm extends EntityAnimal { public EntityWorm(World par1World) { super(par1World); this.experienceValue = 10; this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(7, new EntityAILookIdle(this)); this.tasks.addTask(6, new EntityAIWander(this, 0.25D)); this.getNavigator().setAvoidsWater(true); this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(1, new EntityAIPanic(this, 1.25D)); this.setSize(0.9F, 0.9F); System.out.println("Creating Worm Entity"); } public boolean isAIEnabled() { return true; } protected String getLivingSound() { return "mob.zombie.say"; } /** * Returns the sound this mob makes when it is hurt. */ protected String getHurtSound() { return "mob.zombie.hurt"; } /** * Returns the sound this mob makes on death. */ protected String getDeathSound() { return "mob.zombie.death"; } protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(20.0D); } protected int getDropItemId() { return Item.goldNugget.itemID; } @Override public EntityAgeable createChild(EntityAgeable entityageable) { // TODO Auto-generated method stub return null; } @Override public String getEntityName(){ return "Worm"; } Client Proxy public class ClientProxy extends CommonProxy { @Override public void initRenders() { RenderingRegistry.registerEntityRenderingHandler(EntityWorm.class, new RenderWorm(new ModelWorm(), 0.5F)); } } Testmod (MainClass) @Mod(modid = ModInformation.ID, name =ModInformation.NAME, version = ModInformation.VERSION) @NetworkMod(channels = {ModInformation.CHANNEL} , clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class) public class Testmod { @Instance(ModInformation.ID) public static Testmod instance; @SidedProxy(clientSide = "proxies.ClientProxy", serverSide = "proxies.CommonProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { proxy.initRenders(); } @EventHandler public void load(FMLInitializationEvent event) { //Register NPCEntities EntityRegistry.registerModEntity(EntityWorm.class, NpcInfo.WORM_NAME, NpcInfo.WORM_ID, mod, 80, 1, true); EntityRegistry.addSpawn(EntityWorm.class, 2, 0, 1, EnumCreatureType.creature); LanguageRegistry.instance().addStringLocalization("entity."+NpcInfo.WORM_NAME+".name" , "en_US", NpcInfo.WORM_NAME); } } You guys are my last hope, why is nothing spawning? Additional Info: The code compiles without any errors, starting the client, joining the world and rightclicking gives you errors, too, but nothing spawns. Forge Version: [1.6.4] latest recommended, Windows 7 64bit + Eclipse