Jump to content

Recommended Posts

Posted

hello, I searched where is this structure in a mod bu i didn't found so please help 
code :

"FireTowerStructure.class"

package net.mcreator.test.world.structure; import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.WorldGenRegistries; import net.minecraft.world.gen.placement.IPlacementConfig; import net.minecraft.world.gen.placement.Placement; import net.minecraft.world.gen.feature.IFeatureConfig; import net.minecraft.world.gen.feature.template.Template; import net.minecraft.util.RegistryKey; import net.minecraft.world.IServerWorld; import net.minecraft.util.math.ChunkPos; import net.minecraft.world.gen.feature.template.StructureProcessor; import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; import net.minecraft.world.gen.feature.template.PlacementSettings; import net.minecraft.util.ResourceLocation; import net.minecraft.util.Mirror; import net.minecraft.util.Rotation; import net.minecraft.world.gen.Heightmap; import net.minecraft.world.World; import net.minecraft.util.math.BlockPos; import java.util.Random; import net.minecraft.world.gen.ChunkGenerator; import net.minecraft.world.ISeedReader; import com.mojang.serialization.Codec; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraft.world.gen.GenerationStage; import net.minecraftforge.event.world.BiomeLoadingEvent; import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.NoFeatureConfig; import net.minecraft.world.gen.feature.Feature; import net.minecraftforge.fml.common.Mod; @Mod.EventBusSubscriber public class FireTowerStructure { private static Feature<NoFeatureConfig> feature; private static ConfiguredFeature<?, ?> configuredFeature; @SubscribeEvent public static void addFeatureToBiomes(final BiomeLoadingEvent event) { event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> FireTowerStructure.configuredFeature); } static { FireTowerStructure.feature = null; FireTowerStructure.configuredFeature = null; } @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) private static class FeatureRegisterHandler { @SubscribeEvent public static void registerFeature(final RegistryEvent.Register<Feature<?>> event) { FireTowerStructure.feature = new Feature<NoFeatureConfig>(NoFeatureConfig.field_236558_a_) { public boolean generate(final ISeedReader world, final ChunkGenerator generator, final Random random, final BlockPos pos, final NoFeatureConfig config) { final int ci = pos.func_177958_n() >> 4 << 4; final int ck = pos.func_177952_p() >> 4 << 4; final RegistryKey<World> dimensionType = (RegistryKey<World>)world.func_201672_e().func_234923_W_(); boolean dimensionCriteria = false; if (dimensionType == World.field_234919_h_) { dimensionCriteria = true; } if (!dimensionCriteria) { return false; } if (random.nextInt(1000000) + 1 <= 3000) { for (int count = random.nextInt(1) + 1, a = 0; a < count; ++a) { final int i = ci + random.nextInt(16); final int k = ck + random.nextInt(16); int j = world.func_201676_a(Heightmap.Type.OCEAN_FLOOR_WG, i, k); --j; final Rotation rotation = Rotation.values()[random.nextInt(3)]; final Mirror mirror = Mirror.values()[random.nextInt(2)]; final BlockPos spawnTo = new BlockPos(i + 0, j + 0, k + 0); final int x = spawnTo.func_177958_n(); final int y = spawnTo.func_177956_o(); final int z = spawnTo.func_177952_p(); final Template template = world.func_201672_e().func_184163_y().func_200220_a(new ResourceLocation("mushoku", "firetower")); if (template == null) { return false; } template.func_237144_a_((IServerWorld)world, spawnTo, new PlacementSettings().func_186220_a(rotation).func_189950_a(random).func_186214_a(mirror).func_215222_a((StructureProcessor)BlockIgnoreStructureProcessor.field_215206_c).func_186218_a((ChunkPos)null).func_186222_a(false), random); } } return true; } }; FireTowerStructure.configuredFeature = (ConfiguredFeature<?, ?>)FireTowerStructure.feature.func_225566_b_((IFeatureConfig)IFeatureConfig.field_202429_e).func_227228_a_(Placement.field_215022_h.func_227446_a_((IPlacementConfig)IPlacementConfig.field_202468_e)); event.getRegistry().register(FireTowerStructure.feature.setRegistryName("fire_tower")); Registry.func_218322_a(WorldGenRegistries.field_243653_e, new ResourceLocation("mushoku:fire_tower"), (Object)FireTowerStructure.configuredFeature); } } }

 

