@Aw3s0Me
Mal ne Frage: was mache ich denn falsch? Ich habe alles nach Tutorial gemacht, aber es spawnt nur ein schwarzer Mann (SLENDERMAN xD) ...
Die Klassen:
Code:
package net.minecraft.src;
public class EntityMiningBot extends EntityLiving {
public EntityMiningBot(World par1World) {
super(par1World);
texture = "/robots/cme.png";
setSize(1.0F, 1.0F);
health = this.getMaxHealth();
}
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
{
super.writeEntityToNBT(nbttagcompound);
}
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
{
super.readEntityFromNBT(nbttagcompound);
}
public int getMaxHealth() {
return 3000;
}
protected String getLivingSound()
{
return "mob.robots.cmelive";
}
protected String getHurtSound()
{
return "mob.robots.cmehurt";
}
protected String getDeathSound()
{
return "mob.robots.cmedeath";
}
protected float getSoundVolume()
{
return 0.4F;
}
}
Code:
package net.minecraft.src;
// Referenced classes of package net.minecraft.src:
// RenderLiving, EntityDeer, ModelBase, EntityLiving,
// Entity
public class RenderMiningBot extends RenderLiving
{
public RenderMiningBot(ModelBase modelbase, float f)
{
super(modelbase, f);
}
public void renderMiningBot(EntityMiningBot entitybot, double d, double d1, double d2,
float f, float f1)
{
super.doRenderLiving(entitybot, d, d1, d2, f, f1);
}
public void doRenderLiving(EntityLiving entityliving, double d, double d1, double d2,
float f, float f1)
{
renderMiningBot((EntityMiningBot)entityliving, d, d1, d2, f, f1);
}
public void doRender(Entity entity, double d, double d1, double d2,
float f, float f1)
{
renderMiningBot((EntityMiningBot)entity, d, d1, d2, f, f1);
}
}
Code:
// Date: 10.09.2012 18:41:01
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package net.minecraft.src;
public class ModelMiningBot extends ModelBase
{
//fields
ModelRenderer BotFront;
ModelRenderer BotBack;
public ModelMiningBot()
{
textureWidth = 128;
textureHeight = 64;
BotFront = new ModelRenderer(this, 0, 0);
BotFront.addBox(0F, 0F, 0F, 14, 14, 12);
BotFront.setRotationPoint(-7F, 10F, -7F);
BotFront.setTextureSize(128, 64);
BotFront.mirror = true;
setRotation(BotFront, 0F, 0F, 0F);
BotBack = new ModelRenderer(this, 0, 0);
BotBack.addBox(0F, 0F, 0F, 12, 9, 2);
BotBack.setRotationPoint(-6F, 11F, 5F);
BotBack.setTextureSize(128, 64);
BotBack.mirror = true;
setRotation(BotBack, 0F, 0F, 0F);
}
public void render(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);
BotFront.render(f5);
BotBack.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)
{
super.setRotationAngles(f, f1, f2, f3, f4, f5);
}
}
Code:
package net.minecraft.src;
import java.util.*;
import java.util.Map;
public class mod_MiningBots extends BaseMod {
public static final Item processor;
public static final Item motherboard;
public static final Item cmebot;
static {
processor = (new ItemBotProcessor(17562)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/robots/processor.png")).setItemName("Processor").setTabToDisplayOn(CreativeTabs.tabRedstone);
motherboard = (new ItemBotMotherboard(17563)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/robots/motherboard.png")).setItemName("Motherboard").setTabToDisplayOn(CreativeTabs.tabRedstone);
cmebot = (new ItemBotCME(17564)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/robots/cmebot.png")).setItemName("CME Bot").setTabToDisplayOn(CreativeTabs.tabRedstone);
}
public mod_MiningBots() {
ModLoader.registerEntityID(EntityMiningBot.class, "CME Bot", ModLoader.getUniqueEntityId());
}
public void AddRenderer(Map map)
{
map.put(EntityMiningBot.class, new RenderMiningBot(new ModelMiningBot(), 0.5F));
}
public String getVersion() {
return "1.3.2";
}
public void load() {
ModLoader.addName(processor, "Processor");
ModLoader.addRecipe(new ItemStack(processor,1), new Object[] {
"RRR","GDG","RRR",Character.valueOf('R'),Item.redstone,Character.valueOf('G'),Item.ingotGold,Character.valueOf('D'),Item.diamond
});
ModLoader.addName(motherboard, "Motherboard");
ModLoader.addRecipe(new ItemStack(motherboard,1), new Object[] {
"RRR","IGI","RRR",Character.valueOf('R'),Item.redstone,Character.valueOf('G'),Item.ingotGold,Character.valueOf('I'),Item.ingotIron
});
ModLoader.addName(cmebot, "CME Bot");
ModLoader.addRecipe(new ItemStack(cmebot,1), new Object[] {
"GMR","GCI","GPR",Character.valueOf('G'),Block.thinGlass,Character.valueOf('M'),motherboard,Character.valueOf('R'),Item.redstone,Character.valueOf('C'),Block.chest,Character.valueOf('I'),Item.pickaxeSteel,Character.valueOf('P'),processor
});
}
}
Code:
package net.minecraft.src;
public class ItemBotCME extends Item {
protected ItemBotCME(int par1) {
super(par1);
}
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) {
int facing;
float yaw = entityplayer.rotationYaw;
EntityMiningBot cme = new EntityMiningBot(world);
if ((yaw > 315.0F) || (yaw <= 45.0F)) {
facing = 0;
cme.setLocationAndAngles(entityplayer.posX, entityplayer.posY - 1, entityplayer.posZ + 2, 180.0F, 0.0F);
}
if ((yaw > 45.0F) && (yaw <= 135.0F)) {
facing = 1;
cme.setLocationAndAngles(entityplayer.posX - 2, entityplayer.posY - 1, entityplayer.posZ, 270.0F, 0.0F);
}
if ((yaw > 135.0F) && (yaw <= 225.0F)) {
facing = 2;
cme.setLocationAndAngles(entityplayer.posX, entityplayer.posY - 1, entityplayer.posZ - 2, 0.0F, 0.0F);
}
if ((yaw > 225.0F) && (yaw <= 315.0F)) {
facing = 3;
cme.setLocationAndAngles(entityplayer.posX + 2, entityplayer.posY - 1, entityplayer.posZ, 90.0F, 0.0F);
}
world.spawnEntityInWorld(cme);
((EntityLiving)cme).playLivingSound();
return itemstack;
}
}