Jump to content

Problem with Underwater coral


yohannlog

Recommended Posts

Hello,

 

Today, I'm trying to make a coral block just for test and I hava a problem since 3 hours.

I have some water bug on my block's side (the bug of water on all versions). I searched everywhere and projects on github and I can't do it.

 

In 1.8, it's so easy but in 1.12.2...

 

I test : setDefaultState(blockState.getBaseState().withProperty(BlockLiquid.LEVEL, 15));
and other method but no..

 

Registering of blocks (ModBlocks):

@Mod.EventBusSubscriber(modid=AquaMariculture.MODID)
public class ModBlocks {
	
    public static Block limestone;
    public static CoralBlock whiteCoral;

	public static void init() {
		limestone = new BlockLimestone("limestone", Material.ROCK).setHardness(1.1F).setResistance(7.0F);
		whiteCoral = (CoralBlock)(new WhiteCoralBlock("white_coral_block")).setHardness(0.0F);
	}
	
	public static void register() {
		
		registerBlockWithVariants(limestone, new ItemBlockLimestone(limestone));
		registerBlock(whiteCoral);
		
	}
	
	public static void registerRenders() {
		for (int i = 0; i < BlockLimestone.EnumType.values().length; i++) {
			registerRender(limestone, i, "limestone_" + BlockLimestone.EnumType.values()[i].getName());
		}
		
		registerRender(whiteCoral, 0, "white_coral_block");
	}
	
	public static void registerBlock(Block block) {
		ForgeRegistries.BLOCKS.register(block);
		ItemBlock item = new ItemBlock(block);
		item.setRegistryName(block.getRegistryName());
		ForgeRegistries.ITEMS.register(item);
		
		ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory"));
	}
	
	public static void registerBlock(Block block, ItemBlock itemBlock) {
		ForgeRegistries.BLOCKS.register(block);
		itemBlock.setRegistryName(block.getRegistryName());
		ForgeRegistries.ITEMS.register(itemBlock);
		
		ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory"));
	}
	
	public static void registerBlockWithVariants(Block block, ItemBlock itemBlock) {
		ForgeRegistries.BLOCKS.register(block);
		itemBlock.setRegistryName(block.getRegistryName());
		ForgeRegistries.ITEMS.register(itemBlock);
		
		ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), 0, new ModelResourceLocation(block.getRegistryName(), "inventory"));
	}
	
	public static void registerRender(Block block, int meta, String fileName) {
		ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(block), meta, new ModelResourceLocation(new ResourceLocation(AquaMariculture.MODID, fileName), "inventory"));
	}
	
	
}

 

Aquatic plant class (extend of Block and IPlantable):

Quote

 


public class AquaticPlant extends Block implements IPlantable{
	
	public AquaticPlant(Material materialIn) {
		super(materialIn);
		setCreativeTab(AquaMariculture.blocks);
	
	}
	

	@Override
	public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
		// TODO Auto-generated method stub
		return EnumPlantType.Water;
	}

	@Override
	public IBlockState getPlant(IBlockAccess world, BlockPos pos) {
		
		return world.getBlockState(pos);
	}
	
	@Override
	public boolean isOpaqueCube(IBlockState state) {
		return false;
	}
	
	@Override
	public boolean isFullCube(IBlockState state) {
		return false;
	}
	
	
    @SideOnly(Side.CLIENT)
    public BlockRenderLayer getBlockLayer()
    {
        return BlockRenderLayer.CUTOUT;
    }
    
    /**
    @Override
    public boolean canPlaceBlockAt(World worldIn, BlockPos pos) {
    	
    	IBlockState state = worldIn.getBlockState(pos.up());
    	Block block = state.getBlock();
    	
    	
    	if (block != Blocks.WATER) {
    		return false;
    	} else {
    		return true;
    	}
    	
    }
**/
}

 

 

 

CoralBlock Class (extends of Aquatic Plant):

Quote

public class CoralBlock extends AquaticPlant {
	
	protected static final AxisAlignedBB REED_AABB = new AxisAlignedBB(0.125D, 0.0D, 0.125D, 0.875D, 1.0D, 0.875D);
	
