Jump to content

Recommended Posts

Posted

So... I wanted add a new block to spawn in the nether, but it isn't appearing after an hour of searching and tinkering with the settings, so my conclusion is that either, 1) Directional blocks require extra/different code when spawning as a ore, or 2) I slipped up someone and am too blind to see the mistake.

 

OreGeneration file:

 

package dev.theagameplayer.visionarymod.world;

import dev.theagameplayer.visionarymod.block.VisionaryBlocks;
import dev.theagameplayer.visionarymod.config.OregenConfig;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.GenerationStage.Decoration;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.OreFeatureConfig;
import net.minecraft.world.gen.feature.OreFeatureConfig.FillerBlockType;
import net.minecraft.world.gen.placement.CountRangeConfig;
import net.minecraft.world.gen.placement.Placement;
import net.minecraftforge.registries.ForgeRegistries;

public class OreGeneration {

    public static void setupOreGeneration()
    {
        if(OregenConfig.generate.get())
        {
            for(Biome biome : ForgeRegistries.BIOMES)
            {
                biome.addFeature(Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.ORE, new OreFeatureConfig(FillerBlockType.NETHERRACK, VisionaryBlocks.steamvent.getDefaultState(), OregenConfig.visionary_chance.get()), Placement.COUNT_RANGE, new CountRangeConfig(20, 16, 0, 240)));
                biome.addFeature(Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.ORE, new OreFeatureConfig(FillerBlockType.NETHERRACK, VisionaryBlocks.steamvent2.getDefaultState(), OregenConfig.visionary_chance.get()), Placement.COUNT_RANGE, new CountRangeConfig(20, 16, 0, 240)));
                biome.addFeature(Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature(Feature.ORE, new OreFeatureConfig(FillerBlockType.NETHERRACK, VisionaryBlocks.steamvent3.getDefaultState(), OregenConfig.visionary_chance.get()), Placement.COUNT_RANGE, new CountRangeConfig(20, 16, 0, 240)));
            }
        }
    }
    
}
 

 

 

OregenConfig file:

 

package dev.theagameplayer.visionarymod.config;

 

import net.minecraftforge.common.ForgeConfigSpec;

 

public class OregenConfig

{

public static ForgeConfigSpec.IntValue visionary_chance;

public static ForgeConfigSpec.BooleanValue generate;

 

public static void init(ForgeConfigSpec.Builder server, ForgeConfigSpec.Builder client)

{

server.comment("Oregen Config");

 

visionary_chance = server

.comment("Maximum number of ore veins of the ore that can spawn in one chunk.")

.defineInRange("oregen.visionary_chance", 20, 1, 1000000);

 

generate = server

.comment("Decide if you want Visionary Mod ores to spawn")

.define("oregen.generate", true);

}

 

}

 

 

 

Log:

 

