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

canCollideCheck - Unknown flag is now not unknown


Recommended Posts

/**
     * Returns whether this block is collideable based on the arguments passed in Args: blockMetaData, unknownFlag
     */
    public boolean canCollideCheck(int par1, boolean par2)
    {
        return this.isCollidable();
    }

 

The par2 boolean is a flag that relates to collision raycasts, say, by the player's mouse cursor.

 

I had a dispenser-like block that I wanted to fire multiple arrows from, found that because of some offsets (so that they would be emitted from different locations, regardless of orientation) was causing some arrows to collide with the block itself.  So I looked into making the block non-collidable for that purpose.

 

Found the above function (well, knew it existed, but implemented it for an override and did this:

 

public boolean canCollideCheck(int par1, boolean par2)
    {
        return this.isCollidable() & par2;
    }

 

I could now no longer right-click interact with my block, but the arrows passed through it as desired.

 

Changed to

 

public boolean canCollideCheck(int par1, boolean par2)
    {
        return this.isCollidable() | par2;
    }

 

And retained the desired behavior and regained the ability to interact with it.

 

Scratch that, was a total fluke due to the RNG.

(There are 4 spots my arrows fire from, two of them collide, two don't, the test I thought things worked right was just a fluke of the RNG picking the two that worked).

 

Back-tracing the code it appears that this boolean is true if and only if the player right-clicks while holding a boat.  I suspect that this code is used to place the boat on top of water rather than underneath.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to post
Share on other sites

Either way this doesn't belong here.

We are not the curators of vanilla code documentation.

http://mcp.ocean-labs.de/index.php/MCPBot

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Link to post
Share on other sites

We are not the curators of vanilla code documentation.

 

I actually had no idea.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • shadowJar creates a new jar task. You need to use reobf { shadowJar } and then shadowJar.finalizedBy('reobfShadowJar') like the default buildscript already does for the normal Jar task.
    • I am wrong. Looks like shadowJar runs on assemble. I will try it.
    • When does shadowJar run? I thought it runs at the same time the jar task runs, which is before reobfJar. I need it to run after reobfJar.
    • You should probably use the Shadow plugin.
    • Hi, I am trying to get HikariCP bundled with my mod as a one fat jar. But there is a problem where HikariCP causes reobfJar to fail with InvalidArgumentException, and I'm not sure why. Here is my gradle code right now (I left out a lot of stuff which I don't think matters):   configurations { embed } dependencies { minecraft 'net.minecraftforge:forge:1.16.5-36.1.0' embed group: 'com.zaxxer', name: 'HikariCP', version: '4.0.3' compileOnly group: 'com.ea.async', name: 'ea-async', version: '1.2.3' } jar { from configurations.embed.collect{ it.isDirectory() ? it : zipTree(it) } manifest { attributes([ "Specification-Title": "examplemod", "Specification-Vendor": "examplemodsareus", "Specification-Version": "1", // We are version 1 of ourselves "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"examplemodsareus", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } } jar.finalizedBy('reobfJar')   As I understand, this is the current order of events: `jar` task to run, which will bundle all the dependencies marked with `embed`, which will create the fat jar `reobfJar` will run on that fat jar. Would I would like to do instead is this order of events: `jar` task to run, but no fat jar is created at this time. `reobfJar` will run on the output of `jar`. A new task runs, which will take the output of `reobfJar` and combine it with the dependencies marked with `embed` to create the one fat jar   I think the code would look something like this:   jar { manifest { attributes([ "Specification-Title": "examplemod", "Specification-Vendor": "examplemodsareus", "Specification-Version": "1", // We are version 1 of ourselves "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"examplemodsareus", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } } jar.finalizedBy('reobfJar') task bundle(type: Jar) { manifest { attributes 'Main-Class': 'com.gluecode.fpvdrone.server.Main' } from "build/libs/modid-1.0.jar" from configurations.embed.collect{ it.isDirectory() ? it : zipTree(it) } } The problems I have with the above is: I have to run `./gradlew bundle` after running `./gradlew buildNeeded`. And I'd like to just run 1 command. It doesn't work because it results in an invalid mod jar. I'm am still learning gradle. Can anyone help me?
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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