Code Monkey home page Code Monkey logo

example-mod's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

example-mod's Issues

Update tutorial to 1.16.4

Updating the tutorial to 1.16.3 would be nice as forge now has
a recommended release for it. Some stuff in forge 1.16.3 has changed.

Or if the 1.15.2 tutorial works for 1.16.3 as well please let me know.

Redundant full qualification

/**
* Sets the {@link net.minecraftforge.registries.IForgeRegistryEntry.Impl#setRegistryName(net.minecraft.util.ResourceLocation) Registry Name} and the {@link net.minecraft.item.Item#setTranslationKey(String) Translation Key} (if applicable) for the entry
*
* @param entry the {@link net.minecraftforge.registries.IForgeRegistryEntry.Impl IForgeRegistryEntry.Impl<?>} to set the names for
* @param name the name for the entry that the registry name is derived from
* @return the entry
*/

Since you have the referenced classes already imported for the class, you don't need to fully qualify the classes

Generating structures

Can you also make tutorial(s) and example mod code for generating custom structures? I think that there aren't many tutorials and examples of structure-generating mods (at least for latest Minecraft/Forge versions), so this would be quite nice addition.

Things that I would like to see in such tutorial:

  • Configuration:

    • How common/rare is the structure: Maybe simply how common per certain number of chunks it is, some different or more advanced configuration...
    • Where it spawns: Dimensions and biomes, locations (surface, underground, sky...,), height, near or far from other (both specific and any) structures, depending on terrain (for example at top/bottom/edge of mountain, more plains-like terrain...), some more randomness...
  • Locating structure with /locate command. If the structure is bigger also where exactly should /locate point to.

  • Generation:

    • Directly in code.
    • Using structure blocks.
    • Combinations of both things. For example, modifying structure block-based structure to give it some more randomness, depending on biome or terrain, merging it with terrain, making part of structure using structure blocks and part using code...
  • Bigger structures:

    • Connecting parts of structures to make bigger structure.
    • Directly in code.
    • Using jigsaw block.
    • Again combination of both things. For example, generally using jigsaw block to randomly select next structure part while manually always selecting specific part when and/or until certain condition is meet (height, biome...) and then process normally using jigsaw blocks. Some more specific example: First specific part ("entrance") is randomly chosen, which then uses jigsaw block to randomly chose new part next to entrance, then starts choosing that same part again until some condition is meet (for example height), then again using jigsaw block to create new part and then normally processing generation using jigsaw blocks.

I know this is quite a lot of things, but at least some could be added for start, and other could be added later.

Update: I found TelepathicGrunt/StructureTutorialMod which seems pretty good example mod. Then, you don't really need to create whole new mod for structures, but you could include some things in tutorial, link that existing mod and/or contribute some features that aren't ready yet (like jigsaw block, more advanced generation, spawning configuration...).

Remove method and use EntityEntryBuilder directly

private static <T extends Entity & IModEntity> EntityEntry buildEntityEntryFromClassWithName(final Class<T> clazz, final ResourceLocation registryName, final boolean hasEgg, final int range, final int updateFrequency, final boolean sendVelocityUpdates) {
EntityEntryBuilder<Entity> builder = EntityEntryBuilder.create();
builder = builder.entity(clazz);
builder = builder.id(registryName, entityId++);
builder = builder.name(registryName.getPath());
builder = builder.tracker(range, updateFrequency, sendVelocityUpdates);
if (hasEgg) {
builder = builder.egg(0xFFFFFF, 0xAAAAAA);
}
return builder.build();
}

Class must be either be declared abstract or implement abstract method

Was having trouble not using IHasModel, got linked to your example mod. When using the ModCreativeTabs i get an error from intelliJ like this:

Class 'Anonymous class derived from CustomCreativeTab' must either be declared abstract or implement abstract method 'getTabIconItem()' in 'CreativeTabs'

Here:

public static final CustomCreativeTab CREATIVE_TAB = new CustomCreativeTab(MOD_ID, true) {
    @Override
    public ItemStack createIcon() {
        return TAB_ICON_ITEMSTACK;
    }
};

Also get an error further down the code like this:

Method does not override method from its superclass

Here:

@SideOnly(Side.CLIENT)
@Override
abstract public ItemStack createIcon();

Link to my class: Github

[Feature Request]A FastTESR example would be nice

In modern forge there is an option to render TileEntities in batch with only one draw call greatly reducing the performance impact on the game. However most modders are either not aware of this ability or don't know how to use it which is a real shame since it really helps with the performance of the game. I would like to propose an inclusion of a FastTESR example in this example mod to help beginners understand how it works, maybe with some helper methods. I could make one and submit a PR if you want. Feel free to close this issue if you don't think your example mod needs an example of a FastTESR :)

Blocks not working

I know this is too general a question but using IntelliJ and your example mod code for some reason the block example is not working for me. If there is something simple you have heard about this issue. The items work fine.

Sorry about how non-specific this is.

Thank you, Peter

Populating Ores

Would you be able to add an example of populating the world with example_ore?

Annotate cadiboo.examplemod.api package with the @API annotation

Forge has a specific annotation for packages that are supposed to hold your API, it's the net.minecraftforge.fml.common.API one. A package annotated with this annotation tells forge that everything within that package is a part of a public API provided by a specific mod. It is used internally in forge when for example deciding whether to remove methods annotated with @optional and it is also used in sorting the mod list. It also provides some information to the addonmakers such as the version of the API. To annotate a package create a package-info.java file in your api package and annotate the package line in it with the annotation. This is not strictly necessarry but is generally a good practice.

Adding keybinds

Adding example custom keybinds to the example mod would be helpful :D

Blocks do not appear in Creative Tab

Love this example mod. Nice design. I've just refactored my mod to incorporate some of your ideas. However, using your registration code in my mod, I noticed that none of the blocks I'm registering appear in my mod's custom creative tab. I finally figured out why. You're setting the creative tab on the block's ItemBlock (when you register the ItemBlock) when really I think you need to be setting it for the Block - inside the Block's constructor, for example. This is corroborated by the fact that if you call getCreativeTab for any ItemBlock, it goes and gets it from the Block.

Worldgen is trash

Multiplication instead of bit shifting, add some comments about why you DONT have to offset cords by 8, and when you would

Turn hardcoded registration into dynamic for loop

public static void onRegisterBlocksEvent(final RegistryEvent.Register<Block> event) {
final IForgeRegistry<Block> registry = event.getRegistry();
registry.register(new BlockResource("example_block"));
registry.register(new BlockModOre("example_ore"));
ExampleMod.info("Registered blocks");
registerTileEntities();
ExampleMod.debug("Registered tile entities");
}

ClientEventSubscriber is subscribed on both sides

When using the @Mod.EventBusSubscriber it subscribes the class to the bus on both sides. You can however specify the side it is subscribed on using the value property of the annotation(example). Without specifying it the class will be subscribed on both sides which may lead to issues. While ClientEventSubscriber in your case doesn't load any client-only classes when loaded it gives modmakers a false impression that it will only be loaded on the client(because of the name). They may then decide to expose client-only classes in it(by making their methods return/take them as parameters, or by specifying fields of those types) and thus crashing the server. I recommend you specify the side in your EventBusSubscriber annotation to avoid those issues.
Edit: The same appies to the ServerEventSubscriber class actually.

.

Can I please just download /gradle.properties alone? if not, I can't do anything about coding with this website.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.