Jump to content

stepsword

Members
  • Posts

    81
  • Joined

  • Last visited

Everything posted by stepsword

  1. Is there a way to do this from IntelliJ? I have a specific thing that needs a player and not just an entity and I want to make sure it works. My computer can probably handle two minecraft instances - is there a way to start a second one in IntelliJ?
  2. Yea - I'm trying to get rid of that for teleports, unless that's impossible
  3. Hi, I'm trying to teleport an Entity about 5-6 blocks. The teleport works as it "should", and the entity does end up in its destination, but I was wondering if there was a way to not render the "in-between" phase. Currently, even I think with Endermen, the teleport shows the entity moving, very quickly, from point A to point B. For a short distance like 5 or 6 blocks, it makes it almost look like the entity is just running really fast. Is there a way to not render this in-between? I.e. just disappear the entity and have them reappear at point B? Edit: setPositionAndUpdate() sets lastTickPosX,Y,Z to the new posX,Y,Z, which is the thing used in the render code to render it partially.. yet it still does not skip the in-between rendering. Not sure where this in-between rendering is coming from.
  4. Nevermind! Figured it out. Actually the texture wrapping was intuitive once I thought about it as actually "wrapping" my texture around the shape, and my shape had a mixed up sin/cos which made the texture messed up.
  5. Hi, I'm making use of the GL_QUAD_STRIP rendering option to render a custom shape. The OpenGL stuff I've read says to add two vertices at a time and the shape actually came out looking correct - but I can't figure out how to properly map the texture with the tesselators .tex(u,v) function. The most I've ever done with mapping the textures is putting them in a square with u,v looking like (0,0),(0,1)(1,1),(1,0). How do I replicate this when only adding two vertices at a time?
  6. Nevermind I think I found it public void startExecuting() in EntityAIWander
  7. How do mobs decide what path its going to take? Like creepers or cows or skeletons? I saw various AI things in EntityCreeper's "initEntityAI()" but not the actual "go from A to B" code. Is there a spot where this is calculated?
  8. Perfect! Thank you.
  9. anyone know where the sky color is set for weather effects like when it rains? I wanted to look at the code Minecraft uses to change the sky color
  10. I'm trying to let the player control an invisible dummy entity (from first person, i.e. just a camera). I'm using setRenderViewEntity() to set it, and intercepting MovementInput to move it. The only problem I'm having, aside from some choppy movement issues, is that I can't seem to get the camera to rotate properly. I can't seem to find an event that handles mouse movement (as opposed to mouse button presses).. I've tried copying the players rotationYaw / rotationPitch, but after I've done setRenderViewEntity(), they seem to stay static. Any ideas? Or if anyone knows where mouse movement is processed into rotationYaw/rotationPitch for the player so I can look at the code for it and see if its doable to copy it somewhere?
  11. I found Chunk Load and Chunk Save, but is there a specifically Chunk unload event? As in, do chunks ever save without unloading? EDIT: I just realized there's both a ChunkDataEvent and a ChunkEvent, and ChunkEvent has the Load/Unload while ChunkDataEvent has Load/Save.. trying to figure out the difference to see which to use
  12. @Animefan8888 Thanks - actually this works better for me without the flag on the player, spawning on a chunk load event is just what I was looking for and it works great.
  13. So basically I'm trying to spawn like 100 (or so) custom entities near the player when a player switches to a custom dimension. I've tried spawning them after my teleporter code and also in onPlayerAdded() in the WorldProvider. Only about 5 of the 100 actually show up. I tested the method for a player teleporting within the dimension, and it spawned the 100 entities, so I'm fairly confident the spawning thing works, but can't seem to get it working when the player comes to the dimension from another world. I've tried doing it both on the client and server, as well as just the server. Is there a way to wait til after the dimension loads and/or after the chunk loads before spawning them?
  14. Ok thanks! that makes sense, wanted to make sure
  15. When I call getPlayerList().getPlayerByUUID and the UUID represents someone who is offline, what happens? Does it throw an error? My IDE says it can never be null, so does it just give you the player even if they're offline? How do I check if the returned player is still logged in?
  16. @diesieben07 Thanks. Do you know if I can do more complicated overrides than just making new JSON models? i.e. if I wanted a programmatic effect like the vanilla enhancement effect? I have some experience with IModel but I'm not sure how that works for overriding a vanilla IModel, if it's even possible. Also is there a way to make JSON models use a boolean NBT value (or any other NBT value for that matter)?
  17. I wanted to add a glowing effect or something like that to certain vanilla items based on their NBT. I don't really have something specific in mind, so it could be some background effect or particles or something that looks like the enchantment glow. Is there a way to intercept the texture at runtime? My backup is to just add an item tooltip to differentiate it since there's an event for that but I would like it to be more obvious if possible.
  18. If anyone cares, I think I will go the route of checking harvest levels in the BlockBreak event and then spawn the drops from getDrops() myself, if the harvest would have been unsucessful. A little hack-y but it does the job I guess
  19. So the HarvestCheck event isn't called for tools. Neither is HarvestDropsEvent, if the harvest is unsuccessful. Are there any events which are fired by tools? I want to make a single wooden pickaxe able to harvest Diamond, for example, based on the pickaxe's NBT, without modifying every wooden pickaxe in the game.
  20. Nevermind, I just didn't look hard enough. It seems like ModelDynBucket does this somewhat so I'm going to try to copy it
  21. So in the bake() method of IModel, I have some textures but I would like to translate/rotate just one of them. Is there a way to do this? The examples I've found use a call like this for an ItemLayerModel, which just layers the textures on top of each other. Is there a way to move one of the textures around? I'm including a vanilla texture in there which is why it'd be helpful if I could translate/rotate the texture. IBakedModel model = (new ItemLayerModel(textures)).bake(state, format, bakedTextureGetter);
  22. I'm trying to merge two (potentially vanilla) textures at runtime based on the NBT of an item and have it display as the icon and in the player's hands. Surprisingly I have a decent idea from one of my other items on how to get vanilla textures so I don't think I need help with that part. But the IModel is a bit confusing. Where is the appropriate place to merge the textures? Based on other mods' uses of bake() in IModel, it seems like that method is primarily for switching out textures. Is the right place to do the merging in ItemOverrideList.handleItemState()? I was planning to cache these textures and pass the location into bake(). Is there a better place to do the merging?
  23. I found Render.renderShadowSingle, which I guess is how Minecraft does it.. I think I may just pass, this doesn't seem worth the time to understand & adapt for my own block
  24. Hi, Does anyone have any resources or any guidance/examples on how to render shadows with Tesselators/BufferBuilders/GlStateManager in the same way that Minecraft normally renders it? Blocks underneath are a bit darker, with a gradient I think based on the sun. The sides are also darker with a gradient on the sides not facing the sun. Is there a way to easily do this with the TESR? I don't want to be getting the time of day and doing complicated shadow calculations every render tick so I was curious if there was a "turnOnNormalShadows" type option somewhere. I used GL11.glDisable(GL11.GL_LIGHTING) because the shadows rendered there would turn off and on randomly depending on how close to the block the player was (and sometimes what direction the player was looking at. Any ideas?
  25. Thanks, @diesieben07. I did see that part of the code, namely this: if (amount > 0.0F && this.canBlockDamageSource(source)) { this.damageShield(amount); amount = 0.0F; if (!source.isProjectile()) { Entity entity = source.getImmediateSource(); if (entity instanceof EntityLivingBase) { this.blockUsingShield((EntityLivingBase)entity); } } flag = true; } But blockUsingShield doesn't actually redirect the arrow - it only calls .knockback() if the damage source is a living entity. It may be obvious from my above posts but I was trying to reflect arrows off a block, so I wanted to see how shields coded the "bounce" part (and for some reason I cannot find the code for that animation anywhere), and then I could manually do the NSEWUD check. But anyway I ended up finding the problem that was preventing bounces - ArrowEntity sets a private variable "inGround" which as far as I can tell can't be modified by any setter methods, and it seems to prevents the arrow from moving once it's buried in a block. Ended up using ObfuscationReflectionHelper to change it - I don't really like that "solution" since it seems hacky, but I'll keep it til I find something better if it exists.
×
×
  • Create New...

Important Information

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