39 lines
1.1 KiB
Java
39 lines
1.1 KiB
Java
package io.github.skippyall.minions.module;
|
|
|
|
import eu.pb4.polymer.core.api.item.PolymerItem;
|
|
import io.github.skippyall.minions.command.Command;
|
|
import io.github.skippyall.minions.program.block.CodeBlock;
|
|
import net.minecraft.item.Item;
|
|
import net.minecraft.item.ItemStack;
|
|
import xyz.nucleoid.packettweaker.PacketContext;
|
|
|
|
import java.util.List;
|
|
|
|
public class SimpleModuleItem extends Item implements PolymerItem, ModuleItem {
|
|
private final List<CodeBlock<?,?>> codeBlocks;
|
|
private final List<Command> commands;
|
|
private final Item vanillaItem;
|
|
|
|
public SimpleModuleItem(List<CodeBlock<?,?>> codeBlocks, List<Command> commands, Settings settings, Item vanillaItem) {
|
|
super(settings.maxCount(1));
|
|
this.codeBlocks = codeBlocks;
|
|
this.commands = commands;
|
|
this.vanillaItem = vanillaItem;
|
|
}
|
|
|
|
@Override
|
|
public List<CodeBlock<?, ?>> getCodeBlocks() {
|
|
return codeBlocks;
|
|
}
|
|
|
|
@Override
|
|
public List<Command> getCommands() {
|
|
return commands;
|
|
}
|
|
|
|
@Override
|
|
public Item getPolymerItem(ItemStack itemStack, PacketContext context) {
|
|
return vanillaItem;
|
|
}
|
|
}
|