Jump to content

Simon_kungen

Members
  • Posts

    151
  • Joined

  • Last visited

Everything posted by Simon_kungen

  1. How do I add it to the client in order for me to use it?
  2. Ok, how would I for example just add JEI as a regular mod to the runtime and then add Curios API as a dependency?
  3. So, should I downgrade to a lower version of Gradle? Or can I use my current version with some changes, and what should that be? I thought I might be able to just replace compile with implementation, but it doesn't seem to be that easy as my IDE doesn't recognize that either. 17:50:12: Executing task 'runClient'... FAILURE: Build failed with an exception. * Where: Build file '~/Files/Minecraft/Mods/Open/IntercraftCore/build.gradle' line: 23 * What went wrong: A problem occurred evaluating root project 'IntercraftCore'. > Could not find method implementation() for arguments [mezz.jei:jei-1.14.4:1.13.2-5.0.0.27] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 0s Could not find method implementation() for arguments [mezz.jei:jei-1.14.4:1.13.2-5.0.0.27] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. 17:50:12: Task execution finished 'runClient'.
  4. Hi Whenever I try and add a mod to the source the build instantly crashes. ... dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true compile "mezz.jei:jei-${mc_version}:${jei_version}" ... It has been like for a while, but because I didn't necessarily need that mod I just didn't bother with it. But now I need to add some other mods I would like to use, such as Curios API. build.gradle Even the suggested examples don't seem to work either: compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' Run
  5. I ended up with this solution and created two new blocks just as a temporary block placement. public static void onExplosion(final ExplosionEvent event) { Random random = new Random(); if (!event.getWorld().isRemote) { for (BlockPos pos : event.getExplosion().getAffectedBlockPositions()) { Block block = event.getWorld().getBlockState(pos).getBlock(); if (BlockTags.getCollection().getOrCreate(cobblestoneID).contains(block)) { if (random.nextInt(9) == 0) { if (random.nextInt(9) == 0) event.getWorld().setBlockState(pos, IntercraftBlocks.SANDSUBSTITUTE.getDefaultState()); else event.getWorld().setBlockState(pos, IntercraftBlocks.GRAVELSUBSTITUTE.getDefaultState()); } } else if (BlockTags.getCollection().getOrCreate(gravelID).contains(block)) { if (random.nextInt(9) == 0) { event.getWorld().setBlockState(pos, IntercraftBlocks.SANDSUBSTITUTE.getDefaultState()); } else { event.getWorld().setBlockState(pos, IntercraftBlocks.GRAVELSUBSTITUTE.getDefaultState()); } } } } } I then did a generic loot table drop where it drops the vanilla variant. Something I was wondering though is how I would make this hardcoded drop value to be in JSON format? n% chance for this drop, and otherwise this drop instead. The only thing I found was the looting and fortune functions, but those only apply if broken with a tool. Do I have to make my own function for that? Because I would prefer doing it all in JSON format if it's possible.
  6. I did a kind of clunky solution to this: switch (destroyer) { case "minecraft:explosion": { if (lootContext.get(LootParameters.THIS_ENTITY) == null) { System.out.println("It was a explosion (probably)!"); return true; } break; } case "minecraft:player": { if (lootContext.get(LootParameters.THIS_ENTITY) instanceof PlayerEntity) { System.out.println("It's a player!"); return true; } break; } } I simply went by extermination method narrowing it down until I'm pretty sure I know what it is. Something I noticed was that I have no way of checking if it was destroyed from the fill command or an explosion. My second idea is to check in a 3x3 block radius after an explosion. What is that smoke effect? A temporary entity or something else? But at this point, this feels like its getting far too complicated than it needs to be. The plan was to when Cobblestone explodes there is a chance for it to drop Gravel instead, and then blowing up Gravel can turn it into Sand. I did this function first, but I got stuck as there is no way of changing what a block drops, so I changed the blocks right before they blew up, too short for us to notice, but gets the effect of some of it turning into Gravel/Sand. public static void onExplosion(final ExplosionEvent event) { Random random = new Random(); if (!event.getWorld().isRemote) { for (BlockPos pos : event.getExplosion().getAffectedBlockPositions()) { Block block = event.getWorld().getBlockState(pos).getBlock(); if (BlockTags.getCollection().getOrCreate(cobblestoneID).contains(block)) { if (random.nextInt(9) == 0) event.getWorld().setBlockState(pos, Blocks.GRAVEL.getDefaultState()); } else if (BlockTags.getCollection().getOrCreate(gravelID).contains(block)) { if (random.nextInt(9) == 0) event.getWorld().setBlockState(pos, Blocks.SAND.getDefaultState()); } } } } But then there is the problem of some of the Gravel turning into Flint, which isn't supposed to happen.
  7. Hi I needed a way to check if a block was destroyed by an explosion or not, but I might have more uses with this if I make it more generic, as in checking if the block has been removed by a certain thing such as a player or a Enderman, or by an explosion. DestroyedBy:java How do I get what destroyed a block?
  8. Could you post the log? In the meantime, you can try and use vanilla Minecraft's grass model and see if that works (minecraft:block/grass_block). And I would recommend creating a different block class for your grass block if you are going to add more blocks in your mod, it can get cluttered pretty easily.
  9. My current plan now is to make a capability and then attach it to every chunk, and then do a test searching for my multiblock: Then it should when it finds it adds that block as the origin. But here I've encountered my first problem: In order for the pattern recognizer to check it needs an origin block position to check from. And that would be the lowest x and z coordinate in the chunk, which I do not know how to check for. I think it would be best to check for just the very top layer in the chunk to avoid slowing down the server too much. But I do not know how to get the chunk's local (0-15) x and z coordinate and go from there. I can get the y coordinate but the other two are unknown.
  10. I could guess he is talking about MultiMC, which is not made by Forge and doesn't support versions of Forge for 1.13+ yet which is detailed here.
  11. Hi I had in the title "multiblock" because what I'm trying to achieve is pretty close to being a standard multiblock structure, but it would not function as a traditional one like a machine. A multiblock recognizing eight (8) blocks from vanilla which when recognizing the pattern will add a timer for n amount of time, and when it reaches 0 will turn the bottom four (4) into another block. I would like to add a feature to make Clay renewable by submerging three (3) Dirt blocks and one (1) Gravel block in a 4x4 underwater, and will over time turn those four blocks into four Clay blocks ready to be harvested. I do not know how to efficiently check for this without lagging the server. Checking for four Water blocks would be disastrous, checking for Dirt or Gravel would be pretty hard on the server too, and then there is the problem of adding a timer to a recognized multiblock of vanilla blocks. Something I could do to make the pattern recognizing more efficient would check for clear sky, I just thought of. But I do not know how to check for that underwater.
  12. Umm, I haven't used that before. I tried the "Debug" button instead of the "Run" button in IntelliJ idea and didn't see any differences between that and the regular run mode.
  13. Using things such as the Debug Stick to change the blockstate imminently changes it back again.
  14. I have a visual blockstate changing whenever it is on or not. Then I have the variable whenever it CAN load that chunk in the TileEntity.
  15. Hi This is a little over the place, but I'm going to try and summarize to the best of my ability: I have a block which affects a whole chunk (a Chunkloader to be exact), and I have made so additional Chunkloaders placed in the same chunk will simply "turn off". The TileEntities tick, and should only do the stuff if the canLoad variable is true. So if I place a second Chunkloader in the same chunk it will make it disabled. I want when it has one of the other Chunkloaders removed it should check if it is the last one there, and if it is disabled it should be allowed to be turned back on: BlockChunkloader.java The strange part is that when I do this the first time it works fine, but after I've reloaded the game the canLoad variable has reverted back being disabled and doesn't seem to be affected by having a new Chunkloader placed in the chunk and then removed. The only way of fixing it is to remove the block and place a new one. Which doesn't make any sense. Not sure if it's a logic error I've missed or some other thing.
  16. Not sure if you figured it out, but here is my solution: I did a more mechanical approach to this. I made four VoxelShape variables due to my block being centred to the side of a block and then I checked which direction the blockstate were and did a switch statement to return the correct orientation: //double x1, double y1, double z1, double x2, double y2, double z2 protected static final VoxelShape SHAPE_WEST = Block.makeCuboidShape(10.0D, 1.0D, 5.0D, 16.0D, 11.0D, 11.0D); protected static final VoxelShape SHAPE_EAST = Block.makeCuboidShape(0.0D, 1.0D, 5.0D, 6.0D, 11.0D, 11.0D); protected static final VoxelShape SHAPE_NORTH = Block.makeCuboidShape(5.0D, 1.0D, 10.0D, 11.0D, 11.0D, 16.0D); protected static final VoxelShape SHAPE_SOUTH = Block.makeCuboidShape(5.0D, 1.0D, 0.0D, 11.0D, 11.0D, 6.0D); @Override public VoxelShape getShape(BlockState state, IBlockReader blockReader, BlockPos pos, ISelectionContext selectionContext) { switch (state.get(HORIZONTAL_FACING)) { case WEST: return SHAPE_WEST; case EAST: return SHAPE_EAST; case SOUTH: return SHAPE_SOUTH; default: case NORTH: return SHAPE_NORTH; } } Because of your block being centred in the middle you only need to make two VoxelShape variables, one is for west and east and the other for north and south. @Override public VoxelShape getShape(BlockState state, IBlockReader blockReader, BlockPos pos, ISelectionContext selectionContext) { switch (state.get(HORIZONTAL_FACING)) { case EAST: case WEST: return SHAPE_WEST_EAST; case NORTH: case SOUTH: return SHAPE_SOUTH_NORTH; } }
  17. The closest in vanilla that does Chunkloading would probably be the forceload command. But it does only load it has a lazy chunk, which is probably going to be its own separate Chunkloader type. I'm currently deciphering the command so it can be applied to my own Chunkloader type, but I still need a Chunkloader which can process entities.
  18. Not sure if it's taboo about talking about it here, but this Fabric mod is the only example which does not use the ForgeChunkManager. But I'm not even sure how that mod does the loading of the chunk, even after reading through the entire project, I narrowed it down to that line. I also updated to 1.14.4 to rule out possible update implementing it again (mappings_version=20190806-1.14.3, forge_version=28.0.49).
  19. Hi I'm going to try and tackle chunk loading now, and I would like to start with just a block that loads the chunk it is present in. It looks like I need to use ForgeChunkManager, but I can't find it for some reason. And then I'm not really sure how to use it. ChunkLoaderBaseTileEntity.java
  20. I have everything on Github, here is where the TileEntity and renderer is.
  21. "In order to register a TESR, call ClientRegistry#bindTileEntitySpecialRenderer passing the tile entity class to be renderer with this TER and the instance of the TER to use to render all TEs of this class." Pretty sure that's everything I'm doing:
  22. It feels like there should be a "stitch" function or something I've missed. Something I discovered just now is that the server crashes when I attach the renderer: ClientRegistry.bindTileEntitySpecialRenderer(TreeTapTileEntity.class, new TreeTapTileEntityRenderer()); java.lang.RuntimeException: Attempted to load class net/minecraft/client/renderer/tileentity/TileEntityRenderer for invalid dist DEDICATED_SERVER
  23. Alright, got it to change to the vanilla hardcoded colours, but how would I change it to my own custom colour codes? Such as 0xc1810a? TranslationTextComponent text = new TranslationTextComponent("tooltip.intercraftcore.composition",element.getSymbol(true),element.getPercentage()*100); text.getStyle().setColor(...); tooltip.add(text);
  24. Hi I have this block which can only be placed on logs, which is fine. But it is a TileEntity which has a function that makes a value in it go up over time, I have a simple boolean value whenever it can do that or not. But due to the nature of the block, I would for that boolean value only change to true when the log it is attached is actually a tree log. I don't want the player to just build a wall of logs and then spamming my block on it, at least make it a little harder. So if there is a way to check whenever a block (a wood log in this case) has been placed by a tree growing and not placed by some other way such as the player or part of a village house. I would like to add colour to the tooltip of my item to accommodate people with dyslexia to recognize an element better inside my ore block by-product better. I have an enum of colour codes corresponding to my ores, so checking that is simple, but having it change colour is the problem. My current code for the tooltip: if (flagIn.isAdvanced()) { for (ElementComposition element : this.composition) tooltip.add(new TranslationTextComponent("tooltip.intercraftcore.composition",element.getSymbol(true),element.getPercentage()*100)); } When I tried a simple test to just change the colour I crashed when hovering over the item: tooltip.add(new TranslationTextComponent(I18n.format("tooltip.intercraftcore.composition", TextFormatting.AQUA, TextFormatting.RESET),element.getSymbol(true),element.getPercentage()*100)); net.minecraft.util.text.TranslationTextComponentFormatException: Error parsing: TranslatableComponent{key=': %', args=[Cu, 95.0], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}}: Unsupported format: '%'
×
×
  • Create New...

Important Information

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