Skip to content

Commit

Permalink
Feature fixes (probably but its still not runnning?)
Browse files Browse the repository at this point in the history
  • Loading branch information
EpicSquid committed Jul 9, 2023
1 parent 92338c6 commit 82c6bc1
Show file tree
Hide file tree
Showing 15 changed files with 93 additions and 74 deletions.
9 changes: 4 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,15 @@ dependencies {
// implementation fg.deobf("com.jozufozu.flywheel:flywheel-forge-${minecraftVersion}:${flywheelVersion}")
// implementation fg.deobf("com.simibubi.create:create-${minecraftVersion}:${createVersion}:slim")

// implementation fg.deobf("se.mickelus.mutil:mutil:${minecraftVersion}-${mutilVersion}")
// implementation fg.deobf("se.mickelus.tetra:tetra:${minecraftVersion}-${tetraVersion}")

implementation fg.deobf("curse.maven:mutil-351914:3941314")
implementation fg.deobf("curse.maven:tetra-289712:4628304")
// CurseMaven Deps
implementation fg.deobf("curse.maven:supplementaries-412082:4120070")
implementation fg.deobf("curse.maven:farmers_delight-398521:3999157")
implementation fg.deobf("curse.maven:moonlight-499980:4096609")
implementation fg.deobf("curse.maven:create-328085:4011414")
// runtimeOnly fg.deobf("curse.maven:world-stripper-250603:3921630")
// implementation fg.deobf("curse.maven:jeed-532286:3820697")
runtimeOnly fg.deobf("curse.maven:world-stripper-250603:3921630")
implementation fg.deobf("curse.maven:jeed-532286:4599099")
// implementation fg.deobf("curse.maven:quark-243121:3840125")
// implementation fg.deobf("curse.maven:autoreglib-250363:3642382")
}
Expand Down
4 changes: 1 addition & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,4 @@ modVersion=1.5.0.1
jeiVersion=11.2.0.246
curiosVersion=5.1.1.0
flywheelVersion=0.6.8-12
createVersion=0.5.0.g-17
mutilVersion=4.5.0
tetraVersion=4.9.0
createVersion=0.5.0.g-17
6 changes: 3 additions & 3 deletions src/main/java/com/sammy/malum/MalumMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import static com.sammy.malum.registry.common.item.ItemRegistry.ITEMS;
import static com.sammy.malum.registry.common.recipe.RecipeSerializerRegistry.RECIPE_SERIALIZERS;
import static com.sammy.malum.registry.common.recipe.RecipeTypeRegistry.RECIPE_TYPES;
import static com.sammy.malum.registry.common.worldgen.FeatureRegistry.FEATURE_TYPES;
import static com.sammy.malum.registry.common.worldgen.FeatureRegistry.*;