	public CoralBlock(String name) {
		super(Material.WATER);
		
		setUnlocalizedName(name);
		setRegistryName(name);
		setCreativeTab(AquaMariculture.blocks);
		setSoundType(SoundType.STONE);
		setDefaultState(blockState.getBaseState().withProperty(BlockLiquid.LEVEL, 15));

	}

	@Override
	public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
    {
        return REED_AABB;
    }
	
	



}

 

 

 

My coral class:

package fr.yohannlog.mariculture.blocks.corals;

import javax.annotation.Nullable;

import net.minecraft.block.Block;
import net.minecraft.block.BlockLiquid;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.BlockFluidRenderer;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;

public class WhiteCoralBlock extends CoralBlock{

	public WhiteCoralBlock(String name) {
		super("white_coral_block");
		
	}
	
	@Override
	public boolean isOpaqueCube(IBlockState state) {
		return false;
	}
	
	@Override
	public boolean isFullCube(IBlockState state) {
		return false;
	}
	
	@Nullable
    public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos)
    {
        return NULL_AABB;
    }
    
	
}

 

 

The crash (my bad..):

[01:03:00] [main/FATAL]: Reported exception thrown!
net.minecraft.util.ReportedException: Tesselating block in world
	at net.minecraft.client.renderer.BlockRendererDispatcher.renderBlock(BlockRendererDispatcher.java:95) ~[BlockRendererDispatcher.class:?]
	at net.minecraft.client.renderer.chunk.RenderChunk.rebuildChunk(RenderChunk.java:203) ~[RenderChunk.class:?]
	at net.minecraft.client.renderer.chunk.ChunkRenderWorker.processTask(ChunkRenderWorker.java:122) ~[ChunkRenderWorker.class:?]
	at net.minecraft.client.renderer.chunk.ChunkRenderDispatcher.updateChunkNow(ChunkRenderDispatcher.java:172) ~[ChunkRenderDispatcher.class:?]
	at net.minecraft.client.renderer.RenderGlobal.setupTerrain(RenderGlobal.java:1012) ~[RenderGlobal.class:?]
	at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1369) ~[EntityRenderer.class:?]
	at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1312) ~[EntityRenderer.class:?]
	at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1115) ~[EntityRenderer.class:?]
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1207) ~[Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:441) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: java.lang.IllegalArgumentException: Cannot get property PropertyInteger{name=level, clazz=class java.lang.Integer, values=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]} as it does not exist in BlockStateContainer{block=aquaculture:white_coral_block, properties=[]}
	at net.minecraft.block.state.BlockStateContainer$StateImplementation.getValue(BlockStateContainer.java:204) ~[BlockStateContainer$StateImplementation.class:?]
	at net.minecraft.client.renderer.BlockFluidRenderer.getFluidHeight(BlockFluidRenderer.java:300) ~[BlockFluidRenderer.class:?]
	at net.minecraft.client.renderer.BlockFluidRenderer.renderFluid(BlockFluidRenderer.java:70) ~[BlockFluidRenderer.class:?]
	at net.minecraft.client.renderer.BlockRendererDispatcher.renderBlock(BlockRendererDispatcher.java:84) ~[BlockRendererDispatcher.class:?]
	... 22 more
[01:03:00] [main/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: ---- Minecraft Crash Report ----
// On the bright side, I bought you a teddy bear!

Time: 3/10/18 1:03 AM
Description: Tesselating block in world

java.lang.IllegalArgumentException: Cannot get property PropertyInteger{name=level, clazz=class java.lang.Integer, values=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]} as it does not exist in BlockStateContainer{block=aquaculture:white_coral_block, properties=[]}
	at net.minecraft.block.state.BlockStateContainer$StateImplementation.getValue(BlockStateContainer.java:204)
	at net.minecraft.client.renderer.BlockFluidRenderer.getFluidHeight(BlockFluidRenderer.java:300)
	at net.minecraft.client.renderer.BlockFluidRenderer.renderFluid(BlockFluidRenderer.java:70)
	at net.minecraft.client.renderer.BlockRendererDispatcher.renderBlock(BlockRendererDispatcher.java:84)
	at net.minecraft.client.renderer.chunk.RenderChunk.rebuildChunk(RenderChunk.java:203)
	at net.minecraft.client.renderer.chunk.ChunkRenderWorker.processTask(ChunkRenderWorker.java:122)
	at net.minecraft.client.renderer.chunk.ChunkRenderDispatcher.updateChunkNow(ChunkRenderDispatcher.java:172)
	at net.minecraft.client.renderer.RenderGlobal.setupTerrain(RenderGlobal.java:1012)
	at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1369)
	at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1312)
	at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1115)
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1207)
	at net.minecraft.client.Minecraft.run(Minecraft.java:441)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:26)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Client thread