[04Oct2019 13:31:22.182] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmluserdevclient, --fml.mcpVersion, 20190829.143755, --fml.mcVersion, 1.14.4, --fml.forgeGroup, net.minecraftforge, --fml.forgeVersion, 28.1.0, --version, MOD_DEV, --assetIndex, 1.14, --assetsDir, /Users/mmeans/.gradle/caches/forge_gradle/assets, --username, Dev, --accessToken, ❄❄❄❄❄❄❄❄, --userProperties, {}]
[04Oct2019 13:31:22.190] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 3.2.0+60+b86c1d4 starting: java version 1.8.0_222 by AdoptOpenJDK
[04Oct2019 13:31:22.408] [main/INFO] [net.minecraftforge.fml.loading.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust
[04Oct2019 13:31:23.676] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'fmluserdevclient' with arguments [--version, MOD_DEV, --gameDir, ., --assetsDir, /Users/mmeans/.gradle/caches/forge_gradle/assets, --assetIndex, 1.14, --username, Dev, --accessToken, ❄❄❄❄❄❄❄❄, --userProperties, {}]
[04Oct2019 13:31:27.344] [Client thread/INFO] [net.minecraft.client.Minecraft/]: Setting user: Dev
[04Oct2019 13:31:39.005] [Client thread/WARN] [net.minecraft.client.GameSettings/]: Skipping bad option: lastServer:
[04Oct2019 13:31:39.049] [Client thread/INFO] [net.minecraft.client.Minecraft/]: LWJGL Version: 3.2.1 build 12
[04Oct2019 13:31:40.868] [modloading-worker-1/INFO] [net.minecraftforge.common.ForgeMod/FORGEMOD]: Forge mod loading, version 28.1.0, for MC 1.14.4 with MCP 20190829.143755
[04Oct2019 13:31:40.868] [modloading-worker-1/INFO] [net.minecraftforge.common.MinecraftForge/FORGE]: MinecraftForge v28.1.0 Initialized
[04Oct2019 13:31:40.923] [modloading-worker-2/INFO] [dev.theagameplayer.visionarymod.VisionaryMod/]: Loading config: /Users/mmeans/Desktop/Modding/Visionary Mod/run/config/visionarymod-client.toml
[04Oct2019 13:31:40.923] [modloading-worker-2/INFO] [dev.theagameplayer.visionarymod.VisionaryMod/]: Built config: /Users/mmeans/Desktop/Modding/Visionary Mod/run/config/visionarymod-client.toml
[04Oct2019 13:31:40.925] [modloading-worker-2/INFO] [dev.theagameplayer.visionarymod.VisionaryMod/]: Loaded config: /Users/mmeans/Desktop/Modding/Visionary Mod/run/config/visionarymod-client.toml
[04Oct2019 13:31:40.950] [modloading-worker-2/INFO] [dev.theagameplayer.visionarymod.VisionaryMod/]: Loading config: /Users/mmeans/Desktop/Modding/Visionary Mod/run/config/visionarymod-server.toml
[04Oct2019 13:31:40.950] [modloading-worker-2/INFO] [dev.theagameplayer.visionarymod.VisionaryMod/]: Built config: /Users/mattmeans/Desktop/Modding/Visionary Mod/run/config/visionarymod-server.toml
[04Oct2019 13:31:40.951] [modloading-worker-2/INFO] [dev.theagameplayer.visionarymod.VisionaryMod/]: Loaded config: /Users/mmeans/Desktop/Modding/Visionary Mod/run/config/visionarymod-server.toml
[04Oct2019 13:31:46.391] [Realms Notification Availability checker #1/INFO] [com.mojang.realmsclient.client.RealmsClient/]: Could not authorize you against Realms server: Invalid session id
[04Oct2019 13:31:49.529] [modloading-worker-3/INFO] [dev.theagameplayer.visionarymod.VisionaryMod/]: Setup method registered.
[04Oct2019 13:31:49.603] [Forge Version Check/INFO] [net.minecraftforge.fml.VersionChecker/]: [visionarymod] Starting version check at http://myurl.me/
[04Oct2019 13:31:49.604] [modloading-worker-3/INFO] [dev.theagameplayer.visionarymod.VisionaryMod/]: clientRegistries method registered.
[04Oct2019 13:31:50.141] [Forge Version Check/WARN] [net.minecraftforge.fml.VersionChecker/]: Failed to process update information
java.io.IOException: Server returned HTTP response code: 400 for URL: http://myurl.me/
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_222]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_222]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_222]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_222]
    at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1950) ~[?:1.8.0_222]
    at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1945) ~[?:1.8.0_222]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_222]
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1944) ~[?:1.8.0_222]
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1514) ~[?:1.8.0_222]
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498) ~[?:1.8.0_222]
    at net.minecraftforge.fml.VersionChecker$1.openUrlStream(VersionChecker.java:189) ~[?:?]
    at net.minecraftforge.fml.VersionChecker$1.process(VersionChecker.java:206) ~[?:?]
    at java.lang.Iterable.forEach(Iterable.java:75) [?:1.8.0_222]
    at net.minecraftforge.fml.VersionChecker$1.run(VersionChecker.java:157) [?:?]
Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: http://myurl.me/
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900) ~[?:1.8.0_222]
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498) ~[?:1.8.0_222]
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480) ~[?:1.8.0_222]
    at net.minecraftforge.fml.VersionChecker$1.openUrlStream(VersionChecker.java:173) ~[?:?]
    ... 3 more
