Jump to content

CreativeMasterBonin

Members
  • Posts

    16
  • Joined

  • Last visited

CreativeMasterBonin's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Nevermind I switched the case from IS clientside to if it ISN'T clientside. Now the dye-ing process works! Cool!
  2. This is in a block class however, useOn is not in a block class. I am assuming I need to put the updateNeighbor method outside of my condition If(level.isClientSide), because otherwise the level.setBlock() method is ran on the client side because I check for the client side first. Or is perhaps the bug within the setBlock() method itself? level.setBlock(blockPos,blockState.setValue(TYPE,0),0 // <- here?); I had set that number to 3 before and the same behavior happened anyways.
  3. public InteractionResult use(BlockState blockState, Level level, BlockPos blockPos, Player player, InteractionHand hand, BlockHitResult blockHitResult) { ItemStack itemstack = player.getItemInHand(hand); boolean successfullyDyed = false; if (level.isClientSide) { if(player.getAbilities().mayBuild == true){ if(itemstack.getItem() == Items.RED_DYE){ level.setBlock(blockPos,blockState.setValue(TYPE,0),0); successfullyDyed = true; } else if(itemstack.getItem() == Items.ORANGE_DYE){ level.setBlock(blockPos,blockState.setValue(TYPE,1),0); successfullyDyed = true; } else if(itemstack.getItem() == Items.YELLOW_DYE){ level.setBlock(blockPos,blockState.setValue(TYPE,2),0); successfullyDyed = true; } else if(itemstack.getItem() == Items.GREEN_DYE){ level.setBlock(blockPos,blockState.setValue(TYPE,3),0); successfullyDyed = true; } else if(itemstack.getItem() == Items.BLUE_DYE){ level.setBlock(blockPos,blockState.setValue(TYPE,4),0); successfullyDyed = true; } else if(itemstack.getItem() == Items.PURPLE_DYE){ level.setBlock(blockPos,blockState.setValue(TYPE,5),0); successfullyDyed = true; } else{ player.displayClientMessage(Component.translatable("block.thingamajigs.lava_lamp.wrong_dye"), true); return InteractionResult.CONSUME; } // update THIS block, no matter what happens if(successfullyDyed == true){ level.updateNeighborsAt(blockPos,this); level.playSound(null, blockPos, SoundEvents.DYE_USE, SoundSource.BLOCKS, 1.0F, 1.0F); return InteractionResult.SUCCESS; } if(!player.isCreative()) { if (itemstack.getCount() > 1) { itemstack.setCount(itemstack.getCount() - 1); } else { itemstack.setCount(0); } } } } return InteractionResult.CONSUME; } Hey there, I was working on a block's 'use' method, however the behavior is not quite what I wanted. In-game, the block will flash to the desired state, then revert back to the state it was in previously, and won't actually update. I was wondering if perhaps I was updating the block wrong? The only state I am trying to update is an Integer value called 'TYPE' from 0-5 by using dyes.
  4. I was wondering if all you needed to create a block that looked like the end portal (without functionality) was this line of code: ItemBlockRenderTypes.setRenderLayer(ThingamajigsBlocks.END_PORTAL_DECO.get(), RenderType.endPortal()); This line of code was in the setupClient() method with every other block's renderType setup. This is the line of code for the custom block in the Block Registry class: public static final RegistryObject<Block> END_PORTAL_DECO = registerBlock("end_portal_deco", () -> new Block(BlockBehaviour.Properties.of(Material.STONE).strength(10f,100f).requiresCorrectToolForDrops().sound(SoundType.STONE)), ThingamajigsCreativeTab.ALL_ITEMS_TAB); But it was just an invisible block, everything else about it worked however (model, item, recipe, loot_table). I looked at vanilla code and it didn't seem like I was missing a step. Did I forget a crucial step somewhere to make the block render like the end portal?
  5. I've added this line after my eventBus registers in the main mod class... "addNetworkMessage(CoffeeMachineUIButtonMessage.class, CoffeeMachineUIButtonMessage::buffer, CoffeeMachineUIButtonMessage::new, CoffeeMachineUIButtonMessage::handler);" Actually I've removed the line and reverted changes. I'll use ticks instead of buttons for this block. Thanks for the help though.
  6. I deleted the "handleButtonAction" method already, sorry. All I wanted to know was which method in what class was causing the crash...
  7. I was porting an old function from a cheaply made version of this mod that i made a long time ago (trying to redo it all from scratch). I guess the guistate shouldnt be static then (fixed). How would I register messages to my channel? This is my first time dealing with server-related code. Is there a better way I could handle the button click from the client?
  8. I recently was working on a new Coffee Machine with UI. It worked up until a snag with a button. Something with the button message, server and renderer is going on, causing the game to crash. Here is the crash report: https://pastebin.com/zm9jzw8X Here is the Coffee Machine Menu Class: https://pastebin.com/cMrsVhKj Here is the Coffee Machine Screen Class: https://pastebin.com/9dG49b26 Here is the Coffee Machine Button Message Class (the one that seems to be the cause of the crash): https://pastebin.com/n2WcEruV And the Main Mod Class: https://pastebin.com/ZLU7L0N6 I am not sure what is causing the crash, because all the code seems to be right... All the screens and menus were linked and registered properly.
  9. I changed the definition to "BlockState _bs = world.getBlockState(_pos).setValue(WhiteRoadMarking.TYPE,marking_type);" and it worked! Thanks!
  10. I understand that part, I get the position and states of the block from the Level... and that only 1 state can be changed at a time... but... The main problem is that I want the block to not only face the player when placed, but also be the correct state based on the Item's NBTdata. I want the setBlock() method to basically Place a block that faces the player and make's it's 'TYPE' property correspond to the Item's 'marking_type' nbt data. I've looked through Level & Block methods and none seem to really do what I want them to do. If I cannot change 2 properties of a block at the same time, without resetting one of the blockstates, then I'm stumped.
  11. PasteBin Code Item PasteBin Code So I have an item that when right clicked on a block (when shift is held) sets it's NBTdata up by one, and loops back around to 0 when the max value is reached. It works fine. When I right click any block (not shift held down) it places a default state Road Marking block. My intended behavior is to grab the item's NBTdata and player facing position and apply it to the Road Marking block in the world when it is placed. My code partially works, but only 1 of the 2 blockstates is ever updated on the block that is placed. If the "type" blockstate is changed first, only the "facing" blockstate is changed based on which way the player is facing, but if "type" is second, the "facing" blockstate is overwritten by the "type" blockstate, causing the block to only face it's default direction. I'm using the method setBlock() from the LevelAccessor to do this behavior. I'm not sure what I'm doing wrong here, because both blockstates are setup properly. I've included the function in a pastebin link. The pastebin code shows the code if "type" is applied to the block at the current block location after the "facing" blockstate is applied. Also, there is a pastebin for the Item that does the right click actions.
  12. Here something I found out. Modpack still doesn't work, but this core or library was that issue before: lda-0.1.5-corePlugin.jar requests "mp3spi1.9.5.jar" which is a faulty library so I removed whatever mod uses "lda-0.1.5-corePlugin.jar". Now, with a folder named "Ding 2" and the game starts, but a new world created never loads. Since my problems are probably worthless and maybe I should stop being blind or stupid to these things, I think I'll do more research on how the heck this stuff works anyways so I won't be so troublesome. Sorry for wasting your time. ?
  13. I just need a simple "what mod is causing this" explanation: Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release [11:56:48] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [11:56:48] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [11:56:48] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker [11:56:48] [main/INFO] [FML]: Forge Mod Loader version 14.23.4.2725 for Minecraft 1.12.2 loading [11:56:48] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_171, running on Mac OS X:x86_64:10.13.2, installed at /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home [11:56:48] [main/ERROR] [FML]: Contained Dep is not in the jar: mp3spi1.9.5.jar [11:56:48] [main/ERROR] [LaunchWrapper]: Unable to launch java.lang.RuntimeException: An error occurred trying to configure the Minecraft home at /Users/bonin888/Documents/Curse/Minecraft/Instances/Ding! for Forge Mod Loader at net.minecraftforge.fml.relauncher.FMLLaunchHandler.setupHome(FMLLaunchHandler.java:109) ~[forge-1.12.2-14.23.4.2725.jar:?] at net.minecraftforge.fml.relauncher.FMLLaunchHandler.setupClient(FMLLaunchHandler.java:79) ~[forge-1.12.2-14.23.4.2725.jar:?] at net.minecraftforge.fml.relauncher.FMLLaunchHandler.configureForClientLaunch(FMLLaunchHandler.java:42) ~[forge-1.12.2-14.23.4.2725.jar:?] at net.minecraftforge.fml.common.launcher.FMLTweaker.injectIntoClassLoader(FMLTweaker.java:139) ~[forge-1.12.2-14.23.4.2725.jar:?] at net.minecraft.launchwrapper.Launch.launch(Launch.java:115) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] Caused by: java.lang.IllegalStateException: Invalid contained dep, Missing from jar: mp3spi1.9.5.jar at net.minecraftforge.fml.relauncher.libraries.LibraryManager.extractPacked(LibraryManager.java:247) ~[forge-1.12.2-14.23.4.2725.jar:?] at net.minecraftforge.fml.relauncher.libraries.LibraryManager.extractPacked(LibraryManager.java:199) ~[forge-1.12.2-14.23.4.2725.jar:?] at net.minecraftforge.fml.relauncher.libraries.LibraryManager.cleanDirectory(LibraryManager.java:165) ~[forge-1.12.2-14.23.4.2725.jar:?] at net.minecraftforge.fml.relauncher.libraries.LibraryManager.setup(LibraryManager.java:96) ~[forge-1.12.2-14.23.4.2725.jar:?] at net.minecraftforge.fml.relauncher.FMLLaunchHandler.setupHome(FMLLaunchHandler.java:104) ~[forge-1.12.2-14.23.4.2725.jar:?] ... 5 more Exception in thread "main" [11:56:48] [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: net.minecraftforge.fml.relauncher.FMLSecurityManager$ExitTrappedException [11:56:48] [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at net.minecraftforge.fml.relauncher.FMLSecurityManager.checkPermission(FMLSecurityManager.java:49) [11:56:48] [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at java.lang.SecurityManager.checkExit(SecurityManager.java:761) [11:56:48] [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at java.lang.Runtime.exit(Runtime.java:107) [11:56:48] [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at java.lang.System.exit(System.java:971) [11:56:48] [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at net.minecraft.launchwrapper.Launch.launch(Launch.java:138) [11:56:48] [main/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at net.minecraft.launchwrapper.Launch.main(Launch.java:28) I've looked up this issue, but this issue is very confusing, as none of the ones i've seen match my issue. Yes i've attached the latest.log, and a mod list. Seems as though something is wrong with the jar: [15:14:12] [main/ERROR] [FML]: Contained Dep is not in the jar: mp3spi1.9.5.jar [15:14:12] [main/ERROR] [LaunchWrapper]: Unable to launch Here is the problem jar (not sure why it causes this startup issue): mp3spi1.9.5.jar (Allows java to use mp3 files.) BTW, this issue isn't technically a crash, but the game doesn't say its a crash, it just displays the launcher log text. But it never said "The Game has crashed". If you know what mod uses this library, please tell me so I can remove it.. latest.log modlist2018
  14. Sorry, i've already noted that ANY liquid except Minecraft Water and Lava crashes the game. And I'm sorry, but I already DID read the crash report. Also, When I removed the mod with "oliveoil" in it (though really you needed to have said "Olive Oil", makes more sense), it still crashes, with water (dynamic liquids), then lava (dynamic liquids), then "iron?".. I'm sure this is either a corrupted mod problem, or maybe I dumb and don't know my mod compatibility list well. I later removed several mods. They did not fix anything. It was the red power mod pack, and forge multipart and associated mods using forge multipart. Also the colored lighting mod was removed too, but surprisingly it did not fix my problem. Later I added TConstruct, and removed codechickencore, mrtbjcore, and another core from the list, the game still starts normally, however, at that point, it still crashed. And not thinking, I through all the mods away and the crash logs. now I'm furious at me for not saving the logs. But, once again, It said: -- Item being rendered -- Item NBT: {FluidName:"iron",Amount:1000} as the problem. And now TConstruct was crashing my game! I think the forge bucket model might be the problem.
  15. If this is still about the mod "Orespawn" you might need to clarify "What" Orespawn mod it is. Is it the one with the crazy mobs pack? Or is it the Orespawn where ore spawn viens and other misc ore features are edited? Be very specific, also, I believe that neither Orespawn mods support 1.12.2 currently, and, if one does, its probably only editing features behind the scenes, or, the mod is a zip file, and will not load unless its a .jar file.
×
×
  • Create New...

Important Information

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