nosingleplayer 1.1.1: fond custom via blit + log debug widgets
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
|
||||
package net.paladrill.paladrillmod.item;
|
||||
|
||||
import net.paladrill.paladrillmod.procedure.ProcedureOkamiRightClickedOnBlock;
|
||||
import net.paladrill.paladrillmod.creativetab.TabPalaDrillMod;
|
||||
import net.paladrill.paladrillmod.ElementsPaladrillmodMod;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.client.event.ModelRegistryEvent;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
|
||||
@ElementsPaladrillmodMod.ModElement.Tag
|
||||
public class ItemOkamiSeeds extends ElementsPaladrillmodMod.ModElement {
|
||||
@GameRegistry.ObjectHolder("paladrillmod:okamiseeds")
|
||||
public static final Item block = null;
|
||||
public ItemOkamiSeeds(ElementsPaladrillmodMod instance) {
|
||||
super(instance, 268);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initElements() {
|
||||
elements.items.add(() -> new ItemCustom());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModels(ModelRegistryEvent event) {
|
||||
ModelLoader.setCustomModelResourceLocation(block, 0, new ModelResourceLocation("paladrillmod:okamiseeds", "inventory"));
|
||||
}
|
||||
public static class ItemCustom extends Item {
|
||||
public ItemCustom() {
|
||||
setMaxDamage(0);
|
||||
maxStackSize = 64;
|
||||
setUnlocalizedName("okamiseeds");
|
||||
setRegistryName("okamiseeds");
|
||||
setCreativeTab(TabPalaDrillMod.tab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxItemUseDuration(ItemStack itemstack) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDestroySpeed(ItemStack par1ItemStack, IBlockState par2Block) {
|
||||
return 1F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUseFirst(EntityPlayer entity, World world, BlockPos pos, EnumFacing direction, float hitX, float hitY,
|
||||
float hitZ, EnumHand hand) {
|
||||
EnumActionResult retval = super.onItemUseFirst(entity, world, pos, direction, hitX, hitY, hitZ, hand);
|
||||
ItemStack itemstack = entity.getHeldItem(hand);
|
||||
int x = pos.getX();
|
||||
int y = pos.getY();
|
||||
int z = pos.getZ();
|
||||
{
|
||||
Map<String, Object> $_dependencies = new HashMap<>();
|
||||
$_dependencies.put("entity", entity);
|
||||
$_dependencies.put("x", x);
|
||||
$_dependencies.put("y", y);
|
||||
$_dependencies.put("z", z);
|
||||
$_dependencies.put("world", world);
|
||||
ProcedureOkamiRightClickedOnBlock.executeProcedure($_dependencies);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user