[04Oct2019 13:31:50.151] [Forge Version Check/INFO] [net.minecraftforge.fml.VersionChecker/]: [forge] Starting version check at https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
[04Oct2019 13:31:50.566] [Forge Version Check/INFO] [net.minecraftforge.fml.VersionChecker/]: [forge] Found status: UP_TO_DATE Current: 28.1.0 Target: null
[04Oct2019 13:31:53.130] [Client thread/WARN] [net.minecraft.client.GameSettings/]: Skipping bad option: lastServer:
[04Oct2019 13:31:53.240] [Client thread/INFO] [net.minecraft.client.audio.SoundSystem/]: OpenAL initialized.
[04Oct2019 13:31:53.242] [Client thread/INFO] [net.minecraft.client.audio.SoundEngine/SOUNDS]: Sound engine started
[04Oct2019 13:31:53.483] [Client thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 512x512 textures-atlas
[04Oct2019 13:31:54.177] [Client thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 256x256 textures/particle-atlas
[04Oct2019 13:31:54.178] [Client thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 256x256 textures/painting-atlas
[04Oct2019 13:31:54.179] [Client thread/INFO] [net.minecraft.client.renderer.texture.AtlasTexture/]: Created: 128x128 textures/mob_effect-atlas
[04Oct2019 13:31:59.528] [Thread-1/FATAL] [net.minecraftforge.common.ForgeConfig/CORE]: Forge config just got changed on the file system!
[04Oct2019 13:32:04.231] [Client thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
[04Oct2019 13:32:04.232] [Client thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[04Oct2019 13:32:04.233] [Client thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
[04Oct2019 13:32:04.234] [Client thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
[04Oct2019 13:32:04.235] [Client thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[04Oct2019 13:32:04.390] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Starting integrated minecraft server version 1.14.4
[04Oct2019 13:32:04.391] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Generating keypair
[04Oct2019 13:32:04.600] [Server thread/INFO] [net.minecraftforge.registries.GameData/REGISTRIES]: Injecting existing registry data into this SERVER instance
[04Oct2019 13:32:04.963] [Server thread/INFO] [net.minecraft.resources.SimpleReloadableResourceManager/]: Reloading ResourceManager: Default, main, forge-1.14.4-28.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar
[04Oct2019 13:32:06.452] [Server thread/INFO] [net.minecraft.item.crafting.RecipeManager/]: Loaded 6 recipes
[04Oct2019 13:32:07.618] [Server thread/INFO] [net.minecraft.advancements.AdvancementList/]: Loaded 811 advancements
[04Oct2019 13:32:08.178] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing start region for dimension minecraft:overworld
[04Oct2019 13:32:09.822] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 0%
[04Oct2019 13:32:09.823] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 0%
[04Oct2019 13:32:09.823] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 0%
[04Oct2019 13:32:09.823] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 0%
[04Oct2019 13:32:10.264] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 59%
[04Oct2019 13:32:12.588] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 83%
[04Oct2019 13:32:12.588] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 83%
[04Oct2019 13:32:12.588] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 83%
[04Oct2019 13:32:12.588] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 83%
[04Oct2019 13:32:12.694] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 91%
[04Oct2019 13:32:13.195] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 91%
[04Oct2019 13:32:13.706] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 91%
[04Oct2019 13:32:14.201] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 93%
[04Oct2019 13:32:14.515] [Thread-1/FATAL] [net.minecraftforge.common.ForgeConfig/CORE]: Forge config just got changed on the file system!
[04Oct2019 13:32:14.710] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 96%
[04Oct2019 13:32:15.003] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Time elapsed: 6816 ms
[04Oct2019 13:32:15.512] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[04Oct2019 13:32:15.512] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved
[04Oct2019 13:32:17.190] [Netty Local Client IO #0/INFO] [net.minecraftforge.fml.network.NetworkHooks/]: Connected to a modded server.
[04Oct2019 13:32:17.560] [Server thread/INFO] [net.minecraft.server.management.PlayerList/]: Dev[local:E:a600e966] logged in with entity id 283 at (86.36256431692296, 45.53584062504456, 63.42653121855847)
[04Oct2019 13:32:17.663] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Dev joined the game
[04Oct2019 13:32:17.860] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Saving and pausing game...
[04Oct2019 13:32:17.870] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'Test World'/minecraft:the_nether
[04Oct2019 13:32:17.891] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'Test World'/minecraft:overworld
[04Oct2019 13:32:18.244] [pool-3-thread-1/WARN] [com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService/]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@29f3946e[id=380df991-f603-344c-a090-369bad2a924a,name=Dev,properties={},legacy=false]
com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time
    at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:79) ~[authlib-1.5.25.jar:?]
    at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:180) ~[authlib-1.5.25.jar:?]
    at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:60) ~[authlib-1.5.25.jar:?]
    at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:57) ~[authlib-1.5.25.jar:?]
    at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3716) ~[guava-21.0.jar:?]
    at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2424) ~[guava-21.0.jar:?]
    at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2298) ~[guava-21.0.jar:?]
    at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2211) ~[guava-21.0.jar:?]
    at com.google.common.cache.LocalCache.get(LocalCache.java:4154) ~[guava-21.0.jar:?]
    at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4158) ~[guava-21.0.jar:?]
    at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5147) ~[guava-21.0.jar:?]
    at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:5153) ~[guava-21.0.jar:?]
    at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:170) ~[authlib-1.5.25.jar:?]
    at net.minecraft.client.Minecraft.getProfileProperties(Minecraft.java:1950) ~[?:?]
    at net.minecraft.client.resources.SkinManager.lambda$loadProfileTextures$1(SkinManager.java:111) ~[?:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_222]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_222]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_222]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_222]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_222]
