Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add machine_infuser_catalysts tag #50

Open
wants to merge 1 commit into
base: 1.16
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"minecraft:stick"
]
}
7 changes: 6 additions & 1 deletion src/main/java/mcjty/rftoolsbase/datagen/ItemTags.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package mcjty.rftoolsbase.datagen;

import mcjty.rftoolsbase.RFToolsBase;
import mcjty.rftoolsbase.modules.infuser.MachineInfuserModule;
import mcjty.rftoolsbase.modules.various.VariousModule;
import mcjty.rftoolsbase.modules.worldgen.WorldGenModule;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.ItemTagsProvider;
Expand All @@ -10,13 +13,15 @@
public class ItemTags extends ItemTagsProvider {

public ItemTags(DataGenerator generator, ExistingFileHelper helper) {
super(generator, new ForgeBlockTagsProvider(generator, helper));
super(generator, new ForgeBlockTagsProvider(generator, helper), RFToolsBase.MODID, helper);
}

@Override
protected void registerTags() {
getOrCreateBuilder(Tags.Items.ORES)
.add(WorldGenModule.DIMENSIONAL_SHARD_END_ITEM.get(), WorldGenModule.DIMENSIONAL_SHARD_NETHER_ITEM.get(), WorldGenModule.DIMENSIONAL_SHARD_OVERWORLD_ITEM.get());
getOrCreateBuilder(MachineInfuserModule.MACHINE_INFUSER_CATALYSTS)
.add(VariousModule.DIMENSIONALSHARD.get());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
import mcjty.lib.blocks.BaseBlock;
import mcjty.lib.container.GenericContainer;
import mcjty.lib.modules.IModule;
import mcjty.rftoolsbase.RFToolsBase;
import mcjty.rftoolsbase.modules.infuser.blocks.MachineInfuserTileEntity;
import mcjty.rftoolsbase.modules.infuser.client.GuiMachineInfuser;
import mcjty.rftoolsbase.setup.Config;
import mcjty.rftoolsbase.setup.Registration;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.tags.ITag;
import net.minecraft.tags.ItemTags;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
Expand All @@ -23,6 +27,7 @@ public class MachineInfuserModule implements IModule {
public static final RegistryObject<Item> MACHINE_INFUSER_ITEM = ITEMS.register("machine_infuser", () -> new BlockItem(MACHINE_INFUSER.get(), Registration.createStandardProperties()));
public static final RegistryObject<TileEntityType<?>> TYPE_MACHINE_INFUSER = TILES.register("machine_infuser", () -> TileEntityType.Builder.create(MachineInfuserTileEntity::new, MACHINE_INFUSER.get()).build(null));
public static final RegistryObject<ContainerType<GenericContainer>> CONTAINER_MACHINE_INFUSER = CONTAINERS.register("machine_infuser", GenericContainer::createContainerType);
public static final ITag.INamedTag<Item> MACHINE_INFUSER_CATALYSTS = ItemTags.createOptional(new ResourceLocation(RFToolsBase.MODID, "machine_infuser_catalysts"));

@Override
public void init(FMLCommonSetupEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class MachineInfuserTileEntity extends GenericTileEntity implements ITick
public static final int SLOT_MACHINEOUTPUT = 1;

public static final Lazy<ContainerFactory> CONTAINER_FACTORY = Lazy.of(() -> new ContainerFactory(2)
.slot(specific(new ItemStack(VariousModule.DIMENSIONALSHARD.get())).in(), CONTAINER_CONTAINER, SLOT_SHARDINPUT, 64, 24)
.slot(specific(stack -> MachineInfuserModule.MACHINE_INFUSER_CATALYSTS.contains(stack.getItem())).in(), CONTAINER_CONTAINER, SLOT_SHARDINPUT, 64, 24)
.slot(specific(MachineInfuserTileEntity::isInfusable).in().out(), CONTAINER_CONTAINER, SLOT_MACHINEOUTPUT, 118, 24)
.playerSlots(10, 70));

Expand Down Expand Up @@ -94,7 +94,7 @@ private void tickServer() {
} else {
ItemStack inputStack = items.getStackInSlot(0);
ItemStack outputStack = items.getStackInSlot(1);
if (!inputStack.isEmpty() && inputStack.getItem() == VariousModule.DIMENSIONALSHARD.get() && isInfusable(outputStack)) {
if (!inputStack.isEmpty() && MachineInfuserModule.MACHINE_INFUSER_CATALYSTS.contains(inputStack.getItem()) && isInfusable(outputStack)) {
startInfusing();
}
}
Expand Down