Jump to content

Recommended Posts

Posted

Ok, now i found this:

    @Override
    public ItemStack getPickBlock(BlockState state, RayTraceResult target, IBlockReader world, BlockPos pos, PlayerEntity player)
    {
        return new ItemStack(AngryBirdsBlocks.balloon_block);
    }

But how do i add the color of the placed block to the ItemStack, if i finished the blockcolors later?

And for my other blocks, how do i check a specific position to return the block there as ItemStack?

  • Replies 62
  • Created
  • Last Reply

Top Posters In This Topic

Posted

i dont really know how to help ya, but your source code helped me understand the way forge works alot better than most tutorials and docs simply cuz you kept most of it in the main file rather than like 5 different files, so just wanted to say thanks

Posted
  On 8/2/2019 at 5:13 PM, Drachenbauer said:

But how do i add the color of the placed block to the ItemStack, if i finished the blockcolors later?

Expand  

You have access to the block state.

 

  On 8/2/2019 at 5:13 PM, Drachenbauer said:

And for my other blocks, how do i check a specific position to return the block there as ItemStack?

Expand  

I'm not sure what you mean here. Please elaborate.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
  On 8/2/2019 at 6:08 PM, Animefan8888 said:

You have access to the block state.

 

I'm not sure what you mean here. Please elaborate.

Expand  

My slingshot-block has invisible blocks at both sides, wich i use for both slingshot-models.

So they should scheck wich of the two different slingshot-blocks is located next to them in the direction indicated by the rotation of the model.

I know how to use theese directions in setBlockState, but i don´t know, how to use this in the pickBlock-method.

Posted
  On 8/2/2019 at 6:36 PM, Drachenbauer said:

I'm not sure what you mean here. Please elaborate. 

Expand  

If you store the blocks color in the BlockState you can get it from the BlockState you are given in the parameters. If you are storing it in a TileEntity you can get the TileEntity by doing world.getTileEntity(...)

 

  On 8/2/2019 at 6:36 PM, Drachenbauer said:

My slingshot-block has invisible blocks at both sides, wich i use for both slingshot-models.

So they should scheck wich of the two different slingshot-blocks is located next to them in the direction indicated by the rotation of the model.

I know how to use theese directions in setBlockState, but i don´t know, how to use this in the pickBlock-method.

Expand  

Umm if you store the value in the BlockState you can use BlockState#get(IProperty) to get the value.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted (edited)

i will store it in the blockstate.

I dont know, where exactly in the method, i have to use BlockState#get(IProperty)...

I cannot find any tutorials about the pickBlock-method.

Edited by Drachenbauer
Posted (edited)

Actually i have this:

    @Override
    public ItemStack getPickBlock(BlockState state, RayTraceResult target, IBlockReader world, BlockPos pos, PlayerEntity player)
    {
        return new ItemStack(AngryBirdsBlocks.balloon_block);
    }

But i need something to replace the blockname, that i can navigate to the already placed main-block of the construct, using the pos-value, to get access to it´s specific blockstates.

