Jump 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.

Cadiboo

Members
  • Joined

  • Last visited

Posts posted by Cadiboo

  1. JSON is just a glorified text file. If your using Eclipse you can install a JSON plugin or you can install some other text editor. I suggest Sublime Text as it has amazing text highlighting and even some syntax highlighting. It’s very intuitive and built for programmers and I’ve never had a single issue with it. 

  2. Don’t use IHasModel (or something similar I.e. ItemModelProvider). Nothing to do with model registration requires private/protected access. You can register all your models in 3 lines of code. Also don’t implement it on a Block. Also interface names should start with “I”.

     

    Did you try looking at the vanilla hay blockstate?

  3. Trigger it from you entities AI task

    2 hours ago, jabelar said:

    If you look at the EntityAIAttackMelee class you can see what I mean. In that class, in the update() method the entity will try to close the distance to the target and then it runs the checkAndPerformAttack() method. In that method, if the distance is close enough it will perform the attack which includes the vanilla swingArm() method for the animation which updates the progress of the animation and also sends a packet to the client tracking system.

    Do your attack logic on the server, then call swingArm (or your own similar method) to fire the animation

  4. ·

    Edited by Cadiboo

    1 hour ago, V0idWa1k3r said:

    go around this method and use events to render an IBakedModel

    Thats what I was suggesting

    1 hour ago, V0idWa1k3r said:

    you will have a nightmare trying to animate parts of it (you can't split the model into parts because the item needs to be a single model obviously and armor parts are rotated differently).

    The jetpack model doesn't have any moving parts, just 2 variants.

    Point taken though

  5. ·

    Edited by Cadiboo

    2 hours ago, V0idWa1k3r said:

    It can't work just fine because it's syntax is invalid. Stone has subtypes and uses metadata to differentiate between variants and as such a data property must be specified in the ingredient. You are not specifying one.

    https://minecraft.gamepedia.com/Recipe#JSON_format

    you need to add

    "data": metadata

    underneath

    "item": "minecraft:stone"

    and make sure your JSON is valid (add a , after minecraft:stone")

  6. Define when they spawn. Every time they respawn? Every time they join the world? The first time they ever join the world? If it is the latter, make a capability that stores if the player has already gotten the item and subscribe to the onEntityJoinWorld event. In that event give the player the item and set the capability storing if they’ve gotten the item to true

  7. if(event.getState().getBlock() == Blocks.SAND.getStateFromMeta(1)) {

    Block != IBlockState. ever

    30 minutes ago, Trhod177 said:

    event.getDrops().remove(1);

    How do you know there are 2 items in the list. how do you even know that the list isnt empty?

     

    31 minutes ago, Trhod177 said:

    @Mod.EventBusSubscriber

    Static subscriber annotation but 

     

    32 minutes ago, Trhod177 said:

    @SubscribeEvent public void onHarvestBlock(BlockEvent.HarvestDropsEvent event)

    non-static subscriber methods?? why??

  8. 13 hours ago, Animefan8888 said:

    When your mod is compiled it doesnt just stay as extends Item or new ItemStack it is translated into the obfuscated names. Which is why using an IDEs built in compiler doesnt work, you have to use gradle.

    Actually you may have a point, I think (I could be wrong) that 1.13 Forge is not going to do runtime deobfuscation so no more SRG names?

  9. I don't think you can easily change the color of a baked quad. The color for rendering quads is gotten by calling Minecraft.getMinecraft().getItemColors().colorMultiplier(stack, bakedquad.getTintIndex()); (colorMultiplier has been renamed to getColorFromItemstack) in RenderItem.func_191970_a (func_191970_a has been renamed to renderQuads). The only way that I can think of to recolour quads would be to modify this method or modify ItemColors to return a different color somehow.

    You can however really easily render baked quads with a different color as I showed in my previous post.

  10. ·

    Edited by Cadiboo

    The colour is a special integer. Try doing

    primeList = colorQuads(primeList, -0x445B75 | 0x1000000);

    I'm pretty sure you construct the colour integer something like this

    int colour = -(invertedRGBInteger) | 0x1000000

    where invertedRGBInteger is a normal RGB colour integer except the colour scale is inverted (0x000000 is white not black). I think this is right, I’m going off my memory and this code that I wrote a while ago. I’ll go do some testing and post a more helpful answer

     

    Edit: I have no clue how the you use the color, I'm going to work backwards from ForgeHooksClient.putQuadColor which appears to be where the magic happens

     

    Edit: I'm stupid, the color includes alpha (the alpha value is either transparent or solid, no in-between)

    int colorRGBA = 0;

    colorRGBA |= 0x00 << 16;// r

    colorRGBA |= 0xFF << 8; // g

    colorRGBA |= 0x00 << 0; // b

    colorRGBA |= 0xFF << 24;// a

    renderQuadsColor(bufferbuilder, quads, colorRGBA);

  11. 1 hour ago, falaRonaldo said:

    Let me get this straight. if I have an electric oven, it has 100 energy in it, if I take it off the ground and with metadata I could leave it saved on the item that it has 100 energy stored and at the time I put it on the floor I get the metadata of the item and see how much energy it has to put into the machine? would this be an example of a use for metadata?

    Metadata has a maximum of 16 possible values. 100 > 16 so you can’t use metadata. Also I assume your machine will have horizontal facing (this uses up 4 values). You can use a tile entity for saving energy (saved in the world with NBT) and when you break it store the energy it the itemstacks nbt or attach an energy capability to it

Important Information

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

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.