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/09/21 in all areas

  1. 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
    2 points
  2. This. The reason for this is that DeferredRegister relies on static initializers. If you put your RegistryObjects in some random class it is not guaranteed that that class is actually initialized by the time your DeferredRegister is. Hence: Put the DeferredRegister and its entries in the same class. @ObjectHolder is explained here: https://mcforge.readthedocs.io/en/latest/concepts/registries/#using-objectholder
    1 point
  3. First of all the BLOCKS and ITEMS fields (i.e. your DeferredRegister instances) should not be in a separate class. Put them in the same class or you will have issues. No, you cannot, because then you defeat the entire purpose of DeferredRegister. You must create your registry objects (blocks, items, etc.) in the registry event. DeferredRegister manages this for you. If you don't want this, you can also manually subscribe to RegistryEvent and create and register your things there. You can then use @ObjectHolder to obtain the instances for your registry entries. You can also mix and matc
    1 point
  4. There is none that I know of. But I will be working on a patch to Forge to work around this problem.
    1 point
  5. setDefaultState is called in mojang mappings registerDefaultState you can use the bot an the forge discord server https://discord.com/invite/UvedJ9m EDIT: commands: mcpe -> mojang : !moj -c mcp methode/field/(1.17) class mojang -> mcpe : !mcp -c moj methode/field/(1.17) class this create StateDefinition but set not the default values
    1 point
  6. Add protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> builder) { builder.add(LEVEL); } snippet taken from the CauldronBlock with slight edit
    1 point
  7. You lack this method: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/block/ore/HardOreBlock.java#L51-L54 I'm not sure what the Mojang mapping name is for it, but you still lack it.
    1 point
  8. Look the Forge's source code. In BedBlock, minecrafts uses PlayerEntity#displayClientMessage to display sleep result (which can be success or failure, so "You can only sleep at night"). Just give an ITextComponent (StringTextComponent or TranslationTextComponent in most cases) and set the second boolean to true to send an state text instead of sending it to the chat. So: PlayerEntity player = //Get player here player.displayClientMessage(new StringTextComponent(""), true); I havn't check that, but it should be somthing like that
    1 point
  9. To be tinted your model face needs to have a tintindex set (not -1, which is the default and means "do not tint"). block/cube_all has no tintindex set for any of its faces - as such your model does not get tinted.
    1 point
  10. I don't know if it is documented somewhere, no. We could in general do a little better with our documentation on "how to get started if you have never modded before". It's something I have been meaning to tackle but never get around to doing...
    1 point
  11. In general you should use the version that comes with the Minecraft launcher, as that is what Forge will use as the main target. But you are correct, currently 8-15 are supported. With 1.17 this will change to require Java 16 (this is a change from vanilla Minecraft).
    1 point
  12. You cannot reliably do this. What you can do is try to find out by looking through ModList#getModFiles and check where the class came from. But this is unreliable, which is why for example @EventBusSubscriber requires you to specify the ModID.
    1 point
  13. When calling ForgeConfigSpec.Builder#comment you need to pass a valid comment (not null or empty string). If you do not want a comment, do not call this method.
    1 point
  14. It will give you all of them. This is not true. It lets you iterate through all of them. What? Why? That is pretty bad API design. If you really do need a Class instance, make a service interface that provides that Class.
    1 point
  15. you have to overwrite the DimensionType file (minecraft / data / dimension_type / the_nether.json) create a file with the exact name in this directory, take a look at these two links my dimension type for a new dimension and the minecraft wiki for dimensions (look at the vanilla defaults) https://github.com/Luis-st/Forge-1.16.5-Nero/blob/main/src/main/resources/data/nero/dimension_type/deepslate.json https://minecraft.fandom.com/wiki/Custom_dimension
    1 point
  16. If you want to do this for the client, you have to put the "-Xmx 1024M" etc in the JVM arguments setting of the launcher, yes (don't put the -jar in there).
    1 point
  17. Look at PlayerList#load for how to get player data.
    1 point
  18. Event handler methods must be static when using @EventBusSubscriber. It is something that can have capabilities, simple as that. TileEntity for example implements ICapabilityProvider, because it can have capabilities. Additionally, you can attach additional providers to an already existing one (like in your case, you attach your provider to the already existing capability provider that is the player). In this case the original (player in this case) provider will delegate to your provider when asked for a capability it doesn't know. In effect this means you can add your own
    1 point
  19. Delete this file: cuneiform-server.toml
    1 point
  20. Java 16 is not yet supported.
    1 point
  21. IPacket is a vanilla class, do not use it. SimpleChannel no longer requires your packets to implement a certain interface. Instead you need to supply the following things: An encoder (BiConsumer<MSG, PacketBuffer>). This will be called with your packet instance and a PacketBuffer to write the packet data to the byte stream. This used to be toBytes in IMessage. A decoder (Function<PacketBuffer, MSG>). This will be called with the byte stream data and must decode it into an instance of your packet. This used to be done via a reflective constructor call and fromBytes.
    1 point
  22. This PR would have allowed you to control the movement speed while the item was in use, but the author hasn't responded for a while. If you were to update it, it may be merged for 1.12.1 and possibly 1.11.2.
    1 point
  23. Thanks for showing me the right direction.
    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.