And i need a way to access theese blockstates (i don´t know, where to insert BlockState#get(IProperty)).

Every time, i try something about blockstates inside the brachets behind "ItemStack", it changes the type of the whoole content to something (maybe BlockState), that does not fit there

Edited by Drachenbauer
Posted
  On 8/2/2019 at 8:06 PM, Drachenbauer said:

And i need a way to access theese blockstates (i don´t know, where to insert BlockState#get(IProperty)).

Expand  
  On 8/2/2019 at 8:06 PM, Drachenbauer said:

BlockState state

Expand  

state.get(...)

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted (edited)

I find no way to insert " state.get(...) " in this line.

And i also think, here "state" is the BlockState from the block, that holds this codt, not from the other block, that should be copyed as an item.

Sample:

The code is in the top-block of the balloon, but i want a way to access the Blockstate of it´s already placed bottom block by using "pos.down()" to get a correct colored copy of it.

 

for short:

I need " pos.down() " and " state.get(...) ", but i find no way to assemble them to a line of code, that works here.

Edited by Drachenbauer
Posted (edited)

Now i found " getItem ", that includes all needed contents and fit´s behind "return".

But it´s deprecated and does not give me the pos down block.

What is the actual replacement for it?

 

Now i have this:

    @Override
    public ItemStack getPickBlock(BlockState state, RayTraceResult target, IBlockReader world, BlockPos pos, PlayerEntity player)
    {
        return super.getPickBlock(state, target, world, pos.down(), player);
    }

But i don´t get the bottom block...

I thaught, if i  add down to the position, it will give the block below this one.

But this doesn´t happen.

Why not?

Edited by Drachenbauer
Posted

I still found no way to get the block below te one with the pickBlock-action, i try to write, by using " pos.down() " and " state.get(...) " .

I really need help for the exact setup of the code-line, that i have to place in the method.

I found no tutorial, how to do this.

Posted (edited)

I tryad around very much on "getPickBlock" without success.

with

Return new ItemStack(...);

i found no way to use " pos.down() " and " state.get(...) ".

And with

return getItem (...);

and

return super.getPickBlock(...);

I can put in " pos.down() " and " state.get(...) ", but it does not have any effect.

I get no item and in the console a warning appears:

[Client thread/WARN] [ne.mi.co.ForgeHooks/]: Picking on: [BLOCK] angrybirdsmod:balloon_block_top gave null item

 

 I think, if anyone found a way to get this getPickBlock-thing to work, the best way is, to put the whoole method with it´s content here.

Edited by Drachenbauer
Posted

I´m still waiting for a solution:

For each block of a multible-block-model, i just created, the pickBlock-function should give a copy of the main-block (the one with the BlockItem) with it´s actual color-blockstate.

Actually i can get a copy of the BlockItem (main-block) only by using the pickBlock-click on the main-block of the model, but not on the other part-blocks.

I still naad a way to get a block by position and then get it´s property for the BlockItem

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements




  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • And without soulsweapons?
    • In France, we deeply value financial security and independence. After my divorce, my life took a chaotic turn, and amidst all the turmoil, I misplaced the backup phrase for my Bitcoin wallet, which held a significant amount, $220,000. I was already grappling with emotional challenges, and the thought of losing my Bitcoin felt like the final blow. In moments like these, I couldn't help but think of the French saying, “Il ne faut jamais dire jamais,” which means “Never say never.” Little did I know that this would become a mantra for my recovery journey. I spent days searching for that elusive phrase, going through old documents and turning my apartment upside down, but it was as if the universe had conspired against me—the backup was simply gone. Feeling desperate and overwhelmed, I confided in a friend who works in the cryptocurrency space. He recommended Hack Buster Recovery, mentioning that they had helped many French investors in similar situations. Skeptical but out of options, I decided to reach out. From the moment I contacted Hack Buster Recovery, I was struck by their understanding of my situation. They were professional and compassionate, reassuring me that I wasn’t alone in this struggle. Their team quickly got to work, explaining the recovery process in a way that put my mind at ease. It was clear they had dealt with cases like mine before, WEBSITE: hackbusters.online
    • (LEEULTIMATEHACKER @ A O L . C O M)  telegram: LEEULTIMATE With LEE ULTIMATE HACKER, a team which specializes in recovering a wide range of digital assets including, Bitcoin, Etherium, stablecoins, non -fungible tokens (NFTs), and other various cryptocurrencies, In the ever evolving crypto world the need for effective recovery solutions is very critical. Their services are specifically tailored to assist clients dealing with fraud, LEE ULTIMATE HACKER's strength lies in its team of industry pioneers who have contributed to shaping the legal and regulatory frameworks around crypto assets, They also work closely with trusted insolvency practitioners, crypto custodians leading exchanges, and Insurance providers, LEE ULTIMATE HACKER and team works with a robust network allows them to delivery seamless end-to-end recovery service capable of handling even the most complex cases, services that are specifically tailored to assist clients dealing with fraud, Bitcoin scams and digital assets that are deliberately concealed or Misappropriated. LEE ULTIMATE HACKER strength lies in its team of industry pioneers who have contributed to shaping the legal and regulatory framework around crypto assets, from the moment assets go missing LEE ULTIMATE HACKER is dedicated to guiding clients through every step of the recovery process, they understand the urgency and emotional weight of such situations and leverage their expertise to maximize the chances of successful outcome, whether facing fraud, scams, or other crypto -related challenges, LEE ULTIMATE HACKER stands ready to help clients reclaim what is rightfully theirs.
    • I deleted wildbackport and now i get this https://mclo.gs/1Q7mHD1
    • Add the full crash-report or latest.log (logs-folder) with sites like https://mclo.gs/ and paste the link to it here
  • Topics

×
×
  • Create New...

Important Information

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