Jump to content

salvestrom

Members
  • Posts

    116
  • Joined

  • Last visited

Posts posted by salvestrom

  1. I now have this setup as below. This allowed 2 to 3 dozen chunks to spawn. I was able to get rest to work smoothly by removing my custom mobs from the spawn list in the biome class. I don't think their placement code is in place properly. I assumed this was the problem along.

     

    This is the registration class for the surface builder.

    @EventBusSubscriber(modid = References.MODID, bus = EventBusSubscriber.Bus.MOD)
    @ObjectHolder(References.MODID)
    public class RegisterSurfaceBuilders
    {
    
    		@ObjectHolder(References.MODID + ":jungle_mountain_builder")
    		public static  SurfaceBuilder<SurfaceBuilderConfig> JUNGLE_MOUNTAIN=new JungleMountainSurfaceBuilder();
    
    		@SubscribeEvent
    		public static void registerSurfaceBuilders(final RegistryEvent.Register<SurfaceBuilder<?>> event) 
    		{
    
    			registerBuilder(event.getRegistry(), JUNGLE_MOUNTAIN, "jungle_mountain_builder");
    		}
    	
    	   
    	private static <T extends SurfaceBuilder<?>> T registerBuilder(final IForgeRegistry<SurfaceBuilder<?>> registry, final T builder, final String builderName) 
    	{
    		if(registry==null)
    		{
    			throw new NullPointerException("Something's gone wrong!");
    		}
    		else
    		{
    			builder.setRegistryName(References.MODID, builderName);
    			registry.register(builder);
    		}
    
    		return builder;
    	}
    }

    And this is the surface builder class.

    public class JungleMountainSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig> 
    {
       public JungleMountainSurfaceBuilder() 
       {
          super(SurfaceBuilderConfig::deserialize);
       }
    
       public void buildSurface(Random random, IChunk chunkIn, Biome biomeIn, int x, int z, int startHeight, double noise, BlockState defaultBlock, BlockState defaultFluid, int seaLevel, long seed, SurfaceBuilderConfig config) 
       {
          if (noise > 3.0D) {
             SurfaceBuilder.DEFAULT.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, SurfaceBuilder.STONE_STONE_GRAVEL_CONFIG);
          } else {
             SurfaceBuilder.DEFAULT.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, SurfaceBuilder.GRASS_DIRT_GRAVEL_CONFIG);
          }
    
       }
    }

     

  2.  The moment the game tries to load the biome that the surface builder is associated there is a crash. The issue only occurs when using my custom surface builder. Using the vanilla mountain surface builder, there is no issue. Registration seems to be checking out – the builder isn't returning null. Below is a crash log of the error.It seems to come down to setSeed, but there is no indication I need to specifically supply the seed in the surface builder. Most of the vanilla ones don't – the mountain surface builder amongst them.

    Spoiler

    [m[1;31m[22:56:44] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception
    net.minecraft.crash.ReportedException: Exception generating new chunk
        at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:869) ~[?:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:800) ~[?:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:646) [?:?] {re:classloading,pl:accesstransformer:B}
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_221] {}
    Caused by: java.lang.NullPointerException
        at net.minecraft.world.gen.surfacebuilders.ConfiguredSurfaceBuilder.setSeed(ConfiguredSurfaceBuilder.java:22) ~[?:?] {re:classloading}
        at net.minecraft.world.biome.Biome.buildSurface(Biome.java:326) ~[?:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.world.gen.NoiseChunkGenerator.generateSurface(NoiseChunkGenerator.java:199) ~[?:?] {re:classloading}
        at net.minecraft.world.chunk.ChunkStatus.lambda$static$6(ChunkStatus.java:61) ~[?:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.world.chunk.ChunkStatus$ISelectiveWorker.doWork(ChunkStatus.java:242) ~[?:?] {re:classloading}
        at net.minecraft.world.chunk.ChunkStatus.func_223198_a(ChunkStatus.java:196) ~[?:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.world.server.ChunkManager.lambda$null$17(ChunkManager.java:512) ~[?:?] {re:classloading}
        at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-2.0.24.jar:?] {}
        at net.minecraft.world.server.ChunkManager.lambda$func_223156_b$19(ChunkManager.java:510) ~[?:?] {re:classloading}
        at java.util.concurrent.CompletableFuture.uniCompose(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.CompletableFuture$UniCompose.tryFire(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.CompletableFuture$Completion.run(Unknown Source) ~[?:1.8.0_221] {}
        at net.minecraft.world.chunk.ChunkTaskPriorityQueueSorter.lambda$null$1(ChunkTaskPriorityQueueSorter.java:44) ~[?:?] {re:classloading}
        at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveOne(DelegatedTaskExecutor.java:83) ~[?:?] {re:classloading}
        at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveWhile(DelegatedTaskExecutor.java:123) ~[?:?] {re:classloading}
        at net.minecraft.util.concurrent.DelegatedTaskExecutor.run(DelegatedTaskExecutor.java:91) ~[?:?] {re:classloading}
        at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) ~[?:1.8.0_221] {}
    [m[1;31m[22:56:44] [Server thread/ERROR] [minecraft/MinecraftServer]: This crash report has been saved to: C:\Users\salvestrom\Desktop\MeincraftJungle 1.14.4\run\.\crash-reports\crash-2019-11-28_22.56.44-server.txt
    [m[32m[22:56:44] [Server thread/INFO] [minecraft/MinecraftServer]: Stopping server
    [m[32m[22:56:44] [Server thread/INFO] [minecraft/MinecraftServer]: Saving players
    [m[32m[22:56:44] [Client thread/INFO] [STDOUT/]: [net.minecraft.util.registry.Bootstrap:printToSYSOUT:106]: ---- Minecraft Crash Report ----
    // I feel sad now :(

    Time: 28/11/19 22:56
    Description: Exception generating new chunk

    java.lang.NullPointerException: Exception generating new chunk
        at net.minecraft.world.gen.surfacebuilders.ConfiguredSurfaceBuilder.setSeed(ConfiguredSurfaceBuilder.java:22) ~[?:?] {re:classloading}
        at net.minecraft.world.biome.Biome.buildSurface(Biome.java:326) ~[?:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.world.gen.NoiseChunkGenerator.generateSurface(NoiseChunkGenerator.java:199) ~[?:?] {re:classloading}
        at net.minecraft.world.chunk.ChunkStatus.lambda$static$6(ChunkStatus.java:61) ~[?:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.world.chunk.ChunkStatus$ISelectiveWorker.doWork(ChunkStatus.java:242) ~[?:?] {re:classloading}
        at net.minecraft.world.chunk.ChunkStatus.func_223198_a(ChunkStatus.java:196) ~[?:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.world.server.ChunkManager.lambda$null$17(ChunkManager.java:512) ~[?:?] {re:classloading}
        at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-2.0.24.jar:?] {}
        at net.minecraft.world.server.ChunkManager.lambda$func_223156_b$19(ChunkManager.java:510) ~[?:?] {re:classloading}
        at java.util.concurrent.CompletableFuture.uniCompose(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.CompletableFuture$UniCompose.tryFire(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.CompletableFuture$Completion.run(Unknown Source) ~[?:1.8.0_221] {}
        at net.minecraft.world.chunk.ChunkTaskPriorityQueueSorter.lambda$null$1(ChunkTaskPriorityQueueSorter.java:44) ~[?:?] {re:classloading}
        at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveOne(DelegatedTaskExecutor.java:83) ~[?:?] {re:classloading}
        at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveWhile(DelegatedTaskExecutor.java:123) ~[?:?] {re:classloading}
        at net.minecraft.util.concurrent.DelegatedTaskExecutor.run(DelegatedTaskExecutor.java:91) ~[?:?] {re:classloading}
        at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) ~[?:1.8.0_221] {}

    This is the registration class for the surface builder.

    @EventBusSubscriber(modid = References.MODID, bus = EventBusSubscriber.Bus.MOD)
    @ObjectHolder(References.MODID)
    public class RegisterSurfaceBuilders
    {
    
    		@ObjectHolder(References.MODID + ":jungle_mountain_builder")
    		public static  SurfaceBuilder<SurfaceBuilderConfig> JUNGLE_MOUNTAIN;
    
    		@SubscribeEvent
    		public static void registerSurfaceBuilders(final RegistryEvent.Register<SurfaceBuilder<?>> event) 
    		{
    			JUNGLE_MOUNTAIN = new JungleMountainSurfaceBuilder(SurfaceBuilderConfig::deserialize);
    
    			registerBuilder(event.getRegistry(), JUNGLE_MOUNTAIN, "jungle_mountain_builder");
    		}
    	
    	   
    	private static <T extends SurfaceBuilder<?>> T registerBuilder(final IForgeRegistry<SurfaceBuilder<?>> registry, final T builder, final String builderName) 
    	{
    		if(registry==null)
    		{
    			throw new NullPointerException("Something's gone wrong!");
    		}
    		else
    		{
    			builder.setRegistryName(References.MODID, builderName);
    			registry.register(builder);
    		}
    
    		return builder;
    	}
    }

    And this is the surface builder class.

    public class JungleMountainSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig> 
    {
       public JungleMountainSurfaceBuilder(Function<Dynamic<?>, ? extends SurfaceBuilderConfig> p_i51310_1_) 
       {
          super(p_i51310_1_);
       }
    
       public void buildSurface(Random random, IChunk chunkIn, Biome biomeIn, int x, int z, int startHeight, double noise, BlockState defaultBlock, BlockState defaultFluid, int seaLevel, long seed, SurfaceBuilderConfig config) 
       {
          if (noise > 3.0D) {
             SurfaceBuilder.DEFAULT.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, SurfaceBuilder.STONE_STONE_GRAVEL_CONFIG);
          } else {
             SurfaceBuilder.DEFAULT.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, SurfaceBuilder.GRASS_DIRT_GRAVEL_CONFIG);
          }
    
       }
    }

     

  3. 3 hours ago, DragonITA said:

    Ok, i have tried with making something, and the Unicorn spawn, but without a texture. The model is just like a white Brick it dosent have a texture.

    This is because Minecraft cannot find the texture. Check the console while loading for any indication of why. Make sure that the name of the texture and the name you are providing in the render file exactly match.

  4. 5 hours ago, DragonITA said:

    private static ModelUnicornWitoutAbstracHorse<UnicornEntity> UnicornModel; 

    Remove this and put this in the constructor super "new UnicornModel<>(0)". The model file has to extend HorseModel Or you will not get the animations.

    In the renderer Create:    

    Quote

    public static final ResourceLocation unicorn= new ResourceLocation("[Your mod ID]:"textures/entity/unicorn_entity.png"

     And return "unicorn" in getEntityTexture.

    ");

    • Like 1
  5. 2 hours ago, DragonITA said:

    No, you have said that i should make that modelUnicorn extends ModelEntity and not ModelHorse, but i need the AbstractHorseEntity, else the gui, animations and etc. wont work and i should rewrite the code.

    I did not say at any point that your model should extend model entity.

     

    This requires three classes. Your entity class should extend HorseEntity giving you access to all of the GUI, saddling and taming. Your render class should be adjusted to not be using the superfluous classy created, as I previously mentioned. Your model class needs to extend HorseModel – this is how you will inherit the animations and bulk of the model.

     

    Note that AbstractHorseEntity does not have all of the code for horses, only the shared code between the various horse entities.

    • Like 1
  6. 23 hours ago, Lea9ue said:

    There is literally zero reasons for you to be using Tabula or BlockBench to add a horn to a horse. You already have Horsemodel. You already have a texture file for a horse that you can add texture to make the horn.  I have a feeling that you are just lost.  You should then add a box like I said before to your model class.

    
      this.corn.addBox(.....);

     Then right here is the coordinates of the texture on the png.

    
    this.corn = new RendererModel(this, number, number);

    The 2 numbers tell exactly where the texture is located on png.

     

     

    Here's one: placing the box and texture blind directly into code and only being able to see what it looks like by loading up the game each time is a pain in the ass.

    • Like 1
  7. The moment the game tries to load the biome that the surface builder is associated there is a crash. The issue only occurs when using my custom surface builder. Using the vanilla mountain surface builder, there is no issue. Registration seems to be checking out – the builder isn't returning null. Below is a crash log of the error.It seems to come down to setSeed, but there is no indication I need to specifically supply the seed in the surface builder. Most of the vanilla ones don't – the mountain surface builder amongst them – unless they are making specific changes.

    Spoiler

    [m[1;31m[22:56:44] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception
    net.minecraft.crash.ReportedException: Exception generating new chunk
        at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:869) ~[?:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:800) ~[?:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:646) [?:?] {re:classloading,pl:accesstransformer:B}
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_221] {}
    Caused by: java.lang.NullPointerException
        at net.minecraft.world.gen.surfacebuilders.ConfiguredSurfaceBuilder.setSeed(ConfiguredSurfaceBuilder.java:22) ~[?:?] {re:classloading}
        at net.minecraft.world.biome.Biome.buildSurface(Biome.java:326) ~[?:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.world.gen.NoiseChunkGenerator.generateSurface(NoiseChunkGenerator.java:199) ~[?:?] {re:classloading}
        at net.minecraft.world.chunk.ChunkStatus.lambda$static$6(ChunkStatus.java:61) ~[?:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.world.chunk.ChunkStatus$ISelectiveWorker.doWork(ChunkStatus.java:242) ~[?:?] {re:classloading}
        at net.minecraft.world.chunk.ChunkStatus.func_223198_a(ChunkStatus.java:196) ~[?:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.world.server.ChunkManager.lambda$null$17(ChunkManager.java:512) ~[?:?] {re:classloading}
        at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-2.0.24.jar:?] {}
        at net.minecraft.world.server.ChunkManager.lambda$func_223156_b$19(ChunkManager.java:510) ~[?:?] {re:classloading}
        at java.util.concurrent.CompletableFuture.uniCompose(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.CompletableFuture$UniCompose.tryFire(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.CompletableFuture$Completion.run(Unknown Source) ~[?:1.8.0_221] {}
        at net.minecraft.world.chunk.ChunkTaskPriorityQueueSorter.lambda$null$1(ChunkTaskPriorityQueueSorter.java:44) ~[?:?] {re:classloading}
        at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveOne(DelegatedTaskExecutor.java:83) ~[?:?] {re:classloading}
        at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveWhile(DelegatedTaskExecutor.java:123) ~[?:?] {re:classloading}
        at net.minecraft.util.concurrent.DelegatedTaskExecutor.run(DelegatedTaskExecutor.java:91) ~[?:?] {re:classloading}
        at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) ~[?:1.8.0_221] {}
    [m[1;31m[22:56:44] [Server thread/ERROR] [minecraft/MinecraftServer]: This crash report has been saved to: C:\Users\salvestrom\Desktop\MeincraftJungle 1.14.4\run\.\crash-reports\crash-2019-11-28_22.56.44-server.txt
    [m[32m[22:56:44] [Server thread/INFO] [minecraft/MinecraftServer]: Stopping server
    [m[32m[22:56:44] [Server thread/INFO] [minecraft/MinecraftServer]: Saving players
    [m[32m[22:56:44] [Client thread/INFO] [STDOUT/]: [net.minecraft.util.registry.Bootstrap:printToSYSOUT:106]: ---- Minecraft Crash Report ----
    // I feel sad now :(

    Time: 28/11/19 22:56
    Description: Exception generating new chunk

    java.lang.NullPointerException: Exception generating new chunk
        at net.minecraft.world.gen.surfacebuilders.ConfiguredSurfaceBuilder.setSeed(ConfiguredSurfaceBuilder.java:22) ~[?:?] {re:classloading}
        at net.minecraft.world.biome.Biome.buildSurface(Biome.java:326) ~[?:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.world.gen.NoiseChunkGenerator.generateSurface(NoiseChunkGenerator.java:199) ~[?:?] {re:classloading}
        at net.minecraft.world.chunk.ChunkStatus.lambda$static$6(ChunkStatus.java:61) ~[?:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.world.chunk.ChunkStatus$ISelectiveWorker.doWork(ChunkStatus.java:242) ~[?:?] {re:classloading}
        at net.minecraft.world.chunk.ChunkStatus.func_223198_a(ChunkStatus.java:196) ~[?:?] {re:classloading,pl:accesstransformer:B}
        at net.minecraft.world.server.ChunkManager.lambda$null$17(ChunkManager.java:512) ~[?:?] {re:classloading}
        at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-2.0.24.jar:?] {}
        at net.minecraft.world.server.ChunkManager.lambda$func_223156_b$19(ChunkManager.java:510) ~[?:?] {re:classloading}
        at java.util.concurrent.CompletableFuture.uniCompose(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.CompletableFuture$UniCompose.tryFire(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.CompletableFuture$Completion.run(Unknown Source) ~[?:1.8.0_221] {}
        at net.minecraft.world.chunk.ChunkTaskPriorityQueueSorter.lambda$null$1(ChunkTaskPriorityQueueSorter.java:44) ~[?:?] {re:classloading}
        at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveOne(DelegatedTaskExecutor.java:83) ~[?:?] {re:classloading}
        at net.minecraft.util.concurrent.DelegatedTaskExecutor.driveWhile(DelegatedTaskExecutor.java:123) ~[?:?] {re:classloading}
        at net.minecraft.util.concurrent.DelegatedTaskExecutor.run(DelegatedTaskExecutor.java:91) ~[?:?] {re:classloading}
        at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) ~[?:1.8.0_221] {}
        at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) ~[?:1.8.0_221] {}

    This is the registration class for the surface builder.

    @EventBusSubscriber(modid = References.MODID, bus = EventBusSubscriber.Bus.MOD)
    @ObjectHolder(References.MODID)
    public class RegisterSurfaceBuilders
    {
    
    		@ObjectHolder(References.MODID + ":jungle_mountain_builder")
    		public static  SurfaceBuilder<SurfaceBuilderConfig> JUNGLE_MOUNTAIN;
    
    		@SubscribeEvent
    		public static void registerSurfaceBuilders(final RegistryEvent.Register<SurfaceBuilder<?>> event) 
    		{
    			JUNGLE_MOUNTAIN = new JungleMountainSurfaceBuilder(SurfaceBuilderConfig::deserialize);
    			//final IForgeRegistry<SurfaceBuilder<?>> registry = 
    			//System.out.println(JUNGLE_MOUNTAIN);
    
    					event.getRegistry().registerAll(
    				
    		    				JUNGLE_MOUNTAIN.setRegistryName("jungle_mountain_builder")
    	
    			//registry.register();registerBuilder(event.getRegistry(), JUNGLE_MOUNTAIN, "jungle_mountain_builder")
    				);
    		}
    	
    	   
    	private static <T extends SurfaceBuilder<?>> T registerBuilder(final IForgeRegistry<SurfaceBuilder<?>> registry, final T builder, final String builderName) 
    	{
    		if(registry==null)
    		{
    			throw new NullPointerException("Something's gone wrong!");
    		}
    		else
    		{
    			builder.setRegistryName(References.MODID, builderName);
    			//registry.register(builder);
    		}
    
    		return builder;
    	}
    }

    And this is the surface builder class.

    public class JungleMountainSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderConfig> 
    {
       public JungleMountainSurfaceBuilder(Function<Dynamic<?>, ? extends SurfaceBuilderConfig> p_i51310_1_) 
       {
          super(p_i51310_1_);
       }
    
       public void buildSurface(Random random, IChunk chunkIn, Biome biomeIn, int x, int z, int startHeight, double noise, BlockState defaultBlock, BlockState defaultFluid, int seaLevel, long seed, SurfaceBuilderConfig config) 
       {
          if (noise > 3.0D) {
             SurfaceBuilder.DEFAULT.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, SurfaceBuilder.STONE_STONE_GRAVEL_CONFIG);
          } else {
             SurfaceBuilder.DEFAULT.buildSurface(random, chunkIn, biomeIn, x, z, startHeight, noise, defaultBlock, defaultFluid, seaLevel, seed, SurfaceBuilder.GRASS_DIRT_GRAVEL_CONFIG);
          }
    
       }
    }

     

  8. First: In 1.12 there was a hook in GenLayer for the WorldTypeEvent.initBiomeGen. In 1.14 the event still exists, but the hook is absent.

     

    I would request an alternative/additional hook, however, in the IForgeWorldType/WorldType class.So that mods can do exactly what the AddBambooForestLayer is doing – replacing an entire biome within a larger biome region in one go.

        default <T extends IArea, C extends IExtendedNoiseRandom<T>> IAreaFactory<T> getBiomeLayer(IAreaFactory<T> parentLayer,
                OverworldGenSettings chunkSettings, LongFunction<C> contextFactory)
        {
            parentLayer = (new BiomeLayer(getWorldType(), chunkSettings)).apply(contextFactory.apply(200L), parentLayer);
            parentLayer = AddBambooForestLayer.INSTANCE.apply(contextFactory.apply(1001L), parentLayer);
            parentLayer = LayerUtil.repeat(1000L, ZoomLayer.NORMAL, parentLayer, 2, contextFactory);
            parentLayer = EdgeBiomeLayer.INSTANCE.apply(contextFactory.apply(1000L), parentLayer);
            return parentLayer;
        }

    By the time you get to the world type event the biome map has been zoomed and smoothed and the coordinates represent a single chunk, rather than the entire biome. The event requires the use of some sort of noise that will randomly replace part of the biome and the results are not ideal. It also seems that terrain variation has already been handled. Swapping a mountain for a swamp at this point will give you a mountainous swamp, for example.

  9. Ever since I started this mod in 1.7 I have had an optional world type that enabled me to have my jungle biomes spawn within the boundaries of existing jungles. Although it doesn't really affect the mod to not use the world type many people have expressed the desire to have access to the biomes in conjunction with using mods such as biomes o plenty. Recently, I was directed to the mod Buildcraft (1.12) who have their code on github. The link below takes you to the folder where most of the magic occurs. I reproduced this code with only name changes for making sense of it amongst my own mod. 

    BuildCraft

    I've fiddled with the noise scale and threshold number to increase the biome size and frequency, but the result was not desirable. I think the problem is that the world type event is called after magnification of the biome map so that each passed in coordinate represents a single chunk on the map, instead of a full biome as it does during my current world type code, partially reproduced here:

    Spoiler
    
        public int[] getInts(int areaX, int areaY, int areaWidth, int areaHeight)
        {
            int[] aint = this.parent.getInts(areaX, areaY, areaWidth, areaHeight);
            int[] aint1 = IntCache.getIntCache(areaWidth * areaHeight);
    
            for (int i = 0; i < areaHeight; ++i)
            {
                for (int j = 0; j < areaWidth; ++j)
                {
                    this.initChunkSeed((long)(j + areaX), (long)(i + areaY));
                    int k = aint[j + i * areaWidth];
                    int l1 = (k & 3840) >> 8;
                    k &= -3841;
    
                    if (this.settings != null && this.settings.fixedBiome >= 0)
                    {
                        aint1[j + i * areaWidth] = this.settings.fixedBiome;
                    }
                    else if (isBiomeOceanic(k))
                    {
                        aint1[j + i * areaWidth] = k;
                    }
                    else if (k == Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND))
                    {
                        aint1[j + i * areaWidth] = k;
                    }
                    else if (k == 1)
                    {
                        if (l1 > 0)
                        {
                            if (this.nextInt(3) == 0)
                            {
                                aint1[j + i * areaWidth] = Biome.getIdForBiome(Biomes.MESA_CLEAR_ROCK);
                            }
                            else
                            {
                                aint1[j + i * areaWidth] = Biome.getIdForBiome(Biomes.MESA_ROCK);
                            }
                        }
                        else
                        {
                            aint1[j + i * areaWidth] = Biome.getIdForBiome(getWeightedBiomeEntry(BiomeManager.BiomeType.DESERT).biome);
                        }
                    }
                    else if (k == 2)
                    {
                        if (l1 > 0)
                        {
                        	int r = this.nextInt(5);
                        	
                        	if(r == 0) {
                        		
                        		aint1[j + i * areaWidth] = Biome.getIdForBiome(JungleBiomeRegistry.biomeJungleMountain);
                        		
                        		} else
                        			if(r == 4) {
                                		aint1[j + i * areaWidth] = Biome.getIdForBiome(JungleBiomeRegistry.biomeJungleSwamp);
                        			} else {
                        				aint1[j + i * areaWidth] = Biome.getIdForBiome(Biomes.JUNGLE);
                        			}
                        	}
                        else
                        {
                            aint1[j + i * areaWidth] = Biome.getIdForBiome(getWeightedBiomeEntry(BiomeType.WARM).biome);
                        }
                    }
                    else if (k == 3)
                    {
                        if (l1 > 0)
                        {
                            aint1[j + i * areaWidth] = Biome.getIdForBiome(Biomes.REDWOOD_TAIGA);
                        }
                        else
                        {
                            aint1[j + i * areaWidth] = Biome.getIdForBiome(getWeightedBiomeEntry(BiomeType.COOL).biome);
                        }
                    }
                    else if (k == 4)
                    {
                        aint1[j + i * areaWidth] = Biome.getIdForBiome(getWeightedBiomeEntry(BiomeType.ICY).biome);
                    }
                    else
                    {
                        aint1[j + i * areaWidth] = Biome.getIdForBiome(Biomes.MUSHROOM_ISLAND);
                    }
                }
            }
    
            return aint1;
        }

     

    I originally cut out the Buildcraft noise generation check in favour of reproducing the jungle section of the JungleGenLayer I had created. This is where I discovered the issue that the random check is applied for every single X, Z coordinate within a chunk leading to a patchwork of biomes one block in size. 

     

    Edit: I also wanted to note that using the Buildcraft code doesn't seem to affect the actual terrain/landscape. My mountain biome will be flat and my swamp biome will be hilly. None of the values from my biome classes appear to get applied.

     

    1.14
    I'm in the middle of updating from 1.12 to 1.14 and thought I would check back to see what had changed with the above. Although the world type event class still exists the hook for it is no longer in the code, so as of now – even if the above were working – I wouldn't be able to use it.

     

    The ideal solution would seem to be a hook that occurs before any zooming. Anyone got any other suggestions?

  10. Resolved. I took one last look at the code before closing my IDE and I finally found the reference to the scuffler class. It's completely erroneous and should be referencing its own class instead. Please delete this and spare me the shame.

     

    Anyone know what this is about? It doesn't seem to be causing any issues, and only seems to pop up once while roaming around a game world. The second class listed doesn't actually call the first class directly, but they do share a base class where some code is used to prevent them from damaging each other, but I turned it all off and still got the message. The scuffler entity does call the base class, but that code doesn't seem to be running when the message pops up.

    [m[33m[22:43:47] [Server thread/WARN] [minecraft/EntityDataManager]: defineId called for: class com.salvestrom.w2theJungle.mobs.entity.EntityLizardmanScuffler from class com.salvestrom.w2theJungle.mobs.entity.EntityLizardmanWitchDoctor
  11. Additional Breakpoint testing has revealed the issue is centred around this piece of code from the PlayerInteractionManager class. The flag and flag1 if statement is not being passed and so harvest block is not being run.

                   boolean flag1 = blockstate.canHarvestBlock(this.world, pos, this.player);
                   itemstack.onBlockDestroyed(this.world, blockstate, pos, this.player);
                   if (itemstack.isEmpty() && !copy.isEmpty()) {
                      net.minecraftforge.event.ForgeEventFactory.onPlayerDestroyItem(this.player, copy, Hand.MAIN_HAND);
                   }
                   boolean flag = removeBlock(pos, flag1);
                   if (flag && flag1) {
                      ItemStack itemstack1 = itemstack.isEmpty() ? ItemStack.EMPTY : itemstack.copy();
                      block.harvestBlock(this.world, this.player, pos, blockstate, tileentity, itemstack1);
                   }

    Remove block seemed pretty innocuous so I focused on canHarvestBlock. Looking into this led me to realise/discover that my climbing web, since it is using Material.WEB has a requires tool check and swords and shears are hardcoded for the Cobweb block. Quite how this is affecting things, I don't know, but when I changed the material to WOOD which has no tool requirement, the items began dropping correctly.If I want to continue using web as the material am I going to need to use the forge hook for canHarvestBlock? Or is there something else I'm missing…

  12. Update/clarification:
    I set breakpoints on every single getDrops and spawnDrops method in block, as well as getLootTable and spawnAsEntity (simultaneously). I also overrode getLootTable in two of my block classes, using system counts to state that it had arrived at the code as well as display what the result of the super call is. The results were this:

    • During model loading the breakpoints for getLootTable were triggered for every single block, including mine, including the climbing web. This method was triggered again on world load.
    • I broke three blocks: dirt, a random one of mine and climbing web. The first two triggered multiple breakpoints in succession, the climbing web breaking triggered none of it.

    How can the game recognise the loot table while loading yet not even try to drop loot once in game?

    Again I note that my block extends the ladder, but the ladder itself contains nothing unusual. Besides, I have another ladder which doesn't have any issues.

  13. Edit: altered the title to more accurately reflect the problem. Please see four posts down almost up-to-date information.

     

    I set up all of the loot tables for my blocks and discovered one of them is not working. I have tried various versions of the file, Even the most simple table possible had noeffect. The version below is a direct copy paste from vanilla cobweb and hasn't even had the drops altered.

     

    Spoiler
    
    {
      "type": "minecraft:block",
      "pools": [
        {
          "rolls": 1,
          "entries": [
            {
              "type": "minecraft:alternatives",
              "children": [
                {
                  "type": "minecraft:item",
                  "conditions": [
                    {
                      "condition": "minecraft:alternative",
                      "terms": [
                        {
                          "condition": "minecraft:match_tool",
                          "predicate": {
                            "item": "minecraft:shears"
                          }
                        },
                        {
                          "condition": "minecraft:match_tool",
                          "predicate": {
                            "enchantments": [
                              {
                                "enchantment": "minecraft:silk_touch",
                                "levels": {
                                  "min": 1
                                }
                              }
                            ]
                          }
                        }
                      ]
                    }
                  ],
                  "name": "minecraft:cobweb"
                },
                {
                  "type": "minecraft:item",
                  "conditions": [
                    {
                      "condition": "minecraft:survives_explosion"
                    }
                  ],
                  "name": "minecraft:string"
                }
              ]
            }
          ]
        }
      ]
    }

     

    I have used breakpoints on every single piece of code in the block class that references dropping blocks and none of them appear to be triggered. I have been able to verify that the block item is being registered (again, this is one amongst a dozen blocks all being registered in the same way). There are no errors/crashes in the console. Simply, nothing seems to drop. The block item registry name is set by calling the blocks registry name. There doesn't appear to be any other spelling issues. I have got to be missing something very simple.

    Also, the blocks class is an extension of the ladder class, comprised of an override for on entity collision which slows down any entities on the custom block and a redundant override of getitem() and getDrops() which was done to insert a system out (which produced nothing).

  14. 6 hours ago, nil said:

    do you mean setting the model parts rotationPoints and rotationAngles to the parent parts?

                GlStateManager.pushMatrix();
                
                GlStateManager.scale(0.75F, 0.75F, 0.75F);
                GlStateManager.translate(0, 16.0F * scale, 3 * scale);
    
                this.lowerbody.postRender(0.0625F);
                this.upperbody.postRender(0.0625F);
                this.neck.postRender(0.0625F);
    
                this.head1.render(scale);
    
                GlStateManager.popMatrix();
                GlStateManager.pushMatrix();
                GlStateManager.scalef(0.5F, 0.5F, 0.5F);
                GlStateManager.translatef(0.0F, 24.0F * scale, 0.0F);
                this.lowerbody.render(scale); 
                GlStateManager.popMatrix(); 

    The above was being done in the render method of the model class. Note that neck is a child of upperbody which is a child of lower body, but head1 is not a child of the neck.

    Although the head will move as the body rotates, this failed because the animations are scaled up with the size of the head, so the head will move in an exaggerated fashion due to things like breathing animations.

  15. 1 hour ago, -fr0st- said:

    it works as long as i remove event.setDamageMultiplier(0), otherwise it just behaves as before.

    The damage multiplier is used directly on the fall distance, not the damage that you took from falling. Therefore, multiplying it by zero reduces your fall distance to 0. Which, I assume, is setting your Y motion to 0. Afraid I can't help with the space bar issue.

  16. My own experience of this, attempting to create babies with enlarged heads for my custom entities, was that I could call poster render method to "connect" the head to the body without making it a child. It would move correctly as if a child model box, but the animation for the scaled box would also be scaled up so the head would animate in an exaggerated fashion compared to the rest of the body and therefore not be completely in sync. It occurred to me to try scaling the animation, but I never actually tried it.

  17. I have been trying to rule out what it isn't, for example: the code for checking if an entity is being ridden is returning correctly. At the moment my focus is on trying to account for why the husk riding a horse won't move. A skeleton on a spider, spawned from a spider egg functions, but that's because it's not saddled and so it is the spider that is moving, not the rider. Which is another hint of where the problem may lie.

    Is there anyone reading this who has a functioning custom mount with a custom rider that is actually moving correctly so that I can be sure there is something wrong my end.

×
×
  • Create New...

Important Information

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