"FireTowerStructure$FeatureRegisterHandler.class"

ackage net.mcreator.test.world.structure; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.WorldGenRegistries; import net.minecraft.world.gen.placement.IPlacementConfig; import net.minecraft.world.gen.placement.Placement; import net.minecraft.world.gen.feature.IFeatureConfig; import net.minecraft.world.gen.feature.template.Template; import net.minecraft.util.RegistryKey; import net.minecraft.world.IServerWorld; import net.minecraft.util.math.ChunkPos; import net.minecraft.world.gen.feature.template.StructureProcessor; import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; import net.minecraft.world.gen.feature.template.PlacementSettings; import net.minecraft.util.ResourceLocation; import net.minecraft.util.Mirror; import net.minecraft.util.Rotation; import net.minecraft.world.gen.Heightmap; import net.minecraft.world.World; import net.minecraft.util.math.BlockPos; import java.util.Random; import net.minecraft.world.gen.ChunkGenerator; import net.minecraft.world.ISeedReader; import com.mojang.serialization.Codec; import net.minecraft.world.gen.feature.NoFeatureConfig; import net.minecraft.world.gen.feature.Feature; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.fml.common.Mod; @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) private static class FeatureRegisterHandler { @SubscribeEvent public static void registerFeature(final RegistryEvent.Register<Feature<?>> event) { FireTowerStructure.access$002(new Feature<NoFeatureConfig>(NoFeatureConfig.field_236558_a_) { public boolean generate(final ISeedReader world, final ChunkGenerator generator, final Random random, final BlockPos pos, final NoFeatureConfig config) { final int ci = pos.func_177958_n() >> 4 << 4; final int ck = pos.func_177952_p() >> 4 << 4; final RegistryKey<World> dimensionType = (RegistryKey<World>)world.func_201672_e().func_234923_W_(); boolean dimensionCriteria = false; if (dimensionType == World.field_234919_h_) { dimensionCriteria = true; } if (!dimensionCriteria) { return false; } if (random.nextInt(1000000) + 1 <= 3000) { for (int count = random.nextInt(1) + 1, a = 0; a < count; ++a) { final int i = ci + random.nextInt(16); final int k = ck + random.nextInt(16); int j = world.func_201676_a(Heightmap.Type.OCEAN_FLOOR_WG, i, k); --j; final Rotation rotation = Rotation.values()[random.nextInt(3)]; final Mirror mirror = Mirror.values()[random.nextInt(2)]; final BlockPos spawnTo = new BlockPos(i + 0, j + 0, k + 0); final int x = spawnTo.func_177958_n(); final int y = spawnTo.func_177956_o(); final int z = spawnTo.func_177952_p(); final Template template = world.func_201672_e().func_184163_y().func_200220_a(new ResourceLocation("mushoku", "firetower")); if (template == null) { return false; } template.func_237144_a_((IServerWorld)world, spawnTo, new PlacementSettings().func_186220_a(rotation).func_189950_a(random).func_186214_a(mirror).func_215222_a((StructureProcessor)BlockIgnoreStructureProcessor.field_215206_c).func_186218_a((ChunkPos)null).func_186222_a(false), random); } } return true; } }); FireTowerStructure.access$102(FireTowerStructure.access$000().func_225566_b_((IFeatureConfig)IFeatureConfig.field_202429_e).func_227228_a_(Placement.field_215022_h.func_227446_a_((IPlacementConfig)IPlacementConfig.field_202468_e))); event.getRegistry().register(FireTowerStructure.access$000().setRegistryName("fire_tower")); Registry.func_218322_a(WorldGenRegistries.field_243653_e, new ResourceLocation("mushoku:fire_tower"), (Object)FireTowerStructure.access$100()); } }

 

