Update Trinkets api

This commit is contained in:
modmuss50 2021-07-23 00:43:57 +01:00
parent baf033036a
commit 482fe4f01f
2 changed files with 16 additions and 13 deletions

View file

@ -42,13 +42,23 @@ repositories {
}
maven {
url "https://maven.shedaniel.me/"
content {
includeGroup "me.shedaniel"
includeGroup "me.shedaniel.cloth"
includeGroup "dev.architectury"
}
}
maven {
url = 'https://ladysnake.jfrog.io/artifactory/mods'
content {
includeGroup "io.github.onyxstudios.Cardinal-Components-API"
}
}
maven {
url = "https://jitpack.io"
content {
includeGroup "com.github.dexman545"
includeGroup "com.github.emilyploszaj"
includeGroup "io.github.onyxstudios.Cardinal-Components-API"
}
}
}
@ -72,7 +82,7 @@ license {
group = 'TechReborn'
allprojects {
version = "5.0.4-beta"
version = "5.0.5-beta"
def build_number = ENV.BUILD_NUMBER ?: "local"
version = "${version}+build.$build_number"
@ -150,7 +160,7 @@ dependencies {
include project(":RebornCore")
optionalDependency "me.shedaniel:RoughlyEnoughItems-fabric:6.0.264-alpha"
disabledOptionalDependency ('com.github.emilyploszaj:trinkets:2.6.7')
disabledOptionalDependency "com.github.emilyploszaj:trinkets:3.0.2"
disabledOptionalDependency "com.github.dexman545:autoswitch-api:-SNAPSHOT"
disabledOptionalDependency 'net.oskarstrom:DashLoader:2.0'

View file

@ -24,7 +24,6 @@
package techreborn.compat.trinkets;
import dev.emi.trinkets.api.TrinketComponent;
import dev.emi.trinkets.api.TrinketsApi;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Items;
@ -34,14 +33,8 @@ import java.util.function.Predicate;
public class Trinkets {
public static Predicate<PlayerEntity> isElytraEquipped() {
return playerEntity -> {
TrinketComponent component = TrinketsApi.getTrinketComponent(playerEntity);
for (int i = 0; i < component.getInventory().size(); i++) {
if (component.getInventory().getStack(i).getItem() == Items.ELYTRA) {
return true;
}
}
return false;
};
return playerEntity -> TrinketsApi.getTrinketComponent(playerEntity)
.map(component -> component.isEquipped(Items.ELYTRA))
.orElse(false);
}
}