Jump to content

FLUFFY2

Forge Modder
  • Posts

    424
  • Joined

  • Last visited

Everything posted by FLUFFY2

  1. Hey there, So i createda block that has both SOILD and TRANSLUCENT part in it. I set the getBlockLayer() to return TRANSLUCENT and it works, but there is a problem. All renders fine expect i can see that sometimes the block model faces dissapear. I guess thats because i have both soild and translucent part in the texture, but i can only return tranlucent in the getBlockLayer(). Is there a way to check for transparent parts on the block and only set the layer to translucent there? How can i fix this? Thanks!
  2. Okay, mayebe in 1.9 it will break. But it works in 1.8, so why the hell not.
  3. diesieben look, i can tell you how you cant achieve this without my method. ISmartItemModel: 1.BaseModel and Arm model is merged together and renders correctly. 2.You cannot set independent transform. 3.You cannot use player.getLocotionSkin() to bind the player arm skin to the json model. You cannot pull the .png out nowhere. The Arm is actually part of the BaseModel: 1.You still cannot bind the player skin to the arm dynamically. RednerHandEvent: 1.You render the arm moder with a method inside RenderPlayer. 2.You can bind the texture to it. 3.You can set independent transform to it. 4.You CANNOT jam it to the item model. There is too much private method you need to reflect or copy. So its not efficent. My method(IPersPectiveModelAware): 1.You can render the arm with the RenderPlayer method, only in first person. 2.You can bind the player skin to it. 3.You can do independent transform. 4.I didnt notice any FPS drop. So in conclusion, this is the only way to do first person arm rendering now. I tried everything and this is the simplest way. Not only you can render the player first person arm, you can do many more what ISmartItemModel cant or it can but its way over complicated.
  4. Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture); I put this after the custom model renderer and it rebinded the model texture. Problem sloved.
  5. Yeah, i just only need help to rebind the texture to the model, with the TextureAtlasSprite getTexture() method.
  6. I have to use GL, because the system is horribly s*it. If i use a merged model, where i merge it to the base model, i cannot do independent transform, and i cannot use the player.getLocotionSkin on it. If i use RenderHandEvent, all the additional models arent jammed to the player view, and its just too much of a hassle to get all those private fields. And no, itemRenderer.renderItem(), not works coz i want to render something else. This method below works and i dont want to bind the texture to the IBakedModel. The other model isnt an IBakedModel, its the players arm. I made the first kinda working first person arm for 1.8, and this little thing is in the way So if you can help, how can i bind a texture to a certain model only? Like: bindTexture; renderModel; stopBindTexture;
  7. Hello guys, I come up with an idea that i can render additional models within the IPerspectiveModelAware handlePerspective method. It does work, i can render both models, rotate them independetly and such. Just that when i bind the texture to the additional model, it also binds the texture to the JSON model. @Override public Pair<IBakedModel, Matrix4f> handlePerspective(TransformType cameraTransformType) { switch(cameraTransformType){ case FIRST_PERSON: this.customModel(); RenderItem.applyVanillaTransform(BaseModel.getItemCameraTransforms().firstPerson); //Rebind texture with BaseModel.getTexture somehow?? return Pair.of(BaseModel, null); } public void customModel(){ Minecraft mc = Minecraft.getMinecraft(); GlStateManager.pushMatrix(); GlStateManager.rotate(20F, 0F, 1F, 0F); GlStateManager.rotate(-80F, 0F, 0F, 1F); GlStateManager.translate(-0.15F, -0.82F, 0F); GlStateManager.scale(0.9F, 1.3F, 0.9F); //TEXTURE BIND TO CUSTOM MODEL mc.getTextureManager().bindTexture(mc.getMinecraft().thePlayer.getLocationSkin()); //RENDER CUSTOM MODEL(hidden) GlStateManager.popMatrix(); } So how can i bind the texture only to the custom model, or how can i rebind the texture to the json model? Since my model has multiple textures i cannot use bindTexture because only the last texture applies.
  8. Okey i fixed the arm render problem, but there isn't any event for item rendering, is there?
  9. Hi! Can i create really detailed models just like in techne with the new .json or i have to forget it? OR i should wait for the IItemRednerer implementation(if there will be one)? This is the last part of my mod that needs to be updated. Oh also, i did render a player arm in first person with RenderPlayer, but now how can i detect if i'm rendering an item and then render the player arm? Thanks!
  10. Right after i maked this post i checked how BlockPumpkin does it. Thanks anyway!
  11. Hi! So metadata is "kinda" gone in 1.8 what is a problem for me because i used metadata to set my 3D block rotation in my TileEntitySpecialRenderer. It seems like i can still get the metadata from only tile entities, but i cannot set them. Im just used a realy simple method: int rotation = tile.getBlockMetadata(); GL11.glRotatef(rotation * 90, 0.0F, 1.0F, 0.0F); Now, how can i do that with block states or something else? Thanks!
  12. Its not really hard. Look up ItemDoor and BlockDoor. Make an item that extend Item Door and a block that extends BlockDoor. Than change the textures remove the iron door part if you want. All the methods are in ItemDoor and BlockDoor, so you can easily override them if oyu want.
  13. This should help: entityplayer.setPositionAndRotation(posX, posY, posZ, yaw, pitch); Note that you can use entityplayer.posXYZ to stay at the same pos.
  14. For the love of god, why not just simply use java correctly? if(entityplayer.getCurrentEquippedItem() != null && (entityplayer.getCurrentEquippedItem().getItem() == Item.getItemFromBlock(Blocks.log) && entityplayer.getCurrentEquippedItem().getItemDamage() == 2)) Bugzoo i see you are new to this so i just give you a simple advice. Use the vanilla src!
  15. Lol, i sloved this 4 mounts ago by myself, but thanks anyways.
  16. The problem is very simple! You set the ligh level too high. 'return 16' MAX value should be 15!!! So in your case 'return 15'! If the light value is in float the MAX is '1.0F'! Be careful with that!
  17. Hello there, I want to send a packet from the server to the connected client, but i get an error rather than an arrived packet. Not crash, just an error. This is my code: @SubscribeEvent public void PlayerLoggedIn(ServerConnectionFromClientEvent event){ EntityPlayerMP player = ((NetHandlerPlayServer)event.handler).playerEntity; if(player != null) AmnesiaLights.snw.sendTo(new SettingsMessageHandler(), player); } And this is the error when i join to the server: http://pastebin.com/bw80eTnG Thanks for helping me!
  18. I don't recommend using .obj model at all for cables. Even if the .obj model is realy simple, imagine if someone using 100+ cable from your mod. It will be a massive lag! I recommend you using Techne with the .java model. It is much simpler and performance frendly.
  19. Indeed, thats looks like fixed my problem. Thank you guys its working now!
  20. Hi there, I have been modding for 2 years now but this part is unclear to me. I sending a packet from the server to ALL clients and play a custom moving sound there. Now the problem is when i start the server it keeps crashing because ISound is only client side. BUT I SENDING THE F*CKING PACKET TO THE CLIENT!!! Why does the server care about what is in the packet? I mean its ment to be for the client not the server. I want to send the packet from the server and let the client to do all the stuff. If you can please help me! Thanks!
  21. In 1.8 there are more doors added. Mayebe there its changed. I can wait till Forge for 1.8 is out. If it will not be added pls don't waste your time with it.
  22. Oh okey i can understand if you not want to do this PR. Thank you for all.
  23. Hi i saw you closed the PR. I read you will see if you can figure out something. I just want to ask will you continue it any time soon or i can forget the it? Thanks and sorry for bothering you.
  24. I know that the client is know whats in my hand. I just don't uderstand how can i inform other players that i have it in there. I know you said pakets, but you also said not to all player. That confuses me a bit. Can you tell me what steps is bad because i doing the following: Check hotbar on sevrer side -> Send a packet to the client -> Set a boolean to true -> Render. But i will try this aswell: Check hotbar client side -> Send packet to the server than send a return packet to others client and set the boolean -> Render Thanks for helping and for your patience.
  25. Okey, than im probably doing something wrong. I can see the render other cannot. Slot detect: if(!world.isRemote){ if(player.inventory.mainInventory[8] != null && player.inventory.mainInventory[8].getItem() == Amnesia.LanternOn){ if(!props.isQuickEquipped()){ Amnesia.snw.sendTo(new HotbarLanternMessageHandler(true), (EntityPlayerMP)player); props.setQuickEquipped(true); } }else{ if(props.isQuickEquipped()){ Amnesia.snw.sendTo(new HotbarLanternMessageHandler(false), (EntityPlayerMP)player); props.setQuickEquipped(false); } } } Packet handler(only onMessage): @Override public IMessage onMessage(HotbarLanternMessageHandler message, MessageContext ctx) { ExtendedPlayerPropertiesHandler.get(Minecraft.getMinecraft().thePlayer).setHotbarLantern(message.isWorn); return null; } This is the render part: @SubscribeEvent public void render(RenderPlayerEvent.Specials.Pre event){ EntityPlayer player = event.entityPlayer; ExtendedPlayerPropertiesHandler props = ExtendedPlayerPropertiesHandler.get(player); if(props.hotbarLantern()){ GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(lanternOnTexture); GL11.glRotatef(5F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-40F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(165F, 0.0F, 0.0F, 1.0F); GL11.glTranslatef(0.0F, -1.4F, -0.12F); float scale = 0.1F; GL11.glScalef(scale, scale, scale); model.renderAll(); GL11.glPopMatrix(); } } Thanks for helping!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.