"FireTowerStructure$FeatureRegisterHandler$1.class"

package net.mcreator.test.world.structure; import net.minecraft.world.gen.feature.IFeatureConfig; import net.minecraft.world.gen.feature.template.Template; import net.minecraft.util.RegistryKey; import net.minecraft.world.IServerWorld; import net.minecraft.util.math.ChunkPos; import net.minecraft.world.gen.feature.template.StructureProcessor; import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor; import net.minecraft.world.gen.feature.template.PlacementSettings; import net.minecraft.util.ResourceLocation; import net.minecraft.util.Mirror; import net.minecraft.util.Rotation; import net.minecraft.world.gen.Heightmap; import net.minecraft.world.World; import net.minecraft.util.math.BlockPos; import java.util.Random; import net.minecraft.world.gen.ChunkGenerator; import net.minecraft.world.ISeedReader; import com.mojang.serialization.Codec; import net.minecraft.world.gen.feature.NoFeatureConfig; import net.minecraft.world.gen.feature.Feature; static final class FireTowerStructure$FeatureRegisterHandler$1 extends Feature<NoFeatureConfig> { public boolean generate(final ISeedReader world, final ChunkGenerator generator, final Random random, final BlockPos pos, final NoFeatureConfig config) { final int ci = pos.func_177958_n() >> 4 << 4; final int ck = pos.func_177952_p() >> 4 << 4; final RegistryKey<World> dimensionType = (RegistryKey<World>)world.func_201672_e().func_234923_W_(); boolean dimensionCriteria = false; if (dimensionType == World.field_234919_h_) { dimensionCriteria = true; } if (!dimensionCriteria) { return false; } if (random.nextInt(1000000) + 1 <= 3000) { for (int count = random.nextInt(1) + 1, a = 0; a < count; ++a) { final int i = ci + random.nextInt(16); final int k = ck + random.nextInt(16); int j = world.func_201676_a(Heightmap.Type.OCEAN_FLOOR_WG, i, k); --j; final Rotation rotation = Rotation.values()[random.nextInt(3)]; final Mirror mirror = Mirror.values()[random.nextInt(2)]; final BlockPos spawnTo = new BlockPos(i + 0, j + 0, k + 0); final int x = spawnTo.func_177958_n(); final int y = spawnTo.func_177956_o(); final int z = spawnTo.func_177952_p(); final Template template = world.func_201672_e().func_184163_y().func_200220_a(new ResourceLocation("mushoku", "firetower")); if (template == null) { return false; } template.func_237144_a_((IServerWorld)world, spawnTo, new PlacementSettings().func_186220_a(rotation).func_189950_a(random).func_186214_a(mirror).func_215222_a((StructureProcessor)BlockIgnoreStructureProcessor.field_215206_c).func_186218_a((ChunkPos)null).func_186222_a(false), random); } } return true; } }





I think this line can maybe help you:

World.field_234919_h_

thanks

Posted

Could you please provide a bit more information, why do you search for the structure, what did you try to achieve?

Also plese post the code in a more readable formate, use the code feature of the forum or use a past side.

Posted

I search were it can spawn (biome/dimension) cause the creator of the mod don't tell where it spawn and "/locate" doesn't work

Code (more readable) :

"FireTowerStructure.class"

 

package net.mcreator.test.world.structure;

import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraft.world.gen.GenerationStage;
import net.minecraftforge.event.world.BiomeLoadingEvent;
import net.minecraft.world.gen.feature.ConfiguredFeature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import net.minecraft.world.gen.feature.Feature;
import net.minecraftforge.fml.common.Mod;

@Mod.EventBusSubscriber
public class FireTowerStructure
{
    private static Feature<NoFeatureConfig> feature;
    private static ConfiguredFeature<?, ?> configuredFeature;
    
