Jump to content

kiou.23

Members
  • Posts

    444
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by kiou.23

  1. yeah, hadn't thought about that guess I'll just have to wait a some hours for decompiling, or get a new pc Thanks anyway
  2. still nothing, I'm trying for the 4th or 5th time I've updated IntelliJ I've changed the mdk version can't I just get a workspace that's already decompiled?
  3. And after running gradlew --stop I just reload the project?
  4. I downloaded the mdk for forge 1.16.4-35.1.10, changed the build.gradle to match the mod info, and then imported the project into IntelliJ IDEA. The IDE is importing the project for 2 hours now, it is running 'decompile'. is it normal for it to take this long? My computer isn't the best, but when I downloaded and imported a 1.16.3 project I don't remember it taking this long? could it be any dependencies or steps I'm missing?
  5. You need to register a configured feature. to do so, you can create a field MY_ORE_CONFIG, of type ConfiguredFeature<?, ?>. Then in the common setup, you want to call Registry.register(), passing in the type of world gen registry (for ores, that's WorldGenRegistries.CONFIGURED_FEATURES), than a string that will be the registry key, and then the actual configured feature. you may want to take a look at the Features class, and see how it creates configured features for ores. For any standard ore you'll use Feature.ORE.withConfiguration(), and pass the feature configurations, which would be a new instance of a OreFeatureConfig. Again, looking at the Features class, and how that class register Configured Features should really simplify thing. After you have the Configured Feature Registered, you need to add it to the biomes generation algorithm. You can do this in the BiomeLoadingEvent. simply check the biome category for the biomes that you want (for instance, if you're adding the ore to the overworld, than don't add it to the Nether and End biomes). you can call BiomeLoadingEvent#getGeneration(), to get the biome's generation algorithm, from there you can call BiomeGenerationSettingsBuilder#getFeatures() to get all the features, and you'd need to pass the Generation Stage, for commom ores: GenerationStage.Decoration.Underground. and from there you can call .add() to add your configured feature (note: .add() will expect a Supplier of a ConfiguredFeature)
  6. Does forge has a dimension data generator? to simplify the process of adding dimensions?
  7. If it's a custom Item that you're implementing you'll need to create a class for it, and override the hasContainerItem and getContainerItem methods, in the getContainerItem you can return the item you want to appear in the crafting slot once the recipe is crafted, in this case you'd want to return the itemStack and damage by one point if it's a vanilla Item you want that behaviour for... I don't know how to help you
  8. you want to use capabilities, here's the docs for them: https://mcforge.readthedocs.io/en/latest/datastorage/capabilities/
  9. https://www.scala-lang.org/
  10. There's a lot of Java and OOP tutorials in Youtube, I personally recommend Derek Banas, as it was with him that I learned Java. this is his Java playlist: https://www.youtube.com/playlist?list=PLE7E8B7F4856C9B19
  11. BiomeGenerationSettingsBuilder#withFeature() returns a new Builder with the passed in feature, it doesn't add the feature to the biomes generation. what you want to call is BiomeGenerationSettingsBuilder#getFeatures().add() you'll pass the generation stage you want your features to be generated in (Decoration.UNDERGROUND_ORES), and you pass a supplier of your feature to the add() method
  12. it'd be easier to help you if you were to provide your code
  13. you tried looking at how the vanilla Ender Chest does it? it's onBlockActivated method should have everything you need
  14. Learning java is the best way of knowing why your code is broken Learn Java "keep in mind that this is not a Java school. You are expected to have basic knowledge of Java before posting here." - this is literally right below the forum title
  15. IItemHandler exposes an interface for handling inventory slots. It can be applied to TileEntities (chests, machines, etc.), Entities (extra player slots, mob/creature inventories/bags), or ItemStacks (portable backpacks and such). It replaces the old IInventory and ISidedInventory with an automation-friendly system. from: https://mcforge.readthedocs.io/en/latest/datastorage/capabilities/#forge-provided-capabilities Edit: you should always use IItemHandler, unless you are calling RecipeManager#getRecipe(), in which case you would need to create a dummy inventory to be passed to the method
  16. oh, actually it's probably because you're passing the wrong player to the isWithinUsableDistance method Edit: this also doesn't solve the problem, but in the ContainerScreen class you don't need to draw the container and player inventory titles to the screen, the method in the super class already does that, so you would be writing it twice
  17. you don't need a block holder you can get any object from the registry by calling RegistryObject#get()
  18. you can make a tile entity, and store the liquid amount as an int, and you'll need to serialize the data to nbt you'll need to make a container and a container screen for the gui and user interaction theGreyGhost has a great tutorial on tile entities: https://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe21_tileentityrenderer
  19. it would be much like the crafting recipes, with a 3x3 matrix. but with an additional ingredient that would be consumed, the recipe would have the crafting pattern, and an extra int. the extra item would be a mod specific item that would hold an int in a nbt, and the recipe would consume what it needed to from this item the crafting would be done in an custom tile entity, I already have implemented the tile entity, and it is able to craft vanilla recipes at the moment. so to get the vanilla recipes I use world.getRecipeManager.getRecipe(), so I suppose I would need my own instance of a custom recipe manager? maybe I can register my recipe type to the world recipe manager?
  20. In my mod, I'm going to have a custom crafting system. But I don't know how I should go about implementing this. for the vanilla recipes, I'm using the data generators, so I thought about making my crafting system be data oriented, and then I could look at the minecraft code to see how they do their systems. but I think it may be more hassle than it's worth. But if not data oriented, then how should I do it? (and if I want to have an api for my mod later on so other devs could make addons, would data oriented with the data generators be the best way to implement?) I'd appreciate guidance on this, thank you
  21. you can, you'll just need to download a bunch of extensions for java and gradle Java Extension Pack: https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack Gradle Support so you can run the gradle tasks: https://marketplace.visualstudio.com/items?itemName=richardwillis.vscode-gradle I tried doing it this way, and I although I rather use vscode than IntelliJ, for the specific purpose of programming in Java, I found IntelliJ better
  22. when the chunk is loaded, calculate the difference between the current time, and the time you stored, and then multiply it by 20. but then I think you would want to divide by 60,000 to know how many times it should have executed? It depends, do you want it to behave as if if it was executing while the game wasn't loaded? so it behaves in "real time"
  23. I'm not 100% sure, as I'm also new to modding. but I think you can do this in the write and read methods. In the write method you can save the current time to the nbt. and in the read method you can get the difference between the current time and the saved time
  24. the game doesn't really tick when the game isn't running but you can call Instant.now().getEpochSecond() to get the current time as a long. you could get this value whenever it unloaded (you can override onChunkUnloaded for instance) and save it in a nbt for instance. then when it loaded back again you could get the current time as a long again and calculated the difference. Then you'd have the elapsed time in seconds. (also: you're not being a jerk, don't worry)
  25. could you post the whole TileEntity class?
×
×
  • Create New...

Important Information

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