2020-04-16 00:39:53 +02:00
|
|
|
package de.ellpeck.prettypipes.items;
|
|
|
|
|
2020-04-16 15:45:11 +02:00
|
|
|
import de.ellpeck.prettypipes.PrettyPipes;
|
2020-04-16 00:39:53 +02:00
|
|
|
import de.ellpeck.prettypipes.Registry;
|
2020-04-20 13:12:26 +02:00
|
|
|
import de.ellpeck.prettypipes.Utility;
|
2020-04-16 23:40:35 +02:00
|
|
|
import de.ellpeck.prettypipes.pipe.modules.containers.AbstractPipeContainer;
|
2020-04-16 04:42:42 +02:00
|
|
|
import de.ellpeck.prettypipes.pipe.PipeTileEntity;
|
2020-04-16 15:45:11 +02:00
|
|
|
import net.minecraft.client.gui.screen.Screen;
|
|
|
|
import net.minecraft.client.resources.I18n;
|
|
|
|
import net.minecraft.client.util.ITooltipFlag;
|
2020-04-16 04:42:42 +02:00
|
|
|
import net.minecraft.entity.player.PlayerEntity;
|
|
|
|
import net.minecraft.entity.player.PlayerInventory;
|
2020-04-16 00:39:53 +02:00
|
|
|
import net.minecraft.item.Item;
|
|
|
|
import net.minecraft.item.ItemStack;
|
2020-04-16 15:45:11 +02:00
|
|
|
import net.minecraft.util.text.*;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
import net.minecraftforge.api.distmarker.Dist;
|
|
|
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
2020-04-18 22:30:14 +02:00
|
|
|
import net.minecraftforge.items.IItemHandler;
|
2020-04-16 00:39:53 +02:00
|
|
|
|
2020-04-16 15:45:11 +02:00
|
|
|
import javax.annotation.Nullable;
|
|
|
|
import java.util.List;
|
|
|
|
|
2020-04-16 02:48:58 +02:00
|
|
|
public abstract class ModuleItem extends Item implements IModule {
|
2020-04-16 15:45:11 +02:00
|
|
|
|
|
|
|
private final String name;
|
|
|
|
|
|
|
|
public ModuleItem(String name) {
|
2020-04-16 00:39:53 +02:00
|
|
|
super(new Properties().group(Registry.GROUP).maxStackSize(16));
|
2020-04-16 15:45:11 +02:00
|
|
|
this.name = name;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@OnlyIn(Dist.CLIENT)
|
|
|
|
public void addInformation(ItemStack stack, @Nullable World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
|
|
|
|
super.addInformation(stack, worldIn, tooltip, flagIn);
|
2020-04-20 13:12:26 +02:00
|
|
|
Utility.addTooltip(this.name, tooltip);
|
2020-04-16 00:39:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2020-04-16 04:42:42 +02:00
|
|
|
public void tick(ItemStack module, PipeTileEntity tile) {
|
2020-04-16 00:39:53 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2020-04-17 22:29:02 +02:00
|
|
|
public boolean canNetworkSee(ItemStack module, PipeTileEntity tile) {
|
2020-04-16 00:39:53 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2020-04-17 22:29:02 +02:00
|
|
|
public boolean canAcceptItem(ItemStack module, PipeTileEntity tile, ItemStack stack) {
|
2020-04-16 00:39:53 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2020-04-18 22:30:14 +02:00
|
|
|
@Override
|
|
|
|
public int getMaxInsertionAmount(ItemStack module, PipeTileEntity tile, ItemStack stack, IItemHandler destination) {
|
|
|
|
return Integer.MAX_VALUE;
|
|
|
|
}
|
|
|
|
|
2020-04-16 00:39:53 +02:00
|
|
|
@Override
|
2020-04-16 04:42:42 +02:00
|
|
|
public int getPriority(ItemStack module, PipeTileEntity tile) {
|
2020-04-16 00:39:53 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2020-04-16 02:48:58 +02:00
|
|
|
|
|
|
|
@Override
|
2020-04-16 04:42:42 +02:00
|
|
|
public AbstractPipeContainer<?> getContainer(ItemStack module, PipeTileEntity tile, int windowId, PlayerInventory inv, PlayerEntity player, int moduleIndex) {
|
|
|
|
return null;
|
2020-04-16 02:48:58 +02:00
|
|
|
}
|
2020-04-16 23:40:35 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public float getItemSpeedIncrease(ItemStack module, PipeTileEntity tile) {
|
|
|
|
return 0;
|
|
|
|
}
|
2020-04-16 00:39:53 +02:00
|
|
|
}
|