Stacktrace:
	at net.minecraft.block.state.BlockStateContainer$StateImplementation.getValue(BlockStateContainer.java:204)
	at net.minecraft.client.renderer.BlockFluidRenderer.getFluidHeight(BlockFluidRenderer.java:300)
	at net.minecraft.client.renderer.BlockFluidRenderer.renderFluid(BlockFluidRenderer.java:70)

-- Block being tesselated --
Details:
	Block type: ID #9 (tile.water // net.minecraft.block.BlockStaticLiquid)
	Block data value: 1 / 0x1 / 0b0001
	Block location: World: (714,4,-123), Chunk: (at 10,0,5 in 44,-8; contains blocks 704,0,-128 to 719,255,-113), Region: (1,-1; contains chunks 32,-32 to 63,-1, blocks 512,0,-512 to 1023,255,-1)
Stacktrace:
	at net.minecraft.client.renderer.BlockRendererDispatcher.renderBlock(BlockRendererDispatcher.java:84)
	at net.minecraft.client.renderer.chunk.RenderChunk.rebuildChunk(RenderChunk.java:203)
	at net.minecraft.client.renderer.chunk.ChunkRenderWorker.processTask(ChunkRenderWorker.java:122)
	at net.minecraft.client.renderer.chunk.ChunkRenderDispatcher.updateChunkNow(ChunkRenderDispatcher.java:172)
	at net.minecraft.client.renderer.RenderGlobal.setupTerrain(RenderGlobal.java:1012)
	at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1369)
	at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1312)

-- Affected level --
Details:
	Level name: MpServer
	All players: 1 total; [EntityPlayerSP['Player752'/135, l='MpServer', x=707.50, y=1.00, z=-116.30]]
	Chunk stats: MultiplayerChunkCache: 289, 289
	Level seed: 0
	Level generator: ID 01 - flat, ver 0. Features enabled: false
	Level generator options: 
	Level spawn location: World: (723,4,-123), Chunk: (at 3,0,5 in 45,-8; contains blocks 720,0,-128 to 735,255,-113), Region: (1,-1; contains chunks 32,-32 to 63,-1, blocks 512,0,-512 to 1023,255,-1)
	Level time: 153747 game time, 182 day time
	Level dimension: 0
	Level storage version: 0x00000 - Unknown?
	Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
	Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
	Forced entities: 28 total; [EntityPlayerSP['Player752'/135, l='MpServer', x=707.50, y=1.00, z=-116.30], EntityCow['Cow'/82, l='MpServer', x=734.07, y=4.00, z=-48.40], EntityCow['Cow'/24, l='MpServer', x=636.17, y=4.00, z=-65.61], EntityHorse['Horse'/34, l='MpServer', x=640.10, y=4.00, z=-151.10], EntityHorse['Horse'/98, l='MpServer', x=741.09, y=4.00, z=-195.39], EntitySlime['Slime'/35, l='MpServer', x=647.64, y=5.76, z=-133.53], EntitySlime['Slime'/99, l='MpServer', x=742.43, y=4.34, z=-195.36], EntitySlime['Slime'/36, l='MpServer', x=638.67, y=4.00, z=-133.29], EntitySlime['Slime'/100, l='MpServer', x=743.94, y=4.00, z=-178.62], EntityCow['Cow'/37, l='MpServer', x=652.46, y=4.00, z=-108.56], EntitySlime['Slime'/101, l='MpServer', x=741.51, y=5.00, z=-68.29], EntityChicken['Chicken'/40, l='MpServer', x=659.36, y=4.00, z=-193.36], EntityHorse['Horse'/42, l='MpServer', x=664.89, y=4.00, z=-172.70], EntityHorse['Horse'/43, l='MpServer', x=670.39, y=4.00, z=-164.12], EntitySheep['Sheep'/107, l='MpServer', x=755.21, y=4.00, z=-187.61], EntityHorse['Horse'/44, l='MpServer', x=663.84, y=4.00, z=-174.23], EntitySlime['Slime'/108, l='MpServer', x=751.28, y=4.00, z=-157.32], EntityChicken['Chicken'/45, l='MpServer', x=671.13, y=4.00, z=-155.95], EntityItem['item.item.egg'/46, l='MpServer', x=669.78, y=4.00, z=-156.70], EntitySlime['Slime'/110, l='MpServer', x=781.89, y=4.00, z=-145.21], EntityCow['Cow'/47, l='MpServer', x=658.01, y=4.00, z=-100.35], EntitySlime['Slime'/48, l='MpServer', x=659.51, y=5.02, z=-101.76], EntityCow['Cow'/49, l='MpServer', x=661.14, y=4.00, z=-91.66], EntitySlime['Slime'/115, l='MpServer', x=783.96, y=5.00, z=-192.31], EntitySlime['Slime'/52, l='MpServer', x=682.29, y=4.12, z=-180.53], EntitySlime['Slime'/53, l='MpServer', x=679.78, y=4.00, z=-178.15], EntitySheep['Sheep'/54, l='MpServer', x=677.78, y=4.00, z=-136.46], EntitySlime['Slime'/58, l='MpServer', x=705.23, y=4.00, z=-60.57]]
	Retry entities: 0 total; []
	Server brand: fml,forge
	Server type: Integrated singleplayer server
