#Truly Modular: Modular Item API
39 messages · Page 1 of 1 (latest)
this is amazing
This is absolutely insane
tinkers construct is like ... nothing compared to this
This is like if Tinkers and Silent Gear and also Tetra had a child and that child went on to become president
Stack modular crafting also works btw
Also im actually using the item render itself for the ender pearl so funny stuff is possible
did i mention its fully datadriven?
What the fuck
Dude this is going to become huge
If it's for 1.20, I guarentee it'll be added to the new ATM pack
its for 1.20.1
although most things are so that might not say a whole lot
I am very confident it'll be seen in there
This mod is incredible
Like, even the GUI looks really clean so far
welp, we are already planning the next gui rework
guis are pure pain not gonna lie
Yes, yes they are. GUIs suck. You guys are awesome for taking the time to make an actually good one
I'm actually really excited for this mod
feel free to bugtest the existing alpha versions^^ there are probably hundrets of bugs im not aware of +_+
Evil laughter
the effects (ie explosions) are done in code then referenced through hooks in the data file?
like "on_block_hit": "miapi:medium_explosion"
oh yea itd be good if you can reference mcfunction files
Not quite
Truly modular uses a property system
So the json in question is
"explosion_projectile": {
"destroyBlocks": false,
"strength": 2
},
the full json in question is sth called a synergy, where under certain condition a item receives different properties
and the java code for the explosions looks like this
public class ExplosionProperty extends CodecBasedProperty<ExplosionProperty.ExplosionInfo> {
public static final String KEY = "explosion_projectile";
public static final Codec<ExplosionInfo> codec = AutoCodec.of(ExplosionInfo.class).codec();
public ExplosionProperty() {
super(KEY, codec);
MiapiProjectileEvents.MODULAR_PROJECTILE_ENTITY_HIT.register(event -> {
ExplosionInfo info = this.get(event.projectile.asItemStack());
if (info != null) {
explode(info, event.projectile, event.entityHitResult);
if (!event.projectile.getWorld().isClient()) {
event.projectile.discard();
return EventResult.interruptTrue();
}
}
return EventResult.pass();
});
MiapiProjectileEvents.MODULAR_PROJECTILE_BLOCK_HIT.register(event -> {
ExplosionInfo info = this.get(event.projectile.asItemStack());
if (info != null) {
explode(info, event.projectile, event.blockHitResult);
if (!event.projectile.getWorld().isClient()) {
event.projectile.discard();
return EventResult.interruptTrue();
}
}
return EventResult.pass();
});
}
private void explode(ExplosionInfo info, ItemProjectileEntity projectile, HitResult result) {
World.ExplosionSourceType explosionSourceType = World.ExplosionSourceType.TNT;
if(!info.destroyBlocks){
explosionSourceType = World.ExplosionSourceType.NONE;
}
projectile.getWorld().createExplosion(projectile, result.getPos().getX(), result.getPos().getY(), result.getPos().getZ(), info.strength, explosionSourceType);
}
public static class ExplosionInfo {
public boolean destroyBlocks = false;
public float strength = 1.0f;
}
}
Tipped arrows are boring