[04Oct2019 13:32:20.123] [Server thread/WARN] [net.minecraft.server.MinecraftServer/]: Can't keep up! Is the server overloaded? Running 2861ms or 57 ticks behind
[04Oct2019 13:32:20.158] [Server thread/INFO] [net.minecraft.network.play.ServerPlayNetHandler/]: Dev lost connection: Disconnected
[04Oct2019 13:32:20.187] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Dev left the game
[04Oct2019 13:32:20.200] [Server thread/INFO] [net.minecraft.network.play.ServerPlayNetHandler/]: Stopping singleplayer server as player logged out
[04Oct2019 13:32:20.287] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Stopping server
[04Oct2019 13:32:20.288] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving players
[04Oct2019 13:32:20.288] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving worlds
[04Oct2019 13:32:20.288] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'Test World'/minecraft:the_nether
[04Oct2019 13:32:20.384] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[04Oct2019 13:32:20.385] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'Test World'/minecraft:overworld
[04Oct2019 13:32:20.691] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (Test World): All chunks are saved
[04Oct2019 13:32:20.705] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[04Oct2019 13:32:20.706] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (Test World): All chunks are saved
[04Oct2019 13:32:23.444] [Client thread/INFO] [net.minecraft.world.storage.SaveFormat/]: Deleting level Test World
[04Oct2019 13:32:23.445] [Client thread/INFO] [net.minecraft.world.storage.SaveFormat/]: Attempt 1...
[04Oct2019 13:32:34.231] [Client thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
[04Oct2019 13:32:34.232] [Client thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[04Oct2019 13:32:34.233] [Client thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
[04Oct2019 13:32:34.234] [Client thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
[04Oct2019 13:32:34.235] [Client thread/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[04Oct2019 13:32:34.236] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Starting integrated minecraft server version 1.14.4
[04Oct2019 13:32:34.236] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Generating keypair
[04Oct2019 13:32:34.295] [Server thread/WARN] [net.minecraftforge.common.ForgeConfigSpec/CORE]: Configuration file ./saves/Test World/serverconfig/visionarymod-server.toml is not correct. Correcting
[04Oct2019 13:32:34.295] [Server thread/WARN] [net.minecraftforge.common.ForgeConfigSpec/CORE]: Incorrect key oregen was corrected from null to SimpleCommentedConfig:{}
[04Oct2019 13:32:34.296] [Server thread/WARN] [net.minecraftforge.common.ForgeConfigSpec/CORE]: Incorrect key oregen.visionary_chance was corrected from null to 20
[04Oct2019 13:32:34.296] [Server thread/WARN] [net.minecraftforge.common.ForgeConfigSpec/CORE]: Incorrect key oregen.generate was corrected from null to true
[04Oct2019 13:32:34.298] [Server thread/WARN] [net.minecraftforge.common.ForgeConfigSpec/CORE]: Configuration file ./saves/Test World/serverconfig/forge-server.toml is not correct. Correcting
[04Oct2019 13:32:34.299] [Server thread/WARN] [net.minecraftforge.common.ForgeConfigSpec/CORE]: Incorrect key server was corrected from null to SimpleCommentedConfig:{}
[04Oct2019 13:32:34.299] [Server thread/WARN] [net.minecraftforge.common.ForgeConfigSpec/CORE]: Incorrect key server.removeErroringEntities was corrected from null to false
[04Oct2019 13:32:34.299] [Server thread/WARN] [net.minecraftforge.common.ForgeConfigSpec/CORE]: Incorrect key server.removeErroringTileEntities was corrected from null to false
[04Oct2019 13:32:34.299] [Server thread/WARN] [net.minecraftforge.common.ForgeConfigSpec/CORE]: Incorrect key server.fullBoundingBoxLadders was corrected from null to false
[04Oct2019 13:32:34.299] [Server thread/WARN] [net.minecraftforge.common.ForgeConfigSpec/CORE]: Incorrect key server.zombieBaseSummonChance was corrected from null to 0.1
[04Oct2019 13:32:34.299] [Server thread/WARN] [net.minecraftforge.common.ForgeConfigSpec/CORE]: Incorrect key server.zombieBabyChance was corrected from null to 0.05
[04Oct2019 13:32:34.299] [Server thread/WARN] [net.minecraftforge.common.ForgeConfigSpec/CORE]: Incorrect key server.logCascadingWorldGeneration was corrected from null to true
[04Oct2019 13:32:34.299] [Server thread/WARN] [net.minecraftforge.common.ForgeConfigSpec/CORE]: Incorrect key server.fixVanillaCascading was corrected from null to false
[04Oct2019 13:32:34.299] [Server thread/WARN] [net.minecraftforge.common.ForgeConfigSpec/CORE]: Incorrect key server.dimensionUnloadQueueDelay was corrected from null to 0
[04Oct2019 13:32:34.299] [Server thread/WARN] [net.minecraftforge.common.ForgeConfigSpec/CORE]: Incorrect key server.clumpingThreshold was corrected from null to 64
[04Oct2019 13:32:34.299] [Server thread/WARN] [net.minecraftforge.common.ForgeConfigSpec/CORE]: Incorrect key server.treatEmptyTagsAsAir was corrected from null to false
[04Oct2019 13:32:34.310] [Server thread/INFO] [net.minecraftforge.registries.GameData/REGISTRIES]: Injecting existing registry data into this SERVER instance
[04Oct2019 13:32:34.675] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Found new data pack vanilla, loading it automatically
[04Oct2019 13:32:34.676] [Server thread/INFO] [net.minecraft.resources.SimpleReloadableResourceManager/]: Reloading ResourceManager: Default, main, forge-1.14.4-28.1.0_mapped_snapshot_20190719-1.14.3-recomp.jar
[04Oct2019 13:32:35.362] [Server thread/INFO] [net.minecraft.item.crafting.RecipeManager/]: Loaded 6 recipes
[04Oct2019 13:32:35.665] [Server thread/INFO] [net.minecraft.advancements.AdvancementList/]: Loaded 811 advancements
[04Oct2019 13:32:39.158] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Preparing start region for dimension minecraft:overworld
[04Oct2019 13:32:39.237] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 0%
[04Oct2019 13:32:39.665] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 0%
[04Oct2019 13:32:40.177] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 0%
[04Oct2019 13:32:40.673] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 1%
[04Oct2019 13:32:41.194] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 3%
[04Oct2019 13:32:41.675] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 3%
[04Oct2019 13:32:42.189] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 5%
[04Oct2019 13:32:42.668] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 5%
[04Oct2019 13:32:43.177] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 9%
[04Oct2019 13:32:43.687] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 10%
[04Oct2019 13:32:44.169] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 10%
[04Oct2019 13:32:44.299] [Thread-1/FATAL] [net.minecraftforge.common.ForgeConfig/CORE]: Forge config just got changed on the file system!
[04Oct2019 13:32:44.667] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 10%
[04Oct2019 13:32:45.182] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 15%
[04Oct2019 13:32:45.670] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 17%
[04Oct2019 13:32:46.171] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 19%
[04Oct2019 13:32:46.678] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 19%
[04Oct2019 13:32:47.177] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 23%
[04Oct2019 13:32:47.666] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 25%
[04Oct2019 13:32:48.167] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 28%
[04Oct2019 13:32:48.675] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 32%
[04Oct2019 13:32:49.172] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 35%
[04Oct2019 13:32:49.689] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 40%
[04Oct2019 13:32:50.253] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 43%
[04Oct2019 13:32:50.667] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 48%
[04Oct2019 13:32:51.175] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 53%
[04Oct2019 13:32:51.682] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 56%
[04Oct2019 13:32:52.428] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 60%
[04Oct2019 13:32:52.692] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 66%
[04Oct2019 13:32:53.335] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 67%
[04Oct2019 13:32:53.683] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 73%
[04Oct2019 13:32:54.170] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 77%
[04Oct2019 13:32:54.700] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 83%
[04Oct2019 13:32:55.170] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 87%
[04Oct2019 13:32:56.267] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 88%
[04Oct2019 13:32:56.268] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Preparing spawn area: 88%
[04Oct2019 13:32:56.307] [Client thread/INFO] [net.minecraft.world.chunk.listener.LoggingChunkStatusListener/]: Time elapsed: 17141 ms
[04Oct2019 13:32:56.676] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[04Oct2019 13:32:56.676] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved
[04Oct2019 13:32:56.802] [Netty Local Client IO #1/INFO] [net.minecraftforge.fml.network.NetworkHooks/]: Connected to a modded server.
[04Oct2019 13:32:56.810] [Server thread/INFO] [net.minecraft.server.management.PlayerList/]: Dev[local:E:d90c28a3] logged in with entity id 357 at (23.5, 74.0, -155.5)
[04Oct2019 13:32:56.819] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Dev joined the game
[04Oct2019 13:32:57.068] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Saving and pausing game...
[04Oct2019 13:32:57.070] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'Test World'/minecraft:overworld
[04Oct2019 13:32:59.952] [Server thread/WARN] [net.minecraft.server.MinecraftServer/]: Can't keep up! Is the server overloaded? Running 3313ms or 66 ticks behind
[04Oct2019 13:33:00.119] [Client thread/INFO] [net.minecraft.advancements.AdvancementList/]: Loaded 0 advancements
[04Oct2019 13:34:11.601] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Dev has made the advancement [Ice Bucket Challenge]
[04Oct2019 13:34:11.620] [Client thread/INFO] [net.minecraft.client.gui.NewChatGui/]: [CHAT] Dev has made the advancement [Ice Bucket Challenge]
[04Oct2019 13:34:11.620] [Client thread/INFO] [net.minecraft.advancements.AdvancementList/]: Loaded 12 advancements
[04Oct2019 13:34:35.855] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Dev has made the advancement [We Need to Go Deeper]
[04Oct2019 13:34:35.863] [Client thread/INFO] [net.minecraft.client.gui.NewChatGui/]: [CHAT] Dev has made the advancement [We Need to Go Deeper]
[04Oct2019 13:34:35.913] [Server thread/WARN] [net.minecraft.server.MinecraftServer/]: Can't keep up! Is the server overloaded? Running 6873ms or 137 ticks behind
[04Oct2019 13:34:35.984] [Client thread/INFO] [net.minecraft.advancements.AdvancementList/]: Loaded 20 advancements
[04Oct2019 13:35:29.591] [Server thread/INFO] [net.minecraft.server.integrated.IntegratedServer/]: Saving and pausing game...
[04Oct2019 13:35:29.597] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'Test World'/minecraft:the_nether
[04Oct2019 13:35:31.374] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'Test World'/minecraft:overworld
[04Oct2019 13:35:33.171] [Server thread/WARN] [net.minecraft.server.MinecraftServer/]: Can't keep up! Is the server overloaded? Running 3530ms or 70 ticks behind
[04Oct2019 13:35:33.177] [Server thread/INFO] [net.minecraft.network.play.ServerPlayNetHandler/]: Dev lost connection: Disconnected
[04Oct2019 13:35:33.178] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Dev left the game
[04Oct2019 13:35:33.185] [Server thread/INFO] [net.minecraft.network.play.ServerPlayNetHandler/]: Stopping singleplayer server as player logged out
[04Oct2019 13:35:33.235] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Stopping server
[04Oct2019 13:35:33.235] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving players
[04Oct2019 13:35:33.235] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving worlds
[04Oct2019 13:35:33.235] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'Test World'/minecraft:the_nether
[04Oct2019 13:35:33.501] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[04Oct2019 13:35:33.502] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving chunks for level 'Test World'/minecraft:overworld
[04Oct2019 13:35:33.930] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (Test World): All chunks are saved
[04Oct2019 13:35:33.941] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[04Oct2019 13:35:33.943] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (Test World): All chunks are saved
[04Oct2019 13:35:35.246] [Client thread/INFO] [net.minecraft.client.Minecraft/]: Stopping!
 

Posted
17 minutes ago, A-Game said:

public static void setupOreGeneration()

Where do you call this method? And where do you setup your config file? Is it being loaded properly?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

Under my main mod file:

 

package dev.theagameplayer.visionarymod;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import dev.theagameplayer.visionarymod.config.Config;
import dev.theagameplayer.visionarymod.proxy.ClientProxy;
import dev.theagameplayer.visionarymod.proxy.ServerProxy;
import dev.theagameplayer.visionarymod.world.OreGeneration;
import dev.theagameplayer.visionarymod.proxy.IProxy;
import net.minecraft.item.ItemGroup;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLDedicatedServerSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.loading.FMLPaths;

@Mod("visionarymod")
public class VisionaryMod {
    
    public static final Logger LOGGER = LogManager.getLogger();
    
    public static final IProxy PROXY = DistExecutor.runForDist(() -> ClientProxy::new, () -> ServerProxy::new);
    
    public static final ItemGroup visionary = new VisionaryItemGroup();
    
    public VisionaryMod() {
        
        ModLoadingContext.get().registerConfig(ModConfig.Type.SERVER, Config.SERVER, "visionarymod-server.toml");
        ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, Config.CLIENT, "visionarymod-client.toml");
        
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::commonSetup);
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientSetup);
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::serverSetup);
        
        Config.loadConfig(Config.CLIENT, FMLPaths.CONFIGDIR.get().resolve("visionarymod-client.toml").toString());
        Config.loadConfig(Config.SERVER, FMLPaths.CONFIGDIR.get().resolve("visionarymod-server.toml").toString());
        
        MinecraftForge.EVENT_BUS.register(this);
    }
    
    private void commonSetup(final FMLCommonSetupEvent event) {
        OreGeneration.setupOreGeneration();
        LOGGER.info("Setup method registered.");
    }
    
    private void clientSetup(final FMLClientSetupEvent event) {
        LOGGER.info("clientRegistries method registered.");
    }
    
    private void serverSetup(final FMLDedicatedServerSetupEvent event) {
        LOGGER.info("serverRegistries method registered.");
    }

}
 

Posted
3 minutes ago, A-Game said:

Under my main mod file:

What about?

28 minutes ago, Animefan8888 said:

Is it being loaded properly?

Use the debugger or println statements.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
3 minutes ago, A-Game said:

It is not being loaded at all it seems...

Your config is not setup properly then. Post all the code relating to your config file.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted (edited)
1 hour ago, A-Game said:

package dev.theagameplayer.visionarymod.config;

 

import net.minecraftforge.common.ForgeConfigSpec;

 

public class OregenConfig

{

public static ForgeConfigSpec.IntValue visionary_chance;

public static ForgeConfigSpec.BooleanValue generate;

 

public static void init(ForgeConfigSpec.Builder server, ForgeConfigSpec.Builder client)

{

server.comment("Oregen Config");

 

visionary_chance = server

.comment("Maximum number of ore veins of the ore that can spawn in one chunk.")

.defineInRange("oregen.visionary_chance", 20, 1, 1000000);

 

generate = server

.comment("Decide if you want Visionary Mod ores to spawn")

.define("oregen.generate", true);

}

 

}

 

 

 

I did use the same config for all 3 versions of the ore temporarily to see if I could get it to spawn first.

Edited by A-Game
Posted
30 minutes ago, A-Game said:

    public VisionaryMod() {
        
        ModLoadingContext.get().registerConfig(ModConfig.Type.SERVER, Config.SERVER, "visionarymod-server.toml");
        ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, Config.CLIENT, "visionarymod-client.toml");
        
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::commonSetup);
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientSetup);
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::serverSetup);
        
        Config.loadConfig(Config.CLIENT, FMLPaths.CONFIGDIR.get().resolve("visionarymod-client.toml").toString());
        Config.loadConfig(Config.SERVER, FMLPaths.CONFIGDIR.get().resolve("visionarymod-server.toml").toString());

