Jump to content

I want to cancel Mineshafts


Schleim_time

Recommended Posts

wait what? how to override a void method huh?

 

 

@SubscribeEvent
    public void onEventGenerateStructure(InitMapGenEvent event){
        if(event.getType() ==  InitMapGenEvent.EventType.MINESHAFT){
           
        }
    }

 

got that but idk how to override that, i only know how to override objects, also i tried in the if statement to setCancelled, that chrashes and setNewGen also crashes

On 5/22/2019 at 10:11 PM, diesieben07 said:

Mineshafts:

Subscribe to InitMapGenEvent (fired on MinecraftForge.TERRAIN_GEN_BUS) and check for InitMapGenEvent.EventType.MINESHAFT. Then override the generator with one that simply generates nothing.

 

Dungeons:

Subscribe to PopulateChunkEvent.Populate (also fired on MinecraftForge.TERRAIN_GEN_BUS) and set it's result to DENY for PopulateChunkEvent.Populate.EventType.DUNGEON.

 

Link to comment
Share on other sites

@SubscribeEvent
    public void onInitMapGenEvent(InitMapGenEvent event) {
        if(event.getType() == InitMapGenEvent.EventType.MINESHAFT) {
            event.setNewGen(new MapGenRavine());
        }
    }

 

tried to override them with ravines but that crash, null also crash and new MapGenBase() also crash, idk hot to use that event im sorry

Link to comment
Share on other sites

16 hours ago, diesieben07 said:

You need to call setNewGen and provide a generator that does not generate anything, like I said.

If it crashes, post the log. We can’t help  you based on “it crashes”

Edited by Cadiboo

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

7 hours ago, Schleim_time said:

i need something diffrent

Post the log first.

7 hours ago, Cadiboo said:

We can’t help  you based on “it crashes” 

 

7 hours ago, Schleim_time said:

i only want to know how to cancel InitMapGenEvent

 

On 5/24/2019 at 2:47 PM, diesieben07 said:

setCancelled will indeed crash, because InitMapGenEvent is not cancellable.

 

Link to comment
Share on other sites

@SubscribeEvent
    public void onInitMapGenEvent(InitMapGenEvent event) {
        if(event.getType() == InitMapGenEvent.EventType.MINESHAFT) {
            event.setNewGen(x);
        }
    }

so thats my code and the only thing i want to know what i have to fit in for "x" to remove the mineshafts, i tried null and also new MapGenBase but both just doent worked like i wanted them to work, i need something to fit in for x and i think a log will not help for that problem

Link to comment
Share on other sites

“x” needs to be your own implementation that doesn’t generate anything

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

9 hours ago, Cadiboo said:

“x” needs to be your own implementation that doesn’t generate anything

there is my problem, i never used that event or created anything like that, like i said i tried to replace the mineshaft by putting for x "new MapGenRavine()" so how does that work?

and new MapGenRavine() didnt worked for that

Edited by Schleim_time
extra info
Link to comment
Share on other sites

It needs to be your own implementation that doesn’t generate anything. So “new DummyMapGen()”

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
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.
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



×
×
  • Create New...

Important Information

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