-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
1,077 additions
and
496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...ace/ironsspellbooks/block/alchemist_cauldron/AlchemistCauldronBuildInteractionsEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.redspace.ironsspellbooks.block.alchemist_cauldron; | ||
|
||
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraftforge.eventbus.api.Event; | ||
|
||
public class AlchemistCauldronBuildInteractionsEvent extends Event { | ||
private final Object2ObjectOpenHashMap<Item, AlchemistCauldronInteraction> interactionMap; | ||
|
||
public AlchemistCauldronBuildInteractionsEvent(Object2ObjectOpenHashMap<Item, AlchemistCauldronInteraction> interactionMap) { | ||
this.interactionMap = interactionMap; | ||
} | ||
|
||
public void addInteraction(Item item, AlchemistCauldronInteraction interaction) { | ||
if (!interactionMap.containsKey(item)) { | ||
interactionMap.put(item, interaction); | ||
} | ||
} | ||
|
||
public void addSimpleBottleEmptyInteraction(Item item) { | ||
if (!interactionMap.containsKey(item)) { | ||
AlchemistCauldronTile.createBottleEmptyInteraction(interactionMap, () -> item); | ||
} | ||
} | ||
} |
7 changes: 2 additions & 5 deletions
7
...va/io/redspace/ironsspellbooks/block/alchemist_cauldron/AlchemistCauldronInteraction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
package io.redspace.ironsspellbooks.block.alchemist_cauldron; | ||
|
||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.InteractionHand; | ||
import net.minecraft.world.InteractionResult; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
public interface AlchemistCauldronInteraction{ | ||
public interface AlchemistCauldronInteraction { | ||
@Nullable | ||
ItemStack interact(BlockState blockState, Level level, BlockPos pos, int currentLevel, ItemStack itemStack); | ||
ItemStack interact(AlchemistCauldronTile blockEntity, BlockState blockState, Level level, BlockPos pos, ItemStack itemStack); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.