Jump to content

SureenInk

Members
  • Posts

    118
  • Joined

  • Last visited

Everything posted by SureenInk

  1. -nods- makes sense...hmm...I still get an error, though in the spawn code (or am I doing that wrong?)...I tried EntityRegistry.addSpawn(EntityNeola.class, 100, 8, 10, new EnumCreatureType(ENeola), BiomeGenBase.forest); but got the error Cannot instantiate the type EnumCreatureType Before that I tried EntityRegistry.addSpawn(EntityNeola.class, 100, 8, 10, EnumCreatureType.ENeola, BiomeGenBase.forest); but still have the same error as before where it's not recognizing the code. Am I putting that first part in the wrong spot (It doesn't seem to work anywhere else). I have it right now just in the top section before any of the PreInits, Inits, etc. Here's my current code: package craftygirls.main; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityList; import net.minecraft.entity.EnumCreatureType; import net.minecraft.world.biome.BiomeGenBase; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; 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.EntityRegistry; import net.minecraftforge.common.util.EnumHelper; import net.minecraft.entity.passive.EntityTameable; @Mod(modid = "craftygirls", name = "The Crafty Girls Core Mod", version = "Alpha v0.1") public class Main { @Instance("craftygirls") public static Main instance; //Proxies @SidedProxy(clientSide="craftygirls.main.ClientProxyClass", serverSide="craftygirls.main.CommonProxyClass") public static CommonProxyClass proxy; //Cookies for Tomboy. Flowers for Alice, and Diamonds for Stef public static final EnumCreatureType ENeola = EnumHelper.addCreatureType("Neola", EntityNeola.class, 40, Material.air, true); @EventHandler public void preInit(FMLPreInitializationEvent e){ } @EventHandler public void Init(FMLInitializationEvent e) { short entityID = 0; proxy.registerEntityWithEgg(EntityNeola.class, "Neola", entityID++, this, 128, 1, true, 0x492d00, 0x029820); proxy.registerEntityWithEgg(EntityTomboy.class, "TomBoy", entityID++, this, 128, 1, true, 0x290877, 0x03f63b); proxy.registerEntityWithEgg(EntityTTSnim.class, "TTSnim", entityID++, this, 128, 1, true, 0x8e69cd, 0xfee02b); proxy.registerRenderThings(); } public void postInit(FMLPostInitializationEvent e) { EntityRegistry.addSpawn(EntityNeola.class, 100, 8, 10, EnumCreatureType.ENeola, BiomeGenBase.forest); EntityRegistry.addSpawn(EntityTomboy.class, 100, 100, 200, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.plains); EntityRegistry.addSpawn(EntityTTSnim.class, 100, 100, 200, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.plains); } } Again, it can't seem to read "ENeola" as a creature type. It tells me it's wrong and recommends changing to one of the four existing ones, just like the previous code I was given... I guess I should note I'm working in 1.7.2, so if these have been 1.6 codes, that might be the problem. I...thought I had mentioned that earlier, but I don't see a mention of it previously, so I must not have.
  2. I think so? According to SanAndreasP, I needed to create a new creature type, since I'm trying to spawn in "EntityTameable" instead of the others. I've still got a big error in the taming code, but I'm more concerned with getting them to spawn right now then making it so they can be tamed. He gave me a code that (I guess?) was supposed to add a creature type, but I don't know how to run it? How do I run that one?
  3. Yeah, it wouldn't let me import it before, and I didn't know where it was located. Let me actually code it (I didn't because I didn't really understand the code at all, like the Material.class and such.) I don't usually just copy and paste in code, but here I couldn't understand some of it, so I figured I'd ask about it before I tried adding my own code in (didn't want to put the wrong stuff in and make it worse, you know?) EDIT 1: EDIT 2: Wait...okay...I think I figured it out...Now I have public static final EnumCreatureType ENeola = EnumHelper.addEnum(paramTypes, EnumCreatureType.class, "Neola", EntityTameable.class, 40, Material.air, true, true); That works fine it seems, but is that supposed to add ENeola as an EnumCreatureType? Cause when I do EntityRegistry.addSpawn(EntityNeola.class, 100, 8, 10, EnumCreatureType.ENeola, BiomeGenBase.forest); It says that doesn't exists and recommends changing "ENeola" to "creature"...These are my lines of code for the ones you gave me: private static final Class[][] paramTypes = new Class[][] {{EnumCreatureType.class, Class.class, int.class, Material.class, boolean.class, boolean.class}}; public static final EnumCreatureType ENeola = EnumHelper.addEnum(paramTypes, EnumCreatureType.class, "Neola", EntityTameable.class, 40, Material.air, true, true);
  4. package craftygirls.main; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityList; import net.minecraft.entity.EnumCreatureType; import net.minecraft.world.biome.BiomeGenBase; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; 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.EntityRegistry; @Mod(modid = "craftygirls", name = "The Crafty Girls Mod", version = "Alpha v0.1") public class Main { @Instance("craftygirls") public static Main instance; //Proxies @SidedProxy(clientSide="craftygirls.main.ClientProxyClass", serverSide="craftygirls.main.CommonProxyClass") public static CommonProxyClass proxy; //private static final Class<?>[][] paramTypes = new Class[][] {{EnumCreatureType.class, Class.class, int.class, Material.class, boolean.class, boolean.class}}; //public static final EnumCreatureType ambientWater = EnumHelper.addEnum(paramTypes, EnumCreatureType.class, "ambientWaterFish", EntityWaterMob.class, 40, Material.water, false, true); //Cookies for Tomboy. Flowers for Alice, and Diamonds for Stef @EventHandler public void preInit(FMLPreInitializationEvent e){ } @EventHandler public void Init(FMLInitializationEvent e) { short entityID = 0; proxy.registerEntityWithEgg(EntityNeola.class, "Neola", entityID++, this, 128, 1, true, 0x492d00, 0x029820); proxy.registerEntityWithEgg(EntityTomboy.class, "TomBoy", entityID++, this, 128, 1, true, 0x290877, 0x03f63b); proxy.registerEntityWithEgg(EntityTTSnim.class, "TTSnim", entityID++, this, 128, 1, true, 0x8e69cd, 0xfee02b); proxy.registerEntityWithEgg(EntityMrFree.class, "MrFree", entityID++, this, 128, 1, true, 0x378d46, 0xdadada); proxy.registerRenderThings(); } public void postInit(FMLPostInitializationEvent e) { EntityRegistry.addSpawn(EntityNeola.class, 100, 8, 10, EnumCreatureType.creature, BiomeGenBase.forest); EntityRegistry.addSpawn(EntityTomboy.class, 100, 100, 200, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.plains); EntityRegistry.addSpawn(EntityTTSnim.class, 100, 100, 200, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.plains); EntityRegistry.addSpawn(EntityMrFree.class, 100, 8, 10, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.plains); } }
  5. Sorry I'm such a noob x.x but... I'm getting an error saying EnumHelper is undefined? I can't seem to import it, and it tells me I need to create the variable...
  6. Hmm...well, I modified some code earlier (I didn't update cause I didn't realize it was that important). They're all extending EntityAnimal, and set to EnumCreatureType.creature right now... EDIT: Also, I'd like them to be tameable...so I changed them to extend EntityTameable...
  7. Okay! I have the /spawn command working and the spawn eggs working now! But...I'm still not seeing them naturally spawning in my world...Maybe they're just rare? I guess I could increase their spawn rate in the .addspawn section?
  8. Wow...I feel stupid >> I was putting that code in the wrong spot -headdesk- It works now, thanks so much for the help! But...isn't that code supposed to also give me a spawn egg for her based on the numbers afterwards? I put in a couple random numbers and got nothing, but again, they were random. Gonna check the wiki again before I really ask for help on that. EDIT: Yeah, I still can't spawn her using the /summon command, and I'm not getting a spawn egg. Do I have to make the spawn egg myself? (Also, I'm using Forge 10.12.0.1024)
  9. Actually, I moved it from PreInit to Init just before posting this because the tutorial said to. I'll move it back. That said, I figured out some problems, but the tutorial says to use EntityRegistry.registerGlobalEntityID(Neola.class, "Neola", EntityRegistry.findGlobalUniqueEntityId(), 3515848, 12102); Problem is, when I use that code, I get an error: Syntax error on token "registerGlobalEntityID", Identifier expected after this token But, yes, I am using 1.7.2
  10. So, I'm not sure if there's something wrong with my entity code, or if it's something else, but I can't get my creature to spawn anywhere, and it says "Unable to summon object" when I run the /summon command. Here's the code. package radial.Main; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class ModelNeola extends ModelBase { //fields ModelRenderer Hat; ModelRenderer head; ModelRenderer body; ModelRenderer rightarm; ModelRenderer leftarm; ModelRenderer rightleg; ModelRenderer leftleg; public ModelNeola() { textureWidth = 64; textureHeight = 32; Hat = new ModelRenderer(this, 35, -4); Hat.addBox(-5F, -9F, -5F, 10, 9, 10); Hat.setRotationPoint(0F, 0F, 0F); Hat.setTextureSize(64, 32); Hat.mirror = true; setRotation(Hat, 0F, -1.570796F, 0F); head = new ModelRenderer(this, 0, 0); head.addBox(-4F, -8F, -4F, 8, 8, ; head.setRotationPoint(0F, 0F, 0F); head.setTextureSize(64, 32); head.mirror = true; setRotation(head, 0F, 0F, 0F); body = new ModelRenderer(this, 16, 16); body.addBox(-4F, 0F, -2F, 8, 12, 4); body.setRotationPoint(0F, 0F, 0F); body.setTextureSize(64, 32); body.mirror = true; setRotation(body, 0F, 0F, 0F); rightarm = new ModelRenderer(this, 40, 16); rightarm.addBox(-3F, -2F, -2F, 4, 12, 4); rightarm.setRotationPoint(-5F, 2F, 0F); rightarm.setTextureSize(64, 32); rightarm.mirror = true; setRotation(rightarm, 0F, 0F, 0F); leftarm = new ModelRenderer(this, 40, 16); leftarm.addBox(-1F, -2F, -2F, 4, 12, 4); leftarm.setRotationPoint(5F, 2F, 0F); leftarm.setTextureSize(64, 32); leftarm.mirror = true; setRotation(leftarm, 0F, 0F, 0F); rightleg = new ModelRenderer(this, 0, 16); rightleg.addBox(-2F, 0F, -2F, 4, 12, 4); rightleg.setRotationPoint(-2F, 12F, 0F); rightleg.setTextureSize(64, 32); rightleg.mirror = true; setRotation(rightleg, 0F, 0F, 0F); leftleg = new ModelRenderer(this, 0, 16); leftleg.addBox(-2F, 0F, -2F, 4, 12, 4); leftleg.setRotationPoint(2F, 12F, 0F); leftleg.setTextureSize(64, 32); leftleg.mirror = true; setRotation(leftleg, 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, entity); Hat.render(f5); head.render(f5); body.render(f5); rightarm.render(f5); leftarm.render(f5); rightleg.render(f5); leftleg.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, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); } } package radial.Main; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.world.World; public class Neola extends EntityAgeable { public Neola(World par1World) { super(par1World); this.setSize(0.9F, 1.3F); } @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); } @Override protected String getLivingSound() { return null;//this refers to:yourmod/sound/YourSound } @Override protected String getHurtSound() { return null;//this refers to:yourmod/sound/optionalFile/YourSound } @Override protected String getDeathSound() { return null;//etc. } @Override protected float getSoundVolume() { return 0.4F; } @Override public EntityAgeable createChild(EntityAgeable var1) { return null; } } And this is the proxy classes. package radial.Main; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.client.registry.RenderingRegistry; import radial.Main.CommonProxyClass; public class ClientProxyClass extends CommonProxyClass { @Override public void registerRenderThings() { RenderingRegistry.registerEntityRenderingHandler(Neola.class, new RenderNeola(new ModelNeola(), 0)); //the 0.5F is the shadowsize } /*@Override public void registerSound() { MinecraftForge.EVENT_BUS.register(new YourSoundEvent());//register the sound event handling class }*/ } package radial.Main; public class CommonProxyClass { public void registerRenderThings() { } public void registerSound() { } } Finally, the main class code, which I have in FMLPreInitializationEvent. @Mod(modid = "Radial", name = "Radial", version = "Alpha v0.3") public class Radial { @Instance("radial") public static Radial instance; //Proxies @SidedProxy(clientSide="radial.Main.ClientProxyClass", serverSide="radial.Main.CommonProxyClass") public static CommonProxyClass proxy; @EventHandler public void init(FMLInitializationEvent e){ int id = 0; EntityRegistry.registerModEntity(Neola.class, "Neola_Alice", 0, this, 80, 1, true);//id is an internal mob id, you can start at 0 and continue adding them up. id++; EntityRegistry.addSpawn(Neola.class, 10, 8, 10, EnumCreatureType.ambient, BiomeGenBase.taiga);//change the values to vary the spawn rarity, biome, etc. proxy.registerRenderThings();//calls the methods in our proxy, which will do things on client side //proxy.registerSound(); } }
  11. Thanks, got this to work. This is now solved ^^
  12. Sweet! Thanks! That fixed all of my problems. Only one more question. Do I have to make a new generation code for every ore? Here's my OreGen code. package radial.Main; import java.util.Random; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import cpw.mods.fml.common.IWorldGenerator; public class OreGen implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { // TODO Auto-generated method stub switch(world.provider.dimensionId){ case 0 : generateSurface(world, random,chunkX*16,chunkZ*16); } } private void generateSurface(World world, Random random, int BlockX, int BlockZ) { for(int i = 0; i<10;i++){ int Xcoord = BlockX + random.nextInt(16); int Zcoord = BlockZ + random.nextInt(16); int Ycoord = random.nextInt(100); (new WorldGenMinable(mainClass.TestOre, 4)).generate(world, random, Xcoord, Ycoord, Zcoord); }} }
  13. That makes sense. Well, the only world generation tutorial I can find isn't for 1.7...could someone help me with that?
  14. I'm very confused here...I have a custom ore I want to generate, and I was told to run "OreDictionary.registerOre" on the ore to add it to the ore dictionary. However, that still doesn't seem to cause it to spawn? I'm confused on how to set it up to spawn how I want it to spawn (I'd like to add multiple ores with varying spawn rates).
  15. [quote name="sequituri" post="88900" timestamp="1395475684"] SureenInk, Busti is referring to the Forge OreDictionary (i believe). If you are creating new ores, you would do well to register them in the Ore registry so other mods can use them in recipes, too. Or simply not have a conflict about it when there are more than 1 lead ores in the game. [/quote] Sorry...I'm horribly new at this...so then I just have to add [codepublic static void oreRegistration() { OreDictionary.registerOre("radialore", RadialOre); } I'm sorry...I really am new at this (just started the other day), so I'm still very confused x.x
  16. Sorry, but...when you say use the addOre with your registry...what do you mean? For my ore I've got: RadialOre = new RadialOre().setBlockName("radialore").setHardness(5.0F).setResistance(5.0F).setLightLevel(0.8F).setStepSound(Block.soundTypeStone).setCreativeTab(RadialTabs).setBlockTextureName(modid + ":radialore"); GameRegistry.registerBlock(RadialOre, "radialore").addOre(RadialOre); RadialOre.setHarvestLevel("pickaxe", 3); That gives me an error, though. Am I putting it in the wrong spot?
  17. That fixed it, thanks ^^
  18. So, I've followed about 4 different tutorials, one of which got me to be able to load eclipse up finally without a problem. However, when I go to read the source code for Minecraft Forge, I get an error that says "The JAR file C:\Users\Sureen\.gradle\caches\minecraft\net\minecraftforge\forge\1.7.2-10.1.0.1024\forgeBin-1.7.2-10.12.0.1024.jar has no source attachment." Then it tells me to attach a source. I don't understand what's wrong? Here's my last forge log (I think this is the forge log? It was the only log I could find) Here's what was in the "gradle.txt" file...I can't find any other logs, though... This is from when I ran setupDecompWorkspace just now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.