sciguy1121 / Community-Mod-1

Community Mod 1
GNU Lesser General Public License v3.0
10 stars 16 forks source link

Raspberry Bush, New GUI Handling system and Ore Dictionary. #202

Closed Techtad closed 11 years ago

Techtad commented 11 years ago

2013-05-07_16 07 14

There wasn't a way to get the raspberries without creative mode, so I thought I can easily implement that. It grows properly and works with bonemeal. It can be harvested for 1-4 raspberries. Now It only needs to generate naturally.

I've also improved the GUI Handling system, all the if statements looked a little messy. So I thought I can make a better, modular GUI Handling system. This is my idea. Now you have to implement the interface IGuiTile in the TileEntity:

public class TileEntityLogger extends TileEntity implements IInventory, IGuiTile {

And then you just need a couple of methods:

@Override
public Container getContainer(World world, int x, int y, int z,
        EntityPlayer player) {
    TileEntity tile = world.getBlockTileEntity(x, y, z);

    if (tile instanceof TileEntityLogger) {
        return new ContainerLogger((TileEntityLogger) tile,
                player.inventory);
    }
    return null;
}

@Override
public GuiContainer getGuiContainer(World world, int x, int y, int z,
        EntityPlayer player) {
    TileEntity tile = world.getBlockTileEntity(x, y, z);

    if (tile instanceof TileEntityLogger) {
        return new GuiLogger((TileEntityLogger) tile,
                player.inventory);
    }
    return null;
}

Then you need to register the IGuiTile to the GuiHandler

GuiHanlder.registerGuiTile((IGuiTile)new TileEntityLogger());

And it's done, should work properly.

I've also started to register some of the metals ingots and ores to the Forge Ore Dictionary.

EliSussman commented 11 years ago

@smigolpol This is great! can you also add world generation for the bushes?

Techtad commented 11 years ago

Maybe, I don't know, I haven't made any world generation before... It also needs, obviously, better textures, because I made these crappy ones only to test it.

EliSussman commented 11 years ago

@smigolpol Ill try with the textures

EliSussman commented 11 years ago

Any Good? @smigolpol raspberrybush

Techtad commented 11 years ago

@KingCreeperEli They have other render type than a normal cube, they're like a sapling. I can change that if necessary, but I think would look good like that. These are the textures I made quickly: 2013-05-07_16 07 14 I think you should do them high resolution to be able to put more detail to the texture.

EliSussman commented 11 years ago

thats fine, I like yours better anyway :)

Techtad commented 11 years ago

Well, I made those textures in like... 2 minutes, because I wanted to see if it works. :)

Fermats-Fish commented 11 years ago

I could probably add world gen later on today.

Techtad commented 11 years ago

Yesterday I implemented some Ore Dictionary registers. Today I was working on improving the basic mod GUI mechanics. The pull request wasn't merger yet, so I thought I will add the changes to this one...

sciguy1121 commented 11 years ago

Looks good! Sorry for the late merge, my internet crashed in a storm and it just got fixed.

Techtad commented 11 years ago

@sciguy1121 Never mind. It just made me work on it a little bit more than usually since I could send everything in 1 pull request.