    @SubscribeEvent
    public static void addFeatureToBiomes(final BiomeLoadingEvent event) {
        event.getGeneration().getFeatures(GenerationStage.Decoration.SURFACE_STRUCTURES).add(() -> FireTowerStructure.configuredFeature);
    }
    
    static {
        FireTowerStructure.feature = null;
        FireTowerStructure.configuredFeature = null;
    }
}

"FireTowerStructure$FeatureRegisterHandler.class"

 

package net.mcreator.test.world.structure;

import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.registry.WorldGenRegistries;
import net.minecraft.world.gen.placement.IPlacementConfig;
import net.minecraft.world.gen.placement.Placement;
import net.minecraft.world.gen.feature.IFeatureConfig;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import net.minecraft.world.gen.feature.Feature;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod;

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
private static class FeatureRegisterHandler
{
    @SubscribeEvent
    public static void registerFeature(final RegistryEvent.Register<Feature<?>> event) {
        FireTowerStructure.access$002((Feature)new FeatureRegisterHandler.FireTowerStructure$FeatureRegisterHandler$1(NoFeatureConfig.field_236558_a_));
        FireTowerStructure.access$102(FireTowerStructure.access$000().func_225566_b_((IFeatureConfig)IFeatureConfig.field_202429_e).func_227228_a_(Placement.field_215022_h.func_227446_a_((IPlacementConfig)IPlacementConfig.field_202468_e)));
        event.getRegistry().register(FireTowerStructure.access$000().setRegistryName("fire_tower"));
        Registry.func_218322_a(WorldGenRegistries.field_243653_e, new ResourceLocation("mushoku:fire_tower"), (Object)FireTowerStructure.access$100());
    }
}

"FireTowerStructure$FeatureRegisterHandler$1.class"

 

package net.mcreator.test.world.structure;

import net.minecraft.world.gen.feature.IFeatureConfig;
import net.minecraft.world.gen.feature.template.Template;
import net.minecraft.util.RegistryKey;
import net.minecraft.world.IServerWorld;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.gen.feature.template.StructureProcessor;
import net.minecraft.world.gen.feature.template.BlockIgnoreStructureProcessor;
import net.minecraft.world.gen.feature.template.PlacementSettings;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Mirror;
import net.minecraft.util.Rotation;
import net.minecraft.world.gen.Heightmap;
import net.minecraft.world.World;
import net.minecraft.util.math.BlockPos;
import java.util.Random;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.ISeedReader;
import com.mojang.serialization.Codec;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import net.minecraft.world.gen.feature.Feature;

static final class FireTowerStructure$FeatureRegisterHandler$1 extends Feature<NoFeatureConfig> {
    public boolean generate(final ISeedReader world, final ChunkGenerator generator, final Random random, final BlockPos pos, final NoFeatureConfig config) {
        final int ci = pos.func_177958_n() >> 4 << 4;
        final int ck = pos.func_177952_p() >> 4 << 4;
        final RegistryKey<World> dimensionType = (RegistryKey<World>)world.func_201672_e().func_234923_W_();
        boolean dimensionCriteria = false;
        if (dimensionType == World.field_234919_h_) {
            dimensionCriteria = true;
        }
        if (!dimensionCriteria) {
            return false;
        }
        if (random.nextInt(1000000) + 1 <= 3000) {
            for (int count = random.nextInt(1) + 1, a = 0; a < count; ++a) {
                final int i = ci + random.nextInt(16);
                final int k = ck + random.nextInt(16);
                int j = world.func_201676_a(Heightmap.Type.OCEAN_FLOOR_WG, i, k);
                --j;
                final Rotation rotation = Rotation.values()[random.nextInt(3)];
                final Mirror mirror = Mirror.values()[random.nextInt(2)];
                final BlockPos spawnTo = new BlockPos(i + 0, j + 0, k + 0);
                final int x = spawnTo.func_177958_n();
                final int y = spawnTo.func_177956_o();
                final int z = spawnTo.func_177952_p();
                final Template template = world.func_201672_e().func_184163_y().func_200220_a(new ResourceLocation("mushoku", "firetower"));
                if (template == null) {
                    return false;
                }
                template.func_237144_a_((IServerWorld)world, spawnTo, new PlacementSettings().func_186220_a(rotation).func_189950_a(random).func_186214_a(mirror).func_215222_a((StructureProcessor)BlockIgnoreStructureProcessor.field_215206_c).func_186218_a((ChunkPos)null).func_186222_a(false), random);
            }
        }
        return true;
    }
}

 

