some mod integration fixes
This commit is contained in:
parent
0ac9453f7b
commit
0bc81087fe
@ -1,6 +1,7 @@
|
||||
Flan 1.6.7
|
||||
======================
|
||||
- Yeet players off riding entities when teleporting
|
||||
- Some mod integration fixes
|
||||
|
||||
Flan 1.6.6
|
||||
======================
|
||||
|
@ -53,18 +53,14 @@ dependencies {
|
||||
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
|
||||
|
||||
modImplementation "me.lucko:fabric-permissions-api:${rootProject.fabric_permissions_api}"
|
||||
modCompileOnly("io.github.gunpowder:gunpowder-api:${rootProject.gunpowder_version}") { //Might need changes later
|
||||
|
||||
modCompileOnly("io.github.gunpowder:gunpowder-currency:${rootProject.gunpowder_currency_version}") {
|
||||
exclude group: "com.google.guava", module:"failureaccess"
|
||||
}
|
||||
/*modRuntime("io.github.gunpowder:gunpowder-base:${rootProject.gunpowder_version}") {
|
||||
exclude group: "com.google.guava", module:"failureaccess"
|
||||
}
|
||||
modRuntime("io.github.gunpowder:gunpowder-currency:${rootProject.gunpowder_currency_version}")
|
||||
*/
|
||||
|
||||
//modImplementation "io.github.ladysnake:PlayerAbilityLib:${rootProject.player_ability_lib}"
|
||||
modCompileOnly "io.github.ladysnake:PlayerAbilityLib:${rootProject.player_ability_lib}"
|
||||
|
||||
//modImplementation("dev.ftb.mods:ftb-ranks-fabric:${rootProject.ftb_ranks}")
|
||||
modCompileOnly("dev.ftb.mods:ftb-ranks-fabric:${rootProject.ftb_ranks}")
|
||||
}
|
||||
|
||||
|
@ -8,9 +8,8 @@ import io.github.flemmli97.flan.Flan;
|
||||
import io.github.flemmli97.flan.claim.PermHelper;
|
||||
import io.github.flemmli97.flan.config.ConfigHandler;
|
||||
import io.github.flemmli97.flan.player.PlayerClaimData;
|
||||
import io.github.gunpowder.api.GunpowderMod;
|
||||
import io.github.gunpowder.api.module.currency.dataholders.StoredBalance;
|
||||
import io.github.gunpowder.api.module.currency.modelhandlers.BalanceHandler;
|
||||
import io.github.gunpowder.entities.StoredBalance;
|
||||
import io.github.gunpowder.modelhandlers.BalanceHandler;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
|
||||
@ -33,9 +32,10 @@ public class CommandCurrencyImpl {
|
||||
context.getSource().sendSuccess(PermHelper.simpleColoredText(ConfigHandler.lang.sellFail, ChatFormatting.DARK_RED), false);
|
||||
return 0;
|
||||
}
|
||||
StoredBalance bal = GunpowderMod.getInstance().getRegistry().getModelHandler(BalanceHandler.class).getUser(context.getSource().getPlayerOrException().getUUID());
|
||||
StoredBalance bal = BalanceHandler.INSTANCE.getUser(context.getSource().getPlayerOrException().getUUID());
|
||||
BigDecimal price = BigDecimal.valueOf(amount * ConfigHandler.config.sellPrice);
|
||||
bal.setBalance(bal.getBalance().add(price));
|
||||
BalanceHandler.INSTANCE.updateUser(bal);
|
||||
data.setAdditionalClaims(data.getAdditionalClaims() - amount);
|
||||
context.getSource().sendSuccess(PermHelper.simpleColoredText(String.format(ConfigHandler.lang.sellSuccess, amount, price), ChatFormatting.GOLD), false);
|
||||
return Command.SINGLE_SUCCESS;
|
||||
@ -50,13 +50,14 @@ public class CommandCurrencyImpl {
|
||||
context.getSource().sendSuccess(PermHelper.simpleColoredText(ConfigHandler.lang.buyDisabled, ChatFormatting.DARK_RED), false);
|
||||
return 0;
|
||||
}
|
||||
StoredBalance bal = GunpowderMod.getInstance().getRegistry().getModelHandler(BalanceHandler.class).getUser(context.getSource().getPlayerOrException().getUUID());
|
||||
StoredBalance bal = BalanceHandler.INSTANCE.getUser(context.getSource().getPlayerOrException().getUUID());
|
||||
int amount = Math.max(0, IntegerArgumentType.getInteger(context, "amount"));
|
||||
BigDecimal price = BigDecimal.valueOf(amount * ConfigHandler.config.buyPrice);
|
||||
if (bal.getBalance().compareTo(price) >= 0) {
|
||||
PlayerClaimData data = PlayerClaimData.get(context.getSource().getPlayerOrException());
|
||||
data.setAdditionalClaims(data.getAdditionalClaims() + amount);
|
||||
bal.setBalance(bal.getBalance().subtract(price));
|
||||
BalanceHandler.INSTANCE.updateUser(bal);
|
||||
context.getSource().sendSuccess(PermHelper.simpleColoredText(String.format(ConfigHandler.lang.buySuccess, amount, price), ChatFormatting.GOLD), false);
|
||||
return Command.SINGLE_SUCCESS;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package io.github.flemmli97.flan.integration.permissions.forge;
|
||||
|
||||
import dev.ftb.mods.ftbranks.api.FTBRanksAPI;
|
||||
import io.github.flemmli97.flan.Flan;
|
||||
import io.github.flemmli97.flan.config.ConfigHandler;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
@ -10,18 +11,18 @@ public class PermissionNodeHandlerImpl {
|
||||
public static boolean perm(CommandSourceStack src, String perm, boolean adminCmd) {
|
||||
if (!Flan.ftbRanks || !(src.getEntity() instanceof ServerPlayer player))
|
||||
return !adminCmd || src.hasPermission(ConfigHandler.config.permissionLevel);
|
||||
return /*FTBRanksAPI.getPermissionValue(player, perm).asBoolean().orElse(!adminCmd || */player.hasPermissions(ConfigHandler.config.permissionLevel);
|
||||
return FTBRanksAPI.getPermissionValue(player, perm).asBoolean().orElse(!adminCmd || player.hasPermissions(ConfigHandler.config.permissionLevel));
|
||||
}
|
||||
|
||||
public static boolean perm(ServerPlayer src, String perm, boolean adminCmd) {
|
||||
if (!Flan.ftbRanks)
|
||||
return !adminCmd || src.hasPermissions(ConfigHandler.config.permissionLevel);
|
||||
return /*FTBRanksAPI.getPermissionValue(src, perm).asBoolean().orElse(!adminCmd || */src.hasPermissions(ConfigHandler.config.permissionLevel);
|
||||
return FTBRanksAPI.getPermissionValue(src, perm).asBoolean().orElse(!adminCmd || src.hasPermissions(ConfigHandler.config.permissionLevel));
|
||||
}
|
||||
|
||||
public static boolean permBelowEqVal(ServerPlayer src, String perm, int val, int fallback) {
|
||||
if (Flan.ftbRanks) {
|
||||
int max = fallback;//FTBRanksAPI.getPermissionValue(src, perm).asInteger().orElse(fallback);
|
||||
int max = FTBRanksAPI.getPermissionValue(src, perm).asInteger().orElse(fallback);
|
||||
return val <= max;
|
||||
}
|
||||
return val <= fallback;
|
||||
|
@ -17,11 +17,11 @@ archives_base_name=flan
|
||||
# Dependencies
|
||||
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
|
||||
fabric_version=0.43.1+1.18
|
||||
gunpowder_version=0.5.7+1.16.5
|
||||
gunpowder_currency_version=1.0.2+gunpowder.0.3.7.mc.1.16.5
|
||||
gunpowder_version=1.1.1.0-1.18.1
|
||||
gunpowder_currency_version=1.0.8+gunpowder.1.1.1.1.mc.1.18.1
|
||||
fabric_permissions_api=0.1-SNAPSHOT
|
||||
player_ability_lib=1.2.2
|
||||
ftb_ranks=1605.1.5-build.16
|
||||
ftb_ranks=1801.1.6-build.20
|
||||
dicemcmm=curse.maven:dicemcmoney-406972:3548047
|
||||
|
||||
# Curse properties
|
||||
|
Loading…
Reference in New Issue
Block a user