Jump to content

Bedrock_Miner

Forge Modder
  • Posts

    613
  • Joined

  • Last visited

Everything posted by Bedrock_Miner

  1. Ok, so its not possible to load the chunk just when I need it? It would be useful to force a chunk to be loaded, access the TE and let the chunk being unloaded again. This won't happen too often, so it wouldn't cause much lag either. The advantage is that I dont need to store anything twice or in ttwo different locations. I actually don't want to keep the whole chunk loaded the whole time because there might be lag issues if too much of those TileEntities are around. However, I actually don't know how to use WorldSavedData. I'll google it and check if it is useful. Thanks so far for your answer.
  2. Hello guys! I planned to create a TileEntity which is an energy reservoir which can be accessed from other TileEntities anywhere around the world and cross-dimensional. What I'm wondering about is how I can access the TileEntity when it is located in a chunk that is not loaded. Is this possible? And if: How can I do it. If not: What are good alternatives? I'm looking forward to seeing your ideas. -BM
  3. Hello guys! I just discovered that the method getEntitiesWithinAABB(Class, AxisAlignedBB) never returns an instance of EntityDragonPart. This is pretty annoying because this prohibits me from creating some automated attacking devices. However, for some reason the method getEntitiesWithinAABBExcludingEntity(Entity, AxisAlignedBB) does return instances of EntityDragonPart. But I don't want to use this method, because I don't want to exclude entities, I want to get every one. Is there a way I can avoid this issue? And why does it happen?
  4. Hello everyone! I wanted to create a little Easter-Egg like feature for one of my mods where the background of the gui screens (The one which is normally dirt) is replaced with other textures based on some values of the player. I now encountered the problem that sometimes the texture is not used. Instead, a white surface is shown. This does not depend on the image I want to load. Here's my code: Any Ideas what I might have done wrong?
  5. OK, then I'll try combining the event with the onEntitySwing method.
  6. This sounds good! Thank you. Is there also an event for left click in midair?
  7. This doesn't cancel any block placing/destruction whatsoever. Just the swing animation.
  8. Would be possible if you always play in creative I want to get left clicks instantly and also if you look right up into the air.
  9. Hello guys! I'm looking for a method that's called when the player left-clicks with his Item. I also want to cancel the actions afterwards. It's easy for a right-click. Just overriding the method there. But also there I don't know how to stop Minecraft from doing anything else (like pressing the button I look at). For a left-click I don't even see a method that could do what I want. I only found onEntitySwing() which is called on left-click, but doesn't enable me to cancel block destruction afterwards. Any ideas here?
  10. Yes, this worked! Although I don't really understand why...
  11. OK: Spawn: this.controlledEntity = new EntityMagicBeam(this.getWorld(), this); this.controlledEntity.setMainMagic(MAX_BEAM_LENGTH, ElementUtil.getMainElement(Arrays.asList(this.getMagicData().getElements()))); this.getWorld().spawnEntityInWorld(this.controlledEntity); Every tick after this: this.controlledEntity.setBeamDirection(this.getEntity().getLookVec()); this.controlledEntity.setPosition(this.getEntity().posX, this.getEntity().posY + this.getEntity().getEyeHeight() - 0.25, this.getEntity().posZ); this.getEntity().addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 5)); if (this.callCount >= MAX_BEAM_TIME) this.controlledEntity.setDead(); (this.getEntity() returns the owner here) Entity class itself:
  12. Hello everyone! I want to create a beam consisting out of several entities in a row. But, for some reason I don't understand, the first entity of the row is moved to 0:0:0 after some time, but only on client side! I debugged a bit and found out that a packet of the class S15PacketEntityRelMove is received and moves the entity to 0:0:0. A bit weird is, that after some time the original position is restored, but the entity still isn't rendered. The entity's position is never set to 0 from server side. It is even set to the owner's position every tick (which is not 0:0:0!). Any ideas how this could happen? And how I can fix it? Is it a problem that the entity is inside it's owner?
  13. No, what I need is the exact position of the camera in the world to get a vector to the entity i'm rendering.
  14. What do you mean by this? Not sure how I could use raytracing in this context.
  15. Hello guys! I need to calculate several vectors between the objects rendered and the current center of the rendering screen. Therefore, I need a way to get the position of the cursor (the center of the screen) in world-coordinates, so that I can calculate a vector between them and the rendered entity. Any ideas how to do this?
  16. Well, I got it to work right now myself, but your post lead me in the right direction: It's updated when the value has changed and not if it is changed and then changed back immediately. During the pullback time of the bow I can only change the value on client side, because the pull time would restart otherwise. Thats why nothing changed for the server, only for the clients. I now added a change when the player starts pulling on server and client and now it works.
  17. I worked a bit with the SelectionBlockTextures thingy and was able to use it. Then I decided to make it a bit more generic by providing a Renderer wrapped in a Runnable instead of a block. That's were I obviously messed up, because now I always get a completely black image. I'll post my code here, hopefully anyone can tell me what I did wrong (maybe I miss some transformations before the rendering?)
  18. After a large bit of refactoring, I got the glint effect to work partially. After a bit more research on the glMatrixMode method, I finally understood what the method does and I changed it a bit so that it works in my favor. I have now a pretty useful enchantment renderer. It has some restrictions, but it works fine. Still nothing new about the b3d thing, I think the guys from Forge are the only ones who know how it works. Also, I understood how the SelectionBlockTextures thing works, at least the basics of it. I still don't quite know how to use it in order to render the "gui" state of the block onto a texture and use it afterwards. Best thing would be if I could just create an instance of a class with the block as an argument, it registers automatically as IResourceManagerReloadListener and provides methods to bind the generated texture to OpenGL.
  19. OK, so I experimented and here are my results: 1. The method TGG mentioned is basically a Generator for an IBakedModel, not a renderer for a simple texture solidified, so I decided to write my own method that renders the texture on the fly: With this method the rendering is pretty easy and the results are awesome. 2. I dug a bit in the source code and found an easy method to render an IBakedModel. Unfortunately, is does not work for builtin/entity renderers, but I didn't expect that anyway. BTW, does anyone know why IBakedModel is deprecated? 3. I looked at RenderItem.renderEffect(), but I don't understand what it does. Mostly because the OpenGL constants are there as numbers, not as the constant names. Maybe someone could help me understanding how this works, this would help me a lot. 4. I found an example on Forge's B3D loader, but it didn't work well for me. https://github.com/MinecraftForge/MinecraftForge/blob/master/src/test/java/net/minecraftforge/debug/ModelLoaderRegistryDebug.java I created a B3D model which has an Animation (scaling up/down along the y axis). I applied this model to a block using the method in the example. My model was rendered wrong, namely 0.5 Blocks moved away along every axis and without texture. Also, I discovered that the animation does not work. Any ideas what I could have done wrong? 5. Well, it's a fancy class in this GitHub repo, but I really don't understand how I use it and how this can help me with my problem. I've not thought about 6 a lot, want to solve the others first.
  20. Heyho Guys! I created a Bow Item, which works great generally, except one single problem: I used the NBTTag to store the current pulling state of the bow for the renderer. Everytime the method onUsingTick is called, the value is updated. When the method onPlayerStoppedUsing is called, an arrow is summoned and the nbt data gets resetted. The problem is: When I watch another player pulling the bow and releasing it, I see him pulling the bow as normal. But when he releases it, the texture is not switched back. I figured out that onPlayerStoppedUsing is only called on the Server and on the Client who caused it. Now, I need to know how to notify the other players that the NBT data needs to be resetted. I already tried several things to solve this: The methods here were called on the server side to synchronize the Item but it didn't work. if (stack.hasTagCompound()) stack.getTagCompound().removeTag("$BOWSTATE$"); if (!world.isRemote) ((EntityPlayerMP)player).updateHeldItem(); // ((EntityPlayerMP)player).playerNetServerHandler.sendPacket(new C09PacketHeldItemChange(player.inventory.currentItem)); // ((EntityPlayerMP) player).markPlayerActive(); Actually, the other players do not see the default bow texture unless I unequip and re-equip my bow. Any ideas how to fix this?
  21. Hello Guys! I created a GUI, everything fine. Now I realized that when I show a hovering text, like the Item tooltips, the enchantment effect on enchanted Items is shown over the whole slot, not only over the Item itself. This happens obviously, because a specific GL state was changed. But I don't know which one. I tried to breakpoint everythins, with no effect. Now I want to know if anyone knows which state this could be, and if anyone knows how to print the whole GL state to compare it with the other one. Or, even better: Open the GL state map in eclipse debugging. Any ideas are very much appreciated!
  22. Oh, thanks that you researched that for me! I don't have time to look at it right now, but I will do this the next days. I just wanted to add another thing I might want to do, namely taking several textures, and baking them together dynamically. (Like the tools in Tinker's Construct). So I have a texture for, say a shovel, and another one for a bigger shovel handle and I want to overlay them to be used as one texture. Even better if this works with Alpha as well, so that you can see the texture of a texture even if its overlayed by a halfway transparent one.
×
×
  • Create New...

Important Information

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