
Posts posted by Cadiboo
-
-
-
-
-
-
-
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.
-
-
-
-
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.
-
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.).
-
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+
-
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.
-
-
Sorry we don't support 1.7.10 on this forum anymore due to its age (4+ years old). We simply don't know how to help you anymore. You can go to the Minecraft Forum where I think that they still still support older versions, or update to a modern version of Minecraft (the latest version or the one before it) to receive support on this forum.
Try removing lumien
-
3 minutes ago, DeathAdder516 said:
Server crashed upon loading possible mod conflicts could someone give me a hand with this one?
Crash Log - https://pastebin.com/6jqd2bfr
Make a new thread. Don't hijack someone else's
-
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 } }
-
-
-
-
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)
-
-
-
Logger not functioning in eclipse
in Modder Support
Sorry, just realised - Start a new thread, don't hijack someone else's. And post your code in the new thread