Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

TheMattyBoy

Forge Modder
  • Content Count

    40
  • Joined

  • Last visited

Everything posted by TheMattyBoy

  1. Oh oops, didn't even notice that... Embarrassing... Right, thanks. Didn't I already sort of do this by doing world.getEntityByID(message.pianoId).getDistanceSqToEntity(p_apply_1_) < 900.0D in the predicate for finding the players? Alright, this is what I was having trouble with. If I tried to register a client packet on both sides the server would crash with a NoClassDefFoundError on whatever client-only class I was trying to access in my onMessage method in my message handler, and no amount of side checking or @SideOnly-ing would fix the error.
  2. I'm trying to create a GUI that can play sounds of type MovingSound (as opposed to a normal PositionedSoundRecords, which is what World#playSound uses) when pressed, not only to the player using the GUI, but to everyone within range. Of course, GUI's are exclusively client sided, so I decided to use SimpleImpl to send a message about the sound to the server, but since I'm using a MovingSound I then have to play it through the SoundHandler in Minecraft (which is a client class) on all receiving clients. I'm kinda new to SimpleImpl and networking in general, but from my limited experience it wou
  3. OK then. Why don't you register it like Minecraft has done it in LootTableList::register(ResourceLocation) (which is a public static method)? That does mean that you have to rename your "loot" folder to "loot_tables", and you probably want to create a sub folder called "chests" where you put your "loot_chest.json" file, but that shouldn't be too big of an issue. I would try doing something like public static ResourceLocation LOOT_CHEST; in your main mod class, then say LOOT_CHEST = LootTableList.register(new ResourceLocation("nm", "chests/loot_chest")); in your pre-initialization e
  4. Try adding .json to your resource location. Not entirely sure if necessary but I know you need for instance .png in resource locations for entity textures
  5. if(world.isRemote) checks if it's on the client, it should be if(!world.isRemote)
  6. So I have a crafting recipe that uses water bottles, which are technically a potion with only an NBT tag to separate them from other potions. Is it possible to check for this NBT tag in the new JSON format for making crafting recipes? If so, what's the syntax? I don't really want players to be able to craft the item with any potion... Here's what my JSON file looks like so far: { "type": "minecraft:crafting_shaped", "pattern": [ "iIw", "Db ", " Bi" ], "key": { "i": { "item": "minecraft:iron_ingot", "data": 0 }, "I": { "item": "minecraft:iron_block",
  7. Welp, I tried, it re-downloaded gradle and everything, but it still failed on ":applySourcePatches"... Think I might just wait for that patch of onArmorTick and hopefully it should be working by then
  8. Oh OK, guess I'll just have to wait then... Thanks for replying What do you mean by "rename the directory"? If I try to physically rename the folder ".gradle", Windows tells me that I must type a file name (maybe because .gradle is an extension and not a file name? Not sure on that one...)
  9. I've made a mod with a bunch of armor items that worked fine, until I tried updating the mod to 1.12. I dug through the code (ctrl + H is my friend) and found that the only place where Item#onArmorTick (a method that should update the armor every tick) gets called is in InventoryPlayer#setPickedItemStack, a method for handling pickblocking (so I could only fly my jetpack for a split second while pickblocking, which is no good), with a message from Forge saying "FORGE: Tick armor on animation ticks". How would I go about doing that (I don't have a separate class for rendering my armors or anyth
  10. What I did was to just put Entity#setSize([width of grown animal] * [a factor that goes from the smallest size* when it's a baby, up to 1 when it's an adult], [height of grown animal] * [the same factor]); in EntityLivingBase#onLivingUpdate. In order to calculate the factor I would need to see your code for handling aging, unless you could figure it out yourself? *By the smallest size I mean say if the smallest version of the animal was 20% the size of the adult one, the "smallest size" would be 0.2, if it was 10% it would be 0.1 etc.
  11. I know, I was just pointing out that it happens and that I need to cancel certain key presses to compensate. Hey, thank you for bringing this to my attention! The KeyBinding class was just what I needed (even though I settled for a slightly different method in the end). I do believe my problems are solved now, thank you to all of you for your help! I really appreciate it! (For those wondering, this is what I settled on): entity.setVelocity(0, 0, 0); if(entity.posX != entity.prevPosX || entity.posY != entity.prevPosY || entity.posZ != entity.prevPosZ) { e
  12. Okay, I sort of solved it by doing this: entity.setVelocity(0, 0, 0); if(entity.posX != entity.prevPosX || entity.posY != entity.prevPosY || entity.posZ != entity.prevPosZ) { entity.setPositionAndUpdate(entity.prevPosX, entity.prevPosY, entity.prevPosZ); } but when you try to move, it starts jittering (seen as I'm teleporting the player every tick). Is there a way to cancel keyboard input from only the buttons [W], [A], [D], [SPACE] and [SHIFT]? I seem to remember there was an event for handling keyboard input, but I can't seem to find one.
  13. Well, there are a few reasons. First of all we have the annoying FOV change (I know I could probably fix this with an event). Slowness doesn't affect knockback, so you could just punch out the mobs (again, should be an easy fix but still). Also, I know it might sound dumb but I'd prefer it if you didn't have the slowness icon in the inventory. But the main reason is that slowness doesn't affect all mobs, such as bats, squid and flying players, and it doesn't block vertical movement, so it's easy to just jump out. If I were to use slowness together with constantly setting only motionY to 0, the
  14. Two things: first, I actually do want skeletons to shoot arrows and creepers to explode and what not. I don't want to freeze time, I merely want to freeze mobs in place so that they can't move/fly. Second, the player is an issue... If I allow the event on the client side, all mobs including the player start jittering like mad when stuck in the ice, and if I limit the event to server side only, it works fine for other mobs but the player doesn't get affected. Edit: It also brings a whole lot of other problems, such as, as you said, they don't take damage unless you do so
  15. So I'm creating an "ice" block of sorts that is supposed to freeze any entities that are inside of it's collision box in place (don't worry about how they would ever get in there, I've already got that covered). By "freeze them in place", I mean that their motion X, Y and Z should all be a constant 0 until the ice block breaks. By simply calling Entity#setVelocity in Block#onEntityCollidedWithBlock in my block class and setting each value to 0, it for whatever reason only makes the entities slightly slower. When using the aforementioned technique in conjunction with calling LivingEvent#LivingU
  16. I know I could, but I'm thinking that I might make a super class for this model and a few others that share similar properties, and by doing this I can easily move the method to that class and insert another parameter to let you find and scale any box you like in the model, if I decide to make the super class that is. Always good to keep the possibility open. That's the thing: I don't know how. What you would normally do to scale a part of a model is push a glMatrix around where you render it and scale it with GL11, but since I'm not rendering the box since the parent box does the rende
  17. I'm sorry, but it's been two days since my last post and I would really appreciate some help...
  18. Try isFullCube instead of isFullBlock . Not 100% sure but I think that's what causing it
  19. But can it be done without rendering it? As I said, it's a child model (a child of a child of a child to be exact), and child models shouldn't be rendered like normal. Instead, they are added to the parent through ModelRenderer#addChild in the constructor of the ModelRenderer class, and only the parent (in this case parent of the parent of the parent) is rendered like normal through ModelRenderer#render . Here's my code for reference: package themattyboy.mesozoicraft.entity.model; import javax.annotation.Nullable; import net.minecraft.client.model.ModelBase; import net.minecr
  20. So I have this model which only calls the ModelRenderer#render function once, because all other boxes are child models or child models of child models etc. of that ModelRenderer . Problem is, I want to scale one of these child models (called 'head') and all of it's child models based on conditions, but I'm not sure how I should go about doing that. I have made this method that successfully for 's itself through all child models and their children to find the box I'm looking for: @Nullable private ModelRenderer scaleHead(ModelRenderer currentBox, EntityVelociraptor raptor) { f
  21. Actually, that method doesn't exist in 1.10.2 (which is the version he's using according to the title), but it does exist in 1.11.2.
  22. Because I want my mobs to have their own separate mob cap, independent of other mobs types.
  23. So... There's nothing I can do about it? Oh well, thanks anyway
  24. I want to create my own EnumCreatureType , and I came across this post from 1.7.10 saying that it didn't work in 1.7.2. But surely that must be fixed by now, right? RIGHT?? If it is, how do I use it? At the moment, this is what I'm doing: public static final EnumCreatureType PREHISTORIC = EnumHelper.addCreatureType("Prehistoric", EntityPrehistoric.class, 12, Material.AIR, true, true); and then I use it in EntityRegistry$addSpawn , but when I do this, anytime I try to run the game it crashes, giving me a java.lang.UnsupportedOperationException . What am I doing wrong? And
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.