Ever since 1.3, the merge of client of server, I have had humongous problems with my mod.
First of all my keybinding will not work :
Ok first of all im not sure if the code in keyUp even works so I put System.out.println("Hello"); in keyDown nothing came out in the console like it should
This is my key handler code:
package jango.mods.starwars;
import java.util.EnumSet;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.src.ModLoader;
import net.minecraft.world.World;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.KeyBindingRegistry.KeyHandler;
import cpw.mods.fml.common.TickType;
public class LightsaberKeyhandler extends KeyHandler {
KeyBinding keybind;
World var1;
int var2;
int var3;
int var4;
EntityPlayer var5;
int var6;
float var7;
float var8;
float var9;
public LightsaberKeyhandler(KeyBinding[] keyBindings, boolean[] repeat) {
super(keyBindings);
// TODO Auto-generated constructor stub
}
@Override
public String getLabel() {
// TODO Auto-generated method stub
return null;
}
@Override
public void keyDown(EnumSet<TickType> types, KeyBinding kb,
boolean tickEnd, boolean isRepeat) {
System.out.println("Hello");
}
Minecraft sabersound = ModLoader.getMinecraftInstance();
private EnumSet ticks = EnumSet.of(TickType.CLIENT);
@Override
public void keyUp(EnumSet<TickType> types, KeyBinding keybind, boolean tickEnd)
{
if (tickEnd && FMLClientHandler.instance().getClient().currentScreen == null)
{
if (var1.isRemote)
{
ItemStack var10 = var5.inventory.getCurrentItem();
if (var10 == null)
{
return;
}
else
{
var10 = var5.inventory.getCurrentItem();
if (var10.itemID == mod_jangostarwars.LightSaberOFF.itemID && var10.getItemDamage() == 0)
{
ItemStack var12 = new ItemStack(mod_jangostarwars.LightSaber, 1, 0);
sabersound.sndManager.playSoundFX("LightSaberSound.LightSaberOnSound", 1.0F, 1.0F);
if (!var5.inventory.addItemStackToInventory(var12))
{
var1.spawnEntityInWorld(new EntityItem(var1, (double)var2 + 0.5D, (double)var3 + 1.5D, (double)var4 + 0.5D, var12));
}
--var10.stackSize;
if (var10.stackSize <= 0)
{
var5.inventory.setInventorySlotContents(var5.inventory.currentItem, (ItemStack)null);
}
}
if (var10.itemID == mod_jangostarwars.LightSaberOFF.itemID && var10.getItemDamage() == 1)
{
ItemStack var12 = new ItemStack(mod_jangostarwars.LightSaber, 1, 1);
sabersound.sndManager.playSoundFX("LightSaberSound.LightSaberOnSound", 1.0F, 1.0F);
if (!var5.inventory.addItemStackToInventory(var12))
{
var1.spawnEntityInWorld(new EntityItem(var1, (double)var2 + 0.5D, (double)var3 + 1.5D, (double)var4 + 0.5D, var12));
}
--var10.stackSize;
if (var10.stackSize <= 0)
{
var5.inventory.setInventorySlotContents(var5.inventory.currentItem, (ItemStack)null);
}
}
if (var10.itemID == mod_jangostarwars.LightSaberOFF.itemID && var10.getItemDamage() == 2)
{
ItemStack var12 = new ItemStack(mod_jangostarwars.LightSaber, 1, 2);
sabersound.sndManager.playSoundFX("LightSaberSound.LightSaberOnSound", 1.0F, 1.0F);
if (!var5.inventory.addItemStackToInventory(var12))
{
var1.spawnEntityInWorld(new EntityItem(var1, (double)var2 + 0.5D, (double)var3 + 1.5D, (double)var4 + 0.5D, var12));
}
--var10.stackSize;
if (var10.stackSize <= 0)
{
var5.inventory.setInventorySlotContents(var5.inventory.currentItem, (ItemStack)null);
}
}
if (var10.itemID == mod_jangostarwars.LightSaberOFF.itemID && var10.getItemDamage() == 3)
{
ItemStack var12 = new ItemStack(mod_jangostarwars.LightSaber, 1, 3);
sabersound.sndManager.playSoundFX("LightSaberSound.LightSaberOnSound", 1.0F, 1.0F);
if (!var5.inventory.addItemStackToInventory(var12))
{
var1.spawnEntityInWorld(new EntityItem(var1, (double)var2 + 0.5D, (double)var3 + 1.5D, (double)var4 + 0.5D, var12));
}
else if (var5 instanceof EntityPlayerMP)
--var10.stackSize;
if (var10.stackSize <= 0)
{
var5.inventory.setInventorySlotContents(var5.inventory.currentItem, (ItemStack)null);
}
}
if (var10.itemID == mod_jangostarwars.LightSaberOFF.itemID && var10.getItemDamage() == 1)
{
ItemStack var12 = new ItemStack(mod_jangostarwars.LightSaber, 1, 1);
sabersound.sndManager.playSoundFX("LightSaberSound.LightSaberOnSound", 1.0F, 1.0F);
if (!var5.inventory.addItemStackToInventory(var12))
{
var1.spawnEntityInWorld(new EntityItem(var1, (double)var2 + 0.5D, (double)var3 + 1.5D, (double)var4 + 0.5D, var12));
}
else if (var5 instanceof EntityPlayerMP)
--var10.stackSize;
if (var10.stackSize <= 0)
{
var5.inventory.setInventorySlotContents(var5.inventory.currentItem, (ItemStack)null);
}
}
if (var10.itemID == mod_jangostarwars.LightSaberOFF.itemID && var10.getItemDamage() == 1)
{
ItemStack var12 = new ItemStack(mod_jangostarwars.LightSaber, 1, 1);
sabersound.sndManager.playSoundFX("LightSaberSound.LightSaberOnSound", 1.0F, 1.0F);
if (!var5.inventory.addItemStackToInventory(var12))
{
var1.spawnEntityInWorld(new EntityItem(var1, (double)var2 + 0.5D, (double)var3 + 1.5D, (double)var4 + 0.5D, var12));
}
else if (var5 instanceof EntityPlayerMP)
--var10.stackSize;
if (var10.stackSize <= 0)
{
var5.inventory.setInventorySlotContents(var5.inventory.currentItem, (ItemStack)null);
}
}
if (var10.itemID == mod_jangostarwars.LightSaberOFF.itemID && var10.getItemDamage() == 1)
{
ItemStack var12 = new ItemStack(mod_jangostarwars.LightSaber, 1, 1);
sabersound.sndManager.playSoundFX("LightSaberSound.LightSaberOnSound", 1.0F, 1.0F);
if (!var5.inventory.addItemStackToInventory(var12))
{
var1.spawnEntityInWorld(new EntityItem(var1, (double)var2 + 0.5D, (double)var3 + 1.5D, (double)var4 + 0.5D, var12));
}
else if (var5 instanceof EntityPlayerMP)
--var10.stackSize;
if (var10.stackSize <= 0)
{
var5.inventory.setInventorySlotContents(var5.inventory.currentItem, (ItemStack)null);
}
}
if (var10.itemID == mod_jangostarwars.LightSaberOFF.itemID && var10.getItemDamage() == 1)
{
ItemStack var12 = new ItemStack(mod_jangostarwars.LightSaber, 1, 1);
sabersound.sndManager.playSoundFX("LightSaberSound.LightSaberOnSound", 1.0F, 1.0F);
if (!var5.inventory.addItemStackToInventory(var12))
{
var1.spawnEntityInWorld(new EntityItem(var1, (double)var2 + 0.5D, (double)var3 + 1.5D, (double)var4 + 0.5D, var12));
}
else if (var5 instanceof EntityPlayerMP)
--var10.stackSize;
if (var10.stackSize <= 0)
{
var5.inventory.setInventorySlotContents(var5.inventory.currentItem, (ItemStack)null);
}
}
}
}else
{
return;
}
}
}
@Override
public EnumSet<TickType> ticks() {
// TODO Auto-generated method stub
return null;
}
}
This is my class code:
package jango.mods.starwars;
import java.util.List;
import java.io.File;
import java.util.*;
import java.io.File;
import org.lwjgl.opengl.GL11;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.src.ModLoader;
import net.minecraft.src.BaseMod;
import cpw.mods.fml.client.registry.KeyBindingRegistry;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.Player;
import net.minecraft.src.ModLoader;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenMinable;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.EnumHelper;
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.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler;
import cpw.mods.fml.common.SidedProxy;
import jango.mods.starwars.ClientPacketHandler;
import jango.mods.starwars.CommonProxy;
import org.lwjgl.input.Keyboard;
@NetworkMod(clientSideRequired=true,serverSideRequired=false, //Whether client side and server side are needed
clientPacketHandlerSpec = @SidedPacketHandler(channels = {"TutorialGeneral" }, packetHandler = PacketHandler.class),
serverPacketHandlerSpec = @SidedPacketHandler(channels = {}, packetHandler = ServerPacketHandler.class))
@Mod(modid="Jangos_StarWars",name="Star Wars - Simple But advanced",version="1.0")
public class mod_jangostarwars extends BaseMod
{
static net.minecraft.item.EnumArmorMaterial MANDO = EnumHelper.addArmorMaterial("MANDO", 56, new int[] {4, 8, 6, 2}, 4);
public static final net.minecraft.block.Block EmitterCrystal = (new BlockEmitterCrystal(200)).setLightValue(0.5F).setHardness(0.5F).setStepSound(Block.soundGlassFootstep).setBlockName("EmmiterCrystal");
public static final net.minecraft.block.Block Hlight = (new Blockhlight(203)).setLightValue(0.9F).setHardness(0.1F).setStepSound(Block.soundGlassFootstep).setBlockName("H Light");
public static final net.minecraft.block.Block DuraSteel = (new BlockDuraSteel(201)).setHardness(1.0F).setStepSound(Block.soundStoneFootstep).setBlockName("DuraSteel");
public static final net.minecraft.block.Block PermaCrete = (new BlockPermaCrete(202)).setHardness(0.9F).setStepSound(Block.soundStoneFootstep).setBlockName("PermaCrete");
public static final net.minecraft.item.Item Crystal = (new ItemCrystal(5000)).setItemName("Crystal");
public static final net.minecraft.item.Item LightSaberOFF = (new ItemSaberOFF(5001)).setItemName("LightSaberOFF");
public static final net.minecraft.item.Item LightSaber = (new ItemSaber(5002, EnumToolSaber.SABER)).setItemName("LightSaber");
public static final net.minecraft.item.Item LightSaberEmitter = (new ItemEmitter(5003)).setItemName("LightSaberEmiter");
public static final net.minecraft.item.Item LightSaberProjecter = (new ItemProjecter(5004)).setItemName("LightSaber Projecter");
public static int texCrystalBlue = ModLoader.addOverride("/terrain.png", "/JangosTextures/StarWars/CrystalBlue.png");
public static int texCrystalRed = ModLoader.addOverride("/terrain.png", "/JangosTextures/StarWars/CrystalRed.png");
public static int texCrystalGreen = ModLoader.addOverride("/terrain.png", "/JangosTextures/StarWars/CrystalGreen.png");
public static int texCrystalPurple = ModLoader.addOverride("/terrain.png", "/JangosTextures/StarWars/CrystalPurple.png");
public static int texCrystalYellow = ModLoader.addOverride("/terrain.png", "/JangosTextures/StarWars/CrystalYellow.png");
public static int texCrystalBlack = ModLoader.addOverride("/terrain.png", "/JangosTextures/StarWars/CrystalBlack.png");
public static int texCrystalWhite = ModLoader.addOverride("/terrain.png", "/JangosTextures/StarWars/CrystalWhite.png");
public static int ItemCrystalTextureBlue = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/BlueGem.png");
public static int ItemCrystalTextureRed = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/RedGem.png");
public static int ItemCrystalTextureGreen = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/GreenGem.png");
public static int ItemCrystalTexturePurple = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/PurpleGem.png");
public static int ItemCrystalTextureYellow = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/YellowGem.png");
public static int ItemCrystalTextureBlack = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/BlackGem.png");
public static int ItemCrystalTextureWhite = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/WhiteGem.png");
public static int ItemLightSaberOff = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/LightSabberOFF.png");
public static int ItemLightSaberBlue = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/LightSabberB.png");
public static int ItemLightSaberRed = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/LightSabberR.png");
public static int ItemLightSaberGreen = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/LightSabberG.png");
public static int ItemLightSaberPurple = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/LightSabberP.png");
public static int ItemLightSaberYellow = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/LightSabberY.png");
public static int ItemLightSaberBlack = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/LightSabberBL.png");
public static int ItemLightSaberWhite = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/LightSabberW.png");
public static int ItemLightSaberEmitterBlue = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/LightSaberEmitterB.png");
public static int ItemLightSaberEmitterRed = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/LightSaberEmitterR.png");
public static int ItemLightSaberEmitterGreen = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/LightSaberEmitterG.png");
public static int ItemLightSaberEmitterPurple = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/LightSaberEmitterP.png");
public static int ItemLightSaberEmitterYellow = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/LightSaberEmitterY.png");
public static int ItemLightSaberEmitterBlack = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/LightSaberEmitterB2.png");
public static int ItemLightSaberEmitterWhite = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/LightSaberEmitterW.png");
public static int ItemLightSaberProjecter = ModLoader.addOverride("/gui/items.png", "/JangosTextures/StarWars/LightSaberProjecter.png");
public static Item mandoHelmet = (new ItemMandoA(3000, MANDO, 3, 0)).setItemName("MandoHelm");
public static Item mandoChestPlate = (new ItemMandoA(3001, MANDO, 1, 1)).setItemName("MandoChest");
public static Item mandoLegs = (new ItemMandoA(3002, MANDO, 3, 2)).setItemName("MandoLegs");
public static Item mandoBoots = (new ItemMandoA(3003, MANDO, 3, 3)).setItemName("MandoBoots");
@SidedProxy(clientSide = "jango.mods.starwars.ClientProxy", serverSide = "jango.mods.starwars.CommonProxy")
public static CommonProxy proxy;
@Instance
public static mod_jangostarwars instance;
@Init
public void load(FMLInitializationEvent evt)
{
proxy.sound();
KeyBinding[] key = {new KeyBinding("Sword_Toggle", Keyboard.KEY_R)};
boolean[] repeat = {false};
KeyBindingRegistry.registerKeyBinding(new LightsaberKeyhandler(key, repeat));
}
public mod_jangostarwars()
{
KeyBinding[] key = {new KeyBinding("Sword_Toggle", Keyboard.KEY_R)};
DuraSteel.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/JangosTextures/StarWars/Dura Steel.png");
PermaCrete.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/JangosTextures/StarWars/Permacrete.png");
Hlight.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/JangosTextures/StarWars/Hlight1.png");
GameRegistry.registerBlock(EmitterCrystal, ItemBlockEmitterCrystal.class);
GameRegistry.registerBlock(DuraSteel);
GameRegistry.registerBlock(PermaCrete);
GameRegistry.registerBlock(Hlight);
ModLoader.addName(mandoHelmet, "Mandolorian Helmet");
ModLoader.addName(mandoChestPlate, "Mandolorian Chestplate");
ModLoader.addName(mandoLegs, "Mandolorian");
ModLoader.addName(mandoBoots, "Mandolorian Boots");
LanguageRegistry.addName(new ItemStack(DuraSteel), "Dura Steel");
LanguageRegistry.addName(new ItemStack(PermaCrete), "Permacrete");
LanguageRegistry.addName(new ItemStack(Hlight), "H Light");
LanguageRegistry.addName(new ItemStack(EmitterCrystal, 1), "Blue Crystal");
LanguageRegistry.addName(new ItemStack(EmitterCrystal, 1, 1), "Red Crystal");
LanguageRegistry.addName(new ItemStack(EmitterCrystal, 1, 2), "Green Crystal");
LanguageRegistry.addName(new ItemStack(EmitterCrystal, 1, 3), "Purple Crystal");
LanguageRegistry.addName(new ItemStack(EmitterCrystal, 1, 4), "Yellow Crystal");
LanguageRegistry.addName(new ItemStack(EmitterCrystal, 1, 5), "Black Crystal");
LanguageRegistry.addName(new ItemStack(EmitterCrystal, 1, 6), "White Crystal");
LanguageRegistry.addName(new ItemStack(LightSaberOFF, 1), "Blue LightSaber Off");
LanguageRegistry.addName(new ItemStack(LightSaberOFF, 1, 1), "Red LightSaber Off");
LanguageRegistry.addName(new ItemStack(LightSaberOFF, 1, 2), "Green LightSaber Off");
LanguageRegistry.addName(new ItemStack(LightSaberOFF, 1, 3), "Purple LightSaber Off");
LanguageRegistry.addName(new ItemStack(LightSaberOFF, 1, 4), "Yellow LightSaber Off");
LanguageRegistry.addName(new ItemStack(LightSaberOFF, 1, 5), "Black LightSaber Off");
LanguageRegistry.addName(new ItemStack(LightSaberOFF, 1, 6), "White LightSaber Off");
LanguageRegistry.addName(new ItemStack(Crystal, 1), "Blue Crystal");
LanguageRegistry.addName(new ItemStack(Crystal, 1, 1), "Red Crystal");
LanguageRegistry.addName(new ItemStack(Crystal, 1, 2), "Green Crystal");
LanguageRegistry.addName(new ItemStack(Crystal, 1, 3), "Purple Crystal");
LanguageRegistry.addName(new ItemStack(Crystal, 1, 4), "Yellow Crystal");
LanguageRegistry.addName(new ItemStack(Crystal, 1, 5), "Black Crystal");
LanguageRegistry.addName(new ItemStack(Crystal, 1, 6), "White Crystal");
LanguageRegistry.addName(new ItemStack(LightSaber, 1), "Blue LightSaber");
LanguageRegistry.addName(new ItemStack(LightSaber, 1, 1), "Red LightSaber");
LanguageRegistry.addName(new ItemStack(LightSaber, 1, 2), "Green LightSaber");
LanguageRegistry.addName(new ItemStack(LightSaber, 1, 3), "Purple LightSaber");
LanguageRegistry.addName(new ItemStack(LightSaber, 1, 4), "Yellow LightSaber");
LanguageRegistry.addName(new ItemStack(LightSaber, 1, 5), "Black LightSaber");
LanguageRegistry.addName(new ItemStack(LightSaber, 1, 6), "White LightSaber");
LanguageRegistry.addName(new ItemStack(LightSaberEmitter, 1), "Blue LightSaber Emitter");
LanguageRegistry.addName(new ItemStack(LightSaberEmitter, 1, 1), "Red LightSaber Emitter");
LanguageRegistry.addName(new ItemStack(LightSaberEmitter, 1, 2), "Green LightSaber Emitter");
LanguageRegistry.addName(new ItemStack(LightSaberEmitter, 1, 3), "Purple LightSaber Emitter");
LanguageRegistry.addName(new ItemStack(LightSaberEmitter, 1, 4), "Yellow LightSaber Emitter");
LanguageRegistry.addName(new ItemStack(LightSaberEmitter, 1, 5), "Black LightSaber Emitter");
LanguageRegistry.addName(new ItemStack(LightSaberEmitter, 1, 6), "White LightSaber Emitter");
LanguageRegistry.addName(new ItemStack(LightSaberProjecter), "LightSaber Projecter");
ModLoader.addRecipe(new ItemStack(LightSaberOFF, 1, 0), new Object[] {" P ", " EB", " I ", 'E', new ItemStack(LightSaberEmitter, 1, 0), 'I', Item.ingotIron, 'P', mod_jangostarwars.LightSaberProjecter, 'B', Block.stoneButton});
ModLoader.addRecipe(new ItemStack(LightSaberOFF, 1, 1), new Object[] {" P ", " EB", " I ", 'E', new ItemStack(LightSaberEmitter, 1, 1), 'I', Item.ingotIron, 'P', mod_jangostarwars.LightSaberProjecter, 'B', Block.stoneButton});
ModLoader.addRecipe(new ItemStack(LightSaberOFF, 1, 2), new Object[] {" P ", " EB", " I ", 'E', new ItemStack(LightSaberEmitter, 1, 2), 'I', Item.ingotIron, 'P', mod_jangostarwars.LightSaberProjecter, 'B', Block.stoneButton});
ModLoader.addRecipe(new ItemStack(LightSaberOFF, 1, 3), new Object[] {" P ", " EB", " I ", 'E', new ItemStack(LightSaberEmitter, 1, 3), 'I', Item.ingotIron, 'P', mod_jangostarwars.LightSaberProjecter, 'B', Block.stoneButton});
ModLoader.addRecipe(new ItemStack(LightSaberOFF, 1, 4), new Object[] {" P ", " EB", " I ", 'E', new ItemStack(LightSaberEmitter, 1, 4), 'I', Item.ingotIron, 'P', mod_jangostarwars.LightSaberProjecter, 'B', Block.stoneButton});
ModLoader.addRecipe(new ItemStack(LightSaberOFF, 1, 5), new Object[] {" P ", " EB", " I ", 'E', new ItemStack(LightSaberEmitter, 1, 5), 'I', Item.ingotIron, 'P', mod_jangostarwars.LightSaberProjecter, 'B', Block.stoneButton});
ModLoader.addRecipe(new ItemStack(LightSaberOFF, 1, 6), new Object[] {" P ", " EB", " I ", 'E', new ItemStack(LightSaberEmitter, 1, 6), 'I', Item.ingotIron, 'P', mod_jangostarwars.LightSaberProjecter, 'B', Block.stoneButton});
ModLoader.addRecipe(new ItemStack(LightSaberProjecter, 1), new Object[] {"IDI", "IGI", "IDI", 'D', Item.diamond, 'I', Item.ingotIron, 'G',Block.glass});
ModLoader.addRecipe(new ItemStack(LightSaberEmitter, 1, 0), new Object[] {"IDI", "ICI", "IRI", 'D', Item.diamond, 'I', Item.ingotIron, 'C', new ItemStack(Crystal, 1, 0), 'R', Item.redstone});
ModLoader.addRecipe(new ItemStack(LightSaberEmitter, 1, 1), new Object[] {"IDI", "ICI", "IRI", 'D', Item.diamond, 'I', Item.ingotIron, 'C', new ItemStack(Crystal, 1, 1), 'R', Item.redstone});
ModLoader.addRecipe(new ItemStack(LightSaberEmitter, 1, 2), new Object[] {"IDI", "ICI", "IRI", 'D', Item.diamond, 'I', Item.ingotIron, 'C', new ItemStack(Crystal, 1, 2), 'R', Item.redstone});
ModLoader.addRecipe(new ItemStack(LightSaberEmitter, 1, 3), new Object[] {"IDI", "ICI", "IRI", 'D', Item.diamond, 'I', Item.ingotIron, 'C', new ItemStack(Crystal, 1, 3), 'R', Item.redstone});
ModLoader.addRecipe(new ItemStack(LightSaberEmitter, 1, 4), new Object[] {"IDI", "ICI", "IRI", 'D', Item.diamond, 'I', Item.ingotIron, 'C', new ItemStack(Crystal, 1, 4), 'R', Item.redstone});
ModLoader.addRecipe(new ItemStack(LightSaberEmitter, 1, 5), new Object[] {"IDI", "ICI", "IRI", 'D', Item.diamond, 'I', Item.ingotIron, 'C', new ItemStack(Crystal, 1, 5), 'R', Item.redstone});
ModLoader.addRecipe(new ItemStack(LightSaberEmitter, 1, 6), new Object[] {"IDI", "ICI", "IRI", 'D', Item.diamond, 'I', Item.ingotIron, 'C', new ItemStack(Crystal, 1, 6), 'R', Item.redstone});
sabersound.installResource("newsound/LightSaberSound/LightSaberOffSound.ogg", new File(sabersound.mcDataDir,"resources/LightSaber/ltsaberoff.ogg"));
sabersound.installResource("newsound/LightSaberSound/LightSaberOnSound.ogg", new File(sabersound.mcDataDir,"resources/LightSaber/ltsaberon.ogg"));
sabersound.installResource("newsound/LightSaberSound/LightSaberConstantSound.ogg", new File(sabersound.mcDataDir,"resources/LightSaber/sabconst.ogg"));
sabersound.installResource("newsound/LightSaberSound/LightSaberSwingASound.ogg", new File(sabersound.mcDataDir,"resources/LightSaber/sabrswgA.ogg"));
sabersound.installResource("newsound/LightSaberSound/LightSaberSwingBSound.ogg", new File(sabersound.mcDataDir,"resources/LightSaber/sabrswgB.ogg"));
sabersound.installResource("newsound/LightSaberSound/LightSaberHitSound.ogg", new File(sabersound.mcDataDir,"resources/LightSaber/sabhit.ogg"));
}
Minecraft sabersound = ModLoader.getMinecraftInstance();
public void generateSurface(World var1, Random var2, int var3, int var4, int y, int z)
{
int var5;
int var6;
int var7;
int var8;
for (var5 = 0; var5 < 6; ++var5)
{
var6 = var3 + var2.nextInt(16);
var7 = var2.nextInt(48);
var8 = var4 + var2.nextInt(16);
(new WorldGenMinable(EmitterCrystal.blockID, 0, 17)).generate(var1, var2, var6, var7, var8);
}
for (var5 = 0; var5 < 6; ++var5)
{
var6 = var3 + var2.nextInt(16);
var7 = var2.nextInt(48);
var8 = var4 + var2.nextInt(16);
(new WorldGenMinable(EmitterCrystal.blockID, 1, 17)).generate(var1, var2, var6, var7, var8);
}
}
public static void renderHelmetVisor(int par1, int par2,Minecraft mc)
{
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(false);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, mc.renderEngine.getTexture("%blur%/JangosTextures/StarWars/Armor/helmetVisorClone.png"));
Tessellator var3 = Tessellator.instance;
var3.startDrawingQuads();
var3.addVertexWithUV(0.0D, (double)par2, -90.0D, 0.0D, 1.0D);
var3.addVertexWithUV((double)par1, (double)par2, -90.0D, 1.0D, 1.0D);
var3.addVertexWithUV((double)par1, 0.0D, -90.0D, 1.0D, 0.0D);
var3.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D);
var3.draw();
GL11.glDepthMask(true);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
@Override
public String getVersion()
{
return null;
}
@Override
public void load()
{
}
}
This is my biggest problem other than the fact of giving players Items using code will give you a ghost item STILL not explained anywhere except "Use Packets" How? Why? Where? were my questions to that and thats not answered so please redirect me to somewhere i can find to fix that I believe this has been fixed in 1.4 sometime due to im able to keep it in my inventory in survival after i used some test code im not sure if it works in LAN though.
Many Thanks and Up votes for you if help... Thanks in advanced
Ok so i made keybinds work with a new code but now i can no longer return an item stack and pressing the bind with anything else selected i get the same error my code which is a Null Pointer Exception
Refine your Forge tutorial(s) and tell people what class to put it in, how t register it if its in a new class or not. i dont know where the hell im have to put the code man....
Refine your Forge tutorial(s) and tell people what class to put it in, how t register it if its in a new class or not. i dont know where the hell im have to put the code man....
What else do you want me to show? I explained every sound event method, showed where to put them(EventHandler class), then on how to register it in the event bus in the preInit method of your mod. If it's too confusing then you shouldn't be making mods and learn coding basics. Don't know what else to say man.
Rollback Post to RevisionRollBack
Same ****, different day - Modification Development Section
First of all my keybinding will not work :
This is my key handler code:
This is my class code:
This is my biggest problem other than the fact of giving players Items using code will give you a ghost item STILL not explained anywhere except "Use Packets" How? Why? Where? were my questions to that and thats not answered so please redirect me to somewhere i can find to fix thatI believe this has been fixed in 1.4 sometime due to im able to keep it in my inventory in survival after i used some test code im not sure if it works in LAN though.Many Thanks and Up votes for you if help... Thanks in advanced
-Jango
Any ideas?
As of 1.4.2, minecraft changed the sound type "newsound" and "sound" to the name "sound3".
Also you should use Forge's sound events. http://www.minecraft...and-more/#forge
What lol? I'm not going to go through this in another thread.
The reverse side also has a reverse side.
My Mods: Dungeon Mobs | (WIP) Blind Mapmaker
Have good grammar. Save us tiem.
What else do you want me to show? I explained every sound event method, showed where to put them(EventHandler class), then on how to register it in the event bus in the preInit method of your mod. If it's too confusing then you shouldn't be making mods and learn coding basics. Don't know what else to say man.