net.minecraft.src

## Class BaseMod

- java.lang.Object
- - net.minecraft.src.BaseMod

- All Implemented Interfaces:
    BaseModProxy

      public abstract class BaseMod
      extends Object
      implements BaseModProxy

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseMod()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `addFuel(int id, int metadata)` Override if you wish to provide a fuel item for the furnace and return the fuel value of the item
    `void` | `addRenderer(Map<Class<? extends Entity>,Render> renderers)`
    `void` | `clientChat(String text)` Only implemented on the client side `serverChat(NetServerHandler, String)`
    `void` | `clientConnect(NetClientHandler handler)` Called when a client connects
    `void` | `clientCustomPayload(NetClientHandler handler, Packet250CustomPayload packet)`
    `void` | `clientDisconnect(NetClientHandler handler)` Called when the client disconnects
    `boolean` | `doTickInGame(TickType tick, boolean tickEnd, Object... data)`
    `boolean` | `doTickInGUI(TickType tick, boolean tickEnd, Object... data)`
    `void` | `generateNether(World world, Random random, int chunkX, int chunkZ)` Override if you wish to generate Nether (Hell biome) blocks
    `void` | `generateSurface(World world, Random random, int chunkX, int chunkZ)` Override if you wish to generate Overworld (not hell or the end) blocks
    `GuiContainer` | `getContainerGUI(EntityClientPlayerMP player, int containerID, int x, int y, int z)` Callback to return a gui screen to display
    `String` | `getName()` Return the name of your mod.
    `String` | `getPriorities()` Get your mod priorities
    `abstract String` | `getVersion()` Return the version of your mod
    `void` | `keyboardEvent(KeyBinding event)`
    `abstract void` | `load()` Load your mod
    `void` | `modsLoaded()` Finish loading your mod
    `void` | `onClientLogin(EntityPlayer player)` Called when a new client logs in.
    `void` | `onClientLogout(INetworkManager mgr)` Called when a client logs out of the server.
    `void` | `onItemPickup(EntityPlayer player, ItemStack item)` Handle item pickup
    `boolean` | `onTickInGame(float time, Minecraft minecraftInstance)` Ticked every game tick if you have subscribed to tick events through `ModLoader.setInGameHook(BaseMod, boolean, boolean)`
    `boolean` | `onTickInGame(MinecraftServer minecraftServer)`
    `boolean` | `onTickInGUI(float tick, Minecraft game, GuiScreen gui)`
    `void` | `receiveCustomPacket(Packet250CustomPayload packet)` Called client side to receive a custom payload for this mod NOTE: this method is not provided in Risugami's implementation of BaseMod!
    `void` | `registerAnimation(Minecraft game)`
    `void` | `renderInvBlock(RenderBlocks renderer, Block block, int metadata, int modelID)`
    `boolean` | `renderWorldBlock(RenderBlocks renderer, IBlockAccess world, int x, int y, int z, Block block, int modelID)`
    `void` | `serverChat(NetServerHandler source, String message)` Called when a chat message is received.
    `void` | `serverConnect(NetHandler handler)`
    `void` | `serverCustomPayload(NetServerHandler handler, Packet250CustomPayload packet)`
    `void` | `serverDisconnect()`
    `Entity` | `spawnEntity(int entityId, World world, double scaledX, double scaledY, double scaledZ)` Spawn the entity of the supplied type, if it is your mod's
    `void` | `takenFromCrafting(EntityPlayer player, ItemStack item, IInventory matrix)` Called when someone crafts an item from a crafting table
    `void` | `takenFromFurnace(EntityPlayer player, ItemStack item)` Called when someone takes a smelted item from a furnace
    `String` | `toString()` The identifier string for the mod- used in client<->server negotiation

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### BaseMod

          public BaseMod()

  - ### Method Detail

    - #### doTickInGame

          public final boolean doTickInGame(TickType tick,
                             boolean tickEnd,
                             Object... data)

      Specified by:
        `doTickInGame` in interface `BaseModProxy`

    - #### doTickInGUI

          public final boolean doTickInGUI(TickType tick,
                            boolean tickEnd,
                            Object... data)

      Specified by:
        `doTickInGUI` in interface `BaseModProxy`

    - #### addFuel

          public int addFuel(int id,
                    int metadata)

      Override if you wish to provide a fuel item for the furnace and return the fuel value of the item
      Specified by:
        `addFuel` in interface `BaseModProxy`
      Parameters:
        `id` -
        `metadata` -

    - #### addRenderer

          public void addRenderer(Map<Class<? extends Entity>,Render> renderers)

    - #### generateNether

          public void generateNether(World world,
                            Random random,
                            int chunkX,
                            int chunkZ)

      Override if you wish to generate Nether (Hell biome) blocks
      Specified by:
        `generateNether` in interface `BaseModProxy`
      Parameters:
        `world` -
        `random` -
        `chunkX` -
        `chunkZ` -

    - #### generateSurface

          public void generateSurface(World world,
                             Random random,
                             int chunkX,
                             int chunkZ)

      Override if you wish to generate Overworld (not hell or the end) blocks
      Specified by:
        `generateSurface` in interface `BaseModProxy`
      Parameters:
        `world` -
        `random` -
        `chunkX` -
        `chunkZ` -

    - #### getContainerGUI

          public GuiContainer getContainerGUI(EntityClientPlayerMP player,
                                     int containerID,
                                     int x,
                                     int y,
                                     int z)

      Callback to return a gui screen to display
      Parameters:
        `player` -
        `containerID` -
        `x` -
        `y` -
        `z` -

    - #### getName

          public String getName()

      Return the name of your mod. Defaults to the class name
      Specified by:
        `getName` in interface `BaseModProxy`

    - #### getPriorities

          public String getPriorities()

      Get your mod priorities
      Specified by:
        `getPriorities` in interface `BaseModProxy`

    - #### getVersion

          public abstract String getVersion()

      Return the version of your mod
      Specified by:
        `getVersion` in interface `BaseModProxy`

    - #### keyboardEvent

          public void keyboardEvent(KeyBinding event)

    - #### load

          public abstract void load()

      Load your mod
      Specified by:
        `load` in interface `BaseModProxy`

    - #### modsLoaded

          public void modsLoaded()

      Finish loading your mod
      Specified by:
        `modsLoaded` in interface `BaseModProxy`

    - #### onItemPickup

          public void onItemPickup(EntityPlayer player,
                          ItemStack item)

      Handle item pickup
      Specified by:
        `onItemPickup` in interface `BaseModProxy`
      Parameters:
        `player` -
        `item` -

    - #### onTickInGame

          public boolean onTickInGame(float time,
                             Minecraft minecraftInstance)

      Ticked every game tick if you have subscribed to tick events through `ModLoader.setInGameHook(BaseMod, boolean, boolean)`
      Parameters:
        `time` - the rendering subtick time (0.0-1.0)
        `minecraftInstance` - the client
      Returns:
        true to continue receiving ticks

    - #### onTickInGame

          public boolean onTickInGame(MinecraftServer minecraftServer)

    - #### onTickInGUI

          public boolean onTickInGUI(float tick,
                            Minecraft game,
                            GuiScreen gui)

    - #### clientChat

          public void clientChat(String text)

      Only implemented on the client side `serverChat(NetServerHandler, String)`
      Specified by:
        `clientChat` in interface `BaseModProxy`
      Parameters:
        `text` -

    - #### clientConnect

          public void clientConnect(NetClientHandler handler)

      Called when a client connects
      Parameters:
        `handler` -

    - #### clientDisconnect

          public void clientDisconnect(NetClientHandler handler)

      Called when the client disconnects
      Parameters:
        `handler` -

    - #### receiveCustomPacket

          public void receiveCustomPacket(Packet250CustomPayload packet)

      Called client side to receive a custom payload for this mod NOTE: this method is not provided in Risugami's implementation of BaseMod!
      Specified by:
        `receiveCustomPacket` in interface `BaseModProxy`
      Parameters:
        `packet` -

    - #### registerAnimation

          public void registerAnimation(Minecraft game)

    - #### renderInvBlock

          public void renderInvBlock(RenderBlocks renderer,
                            Block block,
                            int metadata,
                            int modelID)

    - #### renderWorldBlock

          public boolean renderWorldBlock(RenderBlocks renderer,
                                 IBlockAccess world,
                                 int x,
                                 int y,
                                 int z,
                                 Block block,
                                 int modelID)

    - #### serverConnect

          public void serverConnect(NetHandler handler)

      Specified by:
        `serverConnect` in interface `BaseModProxy`

    - #### serverCustomPayload

          public void serverCustomPayload(NetServerHandler handler,
                                 Packet250CustomPayload packet)

      Specified by:
        `serverCustomPayload` in interface `BaseModProxy`

    - #### serverDisconnect

          public void serverDisconnect()

      Specified by:
        `serverDisconnect` in interface `BaseModProxy`

    - #### takenFromCrafting

          public void takenFromCrafting(EntityPlayer player,
                               ItemStack item,
                               IInventory matrix)

      Called when someone crafts an item from a crafting table
      Specified by:
        `takenFromCrafting` in interface `BaseModProxy`
      Parameters:
        `player` -
        `item` -
        `matrix` -

    - #### takenFromFurnace

          public void takenFromFurnace(EntityPlayer player,
                              ItemStack item)

      Called when someone takes a smelted item from a furnace
      Specified by:
        `takenFromFurnace` in interface `BaseModProxy`
      Parameters:
        `player` -
        `item` -

    - #### toString

          public String toString()

      The identifier string for the mod- used in client<->server negotiation
      Overrides:
        `toString` in class `Object`

    - #### serverChat

          public void serverChat(NetServerHandler source,
                        String message)

      Called when a chat message is received. Return true to stop further processing
      Specified by:
        `serverChat` in interface `BaseModProxy`

    - #### onClientLogin

          public void onClientLogin(EntityPlayer player)

      Called when a new client logs in. NOTE: this method is not provided in Risugami's implementation of BaseMod!
      Specified by:
        `onClientLogin` in interface `BaseModProxy`
      Parameters:
        `player` -

    - #### onClientLogout

          public void onClientLogout(INetworkManager mgr)

      Called when a client logs out of the server. NOTE: this method is not provided in Risugami's implementation of BaseMod!
      Specified by:
        `onClientLogout` in interface `BaseModProxy`

    - #### spawnEntity

          public Entity spawnEntity(int entityId,
                           World world,
                           double scaledX,
                           double scaledY,
                           double scaledZ)

      Spawn the entity of the supplied type, if it is your mod's

    - #### clientCustomPayload

          public void clientCustomPayload(NetClientHandler handler,
                                 Packet250CustomPayload packet)