Stacktrace:
	at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:461)
	at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2896)
	at net.minecraft.client.Minecraft.run(Minecraft.java:462)
	at net.minecraft.client.main.Main.main(Main.java:118)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
	at GradleStart.main(GradleStart.java:26)

-- System Details --
Details:
	Minecraft Version: 1.12.2
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_161, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 649792272 bytes (619 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB)
	JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	FML: MCP 9.42 Powered by Forge 14.23.2.2624 5 mods loaded, 5 mods active
	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

	| State     | ID          | Version      | Source                           | Signature |
	|:--------- |:----------- |:------------ |:-------------------------------- |:--------- |
	| UCHIJAAAA | minecraft   | 1.12.2       | minecraft.jar                    | None      |
	| UCHIJAAAA | mcp         | 9.42         | minecraft.jar                    | None      |
	| UCHIJAAAA | FML         | 8.0.99.99    | forgeSrc-1.12.2-14.23.2.2624.jar | None      |
	| UCHIJAAAA | forge       | 14.23.2.2624 | forgeSrc-1.12.2-14.23.2.2624.jar | None      |
	| UCHIJAAAA | aquaculture | 1.0          | bin                              | None      |

	Loaded coremods (and transformers): 
	GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 391.01' Renderer: 'GeForce GTX 860M/PCIe/SSE2'
	Launched Version: 1.12.2
	LWJGL: 2.9.4
	OpenGL: GeForce GTX 860M/PCIe/SSE2 GL version 4.6.0 NVIDIA 391.01, NVIDIA Corporation
	GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.

	Using VBOs: Yes
	Is Modded: Definitely; Client brand changed to 'fml,forge'
	Type: Client (map_client.txt)
	Resource Packs: 
	Current Language: English (US)
	Profiler Position: N/A (disabled)
	CPU: 8x Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz
