Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.8][Almost Solved]Get block-set block methods/ IWorldGenerator with structures


memcallen
 Share

Recommended Posts

What are the getting and setting block methods for 1.8?

If there are none (which I highly doubt) how can I make my structure generate in-world (I already have the IWorldGenerator set up).

The proud(ish) developer of Ancients

Link to comment
Share on other sites

So far I have found a set block method but no get block method. I need the get block method for detecting what the top block's y coord is at the specified x/z coordinates. I need the y-coord so that my structure doesn't spawn in the ground, or in the air.

The proud(ish) developer of Ancients

Link to comment
Share on other sites

Yes, thanks. Also how do I use IBlockState to set a block? It's an interface so I can't instantiate it. Is there a method somewhere kind of like getAxisAlignedBB that returns it?

The proud(ish) developer of Ancients

Link to comment
Share on other sites

Use

Block#getDefaultState()

for standard blocks.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

I'm not sure this is how IBlockState is supposed to work but I'm using this code to spawn my block (x/z are random coords from IWorldGenerator):

BlockPos block = new BlockPos(x,0,z);

block = world.getTopSolidOrLiquidBlock(block);

System.out.println("Top Block is:"+block.getY());

IBlockState state = Ancients.invincible.getDefaultState();

world.setBlockState(block, state);

The proud(ish) developer of Ancients

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • I'm new to modding and I want to do this. What class would I put that in?
    • That is a different crash report. Please post the debug.log file from the logs folder.
    • [22Jan.2022 18:41:22.485] [Server thread/ERROR] [net.minecraftforge.eventbus.EventBus/EVENTBUS]: Exception caught during firing event: 'net.minecraft.nbt.CompoundTag net.minecraft.world.level.block.entity.SignBlockEntity.save(net.minecraft.nbt.CompoundTag)'     Index: 4     Listeners:         0: HIGH         1: ASM: class dev.architectury.event.forge.EventHandlerImplCommon event(Lnet/minecraftforge/event/server/ServerStartingEvent;)V         2: NORMAL         3: ASM: cyclopscore onServerStarting(Lnet/minecraftforge/event/server/ServerStartingEvent;)V         4: ASM: chanceCubes.CCubesCore@5b77fda6 serverStart(Lnet/minecraftforge/event/server/ServerStartingEvent;)V         5: ASM: mods.waterstrainer.event.EventServerStarting@2dc1913f onServerStarting(Lnet/minecraftforge/event/server/ServerStartingEvent;)V         6: ASM: com.song.castle_in_the_sky.CastleInTheSky@1f8c253d onServerStarting(Lnet/minecraftforge/event/server/ServerStartingEvent;)V         7: ASM: se.mickelus.tetra.TetraMod@203a3089 serverStarting(Lnet/minecraftforge/event/server/ServerStartingEvent;)V         8: net.minecraftforge.eventbus.EventBus$$Lambda$4325/0x0000000800c57770@71737087         9: ASM: de.teamlapen.vampirism.VampirismMod@1213b1b onServerStart(Lnet/minecraftforge/event/server/ServerStartingEvent;)V         10: net.minecraftforge.eventbus.EventBus$$Lambda$4325/0x0000000800c57770@1a894d2d         11: net.minecraftforge.eventbus.EventBus$$Lambda$4325/0x0000000800c57770@3deb329 java.lang.NoSuchMethodError: 'net.minecraft.nbt.CompoundTag net.minecraft.world.level.block.entity.SignBlockEntity.save(net.minecraft.nbt.CompoundTag)'     at TRANSFORMER/chancecubes@1.18.1-5.0.2.444/chanceCubes.rewards.DefaultRewards.loadDefaultRewards(DefaultRewards.java:124)     at TRANSFORMER/chancecubes@1.18.1-5.0.2.444/chanceCubes.CCubesCore.serverStart(CCubesCore.java:123)     at net.minecraftforge.eventbus.ASMEventHandler_101_CCubesCore_serverStart_ServerStartingEvent.invoke(.dynamic)     at MC-BOOTSTRAP/eventbus@5.0.3/net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85)     at MC-BOOTSTRAP/eventbus@5.0.3/net.minecraftforge.eventbus.EventBus.post(EventBus.java:302)     at MC-BOOTSTRAP/eventbus@5.0.3/net.minecraftforge.eventbus.EventBus.post(EventBus.java:283)     at TRANSFORMER/forge@39.0.56/net.minecraftforge.server.ServerLifecycleHooks.handleServerStarting(ServerLifecycleHooks.java:102)     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.base/java.lang.reflect.Method.invoke(Method.java:568)     at TRANSFORMER/net.optifine/net.optifine.reflect.Reflector.callBoolean(Reflector.java:702)     at TRANSFORMER/minecraft@1.18.1/net.minecraft.client.server.IntegratedServer.m_7038_(IntegratedServer.java:90)     at TRANSFORMER/minecraft@1.18.1/net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:644)     at TRANSFORMER/minecraft@1.18.1/net.minecraft.server.MinecraftServer.m_177918_(MinecraftServer.java:258)     at java.base/java.lang.Thread.run(Thread.java:833) [22Jan.2022 18:41:22.509] [Server thread/DEBUG] [mixin/]: Mixing MixinChunkSerializer from architectury.mixins.json into net.minecraft.world.level.chunk.storage.ChunkSerializer [22Jan.2022 18:41:28.076] [Server thread/DEBUG] [net.minecraftforge.fml.loading.FileUtils/CORE]: Found existing serverconfig directory : C:\Users\UTW\AppData\Roaming\.minecraft\saves\New World\serverconfig [22Jan.2022 18:41:28.076] [Server thread/DEBUG] [net.minecraftforge.fml.config.ConfigTracker/CONFIG]: Unloading configs type SERVER Sry if its not the right one, im pretty new at Forge
    • I have a modded server that worked before I changed the config for SereneSeasons (made the seasons longer and turned off offline season progression). Now it just gives said error message, even after reverting the changes.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.