Jump to content

sigurd4

Members
  • Posts

    137
  • Joined

  • Last visited

Everything posted by sigurd4

  1. i have some firearms and im trying to have a way to reload them with a key, and use another key to change between three or more ammunition types. im having a tough time doing that and i think the problem lies in the fact that my way of getting the player that hit the key is not working properly, but it could be something else. a lot of other parts of my code is not working either and i dont understand why. can anyone help me?? please! what am i doing wrong?? In Init function in clientside proxy: KeyBindings.init(); FMLCommonHandler.instance().bus().register(new KeyBindings()); KeyBindings Class: public class KeyBindings extends ClientRegistry { public static KeyBinding WeaponNextAmmoType; public static KeyBinding WeaponReload; public Minecraft mc = Minecraft.getMinecraft(); public static void init() { WeaponNextAmmoType = new KeyBinding("key.WeaponNextAmmoTypeSelection", Keyboard.KEY_B, "key.categories.bioshock.weapon"); WeaponReload = new KeyBinding("key.WeaponReload", Keyboard.KEY_R, "key.categories.bioshock.weapon"); ClientRegistry.registerKeyBinding(WeaponNextAmmoType); ClientRegistry.registerKeyBinding(WeaponReload); } @SubscribeEvent public void onKeyInput(InputEvent.KeyInputEvent event) { if(KeyBindings.WeaponNextAmmoType != null) { if(KeyBindings.WeaponNextAmmoType.isPressed()) { EntityPlayer player = mc.thePlayer; if(player.getHeldItem() != null) if(player.getHeldItem().getItem() instanceof ItemWeaponRanged) { ItemWeaponRanged gun = (ItemWeaponRanged)player.getHeldItem().getItem(); gun.selectNextAmmoType(player.getHeldItem(), player); int a = player.getHeldItem().getTagCompound().getInteger("Ammo"); int c = player.getHeldItem().getTagCompound().getInteger("Capacity"); if(a+1 > c) { if(gun.reload(player.getHeldItem(), player, gun.reloadAmount)) { player.worldObj.playSoundAtEntity(player, "bioshock:item.weapon.shotgun.reload.single", 0.8F, 1.0F); } } } } } if(KeyBindings.WeaponReload != null) { if(KeyBindings.WeaponReload.isPressed()) { EntityPlayer player = mc.thePlayer; if(player.getHeldItem() != null) if(player.getHeldItem().getItem() instanceof ItemWeaponRanged) { if(player.getHeldItem().getTagCompound().getInteger("Ammo")+1 <= player.getHeldItem().getTagCompound().getInteger("Capacity")) { ItemWeaponRanged gun = (ItemWeaponRanged)player.getHeldItem().getItem(); player.worldObj.playSoundAtEntity(player, "bioshock:item.weapon.shotgun.reload.single", 0.8F, 1.0F); int a = player.getHeldItem().getTagCompound().getInteger("Ammo"); int c = player.getHeldItem().getTagCompound().getInteger("Capacity"); if(a+1 > c) { if(gun.reload(player.getHeldItem(), player, gun.reloadAmount)) { player.worldObj.playSoundAtEntity(player, "bioshock:item.weapon.shotgun.reload.single", 0.8F, 1.0F); } } } else { player.worldObj.playSoundAtEntity(player, "random.click", 0.3F, 1.6F); } } } } } } ItemWeaponRanged Class: public class ItemWeaponRanged extends ItemGeneric { public Item ammoItem; public int fireRate; public int capacity; public float spread; public float recoil; public int reloadAmount; public String upgrade1Name; public String upgrade2Name; public String[] ammoNames; public IIcon defaultTexture; public IIcon upgrade1Texture; public IIcon upgrade2Texture; public IIcon upgradeBothTexture; /** * Base class for ranged weapons and other similar things that use ammunition * @param int Ammunition maximum capacity * @param int Fire rate * @param float Spread * @param float Recoil * @param String name for first upgrade * @param String name for second upgrade * @param String name for first type of ammunition * @param String name for second type of ammunition * @param String name for third type of ammunition */ public ItemWeaponRanged(int capacity, int fireRate, float spread, float recoil, int reloadAmount, String upgrade1Name, String upgrade2Name, String[] ammoNames) { this.capacity = capacity; this.fireRate = fireRate; this.spread = spread; this.recoil = recoil; this.reloadAmount = reloadAmount; this.upgrade1Name = upgrade1Name; this.upgrade2Name = upgrade2Name; this.ammoNames = ammoNames; this.setMaxStackSize(1); this.setCreativeTab(BioshockMod.tabBioshockModWeapons); this.setUnlocalizedName("weapon"); this.setTextureName("bioshock:weapon"); this.setMaxDamage(100); this.setNoRepair(); this.setHasSubtypes(true); } /** * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) */ @SideOnly(Side.CLIENT) public void getSubItems(Item item, CreativeTabs creativeTab, List list) { ItemStack itemstack1 = new ItemStack(item, 1, 1); itemstack1.setTagCompound(new NBTTagCompound()); itemstack1.stackTagCompound.setString("AmmoType", this.ammoNames[0]); ItemStack itemstack2 = new ItemStack(item, 1, 1); itemstack2.setTagCompound(new NBTTagCompound()); itemstack2.stackTagCompound.setString("AmmoType", this.ammoNames[0]); ItemStack itemstack3 = new ItemStack(item, 1, 1); itemstack3.setTagCompound(new NBTTagCompound()); itemstack3.stackTagCompound.setString("AmmoType", this.ammoNames[0]); ItemStack itemstack4 = new ItemStack(item, 1, 1); itemstack4.setTagCompound(new NBTTagCompound()); itemstack4.stackTagCompound.setString("AmmoType", this.ammoNames[0]); itemstack2.stackTagCompound.setBoolean("Upgrade1", true); itemstack3.stackTagCompound.setBoolean("Upgrade2", true); itemstack4.stackTagCompound.setBoolean("Upgrade1", true); itemstack4.stackTagCompound.setBoolean("Upgrade2", true); this.createNbt(itemstack1); this.createNbt(itemstack2); this.createNbt(itemstack3); this.createNbt(itemstack4); list.add(itemstack1); list.add(itemstack2); list.add(itemstack3); list.add(itemstack4); } public void registerIcons(IIconRegister iconReg) { this.defaultTexture = iconReg.registerIcon(this.iconString); this.upgrade1Texture = iconReg.registerIcon(this.iconString); this.upgrade2Texture = iconReg.registerIcon(this.iconString); this.upgradeBothTexture = iconReg.registerIcon(this.iconString+"_upgrade_both"); } public void registerIcons(IIconRegister iconReg, String update1, String update2) { this.defaultTexture = iconReg.registerIcon(this.iconString); this.upgrade1Texture = iconReg.registerIcon(this.iconString + "_upgrade_"+update1); this.upgrade2Texture = iconReg.registerIcon(this.iconString+"_upgrade_"+update2); this.upgradeBothTexture = iconReg.registerIcon(this.iconString+"_upgrade_both"); } public IIcon getIconIndex(ItemStack itemstack) { this.createNbt(itemstack); if(itemstack.stackTagCompound.getBoolean("Upgrade1") && itemstack.stackTagCompound.getBoolean("Upgrade2")) { return this.upgradeBothTexture; } else if(itemstack.stackTagCompound.getBoolean("Upgrade1")) { return this.upgrade1Texture; } else if(itemstack.stackTagCompound.getBoolean("Upgrade2")) { return this.upgrade2Texture; } else { return this.defaultTexture; } } public IIcon getIcon(ItemStack itemstack, int pass) { return this.getIconIndex(itemstack); } /** * allows items to add custom lines of information to the mouseover description */ @SuppressWarnings({ "rawtypes", "unchecked" }) public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) { this.createNbt(itemstack); if(itemstack.stackTagCompound.hasKey("Capacity") && itemstack.stackTagCompound.hasKey("Ammo")) { list.add("Ammo: "); list.add(Integer.toString(itemstack.stackTagCompound.getInteger("Ammo")) + "/" + Integer.toString(itemstack.stackTagCompound.getInteger("Capacity"))); if(itemstack.stackTagCompound.getInteger("Ammo") > 0) { for(int z = 0; z < this.ammoNames.length; ++z) { if(itemstack.stackTagCompound.getString("AmmoType") == this.ammoNames[z]) { list.add("(" + this.ammoNames[z] + ")"); } } } } if(itemstack.stackTagCompound.hasKey("FireRate")) { list.add("Fire Rate: "); list.add(Float.toString(itemstack.stackTagCompound.getInteger("FireRate")/20F)); } if(itemstack.stackTagCompound.getBoolean("UpgradeClip") || itemstack.stackTagCompound.getBoolean("UpgradeDamage")) { list.add("Upgrades: "); if(itemstack.stackTagCompound.getBoolean("Upgrade1")) { list.add("-" + this.upgrade1Name + " Upgrade"); } if(itemstack.stackTagCompound.getBoolean("Upgrade2")) { list.add("-" + this.upgrade2Name + " Upgrade"); } } this.addInformationCustomUpgrades(itemstack, player, list, bool); } public void addInformationCustomAmmo(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {} public void addInformationCustomUpgrades(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {} public void onUpdate(ItemStack itemstack, World world, Entity entity, int par4, boolean par5) { this.createNbt(itemstack); if(itemstack.stackTagCompound.getInteger("FireRateTimer") > 0) { itemstack.stackTagCompound.setInteger("FireRateTimer", itemstack.stackTagCompound.getInteger("FireRateTimer")-1); } if(entity instanceof EntityPlayer && itemstack.stackTagCompound.getInteger("RecoilTimer") > 0) { itemstack.stackTagCompound.setInteger("RecoilTimer", itemstack.stackTagCompound.getInteger("RecoilTimer")-1); ((EntityPlayer)entity).rotationPitch = ((EntityPlayer)entity).rotationPitch+this.recoil/6; } /*if(!itemstack.hasDisplayName()) { String a = null; if(world.isRemote) { a = StatCollector.translateToLocal(itemstack.getItem().getUnlocalizedName(itemstack)); } if(a != null) { itemstack.setStackDisplayName("§r" + a); } }*/ } @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { EntityExtendedPlayer props = EntityExtendedPlayer.get(player); if(itemstack.stackTagCompound.getInteger("FireRateTimer") <= 0) { if(itemstack.stackTagCompound.getInteger("Ammo") > 0) { this.fireBullet(itemstack, world, player); itemstack.stackTagCompound.setInteger("Ammo", itemstack.stackTagCompound.getInteger("Ammo")-1); if(!player.capabilities.isCreativeMode) { if (itemstack.stackTagCompound.getInteger("Ammo") <= 0) { itemstack.stackTagCompound.setInteger("FireRateTimer", 0); itemstack.stackTagCompound.setInteger("Ammo", 0); world.playSoundAtEntity(player, "random.click", 2.0F, 2.0F / (itemRand.nextFloat() * 0.4F + 0.8F)); } else { this.setFireRate(itemstack); } } player.rotationPitch = player.rotationPitch-this.recoil; player.rotationYaw = player.rotationYaw+this.hi(0.01F); itemstack.stackTagCompound.setInteger("RecoilTimer", 6); } else { world.playSoundAtEntity(player, "random.click", 2.0F, 2.0F / (itemRand.nextFloat() * 0.4F + 0.8F)); } } return itemstack; } public void setupUpgradeNbt(ItemStack itemstack) {} public void createNbt(ItemStack itemstack) { if(itemstack.stackTagCompound == null) { itemstack.setTagCompound(new NBTTagCompound()); } this.setupUpgradeNbt(itemstack); if(!itemstack.stackTagCompound.hasKey("Capacity")) { itemstack.stackTagCompound.setInteger("Capacity", capacity); } if(!itemstack.stackTagCompound.hasKey("Ammo")) { itemstack.stackTagCompound.setInteger("Ammo", capacity); } if(!itemstack.stackTagCompound.hasKey("AmmoType")) { itemstack.stackTagCompound.setString("AmmoType", this.ammoNames[1]); } if(!itemstack.stackTagCompound.hasKey("FireRate")) { itemstack.stackTagCompound.setInteger("FireRate", fireRate); } if(!itemstack.stackTagCompound.hasKey("FireRateTimer")) { itemstack.stackTagCompound.setInteger("FireRateTimer", 0); } if(!itemstack.stackTagCompound.hasKey("Upgrade1")) { itemstack.stackTagCompound.setBoolean("Upgrade1", false); } if(!itemstack.stackTagCompound.hasKey("Upgrade2")) { itemstack.stackTagCompound.setBoolean("Upgrade2", false); } } public void setFireRate(ItemStack itemstack) { itemstack.stackTagCompound.setInteger("FireRateTimer", itemstack.stackTagCompound.getInteger("FireRate")); } public void fireBullet(ItemStack itemstack, World world, EntityPlayer player) {} protected float hi(float input) { return (this.itemRand.nextFloat()*input*2)-input; } public void selectNextAmmoType(ItemStack itemstack, EntityPlayer player) { this.selectAmmoType(itemstack, player, this.getAmmoNameIndex(itemstack, 1)); } public void selectAmmoType(ItemStack itemstack, EntityPlayer player, int ammoNameNumber) { if(this.ammoItem != null) { player.dropItem(this.ammoItem, itemstack.getTagCompound().getInteger("Ammo")); } itemstack.getTagCompound().setString("AmmoType", this.ammoNames[ammoNameNumber]); } protected int getAmmoNameIndex(ItemStack itemstack, int modifier) { int a = -1; String texture = itemstack.getTagCompound().getString("AmmoType"); for(int i = this.ammoNames.length-1; i >= 0 && i < this.ammoNames.length-1; --i) { if(texture == this.ammoNames[i]) { a = i; break; } } if(a >= 0) { if(modifier != 0) { int b = this.ammoNames.length-1; int i; for(i = a + modifier; i < b; i -= b) { a = i - modifier; } } } else { a = 0; } return a; } public boolean reload(ItemStack itemstack, EntityPlayer player, int requestedAmount) { if(itemstack.getItem() instanceof ItemWeaponRanged) { Item ammoItem = ((ItemWeaponRanged)itemstack.getItem()).ammoItem; if(ammoItem != null) { int i = this.lookForItemInInventory(this.ammoItem, player, requestedAmount); if(i > 0) { int c = itemstack.getTagCompound().getInteger("Capacity"); itemstack.getTagCompound().setInteger("Ammo", i > c ? c : i); return true; } else { return false; } } else { return false; } } else { return false; } } protected int lookForItemInInventory(Item item, EntityPlayer player, int requestedAmount) { int amount = 0; for(int slot = player.inventory.getSizeInventory()-1; slot >= 0 && amount < requestedAmount; --slot) { if(player.inventory.getStackInSlot(slot) != null) { if(player.inventory.getStackInSlot(slot).getItem() == item) { ++amount; --player.inventory.getStackInSlot(slot).stackSize; return amount; } } } return amount; } } ItemWeaponShotgun Class: public class ItemWeaponShotgun extends ItemWeaponRanged { public Item ammoItem = BioshockMod.WeaponShotgunAmmo00; public int fireRate2; /** * @param int Ammunition maximum capacity * @param int Fire rate without upgrade (in ticks) * @param int Fire rate with upgrade (in ticks) * @param float Spread * @param float Recoil * @param String name for first upgrade * @param String name for second upgrade * @param String name for first type of ammunition * @param String name for second type of ammunition * @param String name for third type of ammunition * @param String name for fourth type of ammunition */ public ItemWeaponShotgun(int capacity, int fireRate, int fireRate2, float spread, float recoil, int reloadAmount, String upgrade1Name, String upgrade2Name, String[] ammoNames) { super(capacity, fireRate, spread, recoil, reloadAmount, upgrade1Name, upgrade2Name, ammoNames); this.fireRate2 = fireRate2; this.setUnlocalizedName("weaponShotgunRapture"); this.setTextureName("bioshock:shotgun_rapture"); } public void registerIcons(IIconRegister iconReg) { super.registerIcons(iconReg, "fire_rate", "damage"); } public void onUpdate(ItemStack itemstack, World world, Entity entity, int par4, boolean par5) { if(!itemstack.stackTagCompound.getBoolean("Upgrade1")) { if(itemstack.stackTagCompound.getInteger("FireRateTimer") == itemstack.stackTagCompound.getInteger("FireRate")- { world.playSoundAtEntity(entity, "bioshock:item.weapon.shotgun.pump", 0.8F, 1.0F); } } super.onUpdate(itemstack, world, entity, par4, par5); } public void setupUpgradeNbt(ItemStack itemstack) { if(!itemstack.stackTagCompound.hasKey("FireRate") || itemstack.stackTagCompound.getInteger("FireRate") == this.fireRate || itemstack.stackTagCompound.getInteger("FireRate") == this.fireRate2) { if(!itemstack.stackTagCompound.getBoolean("Upgrade1")) { itemstack.stackTagCompound.setInteger("FireRate", this.fireRate); } else { itemstack.stackTagCompound.setInteger("FireRate", this.fireRate2); } } } public void fireBullet(ItemStack itemstack, World world, EntityPlayer player) { world.playSoundAtEntity(player, "fireworks.blast", 1.8F, 1.5F / (itemRand.nextFloat() * 0.4F + 0.8F)); world.playSoundAtEntity(player, "random.explode", 0.3F, (1.0F + (this.itemRand.nextFloat() - this.itemRand.nextFloat()) * 0.2F) * 2.7F); world.playSoundAtEntity(player, "mob.blaze.hit", 0.015F, 0.08F / (itemRand.nextFloat() * 0.4F + 0.8F)); world.playSoundAtEntity(player, "fireworks.blast", 1.8F, 1.5F / (itemRand.nextFloat() * 0.4F + 0.8F)); world.playSoundAtEntity(player, "random.explode", 0.3F, (1.0F + (this.itemRand.nextFloat() - this.itemRand.nextFloat()) * 0.2F) * 2.7F); world.playSoundAtEntity(player, "mob.blaze.hit", 0.015F, 0.08F / (itemRand.nextFloat() * 0.4F + 0.8F)); if(itemstack.stackTagCompound.getString("AmmoType") != this.ammoNames[3]) { for(int a = 8; a > 0; --a) { if(!world.isRemote) { float power = 0.9F; float damage = 35F; EntityBullet bullet = new EntityBullet(world, player, null); if(a < 4) { bullet.silent = true; } bullet.onTickDamageModifier = 0.7F; bullet.ignoresArmour = true; bullet.damageName = "shotgun"; if(itemstack.stackTagCompound.getString("AmmoType") == this.ammoNames[0]) { //yo bro whatchugonnadoabutit } if(itemstack.stackTagCompound.getString("AmmoType") == this.ammoNames[1]) { //bullet.dealsPhysicalDamage = false; bullet.electric = true; } if(itemstack.stackTagCompound.getString("AmmoType") == this.ammoNames[2]) { //bullet.dealsPhysicalDamage = false; bullet.burning = true; power = power*4; damage = damage/0.7F; } if(itemstack.stackTagCompound.getBoolean("Upgrade2")) { bullet.damage = damage+damage/4; bullet.power = power*4; } else { bullet.damage = damage; bullet.power = power; } bullet.setVelocity(bullet.motionX+hi(this.spread/50), bullet.motionY+hi(this.spread/50), bullet.motionZ+hi(this.spread/50)); world.spawnEntityInWorld(bullet); } } } else { if(!world.isRemote) { float power = 2.4F; float damage = 58F; EntityBullet bullet = new EntityBullet(world, player, null); bullet.onTickDamageModifier = 0.98F; bullet.ignoresArmour = true; bullet.damageName = "shotgun"; bullet.piercing = true; if(itemstack.stackTagCompound.getBoolean("Upgrade2")) { bullet.damage = damage+damage/4; bullet.power = power*4; } else { bullet.damage = damage; bullet.power = power; } world.spawnEntityInWorld(bullet); } } EntityBullet bullet = new EntityBullet(world, player); player.setVelocity(player.motionX-bullet.motionX/200, player.motionX-bullet.motionY/200, player.motionX-bullet.motionZ/200); bullet.setDead(); } }
  2. i made a new special crafting recipe (it has its own class instead of using the normal way of making crafting recipes) and the first times i tried it, putting the materials in the crafting slots would cause a crash, so it is being called properly, i know that for sure and i have another crafting recipe that works and is called the excact same way, but with different arguments and of course with a different class. after i fixed that i realized that it didnt produce anything at all as if i didnt have the crafting recipe there at all! my code is a mess and i cant figure out what i have done wrong. can anyone help? public class RecipeWeaponReload implements IRecipe { private int ammount; private int ammoType; private Item weapon; private Item ammo1; private Item ammo2; private Item ammo3; private ItemStack itemstack; public RecipeWeaponReload(Item weapon, Item ammo1, Item ammo2, Item ammo3) { this.weapon = weapon; this.ammo1 = ammo1; this.ammo2 = ammo2; this.ammo3 = ammo3; } @Override public boolean matches(InventoryCrafting crafting, World world) { ItemStack itemstack1 = null; ItemStack itemstack2 = null; int w = 0; int a = 0; int a1 = 0; int a2 = 0; int a3 = 0; int at = 0; for (int k1 = 0; k1 < crafting.getSizeInventory(); ++k1) { itemstack1 = crafting.getStackInSlot(k1); if (itemstack1 != null) { if(itemstack1.getItem() == this.ammo1) { ++a; ++a1; at = 1; } else if(itemstack1.getItem() == this.ammo2) { ++a; ++a2; at = 2; } else if(itemstack1.getItem() == this.ammo3) { ++a; ++a3; at = 3; } else if(itemstack1.getItem() == this.weapon) { ++w; itemstack2 = itemstack1; } else { return false; } } } if(itemstack2 != null && ((w == 1 && a1 > 0 && a2 == 0 && a3 == 0) || (w == 1 && a1 == 0 && a2 > 0 && a3 == 0) || (w == 1 && a1 == 0 && a2 == 0 && a3 > 0))) { String t = null; if(itemstack2.getItem() instanceof ItemWeaponPistol) { if(at == 1) { t = ((ItemWeaponPistol)itemstack2.getItem()).ammo1Name; } else if(at == 2) { t = ((ItemWeaponPistol)itemstack2.getItem()).ammo2Name; } else if(at == 3) { t = ((ItemWeaponPistol)itemstack2.getItem()).ammo3Name; } } if(itemstack2.stackTagCompound.getInteger("Ammo")+a > itemstack2.stackTagCompound.getInteger("Capacity") && itemstack2.stackTagCompound.getString("AmmoType") == t) { return false; } else { this.ammount = a; this.ammoType = at; return true; } } else { this.itemstack = null; return false; } } @Override public ItemStack getCraftingResult(InventoryCrafting crafting) { if(this.itemstack != null) { ItemStack itemstack1 = ItemStack.copyItemStack(this.itemstack); if(itemstack1.getItem() instanceof ItemWeaponPistol) { ((ItemWeaponPistol)itemstack1.getItem()).createNbt(itemstack1); } if(itemstack1.stackTagCompound.getInteger("Ammo")+this.ammount > itemstack1.stackTagCompound.getInteger("Capacity")) { itemstack1.stackTagCompound.setInteger("Ammo", itemstack1.stackTagCompound.getInteger("Capacity")); } else { itemstack1.stackTagCompound.setInteger("Ammo", itemstack1.stackTagCompound.getInteger("Ammo")+this.ammount); } if(itemstack1.getItem() instanceof ItemWeaponPistol) { if(this.ammoType == 1) { itemstack1.stackTagCompound.setString("AmmoType", ((ItemWeaponPistol)itemstack1.getItem()).ammo1Name); } else if(this.ammoType == 2) { itemstack1.stackTagCompound.setString("AmmoType", ((ItemWeaponPistol)itemstack1.getItem()).ammo2Name); } else if(this.ammoType == 3) { itemstack1.stackTagCompound.setString("AmmoType", ((ItemWeaponPistol)itemstack1.getItem()).ammo3Name); } } return itemstack1; } else { return null; } } @Override public int getRecipeSize() { return 1; } @Override public ItemStack getRecipeOutput() { if(this.itemstack != null) { return this.itemstack; } else { return new ItemStack(this.weapon); } } }
  3. that wouldnt work that well, cause the furnace only has one output slot, therefore one item would be in the way for the other to appear. the only way to do so would be to make it only wok if that slot is empty, though that would be bad if its something the player needs to make a lot of, or you could make a different type of furnace like a slag furnace. i dont know how you would do those things, but i now that this will be a problem if you are going to use the vanilla furnace.
  4. i want to have a crafting recipe where the product has the same damage value as a specific component. i know i could make seperate crafting recipes for each possible damage value, but i would prefer another way, since the item has more than 100 possible damage values. (its an armourpiece with durability)
  5. i want an armourpiece that can change the walking sound of the player. how would i do this? i did notice there is an event for playing sounds at entities. can i use that? and in that case: how do i determine if the sound is the walking sound? or is it another way?
  6. it is. but i still cant see trough the helmet. i also want to make the part on the texture that isnt on the head to render on the users upper body. is this possible?
  7. i want to have an armourpiece (specificly an helmet) that has a transparent texture that can not only cover the head, but the upper body of the user. im trying to use this texture: how would i go about doing that? i'm sure there's a way to do it, but i have no idea how.
  8. thank you, it works! i didnt realize i had to have the event as an argument for the function. im such a noob.
  9. i am trying to make the player invulnerable to arrows under certain conditions and do something when that happens. i used the event LivingHurtEvent and checked if the damagesource was an arrow, but for some reason the game crashes on startup and i dont really get why. it says its something about it not having the right amount of arguments (which it has). here is the log: [20:59:53] [main/INFO] [GradleStart]: No arguments specified, assuming client. [20:59:53] [main/INFO] [GradleStart]: Extra: [] [20:59:53] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Sigurd/.gradle/caches/minecraft/assets, --assetIndex, 1.7.10, --accessToken, {REDACTED}, --version, 1.7.10, --tweakClass, cpw.mods.fml.common.launcher.FMLTweaker, --username, ForgeDevName] [20:59:53] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker [20:59:53] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker [20:59:53] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker [20:59:53] [main/INFO] [FML]: Forge Mod Loader version 7.10.18.1180 for Minecraft 1.7.10 loading [20:59:53] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre8 [20:59:53] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation [20:59:54] [main/WARN] [FML]: The coremod codechicken.core.launch.CodeChickenCorePlugin does not have a MCVersion annotation, it may cause issues with this version of Minecraft [20:59:54] [main/WARN] [FML]: The coremod codechicken.nei.asm.NEICorePlugin does not have a MCVersion annotation, it may cause issues with this version of Minecraft [20:59:54] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [20:59:54] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker [20:59:54] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [20:59:54] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [20:59:54] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper [20:59:54] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work! [20:59:56] [main/ERROR] [FML]: The minecraft jar file:/C:/Users/Sigurd/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.0.1180/forgeSrc-1.7.10-10.13.0.1180.jar!/net/minecraft/client/ClientBrandRetriever.class appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again! [20:59:56] [main/ERROR] [FML]: FML has been ordered to ignore the invalid or missing minecraft certificate. This is very likely to cause a problem! [20:59:56] [main/ERROR] [FML]: Technical information: ClientBrandRetriever was at jar:file:/C:/Users/Sigurd/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.0.1180/forgeSrc-1.7.10-10.13.0.1180.jar!/net/minecraft/client/ClientBrandRetriever.class, there were 0 certificates for it [20:59:56] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing [20:59:56] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper [20:59:56] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper [20:59:56] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper [20:59:57] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper [20:59:57] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker [20:59:57] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main} [20:59:58] [main/INFO]: Setting user: ForgeDevName [21:00:01] [Client thread/INFO]: LWJGL Version: 2.9.1 [21:00:02] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization [21:00:02] [Client thread/INFO] [FML]: MinecraftForge v10.13.0.1180 Initialized [21:00:02] [Client thread/INFO] [FML]: Replaced 182 ore recipies [21:00:02] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization [21:00:02] [Client thread/INFO] [FML]: Searching C:\Users\Sigurd\Documents\Minecraft\bioshock mod workspace\Forgemods\eclipse\mods for mods [21:00:02] [Client thread/INFO] [FML]: Also searching C:\Users\Sigurd\Documents\Minecraft\bioshock mod workspace\Forgemods\eclipse\mods\1.7.10 for mods [21:00:03] [Client thread/ERROR] [FML]: FML has detected a mod that is using a package name based on 'net.minecraft.src' : net.minecraft.src.FMLRenderAccessLibrary. This is generally a severe programming error. There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW! [21:00:05] [Client thread/INFO] [FML]: Forge Mod Loader has identified 7 mods to load [21:00:05] [Client thread/INFO] [FML]: FML has found a non-mod file CodeChickenLib-1.7.10-1.1.1.93-dev.jar in your mods directory. It will now be injected into your classpath. This could severe stability issues, it should be removed if possible. [21:00:05] [Client thread/WARN] [FML]: The mod FMLMod:bioshock{0.5} is attempting to register a block whilst it it being constructed. This is bad modding practice - please use a proper mod lifecycle event. [21:00:05] [Client thread/WARN] [FML]: The mod FMLMod:bioshock{0.5} is attempting to register a block whilst it it being constructed. This is bad modding practice - please use a proper mod lifecycle event. [21:00:05] [Client thread/WARN] [FML]: The mod FMLMod:bioshock{0.5} is attempting to register a block whilst it it being constructed. This is bad modding practice - please use a proper mod lifecycle event. [21:00:05] [Client thread/WARN] [FML]: The mod FMLMod:bioshock{0.5} is attempting to register a block whilst it it being constructed. This is bad modding practice - please use a proper mod lifecycle event. [21:00:06] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Not Enough Items, FMLFileResourcePack:BioshockMod, FMLFileResourcePack:Waila, resourcepack making kit 14w11a [21:00:06] [Client thread/INFO] [FML]: Processing ObjectHolder annotations [21:00:06] [Client thread/INFO] [FML]: Found 341 ObjectHolder annotations [21:00:06] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0 [21:00:06] [Client thread/INFO] [FML]: Applying holder lookups [21:00:06] [Client thread/INFO] [FML]: Holder lookups applied Starting up SoundSystem... Initializing LWJGL OpenAL (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) OpenAL initialized. [21:00:07] [sound Library Loader/INFO]: Sound engine started [21:00:07] [Client thread/WARN]: File bioshock:sounds/random/click.ogg does not exist, cannot add it to event bioshock:item.skyhook.click [21:00:08] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas [21:00:08] [Client thread/INFO]: Created: 512x256 textures/items-atlas [21:00:08] [CodeChicken Update Checker/ERROR] [CodeChickenCore]: Failed to check notifications: [21:00:08] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from INITIALIZATION to POSTINITIALIZATION. Loading cannot continue [21:00:08] [Client thread/ERROR] [FML]: mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized FML{7.10.18.1180} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized Forge{10.13.0.1180} [Minecraft Forge] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized CodeChickenCore{1.0.2.9} [CodeChicken Core] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized NotEnoughItems{1.0.2.15} [Not Enough Items] (NotEnoughItems-1.7.10-1.0.2.15-dev.jar) Unloaded->Constructed->Pre-initialized->Initialized bioshock{0.5} [bioshockMod] (bin) Unloaded->Constructed->Pre-initialized->Errored Waila{1.5.2_1.7.2} [Waila] (Waila-1.5.2a_1.7.2.jar) Unloaded->Constructed->Pre-initialized->Initialized [21:00:08] [Client thread/ERROR] [FML]: The following problems were captured during this phase [21:00:08] [Client thread/ERROR] [FML]: Caught exception from bioshock java.lang.IllegalArgumentException: Method public void com.sigurd4.Bioshock.BioshockEventHandler.LivingHurtEvent(net.minecraft.entity.EntityLivingBase,net.minecraft.util.DamageSource,float) has @SubscribeEvent annotation, but requires 3 arguments. Event handler methods must require a single argument. at cpw.mods.fml.common.eventhandler.EventBus.register(EventBus.java:59) ~[forgeSrc-1.7.10-10.13.0.1180.jar:?] at com.sigurd4.Bioshock.BioshockMod.load(BioshockMod.java:528) ~[bin/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0] at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513) ~[forgeSrc-1.7.10-10.13.0.1180.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?] at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) ~[forgeSrc-1.7.10-10.13.0.1180.jar:?] at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) ~[forgeSrc-1.7.10-10.13.0.1180.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?] at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) [LoadController.class:?] at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691) [Loader.class:?] at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.startGame(Minecraft.java:596) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:941) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0] at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0] at GradleStart.bounce(GradleStart.java:108) [start/:?] at GradleStart.startClient(GradleStart.java:101) [start/:?] at GradleStart.main(GradleStart.java:56) [start/:?] ---- Minecraft Crash Report ---- // But it works on my machine. Time: 24.07.14 21:00 Description: Initializing game java.lang.IllegalArgumentException: Method public void com.sigurd4.Bioshock.BioshockEventHandler.LivingHurtEvent(net.minecraft.entity.EntityLivingBase,net.minecraft.util.DamageSource,float) has @SubscribeEvent annotation, but requires 3 arguments. Event handler methods must require a single argument. at cpw.mods.fml.common.eventhandler.EventBus.register(EventBus.java:59) at com.sigurd4.Bioshock.BioshockMod.load(BioshockMod.java:528) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691) at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288) at net.minecraft.client.Minecraft.startGame(Minecraft.java:596) at net.minecraft.client.Minecraft.run(Minecraft.java:941) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at GradleStart.bounce(GradleStart.java:108) at GradleStart.startClient(GradleStart.java:101) at GradleStart.main(GradleStart.java:56) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at cpw.mods.fml.common.eventhandler.EventBus.register(EventBus.java:59) at com.sigurd4.Bioshock.BioshockMod.load(BioshockMod.java:528) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691) at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288) at net.minecraft.client.Minecraft.startGame(Minecraft.java:596) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:941) at net.minecraft.client.main.Main.main(Main.java:164) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at GradleStart.bounce(GradleStart.java:108) at GradleStart.startClient(GradleStart.java:101) at GradleStart.main(GradleStart.java:56) -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.8.0, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 801884160 bytes (764 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.05 FML v7.10.18.1180 Minecraft Forge 10.13.0.1180 7 mods loaded, 7 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized FML{7.10.18.1180} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized Forge{10.13.0.1180} [Minecraft Forge] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized CodeChickenCore{1.0.2.9} [CodeChicken Core] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized NotEnoughItems{1.0.2.15} [Not Enough Items] (NotEnoughItems-1.7.10-1.0.2.15-dev.jar) Unloaded->Constructed->Pre-initialized->Initialized bioshock{0.5} [bioshockMod] (bin) Unloaded->Constructed->Pre-initialized->Errored Waila{1.5.2_1.7.2} [Waila] (Waila-1.5.2a_1.7.2.jar) Unloaded->Constructed->Pre-initialized->Initialized Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: GeForce GT 530/PCIe/SSE2 GL version 4.3.0, NVIDIA Corporation GL Caps: Using GL 1.3 multitexturing. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Anisotropic filtering is supported and maximum anisotropy is 16. Shaders are available because OpenGL 2.1 is supported. Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [resourcepack making kit 14w11a] Current Language: English (US) Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Anisotropic Filtering: Off (1) #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Sigurd\Documents\Minecraft\bioshock mod workspace\Forgemods\eclipse\.\crash-reports\crash-2014-07-24_21.00.08-client.txt AL lib: (EE) alc_cleanup: 1 device not closed Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release and here is the code i wrote in my event handler: @SubscribeEvent public void LivingHurtEvent(EntityLivingBase entity, DamageSource source, float ammount) { if(entity instanceof EntityPlayer) { if(source.getDamageType() == "arrow") { EntityExtendedPlayer props = EntityExtendedPlayer.get((EntityPlayer)entity); if(props.hasPlasmid("ironsides") && entity.getHeldItem().getItem() == BioshockMod.VigorIronsides && entity.getHeldItem().stackTagCompound.getInteger("BulletShield") > 0) { ((EntityPlayer)entity).inventory.addItemStackToInventory(new ItemStack(Items.arrow)); ammount = 0; } if(props.hasPlasmid("returnToSender") && entity.getHeldItem().getItem() == BioshockMod.VigorReturnToSender && entity.getHeldItem().stackTagCompound.getInteger("BulletShield") > 0) { if(entity.getHeldItem().getItem() == BioshockMod.VigorReturnToSender) { entity.getHeldItem().stackTagCompound.setFloat("BulletShieldDamage", entity.getHeldItem().stackTagCompound.getFloat("BulletShieldDamage")+ammount); entity.getHeldItem().stackTagCompound.setFloat("BulletShieldPower", entity.getHeldItem().stackTagCompound.getFloat("BulletShieldPower")+0.07F); entity.getHeldItem().stackTagCompound.setFloat("BulletShieldSpeed", entity.getHeldItem().stackTagCompound.getFloat("BulletShieldSpeed")+0.4F); } ammount = 0; } } } } what am i supposed to do?
  10. bump! im desperate! i cant run minecraft and i cant figure out how to fix it!
  11. im getting the same error again, this time i only have one project at the time. it happened after i updated to 1.7.10. i have tried to remove the project, then load it again just like how i fixed it previously, but it doesnt work.
  12. after updating to 1.7.10 i had some errors which i dont know what to replace with to fix: this.worldObj.rayTraceBlocks(this.worldObj.getWorldVec3Pool().getVecFromPool(args) what do i use now instead of getWorldVec3Pool?
  13. it only shows in the player's hand and not inside the inventory or in a chest etc... how do i do that? this is the code used for the item texture in my item class: public void registerIcons(IIconRegister iconReg) { this.itemIcon = iconReg.registerIcon("something"); this.itemIcon2= iconReg.registerIcon("something"); } public IIcon getIcon(ItemStack itemstack, int pass) { if(itemstack.stackTagCompound.getInteger("Timer") > 0) { return this.itemIcon2; } else { return this.itemIcon; } }
  14. ok i removed both projects from eclipse and added one of them, now that works. whats strange is that it now give s me new erros that i didnt have before (specificly, various classes that implements a interface has errors where it has the @Override. that worked before. parhaps the nev version got installed for my old workspace too.) it seems to work as it should, though.
  15. first, i went to files.minecraftforge.net and downloaded the stable src build for 1.7.10. then i extracted it into the folder i wanted to use. then open up cmd in that folder and first typed in "gradlew setupDecompWorkspcae" or something like that, then when it was done i typed it "gradlew eclipse" and let that do its thing. then opened up eclipse, created a new java project and chose that folder as the project directory. then i went trough the build.gradlew file and filled it in like this: buildscript { repositories { mavenCentral() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' } } apply plugin: 'forge' version = "0.1" group= "com.sigurd4.modname" archivesBaseName = "modname" minecraft { version = "1.7.10-10.13.0.1180" assetDir = "eclipse/assets" } dependencies {} processResources { inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' expand 'version':project.version, 'mcversion':project.minecraft.version } from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } }
  16. how do i do that? is it the arguments tab in run configurations?
  17. i set up forge gradle in another folder (i have another forge gradle somewhere else. not sure if the fact that i have multiple forge gradle setups is a problem) this time in a different version (forge 1.7.10-10.13.0.1180 to be specific) but i am not able to run minecraft. it seems to not be a problem with my mod, but with the jarfile (it says it is corrupt). i tried deleting the jarfile, then reinstalling forge gradle (i was almost sure that would work) but it still didnt work, so i am clueless. the version i used is supposed to be stable so i thought using another version would be pointless. here is the log: [22:55:52] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker [22:55:52] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker [22:55:52] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker [22:55:52] [main/INFO] [FML]: Forge Mod Loader version 7.10.18.1180 for Minecraft 1.7.10 loading [22:55:52] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre8 [22:55:52] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation [22:55:52] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [22:55:52] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker [22:55:52] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [22:55:52] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker [22:55:52] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper [22:55:52] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work! [22:55:54] [main/ERROR] [FML]: The minecraft jar file:/C:/Users/Sigurd/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.0.1180/forgeSrc-1.7.10-10.13.0.1180.jar!/net/minecraft/client/ClientBrandRetriever.class appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again! [22:55:54] [main/ERROR] [FML]: FML has been ordered to ignore the invalid or missing minecraft certificate. This is very likely to cause a problem! [22:55:54] [main/ERROR] [FML]: Technical information: ClientBrandRetriever was at jar:file:/C:/Users/Sigurd/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-10.13.0.1180/forgeSrc-1.7.10-10.13.0.1180.jar!/net/minecraft/client/ClientBrandRetriever.class, there were 0 certificates for it [22:55:54] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing [22:55:54] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper [22:55:54] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker [22:55:55] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main} [22:55:55] [main/ERROR] [LaunchWrapper]: Unable to launch java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0] at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?] Caused by: joptsimple.MissingRequiredOptionException: Missing required option(s) ['userProperties'] at joptsimple.OptionParser.ensureRequiredOptions(OptionParser.java:447) ~[OptionParser.class:?] at joptsimple.OptionParser.parse(OptionParser.java:437) ~[OptionParser.class:?] at net.minecraft.client.main.Main.main(Main.java:89) ~[Main.class:?] ... 6 more what can i do to fix this?
  18. oops i just realized i had forgot to set the GL11 translation to the second layer. haha
  19. im making an item that is supposed to have a two layered texture, where the second one is transparent and also glow in the dark (only if shouldGlow is true). i have managed to do this with an entity, but i cant figure out how to do it with an item model. please help! this is the renderer code: public class RenderPlasmidHand implements IItemRenderer { private final ResourceLocation steveTextures = new ResourceLocation("textures/entity/steve.png"); private boolean hasEve; private int cooldown; private String plasmid; private boolean hasPlasmid; public boolean shouldGlow; private String texture; protected ModelPlasmidHand model; public RenderPlasmidHand(boolean shouldGlow) { this.model = new ModelPlasmidHand(); this.shouldGlow = shouldGlow; } @Override public boolean handleRenderType(ItemStack itemstack, ItemRenderType itemrendertype) { if(itemrendertype == ItemRenderType.EQUIPPED_FIRST_PERSON) { return /*itemstack.stackTagCompound.getBoolean("PlayerHasPlasmid") || */true; } else { return false; } } @Override public void renderItem(ItemRenderType itemrendertype, ItemStack itemstack, Object... data) { this.cooldown = itemstack.stackTagCompound.getInteger("Cooldown"); this.hasEve = itemstack.stackTagCompound.getInteger("PlayerEve") > 0; this.hasPlasmid = itemstack.stackTagCompound.getBoolean("PlayerHasPlasmid"); this.texture = itemstack.stackTagCompound.getString("PlayerTextre"); this.plasmid = itemstack.stackTagCompound.getString("Plasmid"); if(/*this.hasPlasmid || */true) { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(this.steveTextures); GL11.glTranslatef(0.3F, 0.2F, -1.7F); GL11.glRotatef(180F, 0F, 0F, 1F); GL11.glRotatef(-90F, 0F, 1F, 0F); GL11.glRotatef(0F, 1F, 0F, 0F); this.model.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, hasEve && cooldown <= 0); GL11.glPopMatrix(); GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("bioshock:textures/entity/plasmids/plasmid_" + this.plasmid + ".png")); GL11.glEnable(GL11.GL_BLEND); if(this.shouldGlow) { GL11.glDisable(GL11.GL_LIGHTING); } //OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)(61680 % 65536) / 1.0F, (float)(61680 / 65536) / 1.0F); this.model.render((Entity)data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, hasEve && cooldown <= 0); if(this.shouldGlow) { GL11.glEnable(GL11.GL_LIGHTING); } GL11.glPopMatrix(); } } @Override public boolean shouldUseRenderHelper(ItemRenderType itemrendertype, ItemStack itemstack, ItemRendererHelper arg2) { return false; } }
  20. oh thank you lol. i am pretty dumb. seems like i actually had one set up allready, and i figured out how to use it.
×
×
  • Create New...

Important Information

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