diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 221a4dc7..00000000 --- a/LICENSE +++ /dev/null @@ -1,42 +0,0 @@ -Private License - -Copyright (c) 2017 2piradians - -Terms and Conditions -Downloading this mod constitutes a complete and unconditional agreement with these terms! -As is necessity, I reserve the right to make changes to these terms at any time and grant exceptions if I so desire. -All permissions and exceptions are non-transferrable and revocable. -The terms only apply so long as you actually use and/or own copies of the mods; if you wish to terminate the agreement with these conditions, you may do so by uninstalling the mods and deleting the downloads. - -0. USED TERMS -MOD - modification, plugin, a piece of software that interfaces with the Minecraft client to extend, add, change or remove original capabilities. -MOJANG - Mojang AB (Sweden) -OWNER - Original author(s) of the mod. Under the copyright terms accepted when purchasing Minecraft (https://account.mojang.com/documents/minecraft_eula) the owner has full rights over their mod despite use of Mojang code -USER - End user of the mod, i.e., the person installing the mod -PRIVATE - Personal use -PUBLIC - Any usage that involves more than one person - -1. LIABILITY -This mod is provided 'as is' with no warranties, implied or otherwise. The owner of this mod takes no responsibility for any damages incurred from the use of this mod. This mod alters fundamental parts of the Minecraft game; parts of Minecraft may not work with this mod installed. All damages caused from the use or misuse of this mod fall on the user. - -2. USE -This mod may be used for the purpose of playing or pack creation as you see fit. It may not be used to generate profit, circumvent the law, or other use contrary to the original function. - -3. REDISTRIBUTION -This mod may not be uploaded or mirrored by anyone other than the owner, and all links to this mod must directly link to Curse or CurseForge and not through a third party link site. Any unauthorized mirrors of or links to the mod that bypass this will be discovered and forced to be deleted. - -4. DERIVATIVE WORKS -This mod is provided freely and may be decompiled and modified for private use, either with a decompiler or a bytecode editor. Public use of modified or derivative versions is prohibited unless you are given specific written permission. Distribution of the source code, modified (including custom compilation) or otherwise, is prohibited by anyone except the author, except in the case of a derivative mod that has been given prior approval. Creating derivative works for commercial use is expressly forbidden and the owner reserves full right to seek damages. - -5. ADDONS AND MODIFICATIONS -Addons and modifications that use none of my mods' source can be made and released freely and distributed as the creator sees fit. However, if I feel an addon or modification's sole purpose is to damage one of my mods - such as by hurting its compatibility with other mods, breaking features, damaging the balance or fundamentally damaging how it was designed - I reserve the right to revoke this permission and prevent it from being used in conjunction with my mods. - -6. MONETIZATION -Any attempts to make money off of this mod (selling, selling modified/derivative versions, adfly, sharecash, donations, ad revenue, etc.) are strictly forbidden, and the owner may claim damages or take other action to rectify the situation. Servers hosting the pack may take donations to cover operating costs, but not for personal profit. Additionally, the mods' behaviors may not be edited - such as by making some items unobtainable - to encourage or coerce players to pay or donate to the pack or server host. These actions are also expressly forbidden by the MC terms of use. - -7. LICENSING -You must agree to the entirety of this license in full in order to use the mods or include it in a pack. Use of the mods constitutes implicit and unconditional agreement to these terms. -The author of this mod reserves the right to change this license as is deemed necessary without prior warning, though such warning may and likely will be provided at the author's discretion. Such changes take effect immediately; it is not required to explicitly agree nor update the mods. - -8. COST -This software is provided free of charge for all users. If you obtained this software from any other source, or paid money to access it, you have been scammed. Get a refund immediately, and report the scammer to me. \ No newline at end of file diff --git a/build.gradle b/build.gradle index 24a0e106..627f109c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,77 +1,78 @@ -buildscript { - repositories { - jcenter() - maven { url = "http://files.minecraftforge.net/maven" } - } - dependencies { - classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' - } -} -apply plugin: 'net.minecraftforge.gradle.forge' -//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. - - -version = "1.11.2-1.0" -group = "twopiradians.minewatch" // http://maven.apache.org/guides/mini/guide-naming-conventions.html -archivesBaseName = "Minewatch" - -sourceCompatibility = targetCompatibility = "1.8" // Need this here so eclipse task generates correctly. -compileJava { - sourceCompatibility = targetCompatibility = "1.8" -} - -minecraft { - version = "1.11.2-13.20.0.2282" - runDir = "run" - - // the mappings can be changed at any time, and must be in the following format. - // snapshot_YYYYMMDD snapshot are built nightly. - // stable_# stables are built at the discretion of the MCP team. - // Use non-default mappings at your own risk. they may not always work. - // simply re-run your setup task after changing the mappings to update your workspace. - mappings = "snapshot_20161220" - // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. -} - -dependencies { - // you may put jars on which you depend on in ./libs - // or you may define them like so.. - //compile "some.group:artifact:version:classifier" - //compile "some.group:artifact:version" - - // real examples - //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env - //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env - - // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. - //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' - - // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided, - // except that these dependencies get remapped to your current MCP mappings - //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev' - //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev' - - // for more info... - // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html - // http://www.gradle.org/docs/current/userguide/dependency_management.html - -} - -processResources { - // this will ensure that this task is redone when the versions change. - inputs.property "version", project.version - inputs.property "mcversion", project.minecraft.version - - // replace stuff in mcmod.info, nothing else - from(sourceSets.main.resources.srcDirs) { - include 'mcmod.info' - - // replace version and mcversion - expand 'version':project.version, 'mcversion':project.minecraft.version - } - - // copy everything else except the mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' - } -} +buildscript { + repositories { + jcenter() + maven { url = "http://files.minecraftforge.net/maven" } + } + dependencies { + classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT' + } +} +apply plugin: 'net.minecraftforge.gradle.forge' +//Only edit below this line, the above code adds and enables the nessasary things for Forge to be setup. + + +version = "1.10.2-1.0" +group = "twopiradians.minewatch" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +archivesBaseName = "Minewatch" + +sourceCompatibility = targetCompatibility = "1.8" // Need this here so eclipse task generates correctly. +compileJava { + sourceCompatibility = targetCompatibility = "1.8" +} + +minecraft { + version = "1.10.2-12.18.3.2185" + runDir = "run" + + // the mappings can be changed at any time, and must be in the following format. + // snapshot_YYYYMMDD snapshot are built nightly. + // stable_# stables are built at the discretion of the MCP team. + // Use non-default mappings at your own risk. they may not always work. + // simply re-run your setup task after changing the mappings to update your workspace. + mappings = "snapshot_20161111" + // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. +} + +dependencies { + // you may put jars on which you depend on in ./libs + // or you may define them like so.. + //compile "some.group:artifact:version:classifier" + //compile "some.group:artifact:version" + + // real examples + //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env + //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env + + // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. + //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' + + // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided, + // except that these dependencies get remapped to your current MCP mappings + //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev' + //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev' + + // for more info... + // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html + // http://www.gradle.org/docs/current/userguide/dependency_management.html + +} + +processResources +{ + // this will ensure that this task is redone when the versions change. + inputs.property "version", project.version + inputs.property "mcversion", project.minecraft.version + + // replace stuff in mcmod.info, nothing else + from(sourceSets.main.resources.srcDirs) { + include 'mcmod.info' + + // replace version and mcversion + expand 'version':project.version, 'mcversion':project.minecraft.version + } + + // copy everything else, thats not the mcmod.info + from(sourceSets.main.resources.srcDirs) { + exclude 'mcmod.info' + } +} diff --git a/src/main/java/twopiradians/minewatch/client/key/KeyToggleMode.java b/src/main/java/twopiradians/minewatch/client/key/KeyToggleMode.java index 7fa86bb1..30709102 100644 --- a/src/main/java/twopiradians/minewatch/client/key/KeyToggleMode.java +++ b/src/main/java/twopiradians/minewatch/client/key/KeyToggleMode.java @@ -33,8 +33,8 @@ public boolean isKeyDown(EntityPlayer player) { @SubscribeEvent @SideOnly(Side.CLIENT) public void playerTick(ClientTickEvent event) { - if (event.phase == Phase.END && Minecraft.getMinecraft().player != null) { - UUID player = Minecraft.getMinecraft().player.getPersistentID(); + if (event.phase == Phase.END && Minecraft.getMinecraft().thePlayer != null) { + UUID player = Minecraft.getMinecraft().thePlayer.getPersistentID(); if (!isKeyDown.containsKey(player) || TOGGLE_MODE.isKeyDown() != isKeyDown.get(player)) { isKeyDown.put(player, TOGGLE_MODE.isKeyDown()); Minewatch.network.sendToServer(new PacketToggleMode(TOGGLE_MODE.isKeyDown(), player)); diff --git a/src/main/java/twopiradians/minewatch/common/entity/EntityAnaBullet.java b/src/main/java/twopiradians/minewatch/common/entity/EntityAnaBullet.java index 15ba979b..d9f56aa0 100644 --- a/src/main/java/twopiradians/minewatch/common/entity/EntityAnaBullet.java +++ b/src/main/java/twopiradians/minewatch/common/entity/EntityAnaBullet.java @@ -53,7 +53,7 @@ public void setAim(Entity shooter, float pitch, float yaw, float velocity, float @Override public void onUpdate() { - float f = MathHelper.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + float f = MathHelper.sqrt_float((float) (this.motionX * this.motionX + this.motionZ * this.motionZ)); this.rotationYaw = (float)(MathHelper.atan2(this.motionX, this.motionZ) * (180D / Math.PI)); this.rotationPitch = (float)(MathHelper.atan2(this.motionY, (double)f) * (180D / Math.PI)); this.prevRotationYaw = this.rotationYaw; @@ -69,12 +69,12 @@ protected void onImpact(RayTraceResult result) { if (result.entityHit instanceof EntityLivingBase && result.entityHit != this.getThrower()) { if (this.heal) { ((EntityLivingBase)result.entityHit).heal(75/ModWeapon.DAMAGE_SCALE); - ((WorldServer)result.entityHit.world).spawnParticle(EnumParticleTypes.HEART, + ((WorldServer)result.entityHit.worldObj).spawnParticle(EnumParticleTypes.HEART, result.entityHit.posX+0.5d, result.entityHit.posY+0.5d,result.entityHit.posZ+0.5d, 10, 0.4d, 0.4d, 0.4d, 0d, new int[0]); if (this.getThrower() != null) - result.entityHit.world.playSound(null, this.getThrower().posX, this.getThrower().posY, this.getThrower().posZ, - SoundEvents.BLOCK_NOTE_PLING, SoundCategory.PLAYERS, 0.3f, result.entityHit.world.rand.nextFloat()/2+1.5f); + result.entityHit.worldObj.playSound(null, this.getThrower().posX, this.getThrower().posY, this.getThrower().posZ, + SoundEvents.BLOCK_NOTE_PLING, SoundCategory.PLAYERS, 0.3f, result.entityHit.worldObj.rand.nextFloat()/2+1.5f); } else { if (this.getThrower() instanceof EntityPlayer) @@ -83,8 +83,8 @@ protected void onImpact(RayTraceResult result) { if (this.getThrower() instanceof EntityPlayer) ((EntityLivingBase)result.entityHit).attackEntityFrom(DamageSource.causeThrownDamage(this, getThrower()), 60F/ModWeapon.DAMAGE_SCALE); if (this.getThrower() != null) - result.entityHit.world.playSound(null, this.getThrower().posX, this.getThrower().posY, this.getThrower().posZ, - SoundEvents.ENTITY_ARROW_HIT_PLAYER, SoundCategory.PLAYERS, 0.3f, result.entityHit.world.rand.nextFloat()/2+0.75f); + result.entityHit.worldObj.playSound(null, this.getThrower().posX, this.getThrower().posY, this.getThrower().posZ, + SoundEvents.ENTITY_ARROW_HIT_PLAYER, SoundCategory.PLAYERS, 0.3f, result.entityHit.worldObj.rand.nextFloat()/2+0.75f); } this.setDead(); } diff --git a/src/main/java/twopiradians/minewatch/common/entity/EntityReaperBullet.java b/src/main/java/twopiradians/minewatch/common/entity/EntityReaperBullet.java index 4329be37..0090c80b 100644 --- a/src/main/java/twopiradians/minewatch/common/entity/EntityReaperBullet.java +++ b/src/main/java/twopiradians/minewatch/common/entity/EntityReaperBullet.java @@ -46,7 +46,7 @@ public EntityReaperBullet(World worldIn, EntityLivingBase throwerIn) { @Override public void onUpdate() { - float f = MathHelper.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + float f = MathHelper.sqrt_float((float) (this.motionX * this.motionX + this.motionZ * this.motionZ)); this.rotationYaw = (float)(MathHelper.atan2(this.motionX, this.motionZ) * (180D / Math.PI)); this.rotationPitch = (float)(MathHelper.atan2(this.motionY, (double)f) * (180D / Math.PI)); this.prevRotationYaw = this.rotationYaw; diff --git a/src/main/java/twopiradians/minewatch/common/entity/ModEntities.java b/src/main/java/twopiradians/minewatch/common/entity/ModEntities.java index c88e1a16..c26a7d50 100644 --- a/src/main/java/twopiradians/minewatch/common/entity/ModEntities.java +++ b/src/main/java/twopiradians/minewatch/common/entity/ModEntities.java @@ -1,6 +1,5 @@ package twopiradians.minewatch.common.entity; -import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.common.registry.EntityRegistry; import twopiradians.minewatch.common.Minewatch; @@ -8,8 +7,8 @@ public class ModEntities { public static void registerEntities() { int id = 0; - EntityRegistry.registerModEntity(new ResourceLocation(Minewatch.MODID, "reaper_pellet"), EntityReaperBullet.class, "reaper_pellet", id++, Minewatch.instance, 16, 1, true); - EntityRegistry.registerModEntity(new ResourceLocation("arrow"), EntityHanzoArrow.class, "hanzo_arrow", id++, Minewatch.instance, 16, 1, true); - EntityRegistry.registerModEntity(new ResourceLocation(Minewatch.MODID, "ana_bullet"), EntityAnaBullet.class, "ana_bullet", id++, Minewatch.instance, 32, 1, true); + EntityRegistry.registerModEntity(EntityReaperBullet.class, "reaper_pellet", id++, Minewatch.instance, 16, 1, true); + EntityRegistry.registerModEntity(EntityHanzoArrow.class, "hanzo_arrow", id++, Minewatch.instance, 16, 1, true); + EntityRegistry.registerModEntity(EntityAnaBullet.class, "ana_bullet", id++, Minewatch.instance, 32, 1, true); } } diff --git a/src/main/java/twopiradians/minewatch/common/item/ModTokens.java b/src/main/java/twopiradians/minewatch/common/item/ModTokens.java index a25c928a..b587cc2d 100644 --- a/src/main/java/twopiradians/minewatch/common/item/ModTokens.java +++ b/src/main/java/twopiradians/minewatch/common/item/ModTokens.java @@ -11,11 +11,11 @@ public class ModTokens extends Item { @SubscribeEvent public void onEvent(LivingDropsEvent event) { - if (!event.getEntityLiving().world.isRemote && event.getEntityLiving() instanceof EntityLiving + if (!event.getEntityLiving().worldObj.isRemote && event.getEntityLiving() instanceof EntityLiving && event.getEntityLiving().getEntityWorld().rand.nextDouble() < 0.01d * (1+event.getLootingLevel())) { - int i = event.getEntityLiving().world.rand.nextInt(4); + int i = event.getEntityLiving().worldObj.rand.nextInt(4); ItemStack stack = new ItemStack(ModItems.tokens.get(i)); - EntityItem drop = new EntityItem(event.getEntityLiving().world, event.getEntityLiving().posX, + EntityItem drop = new EntityItem(event.getEntityLiving().worldObj, event.getEntityLiving().posX, event.getEntityLiving().posY, event.getEntityLiving().posZ, stack); event.getDrops().add(drop); } diff --git a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemAnaRifle.java b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemAnaRifle.java index 4df6ea27..971ac512 100644 --- a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemAnaRifle.java +++ b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemAnaRifle.java @@ -25,7 +25,7 @@ public void onShoot(World worldIn, EntityPlayer playerIn, EnumHand hand) { if (!worldIn.isRemote) { EntityAnaBullet bullet = new EntityAnaBullet(worldIn, playerIn, Minewatch.keyMode.isKeyDown(playerIn)); bullet.setAim(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 5.0F, 1.0F); - worldIn.spawnEntity(bullet); + worldIn.spawnEntityInWorld(bullet); worldIn.playSound(null, playerIn.posX, playerIn.posY, playerIn.posZ, ModSoundEvents.reaperShotgun, SoundCategory.PLAYERS, 1.0f, worldIn.rand.nextFloat()/2+0.75f); } diff --git a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemHanzoBow.java b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemHanzoBow.java index 578cd05e..14687343 100644 --- a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemHanzoBow.java +++ b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemHanzoBow.java @@ -56,7 +56,7 @@ else if (this.isArrow(player.getHeldItem(EnumHand.MAIN_HAND))) if (this.isArrow(itemstack)) return itemstack; } - return ItemStack.EMPTY; + return null; } } @@ -73,11 +73,11 @@ public void onPlayerStoppedUsing(ItemStack stack, World worldIn, EntityLivingBas ItemStack itemstack = this.findAmmo(entityplayer); int i = Math.min(this.getMaxItemUseDuration(stack) - timeLeft,20); - i = net.minecraftforge.event.ForgeEventFactory.onArrowLoose(stack, worldIn, entityplayer, i, !itemstack.isEmpty() || flag); + i = net.minecraftforge.event.ForgeEventFactory.onArrowLoose(stack, worldIn, entityplayer, i, itemstack != null || flag); if (i < 0) return; - if (!itemstack.isEmpty() || flag) { - if (itemstack.isEmpty()) + if (itemstack != null || flag) { + if (itemstack == null) itemstack = new ItemStack(Items.ARROW); float f = (float)i/10; @@ -94,17 +94,17 @@ public void onPlayerStoppedUsing(ItemStack stack, World worldIn, EntityLivingBas entityarrow.setDamage(125*((double)i/80/DAMAGE_SCALE)); if (!ModArmor.isSet(entityplayer, ModItems.hanzo)) stack.damageItem(1, entityplayer); - worldIn.spawnEntity(entityarrow); + worldIn.spawnEntityInWorld(entityarrow); } worldIn.playSound((EntityPlayer)null, entityplayer.posX, entityplayer.posY, entityplayer.posZ, ModSoundEvents.hanzoBowShoot, SoundCategory.PLAYERS, 1.0F, worldIn.rand.nextFloat()/2+0.75f); if (!flag1 && !entityplayer.capabilities.isCreativeMode) { - itemstack.shrink(1); + --itemstack.stackSize; - if (itemstack.isEmpty()) - entityplayer.inventory.deleteStack(itemstack); + if (itemstack.stackSize == 0) + entityplayer.inventory.deleteStack(itemstack); } } } @@ -124,21 +124,21 @@ public EnumAction getItemUseAction(ItemStack stack) { } @Override - public ActionResult onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { + public ActionResult onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand handIn) { ItemStack itemstack = playerIn.getHeldItem(handIn); - boolean flag = !this.findAmmo(playerIn).isEmpty(); + boolean flag = this.findAmmo(playerIn) != null; ActionResult ret = net.minecraftforge.event.ForgeEventFactory.onArrowNock(itemstack, worldIn, playerIn, handIn, flag); if (ret != null) return ret; if (!playerIn.capabilities.isCreativeMode && !flag) { - return flag ? new ActionResult(EnumActionResult.PASS, itemstack) : new ActionResult(EnumActionResult.FAIL, itemstack); + return flag ? new ActionResult(EnumActionResult.PASS, itemstack) : new ActionResult(EnumActionResult.FAIL, itemstack); } else { playerIn.setActiveHand(handIn); worldIn.playSound(null, playerIn.posX, playerIn.posY, playerIn.posZ, ModSoundEvents.hanzoBowDraw, SoundCategory.PLAYERS, 1.0f, worldIn.rand.nextFloat()/2+0.75f); - return new ActionResult(EnumActionResult.SUCCESS, itemstack); + return new ActionResult(EnumActionResult.SUCCESS, itemstack); } } } diff --git a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemReaperShotgun.java b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemReaperShotgun.java index 2e7e8af4..e2623893 100644 --- a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemReaperShotgun.java +++ b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemReaperShotgun.java @@ -21,7 +21,7 @@ public ItemReaperShotgun() { @Override public void onShoot(World worldIn, EntityPlayer playerIn, EnumHand hand) { for (int i=0; i<20; i++) - worldIn.spawnEntity(new EntityReaperBullet(worldIn, playerIn)); + worldIn.spawnEntityInWorld(new EntityReaperBullet(worldIn, playerIn)); worldIn.playSound(null, playerIn.posX, playerIn.posY, playerIn.posZ, ModSoundEvents.reaperShotgun, SoundCategory.PLAYERS, 1.0f, worldIn.rand.nextFloat()/2+0.75f); } diff --git a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemReinhardtHammer.java b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemReinhardtHammer.java index c2280279..25a46dd4 100644 --- a/src/main/java/twopiradians/minewatch/common/item/weapon/ItemReinhardtHammer.java +++ b/src/main/java/twopiradians/minewatch/common/item/weapon/ItemReinhardtHammer.java @@ -30,19 +30,19 @@ public ItemReinhardtHammer() { public Multimap getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) { Multimap multimap = super.getAttributeModifiers(slot, stack); if (slot == EntityEquipmentSlot.MAINHAND) - multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getName(), - new AttributeModifier(ATTACK_DAMAGE_MODIFIER, SharedMonsterAttributes.ATTACK_DAMAGE.getName(), 75d/DAMAGE_SCALE-1, 0)); + multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), + new AttributeModifier(ATTACK_DAMAGE_MODIFIER, SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), 75d/DAMAGE_SCALE-1, 0)); return multimap; } @Override public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity) { - if (!player.world.isRemote && player.getHeldItemMainhand() != null && + if (!player.worldObj.isRemote && player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() instanceof ItemReinhardtHammer) { if (player.getCooldownTracker().hasCooldown(this)) return true; AxisAlignedBB aabb = entity.getEntityBoundingBox().expandXyz(2); - List list = player.world.getEntitiesWithinAABBExcludingEntity(player, aabb); + List list = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, aabb); if (!list.isEmpty()) { Iterator iterator = list.iterator(); while (iterator.hasNext()) { @@ -53,8 +53,8 @@ public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity en if (!ModArmor.isSet(player, material)) player.getHeldItemMainhand().damageItem(1, player); player.getCooldownTracker().setCooldown(this, 20); - player.world.playSound(null, player.posX, player.posY, player.posZ, - ModSoundEvents.reinhardtRocketHammer, SoundCategory.PLAYERS, 1.0f, player.world.rand.nextFloat()/2+0.75f); + player.worldObj.playSound(null, player.posX, player.posY, player.posZ, + ModSoundEvents.reinhardtRocketHammer, SoundCategory.PLAYERS, 1.0f, player.worldObj.rand.nextFloat()/2+0.75f); } return false; } diff --git a/src/main/java/twopiradians/minewatch/common/item/weapon/ModWeapon.java b/src/main/java/twopiradians/minewatch/common/item/weapon/ModWeapon.java index 88c0339e..68361ef6 100644 --- a/src/main/java/twopiradians/minewatch/common/item/weapon/ModWeapon.java +++ b/src/main/java/twopiradians/minewatch/common/item/weapon/ModWeapon.java @@ -8,7 +8,6 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; @@ -49,19 +48,18 @@ public class ModWeapon extends Item protected void onShoot(World worldIn, EntityPlayer playerIn, EnumHand hand) {} @Override - public ActionResult onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand hand) { + public ActionResult onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) { // check that item does not have MC cooldown (and nbt cooldown if it hasOffhand) if (cooldown >= 0 && playerIn != null && playerIn.getHeldItem(hand) != null && !playerIn.getCooldownTracker().hasCooldown(playerIn.getHeldItem(hand).getItem()) && (!hasOffhand || (playerIn.getHeldItem(hand).hasTagCompound() && playerIn.getHeldItem(hand).getTagCompound().getInteger("cooldown") <= 0))) { if (playerIn.getHeldItem(hand).getItem() instanceof ItemReinhardtHammer) - return new ActionResult(EnumActionResult.PASS, playerIn.getHeldItem(hand)); + return new ActionResult(EnumActionResult.PASS, playerIn.getHeldItem(hand)); if (!worldIn.isRemote) { onShoot(worldIn, playerIn, hand); // set MC cooldown/2 and nbt cooldown if hasOffhand, otherwise just set MC cooldown - if (playerIn.getHeldItem(getInactiveHand(playerIn)) != null - && playerIn.getHeldItem(getInactiveHand(playerIn)).getItem() != Items.AIR + if (playerIn.getHeldItem(getInactiveHand(playerIn)) != null && playerIn.getHeldItem(hand).getItem() != playerIn.getHeldItem(getInactiveHand(playerIn)).getItem()) playerIn.getCooldownTracker().setCooldown(playerIn.getHeldItem(getInactiveHand(playerIn)).getItem(), cooldown+1); if (hasOffhand) { @@ -74,10 +72,10 @@ public ActionResult onItemRightClick(World worldIn, EntityPlayer play if (!ModArmor.isSet(playerIn, material)) playerIn.getHeldItem(hand).damageItem(1, playerIn); } - return new ActionResult(EnumActionResult.SUCCESS, playerIn.getHeldItem(hand)); + return new ActionResult(EnumActionResult.SUCCESS, playerIn.getHeldItem(hand)); } else - return new ActionResult(EnumActionResult.PASS, playerIn.getHeldItem(hand)); + return new ActionResult(EnumActionResult.PASS, playerIn.getHeldItem(hand)); } @Override @@ -94,7 +92,7 @@ public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSl if (player.getHeldItemMainhand().getItem() instanceof ItemAnaRifle && Minewatch.keyMode.isKeyDown(player) && entityIn.ticksExisted % 10 == 0) { AxisAlignedBB aabb = entityIn.getEntityBoundingBox().expandXyz(30); - List list = entityIn.world.getEntitiesWithinAABBExcludingEntity(entityIn, aabb); + List list = entityIn.worldObj.getEntitiesWithinAABBExcludingEntity(entityIn, aabb); if (!list.isEmpty()) { Iterator iterator = list.iterator(); while (iterator.hasNext()) { @@ -102,11 +100,11 @@ public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSl if (entityInArea != null && entityInArea instanceof EntityPlayer && ((EntityPlayer)entityInArea).isOnSameTeam(player) && ((EntityPlayer)entityInArea).getHealth() < ((EntityPlayer)entityInArea).getMaxHealth()) { - Minewatch.proxy.spawnParticlesHealthPlus(player.world, entityInArea.posX, + Minewatch.proxy.spawnParticlesHealthPlus(player.worldObj, entityInArea.posX, entityInArea.posY+2.5d, entityInArea.posZ, 0, 0, 0, 3); } else if (entityInArea != null && entityInArea instanceof EntityLiving) { - entityInArea.world.spawnParticle(EnumParticleTypes.HEART, entityInArea.posX, + entityInArea.worldObj.spawnParticle(EnumParticleTypes.HEART, entityInArea.posX, entityInArea.posY+2d, entityInArea.posZ, 0, 1, 0, new int[0]); } } @@ -152,7 +150,7 @@ public void onEvent(PlayerInteractEvent.LeftClickEmpty event) { && event.getEntityPlayer().getHeldItemMainhand().getItem() instanceof ItemReinhardtHammer) { EntityPlayer player = event.getEntityPlayer(); if (player.getCooldownTracker().hasCooldown(player.getHeldItemMainhand().getItem())) { - player.world.playSound(player, player.posX, player.posY, player.posZ, + player.worldObj.playSound(player, player.posX, player.posY, player.posZ, ModSoundEvents.reinhardtRocketHammer, SoundCategory.PLAYERS, 1.0f, event.getWorld().rand.nextFloat()/2+0.75f); } } @@ -162,7 +160,7 @@ public void onEvent(PlayerInteractEvent.LeftClickEmpty event) { @SideOnly(Side.CLIENT) @SubscribeEvent public void onEvent(RenderGameOverlayEvent.Post event) { - EntityPlayer player = Minecraft.getMinecraft().player; + EntityPlayer player = Minecraft.getMinecraft().thePlayer; boolean offhand = false; boolean mainhand = false; if (player != null && player.getHeldItemMainhand() != null && player.getHeldItemMainhand().getItem() instanceof ModWeapon diff --git a/src/main/java/twopiradians/minewatch/creativetab/MinewatchTab.java b/src/main/java/twopiradians/minewatch/creativetab/MinewatchTab.java index 1ac625ee..7f6202eb 100644 --- a/src/main/java/twopiradians/minewatch/creativetab/MinewatchTab.java +++ b/src/main/java/twopiradians/minewatch/creativetab/MinewatchTab.java @@ -1,6 +1,7 @@ package twopiradians.minewatch.creativetab; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import twopiradians.minewatch.common.item.ModItems; @@ -11,7 +12,7 @@ public MinewatchTab(String label) { } @Override - public ItemStack getTabIconItem() { - return new ItemStack(ModItems.reaper_token); + public Item getTabIconItem() { + return new ItemStack(ModItems.reaper_token).getItem(); } } diff --git a/src/main/java/twopiradians/minewatch/packet/PacketToggleMode.java b/src/main/java/twopiradians/minewatch/packet/PacketToggleMode.java index 509b8338..fee5d735 100644 --- a/src/main/java/twopiradians/minewatch/packet/PacketToggleMode.java +++ b/src/main/java/twopiradians/minewatch/packet/PacketToggleMode.java @@ -38,7 +38,7 @@ public void toBytes(ByteBuf buf) { public static class Handler implements IMessageHandler { @Override public IMessage onMessage(final PacketToggleMode packet, final MessageContext ctx) { - IThreadListener mainThread = (WorldServer) ctx.getServerHandler().playerEntity.world; + IThreadListener mainThread = (WorldServer) ctx.getServerHandler().playerEntity.worldObj; mainThread.addScheduledTask(new Runnable() { @Override