Code Monkey home page Code Monkey logo

labyrinth's People

Contributors

foghrye4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

minecrak

labyrinth's Issues

NullPointerException when saving entity

[06:04:18] [Server thread/ERROR]: Encountered an unexpected exception
net.minecraft.util.ReportedException: Saving entity NBT
	at net.minecraft.entity.Entity.writeToNBT(Entity.java:1939) ~[Entity.class:?]
	at net.minecraft.entity.Entity.writeToNBTOptional(Entity.java:1822) ~[Entity.class:?]
	at cubicchunks.world.EntityContainer.writeToNbt(EntityContainer.java:163) ~[EntityContainer.class:?]
	at cubicchunks.server.chunkio.IONbtWriter.writeEntities(IONbtWriter.java:157) ~[IONbtWriter.class:?]
	at cubicchunks.server.chunkio.IONbtWriter.write(IONbtWriter.java:90) ~[IONbtWriter.class:?]
	at cubicchunks.server.chunkio.RegionCubeIO.saveCube(RegionCubeIO.java:159) ~[RegionCubeIO.class:?]
	at cubicchunks.server.CubeProviderServer.saveChunks(CubeProviderServer.java:163) ~[CubeProviderServer.class:?]
	at net.minecraft.world.WorldServer.saveAllChunks(WorldServer.java:1073) ~[WorldServer.class:?]
	at net.minecraft.server.MinecraftServer.saveAllWorlds(MinecraftServer.java:426) ~[MinecraftServer.class:?]
	at net.minecraft.server.integrated.IntegratedServer.saveAllWorlds(IntegratedServer.java:238) ~[IntegratedServer.class:?]
	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:722) ~[MinecraftServer.class:?]
	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) ~[IntegratedServer.class:?]
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:548) [MinecraftServer.class:?]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
Caused by: java.lang.NullPointerException
	at labyrinth.entity.EntitySlimeLeveled.writeEntityToNBT(EntitySlimeLeveled.java:51) ~[EntitySlimeLeveled.class:?]
	at net.minecraft.entity.Entity.writeToNBT(Entity.java:1910) ~[Entity.class:?]
	... 13 more

I got this exception when flying straight down in spectator mode for long enough. I was running it in dev environment because I was testing if my changes didn't break this mod.

Offset population by 8 blocks in x, y and z coordinates

This is not a huge performance issue in CubicChunks thanks to changes made by xcube16, but it's still the wrong thing to do. Without these changes, your mod would immediateely crash with StackOverflowError. You are setting blocks at the x=0/z=0 border of the give chunk, which when given "do block updates" flag also notifies neighbors... which causes neighbor chunks to be generated. In vanilla this could cause infinite chain of chunk generation and population that would almost instantly crash. With cubic chunks it "only" causes generating more chunks. In the near future I'm going to add warnings when this happens.

Also it would break if I ever go back to the vanilla way (which isn't that unlikely).

So basically what you are doing:

# - the area you are populating.
The middle chunk is the one you got as CubePos.

+--------+--------+--------+
|        |        |        |
|        |        |        |
+--------+--------+--------+
|        |########|        |
|        |########|        |
+--------+--------+--------+
|        |        |        |
|        |        |        |
+--------+--------+--------+

And what you should do (this is also now explained in javadoc):

# - the area you are populating.
The middle chunk is the one you got as CubePos.

+--------+--------+--------+
|        |        |        |
|        |    ####|####    |
+--------+--------+--------+
|        |    ####|####    |
|        |        |        |
+--------+--------+--------+
|        |        |        |
|        |        |        |
+--------+--------+--------+

The reason for this is that the vast majoroty of populators need to set blocks outside of the directly populated area, like trees for example. If the middle chunk was to be populated directly, populating this one chunk could affect - in vanilla - 8 neighbor chunks, and - in cubic chunks - 26 neighbor cubes. This means that to make sure that all the chunks that affect the currently populated cube are populated, we would need to populate 27 cubes which would need actually generating a whole 125 of them.

Now we need to populate only 8 of them and actually generate 27.

Suggestion: randomly generated dungeon

This mod is very epic, but unfortunately, it lack one major thing.

I trust you to have a good idea on how you can do this.

But here is what I have in mind.

In the preset, we can determine how rare it is to spawn one type of dungeon. Once this dungeon spawn, it generate other "cube" all around it with a percentage chance of happening, which we can edit in the preset. Then this other cube being generated also have the same percentage chance of spawning other cubes all around it. Eventually, the end of the dungeon. By having 100% chance, then dungeon will spawn infinitely.

The first and main cube being generated which generate other cubes afterward is the boss room to find inside each labyrinth (unless multiple labyrinth connect together to form larger labyrinth). This cube spawn a boss and a couple of good dungeon chests.

I have heard about your idea of creating tunnels connecting cubes together. I'm not sure of what this means, but this made my imagination go wild. It make me think of the plastic labyrinth we create for our little mice. Each cubes generate other cubes but they can generate tunnels instead with a random chance we can configure in the preset as well. But I'd rather have random dungeons first than having tunnels!

world specific settings

The mod should be able to have world specific location settings rather than a global setting so it doesn't fudge up existing worlds. Preferably by world generation menu, but any method is fine

Sunlight won't propagate through the labirynth - the mod directly sets blocks in ExtendedBlockStorage

The mod should NEVER set blocks directly in ExtededBlockStorage and should never have the need to set the light array. Instead you should offset the blocks you set by 8 in each direction and set them through World. Yes, it won't be as fast. Mainly because you are skipping a lot of the things that make it slow that will cause issues.

2017-05-18_06 16 24

Or you might have better luck creating new Labirynth world type (a cubic chunks one) with your own chunk generator, that doesn't even bother doing anything below the point where your structure starts, and place just them and nothing else. This would have the obvious downside that it won't support any world types that you don't intend it to support.

Or it can be done as early structure generator, I can add an event to add custom ones. You would work with CubePrimer there. And then only add tile entities in populator.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.