Jump to content

McJty

Members
  • Posts

    129
  • Joined

  • Last visited

Everything posted by McJty

  1. Is there nobody who knows anything about this or can help me find a way to prevent passive mobs from spawning in freshly generated chunks? Thanks
  2. I am struggling with a problem with LivingSpawnEvent.CheckSpawn. It works perfectly fine for hostile mobs but passive mobs that are generated at chunk generation time (i.e. passive sheep, cows and so on) are not going through that even it seems. Even though according to the Minecraft code it should. Here is the code snippet: @SubscribeEvent public void onEntitySpawnEvent(LivingSpawnEvent.CheckSpawn event) { System.out.println("event.entity.toString() = " + event.entity.toString()); } This code works fine for hostile mob spawns. I can see the print in my console but nothing happens for passive mobs. Any clue?
  3. Ok. Thanks to this I got it working:
  4. Thanks a lot. I think I can manage with that :-)
  5. I would like to render a thick beam of light. So essentially this should be a quad that is oriented in such a way that it always faces the camera. But it should start at some point in 3D and end at another point. And it should also be perspective correct. I have this code so far: private void drawLine(Coordinate c1, Coordinate c2, float width) { Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.setColorRGBA(255, 255, 255, 128); tessellator.setBrightness(240); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); // Calculate the start point of the laser float mx1 = c1.getX() + .5f; float my1 = c1.getY() + .5f; float mz1 = c1.getZ() + .5f; Vector start = new Vector(mx1, my1, mz1); // Calculate the end point of the laser float mx2 = c2.getX() + .5f; float my2 = c2.getY() + .5f; float mz2 = c2.getZ() + .5f; Vector end = new Vector(mx2, my2, mz2); // Given the two points above I would like to render a quad that // always faces the camera. i guess I need to use things like // this.renderManager.playerViewY ... Vector p1 = ...; Vector p2 = ...; Vector p3 = ...; Vector p4 = ...; drawQuad(tessellator, p1, p2, p5, p6); drawQuad(tessellator, p2, p1, p6, p5); drawQuad(tessellator, p8, p7, p4, p3); drawQuad(tessellator, p7, p8, p3, p4); tessellator.draw(); } So basically I need something for the '...'. Anyone who can help me with the correct formula to get a correct looking laser beam like that? Thanks!
  6. Yes I thought so too but it isn't. Apparently you also have to handle the damage after crafting. In case of the division sigil it gets damaged to above max damage and the minecraft vanilla code then destroys the container. I added similar code to my crafter to solve this issue.
  7. Hi all, In my RFTools auto crafter there is currently a duplication bug with the auto crafter in case there are container items that are supposed to be consumed. Basically when you craft something that outputs the container item (like a bucket) in addition to the output result my crafter puts back the bucket in the inventory. However it appears that there are crafting recipes that use container items that you are supposed to consume while crafting. One example is when you place an inactivated division sigil in the crafting grid. It gives you iron ingots and then goes away. How can I distinguish or know when a recipe is supposed to throw away the container items of the items in the recipe and when it is supposed to keep them? Thanks!
  8. Actually I found the problem. It is not a mod that is causing the issue. It is a mod that is 'FIXING' the issue. Apparently in my local dev env I have a CoFHlib that patches a bug in Minecraft's mergeItemStack() which apparently doesn't respect the maximum number of items in inventory slots. So in my dev env it was fixed because CoFHlib was fixing it. But apparently in some modpacks there is no CoFHlib or perhaps another version of CoFHlib which does not fix this. So I solved the issue by implementing the fix locally in my mod. Thanks for helping though.
  9. Well reproducing it is easy enough. Exactly like I did in the screenshot. Shift-click on a stack. In my dev environment the stack gets evenly distributed on the slots (like the second screenshot shows). In many modpacks however (like FTB Infinity) the first slot of the container gets one item and the rest of the stack is discared (lost).
  10. Nobody has any idea on this? This bug is hitting several of my containers (every container for which the slot in the container only allows one item but the stack itself can contain multiple items).
  11. Ok, here two screenshots. Before shift-click and after shift-click. Notice how it works fine for me. It doesn't for many people and I don't know why: And here is the code for this particular container: https://github.com/McJty/RFTools/blob/master/src/main/java/com/mcjty/rftools/blocks/screens/ScreenContainer.java
  12. There is an annoying bug in RFTools that I cannot reproduce in my dev env so it is somewhat hard to debug. But basically if people shift-click a stack of items into some of my containers (for which the slots only accept one item) then one item of the stack is inserted and the rest is lost. If I do it in my dev env then the items of the stack are nicely distributed to all available slots of the machine and the remainder goes somewhere in the player inventory. Nothing is lost. I'm at a loss as what I could be doing wrong. My transferStackInSlot implementation can be found here: https://github.com/McJty/RFTools/blob/master/src/main/java/com/mcjty/container/GenericContainer.java Anyone who has any insight into what might be wrong? Thanks!
  13. I solved it thanks to advice on irc. Apparently I need to use Blocks.flowing_java instead of Blocks.java.
  14. Hi, I would like to have a block that emits a sound depending on how close the player is. This sound should be continuous (i.e. a bit like a humming sound). I know how to play a single sound effect but I don't know how to make this loop automatically. Thanks!
  15. Hi, on the server side I'm trying to put down a lava block like this: world.setBlock(x, y, z, Blocks.lava, 0, 3); The 3 should ensure it is propagated to the clients and that a block update happens. Nevertheless, the lava doesn't start flowing. It is simply the single lava source block. It only starts to flow as soon as I put another block next to it. Any ideas what I need to do to get the lava to flow?
  16. Yes. I have now refined the custom recipe so that it only compares certain NBT tags and ignores the rest. Works much better now. Thanks!
  17. There is no crash. It is just not crafting. The recipe simply doesn't work. Anyway, I suspect I know what the problem is. It is possible that my NBT matching algorithm is too specific. It appears that an enchanted pickaxe made with 'x' key works fine while an echanted pickaxe made with an enchnated book and anvil doesn't. So I probably have to change my matching algorithm to only match the NBT keys that I want.
  18. I have had some reports of a custom recipe in my mod not working properly. I cannot reproduce it but I've seen others who can. It is a custom recipe which I created because I needed a recipe that matches only with an efficiency 3 enchanted diamond pickaxe. So I need the recipe to match on specific NBT data. Here is my custom recipe: https://github.com/McJty/RFTools/blob/master/src/main/java/com/mcjty/rftools/crafting/NBTMatchingRecipe.java and here is where I use it: https://github.com/McJty/RFTools/blob/master/src/main/java/com/mcjty/rftools/crafting/ModCrafting.java As it works for me it is a bit hard to debug. Can someone spot a mistake that I may have made here? Maybe there is some kind of mod interaction going on and in that case I'd like to make my recipe more robust. Thanks!
  19. That sounds rather expensive isn't it?
  20. How does that help me? Nothing will fire that event?
  21. Hi all. I need to know when the player gains an item of my mod. Be it by picking it up from the ground, getting it out of a chest or anything else. I need this to register an achievement. I can use ItemPickupEvent to get notified when the player picks up an item from the ground but that doesn't work for picking up from a chest or other inventory. So ideally I would like to have an event that is fired when the player gains an item in his/her inventory. Is there something like that? Thanks!
  22. I have the following code in my container (which is a crafting mechanism): @Override public ItemStack slotClick(int index, int button, int mode, EntityPlayer player) { if (factory.isGhostOutputSlot(index)) { Slot slot = getSlot(index); if (slot.getHasStack()) { ItemStack result = slot.getStack().copy(); getSlot(SLOT_BASE).decrStackSize(1); getSlot(SLOT_CONTROLLER).decrStackSize(1); getSlot(SLOT_TYPE_CONTROLLER).decrStackSize(1); getSlot(SLOT_ENERGY).decrStackSize(1); getSlot(SLOT_MEMORY).decrStackSize(1); getSlot(SLOT_ESSENCE).decrStackSize(1); slot.putStack(null); return result; } else { return null; } } else { return super.slotClick(index, button, mode, player); } } The idea is that certain slots are consumed (this works) and that the crafted item is returned to the user. But apparently it just disappears. How can I make sure that the user can pull out the end result out of this crafter?
  23. I found the issue. I had equals/hashCode defined in my TE superclass which apparently for some reason confused the MC renderer. Removing that (as it was actually not needed) solved everything. Not sure why updating CoFH triggered this however.
  24. I'm wondering if this could be a TESR culling issue. But the blocks to which the TESR belongs are clearly in view.
×
×
  • Create New...

Important Information

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