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

    • Hello, I'm trying to modify the effects of native enchantments for bows and arrows in Minecraft. After using a decompilation tool, I found that the specific implementations of native bow and arrow enchantments (including `ArrowDamageEnchantment`, `ArrowKnockbackEnchantment`, `ArrowFireEnchantment`, `ArrowInfiniteEnchantment`, `ArrowPiercingEnchantment`) do not contain any information about the enchantment effects (such as the `getDamageProtection` function for `ProtectionEnchantment`, `getDamageBonus` function for `DamageEnchantment`, etc.). Upon searching for the base class of arrows, `AbstractArrow`, I found a function named setEnchantmentEffectsFromEntity`, which seems to be used to retrieve the enchantment levels of the tool held by a `LivingEntity` and calculate the specific values of the enchantment effects. However, after testing with the following code, I found that this function is not being called:   @Mixin(AbstractArrow.class) public class ModifyArrowEnchantmentEffects {     private static final Logger LOGGER = LogUtils.getLogger();     @Inject(         method = "setEnchantmentEffectsFromEntity",         at = @At("HEAD")     )     private void logArrowEnchantmentEffectsFromEntity(CallbackInfo ci) {         LOGGER.info("Arrow enchantment effects from entity");     } }   Upon further investigation, I found that within the onHitEntity method, there are several lines of code:               if (!this.level().isClientSide &amp;&amp; entity1 instanceof LivingEntity) {                EnchantmentHelper.doPostHurtEffects(livingentity, entity1);                EnchantmentHelper.doPostDamageEffects((LivingEntity)entity1, livingentity);             }   These lines of code actually call the doPostHurt and doPostAttack methods of each enchantment in the enchantment list. However, this leads back to the issue because native bow and arrow enchantments do not implement these functions. Although their base class defines the functions, they are empty. At this point, I'm completely stumped and seeking assistance. Thank you.
    • I have been trying to make a server with forge but I keep running into an issue. I have jdk 22 installed as well as Java 8. here is the debug file  
    • it crashed again     What the console says : [00:02:03] [Server thread/INFO] [Easy NPC/]: [EntityManager] Server started! [00:02:03] [Server thread/INFO] [co.gi.al.ic.IceAndFire/]: {iceandfire:fire_dragon_roost=true, iceandfire:fire_lily=true, iceandfire:spawn_dragon_skeleton_fire=true, iceandfire:lightning_dragon_roost=true, iceandfire:spawn_dragon_skeleton_lightning=true, iceandfire:ice_dragon_roost=true, iceandfire:ice_dragon_cave=true, iceandfire:lightning_dragon_cave=true, iceandfire:cyclops_cave=true, iceandfire:spawn_wandering_cyclops=true, iceandfire:spawn_sea_serpent=true, iceandfire:frost_lily=true, iceandfire:hydra_cave=true, iceandfire:lightning_lily=true, iceandfireixie_village=true, iceandfire:myrmex_hive_jungle=true, iceandfire:myrmex_hive_desert=true, iceandfire:silver_ore=true, iceandfire:siren_island=true, iceandfire:spawn_dragon_skeleton_ice=true, iceandfire:spawn_stymphalian_bird=true, iceandfire:fire_dragon_cave=true, iceandfire:sapphire_ore=true, iceandfire:spawn_hippocampus=true, iceandfire:spawn_death_worm=true} [00:02:03] [Server thread/INFO] [co.gi.al.ic.IceAndFire/]: {TROLL_S=true, HIPPOGRYPH=true, AMPHITHERE=true, COCKATRICE=true, TROLL_M=true, DREAD_LICH=true, TROLL_F=true} [00:02:03] [Server thread/INFO] [ne.be.lo.WeaponRegistry/]: Encoded Weapon Attribute registry size (with package overhead): 41976 bytes (in 5 string chunks with the size of 10000) [00:02:03] [Server thread/INFO] [patchouli/]: Sending reload packet to clients [00:02:03] [Server thread/WARN] [voicechat/]: [voicechat] Running in offline mode - Voice chat encryption is not secure! [00:02:03] [VoiceChatServerThread/INFO] [voicechat/]: [voicechat] Using server-ip as bind address: 0.0.0.0 [00:02:03] [Server thread/WARN] [ModernFix/]: Dedicated server took 22.521 seconds to load [00:02:03] [VoiceChatServerThread/INFO] [voicechat/]: [voicechat] Voice chat server started at 0.0.0.0:25565 [00:02:03] [Server thread/WARN] [minecraft/SynchedEntityData]: defineId called for: class net.minecraft.world.entity.player.Player from class tschipp.carryon.common.carry.CarryOnDataManager [00:02:03] [Server thread/INFO] [ne.mi.co.AdvancementLoadFix/]: Using new advancement loading for net.minecraft.server.PlayerAdvancements@2941ffd5 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 0 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 1 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 2 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 3 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 4 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 5 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 6 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 7 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 8 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 9 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 10 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 11 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 12 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 13 [00:02:10] [Netty Epoll Server IO #2/INFO] [Calio/]: Received acknowledgment for login packet with id 14 [00:02:19] [Server thread/INFO] [ne.mi.co.AdvancementLoadFix/]: Using new advancement loading for net.minecraft.server.PlayerAdvancements@ebc7ef2 [00:02:19] [Server thread/INFO] [minecraft/PlayerList]: ZacAdos[/90.2.17.162:49242] logged in with entity id 1062 at (-1848.6727005281205, 221.0, -3054.2468255848935) [00:02:19] [Server thread/ERROR] [ModernFix/]: Skipping entity ID sync for com.talhanation.smallships.world.entity.ship.Ship: java.lang.NoClassDefFoundError: net/minecraft/client/CameraType [00:02:19] [Server thread/INFO] [minecraft/MinecraftServer]: - Gloop - ZacAdos joined the game [00:02:19] [Server thread/INFO] [xa.pa.OpenPartiesAndClaims/]: Updating all forceload tickets for cc56befd-d376-3526-a760-340713c478bd [00:02:19] [Server thread/INFO] [se.mi.te.da.DataManager/]: Sending data to client: ZacAdos [00:02:19] [Server thread/INFO] [voicechat/]: [voicechat] Received secret request of - Gloop - ZacAdos (17) [00:02:19] [Server thread/INFO] [voicechat/]: [voicechat] Sent secret to - Gloop - ZacAdos [00:02:21] [VoiceChatPacketProcessingThread/INFO] [voicechat/]: [voicechat] Successfully authenticated player cc56befd-d376-3526-a760-340713c478bd [00:02:22] [VoiceChatPacketProcessingThread/INFO] [voicechat/]: [voicechat] Successfully validated connection of player cc56befd-d376-3526-a760-340713c478bd [00:02:22] [VoiceChatPacketProcessingThread/INFO] [voicechat/]: [voicechat] Player - Gloop - ZacAdos (cc56befd-d376-3526-a760-340713c478bd) successfully connected to voice chat stop [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Stopping the server [00:02:34] [Server thread/INFO] [mo.pl.ar.ArmourersWorkshop/]: stop local service [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Stopping server [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Saving players [00:02:34] [Server thread/INFO] [minecraft/ServerGamePacketListenerImpl]: ZacAdos lost connection: Server closed [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: - Gloop - ZacAdos left the game [00:02:34] [Server thread/INFO] [xa.pa.OpenPartiesAndClaims/]: Updating all forceload tickets for cc56befd-d376-3526-a760-340713c478bd [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Saving worlds [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[world]'/minecraft:the_end [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: Saving chunks for level 'ServerLevel[world]'/minecraft:the_nether [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: ThreadedAnvilChunkStorage (world): All chunks are saved [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved [00:02:34] [Server thread/INFO] [minecraft/MinecraftServer]: ThreadedAnvilChunkStorage: All dimensions are saved [00:02:34] [Server thread/INFO] [xa.pa.OpenPartiesAndClaims/]: Stopping IO worker... [00:02:34] [Server thread/INFO] [xa.pa.OpenPartiesAndClaims/]: Stopped IO worker! [00:02:34] [Server thread/INFO] [Calio/]: Removing Dynamic Registries for: net.minecraft.server.dedicated.DedicatedServer@7dc879e1 [MineStrator Daemon]: Checking server disk space usage, this could take a few seconds... [MineStrator Daemon]: Updating process configuration files... [MineStrator Daemon]: Ensuring file permissions are set correctly, this could take a few seconds... [MineStrator Daemon]: Pulling Docker container image, this could take a few minutes to complete... [MineStrator Daemon]: Finished pulling Docker container image container@pterodactyl~ java -version openjdk version "17.0.10" 2024-01-16 OpenJDK Runtime Environment Temurin-17.0.10+7 (build 17.0.10+7) OpenJDK 64-Bit Server VM Temurin-17.0.10+7 (build 17.0.10+7, mixed mode, sharing) container@pterodactyl~ java -Xms128M -Xmx6302M -Dterminal.jline=false -Dterminal.ansi=true -Djline.terminal=jline.UnsupportedTerminal -p libraries/cpw/mods/bootstraplauncher/1.1.2/bootstraplauncher-1.1.2.jar:libraries/cpw/mods/securejarhandler/2.1.4/securejarhandler-2.1.4.jar:libraries/org/ow2/asm/asm-commons/9.5/asm-commons-9.5.jar:libraries/org/ow2/asm/asm-util/9.5/asm-util-9.5.jar:libraries/org/ow2/asm/asm-analysis/9.5/asm-analysis-9.5.jar:libraries/org/ow2/asm/asm-tree/9.5/asm-tree-9.5.jar:libraries/org/ow2/asm/asm/9.5/asm-9.5.jar:libraries/net/minecraftforge/JarJarFileSystems/0.3.16/JarJarFileSystems-0.3.16.jar --add-modules ALL-MODULE-PATH --add-opens java.base/java.util.jar=cpw.mods.securejarhandler --add-opens java.base/java.lang.invoke=cpw.mods.securejarhandler --add-exports java.base/sun.security.util=cpw.mods.securejarhandler --add-exports jdk.naming.dns/com.sun.jndi.dns=java.naming -Djava.net.preferIPv6Addresses=system -DignoreList=bootstraplauncher-1.1.2.jar,securejarhandler-2.1.4.jar,asm-commons-9.5.jar,asm-util-9.5.jar,asm-analysis-9.5.jar,asm-tree-9.5.jar,asm-9.5.jar,JarJarFileSystems-0.3.16.jar -DlibraryDirectory=libraries -DlegacyClassPath=libraries/cpw/mods/securejarhandler/2.1.4/securejarhandler-2.1.4.jar:libraries/org/ow2/asm/asm/9.5/asm-9.5.jar:libraries/org/ow2/asm/asm-commons/9.5/asm-commons-9.5.jar:libraries/org/ow2/asm/asm-tree/9.5/asm-tree-9.5.jar:libraries/org/ow2/asm/asm-util/9.5/asm-util-9.5.jar:libraries/org/ow2/asm/asm-analysis/9.5/asm-analysis-9.5.jar:libraries/net/minecraftforge/accesstransformers/8.0.4/accesstransformers-8.0.4.jar:libraries/org/antlr/antlr4-runtime/4.9.1/antlr4-runtime-4.9.1.jar:libraries/net/minecraftforge/eventbus/6.0.3/eventbus-6.0.3.jar:libraries/net/minecraftforge/forgespi/6.0.0/forgespi-6.0.0.jar:libraries/net/minecraftforge/coremods/5.0.1/coremods-5.0.1.jar:libraries/cpw/mods/modlauncher/10.0.8/modlauncher-10.0.8.jar:libraries/net/minecraftforge/unsafe/0.2.0/unsafe-0.2.0.jar:libraries/com/electronwill/night-config/core/3.6.4/core-3.6.4.jar:libraries/com/electronwill/night-config/toml/3.6.4/toml-3.6.4.jar:libraries/org/apache/maven/maven-artifact/3.8.5/maven-artifact-3.8.5.jar:libraries/net/jodah/typetools/0.8.3/typetools-0.8.3.jar:libraries/net/minecrell/terminalconsoleappender/1.2.0/terminalconsoleappender-1.2.0.jar:libraries/org/jline/jline-reader/3.12.1/jline-reader-3.12.1.jar:libraries/org/jline/jline-terminal/3.12.1/jline-terminal-3.12.1.jar:libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar:libraries/org/openjdk/nashorn/nashorn-core/15.3/nashorn-core-15.3.jar:libraries/net/minecraftforge/JarJarSelector/0.3.16/JarJarSelector-0.3.16.jar:libraries/net/minecraftforge/JarJarMetadata/0.3.16/JarJarMetadata-0.3.16.jar:libraries/net/minecraftforge/fmlloader/1.19.2-43.3.0/fmlloader-1.19.2-43.3.0.jar:libraries/net/minecraft/server/1.19.2-20220805.130853/server-1.19.2-20220805.130853-extra.jar:libraries/com/github/oshi/oshi-core/5.8.5/oshi-core-5.8.5.jar:libraries/com/google/code/gson/gson/2.8.9/gson-2.8.9.jar:libraries/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar:libraries/com/google/guava/guava/31.0.1-jre/guava-31.0.1-jre.jar:libraries/com/mojang/authlib/3.11.49/authlib-3.11.49.jar:libraries/com/mojang/brigadier/1.0.18/brigadier-1.0.18.jar:libraries/com/mojang/datafixerupper/5.0.28/datafixerupper-5.0.28.jar:libraries/com/mojang/javabridge/1.2.24/javabridge-1.2.24.jar:libraries/com/mojang/logging/1.0.0/logging-1.0.0.jar:libraries/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar:libraries/io/netty/netty-buffer/4.1.77.Final/netty-buffer-4.1.77.Final.jar:libraries/io/netty/netty-codec/4.1.77.Final/netty-codec-4.1.77.Final.jar:libraries/io/netty/netty-common/4.1.77.Final/netty-common-4.1.77.Final.jar:libraries/io/netty/netty-handler/4.1.77.Final/netty-handler-4.1.77.Final.jar:libraries/io/netty/netty-resolver/4.1.77.Final/netty-resolver-4.1.77.Final.jar:libraries/io/netty/netty-transport/4.1.77.Final/netty-transport-4.1.77.Final.jar:libraries/io/netty/netty-transport-classes-epoll/4.1.77.Final/netty-transport-classes-epoll-4.1.77.Final.jar:libraries/io/netty/netty-transport-native-epoll/4.1.77.Final/netty-transport-native-epoll-4.1.77.Final-linux-x86_64.jar:libraries/io/netty/netty-transport-native-epoll/4.1.77.Final/netty-transport-native-epoll-4.1.77.Final-linux-aarch_64.jar:libraries/io/netty/netty-transport-native-unix-common/4.1.77.Final/netty-transport-native-unix-common-4.1.77.Final.jar:libraries/it/unimi/dsi/fastutil/8.5.6/fastutil-8.5.6.jar:libraries/net/java/dev/jna/jna/5.10.0/jna-5.10.0.jar:libraries/net/java/dev/jna/jna-platform/5.10.0/jna-platform-5.10.0.jar:libraries/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:libraries/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar:libraries/org/apache/logging/log4j/log4j-api/2.17.0/log4j-api-2.17.0.jar:libraries/org/apache/logging/log4j/log4j-core/2.17.0/log4j-core-2.17.0.jar:libraries/org/apache/logging/log4j/log4j-slf4j18-impl/2.17.0/log4j-slf4j18-impl-2.17.0.jar:libraries/org/slf4j/slf4j-api/1.8.0-beta4/slf4j-api-1.8.0-beta4.jar cpw.mods.bootstraplauncher.BootstrapLauncher --launchTarget forgeserver --fml.forgeVersion 43.3.0 --fml.mcVersion 1.19.2 --fml.forgeGroup net.minecraftforge --fml.mcpVersion 20220805.130853 [00:02:42] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher running: args [--launchTarget, forgeserver, --fml.forgeVersion, 43.3.0, --fml.mcVersion, 1.19.2, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20220805.130853] [00:02:42] [main/INFO] [cp.mo.mo.Launcher/MODLAUNCHER]: ModLauncher 10.0.8+10.0.8+main.0ef7e830 starting: java version 17.0.10 by Eclipse Adoptium; OS Linux arch amd64 version 6.1.0-12-amd64 [00:02:43] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/home/container/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar%2363!/ Service=ModLauncher Env=SERVER [00:02:43] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/fmlcore/1.19.2-43.3.0/fmlcore-1.19.2-43.3.0.jar is missing mods.toml file [00:02:43] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/javafmllanguage/1.19.2-43.3.0/javafmllanguage-1.19.2-43.3.0.jar is missing mods.toml file [00:02:43] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/lowcodelanguage/1.19.2-43.3.0/lowcodelanguage-1.19.2-43.3.0.jar is missing mods.toml file [00:02:43] [main/WARN] [ne.mi.fm.lo.mo.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/mclanguage/1.19.2-43.3.0/mclanguage-1.19.2-43.3.0.jar is missing mods.toml file [00:02:44] [main/WARN] [ne.mi.ja.se.JarSelector/]: Attempted to select two dependency jars from JarJar which have the same identification: Mod File: and Mod File: . Using Mod File: [00:02:44] [main/WARN] [ne.mi.ja.se.JarSelector/]: Attempted to select a dependency jar for JarJar which was passed in as source: resourcefullib. Using Mod File: /home/container/mods/resourcefullib-forge-1.19.2-1.1.24.jar [00:02:44] [main/INFO] [ne.mi.fm.lo.mo.JarInJarDependencyLocator/]: Found 13 dependencies adding them to mods collection Latest log [29Mar2024 00:02:42.803] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--launchTarget, forgeserver, --fml.forgeVersion, 43.3.0, --fml.mcVersion, 1.19.2, --fml.forgeGroup, net.minecraftforge, --fml.mcpVersion, 20220805.130853] [29Mar2024 00:02:42.805] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 10.0.8+10.0.8+main.0ef7e830 starting: java version 17.0.10 by Eclipse Adoptium; OS Linux arch amd64 version 6.1.0-12-amd64 [29Mar2024 00:02:43.548] [main/INFO] [mixin/]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=union:/home/container/libraries/org/spongepowered/mixin/0.8.5/mixin-0.8.5.jar%2363!/ Service=ModLauncher Env=SERVER [29Mar2024 00:02:43.876] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/fmlcore/1.19.2-43.3.0/fmlcore-1.19.2-43.3.0.jar is missing mods.toml file [29Mar2024 00:02:43.877] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/javafmllanguage/1.19.2-43.3.0/javafmllanguage-1.19.2-43.3.0.jar is missing mods.toml file [29Mar2024 00:02:43.877] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/lowcodelanguage/1.19.2-43.3.0/lowcodelanguage-1.19.2-43.3.0.jar is missing mods.toml file [29Mar2024 00:02:43.878] [main/WARN] [net.minecraftforge.fml.loading.moddiscovery.ModFileParser/LOADING]: Mod file /home/container/libraries/net/minecraftforge/mclanguage/1.19.2-43.3.0/mclanguage-1.19.2-43.3.0.jar is missing mods.toml file [29Mar2024 00:02:44.033] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select two dependency jars from JarJar which have the same identification: Mod File: and Mod File: . Using Mod File: [29Mar2024 00:02:44.034] [main/WARN] [net.minecraftforge.jarjar.selection.JarSelector/]: Attempted to select a dependency jar for JarJar which was passed in as source: resourcefullib. Using Mod File: /home/container/mods/resourcefullib-forge-1.19.2-1.1.24.jar [29Mar2024 00:02:44.034] [main/INFO] [net.minecraftforge.fml.loading.moddiscovery.JarInJarDependencyLocator/]: Found 13 dependencies adding them to mods collection
    • I am unable to do that. Brigadier is a mojang library that parses commands.
  • Topics

×
×
  • Create New...

Important Information

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