Jump to content

Recommended Posts

Posted

It handles squares. Anything that is a square is good, because it looks up the size of the icon. So regardless of how big your icon is, it is designed to draw from the start to the end, not just 16 pixels.

The only reason it can't handle a square is because it complains about non-squares... and I don't know how to get around that.

 

True, but my point was:

 

The old spritesheets were 256x256 and held 256 sprites.  To keep that the same under the new system, you need 16x16 icon files.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Know how to program in Java. If you don't, start learning Java. You can probably pick it up while writing mods, but don't ask for Java help in Minecraft communication channels. There are entire books on learning Java, along with online tutorials.

"You can probably pick it up while writing mods." I am going to kick the person who wrote that.

 

Lex knows everything? Maybe we should clone him! Oh wait, that would probably be a bad idea. In many ways.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Posted

Know how to program in Java. If you don't, start learning Java. You can probably pick it up while writing mods, but don't ask for Java help in Minecraft communication channels. There are entire books on learning Java, along with online tutorials.

"You can probably pick it up while writing mods." I am going to kick the person who wrote that.

 

It's not technically incorrect.  I didn't know Java and started writing mods.  I did, however, have prior programming experience in multiple languages (C++, C#, Javascript, Actionscript 2, Actionscript 3...).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Know how to program in Java. If you don't, start learning Java. You can probably pick it up while writing mods, but don't ask for Java help in Minecraft communication channels. There are entire books on learning Java, along with online tutorials.

"You can probably pick it up while writing mods." I am going to kick the person who wrote that.

 

It's not technically incorrect.  I didn't know Java and started writing mods.  I did, however, have prior programming experience in multiple languages (C++, C#, Javascript, Actionscript 2, Actionscript 3...).

Well, if you know C, then it's smooth sailing. I knew Python at the age of, like, ten, then I learned Java and GL because I wanted to write a Minecraft clone, then I decided to get into Minecraft modding. Still, I get tired of the people who think they can learn how to program and how to program in Java like this.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Posted

Well, if you know C, then it's smooth sailing. I knew Python at the age of, like, ten, then I learned Java and GL because I wanted to write a Minecraft clone, then I decided to get into Minecraft modding. Still, I get tired of the people who think they can learn how to program and how to program in Java like this.

 

Eh.  My C* is a bit rusty.  I can't write applications from the ground up, much less one with a GUI or any rendering.  Most of what I do is either in Unity3D, Flash, or web-based.

 

As far as I'm concerned the only difference between Java and Flash is how variables are declared.

("int a;" vs. "var a:int;")

Oh, and having to deal with Floats and Doubles not being the same thing and can't convert between them implicitly.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

So I started sorta learning Lua when I was like 8 but i didnt get far at all(played Roblox) then when I was 13 I started learning Java, but didnt get very far, made some VERY simple programs, and then I started to mod minecraft. I then kind of gave up till summer started so I had all the time in the world. And I would like my ore to spawn. So how do I make it static?

Posted

Well, if you know C, then it's smooth sailing. I knew Python at the age of, like, ten, then I learned Java and GL because I wanted to write a Minecraft clone, then I decided to get into Minecraft modding. Still, I get tired of the people who think they can learn how to program and how to program in Java like this.

 

Eh.  My C* is a bit rusty.  I can't write applications from the ground up, much less one with a GUI or any rendering.  Most of what I do is either in Unity3D, Flash, or web-based.

 

As far as I'm concerned the only difference between Java and Flash is how variables are declared.

("int a;" vs. "var a:int;")

Oh, and having to deal with Floats and Doubles not being the same thing and can't convert between them implicitly.

The largest change for me (python to java) was getting used to all the type restriction, and not just float/double. (function args, returns, variable types, casting) I don't like the way Java restricts everything. I've wanted, many times, to change something that was private/protected/package or final in a Minecraft class, but I couldn't. Making a getter and setter for one variable when you could just refer directly seems like a waste of space. I hold the belief that if you don't want something changed, it is a simple matter to *not change it*. Or, if you're writing an API or the like, make sure to write in the docs that you don't want it changed. I wrote a rant a while back to this effect.

 

Actually, the largest change was probably the eternal stupidity of Java arrays (here's another rant for you). Python's list syntax alone makes it a better language. Probably the only advantage Java has over Python that I can think of is the ternary operator. And even then you can instead use (c,a)\[b\] instead of a ? b : c. (Edit: Dammit, markdown.)

 

Or maybe the largest change would be the non-descriptive-ness of NPE's. If Python can use a NameError to say that something isn't defined, or an AttributeError to say that there's no such function or method, I don't see why Java can't.

So I started sorta learning Lua when I was like 8 but i didnt get far at all(played Roblox) then when I was 13 I started learning Java, but didnt get very far, made some VERY simple programs, and then I started to mod minecraft. I then kind of gave up till summer started so I had all the time in the world. And I would like my ore to spawn. So how do I make it static?

Just put a "static" modifier on the block.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Posted

Well, if you know C, then it's smooth sailing. I knew Python at the age of, like, ten, then I learned Java and GL because I wanted to write a Minecraft clone, then I decided to get into Minecraft modding. Still, I get tired of the people who think they can learn how to program and how to program in Java like this.

 

Eh.  My C* is a bit rusty.  I can't write applications from the ground up, much less one with a GUI or any rendering.  Most of what I do is either in Unity3D, Flash, or web-based.

 

As far as I'm concerned the only difference between Java and Flash is how variables are declared.

("int a;" vs. "var a:int;")

Oh, and having to deal with Floats and Doubles not being the same thing and can't convert between them implicitly.

The largest change for me (python to java) was getting used to all the type restriction, and not just float/double. (function args, returns, variable types, casting) I don't like the way Java restricts everything. I've wanted, many times, to change something that was private/protected/package or final in a Minecraft class, but I couldn't. Making a getter and setter for one variable when you could just refer directly seems like a waste of space. I hold the belief that if you don't want something changed, it is a simple matter to *not change it*. Or, if you're writing an API or the like, make sure to write in the docs that you don't want it changed. I wrote a rant a while back to this effect.

 

Actually, the largest change was probably the eternal stupidity of Java arrays (here's another rant for you). Python's list syntax alone makes it a better language. Probably the only advantage Java has over Python that I can think of is the ternary operator. And even then you can instead use (c,a) instead of a ? b : c.

 

Or maybe the largest change would be the non-descriptive-ness of NPE's. If Python can use a NameError to say that something isn't defined, or an AttributeError to say that there's no such function or method, I don't see why Java can't.

So I started sorta learning Lua when I was like 8 but i didnt get far at all(played Roblox) then when I was 13 I started learning Java, but didnt get very far, made some VERY simple programs, and then I started to mod minecraft. I then kind of gave up till summer started so I had all the time in the world. And I would like my ore to spawn. So how do I make it static?

Just put a "static" modifier on the block.

How do i do that? More so i guess where do i put that?

Posted

Well, if you know C, then it's smooth sailing. I knew Python at the age of, like, ten, then I learned Java and GL because I wanted to write a Minecraft clone, then I decided to get into Minecraft modding. Still, I get tired of the people who think they can learn how to program and how to program in Java like this.

 

Eh.  My C* is a bit rusty.  I can't write applications from the ground up, much less one with a GUI or any rendering.  Most of what I do is either in Unity3D, Flash, or web-based.

 

As far as I'm concerned the only difference between Java and Flash is how variables are declared.

("int a;" vs. "var a:int;")

Oh, and having to deal with Floats and Doubles not being the same thing and can't convert between them implicitly.

The largest change for me (python to java) was getting used to all the type restriction, and not just float/double. (function args, returns, variable types, casting) I don't like the way Java restricts everything. I've wanted, many times, to change something that was private/protected/package or final in a Minecraft class, but I couldn't. Making a getter and setter for one variable when you could just refer directly seems like a waste of space. I hold the belief that if you don't want something changed, it is a simple matter to *not change it*. Or, if you're writing an API or the like, make sure to write in the docs that you don't want it changed. I wrote a rant a while back to this effect.

 

Actually, the largest change was probably the eternal stupidity of Java arrays (here's another rant for you). Python's list syntax alone makes it a better language. Probably the only advantage Java has over Python that I can think of is the ternary operator. And even then you can instead use (c,a) instead of a ? b : c.

 

Or maybe the largest change would be the non-descriptive-ness of NPE's. If Python can use a NameError to say that something isn't defined, or an AttributeError to say that there's no such function or method, I don't see why Java can't.

So I started sorta learning Lua when I was like 8 but i didnt get far at all(played Roblox) then when I was 13 I started learning Java, but didnt get very far, made some VERY simple programs, and then I started to mod minecraft. I then kind of gave up till summer started so I had all the time in the world. And I would like my ore to spawn. So how do I make it static?

Just put a "static" modifier on the block.

How do i do that? More so i guess where do i put that?

 

In the class where you declared your block ID, add static to the beginning. ie:

 public static myFirstBlockID 

(public isn't necessary, but I do use it sometimes)

Posted
The largest change for me (python to java) was getting used to all the type restriction, and not just float/double. (function args, returns, variable types, casting) I don't like the way Java restricts everything.

 

I've gotten into using type restrictions in Flash because it's faster.

Otherwise this is valid code (and not only will compile, but will run:

var i = 1.333;
i += 0x1;
i = new Object();
i.random = 2;

 

I've wanted, many times, to change something that was private/protected/package or final in a Minecraft class, but I couldn't. Making a getter and setter for one variable when you could just refer directly seems like a waste of space. I hold the belief that if you don't want something changed, it is a simple matter to *not change it*. Or, if you're writing an API or the like, make sure to write in the docs that you don't want it changed. I wrote a rant a while back to this effect.

 

There are good reasons for getters/setters.  For example if setting the property means that some other flags or variables need to get set as a result.  A good example is the setters that cause datawatchers to update.  Likewise health (forcing every effect that CAN reduce an entity to 0 hp having to manage that entity dying would be absurd, instead you can manage that inside the setter!).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Well, if you know C, then it's smooth sailing. I knew Python at the age of, like, ten, then I learned Java and GL because I wanted to write a Minecraft clone, then I decided to get into Minecraft modding. Still, I get tired of the people who think they can learn how to program and how to program in Java like this.

 

Eh.  My C* is a bit rusty.  I can't write applications from the ground up, much less one with a GUI or any rendering.  Most of what I do is either in Unity3D, Flash, or web-based.

 

As far as I'm concerned the only difference between Java and Flash is how variables are declared.

("int a;" vs. "var a:int;")

Oh, and having to deal with Floats and Doubles not being the same thing and can't convert between them implicitly.

The largest change for me (python to java) was getting used to all the type restriction, and not just float/double. (function args, returns, variable types, casting) I don't like the way Java restricts everything. I've wanted, many times, to change something that was private/protected/package or final in a Minecraft class, but I couldn't. Making a getter and setter for one variable when you could just refer directly seems like a waste of space. I hold the belief that if you don't want something changed, it is a simple matter to *not change it*. Or, if you're writing an API or the like, make sure to write in the docs that you don't want it changed. I wrote a rant a while back to this effect.

 

Actually, the largest change was probably the eternal stupidity of Java arrays (here's another rant for you). Python's list syntax alone makes it a better language. Probably the only advantage Java has over Python that I can think of is the ternary operator. And even then you can instead use (c,a) instead of a ? b : c.

 

Or maybe the largest change would be the non-descriptive-ness of NPE's. If Python can use a NameError to say that something isn't defined, or an AttributeError to say that there's no such function or method, I don't see why Java can't.

So I started sorta learning Lua when I was like 8 but i didnt get far at all(played Roblox) then when I was 13 I started learning Java, but didnt get very far, made some VERY simple programs, and then I started to mod minecraft. I then kind of gave up till summer started so I had all the time in the world. And I would like my ore to spawn. So how do I make it static?

Just put a "static" modifier on the block.

How do i do that? More so i guess where do i put that?

 

In the class where you declared your block ID, add static to the beginning. ie:

 public static myFirstBlockID 

(public isn't necessary, but I do use it sometimes)

Ok I cant seem to get it to work.

I declared it in my main class file, but I thought I already had it static

 

package mtshaw113.juli;

import mtshaw113.juli.client.ClientProxy;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;


@Mod(modid="Juli", name="Juli", version="0.0.0")
@NetworkMod(clientSideRequired=true, serverSideRequired=false)
public class Juli {

    // The instance of your mod that Forge uses.
    @Instance("Juli")
    public static Juli instance;
   
    // Says where the client and server 'proxy' code is loaded.
    @SidedProxy(clientSide="mtshaw113.juli.client.ClientProxy", serverSide="mtshaw113.juli.CommonProxy")
    public static CommonProxy proxy;
    public static ClientProxy proxy1;
   
public static EventManager eventmanager = new EventManager();
public static Block oreJuli;              //<--- Isn't it static there?
public static final String modid = "Juli";
    
    @Init
    public void load(FMLInitializationEvent event) {
            proxy.registerRenderers();
            
            GameRegistry.registerWorldGenerator(eventmanager);                        
            
            oreJuli = new Block(500, Material.rock).setUnlocalizedName("oreJuli");           
            GameRegistry.registerBlock(oreJuli, modid + oreJuli.getUnlocalizedName());          
            LanguageRegistry.addName(oreJuli, "Juli's Ore");
            
            
            
  /*  ItemStack dirtStack = new ItemStack (Block.dirt);
   * ItemStack gravelStack = new ItemStack(Block.gravel);
   * ItemStack cobbleStack = new ItemStack(Block.cobblestone);     
   * 
   * GameRegistry.addSmelting(Block.stone.blockID, new ItemStack(
   *         Block.stoneBrick), 0.1f);
   *  
   * GameRegistry.addRecipe(new ItemStack(Block.stone), "xyx", "y y", "xyx",
   *         'x', dirtStack, 'y', gravelStack);
   */
    
            
    }

}

 

My Event Manager code:

 

package mtshaw113.juli;

import java.util.Random;

import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;

public class EventManager implements IWorldGenerator {

   @Override
   public void generate(Random random, int chunkX, int chunkZ, World world,
         IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
      switch(world.provider.dimensionId){
      
      case 1:
         generateNether(world, random, chunkX * 16, chunkZ * 16);
         
      case 0:
         generateSurface(world, random, chunkX * 16, chunkZ * 16);
         
      case -1:
         generateEnd(world, random, chunkX * 16, chunkZ * 16);
      }
      
   }

   private void generateEnd(World world, Random random, int chunkX, int chunkZ) {
      
      }
       


   public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
      for(int i = 0; i < 9; i++){
         int xCoord = chunkX + random.nextInt(16);
         int yCoord = random.nextInt(40);
         int zCoord = chunkZ + random.nextInt(16);
         
         (new WorldGenMinable(mtshaw113.juli.oreJuli.blockID, 5)).generate(world, random, xCoord, yCoord, zCoord);
         
      }
      
   }
   
      /**
    Here, your ore has a spawn rate of 9 (which you can change to suit your desires):
            for(int  i = 0; i < 9; i++) {
    It spawns at, or below, level 13 on the Y-Axis (also changeable):
            in yCoord = random.nextInt(13);
    And it spawns at a max of 4 blocks per vein (again, changeable):
            ...(mtshaw113.julit.oreJuli, 4) ...
     **/

   private void generateNether(World world, Random random, int chunkX,
         int chunkZ) {
      
   }

}

 

And my oreJuli class(The block im trying to spawn):

 

package mtshaw113.juli;

import net.minecraft.block.Block;
import net.minecraft.block.BlockOre;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class oreJuli extends BlockOre 
{
public oreJuli(int id, Material par2Material)
{
	super(id);
	this.setCreativeTab(CreativeTabs.tabBlock);
}{

Block oreJuli;
final String modid = "Juli";

oreJuli = new Block(500, Material.rock).setUnlocalizedName("oreJuli");           
    GameRegistry.registerBlock(oreJuli, modid + oreJuli.getUnlocalizedName());          
    LanguageRegistry.addName(oreJuli, "Juli's Ore");

}

public void updateIcons(IconRegister par1iconregister){
	this.blockIcon = par1iconregister.registerIcon("[oreJuli]");
}



/*	 @SideOnly(Side.CLIENT)
     public void registerIcons(IconRegister par1IconRegister)
  {
      this.blockIcon = par1IconRegister.registerIcon(Juli.modid + ":" + this.getUnlocalizedName2());
  }
*/
}

 

Sorry I am extremely bad at Java, I just wanted something fun and easy(easy as in like it wont take hundreds of hours of coding) to do over the summer. I promise I will start learning soon, I just want that ore to work first!

And back to the original original question, My block(from the creative menu) Has the "Missing Texture" texture

Posted

The largest change for me (python to java) was getting used to all the type restriction, and not just float/double. (function args, returns, variable types, casting) I don't like the way Java restricts everything.

 

I've gotten into using type restrictions in Flash because it's faster.

Otherwise this is valid code (and not only will compile, but will run:

var i = 1.333;
i += 0x1;
i = new Object();
i.random = 2;

I don't see a good reason why it shouldn't run. You're setting it to 1.333, then adding 1. Then you're setting it to an object, and you're giving it an attribute called "random" that you're setting to 2. Beats me as to why, but there's no good reason why you shouldn't be able to do that.

I've wanted, many times, to change something that was private/protected/package or final in a Minecraft class, but I couldn't. Making a getter and setter for one variable when you could just refer directly seems like a waste of space. I hold the belief that if you don't want something changed, it is a simple matter to *not change it*. Or, if you're writing an API or the like, make sure to write in the docs that you don't want it changed. I wrote a rant a while back to this effect.

 

There are good reasons for getters/setters.  For example if setting the property means that some other flags or variables need to get set as a result.  A good example is the setters that cause datawatchers to update.  Likewise health (forcing every effect that CAN reduce an entity to 0 hp having to manage that entity dying would be absurd, instead you can manage that inside the setter!).

True. I agree entirely. I'm referring to the getters without setters (if you don't want the variable modified, just say so!) or the like.

BEWARE OF GOD

---

Co-author of Pentachoron Labs' SBFP Tech.

Posted
mtshaw113.juli.oreJuli.blockID

 

This is wrong.

 

You want Juli.oreJuli.blockID

 

I don't see a good reason why it shouldn't run. You're setting it to 1.333, then adding 1. Then you're setting it to an object, and you're giving it an attribute called "random" that you're setting to 2. Beats me as to why, but there's no good reason why you shouldn't be able to do that.

 

Type errors are a very good thing to check:

 

var i = new Object();
if(rand.nextBoolean()) {
     i = 3;
}
i.prop = 9;

 

That should not compile.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Ok finally the ore spawns. But the texture is still being "Missing Texture" Derpy.

 

Because:

 

this.blockIcon = par1iconregister.registerIcon("[oreJuli]");

 

Your registering things wrong.  It's looking for a file named "[oreJuli]" (including those brackets!) in the /mods/textures/blocks folder.

 

17th time I've posted this:

 

Capture.png

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Posted

Ok finally the ore spawns. But the texture is still being "Missing Texture" Derpy.

 

Because:

 

this.blockIcon = par1iconregister.registerIcon("[oreJuli]");

 

Your registering things wrong.  It's looking for a file named "[oreJuli]" (including those brackets!) in the /mods/textures/blocks folder.

 

17th time I've posted this:

 

Capture.png

If I follow your setup, I get an error on 'blockIcon': Syntax error on token "blockIcon", VariableDeclaratorId expected after this token 58CqScH.png

Posted

...

 

Seriously?

 

I'm not even going to tell you what's wrong.  It should be blindingly obvious to anyone with a pair of eyeballs.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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