Отпишитесь те кто реально будет помогать, а не гнобить как многие любят.
Мой базовый файл
мой Test (в нем проблема)
мой TestModel
мой gun01
--------------------------------------------------------------------------------------------------------------------------
Он хочет создать класс Links, если создать то ему не нравиться слово MODID.
Мой базовый файл
Код:
package ru.guns1.basfile;
import com.yancraft.tutorial.ItemTable;
import net.minecraft.item.Item;
import net.minecraftforge.client.MinecraftForgeClient;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.registry.GameRegistry;
@Mod(modid = "guns1", name = "Guns1", version = "0.1")
public class BasFile {
public static Item gun01;
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
//Item/Block init and registering
//Config handling
gun01 = new gun01().setUnlocalizedName("gun01").setTextureName("imagic:itemtable");
GameRegistry.registerItem(gun01, gun01.getUnlocalizedName().substring(5));
}
@EventHandler
public void init(FMLInitializationEvent event) {
//Proxy, TIleENity, entity, GUI and Packet Registering
MinecraftForgeClient.registerItemRenderer(gun01, new Test());
}
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
}
}
мой Test (в нем проблема)
Код:
package ru.guns1.basfile;
import org.lwjgl.opengl.GL11;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.IItemRenderer;
public class Test implements IItemRenderer {
private final TestModel model;
private final ResourceLocation LOC = new ResourceLocation(Links.MODID, "textures/models/texture.png");
public Test() {
model = new TestModel();
}
@Override
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
return true;
}
@Override
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item,
ItemRendererHelper helper) {
return false;
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
//Вот здесь пишешь рендер детали (положение, угол наклона и т.д.)
GL11.glPushMatrix();
Minecraft.getMinecraft().renderEngine.bindTexture(LOC);
model.rend(0.0625F);
GL11.glPopMatrix();
}
}
мой TestModel
Код:
package ru.guns1.basfile;
import com.sun.xml.internal.stream.Entity;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
public class TestModel extends ModelBase
{
//fields
ModelRenderer Shape1;
public TestModel()
{
textureWidth = 64;
textureHeight = 32;
Shape1 = new ModelRenderer(this, 0, 0);
Shape1.addBox(0F, 0F, 0F, 1, 9, 1);
Shape1.setRotationPoint(0F, 15F, 0F);
Shape1.setTextureSize(64, 32);
Shape1.mirror = true;
setRotation(Shape1, 0F, 0F, 0F);
}
public void render(net.minecraft.entity.Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5,entity);
Shape1.render(f5);
}
public void rend(float f5){
Shape1.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, net.minecraft.entity.Entity ent)
{
super.setRotationAngles(f, f1, f2, f3, f4, f5,ent);
}
}
мой gun01
Код:
package ru.guns1.basfile;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
public class gun01 extends Item {
protected gun01() {
this.setCreativeTab(CreativeTabs.tabCombat);
}
}
Код:
private final ResourceLocation LOC = new ResourceLocation(Links.MODID, "textures/models/texture.png");