Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Cadiboo

Members
  • Joined

  • Last visited

Posts posted by Cadiboo

  1. Capabilities are just a way provide a good API for getting stuff from a thing.

     

    They are pretty much a better & more compatibile method than using interfaces 

     

    For example:

    Using interfaces (example: “IHasInventory”)

    public class Thing implements IHasInventory {

    @Override

    public Inventory getInventory() {

    // return this thing’s inventory

    }

     

    }

     

    With the previous example, using this:

    if(thing instanceof IHasInventory) {

    // do stuff

    }

    is the same as doing this (with capabilities)

    if(thing.hasCapability(INVENTORY_CAP)) {

    // do stuff

    }

     

    I’ll go through & Edit this with my computer later, but the point I’m trying to make is:

    Capabilities and Interfaces are two different approaches to a problem, with capabilities being the newer and “better” approach.

     

    using instanceof with interfaces is the same as using hasCapability with capabilities

     

    using ((Interface)object).getThing() with interfaces is the same as using getCapability with capabilities

     

    capabilities also allow for extra data to be passed in (like facing in the case of forge’s implementation) which is one of the major advantages of capabilities over interfaces.

    Also interfaces were designed for something different.

    Also capabilities use the OOP principle “composition over inheritance” which is what code in all OOP languages globally is changing too. 

  2. 5 minutes ago, Kinniken said:

    external content creators as it means that their villagers won't get auto-included.

    This is exactly WHY you should use JSON, they will add their villages with JSON.

     

    I'm arguing for JSON advancements because thats the standard (How vanilla does it). If you want to use another method just make sure that it will support data packs etc.

  3. Modding with Minecraft Forge is pretty simple, but it has quite a few conventions & pre-requisites that are unique to it and are actually pretty important and vital to having your mod work properly. You might want to take a look at https://github.com/Cadiboo/Example-Mod. It’s a bare-bones mod setup to allow you to play around and learn the basics of Forge Modding in (in the correct way, using the right conventions etc.).

  4. Are we forgetting 1.7.10 -> 1.8? The entire rendering system changed completely.

    2 hours ago, PolygonFruits said:

    The Flattening in 1.13

    The flattening itself isn't a problem, its a code choice made by Mojang now that they've (finally) expanded the block ID limit and abstracted away metadata. The real change with 1.13 is Terrain Gen.

     

    Also in 1.13 Forge has rewritten its entire mod loading system and should now support Java 9+

  5. 12 hours ago, Kinniken said:

    If mod pack makers want to add advancements that refer to my mod that's great, but the default ones should be left as is.

    What if they disagree, and want to change stuff? If you have it all in code they will have to create a copy of your mod, edit it, redistribute it etc. If you do it in JSON all then need to do is edit the JSON file.

    9 hours ago, Kinniken said:

    generate the JSON from code

    Very doable, and not that ugly.

  6. ·

    Edited by Cadiboo

    13 minutes ago, D0XY said:

    How can I resume a loop after it reaches the needed ticks?

    I assume have a counter, increment that counter every tick, and only act if the delay has been reached

    (pseudocode)

    private static int counter = 0;
    //inside tick event
    {
    	counter++;
    	if((counter % interval) == 0) {
    		//do stuff
    	}
    }

    or to add pseudocode for @V0idWa1k3r's answer

    private static final int DELAY = 1 * 20; //1 second;
    private static int delayCounter = DELAY;
    //inside tick event
    {
    	delayCounter--;
    	if(delayCounter == 0) {
    		delayCounter = DELAY;
    		//do stuff
    	}
    }
  7. Ok, do you know what a method is?

    right now your trying to define a method inside another method. This will never* work. I see you tried to fix your issue by removing “public AxisAlignedBB”, but your still trying to define a method inside a method, you’ve just now mangled the inner method. What you need to do where your trying to define the second (where your sure the entity is a player) method is run some code adding custom bounding boxes (look at fences), and otherwise (if the entity is not a player) call super (or run other logic).

     

     

    *unless your instantiating an anonymous class (which you won’t learn about for a long time and may never need)

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.