Skip to content

Commit

Permalink
Fixed tree_felling.json
Browse files Browse the repository at this point in the history
  • Loading branch information
RaymondBlaze committed Apr 13, 2022
1 parent 90a4c8e commit af3b99e
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 7 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ repositories {
}

dependencies {
minecraft 'net.minecraftforge:forge:1.18.1-39.1.2'
minecraft "net.minecraftforge:forge:${project.forge_version}"

implementation fg.deobf(group: 'top.theillusivec4.caelus', name: 'caelus-forge', version: "${project.minecraft_version}-${project.caelus_version}")
implementation fg.deobf(group: 'top.theillusivec4.caelus', name: 'caelus-forge', version: "${project.caelus_version}")
implementation fg.deobf("curse.maven:origins-474438:${project.origins_version}")

annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ org.gradle.daemon=false
mappings_version=2022.02.13-1.18.1

# Mod Properties
mod_version=1.0.0
mod_version=1.0.1
mod_id=origins_classes
mod_author=LimonBlaze
maven_group=limonblaze.originsclasses
archives_base_name=origins-classes-forge

# Dependencies
caelus_version=3.0.0.2
caelus_version=1.18.1-3.0.0.2
origins_version=3747132
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package limonblaze.originsclasses.common.apoli.condition.item;

import com.mojang.serialization.Codec;
import io.github.edwinmindcraft.apoli.api.configuration.FieldConfiguration;
import io.github.edwinmindcraft.apoli.api.power.factory.ItemCondition;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraftforge.common.ToolAction;

import javax.annotation.Nonnull;

public class ToolActionCondition extends ItemCondition<FieldConfiguration<String>> {

public ToolActionCondition() {
super(FieldConfiguration.codec(Codec.STRING, "tool_action"));
}

@Override
protected boolean check(FieldConfiguration<String> configuration, @Nonnull Level level, ItemStack stack) {
return stack.canPerformAction(ToolAction.get(configuration.value()));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public record MultiMineConfiguration(float speedMultiplier,
.forGetter(x -> Optional.of(x.speedMultiplier)),
CalioCodecHelper.optionalField(ConfiguredBlockCondition.CODEC, "block_condition")
.forGetter(x -> Optional.ofNullable(x.blockCondition)),
CalioCodecHelper.optionalField(ConfiguredItemCondition.CODEC, "block_condition")
CalioCodecHelper.optionalField(ConfiguredItemCondition.CODEC, "item_condition")
.forGetter(x -> Optional.ofNullable(x.itemCondition)),
CalioCodecHelper.optionalField(ConfiguredEntityAction.CODEC, "entity_action")
.forGetter(x -> Optional.ofNullable(x.entityAction))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import io.github.edwinmindcraft.apoli.common.condition.entity.SimpleEntityCondition;
import io.github.edwinmindcraft.apoli.common.condition.item.SimpleItemCondition;
import limonblaze.originsclasses.OriginsClasses;
import limonblaze.originsclasses.common.apoli.condition.item.ToolActionCondition;
import limonblaze.originsclasses.util.PowerUtil;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.animal.Animal;
Expand Down Expand Up @@ -47,6 +48,7 @@ public class OriginsClassesConditions {
new SimpleItemCondition(stack -> stack.getItem() instanceof ArmorItem armor && armor.getSlot() == EquipmentSlot.LEGS));
public static final RegistryObject<SimpleItemCondition> SHOES = ITEM_CONDITIONS.register("shoes", () ->
new SimpleItemCondition(stack -> stack.getItem() instanceof ArmorItem armor && armor.getSlot() == EquipmentSlot.FEET));
public static final RegistryObject<ToolActionCondition> TOOL_ACTION = ITEM_CONDITIONS.register("tool_action", ToolActionCondition::new);

public static final DeferredRegister<BlockCondition<?>> BLOCK_CONDITIONS = DeferredRegister.create(ApoliRegistries.BLOCK_CONDITION_CLASS, OriginsClasses.MODID);
public static final RegistryObject<SimpleBlockCondition> CROP = BLOCK_CONDITIONS.register("crop", () ->
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ side = "BOTH"
[[dependencies.origins-classes]]
modId = "origins"
mandatory = true
versionRange = "[1.3.1.14,)"
versionRange = "[1.18.1-1.3.1.14,)"
ordering = "NONE"
side = "BOTH"
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"type": "origins_classes:lumberjack"
"type": "origins_classes:lumberjack",
"item_condition": {
"type": "origins_classes:tool_action",
"tool_action": "axe_dig"
}
}

0 comments on commit af3b99e

Please sign in to comment.