Jump to content

Recommended Posts

Posted

Tell us what you want the player to see happen.

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.

Posted
  On 3/2/2018 at 6:09 AM, jabelar said:

What are you trying to achieve?

Expand  

like where in minecrafts code is when chunks are first generated so i can finger something out to add code to it or something, example

 

if(newChunkGenerated && mc.player.onGround){

mc.player.jump();

}

Posted
  On 3/2/2018 at 6:22 AM, jabelar said:

I mean why do you want this? What are you wanting to do by knowing it is a new chunk? Do you really just want to make it jump continuously on a new chunk?

Expand  

i want it to jump and say on screen saying if a new chunk generated which i know how to do i just dont know how to get newly generated chunks

Posted

Chunks being generated happens so far away from the player that that behavior doesn't even make sense.

 

What if the player is falling / flying at the time? Teleporting? Riding in a minecart or on a horse? In a boat?

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.

Posted
  On 3/2/2018 at 6:43 AM, Draco18s said:

Chunks being generated happens so far away from the player that that behavior doesn't even make sense.

 

What if the player is falling / flying at the time? Teleporting? Riding in a minecart or on a horse? In a boat?

Expand  

i guess you have a point, i was going do that for testing but i can it can show something on screen if newly chunks generated, i wana make a mod for like new updates so you know your in new chunks so you can start looking for newly generated stuff in the update, but where in the code does newly generated in code?

Posted

There's an event for it, but actually there's several events for it. That's why we want to know what you're doing, so we can point you at the most appropriate one.

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.

Posted

It depends on what you want to do.

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.

Posted

If the chunk was just generated* then....

...it will be a new chunk.

 

*There are, of course, multiple stages of chunk generation and may not occur immediately one after the other...

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.

Posted
  On 3/2/2018 at 7:14 AM, Draco18s said:

If the chunk was just generated* then....

...it will be a new chunk.

 

*There are, of course, multiple stages of chunk generation and may not occur immediately one after the other...

Expand  

so i looked at a chunk event and its kinda working but not really, by new chunk i mean a new chunk first time being generated(it wasent already loaded before) do you know how to check for that?

Posted

ChunkGeneratorEvent (of which there are 3 sub events, one of which is the PopulateChunkEvent which has its own 3 sub events)

DecorateBiomeEvent (of which there are 3 sub events) which is involved in chunk generation

OreGenEvent (of which there are 4 sub events) which is involved in chunk generation

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.

Posted
  On 3/2/2018 at 7:50 AM, Draco18s said:

ChunkGeneratorEvent (of which there are 3 sub events, one of which is the PopulateChunkEvent which has its own 3 sub events)

DecorateBiomeEvent (of which there are 3 sub events) which is involved in chunk generation

OreGenEvent (of which there are 4 sub events) which is involved in chunk generation

Expand  

Thanks i see that, but is there like a way if(chunk.wasAlreadyLoaded){

}

or something that i can determine if a chunk was already generated before the player generating it now

Posted
  On 3/2/2018 at 9:07 AM, diesieben07 said:

As already pointed out by Draco:

Chunks are not generated multiple times. If a chunk is being generated, it is a new chunk by definition.

Expand  

sorry i dont fully understand what you  guys are saying, im probably being a pain the the but but, i was looking at a forums post from 3 years ago u helped a guy and u said this

 

ChunkProviderGenerate for example always reports true from chunkExists, where as ChunkProviderServer checks if the chunk is loaded into memory.

And World.getChunkProvider always gives you a ChunkProviderServer (resp. a ChunkProviderClient).

 

how can i use ChunkProviderServer to check if a chunk is/was loaded into memory

Posted (edited)

I think they're saying that if the event fires then the chunk is new. You don't need to further check.

 

Now I think you want the player to know which chunks are "new" in terms of generated since the last game load. I that case I would probably just make a List of ChunkPos elements that I add to each time there is a Populate event and then as the player moves around I would check if they've entered a chunk on that List. If they have, then they are exploring a newly generated chunk. Basically I'm saying you can make your own method for checking for newly generated chunks simply by keeping them in a list and then checking the list.

