-
Posts
42 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Oen44's Achievements
Tree Puncher (2/8)
5
Reputation
-
Didn't even notice that &1. Everything works now, time to move on, thank you! Thread can be closed.
-
Great, added few more methods from your code, had to edit few parts but now it works. #Edit Actually there is one more thing. Looks like whenever I'm rejoining the world, blocks are facing different direction, like its not saving.
-
[19:17:40] [Client thread/ERROR] [FML]: Exception caught during firing event net.minecraftforge.event.RegistryEvent$Register@9f3d1b9: java.lang.IllegalArgumentException: Cannot set property PropertyDirection{name=facing, clazz=class net.minecraft.util.EnumFacing, values=[north, south, west, east]} as it does not exist in BlockStateContainer{block=minecraft:air, properties=[]} at net.minecraft.block.state.BlockStateContainer$StateImplementation.withProperty(BlockStateContainer.java:221) ~[BlockStateContainer$StateImplementation.class:?] at eu.includespark.rpgmod.blocks.NoticeBoardBlock.<init>(NoticeBoardBlock.java:22) ~[NoticeBoardBlock.class:?] at eu.includespark.rpgmod.blocks.ModBlocks.registerBlocks(ModBlocks.java:26) ~[ModBlocks.class:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_4_ModBlocks_registerBlocks_Register.invoke(.dynamic) ~[?:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?] at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:144) ~[EventBus$1.class:?] at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) [EventBus.class:?] at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:847) [GameData.class:?] at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:628) [Loader.class:?] at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.init(Minecraft.java:514) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:422) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181] 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_181] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_181] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_181] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_181] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:25) [start/:?] public class NoticeBoardBlock extends BlockHorizontal { private final AxisAlignedBB BOUNDING_BOX; public NoticeBoardBlock(String name, Material material, AxisAlignedBB bb) { super(material); BOUNDING_BOX = bb; setUnlocalizedName(name); setRegistryName(name); setDefaultState(getBlockState().getBaseState().withProperty(FACING, EnumFacing.NORTH)); } @Override public boolean isOpaqueCube(IBlockState state) { return false; } @Override public boolean isFullCube(IBlockState state) { return false; } @Override public boolean isFullBlock(IBlockState state) { return false; } @Override public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) { return BOUNDING_BOX; } @Override public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos) { return BOUNDING_BOX; } @Override public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) { return super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, hand).withProperty(FACING, placer.getHorizontalFacing().getOpposite()); } } @Mod.EventBusSubscriber(modid=RPGMod.MODID) public class ModBlocks { private static Block nbLeft; private static Block nbMiddle; private static Block nbRight; private static Block nbLeg; @SubscribeEvent public static void registerBlocks(RegistryEvent.Register<Block> event) { nbLeft = new NoticeBoardBlock("notice_board_left", Material.WOOD, new AxisAlignedBB(0f, 0f, 0.375f, 1f, 1f, 0.625f)).setCreativeTab(RPGMod.creativeTab); nbLeft.setHarvestLevel("axe", 1); nbMiddle = new NoticeBoardBlock("notice_board_mid", Material.WOOD, new AxisAlignedBB(0f, 0f, 0.375f, 1f, 1f, 0.625f)).setCreativeTab(RPGMod.creativeTab); nbMiddle.setHarvestLevel("axe", 1); nbRight = new NoticeBoardBlock("notice_board_right", Material.WOOD, new AxisAlignedBB(0f, 0f, 0.375f, 1f, 1f, 0.625f)).setCreativeTab(RPGMod.creativeTab); nbRight.setHarvestLevel("axe", 1); nbLeg = new BlockBase("notice_board_leg", Material.WOOD, new AxisAlignedBB(0.375f, 0f, 0.375f, 0.625f, 1f, 0.625f)).setCreativeTab(RPGMod.creativeTab); nbLeg.setHarvestLevel("axe", 1); event.getRegistry().registerAll(nbLeft); event.getRegistry().registerAll(nbMiddle); event.getRegistry().registerAll(nbRight); event.getRegistry().registerAll(nbLeg); } @SubscribeEvent public static void registerItemBlocks(RegistryEvent.Register<Item> event) { event.getRegistry().registerAll(new ItemBlock(nbLeft).setRegistryName(nbLeft.getRegistryName())); event.getRegistry().registerAll(new ItemBlock(nbMiddle).setRegistryName(nbMiddle.getRegistryName())); event.getRegistry().registerAll(new ItemBlock(nbRight).setRegistryName(nbRight.getRegistryName())); event.getRegistry().registerAll(new ItemBlock(nbLeg).setRegistryName(nbLeg.getRegistryName())); } @SubscribeEvent public static void registerRenders(ModelRegistryEvent event) { registerRender(Item.getItemFromBlock(nbLeft)); registerRender(Item.getItemFromBlock(nbMiddle)); registerRender(Item.getItemFromBlock(nbRight)); registerRender(Item.getItemFromBlock(nbLeg)); } public static void registerRender(Item item) { ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation( item.getRegistryName(), "inventory")); } } Crash happens on initialization. This line is the issue setDefaultState(getBlockState().getBaseState().withProperty(FACING, EnumFacing.NORTH)); Example blockstate registry JSON { "variants": { "normal": { "model": "rpgmod:notice_board_mid_model" }, "facing=north": {"model": "rpgmod:notice_board_mid_model"}, "facing=south": {"model": "rpgmod:notice_board_mid_model"}, "facing=west": {"model": "rpgmod:notice_board_mid_model"}, "facing=east": {"model": "rpgmod:notice_board_mid_model"} } } I'm trying to make custom block face the player when placed.
-
How different mods handle custom advancements rendering? This can't be just JSON, there must be something more, but I can't find anything about that. Most of them are allowing to press on one of the advancements and see more details or there are lists of required items in the tooltip. Even something small as positions and custom image for the lines connecting advancements together. Opening different windows with different advancements using items instead of the one with default hotkey "L". Should I look for specific classes and override their methods or what's up with that? #Edit Looks like it's made using Triumph and Better Advancements. Not sure how to add that to my mod as these mods are mostly used in modpacks.
-
- 1
-
I don't think that it will ever be 100% complete. It's a big project, bugs are always going to appear (not always big one).
-
Oen44 changed their profile photo
-
Code-Style #1
-
At some point I had that, should have pay more attention while tidying code. Thanks for noticing that and help.
-
So I should extend Client and Sever proxy with Common and register capabilities inside Common?
-
Should I register that on client AND server proxy? Does it matter?
-
Why should I prevent client from using capabilities? No need for that.
-
-
There are MC files.
-
Your workbench has less slots, right? Use that to compare.
-
Check InventoryCrafting inv in matches method Return false if it's not yours crafting.
-
Post details about java version etc.