[01:03:00] [main/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: #@!@# Game crashed! Crash report saved to: #@!@# J:\Minecraft\Forge mods\Mariculture\run\.\crash-reports\crash-2018-03-10_01.03.00-client.txt
AL lib: (EE) alc_cleanup: 1 device not closed
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

 

I thank you in advance..

 

Yohann

 

Edited by yohannlog
add method
Link to comment
Share on other sites

This hasn't changed since 1.8, you need to include the BlockLiquid.LEVEL property in your Block's state (by overriding Block#createBlockState) before you can set the value of it.

 

I have a block that does this, you can see that in both 1.8 and 1.12.2 I override Block#createBlockState.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Ok thanks,

 

I already set the BlockLiquid.LEVEL in my class but now I set it to 0.

 

And I had :

 

	@Override
	public int getMetaFromState(final IBlockState state) {
		return 0;
	}

 

 

Now, he didn't crash but:

[01:37:17] [main/ERROR] [FML]: Exception loading model for variant aquaculture:white_coral_block#level=8 for blockstate "aquaculture:white_coral_block[level=8]"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model aquaculture:white_coral_block#level=8 with loader VariantLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:248) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:153) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:236) ~[ModelLoader.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:163) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:121) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:559) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
	at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:83) ~[ModelBlockDefinition.class:?]
	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1189) ~[ModelLoader$VariantLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
	... 21 more
[01:37:17] [main/ERROR] [FML]: Exception loading model for variant aquaculture:white_coral_block#level=9 for blockstate "aquaculture:white_coral_block[level=9]"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model aquaculture:white_coral_block#level=9 with loader VariantLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:248) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:153) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:236) ~[ModelLoader.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:163) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:121) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:559) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
	at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:83) ~[ModelBlockDefinition.class:?]
	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1189) ~[ModelLoader$VariantLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
	... 21 more
[01:37:17] [main/ERROR] [FML]: Exception loading model for variant aquaculture:white_coral_block#level=4 for blockstate "aquaculture:white_coral_block[level=4]"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model aquaculture:white_coral_block#level=4 with loader VariantLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:248) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:153) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:236) ~[ModelLoader.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:163) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:121) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:559) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
	at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:83) ~[ModelBlockDefinition.class:?]
	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1189) ~[ModelLoader$VariantLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
	... 21 more
[01:37:17] [main/ERROR] [FML]: Exception loading model for variant aquaculture:white_coral_block#level=5 for blockstate "aquaculture:white_coral_block[level=5]"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model aquaculture:white_coral_block#level=5 with loader VariantLoader.INSTANCE, skipping
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:153) ~[ModelLoaderRegistry.class:?]
	at net.minecraftforge.client.model.ModelLoader.registerVariant(ModelLoader.java:248) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelBakery.loadBlock(ModelBakery.java:153) ~[ModelBakery.class:?]
	at net.minecraftforge.client.model.ModelLoader.loadBlocks(ModelLoader.java:236) ~[ModelLoader.class:?]
	at net.minecraftforge.client.model.ModelLoader.setupModelRegistry(ModelLoader.java:163) ~[ModelLoader.class:?]
	at net.minecraft.client.renderer.block.model.ModelManager.onResourceManagerReload(ModelManager.java:28) [ModelManager.class:?]
	at net.minecraft.client.resources.SimpleReloadableResourceManager.registerReloadListener(SimpleReloadableResourceManager.java:121) [SimpleReloadableResourceManager.class:?]
	at net.minecraft.client.Minecraft.init(Minecraft.java:559) [Minecraft.class:?]
	at net.minecraft.client.Minecraft.run(Minecraft.java:421) [Minecraft.class:?]
	at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_161]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_161]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_161]
	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
	at GradleStart.main(GradleStart.java:26) [start/:?]
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException
	at net.minecraft.client.renderer.block.model.ModelBlockDefinition.getVariant(ModelBlockDefinition.java:83) ~[ModelBlockDefinition.class:?]
	at net.minecraftforge.client.model.ModelLoader$VariantLoader.loadModel(ModelLoader.java:1189) ~[ModelLoader$VariantLoader.class:?]
	at net.minecraftforge.client.model.ModelLoaderRegistry.getModel(ModelLoaderRegistry.java:149) ~[ModelLoaderRegistry.class:?]
	... 21 more

 

Link to comment
Share on other sites

You either need a custom state mapper to ignore the property or you need to include all of the level variants in your blockstate file.

Just because the value "is always 0" as far as your code is concerned, doesn't mean that the model bakery knows this. It was given a "level" property with 16 values, but you didn't tell the bakery (via a statemapper or blockstate file) what to do with those 16 values.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Quote

