Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
Слишком много просишьzan2828 написал(а):1.Можете выложить полный код 3d оружия (с подробным объяснением, это поможет многим новичкам)
2.Как можно изменить текстуру неба?
Но он не будет учиться, если все будут делать за тебя.Язык программирования учиться долго
Почему-то кажется, что это только если под копирку... Головой-то тоже думать придется...Неправда.Базовых знаний(админ знает только базу)достаточно
Пиши конкретно проблему. А дать код это уже заказ,а за заказ надо платитьDovakin написал(а):И хорошо,сталкеровыживанческоаномальноапокалиптических модов будет меньше.
Пиши конкретно проблему. А дать код это уже заказ,а за заказ надо платитьDovakin написал(а):И хорошо,сталкеровыживанческоаномальноапокалиптических модов будет меньше.
package ru.guns1.basfile;
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");
MinecraftForgeClient.registerItemRenderer(gun01, new Test());
GameRegistry.registerItem(gun01, gun01.getUnlocalizedName().substring(5));
}
@EventHandler
public void init(FMLInitializationEvent event) {
//Proxy, TIleENity, entity, GUI and Packet Registering
}
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
}
}
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();
}
}
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);
}
}