Edited by jabelar

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted (edited)
  On 3/2/2018 at 4:27 PM, IKnowImEZ said:

sorry i dont fully understand what you  guys are saying

Expand  

Ok look. We're going to play black jack.

 

I have dealt you two cards. They are a five and a three.

<ChunkGeneratorEvent fired: five>

<ChunkGeneratorEvent fired: three>

 

Do you want a third?

  Quote

yes, I would like a new card

Expand  

Here you go here is a third card. It is new and it is a seven.

<ChunkGeneratorEvent fired: seven>

Would you like another card?

  Quote

Ok, but I'm looking at my cards now and I want to know if the five is a new card.

Expand  

...

Edited by Draco18s

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.

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

    • I will keep adding to this thread with more information in case anyone can help, or at the very least I can keep my troubleshooting organized. I decided to downgrade to 54.1.0 in the hopes that this would fix the issue but it didn't. At least now I am on a "recommended" version. The crash report did confirm my earlier post that the Exception is coming from effectiveDescriptionId(). I'll continue to see if I can find a way to set the ID manually.   Caused by: java.lang.NullPointerException: Item id not set         at java.base/java.util.Objects.requireNonNull(Objects.java:259) ~[?:?]         at TRANSFORMER/minecraft@1.21.4/net.minecraft.world.item.Item$Properties.effectiveDescriptionId(Item.java:465) ~[forge-1.21.4-54.1.0-client.jar!/:?]         at TRANSFORMER/minecraft@1.21.4/net.minecraft.world.item.Item.<init>(Item.java:111) ~[forge-1.21.4-54.1.0-client.jar!/:?]         at TRANSFORMER/shotgunmod@1.0.0/com.example.shotgunmod.ShotgunItem.<init>(ShotgunItem.java:19) ~[shotgunmod-1.0.0.jar!/:1.0.0]         at TRANSFORMER/shotgunmod@1.0.0/com.example.shotgunmod.ModItems.lambda$static$0(ModItems.java:15) ~[shotgunmod-1.0.0.jar!/:1.0.0]         at TRANSFORMER/net.minecraftforge.forge@54.1.0/net.minecraftforge.registries.DeferredRegister$EventDispatcher.lambda$handleEvent      
    • It just randomly stop working after a rebooted my dedicated server PLEASE HELP!   com.google.gson   Failed to start the minecraft server com.google.gson.JsonSyntaxException: Expected a com.google.gson.JsonObject but was com.google.gson.JsonPrimitive; at path $  
    • It was working perfectly fine last night but now I'm getting an exit code -1 with the textbox: The game crashed: rendering overlay Error: net.minecraftforge.fml.ModLoadingException: Supplementaries (supplementaries) encountered an error during the done event phase Here's the crash log: https://pastebin.com/KmesArYS Any help is apricated
    • Link to Crashlog: https://pastebin.com/bKqH9fx2 Trying to set up a custom mod pack, was going smoothly up until recently as the WorldLoader screen, (the one that appears when you select "create new world" in Singleplayer), was clicked to test that it was running fine. Most Recent Few mods added were; - Create (+ its addons) - Immersive Weathering [Forge] I've tried all I could think of since loading up the game worked fine and I've never had this issue before.  Any help is appreciated.  
    • Digging in to the source, in this case net.minecraft.world.item.Item.Properties, I see these functions are the error source:         protected String effectiveDescriptionId() {             return this.descriptionId.get(Objects.requireNonNull(this.id, "Item id not set"));         }         public ResourceLocation effectiveModel() {             return this.model.get(Objects.requireNonNull(this.id, "Item id not set"));         } Can anyone share more information on how to set the Id properly? Is this something I have to do explicitly by calling the setId() function? My understanding is the ID is set implictly with these calls:       public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, ShotgunMod.MODID);     private static final Item.Properties p = new Item.Properties().durability(100).stacksTo(1);     public static final RegistryObject<Item> SHOTGUN = ITEMS.register("shotgun", () -> new ShotgunItem(p)); From net.minecraft.world.item.Item.Properties;  public Item.Properties setId(ResourceKey<Item> pId) {             this.id = pId;             return this;   } Thank you for your help
  • Topics

×
×
  • Create New...

Important Information

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