[01:37:17] [main/ERROR] [FML]: Exception loading model for variant aquaculture:white_coral_block#level=8 for blockstate "aquaculture:white_coral_block[level=8]"
net.minecraftforge.client.model.ModelLoaderRegistry$LoaderException: Exception loading model aquaculture:white_coral_block#level=8 with loader VariantLoader.INSTANCE, skipping
...
Caused by: net.minecraft.client.renderer.block.model.ModelBlockDefinition$MissingVariantException

 

Now that your Block actually has a property, there are 16 variants that your blockstates file doesn't define a model for.

 

You could define a model for each variant, but there's not much point in this because they'd all be the same. Instead, you should tell Minecraft to ignore the BlockLiquid.LEVEL property when loading models by registering an IStateMapper for your Block in ModelRegistryEvent.

 

The easiest way to create an IStateMapper is by creating a StateMap.Builder, calling StateMap.Builder#ignore to ignore the property and then calling StateMap.Builder#build.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

It's this ?

 

@SubscribeEvent
	public static void registerModels(ModelRegistryEvent event) {
		final StateMap.Builder AS = new StateMap.Builder();
		ModelLoader.setCustomStateMapper(ModBlocks.whiteCoral, AS.ignore(BlockLiquid.LEVEL).build());
	}

 

If it's that, I set this code where ? I do not know where we put it ..

Link to comment
Share on other sites

4 minutes ago, yohannlog said:

It's this ?

 


@SubscribeEvent
	public static void registerModels(ModelRegistryEvent event) {
		final StateMap.Builder AS = new StateMap.Builder();
		ModelLoader.setCustomStateMapper(ModBlocks.whiteCoral, AS.ignore(BlockLiquid.LEVEL).build());
	}

 

If it's that, I set this code where ? I do not know where we put it ..

 

That should work, though the AS local variable is pointless.

 

This needs to be in a client-only class that's registered to the Forge event bus (e.g. annotated with @Mod.EventBusSubscriber). When using @Mod.EventBusSubscriber with classes that only exist on one physical side, make sure to pass Side.CLIENT or Side.SERVER to the annotation as appropriate so Forge only loads and registers it on that side.

Edited by Choonster

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Ok, it's working !!

 

There where a few hours, I created this class but I forgotten the EventBusSubcriber xD.

 

 

Thank you very much !!

 

Ps: A question : We can set the EventBusSubscriber on another class like extends Block or  required an empty 

file ?

Yohann

 

Link to comment
Share on other sites

19 minutes ago, yohannlog said:

And an another question : Can I delete swimming in the corail ? I think 'no' because It's like water xD

 

Remove WhiteCoralBlock's override of Block#getCollisionBoundingBox and the AABB returned by CoralBlock#getBoundingBox should be used as the collision bounding box.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

He doesn't work

 

I add this to CoralBlock: (Just the second method) (I test with bounding box and after deleted this and doesn't work)

//I delete override or not ?
@Override
	public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
    {
        return REED_AABB;
    }
	
	@Override
	public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos)
    {
        return REED_AABB;
    }

 

And I delete the override on the White coral block.

Edited by yohannlog
Add Precision
Link to comment
Share on other sites

Aquatic Plant:

public class AquaticPlant extends Block implements IPlantable{
	
	public AquaticPlant(Material materialIn) {
		super(materialIn);
		setCreativeTab(AquaMariculture.blocks);
	
	}
	

	@Override
	public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
		// TODO Auto-generated method stub
		return EnumPlantType.Water;
	}

	@Override
	public IBlockState getPlant(IBlockAccess world, BlockPos pos) {
		
		return world.getBlockState(pos);
	}
	
	@Override
	public boolean isOpaqueCube(IBlockState state) {
		return false;
	}
	
	@Override
	public boolean isFullCube(IBlockState state) {
		return false;
	}
	
	
    @SideOnly(Side.CLIENT)
    public BlockRenderLayer getBlockLayer()
    {
        return BlockRenderLayer.CUTOUT_MIPPED;
    }
    
    
    
    @Override
    public boolean canPlaceBlockAt(World worldIn, BlockPos pos) {
    	
    	IBlockState state = worldIn.getBlockState(pos.up());
    	Block block = state.getBlock();
    	
    	
    	if (block != Blocks.WATER) {
    		return false;
    	} else {
    		return true;
    	}
    	
    }

}

 

