Skip to content

Commit

Permalink
Merge branch 'master' into no-arch
Browse files Browse the repository at this point in the history
# Conflicts:
#	build.gradle
#	fabric/src/main/java/org/samo_lego/taterzens/fabric/TaterzensFabric.java
#	gradle.properties
  • Loading branch information
samolego committed Mar 16, 2023
2 parents 69e87f1 + f417290 commit 32a47d2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry;
import net.minecraft.core.registries.BuiltInRegistries;
import org.samo_lego.taterzens.Taterzens;
import org.samo_lego.taterzens.api.TaterzensAPI;
import org.samo_lego.taterzens.fabric.commands.MessagesReorderCommand;
import org.samo_lego.taterzens.fabric.compatibility.carpet.AdditionalFunctions;
import org.samo_lego.taterzens.fabric.compatibility.carpet.ScarpetProfession;
Expand All @@ -30,15 +29,16 @@ public void onInitialize() {

// CarpetMod
if (CARPETMOD_LOADED) {
TaterzensAPI.registerProfession(ScarpetProfession.ID, ScarpetProfession::new);
AdditionalFunctions.init();
}

// Events
CommandRegistrationCallback.EVENT.register((dispatcher, context, selection) -> {
Taterzens.registerCommands(dispatcher, context);
MessagesReorderCommand.register(dispatcher);
ScarpetTraitCommand.register();
if (CARPETMOD_LOADED) {
ScarpetTraitCommand.register(); // also registers profession on first init
}
});

UseBlockCallback.EVENT.register(new BlockInteractEventImpl());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import net.minecraft.network.chat.HoverEvent;
import net.minecraft.network.chat.MutableComponent;
import org.samo_lego.taterzens.Taterzens;
import org.samo_lego.taterzens.api.TaterzensAPI;
import org.samo_lego.taterzens.api.professions.TaterzenProfession;
import org.samo_lego.taterzens.commands.NpcCommand;
import org.samo_lego.taterzens.interfaces.ITaterzenEditor;
Expand All @@ -35,9 +36,13 @@
import static org.samo_lego.taterzens.util.TextUtil.translate;

public class ScarpetTraitCommand {
static {
TaterzensAPI.registerProfession(ScarpetProfession.ID, ScarpetProfession::new);
}

public static void register() {
LiteralCommandNode<CommandSourceStack> scarpet = literal("scarpetTraits")
.requires(src -> CARPETMOD_LOADED && Taterzens.getInstance().getPlatform().checkPermission(src, "taterzens.profession.scarpet", config.perms.professionCommandPL))
.requires(src -> Taterzens.getInstance().getPlatform().checkPermission(src, "taterzens.profession.scarpet", config.perms.professionCommandPL))
.then(literal("add")
.requires(src -> Taterzens.getInstance().getPlatform().checkPermission(src, "taterzens.profession.scarpet.add", config.perms.professionCommandPL))
.then(argument("id", StringArgumentType.word())
Expand Down
9 changes: 7 additions & 2 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
jdk:
- openjdk17
before_install:
- wget https://github.com/sormuras/bach/raw/master/install-jdk.sh
- source install-jdk.sh --feature 17
- export SDKMAN_DIR="/home/jitpack/.sdkman/"
- source "/home/jitpack/.sdkman/bin/sdkman-init.sh"
- sdk install java 17.0.1-open
- sdk use java 17.0.1-open

0 comments on commit 32a47d2

Please sign in to comment.