Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Leaderboard

Popular Content

Showing content with the highest reputation since 06/28/21 in Posts

  1. I don't think you can use tags like that in data generation. I would just check at runtime if the item is in the ingots tag but not in the brick or nether brick tags. This way it is dynamic as well, should mods add to these tags.
    1 point
  2. Alright so in a mod I'm working on, we have custom particle effects that behave similarly to the vanilla ones. With the way they work now, I need a ParticleType<?> and an IParticleFactory<ParticleType<?>>. I'm able to get the ParticleType<?> to register using the Register<ParticleType<?>> event just like everything else, however I can't get the ParticleFactoryRegisterEvent to fire. Am I using the wrong event bus, or is something missing on a Forge end? I've tried doing this without registering anything, and just firing the event with some console output, but
    1 point
  3. It does not. It is broken and will cause issues. Registry entries should be initialized at precise times (the registry event). By putting their creation into a static initializer, you break this. Using reflection for this is just ugly and crude. Use DeferredRegister if you want to have a simpler system.
    1 point
  4. Not easily. Forge has an event for this (PlayerDestroyItemEvent), but it seems it is not implemented for armor. You could probably hack something together with CriteriaTriggers.ITEM_DURABILITY_CHANGED, but it would probably not work very well. It's in IForgeItem, which Item implements.
    1 point
  5. Look at ChickenRenderer. Your renderer is missing a crucial part.
    1 point
  6. First you need to check whether you are on the server (World#isClientSide). None of this should be done client side. Do not subscribe to "base class" events such as TickEvent. This means you will receive all subclasses, which in the case of TickEvent is all kinds of things. This is not at all useful. You also need to realize that every type of TickEvent fires twice every tick, once before and once after vanilla logic. Check TickEvent#phase. You need to realize that there is potentially more than one player. You can't just store a static CooldownTracker and expect it to magically be
    1 point
  7. I'm not sure why it doesn't work on the server. Minecraft definitely uses getMaxLocalRawBrightness on the server just fine...
    1 point
  8. BreakEvent is called before the block is removed. So you would have to cancel the event and then replace the block.
    1 point
  9. Well, my friend, it completely worked! Easy, brilliant and simple way to make this. I cannot confirm if the ores spawn only on the surface of lava pools or also floating inside them as all the pools I've found were 1 block deep. It's not exaactly what I envisioned, but for the cool, easy to implement idea, I thank you, and added you to the acknowledgements.
    1 point
  10. Unfortunately I'm also new to modding, so I'm not that familiar with the full code base. Maybe someone else'll know? I still definitely recommend looking into where in the original source the lava pools are spawned and seeing if there's anything you can hook into there, just in case.
    1 point
  11. I'm not on my dev machine so I can't check the code myself, but I'm fairly certain the bee nest generation is attached to and triggered by the tree generation itself. If you want to use that approach, you'll need to hook into the lava pool generation, which I suspect is pretty difficult. Alternatively, I took a peek at some world gen stuff, and have you considered making the valid replacement block be lava source blocks instead of stone? It has the small chance of completely filling an underground lava pool, but otherwise I think it might do what you need.
    1 point
  12. 'init' method still needs a @SubscribeEvent
    1 point
  13. init is never called, because you do not register it to the mod event bus.
    1 point
  14. This is your issue. This code runs on the server, hence you cannot do this here. You have to use DistExecutor for this. However you should probably really just store the RegistryKey in CubeStructure and not the World. Then you do not have this issue at all and you also don't run the risk of causing memory leaks.
    1 point
  15. The method is called getInstance now. There is no reason to store the Minecraft instance in your own field again, it already is a singleton. Simply call getInstance. Store it in a local variable if you want cleaner code. Note that all TickEvents fire twice every tick, you must check TickEvent#phase. Modifying the walking speed on the client will probably get you kicked from the server due to it not allowing you to move at that speed.
    1 point
  16. did you use autoreglib?
    1 point
  17. well, it's not like I wrote the bot
    1 point
  18. There is a much better way, join the Forge discord and use forge-bot.
    1 point
  19. latest log: https://gist.github.com/TheSaikos/1d7fd1c203bcc716d00e65aa56ec87a3 debug log: https://gist.github.com/TheSaikos/5ed12891967473cf9bd9731de8711439 I played in my world with 170+ mods for over 2 months, everything worked fine. Overnight when i tried to load up the world it got stuck on the mentioned screen. My game didn't crash before or anything. Anytime i created a new world i couldn't rejoin it. I already did a clean reinstall and resetted all the config files and it still isn't working. When I removed mods one by one, it would work sometimes, but when I rejoin again it w
    1 point
  20. you also can try to use an AttributeModifier (Attributes#MOVEMENT_SPEED), use the ArmorItem as an example or try to manipulate the player's motion, but that's tricky
    1 point
  21. I would say don't do them at all. They are not used anywhere else but your TileEntity after it has already checked for a matching recipe. If they were programmed correctly, they would always succeed, because obviously the recipe would never have matched if one of them was not an input.
    1 point
  22. First you get the two inputs and the catalyst. You then pass these three stacks to the getResult method. The getResult method then does this: new RecipeWrapper(new InvWrapper(new Inventory(input1, input2, catalyst))) Instead, getResult could just get passed in the IItemHandler you already have (here) and use RecipeWrapper on that.
    1 point
  23. This is just gross, the following coremods are erroring: Performant snowrealmagic supplementaries defaultoptions ars_nouveau ftb ultimine Remove them
    1 point
  24. Yeah, either NBT or a capability should work.
    1 point
  25. You can't really have an instance field like extraArmor in item classes, since items are singleton and every stack will share the same item. This means that for example if one player uses the item and changes the extraArmor field, it will also change for all other players that also have that item.
    1 point
  26. Your serializer is looking for a JsonObject called "output" in the recipe. this key does not exist in your JSON file.
    1 point
  27. IRecipeSerializer is a registry entry. You must register it in the same way you do blocks and items.
    1 point
  28. Oh gosh looks like I tunnel visioned onto the model and layer themselves and it never clicked on me that it was the render event all along. Made a set to store all players that I've added the layer to, now it's smooth like butter. Thanks for the help dude, and also for the grain interaction thing. Scrap that, someone pointed out to me that the renderer is shared for all entities, so yeah, only once at startup.
    1 point
  29. Well, Minecraft runs on the JVM so in that sense, yes.
    1 point
  30. remove the parameters from the Mod.EventBusSubscriber annotation and this code line: MinecraftForge.EVENT_BUS.post(event);
    1 point
  31. you need to render the lines of the box, look at the StructureBlockTileEntityRenderer for an example but basically you render a box with WorldRenderer#renderLineBox
    1 point
  32. Solved: Thank you for your patient help. It works now and believe me, the satisfaction of having a diamond pop out of a grass block after hours of making stupid mistakes is way greater than the satisfaction of just finding a Diamond in survival . This is the final class for registry: package com.FenrisFox86.fenriscore.common.events; import ... @Mod.EventBusSubscriber(modid = FenrisCore.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class LootModifierEvents { @SubscribeEvent public static void registerModifierSerializers(@Nonnull final RegistryEvent.Register<G
    1 point
  33. You now register the class to the event bus (using @EventBusSubscriber) but made the method not static. If you register the class, the method must be static. If you register the instance, it must be non-static. Additionally, @EventBusSubscriber registers to the Forge event bus by default, registry events fire on the mod event bus. Check out the event documentation for more info.
    1 point
  34. Do not put a DeferredRegister and its entries in separate classes (mainly FABRICATOR_CONTROLLER_BLOCK_ITEM and ItemRegistry.ITEMS). Either move FABRICATOR_CONTROLLER_BLOCK_ITEM or make a secondary DeferredRegister for items in BlockRegistry. You have told your TileEntityType that no blocks are valid for it, hence it reports this fact. Pass the valid blocks to the of method.
    1 point
  35. You don't run mods. You put them in the mods folder.
    1 point
  36. The root cause seems to be an issue with "survive". Check if it is up to date, report to the mod author if you're already using the latest version.
    1 point
  37. Instant effects require you to call Effect#affectEntity instead of calling LivingEntity#addPotionEffect. See PotionEntity#func_213888_a for how splash potions do this.
    1 point
  38. Yes finally. I took some suggestions from here The libraries are now embedded and loaded on runtime. I used embed and works perfectly. This is the final configuration: buildscript { repositories { maven { url = 'https://maven.minecraftforge.net' } mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true } } apply plugin: 'net.minecraftforge.gradle' // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. apply
    1 point
  39. Command blocks have a permission level of 2, not 4.
    1 point
  40. Why on earth do you keep calling random methods? Why are you calling Entity#getEntity? Why are you calling onKillCommand? Learn basic Java, instanceof and casting.
    1 point
  41. You have to use DamageSource#getEntity to get the entity doing the attack. Note that this can be null, if you take damage from something that is not an entity.
    1 point
  42. The Forge Git repository only contains patches to the decompiled Minecraft source code. In very simplified terms this means "remove this line from this file" or "add this code here". It does not contain the decompiled game source code. When the Forge installer is built, these patch files are converted to binary patches to the compiled code, these binary patch files are then shipped with the installer. As such the installer again does not contain any Minecraft code. When you then run the installer it takes the vanilla Minecraft jar (or downloads it from Mojang's servers if you don't have i
    1 point
  43. Hi Alright, this is a few things I've had issues with getting to work, so in the title, I've marked them with 1, 2, 3 and 4 for clarity. 1. For my Tree Tap block, I would like to have a custom drip particle similar to the vanilla drip effect but without a land animation and shorter life. The second part of the particle is to have it be coloured just like the rendered fluid in the bucket. I have three files for this: FXDropLiquid.java public class FXDropLiquid extends Particle { private final short red, green, blue; private final float maxAge;
    1 point
  44. Some recent version seems to have changed the default way IntelliJ compiles Gradle project. It used to be that it still used the IntelliJ build system, which puts resources and classes in one folder. Now "Delegate to gradle" seems to be the default, and gradle puts resources and classes in two separate folders. Make sure to set IntelliJ to not delegate to Gradle (https://www.jetbrains.com/help/idea/work-with-gradle-projects.html#delegate_build_actions).
    1 point
  45. SORRY FOR NECROING AN OLD THREAD! If anyone wants examples of how to use DefaultVertexFormats.BLOCK look at net.minecraft.client.renderer.BlockFluidRenderer or If anyone wants examples of how to use DefaultVertexFormats.POSITION_TEX look at net.minecraft.client.renderer.ItemRenderer or RenderTileEntityAlchemicArray.java If anyone wants examples of how to use DefaultVertexFormats.POSITION_TEX_COLOR look at net.minecraft.client.renderer.RenderGlobal or ClientUtil.java Examples for everything except block are pretty easy to find with your IDE's search
    1 point
  46. I've figured out that Minecraft.getMinecraft().getIntegratedServer() works in singleplayer. Because I don't really intend for this to be a server mod, I think I'll just make it not work but not crash when attempting to execute a command on a server: MinecraftServer server = Minecraft.getMinecraft().getIntegratedServer(); if(server == null) { parent.parent.out.println("You cannot run vanilla commands on a server!"); } else { server.getCommandManager().executeCommand(parent, command); } Thanks anyways for the help, Choonster and diesieben!
    1 point


  • Newsletter

    Want to keep up to date with all our latest news and information?
    Sign Up
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.