@SuppressWarnings("unused")
@Mod(MalumMod.MALUM)
Expand Down Expand Up @@ -69,8 +69,8 @@ public MalumMod() {
RECIPE_TYPES.register(modBus);
RECIPE_SERIALIZERS.register(modBus);
FEATURE_TYPES.register(modBus);
// CONFIGURED_FEATURES.register(modBus);
// PLACED_FEATURES.register(modBus);
CONFIGURED_FEATURES.register(modBus);
PLACED_FEATURES.register(modBus);

TetraCompat.init();
FarmersDelightCompat.init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.ItemHandlerHelper;
import net.minecraftforge.items.wrapper.EmptyHandler;
Expand Down Expand Up @@ -42,7 +43,7 @@ public VoxelShape getShape(BlockState p_60555_, BlockGetter p_60556_, BlockPos p
public int getAnalogOutputSignal(BlockState pState, Level pLevel, BlockPos pPos) {
BlockEntity be = pLevel.getBlockEntity(pPos);
if (be instanceof SpiritAltarBlockEntity altar) {
return ItemHandlerHelper.calcRedstoneFromInventory(altar.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).orElse(new EmptyHandler()));
return ItemHandlerHelper.calcRedstoneFromInventory(altar.getCapability(ForgeCapabilities.ITEM_HANDLER).orElse(new EmptyHandler()));
}
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.ItemHandlerHelper;
import net.minecraftforge.items.wrapper.EmptyHandler;
Expand Down Expand Up @@ -69,7 +70,7 @@ public boolean hasAnalogOutputSignal(BlockState pState) {
public int getAnalogOutputSignal(BlockState pState, Level pLevel, BlockPos pPos) {
BlockEntity be = pLevel.getBlockEntity(pPos);
if (be instanceof MultiBlockComponentEntity component) {
return ItemHandlerHelper.calcRedstoneFromInventory(component.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).orElse(new EmptyHandler()));
return ItemHandlerHelper.calcRedstoneFromInventory(component.getCapability(ForgeCapabilities.ITEM_HANDLER).orElse(new EmptyHandler()));
}
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.ItemHandlerHelper;
import net.minecraftforge.items.wrapper.EmptyHandler;
Expand Down Expand Up @@ -51,7 +52,7 @@ public boolean hasAnalogOutputSignal(BlockState pState) {
public int getAnalogOutputSignal(BlockState pState, Level pLevel, BlockPos pPos) {
BlockEntity be = pLevel.getBlockEntity(pPos);
if (be instanceof SpiritCatalyzerCoreBlockEntity catalyzer) {
return ItemHandlerHelper.calcRedstoneFromInventory(catalyzer.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).orElse(new EmptyHandler()));
return ItemHandlerHelper.calcRedstoneFromInventory(catalyzer.getCapability(ForgeCapabilities.ITEM_HANDLER).orElse(new EmptyHandler()));
}
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.ItemHandlerHelper;
import net.minecraftforge.items.wrapper.EmptyHandler;
Expand Down Expand Up @@ -55,7 +56,7 @@ public boolean hasAnalogOutputSignal(BlockState pState) {
public int getAnalogOutputSignal(BlockState pState, Level pLevel, BlockPos pPos) {
BlockEntity be = pLevel.getBlockEntity(pPos);
if (be instanceof MultiBlockComponentEntity component) {
return ItemHandlerHelper.calcRedstoneFromInventory(component.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).orElse(new EmptyHandler()));
return ItemHandlerHelper.calcRedstoneFromInventory(component.getCapability(ForgeCapabilities.ITEM_HANDLER).orElse(new EmptyHandler()));
}
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.ItemHandlerHelper;
import net.minecraftforge.items.wrapper.EmptyHandler;
Expand All @@ -29,7 +30,7 @@ public VoxelShape getShape(BlockState p_60555_, BlockGetter p_60556_, BlockPos p
public int getAnalogOutputSignal(BlockState pState, Level pLevel, BlockPos pPos) {
BlockEntity be = pLevel.getBlockEntity(pPos);
if (be instanceof SpiritCrucibleCoreBlockEntity crucible) {
return ItemHandlerHelper.calcRedstoneFromInventory(crucible.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).orElse(new EmptyHandler()));
return ItemHandlerHelper.calcRedstoneFromInventory(crucible.getCapability(ForgeCapabilities.ITEM_HANDLER).orElse(new EmptyHandler()));
}
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.ItemHandlerHelper;
import net.minecraftforge.items.wrapper.EmptyHandler;
Expand Down Expand Up @@ -68,7 +69,7 @@ public boolean hasAnalogOutputSignal(BlockState pState) {
public int getAnalogOutputSignal(BlockState pState, Level pLevel, BlockPos pPos) {
BlockEntity be = pLevel.getBlockEntity(pPos);
if (be instanceof TwistedTabletBlockEntity tablet) {
return ItemHandlerHelper.calcRedstoneFromInventory(tablet.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).orElse(new EmptyHandler()));
return ItemHandlerHelper.calcRedstoneFromInventory(tablet.getCapability(ForgeCapabilities.ITEM_HANDLER).orElse(new EmptyHandler()));
}
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public InteractionResult onUse(Player player, InteractionHand hand) {
@NotNull
@Override
public <T> LazyOptional<T> getCapability(@NotNull Capability<T> cap) {
if(cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY){
if(cap == ForgeCapabilities.ITEM_HANDLER){
return handler.cast();
}
return super.getCapability(cap);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package com.sammy.malum.common.block.nature;

import com.sammy.malum.registry.common.block.BlockTagRegistry;
import com.sammy.malum.registry.common.worldgen.FeatureRegistry;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.LevelReader;
import net.minecraft.world.level.block.SaplingBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraftforge.eventbus.api.Event;
import net.minecraftforge.registries.RegistryObject;

import java.util.Random;
Expand All @@ -35,7 +39,7 @@ public void advanceTree(ServerLevel level, BlockPos pos, BlockState state, Rando
if (state.getValue(STAGE) == 0) {
level.setBlock(pos, state.cycle(STAGE), 4);
} else {
if (!net.minecraftforge.event.ForgeEventFactory.saplingGrowTree(level, rand, pos)) {
if (!net.minecraftforge.event.ForgeEventFactory.blockGrowFeature(level, rand, pos, Holder.direct(FeatureRegistry.ConfiguredFeatures.RUNEWOOD_TREE_FEATURE.get())).getResult().equals(Event.Result.DENY)) {
return;
}
tree.get().place(NoneFeatureConfiguration.INSTANCE, level, level.getChunkSource().getGenerator(), rand, pos);
Expand Down
28 changes: 14 additions & 14 deletions src/main/java/com/sammy/malum/compability/tetra/TetraCompat.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.projectile.Arrow;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.enchantment.EnchantmentCategory;
import net.minecraftforge.event.entity.EntityJoinLevelEvent;
import net.minecraftforge.fml.ModList;
//import se.mickelus.tetra.aspect.ItemAspect;
//import se.mickelus.tetra.aspect.TetraEnchantmentHelper;
//import se.mickelus.tetra.effect.ItemEffect;
//import se.mickelus.tetra.items.modular.ModularItem;
import se.mickelus.tetra.aspect.ItemAspect;
import se.mickelus.tetra.aspect.TetraEnchantmentHelper;
import se.mickelus.tetra.effect.ItemEffect;
import se.mickelus.tetra.items.modular.ModularItem;

public class TetraCompat {
public static boolean LOADED;
Expand All @@ -20,19 +21,18 @@ public static void init() {

public static class LoadedOnly {

// private static final ItemEffect SHATTERS_SOULS = ItemEffect.get("malum.shatters_souls");
//
// public static final ItemAspect SOUL_HUNTER_TOOL = ItemAspect.get("soulStained");
private static final ItemEffect SHATTERS_SOULS = ItemEffect.get("malum.shatters_souls");
public static final ItemAspect SOUL_HUNTER_TOOL = ItemAspect.get("soulStained");

static
{
// TODO
// TetraEnchantmentHelper.registerMapping(SOUL_HUNTER_TOOL, new TetraEnchantmentHelper.EnchantmentRules(EnchantmentRegistry.SOUL_HUNTER_WEAPON, "additions/malum_something", "exclusions/malum_something"));
static {
TetraEnchantmentHelper.registerMapping(SOUL_HUNTER_TOOL,
new TetraEnchantmentHelper.EnchantmentRules("additions/malum_something", "exclusions/malum_something", new EnchantmentCategory[]{EnchantmentRegistry.SOUL_HUNTER_WEAPON}));
}

public static boolean hasSoulStrike(ItemStack stack) {
// if (stack.getItem() instanceof ModularItem modularItem) {
// return modularItem.getEffectLevel(stack, SHATTERS_SOULS) > 0;
// }
if (stack.getItem() instanceof ModularItem modularItem) {
return modularItem.getEffectLevel(stack, SHATTERS_SOULS) > 0;
}
return false;
}

Expand Down
Loading

0 comments on commit 82c6bc1

Please sign in to comment.