BlockCoral

public class CoralBlock extends AquaticPlant {
	
	protected static final AxisAlignedBB REED_AABB = new AxisAlignedBB(0.125D, 0.0D, 0.125D, 0.875D, 1.0D, 0.875D);
	
	public CoralBlock(String name) {
		super(Material.WATER);
		
		setUnlocalizedName(name);
		setRegistryName(name);
		setCreativeTab(AquaMariculture.blocks);
		setSoundType(SoundType.STONE);
		setDefaultState(blockState.getBaseState().withProperty(BlockLiquid.LEVEL, 0));

		
	}
	
	@Override
	protected BlockStateContainer createBlockState() {
		return new BlockStateContainer(this, BlockLiquid.LEVEL);
	}
	
	@Override
	public int getMetaFromState(final IBlockState state) {
		return 0;
	}

	@Override
	public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
    {
        return REED_AABB;
    }
	
	@Override
	public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos)
    {
        return REED_AABB;
    }
}

 

White coral block:

 

public class WhiteCoralBlock extends CoralBlock{

	public WhiteCoralBlock(String name) {
		super("white_coral_block");
		
	}
	
	@Override
	public boolean isOpaqueCube(IBlockState state) {
		return false;
	}
	
	@Override
	public boolean isFullCube(IBlockState state) {
		return false;
	}
	
	
    public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos)
    {
        return NULL_AABB;
    }
	
	

 

Link to comment
Share on other sites

When I said "remove the override", I meant "remove the method that overrides this method". Removing the @Override annotation is pointless, since it doesn't actually affect whether or not one method overrides another.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

2 hours ago, yohannlog said:

I remove the getBoundingBox on the CoralBlock and WhiteCoralBlock and It doesn't work. We can swimming, if I didn't delete the method on CoralBlock is the same problem (we can swim)

 

The only method you need to remove is WhiteCoralBlock#getCollisionBoundingBox, though BlockCoral#getCollisionBoundingBox can also be removed because it does the same thing as the super method (i.e. returns the same value as getBoundingBox).

 

Remove WhiteCoralBlock#getCollisionBoundingBox and BlockCoral#getCollisionBoundingBox while leaving BlockCoral#getBoundingBox in place. If this doesn't work, post your new code.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Now I have an hitbox:

 

CoralBlock:

public class CoralBlock extends AquaticPlant {
	
	protected static final AxisAlignedBB REED_AABB = new AxisAlignedBB(0.125D, 0.0D, 0.125D, 0.875D, 1.0D, 0.875D);
	
	public CoralBlock(String name) {
		super(Material.WATER);
		
		setUnlocalizedName(name);
		setRegistryName(name);
		setCreativeTab(AquaMariculture.blocks);
		setSoundType(SoundType.STONE);
		setDefaultState(blockState.getBaseState().withProperty(BlockLiquid.LEVEL, 0));

		
	}
	
	@Override
	protected BlockStateContainer createBlockState() {
		return new BlockStateContainer(this, BlockLiquid.LEVEL);
	}
	
	@Override
	public int getMetaFromState(final IBlockState state) {
		return 0;
	}
	
	@Override
	public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
    {
        return REED_AABB;
    }
	


}

 

White Coral:

 

public class WhiteCoralBlock extends CoralBlock{

	public WhiteCoralBlock(String name) {
		super("white_coral_block");
		this.setTickRandomly(true);
		
		
	}
	
	@Override
	public boolean isOpaqueCube(IBlockState state) {
		return false;
	}
	
	@Override
	public boolean isFullCube(IBlockState state) {
		return false;
	}
}

 

Aquatic Plant:

 

public class AquaticPlant extends Block implements IPlantable{
	
	public AquaticPlant(Material materialIn) {
		super(materialIn);
		setCreativeTab(AquaMariculture.blocks);
		this.setTickRandomly(false);
	
	}
	