None of this ever references your OreGenConfig class or potentially an instance of it so I don't know how you expect it to be loaded.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

That was my Oregon config file, this is the main config file:

 

package dev.theagameplayer.visionarymod.config;

import java.io.File;

import com.electronwill.nightconfig.core.file.CommentedFileConfig;
import com.electronwill.nightconfig.core.io.WritingMode;

import dev.theagameplayer.visionarymod.VisionaryMod;
import net.minecraftforge.common.ForgeConfigSpec;
import net.minecraftforge.fml.common.Mod;

@Mod.EventBusSubscriber
public class Config 
{
    private static final ForgeConfigSpec.Builder SERVER_BUILDER = new ForgeConfigSpec.Builder();
    public static final ForgeConfigSpec SERVER;
    private static final ForgeConfigSpec.Builder CLIENT_BUILDER = new ForgeConfigSpec.Builder();
    public static final ForgeConfigSpec CLIENT;
    
    static
    {
        OregenConfig.init(SERVER_BUILDER, CLIENT_BUILDER);
        
        SERVER = SERVER_BUILDER.build();
        CLIENT = CLIENT_BUILDER.build();
    }
    
    public static void loadConfig(ForgeConfigSpec config, String path)
    {
        VisionaryMod.LOGGER.info("Loading config: " + path);
        final CommentedFileConfig file = CommentedFileConfig.builder(new File(path)).sync().autosave().writingMode(WritingMode.REPLACE).build();
        VisionaryMod.LOGGER.info("Built config: " + path);
        file.load();
        VisionaryMod.LOGGER.info("Loaded config: " + path);
        config.setConfig(file);
    }

}
 