Posted
On 11/4/2023 at 11:07 PM, pixelrestrike said:

I'm deconpiling this mod cause I search where spawn the structure and I think it work cause other structure spawn

As Finn already told you the Mod is made by Mcreator its a mode maker for Minecraft (which is not recommend to use).

It looks like there is a 1000/3 chance that the structure is generated in a chunk.

I would recommend removing the mod and replacing it with a similar mod from Curseforge.

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

    • So i have a forge modded aternos server that worked just fine for a month untill today it suddenly crashes most of the time giving errors and idk which mod is causing the error or its smth else here is the crash log link https://mclo.gs/gGkzGKT
    • Struggling to decipher a crash report I'm getting in a custom modpack I'm tinkering with. The crash happens on startup, but weirdly, only some of the time. It seems to be related to Steves Carts, but weirdly it only started happening recently, and I can't identify if another mod is conflicting, or why it is only happening some of the time:   java.lang.NullPointerException: Cannot invoke "net.minecraft.world.entity.player.Player.m_20202_()" because "player" is null at vswe.stevescarts.events.OverlayEventHandler.onRenderTick(OverlayEventHandler.java:24) ~[stevescarts-1.20.1-1.1.14.jar%23527!/:1.20.1-1.1.14] {re:classloading} at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:260) ~[eventbus-6.0.5.jar%23127!/:?] {} at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:252) ~[eventbus-6.0.5.jar%23127!/:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%23127!/:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%23127!/:?] {} at net.minecraftforge.event.ForgeEventFactory.onRenderTickEnd(ForgeEventFactory.java:919) ~[forge-1.20.1-47.1.106-universal.jar%23581!/:?] {re:mixin,re:classloading,pl:mixin:APP:modernfix-forge.mixins.json:perf.potential_spawns_alloc.ForgeEventFactoryMixin,pl:mixin:A} at net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1148) ~[client-1.20.1-20230612.114412-srg.jar%23576!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick_render_call,xf:fml:xaerominimap:xaero_minecraftclient,xf:fml:xaeroworldmap:xaero_wm_minecraftclient,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick_render_call,xf:fml:xaerominimap:xaero_minecraftclient,xf:fml:xaeroworldmap:xaero_wm_minecraftclient,pl:mixin:A,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.m_91374_(Minecraft.java:718) ~[client-1.20.1-20230612.114412-srg.jar%23576!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick_render_call,xf:fml:xaerominimap:xaero_minecraftclient,xf:fml:xaeroworldmap:xaero_wm_minecraftclient,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick,xf:fml:xaeroworldmap:xaero_wm_minecraft_runtick_render_call,xf:fml:xaerominimap:xaero_minecraftclient,xf:fml:xaeroworldmap:xaero_wm_minecraftclient,pl:mixin:A,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:218) ~[minecraft-1.20.1-client.jar:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:flywheel.mixins.json:ClientMainMixin,pl:mixin:A,pl:runtimedistcleaner:A}     Including some extra info in case any of it is relevant^. Appreciate any ideas/advice!    
    • Try the JVM argument in this post, just sub xmx/xms numbers for what you want/need allocated.  https://www.reddit.com/r/feedthebeast/s/lzmKUNZFrG I'm having the same issue with a huge modpack using the 3 culprits to your issue.  Let me know if this helps!
    • i have been trying to  lauch a modpack and it crashes in the lauching phase   
    • nope, even the log is the exact same, i also tried with the Dimensional doors just in case and nothing.
  • Topics

×
×
  • Create New...

Important Information

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