Skip to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

V0idWa1k3r

Members
  • Joined

  • Last visited

Everything posted by V0idWa1k3r

  1. Why would you ever want your block to switch it's tile entity? Tile entity is just a way to store and process data. What exactly are you trying to achieve?
  2. JSON models with sizes that are bigger than 1 cube (16x16x16) already behave strange enough with incorrect UVs and bounding box issues. Solution: use custom IBakedModel(s)/make your block consist of multiple 1x1x1 'parts' Here is a good example of the 'weirdness' I am talking about.
  3. Pretty sure that your mcmod.info needs to have a modid property defined.
  4. And... congratulations! You are the third person in a row who forgot about applying correct translations before rendering! With correct translations applied I get the following from your code: Also if you want your block to be transparent you need to setup GL's blend too, not only alpha
  5. So, read or write? That... is a very specific way to check booleans. Very... strict. Also you should not even need this unless you are explicitly reading entity nbt on the client. I do not think that readEntityFromNBT is ever called on the client. Erm... why? Why are you setting your variables and then redundantly calling getters? They do not do anything on their own... Maybe you ment to invoke your setters? You should use breakpoints to confirm this, not printlns which can get lost in the console. Breakpoints are the way to debug your code, trust me
  6. You are comparing objects by reference (==) instead of by contents (ItemStack::areItemStacksEqual).
  7. Best "open-source"-ish mod to learn the basics of things? Minecraft. Seriously, a lot of things people ask about can be found here and there in Vanilla. Best open-source mod to learn about conventional coding? Forge. Best open-source mod to learn about how to do some specific things? Your brain and a bit of logic. Best open-source mod to learn something really specific from? Well, depends on the specifics. Most mods nowdays are open-sourced, as there is literally no reason to hide your source code. Every mod does things it's own way though. Want something simple? Pick a simple mod then, Any advanced mod will have several layers of abstractions and by your definition will be 'non learner friendly'. Also I do not think that any mod but the forge example mod is intended to be 'learner-friendly'. Mods are usually designed to work, not to teach people how to code
  8. The way I see it implemented usually is either using the ParticleManager.addParticle while checking for user settings for particles(although the last step is mostly ignored) or with custom from-the-ground-up built particle systems. Obfuscated names should be in your %username%/.gradle/caches/minecraft/de/oceanlabs/mcp/whateveryouareusing... or MCPBot
  9. Well, technically there is absolutely nothing stopping you from using reflections on that map field to check if the given key has any value associated with it if you are so insistent on using the ParticleManager...
  10. The error message is pretty self-explanatory. Set<Biome> is not a Biome array and can't be cast to one. BiomeDictionary::getBiomes returns a Set<Biome> and you need a Biome[]. As for your first issue you should look here:
  11. Yes, you are right, I misunderstood the question a little bit
  12. You will need to use one of forge's render events, like RenderWorldLastEvent. You can get the block the player is looking at with the World::rayTraceBlocks method. I believe it's HitResult returns you the BlockPos of the block the player is looking at with EnumFacing of the side the player is looking at. Your rendering position would then be the raytraceresult position offset by that facing. To render a blockstate in the world you can look at RenderFallingBlock class. There might be some issues with transparency but in theory you can just enable blend with appropriate source and destination factors and either use gl's color method or manually override vertex color data in the vertexbuffer you are rendering your block with using VertexBuffer::putColor. Just do not forget to properly offset your rendering, or you will be the third person in a row with the rendered object 'following' the player/not rendering
  13. Define 'extract'. If you mean get the ItemStack for the recipe manager you would get your slot with the method I have mentioned above and call Slot::getStack(). If you want to remove the item from the slot you can use Container::putStackInSlot(int slotID, ItemStack toPut)
  14. You can't. There is no model or a blockstate file for a chest, because Mojang hardcoded the rendering of the chest into the game's code. See TileEntityItemStackRenderer::renderByItem. It literally checks if the block if the itemstack being rendered is a chest and renders it as a tile entity if it is
  15. You can create your own model that would seem just like a chest. I mean, a chest model isn't that complicated, it is a 14x14x14 cube with a 1x2x1 lock . There is a way to bind TileEntitySpecialRenderers to Item+meta pairs(ForgeHooksClient::registerTESRItemStack) but it is marked as deprecated and is commented as 'Will be removed as soon as possible', so I wouldn't use it.
  16. Problem №1. Chests don't have a normal inventory model. Their rendering is built-in. Problem №2. You need to register your TileEntity with GameRegistry::registerTileEntity
  17. You mean when in third person view? Just check that the entity you are drawing the box around isn't the client player. Define 'teleporting around'. It is already translated using partial ticks so it should move smooth with the entity it is drawn around. If that entity is being teleported then the box is obviously going to follow the entity.
  18. Pretty much something like that, yea. The particular implementation is up to you
  19. I don't think you have fixed it as it is still clearly following the player with some of it's vertices. You should really use the RenderLivingEvent to not suffer with translations that much as it already has everything figured, you would just use the X/Y/Z it provides. VertexFormat is a way to tell OpenGL what data do your vertices carry. Like position. Or color. Or texture coordinates. When you start drawing with Tessellator's VertexBuffer you specify the format - the way vertices are packed. You should then follow that format when declaring your vertices. If your format is POSITION_TEX which is basically position followed by texture coordinates your vertices should include both (pos(xyz).tex(uv)). If you are not planning to use texture coordinates don't use the format which includes them. There is a POSITION format which only requires position. Or POSITION_COLOR.
  20. Yes, you need to specify your AABB correctly. With appropriate XYZ coordinates. Something like (posX - 0.5, posY, posZ - 0.5, posX + 0.5, posY + offsetY, posZ + 0.5) Your vertexformat is position + texture coordinates yet you are only providing the position to your vertex. Why does your format even include texture coordinates if you are disabling the texture units with OpenGL in the first place? Also you do not need to call draw every n vertices. You can upload all your vertices first and then call the draw method.
  21. Ehh.. What? It is fired each frame, as any other render event. I don't really get the 'player can be assigned later' bit too. Assigned to what? RenderLivingEvent only fires for entities which are, well, drawn on screen. The entity object you get in that event can't be null. And as far as I am aware MC will not render players on the client (and thus will not call the event) untill the full data but the skin has been recieved for that player. And if you really need it you can even wait for the skin to be recieved with a simple if check... I do not see the startDrawingESPs method, but I assume it simply renders the AABB you've provided. You are not offsetting enough. Say your entity is at 20 10 10. And the player is at -20 10 10. Right now you are translating the tessellator to 0 0 0... and rendering the box there. You know, at 0, yourEntityOffsetY, 0. Why are you not applying the X and Z entity coordintes to your aabb? Also your minY and maxY coordinates are the same for your aabb. Unless you are handling that differently in your render function that will not work.
  22. There are 2 sub-events of the RenderLivingEvent - Pre and Post. I think you can figure out when they are fired by their names. And if you want your outline to be drawn over an entity you need to disable GL depth. A 'glowing effect'? Could you explain with a bit more details what are you trying to achieve? If you want the outline to be bright you need to pass appropriate lightmap coordinates to tessellator's vertexbuffer
  23. There is a ClientChatEvent in forge that allows you to process messages the player is sending to the chat. If you cancel the event the message will not be printed to the chat. That event is client-side only. There is also a ServerChatEvent that does the same but on a server. If that is canceled the message will not display for other players, but only for the player who typed the message, I think.
  24. Just store all your knowledges in a list/set/map in your capability.
  25. You need a dev version of the mod. Also 1.7.10 is not supported on this forum.

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.