Posted
1 hour ago, A-Game said:

OregenConfig.init(SERVER_BUILDER, CLIENT_BUILDER);

Wouldn't this reference the Oregen config file when the main mod file calls the config file to be loaded?

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

    • Version 1.19 - Forge 41.0.63 I want to create a wolf entity that I can ride, so far it seems to be working, but the problem is that when I get on the wolf, I can’t control it. I then discovered that the issue is that the server doesn’t detect that I’m riding the wolf, so I’m struggling with synchronization. However, it seems to not be working properly. As I understand it, the server receives the packet but doesn’t register it correctly. I’m a bit new to Java, and I’ll try to provide all the relevant code and prints *The comments and prints are translated by chatgpt since they were originally in Spanish* Thank you very much in advance No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. No player is mounted, or the passenger is not a player. MountableWolfEntity package com.vals.valscraft.entity; import com.vals.valscraft.network.MountSyncPacket; import com.vals.valscraft.network.NetworkHandler; import net.minecraft.client.Minecraft; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.animal.Wolf; import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.Entity; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; import net.minecraftforge.event.TickEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.network.PacketDistributor; public class MountableWolfEntity extends Wolf { private boolean hasSaddle; private static final EntityDataAccessor<Byte> DATA_ID_FLAGS = SynchedEntityData.defineId(MountableWolfEntity.class, EntityDataSerializers.BYTE); public MountableWolfEntity(EntityType<? extends Wolf> type, Level level) { super(type, level); this.hasSaddle = false; } @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(DATA_ID_FLAGS, (byte)0); } public static AttributeSupplier.Builder createAttributes() { return Wolf.createAttributes() .add(Attributes.MAX_HEALTH, 20.0) .add(Attributes.MOVEMENT_SPEED, 0.3); } @Override public InteractionResult mobInteract(Player player, InteractionHand hand) { ItemStack itemstack = player.getItemInHand(hand); if (itemstack.getItem() == Items.SADDLE && !this.hasSaddle()) { if (!player.isCreative()) { itemstack.shrink(1); } this.setSaddle(true); return InteractionResult.SUCCESS; } else if (!level.isClientSide && this.hasSaddle()) { player.startRiding(this); MountSyncPacket packet = new MountSyncPacket(true); // 'true' means the player is mounted NetworkHandler.CHANNEL.sendToServer(packet); // Ensure the server handles the packet return InteractionResult.SUCCESS; } return InteractionResult.PASS; } @Override public void travel(Vec3 travelVector) { if (this.isVehicle() && this.getControllingPassenger() instanceof Player) { System.out.println("The wolf has a passenger."); System.out.println("The passenger is a player."); Player player = (Player) this.getControllingPassenger(); // Ensure the player is the controller this.setYRot(player.getYRot()); this.yRotO = this.getYRot(); this.setXRot(player.getXRot() * 0.5F); this.setRot(this.getYRot(), this.getXRot()); this.yBodyRot = this.getYRot(); this.yHeadRot = this.yBodyRot; float forward = player.zza; float strafe = player.xxa; if (forward <= 0.0F) { forward *= 0.25F; } this.flyingSpeed = this.getSpeed() * 0.1F; this.setSpeed((float) this.getAttributeValue(Attributes.MOVEMENT_SPEED) * 1.5F); this.setDeltaMovement(new Vec3(strafe, travelVector.y, forward).scale(this.getSpeed())); this.calculateEntityAnimation(this, false); } else { // The wolf does not have a passenger or the passenger is not a player System.out.println("No player is mounted, or the passenger is not a player."); super.travel(travelVector); } } public boolean hasSaddle() { return this.hasSaddle; } public void setSaddle(boolean hasSaddle) { this.hasSaddle = hasSaddle; } @Override protected void dropEquipment() { super.dropEquipment(); if (this.hasSaddle()) { this.spawnAtLocation(Items.SADDLE); this.setSaddle(false); } } @SubscribeEvent public static void onServerTick(TickEvent.ServerTickEvent event) { if (event.phase == TickEvent.Phase.START) { MinecraftServer server = net.minecraftforge.server.ServerLifecycleHooks.getCurrentServer(); if (server != null) { for (ServerPlayer player : server.getPlayerList().getPlayers()) { if (player.isPassenger() && player.getVehicle() instanceof MountableWolfEntity) { MountableWolfEntity wolf = (MountableWolfEntity) player.getVehicle(); System.out.println("Tick: " + player.getName().getString() + " is correctly mounted on " + wolf); } } } } } private boolean lastMountedState = false; @Override public void tick() { super.tick(); if (!this.level.isClientSide) { // Only on the server boolean isMounted = this.isVehicle() && this.getControllingPassenger() instanceof Player; // Only print if the state changed if (isMounted != lastMountedState) { if (isMounted) { Player player = (Player) this.getControllingPassenger(); // Verify the passenger is a player System.out.println("Server: Player " + player.getName().getString() + " is now mounted."); } else { System.out.println("Server: The wolf no longer has a passenger."); } lastMountedState = isMounted; } } } @Override public void addPassenger(Entity passenger) { super.addPassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(true)); } } } @Override public void removePassenger(Entity passenger) { super.removePassenger(passenger); if (passenger instanceof Player) { Player player = (Player) passenger; if (!this.level.isClientSide && player instanceof ServerPlayer) { // Send the packet to the server to indicate the player is no longer mounted NetworkHandler.CHANNEL.send(PacketDistributor.PLAYER.with(() -> (ServerPlayer) player), new MountSyncPacket(false)); } } } @Override public boolean isControlledByLocalInstance() { Entity entity = this.getControllingPassenger(); return entity instanceof Player; } @Override public void positionRider(Entity passenger) { if (this.hasPassenger(passenger)) { double xOffset = Math.cos(Math.toRadians(this.getYRot() + 90)) * 0.4; double zOffset = Math.sin(Math.toRadians(this.getYRot() + 90)) * 0.4; passenger.setPos(this.getX() + xOffset, this.getY() + this.getPassengersRidingOffset() + passenger.getMyRidingOffset(), this.getZ() + zOffset); } } } MountSyncPacket package com.vals.valscraft.network; import com.vals.valscraft.entity.MountableWolfEntity; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class MountSyncPacket { private final boolean isMounted; public MountSyncPacket(boolean isMounted) { this.isMounted = isMounted; } public void encode(FriendlyByteBuf buffer) { buffer.writeBoolean(isMounted); } public static MountSyncPacket decode(FriendlyByteBuf buffer) { return new MountSyncPacket(buffer.readBoolean()); } public void handle(NetworkEvent.Context context) { context.enqueueWork(() -> { ServerPlayer player = context.getSender(); // Get the player from the context if (player != null) { // Verifies if the player has dismounted if (!isMounted) { Entity vehicle = player.getVehicle(); if (vehicle instanceof MountableWolfEntity wolf) { // Logic to remove the player as a passenger wolf.removePassenger(player); System.out.println("Server: Player " + player.getName().getString() + " is no longer mounted."); } } } }); context.setPacketHandled(true); // Marks the packet as handled } } networkHandler package com.vals.valscraft.network; import com.vals.valscraft.valscraft; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.network.NetworkRegistry; import net.minecraftforge.network.simple.SimpleChannel; import net.minecraftforge.network.NetworkEvent; import java.util.function.Supplier; public class NetworkHandler { private static final String PROTOCOL_VERSION = "1"; public static final SimpleChannel CHANNEL = NetworkRegistry.newSimpleChannel( new ResourceLocation(valscraft.MODID, "main"), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals ); public static void init() { int packetId = 0; // Register the mount synchronization packet CHANNEL.registerMessage( packetId++, MountSyncPacket.class, MountSyncPacket::encode, MountSyncPacket::decode, (msg, context) -> msg.handle(context.get()) // Get the context with context.get() ); } }  
    • Do you use features of inventory profiles next (ipnext) or is there a change without it?
    • Remove rubidium - you are already using embeddium, which is a fork of rubidium
  • Topics

×
×
  • Create New...

Important Information

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