	@Override
	public EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
		// TODO Auto-generated method stub
		return EnumPlantType.Water;
	}

	@Override
	public IBlockState getPlant(IBlockAccess world, BlockPos pos) {
		
		return world.getBlockState(pos);
	}
	
	@Override
	public boolean isOpaqueCube(IBlockState state) {
		return false;
	}
	
	@Override
	public boolean isFullCube(IBlockState state) {
		return false;
	}
	
	
    @SideOnly(Side.CLIENT)
    public BlockRenderLayer getBlockLayer()
    {
        return BlockRenderLayer.CUTOUT_MIPPED;
    }
    
    @Override
    public boolean canPlaceBlockAt(World worldIn, BlockPos pos) {
    	
    	IBlockState state = worldIn.getBlockState(pos.up());
    	Block block = state.getBlock();
    	
    	
    	if (block != Blocks.WATER) {
    		return false;
    	} else {
    		return true;
    	}
    	
    }
    
  

}

 

Edited by yohannlog
precision
Link to comment
Share on other sites

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

    • They were already updated, and just to double check I even did a cleanup and fresh update from that same page. I'm quite sure drivers are not the problem here. 
    • i tried downloading the drivers but it says no AMD graphics hardware has been detected    
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system  
    • As the title says i keep on crashing on forge 1.20.1 even without any mods downloaded, i have the latest drivers (nvidia) and vanilla minecraft works perfectly fine for me logs: https://pastebin.com/5UR01yG9
    • Hello everyone, I'm making this post to seek help for my modded block, It's a special block called FrozenBlock supposed to take the place of an old block, then after a set amount of ticks, it's supposed to revert its Block State, Entity, data... to the old block like this :  The problem I have is that the system breaks when handling multi blocks (I tried some fix but none of them worked) :  The bug I have identified is that the function "setOldBlockFields" in the item's "setFrozenBlock" function gets called once for the 1st block of multiblock getting frozen (as it should), but gets called a second time BEFORE creating the first FrozenBlock with the data of the 1st block, hence giving the same data to the two FrozenBlock :   Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=head] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@73681674 BlockEntityData : id:"minecraft:bed",x:3,y:-60,z:-6} Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=3, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=2, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} here is the code inside my custom "freeze" item :    @Override     public @NotNull InteractionResult useOn(@NotNull UseOnContext pContext) {         if (!pContext.getLevel().isClientSide() && pContext.getHand() == InteractionHand.MAIN_HAND) {             BlockPos blockPos = pContext.getClickedPos();             BlockPos secondBlockPos = getMultiblockPos(blockPos, pContext.getLevel().getBlockState(blockPos));             if (secondBlockPos != null) {                 createFrozenBlock(pContext, secondBlockPos);             }             createFrozenBlock(pContext, blockPos);             return InteractionResult.SUCCESS;         }         return super.useOn(pContext);     }     public static void createFrozenBlock(UseOnContext pContext, BlockPos blockPos) {         BlockState oldState = pContext.getLevel().getBlockState(blockPos);         BlockEntity oldBlockEntity = oldState.hasBlockEntity() ? pContext.getLevel().getBlockEntity(blockPos) : null;         CompoundTag oldBlockEntityData = oldState.hasBlockEntity() ? oldBlockEntity.serializeNBT() : null;         if (oldBlockEntity != null) {             pContext.getLevel().removeBlockEntity(blockPos);         }         BlockState FrozenBlock = setFrozenBlock(oldState, oldBlockEntity, oldBlockEntityData);         pContext.getLevel().setBlockAndUpdate(blockPos, FrozenBlock);     }     public static BlockState setFrozenBlock(BlockState blockState, @Nullable BlockEntity blockEntity, @Nullable CompoundTag blockEntityData) {         BlockState FrozenBlock = BlockRegister.FROZEN_BLOCK.get().defaultBlockState();         ((FrozenBlock) FrozenBlock.getBlock()).setOldBlockFields(blockState, blockEntity, blockEntityData);         return FrozenBlock;     }  
  • Topics

×
×
  • Create New...

Important Information

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