From 449dd530396aa21197a56810792299e6420ace82 Mon Sep 17 00:00:00 2001 From: HoosierTransfer Date: Sun, 30 Jun 2024 10:00:53 -0400 Subject: [PATCH] stuff before entity equipment slot --- .../minecraft/textures/entity/sweep.png | Bin 0 -> 1075 bytes .../assets/minecraft/textures/gui/icons.png | Bin 9672 -> 7418 bytes .../minecraft/textures/particle/particles.png | Bin 3613 -> 3262 bytes src/main/java/net/hoosiertransfer/Config.java | 5 +- .../eaglercraft/v1_8/opengl/OpenGlHelper.java | 23 +- .../java/net/minecraft/block/BlockEndRod.java | 14 +- .../java/net/minecraft/client/Minecraft.java | 10 +- .../net/minecraft/client/gui/GuiIngame.java | 82 +++- .../multiplayer/PlayerControllerMP.java | 7 +- .../client/network/NetHandlerPlayClient.java | 9 + .../client/particle/EffectRenderer.java | 4 + .../client/particle/EntityCrit2FX.java | 11 + .../minecraft/client/particle/EntityFX.java | 5 + .../client/particle/ParticleDragonBreath.java | 87 ++++ .../client/particle/ParticleEndRod.java | 31 ++ .../particle/ParticleSimpleAnimated.java | 105 +++++ .../client/particle/ParticleSweepAttack.java | 92 +++++ .../client/renderer/ItemRenderer.java | 7 + .../renderer/entity/ArmorStandRenderer.java | 14 +- .../client/renderer/entity/RenderItem.java | 18 + .../client/settings/GameSettings.java | 2 + .../java/net/minecraft/entity/Entity.java | 2 +- .../minecraft/entity/EntityLivingBase.java | 39 +- .../entity/SharedMonsterAttributes.java | 6 +- .../minecraft/entity/boss/EntityWither.java | 10 +- .../entity/item/EntityArmorStand.java | 2 +- .../entity/monster/EntityMagmaCube.java | 15 +- .../minecraft/entity/monster/EntityMob.java | 77 ++-- .../entity/monster/EntityZombie.java | 16 +- .../minecraft/entity/passive/EntityHorse.java | 12 + .../entity/passive/EntityRabbit.java | 10 +- .../minecraft/entity/player/EntityPlayer.java | 375 +++++++++++++----- .../entity/player/EntityPlayerMP.java | 13 + .../entity/player/InventoryPlayer.java | 18 - .../java/net/minecraft/init/Bootstrap.java | 6 +- src/main/java/net/minecraft/item/Item.java | 10 +- src/main/java/net/minecraft/item/ItemAxe.java | 11 +- .../net/minecraft/item/ItemChorusFruit.java | 8 +- src/main/java/net/minecraft/item/ItemHoe.java | 34 +- .../java/net/minecraft/item/ItemPickaxe.java | 21 +- .../java/net/minecraft/item/ItemSpade.java | 16 +- .../java/net/minecraft/item/ItemStack.java | 33 +- .../java/net/minecraft/item/ItemSword.java | 4 +- .../java/net/minecraft/item/ItemTool.java | 54 ++- .../network/EnumConnectionState.java | 5 + .../network/play/INetHandlerPlayClient.java | 3 + .../network/play/server/SPacketCooldown.java | 59 +++ .../java/net/minecraft/potion/Potion.java | 6 +- .../minecraft/potion/PotionAttackDamage.java | 13 +- .../server/management/ItemInWorldManager.java | 6 +- .../java/net/minecraft/util/CombatRules.java | 17 + .../net/minecraft/util/CooldownTracker.java | 89 +++++ .../minecraft/util/CooldownTrackerServer.java | 27 ++ .../net/minecraft/util/EnumParticleTypes.java | 5 +- 54 files changed, 1243 insertions(+), 305 deletions(-) create mode 100644 resources/resources/assets/minecraft/textures/entity/sweep.png create mode 100644 src/main/java/net/minecraft/client/particle/ParticleDragonBreath.java create mode 100644 src/main/java/net/minecraft/client/particle/ParticleEndRod.java create mode 100644 src/main/java/net/minecraft/client/particle/ParticleSimpleAnimated.java create mode 100644 src/main/java/net/minecraft/client/particle/ParticleSweepAttack.java create mode 100644 src/main/java/net/minecraft/network/play/server/SPacketCooldown.java create mode 100644 src/main/java/net/minecraft/util/CombatRules.java create mode 100644 src/main/java/net/minecraft/util/CooldownTracker.java create mode 100644 src/main/java/net/minecraft/util/CooldownTrackerServer.java diff --git a/resources/resources/assets/minecraft/textures/entity/sweep.png b/resources/resources/assets/minecraft/textures/entity/sweep.png new file mode 100644 index 0000000000000000000000000000000000000000..3e209b0071840828aff7fd530f9d0036f37a8a49 GIT binary patch literal 1075 zcmeAS@N?(olHy`uVBq!ia0vp^4M42G!3-qd{%H^gQjEnx?oJHr&dI!FU|?nl@Ck7R z3jY89A4raZ(GVDcA&_47CK>2$#*!evUYh7ML)4&ynnwKrFzd*TfaAZZevpEANX$aj4AOP z+vQo7ez M>FVdQ&MBb@0Bg#6i~s-t literal 0 HcmV?d00001 diff --git a/resources/resources/assets/minecraft/textures/gui/icons.png b/resources/resources/assets/minecraft/textures/gui/icons.png index 89d780f08991b7d579eb1d938d527cc4b20ab9bf..e825f7907b23324a5a9220c8977727489a047db0 100644 GIT binary patch literal 7418 zcmd5>c{r5syMJb^DI{BV@l8l%Uk526gjC8lBKtZayO}mZmR8GT-wB0~U6v_gFfy`@ zl6^Nc3}(*goZmUuIp?qQ-^d7ibkmM`MFafO`1NYASq5yK}_P@U}kyY%PaBh#G_C zKeU@n0Y;|!Oax}GV<-4cG^rT?2!E( zg!$?6$sbU9=!v_8=XQUD?i!rxKYkZscKi|tuiu3>Hc{!anreQbYJ);ktUGpL)rpj< zUf3}AEqZs|1g07iyEi#*V|>DKQk6>BP`}~(J+rXH=R397#<=@Z&TLlfc}xY1^m$BR zY}4&dZt6{uL^KmH4>KRD@xGBVUGMH(uU?LZ7oevRo04|9mpkqxG${44YTkRS_6?ET z)wwE!=Zscg9jsFebzniHOv}c{*-zdlm5khv7|%z@m+2q9&J3WK%MDHE{@py(>VPiCeYkUxuqEg{T5Zve_NkAt z<+p+y$1UCA0TK57KXj_WtpYkO)D?!TjyseSz4NCzSaeg{_np%Qdc?R;pLTUh?uN5v ztPYNB3XZ(-RMs&Ia`y^RC~rux4({Tb_FrEU?nS>ecItUac$fMStOq1_S%U!( zKii*PqxYIs?G<=sOaoIUK5c8S(TpvS=@_?AzA&4Zdqe>#XqvRUEq1)%KQ5=;bXQ1V zA9<5AB+gTk9c1yWLT)|ty;{oMn~XMmVq)Wmmq6Oi8clWn14`ha$ShM^TFEI5H@|F? zJfDap+hj$}Rb9oO#OWzJM&jd)>UTYfoq5zrwO49)_m_U8*6_Z(PVe5V+4!7RFNOJg z$w?G54+fK%uG7vQt1g839B_0Y)^dTEB7S1fbyK@A87Y^^p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siz`+5WzK^iQUr{o2Z;Z?gLGEB&^Oe6^cvJ1eCCxwexDH>u=V|7DE(*mpiU za496a9hhxfnOcy1^+&$j$=CIlJbIRD8J5ekWJ>IEe_Mzk11yDO~#>DtId0die}t_de_ zrAFvVZdj?+QgEJQQ>}#7D$+WEt^<+F4_vAvB0G4w0xgB=EQOZ)0!tkgK`*6D<%8rB ztt?beIkeW6R@nwlvK`sFEDBJ7ppMCA9h#5M&9;qn79yQOsX{0U8vh47pg>21z`P;= O0000g+ diff --git a/src/main/java/net/hoosiertransfer/Config.java b/src/main/java/net/hoosiertransfer/Config.java index 5e0f894..09eb1cf 100644 --- a/src/main/java/net/hoosiertransfer/Config.java +++ b/src/main/java/net/hoosiertransfer/Config.java @@ -1,8 +1,9 @@ package net.hoosiertransfer; +import java.util.Arrays; import java.util.HashSet; import java.util.Set; -import java.util.Arrays; + import net.minecraft.client.Minecraft; public class Config { @@ -30,6 +31,6 @@ public class Config { } public static boolean renderParticles() { - return false; + return true; } } diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/OpenGlHelper.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/OpenGlHelper.java index c110e6a..5997764 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/OpenGlHelper.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/opengl/OpenGlHelper.java @@ -1,5 +1,8 @@ package net.lax1dude.eaglercraft.v1_8.opengl; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; + /** * Copyright (c) 2022 lax1dude. All Rights Reserved. * @@ -26,6 +29,24 @@ public class OpenGlHelper { GlStateManager.texCoords2D(x, y); GlStateManager.setActiveTexture(defaultTexUnit); } - + public static void renderDirections(int p_188785_0_) + { + GlStateManager.disableTexture2D(); + GlStateManager.depthMask(false); + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer vertexbuffer = tessellator.getWorldRenderer(); + vertexbuffer.begin(1, DefaultVertexFormats.POSITION_COLOR); + EaglercraftGPU.glLineWidth(2.0F); + vertexbuffer.pos(0.0D, 0.0D, 0.0D).color(255, 0, 0, 255).endVertex(); + vertexbuffer.pos((double)p_188785_0_, 0.0D, 0.0D).color(255, 0, 0, 255).endVertex(); + vertexbuffer.pos(0.0D, 0.0D, 0.0D).color(0, 255, 0, 255).endVertex(); + vertexbuffer.pos(0.0D, (double)p_188785_0_, 0.0D).color(0, 255, 0, 255).endVertex(); + vertexbuffer.pos(0.0D, 0.0D, 0.0D).color(0, 0, 255, 255).endVertex(); + vertexbuffer.pos(0.0D, 0.0D, (double)p_188785_0_).color(0, 0, 255, 255).endVertex(); + tessellator.draw(); + EaglercraftGPU.glLineWidth(1.0F); + GlStateManager.depthMask(true); + GlStateManager.enableTexture2D(); + } } diff --git a/src/main/java/net/minecraft/block/BlockEndRod.java b/src/main/java/net/minecraft/block/BlockEndRod.java index d4585c1..223b8f5 100644 --- a/src/main/java/net/minecraft/block/BlockEndRod.java +++ b/src/main/java/net/minecraft/block/BlockEndRod.java @@ -96,13 +96,13 @@ public class BlockEndRod extends Block { double d3 = (double) (0.4F - (rand.nextFloat() + rand.nextFloat()) * 0.4F); if (rand.nextInt(5) == 0) { - // worldIn.spawnParticle(EnumParticleTypes.END_ROD, d0 + (double) - // enumfacing.getFrontOffsetX() * d3, - // d1 + (double) enumfacing.getFrontOffsetY() * d3, d2 + (double) - // enumfacing.getFrontOffsetZ() * d3, - // rand.nextGaussian() * 0.005D, rand.nextGaussian() * 0.005D, - // rand.nextGaussian() * 0.005D, - // new int[0]); + worldIn.spawnParticle(EnumParticleTypes.END_ROD, d0 + (double) + enumfacing.getFrontOffsetX() * d3, + d1 + (double) enumfacing.getFrontOffsetY() * d3, d2 + (double) + enumfacing.getFrontOffsetZ() * d3, + rand.nextGaussian() * 0.005D, rand.nextGaussian() * 0.005D, + rand.nextGaussian() * 0.005D, + new int[0]); } } diff --git a/src/main/java/net/minecraft/client/Minecraft.java b/src/main/java/net/minecraft/client/Minecraft.java index 6ab971e..afd326c 100644 --- a/src/main/java/net/minecraft/client/Minecraft.java +++ b/src/main/java/net/minecraft/client/Minecraft.java @@ -1190,7 +1190,6 @@ public class Minecraft implements IThreadListener { private void clickMouse() { if (this.leftClickCounter <= 0) { - this.thePlayer.swingItem(); if (this.objectMouseOver == null) { logger.error("Null returned as \'hitResult\', this shouldn\'t happen!"); if (this.playerController.isNotCreative()) { @@ -1213,9 +1212,13 @@ public class Minecraft implements IThreadListener { if (this.playerController.isNotCreative()) { this.leftClickCounter = 10; } + + this.thePlayer.resetCooldown(); } } + + this.thePlayer.swingItem(); } } @@ -2370,6 +2373,11 @@ public class Minecraft implements IThreadListener { return modelManager; } + public float getRenderPartialTicks() + { + return this.timer.renderPartialTicks; + } + /** * + * Returns the save loader that is currently being used diff --git a/src/main/java/net/minecraft/client/gui/GuiIngame.java b/src/main/java/net/minecraft/client/gui/GuiIngame.java index 85c739f..20498dc 100644 --- a/src/main/java/net/minecraft/client/gui/GuiIngame.java +++ b/src/main/java/net/minecraft/client/gui/GuiIngame.java @@ -23,6 +23,7 @@ import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.client.resources.I18n; +import net.minecraft.client.settings.GameSettings; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; @@ -169,7 +170,10 @@ public class GuiIngame extends Gui { this.renderTooltip(scaledresolution, partialTicks); } - this.mc.getTextureManager().bindTexture(icons); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(icons); + GlStateManager.enableBlend(); + this.renderAttackIndicator(partialTicks, scaledresolution); GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0); this.mc.mcProfiler.startSection("bossHealth"); this.renderBossHealth(); @@ -328,6 +332,65 @@ public class GuiIngame extends Gui { GlStateManager.enableAlpha(); } + private void renderAttackIndicator(float p_184045_1_, ScaledResolution p_184045_2_) + { + GameSettings gamesettings = this.mc.gameSettings; + + if (gamesettings.thirdPersonView == 0) + { + if (this.mc.playerController.isSpectator() && this.mc.pointedEntity == null) + { + MovingObjectPosition raytraceresult = this.mc.objectMouseOver; + + if (raytraceresult == null || raytraceresult.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) + { + return; + } + + BlockPos blockpos = raytraceresult.getBlockPos(); + + if (!this.mc.theWorld.getBlockState(blockpos).getBlock().hasTileEntity() || !(this.mc.theWorld.getTileEntity(blockpos) instanceof IInventory)) + { + return; + } + } + + int l = p_184045_2_.getScaledWidth(); + int i1 = p_184045_2_.getScaledHeight(); + + if (gamesettings.showDebugInfo && !gamesettings.hideGUI && !this.mc.thePlayer.hasReducedDebug() && !gamesettings.reducedDebugInfo) + { + // GlStateManager.pushMatrix(); + // GlStateManager.translate((float)(l / 2), (float)(i1 / 2), this.zLevel); + // Entity entity = this.mc.getRenderViewEntity(); + // GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * p_184045_1_, -1.0F, 0.0F, 0.0F); + // GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * p_184045_1_, 0.0F, 1.0F, 0.0F); + // GlStateManager.scale(-1.0F, -1.0F, -1.0F); + // OpenGlHelper.renderDirections(10); + // GlStateManager.popMatrix(); + } + else + { + GlStateManager.tryBlendFuncSeparate(GL_ONE_MINUS_DST_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_ONE, GL_ZERO); + GlStateManager.enableAlpha(); + // this.drawTexturedModalRect(l / 2 - 7, i1 / 2 - 7, 0, 0, 16, 16); + + if (this.mc.gameSettings.attackIndicator == 1) + { + float f = this.mc.thePlayer.getCooledAttackStrength(0.0F); + if (f < 1.0F) + { + int i = i1 / 2 - 7 + 16; + int j = l / 2 - 7; + int k = (int)(f * 17.0F); + this.drawTexturedModalRect(j, i, 36, 94, 16, 4); + this.drawTexturedModalRect(j, i, 52, 94, k, 4); + } + } + } + } + } + public void renderGameOverlayCrosshairs(int scaledResWidth, int scaledResHeight) { if (this.showCrosshair()) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); @@ -362,6 +425,23 @@ public class GuiIngame extends Gui { this.renderHotbarItem(j, k, l, partialTicks, entityplayer); } + if (this.mc.gameSettings.attackIndicator == 2) + { + float f1 = this.mc.thePlayer.getCooledAttackStrength(0.0F); + + if (f1 < 1.0F) + { + int i2 = sr.getScaledHeight() - 20; + int j2 = i + 91 + 6; + + this.mc.getTextureManager().bindTexture(icons); + int k1 = (int)(f1 * 19.0F); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + this.drawTexturedModalRect(j2, i2, 0, 94, 18, 18); + this.drawTexturedModalRect(j2, i2 + 18 - k1, 18, 112 - k1, 18, k1); + } + } + RenderHelper.disableStandardItemLighting(); GlStateManager.disableRescaleNormal(); GlStateManager.disableBlend(); diff --git a/src/main/java/net/minecraft/client/multiplayer/PlayerControllerMP.java b/src/main/java/net/minecraft/client/multiplayer/PlayerControllerMP.java index a60f35d..aa3697f 100644 --- a/src/main/java/net/minecraft/client/multiplayer/PlayerControllerMP.java +++ b/src/main/java/net/minecraft/client/multiplayer/PlayerControllerMP.java @@ -258,6 +258,7 @@ public class PlayerControllerMP { this.isHittingBlock = false; this.curBlockDamageMP = 0.0F; this.mc.theWorld.sendBlockBreakProgress(this.mc.thePlayer.getEntityId(), this.currentBlock, -1); + this.mc.thePlayer.resetCooldown(); } } @@ -394,6 +395,8 @@ public class PlayerControllerMP { if (!flag && this.currentGameType != WorldSettings.GameType.SPECTATOR) { if (heldStack == null) { return false; + } else if (player.getCooldownTracker().hasCooldown(heldStack.getItem())) { + return false; } else if (this.currentGameType.isCreative()) { int i = heldStack.getMetadata(); int j = heldStack.stackSize; @@ -417,6 +420,8 @@ public class PlayerControllerMP { public boolean sendUseItem(EntityPlayer playerIn, World worldIn, ItemStack itemStackIn) { if (this.currentGameType == WorldSettings.GameType.SPECTATOR) { return false; + } else if (playerIn.getCooldownTracker().hasCooldown(itemStackIn.getItem())) { + return false; } else { this.syncCurrentPlayItem(); this.netClientHandler @@ -449,8 +454,8 @@ public class PlayerControllerMP { this.netClientHandler.addToSendQueue(new C02PacketUseEntity(targetEntity, C02PacketUseEntity.Action.ATTACK)); if (this.currentGameType != WorldSettings.GameType.SPECTATOR) { playerIn.attackTargetEntityWithCurrentItem(targetEntity); + playerIn.resetCooldown(); } - } /** diff --git a/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java b/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java index 3974f58..749f266 100644 --- a/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java +++ b/src/main/java/net/minecraft/client/network/NetHandlerPlayClient.java @@ -183,6 +183,7 @@ import net.minecraft.network.play.server.S46PacketSetCompressionLevel; import net.minecraft.network.play.server.S47PacketPlayerListHeaderFooter; import net.minecraft.network.play.server.S48PacketResourcePackSend; import net.minecraft.network.play.server.S49PacketUpdateEntityNBT; +import net.minecraft.network.play.server.SPacketCooldown; import net.minecraft.potion.PotionEffect; import net.minecraft.scoreboard.IScoreObjectiveCriteria; import net.minecraft.scoreboard.Score; @@ -1836,6 +1837,14 @@ public class NetHandlerPlayClient implements INetHandlerPlayClient { } } + public void handleCooldown(SPacketCooldown packetIn) { + if (packetIn.getTicks() == 0) { + this.gameController.thePlayer.getCooldownTracker().removeCooldown(packetIn.getItem()); + } else { + this.gameController.thePlayer.getCooldownTracker().setCooldown(packetIn.getItem(), packetIn.getTicks()); + } + } + /** * + * Returns this the NetworkManager instance registered with this diff --git a/src/main/java/net/minecraft/client/particle/EffectRenderer.java b/src/main/java/net/minecraft/client/particle/EffectRenderer.java index 97a4c69..cbe77f5 100644 --- a/src/main/java/net/minecraft/client/particle/EffectRenderer.java +++ b/src/main/java/net/minecraft/client/particle/EffectRenderer.java @@ -149,6 +149,10 @@ public class EffectRenderer { this.registerParticle(EnumParticleTypes.EXPLOSION_LARGE.getParticleID(), new EntityLargeExplodeFX.Factory()); this.registerParticle(EnumParticleTypes.FIREWORKS_SPARK.getParticleID(), new EntityFirework.Factory()); this.registerParticle(EnumParticleTypes.MOB_APPEARANCE.getParticleID(), new MobAppearance.Factory()); + this.registerParticle(EnumParticleTypes.DRAGON_BREATH.getParticleID(), new ParticleDragonBreath.Factory()); + this.registerParticle(EnumParticleTypes.END_ROD.getParticleID(), new ParticleEndRod.Factory()); + this.registerParticle(EnumParticleTypes.DAMAGE_INDICATOR.getParticleID(), new EntityCrit2FX.DamageIndicatorFactory()); + this.registerParticle(EnumParticleTypes.SWEEP_ATTACK.getParticleID(), new ParticleSweepAttack.Factory()); } public void registerParticle(int id, IParticleFactory particleFactory) { diff --git a/src/main/java/net/minecraft/client/particle/EntityCrit2FX.java b/src/main/java/net/minecraft/client/particle/EntityCrit2FX.java index 649539a..773d534 100644 --- a/src/main/java/net/minecraft/client/particle/EntityCrit2FX.java +++ b/src/main/java/net/minecraft/client/particle/EntityCrit2FX.java @@ -101,6 +101,17 @@ public class EntityCrit2FX extends EntityFX { } + public static class DamageIndicatorFactory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + EntityFX particle = new EntityCrit2FX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn + 1.0D, zSpeedIn, 1.0F); + particle.setMaxAge(20); + particle.setParticleTextureIndex(67); + return particle; + } + } + public static class Factory implements IParticleFactory { public EntityFX getEntityFX(int var1, World world, double d0, double d1, double d2, double d3, double d4, double d5, int... var15) { diff --git a/src/main/java/net/minecraft/client/particle/EntityFX.java b/src/main/java/net/minecraft/client/particle/EntityFX.java index a4f2c07..985bcf3 100644 --- a/src/main/java/net/minecraft/client/particle/EntityFX.java +++ b/src/main/java/net/minecraft/client/particle/EntityFX.java @@ -135,6 +135,11 @@ public class EntityFX extends Entity { return this.particleAlpha; } + public void setMaxAge(int p_187114_1_) + { + this.particleMaxAge = p_187114_1_; + } + /** * + * returns if this entity triggers Block.onEntityWalking on the diff --git a/src/main/java/net/minecraft/client/particle/ParticleDragonBreath.java b/src/main/java/net/minecraft/client/particle/ParticleDragonBreath.java new file mode 100644 index 0000000..98be6a0 --- /dev/null +++ b/src/main/java/net/minecraft/client/particle/ParticleDragonBreath.java @@ -0,0 +1,87 @@ +package net.minecraft.client.particle; + +import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class ParticleDragonBreath extends EntityFX +{ + private final float oSize; + private boolean hasHitGround; + + protected ParticleDragonBreath(World worldIn, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) + { + super(worldIn, x, y, z, xSpeed, ySpeed, zSpeed); + this.motionX = xSpeed; + this.motionY = ySpeed; + this.motionZ = zSpeed; + this.particleRed = MathHelper.randomFloatClamp(this.rand, 0.7176471F, 0.8745098F); + this.particleGreen = MathHelper.randomFloatClamp(this.rand, 0.0F, 0.0F); + this.particleBlue = MathHelper.randomFloatClamp(this.rand, 0.8235294F, 0.9764706F); + this.particleScale *= 0.75F; + this.oSize = this.particleScale; + this.particleMaxAge = (int)(20.0D / ((double)this.rand.nextFloat() * 0.8D + 0.2D)); + this.hasHitGround = false; + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) + { + this.setDead(); + } + else + { + this.setParticleTextureIndex(3 * this.particleAge / this.particleMaxAge + 5); + + if (this.isCollided) + { + this.motionY = 0.0D; + this.hasHitGround = true; + } + + if (this.hasHitGround) + { + this.motionY += 0.002D; + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + + if (this.posY == this.prevPosY) + { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + + this.motionX *= 0.9599999785423279D; + this.motionZ *= 0.9599999785423279D; + + if (this.hasHitGround) + { + this.motionY *= 0.9599999785423279D; + } + } + } + + /** + * Renders the particle + */ + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + this.particleScale = this.oSize * MathHelper.clamp_float(((float)this.particleAge + partialTicks) / (float)this.particleMaxAge * 32.0F, 0.0F, 1.0F); + super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ); + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new ParticleDragonBreath(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/particle/ParticleEndRod.java b/src/main/java/net/minecraft/client/particle/ParticleEndRod.java new file mode 100644 index 0000000..cb3e6ae --- /dev/null +++ b/src/main/java/net/minecraft/client/particle/ParticleEndRod.java @@ -0,0 +1,31 @@ +package net.minecraft.client.particle; + +import net.minecraft.world.World; + +public class ParticleEndRod extends ParticleSimpleAnimated +{ + public ParticleEndRod(World p_i46580_1_, double p_i46580_2_, double p_i46580_4_, double p_i46580_6_, double p_i46580_8_, double p_i46580_10_, double p_i46580_12_) + { + super(p_i46580_1_, p_i46580_2_, p_i46580_4_, p_i46580_6_, 176, 8, -5.0E-4F); + this.motionX = p_i46580_8_; + this.motionY = p_i46580_10_; + this.motionZ = p_i46580_12_; + this.particleScale *= 0.75F; + this.particleMaxAge = 60 + this.rand.nextInt(12); + this.setColorFade(15916745); + } + + public void moveEntity(double x, double y, double z) + { + this.setEntityBoundingBox(this.getEntityBoundingBox().offset(x, y, z)); + this.resetPositionToBB(); + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new ParticleEndRod(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } +} diff --git a/src/main/java/net/minecraft/client/particle/ParticleSimpleAnimated.java b/src/main/java/net/minecraft/client/particle/ParticleSimpleAnimated.java new file mode 100644 index 0000000..4c1c1d4 --- /dev/null +++ b/src/main/java/net/minecraft/client/particle/ParticleSimpleAnimated.java @@ -0,0 +1,105 @@ +package net.minecraft.client.particle; + +import net.minecraft.world.World; + +public class ParticleSimpleAnimated extends EntityFX { + /** + * The base texture index. The texture index starts at this + (numAgingFrames - + * 1), and works its way down to this + * number as the particle decays. + */ + private final int textureIdx; + + /** + * How many different textures there are to progress through as the particle + * decays + */ + private final int numAgingFrames; + + /** + * Added to the ySpeed every tick. Usually a small (thousandths), negative + * value. + */ + private final float yAccel; + + /** The red value to drift toward */ + private float fadeTargetRed; + + /** The green value to drift toward */ + private float fadeTargetGreen; + + /** The blue value to drift toward */ + private float fadeTargetBlue; + + /** True if setColorFade has been called */ + private boolean fadingColor; + + public ParticleSimpleAnimated(World worldIn, double x, double y, double z, int textureIdxIn, int numFrames, + float yAccelIn) { + super(worldIn, x, y, z); + this.textureIdx = textureIdxIn; + this.numAgingFrames = numFrames; + this.yAccel = yAccelIn; + } + + public void setColor(int p_187146_1_) { + float f = (float) ((p_187146_1_ & 16711680) >> 16) / 255.0F; + float f1 = (float) ((p_187146_1_ & 65280) >> 8) / 255.0F; + float f2 = (float) ((p_187146_1_ & 255) >> 0) / 255.0F; + float f3 = 1.0F; + this.setRBGColorF(f * f3, f1 * f3, f2 * f3); + } + + /** + * sets a color for the particle to drift toward (20% closer each tick, never + * actually getting very close) + */ + public void setColorFade(int rgb) { + this.fadeTargetRed = (float) ((rgb & 16711680) >> 16) / 255.0F; + this.fadeTargetGreen = (float) ((rgb & 65280) >> 8) / 255.0F; + this.fadeTargetBlue = (float) ((rgb & 255) >> 0) / 255.0F; + this.fadingColor = true; + } + + public boolean isTransparent() { + return true; + } + + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + + if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + if (this.particleAge > this.particleMaxAge / 2) { + this.setAlphaF(1.0F + - ((float) this.particleAge - (float) (this.particleMaxAge / 2)) / (float) this.particleMaxAge); + + if (this.fadingColor) { + this.particleRed += (this.fadeTargetRed - this.particleRed) * 0.2F; + this.particleGreen += (this.fadeTargetGreen - this.particleGreen) * 0.2F; + this.particleBlue += (this.fadeTargetBlue - this.particleBlue) * 0.2F; + } + } + + this.setParticleTextureIndex(this.textureIdx + + (this.numAgingFrames - 1 - this.particleAge * this.numAgingFrames / this.particleMaxAge)); + this.motionY += (double) this.yAccel; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.9100000262260437D; + this.motionY *= 0.9100000262260437D; + this.motionZ *= 0.9100000262260437D; + + if (this.isCollided) { + this.motionX *= 0.699999988079071D; + this.motionZ *= 0.699999988079071D; + } + } + + public int getBrightnessForRender(float p_189214_1_) { + return 15728880; + } +} diff --git a/src/main/java/net/minecraft/client/particle/ParticleSweepAttack.java b/src/main/java/net/minecraft/client/particle/ParticleSweepAttack.java new file mode 100644 index 0000000..177ee7a --- /dev/null +++ b/src/main/java/net/minecraft/client/particle/ParticleSweepAttack.java @@ -0,0 +1,92 @@ +package net.minecraft.client.particle; + +import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; +import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureManager; +import net.minecraft.client.renderer.vertex.DefaultVertexFormats; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + +public class ParticleSweepAttack extends EntityFX +{ + private static final ResourceLocation SWEEP_TEXTURE = new ResourceLocation("textures/entity/sweep.png"); + private int life; + private int lifeTime; + private TextureManager textureManager; + private float size; + + protected ParticleSweepAttack(TextureManager textureManagerIn, World worldIn, double x, double y, double z, double p_i46582_9_, double p_i46582_11_, double p_i46582_13_) + { + super(worldIn, x, y, z, 0.0D, 0.0D, 0.0D); + this.textureManager = textureManagerIn; + this.lifeTime = 4; + this.particleRed = this.particleGreen = this.particleBlue = this.rand.nextFloat() * 0.6F + 0.4F; + this.size = 1.0F - (float)p_i46582_9_ * 0.5F; + } + + /** + * Renders the particle + */ + public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ) + { + int i = (int)(((float)this.life + partialTicks) * 3.0F / (float)this.lifeTime); + + if (i <= 7) + { + this.textureManager.bindTexture(SWEEP_TEXTURE); + float f = (float)(i % 4) / 4.0F; + float f1 = f + 0.24975F; + float f2 = (float)(i / 2) / 2.0F; + float f3 = f2 + 0.4995F; + float f4 = 1.0F * this.size; + float f5 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTicks - interpPosX); + float f6 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTicks - interpPosY); + float f7 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTicks - interpPosZ); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + GlStateManager.disableLighting(); + RenderHelper.disableStandardItemLighting(); + worldRendererIn.begin(7, DefaultVertexFormats.PARTICLE_POSITION_TEX_COLOR_LMAP); + worldRendererIn.pos((double)(f5 - rotationX * f4 - rotationXY * f4), (double)(f6 - rotationZ * f4 * 0.5F), (double)(f7 - rotationYZ * f4 - rotationXZ * f4)).tex((double)f1, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldRendererIn.pos((double)(f5 - rotationX * f4 + rotationXY * f4), (double)(f6 + rotationZ * f4 * 0.5F), (double)(f7 - rotationYZ * f4 + rotationXZ * f4)).tex((double)f1, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldRendererIn.pos((double)(f5 + rotationX * f4 + rotationXY * f4), (double)(f6 + rotationZ * f4 * 0.5F), (double)(f7 + rotationYZ * f4 + rotationXZ * f4)).tex((double)f, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex(); + worldRendererIn.pos((double)(f5 + rotationX * f4 - rotationXY * f4), (double)(f6 - rotationZ * f4 * 0.5F), (double)(f7 + rotationYZ * f4 - rotationXZ * f4)).tex((double)f, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex(); + Tessellator.getInstance().draw(); + GlStateManager.enableLighting(); + } + } + + public int getBrightnessForRender(float p_189214_1_) + { + return 61680; + } + + public void onUpdate() + { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + ++this.life; + + if (this.life == this.lifeTime) + { + this.setDead(); + } + } + + public int getFXLayer() + { + return 3; + } + + public static class Factory implements IParticleFactory + { + public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_) + { + return new ParticleSweepAttack(Minecraft.getMinecraft().getTextureManager(), worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); + } + } +} diff --git a/src/main/java/net/minecraft/client/renderer/ItemRenderer.java b/src/main/java/net/minecraft/client/renderer/ItemRenderer.java index 6071cbb..8ddc1f1 100644 --- a/src/main/java/net/minecraft/client/renderer/ItemRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/ItemRenderer.java @@ -1,5 +1,7 @@ package net.minecraft.client.renderer; +import com.google.common.base.Objects; + import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*; import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerTextureAtlasSprite; @@ -536,6 +538,11 @@ public class ItemRenderer { flag = true; } + float cooledAttackStength = entityplayersp.getCooledAttackStrength(1.0F); + this.equippedProgress += MathHelper + .clamp_float((com.google.common.base.Objects.equal(this.itemToRender, itemstack) ? cooledAttackStength * cooledAttackStength * cooledAttackStength : 0.0F) + - this.equippedProgress, -0.4F, 0.4F); + float f = 0.4F; float f1 = flag ? 0.0F : 1.0F; float f2 = MathHelper.clamp_float(f1 - this.equippedProgress, -f, f); diff --git a/src/main/java/net/minecraft/client/renderer/entity/ArmorStandRenderer.java b/src/main/java/net/minecraft/client/renderer/entity/ArmorStandRenderer.java index 4ae7659..5cfc5be 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/ArmorStandRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/entity/ArmorStandRenderer.java @@ -7,6 +7,7 @@ import net.minecraft.client.renderer.entity.layers.LayerBipedArmor; import net.minecraft.client.renderer.entity.layers.LayerCustomHead; import net.minecraft.client.renderer.entity.layers.LayerHeldItem; import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; /** @@ -73,9 +74,16 @@ public class ArmorStandRenderer extends RendererLivingEntity { return (ModelArmorStand) super.getMainModel(); } - protected void rotateCorpse(EntityArmorStand var1, float var2, float f, float var4) { - GlStateManager.rotate(180.0F - f, 0.0F, 1.0F, 0.0F); - } + protected void rotateCorpse(EntityArmorStand entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks) + { + GlStateManager.rotate(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F); + float f = (float)(entityLiving.worldObj.getTotalWorldTime() - entityLiving.punchCooldown) + partialTicks; + + if (f < 5.0F) + { + GlStateManager.rotate(MathHelper.sin(f / 1.5F * (float)Math.PI) * 3.0F, 0.0F, 1.0F, 0.0F); + } + } protected boolean canRenderName(EntityArmorStand entityarmorstand) { return entityarmorstand.getAlwaysRenderNameTag(); diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderItem.java b/src/main/java/net/minecraft/client/renderer/entity/RenderItem.java index b64a608..d0b7ec8 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderItem.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderItem.java @@ -34,6 +34,7 @@ import net.minecraft.block.BlockStoneSlabNew; import net.minecraft.block.BlockTallGrass; import net.minecraft.block.BlockWall; import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.EntityRenderer; import net.minecraft.client.renderer.ItemMeshDefinition; @@ -67,6 +68,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumWorldBlockLayer; +import net.minecraft.util.MathHelper; import net.minecraft.util.ReportedException; import net.minecraft.util.ResourceLocation; import net.minecraft.util.Vec3i; @@ -531,6 +533,22 @@ public class RenderItem implements IResourceManagerReloadListener { GlStateManager.enableDepth(); } + EntityPlayerSP entityplayersp = Minecraft.getMinecraft().thePlayer; + float f = entityplayersp == null ? 0.0F + : entityplayersp.getCooldownTracker().getCooldown(stack.getItem(), + Minecraft.getMinecraft().getRenderPartialTicks()); + if (f > 0.0F) { + GlStateManager.disableLighting(); + GlStateManager.disableDepth(); + GlStateManager.disableTexture2D(); + Tessellator tessellator1 = Tessellator.getInstance(); + WorldRenderer worldRenderer = tessellator1.getWorldRenderer(); + this.func_181565_a(worldRenderer, xPosition, yPosition + MathHelper.floor_float(16.0F * (1.0F - f)), 16, + MathHelper.ceiling_float_int(16.0F * f), 255, 255, 255, 127); + GlStateManager.enableTexture2D(); + GlStateManager.enableLighting(); + GlStateManager.enableDepth(); + } } } diff --git a/src/main/java/net/minecraft/client/settings/GameSettings.java b/src/main/java/net/minecraft/client/settings/GameSettings.java index 6e8d829..8429fb4 100644 --- a/src/main/java/net/minecraft/client/settings/GameSettings.java +++ b/src/main/java/net/minecraft/client/settings/GameSettings.java @@ -232,6 +232,8 @@ public class GameSettings { public boolean disableAlpha = false; + public int attackIndicator = 1; // TODO: add this as an option + public GameSettings(Minecraft mcIn) { this.keyBindings = (KeyBinding[]) ArrayUtils.addAll(new KeyBinding[] { this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, diff --git a/src/main/java/net/minecraft/entity/Entity.java b/src/main/java/net/minecraft/entity/Entity.java index 75d8c91..5fa17a6 100644 --- a/src/main/java/net/minecraft/entity/Entity.java +++ b/src/main/java/net/minecraft/entity/Entity.java @@ -807,7 +807,7 @@ public abstract class Entity implements ICommandSender { * Resets the entity's position to the center (planar) and * bottom (vertical) points of its bounding box. */ - private void resetPositionToBB() { + public void resetPositionToBB() { this.posX = (this.getEntityBoundingBox().minX + this.getEntityBoundingBox().maxX) / 2.0D; this.posY = this.getEntityBoundingBox().minY; this.posZ = (this.getEntityBoundingBox().minZ + this.getEntityBoundingBox().maxZ) / 2.0D; diff --git a/src/main/java/net/minecraft/entity/EntityLivingBase.java b/src/main/java/net/minecraft/entity/EntityLivingBase.java index 6cb0d40..0a7da48 100644 --- a/src/main/java/net/minecraft/entity/EntityLivingBase.java +++ b/src/main/java/net/minecraft/entity/EntityLivingBase.java @@ -61,6 +61,7 @@ import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraft.world.WorldServer; import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.util.CombatRules; /** * + @@ -172,6 +173,9 @@ public abstract class EntityLivingBase extends Entity { /** The BlockPos the entity had during the previous tick. */ private BlockPos prevBlockpos; + protected int ticksSinceLastSwing; + + /** * + * Called by the /kill command. @@ -204,6 +208,8 @@ public abstract class EntityLivingBase extends Entity { this.getAttributeMap().registerAttribute(SharedMonsterAttributes.maxHealth); this.getAttributeMap().registerAttribute(SharedMonsterAttributes.knockbackResistance); this.getAttributeMap().registerAttribute(SharedMonsterAttributes.movementSpeed); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.ARMOR); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.field_189429_h); } protected void updateFallState(double d0, boolean flag, Block block, BlockPos blockpos) { @@ -1052,18 +1058,10 @@ public abstract class EntityLivingBase extends Entity { * Returns the current armor value as determined by a call to * InventoryPlayer.getTotalArmorValue */ - public int getTotalArmorValue() { - int i = 0; - - for (ItemStack itemstack : this.getInventory()) { - if (itemstack != null && itemstack.getItem() instanceof ItemArmor) { - int j = ((ItemArmor) itemstack.getItem()).damageReduceAmount; - i += j; - } - } - - return i; - } + public int getTotalArmorValue() { + IAttributeInstance iattributeinstance = this.getEntityAttribute(SharedMonsterAttributes.ARMOR); + return MathHelper.floor_double(iattributeinstance.getAttributeValue()); + } protected void damageArmor(float parFloat1) { } @@ -1072,16 +1070,15 @@ public abstract class EntityLivingBase extends Entity { * + * Reduces damage, depending on armor */ - protected float applyArmorCalculations(DamageSource source, float damage) { - if (!source.isUnblockable()) { - int i = 25 - this.getTotalArmorValue(); - float f = damage * (float) i; - this.damageArmor(damage); - damage = f / 25.0F; - } + protected float applyArmorCalculations(DamageSource source, float damage) { + if (!source.isUnblockable()) { + this.damageArmor(damage); + damage = CombatRules.func_189427_a(damage, (float) this.getTotalArmorValue(), + (float) this.getEntityAttribute(SharedMonsterAttributes.field_189429_h).getAttributeValue()); + } - return damage; - } + return damage; + } /** * + diff --git a/src/main/java/net/minecraft/entity/SharedMonsterAttributes.java b/src/main/java/net/minecraft/entity/SharedMonsterAttributes.java index b993a47..ce61e9c 100644 --- a/src/main/java/net/minecraft/entity/SharedMonsterAttributes.java +++ b/src/main/java/net/minecraft/entity/SharedMonsterAttributes.java @@ -1,8 +1,8 @@ package net.minecraft.entity; import java.util.Collection; -import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; import net.lax1dude.eaglercraft.v1_8.log4j.Logger; import net.minecraft.entity.ai.attributes.AttributeModifier; @@ -54,6 +54,10 @@ public class SharedMonsterAttributes { 0.699999988079071D, 0.0D, 1024.0D)).setDescription("Movement Speed").setShouldWatch(true); public static final IAttribute attackDamage = new RangedAttribute((IAttribute) null, "generic.attackDamage", 2.0D, 0.0D, 2048.0D); + public static final IAttribute ARMOR = (new RangedAttribute((IAttribute)null, "generic.armor", 0.0D, 0.0D, 30.0D)).setShouldWatch(true); + + public static final IAttribute field_189429_h = (new RangedAttribute((IAttribute)null, "generic.armorToughness", 0.0D, 0.0D, 20.0D)).setShouldWatch(true); + public static final IAttribute ATTACK_SPEED = (new RangedAttribute((IAttribute)null, "generic.attackSpeed", 4.0D, 0.0D, 1024.0D)).setShouldWatch(true); /** * + diff --git a/src/main/java/net/minecraft/entity/boss/EntityWither.java b/src/main/java/net/minecraft/entity/boss/EntityWither.java index 5fef1e0..d532bb7 100644 --- a/src/main/java/net/minecraft/entity/boss/EntityWither.java +++ b/src/main/java/net/minecraft/entity/boss/EntityWither.java @@ -389,15 +389,6 @@ public class EntityWither extends EntityMob implements IBossDisplayData, IRanged public void setInWeb() { } - /** - * + - * Returns the current armor value as determined by a call to - * InventoryPlayer.getTotalArmorValue - */ - public int getTotalArmorValue() { - return 4; - } - private double func_82214_u(int parInt1) { if (parInt1 <= 0) { return this.posX; @@ -562,6 +553,7 @@ public class EntityWither extends EntityMob implements IBossDisplayData, IRanged this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(300.0D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.6000000238418579D); this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(40.0D); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(4.0D); } public float func_82207_a(int parInt1) { diff --git a/src/main/java/net/minecraft/entity/item/EntityArmorStand.java b/src/main/java/net/minecraft/entity/item/EntityArmorStand.java index 4f1fb7e..8ce10c4 100644 --- a/src/main/java/net/minecraft/entity/item/EntityArmorStand.java +++ b/src/main/java/net/minecraft/entity/item/EntityArmorStand.java @@ -65,7 +65,7 @@ public class EntityArmorStand extends EntityLivingBase { private static final Rotations DEFAULT_RIGHTLEG_ROTATION = new Rotations(1.0F, 0.0F, 1.0F); private final ItemStack[] contents; private boolean canInteract; - private long punchCooldown; + public long punchCooldown; private int disabledSlots; private boolean field_181028_bj; private Rotations headRotation; diff --git a/src/main/java/net/minecraft/entity/monster/EntityMagmaCube.java b/src/main/java/net/minecraft/entity/monster/EntityMagmaCube.java index 2fc9a50..80f61dc 100644 --- a/src/main/java/net/minecraft/entity/monster/EntityMagmaCube.java +++ b/src/main/java/net/minecraft/entity/monster/EntityMagmaCube.java @@ -67,15 +67,6 @@ public class EntityMagmaCube extends EntitySlime { && !this.worldObj.isAnyLiquid(this.getEntityBoundingBox()); } - /** - * + - * Returns the current armor value as determined by a call to - * InventoryPlayer.getTotalArmorValue - */ - public int getTotalArmorValue() { - return this.getSlimeSize() * 3; - } - public int getBrightnessForRender(float var1) { return 15728880; } @@ -100,6 +91,12 @@ public class EntityMagmaCube extends EntitySlime { return Items.magma_cream; } + protected void setSlimeSize(int size) + { + super.setSlimeSize(size); + this.getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue((double)(size * 3)); + } + /** * + * Drop 0-2 items of this living's type diff --git a/src/main/java/net/minecraft/entity/monster/EntityMob.java b/src/main/java/net/minecraft/entity/monster/EntityMob.java index 088290f..a308ff8 100644 --- a/src/main/java/net/minecraft/entity/monster/EntityMob.java +++ b/src/main/java/net/minecraft/entity/monster/EntityMob.java @@ -5,6 +5,10 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityCreature; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemAxe; +import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.DamageSource; import net.minecraft.util.MathHelper; @@ -118,35 +122,58 @@ public abstract class EntityMob extends EntityCreature implements IMob { return i > 4 ? "game.hostile.hurt.fall.big" : "game.hostile.hurt.fall.small"; } - public boolean attackEntityAsMob(Entity entity) { - float f = (float) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); - int i = 0; - if (entity instanceof EntityLivingBase) { - f += EnchantmentHelper.func_152377_a(this.getHeldItem(), - ((EntityLivingBase) entity).getCreatureAttribute()); - i += EnchantmentHelper.getKnockbackModifier(this); - } + public boolean attackEntityAsMob(Entity entityIn) + { + float f = (float)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + int i = 0; - boolean flag = entity.attackEntityFrom(DamageSource.causeMobDamage(this), f); - if (flag) { - if (i > 0) { - entity.addVelocity( - (double) (-MathHelper.sin(this.rotationYaw * 3.1415927F / 180.0F) * (float) i * 0.5F), 0.1D, - (double) (MathHelper.cos(this.rotationYaw * 3.1415927F / 180.0F) * (float) i * 0.5F)); - this.motionX *= 0.6D; - this.motionZ *= 0.6D; - } + if (entityIn instanceof EntityLivingBase) + { + f += EnchantmentHelper.func_152377_a(this.getHeldItem(), ((EntityLivingBase)entityIn).getCreatureAttribute()); + i += EnchantmentHelper.getKnockbackModifier(this); + } - int j = EnchantmentHelper.getFireAspectModifier(this); - if (j > 0) { - entity.setFire(j * 4); - } + boolean flag = entityIn.attackEntityFrom(DamageSource.causeMobDamage(this), f); - this.applyEnchantments(this, entity); - } + if (flag) + { + if (i > 0 && entityIn instanceof EntityLivingBase) + { + ((EntityLivingBase)entityIn).knockBack(this, (float)i * 0.5F, (double)MathHelper.sin(this.rotationYaw * 0.017453292F), (double)(-MathHelper.cos(this.rotationYaw * 0.017453292F))); + this.motionX *= 0.6D; + this.motionZ *= 0.6D; + } - return flag; - } + int j = EnchantmentHelper.getFireAspectModifier(this); + + if (j > 0) + { + entityIn.setFire(j * 4); + } + + // if (entityIn instanceof EntityPlayer) + // { + // EntityPlayer entityplayer = (EntityPlayer)entityIn; + // ItemStack itemstack = this.getHeldItem(); + // ItemStack itemstack1 = entityplayer.isHandActive() ? entityplayer.getActiveItemStack() : null; + + // if (itemstack != null && itemstack1 != null && itemstack.getItem() instanceof ItemAxe && itemstack1.getItem() == Items.SHIELD) + // { + // float f1 = 0.25F + (float)EnchantmentHelper.getEfficiencyModifier(this) * 0.05F; + + // if (this.rand.nextFloat() < f1) + // { + // entityplayer.getCooldownTracker().setCooldown(Items.SHIELD, 100); + // this.worldObj.setEntityState(entityplayer, (byte)30); + // } + // } + // } + + this.applyEnchantments(this, entityIn); + } + + return flag; + } public float getBlockPathWeight(BlockPos blockpos) { return 0.5F - this.worldObj.getLightBrightness(blockpos); diff --git a/src/main/java/net/minecraft/entity/monster/EntityZombie.java b/src/main/java/net/minecraft/entity/monster/EntityZombie.java index 97761d5..5ec19ea 100644 --- a/src/main/java/net/minecraft/entity/monster/EntityZombie.java +++ b/src/main/java/net/minecraft/entity/monster/EntityZombie.java @@ -2,6 +2,7 @@ package net.minecraft.entity.monster; import java.util.Calendar; import java.util.List; + import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; import net.minecraft.block.Block; import net.minecraft.entity.Entity; @@ -122,6 +123,7 @@ public class EntityZombie extends EntityMob { this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(35.0D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D); + this.getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(2.0D); this.getAttributeMap().registerAttribute(reinforcementChance) .setBaseValue(this.rand.nextDouble() * 0.10000000149011612D); } @@ -133,20 +135,6 @@ public class EntityZombie extends EntityMob { this.getDataWatcher().addObject(14, Byte.valueOf((byte) 0)); } - /** - * + - * Returns the current armor value as determined by a call to - * InventoryPlayer.getTotalArmorValue - */ - public int getTotalArmorValue() { - int i = super.getTotalArmorValue() + 2; - if (i > 20) { - i = 20; - } - - return i; - } - public boolean isBreakDoorsTaskSet() { return this.isBreakDoorsTaskSet; } diff --git a/src/main/java/net/minecraft/entity/passive/EntityHorse.java b/src/main/java/net/minecraft/entity/passive/EntityHorse.java index 8ba7b0c..0cbffe2 100644 --- a/src/main/java/net/minecraft/entity/passive/EntityHorse.java +++ b/src/main/java/net/minecraft/entity/passive/EntityHorse.java @@ -20,6 +20,7 @@ import net.minecraft.entity.ai.EntityAIRunAroundLikeCrazy; import net.minecraft.entity.ai.EntityAISwimming; import net.minecraft.entity.ai.EntityAIWander; import net.minecraft.entity.ai.EntityAIWatchClosest; +import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.ai.attributes.IAttribute; import net.minecraft.entity.ai.attributes.IAttributeInstance; import net.minecraft.entity.ai.attributes.RangedAttribute; @@ -323,6 +324,17 @@ public class EntityHorse extends EntityAnimal implements IInvBasic { public void setHorseArmorStack(ItemStack itemStackIn) { this.dataWatcher.updateObject(22, Integer.valueOf(this.getHorseArmorIndex(itemStackIn))); this.resetTexturePrefix(); + // TODO: implement ar + // if (!this.worldObj.isRemote) + // { + // this.getEntityAttribute(SharedMonsterAttributes.ARMOR).removeModifier(ARMOR_MODIFIER_UUID); + // int i = horsearmortype.getProtection(); + + // if (i != 0) + // { + // this.getEntityAttribute(SharedMonsterAttributes.ARMOR).applyModifier((new AttributeModifier(ARMOR_MODIFIER_UUID, "Horse armor bonus", (double)i, 0)).setSaved(false)); + // } + // } } public void setBreeding(boolean breeding) { diff --git a/src/main/java/net/minecraft/entity/passive/EntityRabbit.java b/src/main/java/net/minecraft/entity/passive/EntityRabbit.java index c1cacec..0497aaa 100644 --- a/src/main/java/net/minecraft/entity/passive/EntityRabbit.java +++ b/src/main/java/net/minecraft/entity/passive/EntityRabbit.java @@ -319,15 +319,6 @@ public class EntityRabbit extends EntityAnimal { } } - /** - * + - * Returns the current armor value as determined by a call to - * InventoryPlayer.getTotalArmorValue - */ - public int getTotalArmorValue() { - return this.getRabbitType() == 99 ? 8 : super.getTotalArmorValue(); - } - /** * + * Called when the entity is attacked. @@ -398,6 +389,7 @@ public class EntityRabbit extends EntityAnimal { public void setRabbitType(int rabbitTypeId) { if (rabbitTypeId == 99) { + this.getEntityAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(8.0D); this.tasks.removeTask(this.aiAvoidWolves); this.tasks.addTask(4, new EntityRabbit.AIEvilAttack(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); diff --git a/src/main/java/net/minecraft/entity/player/EntityPlayer.java b/src/main/java/net/minecraft/entity/player/EntityPlayer.java index 987e0c5..223ffeb 100644 --- a/src/main/java/net/minecraft/entity/player/EntityPlayer.java +++ b/src/main/java/net/minecraft/entity/player/EntityPlayer.java @@ -1,12 +1,15 @@ package net.minecraft.entity.player; -import com.google.common.base.Charsets; -import com.google.common.collect.Lists; -import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; - import java.util.Collection; import java.util.List; + +import javax.annotation.Nullable; + +import com.google.common.base.Charsets; +import com.google.common.collect.Lists; + import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; +import net.lax1dude.eaglercraft.v1_8.mojang.authlib.GameProfile; import net.minecraft.block.Block; import net.minecraft.block.BlockBed; import net.minecraft.block.BlockDirectional; @@ -47,6 +50,7 @@ import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemElytra; import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.network.play.server.S12PacketEntityVelocity; @@ -65,6 +69,7 @@ import net.minecraft.tileentity.TileEntitySign; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; +import net.minecraft.util.CooldownTracker; import net.minecraft.util.DamageSource; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumParticleTypes; @@ -76,6 +81,7 @@ import net.minecraft.world.EnumDifficulty; import net.minecraft.world.IInteractionObject; import net.minecraft.world.LockCode; import net.minecraft.world.World; +import net.minecraft.world.WorldServer; import net.minecraft.world.WorldSettings; /** @@ -157,8 +163,17 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS private int lastXPSound; private final GameProfile gameProfile; private boolean hasReducedDebug = false; + + + private ItemStack itemStackMainHand = null; + private final CooldownTracker cooldownTracker = this.createCooldownTracker(); + public EntityFishHook fishEntity; + protected CooldownTracker createCooldownTracker() { + return new CooldownTracker(); + } + public EntityPlayer(World worldIn, GameProfile gameProfileIn) { super(worldIn); this.entityUniqueID = getUUID(gameProfileIn); @@ -176,6 +191,7 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS super.applyEntityAttributes(); this.getAttributeMap().registerAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(1.0D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.10000000149011612D); + this.getAttributeMap().registerAttribute(SharedMonsterAttributes.ATTACK_SPEED); } protected void entityInit() { @@ -353,6 +369,19 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS this.setPosition(d3, this.posY, d4); } + ++this.ticksSinceLastSwing; + + ItemStack itemstack = this.getHeldItem(); + + if (!ItemStack.areItemStacksEqual(this.itemStackMainHand, itemstack)) { + if (!ItemStack.areItemsEqualIgnoreDurability(this.itemStackMainHand, itemstack)) { + this.resetCooldown(); + } + + this.itemStackMainHand = itemstack == null ? null : itemstack.copy(); + } + + this.cooldownTracker.tick(); this.updateSize(); } @@ -1001,15 +1030,6 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS this.inventory.damageArmor(f); } - /** - * + - * Returns the current armor value as determined by a call to - * InventoryPlayer.getTotalArmorValue - */ - public int getTotalArmorValue() { - return this.inventory.getTotalArmorValue(); - } - /** * + * When searching for vulnerable players, if a player is @@ -1165,120 +1185,251 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS return -0.35D; } + public float getCooledAttackStrength(float adjustTicks) { + return MathHelper.clamp_float(((float) this.ticksSinceLastSwing + adjustTicks) / this.getCooldownPeriod(), 0.0F, + 1.0F); + } + + public float getCooldownPeriod() { + return (float) (1.0D / this.getEntityAttribute(SharedMonsterAttributes.ATTACK_SPEED).getAttributeValue() + * 20.0D); + } + + public void resetCooldown() { + this.ticksSinceLastSwing = 0; + } + + public CooldownTracker getCooldownTracker() { + return this.cooldownTracker; + } + /** * + * Attacks for the player the targeted entity with the currently * equipped item. The equipped item has hitEntity called on it. * Args: targetEntity */ - public void attackTargetEntityWithCurrentItem(Entity entity) { - if (entity.canAttackWithItem()) { - if (!entity.hitByEntity(this)) { - float f = (float) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); - int i = 0; - float f1 = 0.0F; - if (entity instanceof EntityLivingBase) { - f1 = EnchantmentHelper.func_152377_a(this.getHeldItem(), - ((EntityLivingBase) entity).getCreatureAttribute()); - } else { - f1 = EnchantmentHelper.func_152377_a(this.getHeldItem(), EnumCreatureAttribute.UNDEFINED); - } + public void attackTargetEntityWithCurrentItem(Entity targetEntity) { + if (targetEntity.canAttackWithItem()) { + if (!targetEntity.hitByEntity(this)) { + float f = (float) this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + float f1 = 0.0F; - i = i + EnchantmentHelper.getKnockbackModifier(this); - if (this.isSprinting()) { - ++i; - } + if (targetEntity instanceof EntityLivingBase) { + f1 = EnchantmentHelper.func_152377_a(this.getHeldItem(), + ((EntityLivingBase) targetEntity).getCreatureAttribute()); + } else { + f1 = EnchantmentHelper.func_152377_a(this.getHeldItem(), + EnumCreatureAttribute.UNDEFINED); + } - if (f > 0.0F || f1 > 0.0F) { - boolean flag = this.fallDistance > 0.0F && !this.onGround && !this.isOnLadder() && !this.isInWater() - && !this.isPotionActive(Potion.blindness) && this.ridingEntity == null - && entity instanceof EntityLivingBase; - if (flag && f > 0.0F) { - f *= 1.5F; - } + float f2 = this.getCooledAttackStrength(0.5F); + f = f * (0.2F + f2 * f2 * 0.8F); + f1 = f1 * f2; + this.resetCooldown(); - f = f + f1; - boolean flag1 = false; - int j = EnchantmentHelper.getFireAspectModifier(this); - if (entity instanceof EntityLivingBase && j > 0 && !entity.isBurning()) { - flag1 = true; - entity.setFire(1); - } + if (f > 0.0F || f1 > 0.0F) { + boolean flag = f2 > 0.9F; + boolean flag1 = false; + boolean flag2 = false; + boolean flag3 = false; + int i = 0; + i = i + EnchantmentHelper.getKnockbackModifier(this); - double d0 = entity.motionX; - double d1 = entity.motionY; - double d2 = entity.motionZ; - boolean flag2 = entity.attackEntityFrom(DamageSource.causePlayerDamage(this), f); - if (flag2) { - if (i > 0) { - entity.addVelocity( - (double) (-MathHelper.sin(this.rotationYaw * 3.1415927F / 180.0F) * (float) i - * 0.5F), - 0.1D, (double) (MathHelper.cos(this.rotationYaw * 3.1415927F / 180.0F) * (float) i - * 0.5F)); - this.motionX *= 0.6D; - this.motionZ *= 0.6D; - this.setSprinting(false); - } + if (this.isSprinting() && flag) { + // this.worldObj.playSound((EntityPlayer) null, this.posX, this.posY, this.posZ, + // SoundEvents.ENTITY_PLAYER_ATTACK_KNOCKBACK, this.getSoundCategory(), 1.0F, 1.0F); + ++i; + flag1 = true; + } - if (entity instanceof EntityPlayerMP && entity.velocityChanged) { - ((EntityPlayerMP) entity).playerNetServerHandler - .sendPacket(new S12PacketEntityVelocity(entity)); - entity.velocityChanged = false; - entity.motionX = d0; - entity.motionY = d1; - entity.motionZ = d2; - } + flag2 = flag && this.fallDistance > 0.0F && !this.onGround && !this.isOnLadder() + && !this.isInWater() && !this.isPotionActive(Potion.blindness) && !this.isRiding() + && targetEntity instanceof EntityLivingBase; + flag2 = flag2 && !this.isSprinting(); - if (flag) { - this.onCriticalHit(entity); - } + if (flag2) { + f *= 1.5F; - if (f1 > 0.0F) { - this.onEnchantmentCritical(entity); - } + } + f = f + f1; + double d0 = (double) (this.distanceWalkedModified - this.prevDistanceWalkedModified); - if (f >= 18.0F) { - this.triggerAchievement(AchievementList.overkill); - } + if (flag && !flag2 && !flag1 && this.onGround && d0 < (double) this.getAIMoveSpeed()) { + ItemStack itemstack = this.getHeldItem(); - this.setLastAttacker(entity); - if (entity instanceof EntityLivingBase) { - EnchantmentHelper.applyThornEnchantments((EntityLivingBase) entity, this); - } + if (itemstack != null && itemstack.getItem() instanceof ItemSword) { + flag3 = true; + } + } - EnchantmentHelper.applyArthropodEnchantments(this, entity); - ItemStack itemstack = this.getCurrentEquippedItem(); - Object object = entity; - if (entity instanceof EntityDragonPart) { - IEntityMultiPart ientitymultipart = ((EntityDragonPart) entity).entityDragonObj; - if (ientitymultipart instanceof EntityLivingBase) { - object = (EntityLivingBase) ientitymultipart; - } - } + float f4 = 0.0F; + boolean flag4 = false; + int j = EnchantmentHelper.getFireAspectModifier(this); - if (itemstack != null && object instanceof EntityLivingBase) { - itemstack.hitEntity((EntityLivingBase) object, this); - if (itemstack.stackSize <= 0) { - this.destroyCurrentEquippedItem(); - } - } + if (targetEntity instanceof EntityLivingBase) { + f4 = ((EntityLivingBase) targetEntity).getHealth(); - if (entity instanceof EntityLivingBase) { - this.addStat(StatList.damageDealtStat, Math.round(f * 10.0F)); - if (j > 0) { - entity.setFire(j * 4); - } - } + if (j > 0 && !targetEntity.isBurning()) { + flag4 = true; + targetEntity.setFire(1); + } + } - this.addExhaustion(0.3F); - } else if (flag1) { - entity.extinguish(); - } - } + double d1 = targetEntity.motionX; + double d2 = targetEntity.motionY; + double d3 = targetEntity.motionZ; + boolean flag5 = targetEntity.attackEntityFrom(DamageSource.causePlayerDamage(this), f); - } - } + if (flag5) { + if (i > 0) { + if (targetEntity instanceof EntityLivingBase) { + ((EntityLivingBase) targetEntity).knockBack(this, (float) i * 0.5F, + (double) MathHelper.sin(this.rotationYaw * 0.017453292F), + (double) (-MathHelper.cos(this.rotationYaw * 0.017453292F))); + } else { + targetEntity.addVelocity( + (double) (-MathHelper.sin(this.rotationYaw * 0.017453292F) * (float) i * 0.5F), + 0.1D, + (double) (MathHelper.cos(this.rotationYaw * 0.017453292F) * (float) i * 0.5F)); + } + + this.motionX *= 0.6D; + this.motionZ *= 0.6D; + this.setSprinting(false); + } + + if (flag3) { + for (EntityLivingBase entitylivingbase : this.worldObj.getEntitiesWithinAABB( + EntityLivingBase.class, + targetEntity.getEntityBoundingBox().expand(1.0D, 0.25D, 1.0D))) { + if (entitylivingbase != this && entitylivingbase != targetEntity + && !this.isOnSameTeam(entitylivingbase) + && this.getDistanceSqToEntity(entitylivingbase) < 9.0D) { + entitylivingbase.knockBack(this, 0.4F, + (double) MathHelper.sin(this.rotationYaw * 0.017453292F), + (double) (-MathHelper.cos(this.rotationYaw * 0.017453292F))); + entitylivingbase.attackEntityFrom(DamageSource.causePlayerDamage(this), 1.0F); + } + } + + // this.worldObj.playSound((EntityPlayer) null, this.posX, this.posY, this.posZ, + // SoundEvents.ENTITY_PLAYER_ATTACK_SWEEP, this.getSoundCategory(), 1.0F, 1.0F); + this.spawnSweepParticles(); + } + + if (targetEntity instanceof EntityPlayerMP && targetEntity.velocityChanged) { + ((EntityPlayerMP) targetEntity).playerNetServerHandler + .sendPacket(new S12PacketEntityVelocity(targetEntity)); + targetEntity.velocityChanged = false; + targetEntity.motionX = d1; + targetEntity.motionY = d2; + targetEntity.motionZ = d3; + } + + if (flag2) { + // this.worldObj.playSound((EntityPlayer) null, this.posX, this.posY, this.posZ, + // SoundEvents.ENTITY_PLAYER_ATTACK_CRIT, this.getSoundCategory(), 1.0F, 1.0F); + this.onCriticalHit(targetEntity); + } + + if (!flag2 && !flag3) { + if (flag) { + // this.worldObj.playSound((EntityPlayer) null, this.posX, this.posY, this.posZ, + // SoundEvents.ENTITY_PLAYER_ATTACK_STRONG, this.getSoundCategory(), 1.0F, 1.0F); + } else { + // this.worldObj.playSound((EntityPlayer) null, this.posX, this.posY, this.posZ, + // SoundEvents.ENTITY_PLAYER_ATTACK_WEAK, this.getSoundCategory(), 1.0F, 1.0F); + } + } + + if (f1 > 0.0F) { + this.onEnchantmentCritical(targetEntity); + } + // TODO: implement shield + // if (!this.worldObj.isRemote && targetEntity instanceof EntityPlayer) { + // EntityPlayer entityplayer = (EntityPlayer) targetEntity; + // ItemStack itemstack2 = this.getHeldItemMainhand(); + // ItemStack itemstack3 = entityplayer.isHandActive() ? entityplayer.getActiveItemStack() + // : null; + + // if (itemstack2 != null && itemstack3 != null && itemstack2.getItem() instanceof ItemAxe + // && itemstack3.getItem() == Items.SHIELD) { + // float f3 = 0.25F + (float) EnchantmentHelper.getEfficiencyModifier(this) * 0.05F; + + // if (flag1) { + // f3 += 0.75F; + // } + + // if (this.rand.nextFloat() < f3) { + // entityplayer.getCooldownTracker().setCooldown(Items.SHIsELD, 100); + // this.worldObj.setEntityState(entityplayer, (byte) 30); + // } + // } + // } + + if (f >= 18.0F) { + this.triggerAchievement(AchievementList.overkill); + } + + this.setLastAttacker(targetEntity); + + if (targetEntity instanceof EntityLivingBase) { + EnchantmentHelper.applyThornEnchantments((EntityLivingBase) targetEntity, this); + } + + EnchantmentHelper.applyArthropodEnchantments(this, targetEntity); + ItemStack itemstack1 = this.getHeldItem(); + Entity entity = targetEntity; + + if (targetEntity instanceof EntityDragonPart) { + IEntityMultiPart ientitymultipart = ((EntityDragonPart) targetEntity).entityDragonObj; + + if (ientitymultipart instanceof EntityLivingBase) { + entity = (EntityLivingBase) ientitymultipart; + } + } + + if (itemstack1 != null && entity instanceof EntityLivingBase) { + itemstack1.hitEntity((EntityLivingBase) entity, this); + + if (itemstack1.stackSize <= 0) { + this.setHeldItem((ItemStack) null); + } + } + + if (targetEntity instanceof EntityLivingBase) { + float f5 = f4 - ((EntityLivingBase) targetEntity).getHealth(); + this.addStat(StatList.damageDealtStat, Math.round(f5 * 10.0F)); + + if (j > 0) { + targetEntity.setFire(j * 4); + } + + if (this.worldObj instanceof WorldServer && f5 > 2.0F) { + int k = (int) ((double) f5 * 0.5D); + ((WorldServer) this.worldObj).spawnParticle(EnumParticleTypes.DAMAGE_INDICATOR, + targetEntity.posX, targetEntity.posY + (double) (targetEntity.height * 0.5F), + targetEntity.posZ, k, 0.1D, 0.0D, 0.1D, 0.2D, new int[0]); + } + } + + this.addExhaustion(0.3F); + } else { + // this.worldObj.playSound((EntityPlayer) null, this.posX, this.posY, this.posZ, + // SoundEvents.ENTITY_PLAYER_ATTACK_NODAMAGE, this.getSoundCategory(), 1.0F, 1.0F); + + if (flag4) { + targetEntity.extinguish(); + } + } + } + } + } + } + + public void setHeldItem(@Nullable ItemStack stack) { + this.inventory.mainInventory[this.inventory.currentItem] = stack; } /** @@ -1292,6 +1443,16 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS public void onEnchantmentCritical(Entity var1) { } + public void spawnSweepParticles() { + double d0 = (double) (-MathHelper.sin(this.rotationYaw * 0.017453292F)); + double d1 = (double) MathHelper.cos(this.rotationYaw * 0.017453292F); + + if (this.worldObj instanceof WorldServer) { + ((WorldServer) this.worldObj).spawnParticle(EnumParticleTypes.SWEEP_ATTACK, this.posX + d0, + this.posY + (double) this.height * 0.5D, this.posZ + d1, 0, d0, 0.0D, d1, 0.0D, new int[0]); + } + } + public void respawnPlayer() { } diff --git a/src/main/java/net/minecraft/entity/player/EntityPlayerMP.java b/src/main/java/net/minecraft/entity/player/EntityPlayerMP.java index 0d999c0..3171224 100644 --- a/src/main/java/net/minecraft/entity/player/EntityPlayerMP.java +++ b/src/main/java/net/minecraft/entity/player/EntityPlayerMP.java @@ -80,6 +80,8 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntitySign; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.CooldownTracker; +import net.minecraft.util.CooldownTrackerServer; import net.minecraft.util.DamageSource; import net.minecraft.util.EntityDamageSource; import net.minecraft.util.IChatComponent; @@ -288,6 +290,11 @@ public class EntityPlayerMP extends EntityPlayer implements ICrafting { .sendPacket(new S42PacketCombatEvent(this.getCombatTracker(), S42PacketCombatEvent.Event.END_COMBAT)); } + protected CooldownTracker createCooldownTracker() + { + return new CooldownTrackerServer(this); + } + /** * + * Called to update the entity's position/logic. @@ -1213,6 +1220,12 @@ public class EntityPlayerMP extends EntityPlayer implements ICrafting { return null; } + public void swingItem() + { + super.swingItem(); + this.resetCooldown(); + } + public void setElytraFlying() { this.setFlag(7, true); } diff --git a/src/main/java/net/minecraft/entity/player/InventoryPlayer.java b/src/main/java/net/minecraft/entity/player/InventoryPlayer.java index b05d8a6..96f8ae7 100644 --- a/src/main/java/net/minecraft/entity/player/InventoryPlayer.java +++ b/src/main/java/net/minecraft/entity/player/InventoryPlayer.java @@ -621,24 +621,6 @@ public class InventoryPlayer implements IInventory { return this.armorInventory[parInt1]; } - /** - * + - * Based on the damage values and maximum damage values of each - * armor item, returns the current armor value. - */ - public int getTotalArmorValue() { - int i = 0; - - for (int j = 0; j < this.armorInventory.length; ++j) { - if (this.armorInventory[j] != null && this.armorInventory[j].getItem() instanceof ItemArmor) { - int k = ((ItemArmor) this.armorInventory[j].getItem()).damageReduceAmount; - i += k; - } - } - - return i; - } - /** * + * Damages armor in each slot by the specified amount. diff --git a/src/main/java/net/minecraft/init/Bootstrap.java b/src/main/java/net/minecraft/init/Bootstrap.java index fffcddf..9dac633 100644 --- a/src/main/java/net/minecraft/init/Bootstrap.java +++ b/src/main/java/net/minecraft/init/Bootstrap.java @@ -473,9 +473,9 @@ public class Bootstrap { BiomeGenBase.doBootstrap(); BlockFire.init(); EntityEnderman.bootstrap(); - ItemAxe.bootstrap(); - ItemPickaxe.bootstrap(); - ItemSpade.bootstrap(); + // ItemAxe.bootstrap(); + // ItemPickaxe.bootstrap(); + // ItemSpade.bootstrap(); Item.registerItems(); Items.doBootstrap(); EntityVillager.bootstrap(); diff --git a/src/main/java/net/minecraft/item/Item.java b/src/main/java/net/minecraft/item/Item.java index 0163345..74c5138 100644 --- a/src/main/java/net/minecraft/item/Item.java +++ b/src/main/java/net/minecraft/item/Item.java @@ -83,8 +83,9 @@ import net.minecraft.world.World; public class Item { public static final RegistryNamespaced itemRegistry = new RegistryNamespaced(); private static final Map BLOCK_TO_ITEM = Maps.newHashMap(); - protected static final EaglercraftUUID itemModifierUUID = EaglercraftUUID + protected static final EaglercraftUUID ATTACK_DAMAGE_MODIFIER = EaglercraftUUID .fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); + protected static final EaglercraftUUID ATTACK_SPEED_MODIFIER = EaglercraftUUID.fromString("FA233E1C-4180-4865-B01B-BCCE9785ACA3"); private CreativeTabs tabToDisplayOn; /** * + @@ -1145,8 +1146,11 @@ public class Item { } public static enum ToolMaterial { - WOOD(0, 59, 2.0F, 0.0F, 15), STONE(1, 131, 4.0F, 1.0F, 5), IRON(2, 250, 6.0F, 2.0F, 14), - EMERALD(3, 1561, 8.0F, 3.0F, 10), GOLD(0, 32, 12.0F, 0.0F, 22); + WOOD(0, 59, 2.0F, 0.0F, 15), + STONE(1, 131, 4.0F, 1.0F, 5), + IRON(2, 250, 6.0F, 2.0F, 14), + EMERALD(3, 1561, 8.0F, 3.0F, 10), + GOLD(0, 32, 12.0F, 0.0F, 22); private final int harvestLevel; private final int maxUses; diff --git a/src/main/java/net/minecraft/item/ItemAxe.java b/src/main/java/net/minecraft/item/ItemAxe.java index 285f35a..dfe883d 100644 --- a/src/main/java/net/minecraft/item/ItemAxe.java +++ b/src/main/java/net/minecraft/item/ItemAxe.java @@ -39,15 +39,20 @@ import net.minecraft.init.Blocks; */ public class ItemAxe extends ItemTool { private static Set EFFECTIVE_ON; + private static final float[] ATTACK_DAMAGES = new float[] {6.0F, 8.0F, 8.0F, 8.0F, 6.0F}; + private static final float[] ATTACK_SPEEDS = new float[] { -3.2F, -3.2F, -3.1F, -3.0F, -3.0F}; public static void bootstrap() { EFFECTIVE_ON = Sets.newHashSet(new Block[] { Blocks.planks, Blocks.bookshelf, Blocks.log, Blocks.log2, Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin, Blocks.melon_block, Blocks.ladder, Blocks.wooden_button, Blocks.wooden_pressure_plate }); } - protected ItemAxe(Item.ToolMaterial material) { - super(3.0F, material, EFFECTIVE_ON); - } + protected ItemAxe(Item.ToolMaterial material) + { + super(material, EFFECTIVE_ON); + this.damageVsEntity = ATTACK_DAMAGES[material.ordinal()]; + this.attackSpeed = ATTACK_SPEEDS[material.ordinal()]; + } public float getStrVsBlock(ItemStack itemstack, Block block) { return block.getMaterial() != Material.wood && block.getMaterial() != Material.plants diff --git a/src/main/java/net/minecraft/item/ItemChorusFruit.java b/src/main/java/net/minecraft/item/ItemChorusFruit.java index a8ca33c..b6c7b69 100644 --- a/src/main/java/net/minecraft/item/ItemChorusFruit.java +++ b/src/main/java/net/minecraft/item/ItemChorusFruit.java @@ -18,7 +18,7 @@ public class ItemChorusFruit extends ItemFood { * the Item before the action is complete. */ public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer entityLiving) { - // TODO: Sound and cooldown + // TODO: Sound ItemStack itemstack = super.onItemUseFinish(stack, worldIn, entityLiving); if (!worldIn.isRemote) { @@ -43,9 +43,9 @@ public class ItemChorusFruit extends ItemFood { break; } } - // if (entityLiving instanceof EntityPlayer) { - // ((EntityPlayer) entityLiving).getCooldownTracker().setCooldown(this, 20); - // } + if (entityLiving instanceof EntityPlayer) { + ((EntityPlayer) entityLiving).getCooldownTracker().setCooldown(this, 20); + } } return itemstack; diff --git a/src/main/java/net/minecraft/item/ItemHoe.java b/src/main/java/net/minecraft/item/ItemHoe.java index b063cdf..df2807b 100644 --- a/src/main/java/net/minecraft/item/ItemHoe.java +++ b/src/main/java/net/minecraft/item/ItemHoe.java @@ -1,5 +1,7 @@ package net.minecraft.item; +import com.google.common.collect.Multimap; + import net.hoosiertransfer.EaglerItems; import net.minecraft.block.Block; import net.minecraft.block.BlockDirt; @@ -7,6 +9,8 @@ import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; @@ -44,12 +48,15 @@ import net.minecraft.world.World; */ public class ItemHoe extends Item { protected Item.ToolMaterial theToolMaterial; + private final float speed; public ItemHoe(Item.ToolMaterial material) { this.theToolMaterial = material; this.maxStackSize = 1; this.setMaxDamage(material.getMaxUses()); this.setCreativeTab(CreativeTabs.tabTools); + this.speed = material.getDamageVsEntity() + 1.0F; + } /** @@ -102,14 +109,14 @@ public class ItemHoe extends Item { } /** - * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise - * the damage on the stack. - */ - public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) - { - stack.damageItem(1, attacker); - return true; - } + * Current implementations of this method in child classes do not use the entry + * argument beside ev. They just raise + * the damage on the stack. + */ + public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) { + stack.damageItem(1, attacker); + return true; + } /** * + @@ -128,4 +135,15 @@ public class ItemHoe extends Item { public String getMaterialName() { return this.theToolMaterial.toString(); } + + public Multimap getItemAttributeModifiers() { + Multimap multimap = super.getItemAttributeModifiers(); + + multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), + new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", 0.0D, 0)); + multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), + new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", (double) (this.speed - 4.0F), 0)); + + return multimap; + } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/item/ItemPickaxe.java b/src/main/java/net/minecraft/item/ItemPickaxe.java index fb3fc9f..b3bb089 100644 --- a/src/main/java/net/minecraft/item/ItemPickaxe.java +++ b/src/main/java/net/minecraft/item/ItemPickaxe.java @@ -38,19 +38,16 @@ import net.minecraft.init.Blocks; * */ public class ItemPickaxe extends ItemTool { - private static Set EFFECTIVE_ON; + private static Set EFFECTIVE_ON = Sets.newHashSet(new Block[] { Blocks.activator_rail, Blocks.coal_ore, Blocks.cobblestone, + Blocks.detector_rail, Blocks.diamond_block, Blocks.diamond_ore, Blocks.double_stone_slab, + Blocks.golden_rail, Blocks.gold_block, Blocks.gold_ore, Blocks.ice, Blocks.iron_block, Blocks.iron_ore, + Blocks.lapis_block, Blocks.lapis_ore, Blocks.lit_redstone_ore, Blocks.mossy_cobblestone, + Blocks.netherrack, Blocks.packed_ice, Blocks.rail, Blocks.redstone_ore, Blocks.sandstone, + Blocks.red_sandstone, Blocks.stone, Blocks.stone_slab, Blocks.stone_button, Blocks.stone_pressure_plate }); - public static void bootstrap() { - EFFECTIVE_ON = Sets.newHashSet(new Block[] { Blocks.activator_rail, Blocks.coal_ore, Blocks.cobblestone, - Blocks.detector_rail, Blocks.diamond_block, Blocks.diamond_ore, Blocks.double_stone_slab, - Blocks.golden_rail, Blocks.gold_block, Blocks.gold_ore, Blocks.ice, Blocks.iron_block, Blocks.iron_ore, - Blocks.lapis_block, Blocks.lapis_ore, Blocks.lit_redstone_ore, Blocks.mossy_cobblestone, - Blocks.netherrack, Blocks.packed_ice, Blocks.rail, Blocks.redstone_ore, Blocks.sandstone, - Blocks.red_sandstone, Blocks.stone, Blocks.stone_slab, Blocks.stone_button, Blocks.stone_pressure_plate }); - } - - protected ItemPickaxe(Item.ToolMaterial material) { - super(2.0F, material, EFFECTIVE_ON); + protected ItemPickaxe(Item.ToolMaterial material) + { + super(1.0F, -2.8F, material, EFFECTIVE_ON); } /** diff --git a/src/main/java/net/minecraft/item/ItemSpade.java b/src/main/java/net/minecraft/item/ItemSpade.java index c28a925..318c50e 100644 --- a/src/main/java/net/minecraft/item/ItemSpade.java +++ b/src/main/java/net/minecraft/item/ItemSpade.java @@ -46,17 +46,13 @@ import net.minecraft.world.World; * */ public class ItemSpade extends ItemTool { - private static Set EFFECTIVE_ON; + private static Set EFFECTIVE_ON = Sets.newHashSet(new Block[] { Blocks.clay, Blocks.dirt, Blocks.farmland, Blocks.grass, + Blocks.gravel, Blocks.mycelium, Blocks.sand, Blocks.snow, Blocks.snow_layer, Blocks.soul_sand, + EaglerItems.getEaglerBlock("grass_path") }); - public static void bootstrap() { - EFFECTIVE_ON = Sets.newHashSet(new Block[] { Blocks.clay, Blocks.dirt, Blocks.farmland, Blocks.grass, - Blocks.gravel, Blocks.mycelium, Blocks.sand, Blocks.snow, Blocks.snow_layer, Blocks.soul_sand, - EaglerItems.getEaglerBlock("grass_path") }); - } - - public ItemSpade(Item.ToolMaterial material) { - super(1.0F, material, EFFECTIVE_ON); - } + public ItemSpade(Item.ToolMaterial material) { + super(1.5F, -3.0F, material, EFFECTIVE_ON); + } /** * + diff --git a/src/main/java/net/minecraft/item/ItemStack.java b/src/main/java/net/minecraft/item/ItemStack.java index 90d81b1..d1fc0a9 100644 --- a/src/main/java/net/minecraft/item/ItemStack.java +++ b/src/main/java/net/minecraft/item/ItemStack.java @@ -8,11 +8,14 @@ import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.HString; import java.util.Set; +import javax.annotation.Nullable; + import com.google.common.collect.HashMultimap; import com.google.common.collect.Lists; import com.google.common.collect.Multimap; import net.minecraft.block.Block; +import net.minecraft.client.resources.I18n; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentDurability; import net.minecraft.enchantment.EnchantmentHelper; @@ -454,6 +457,11 @@ public final class ItemStack { : (stackA != null && stackB != null ? stackA.isItemEqual(stackB) : false); } + public static boolean areItemsEqualIgnoreDurability(@Nullable ItemStack stackA, @Nullable ItemStack stackB) + { + return stackA == stackB ? true : (stackA != null && stackB != null ? stackA.isItemEqualIgnoreDurability(stackB) : false); + } + /** * + * compares ItemStack argument to the instance ItemStack; @@ -464,6 +472,11 @@ public final class ItemStack { return other != null && this.item == other.item && this.itemDamage == other.itemDamage; } + public boolean isItemEqualIgnoreDurability(@Nullable ItemStack stack) + { + return !this.isItemStackDamageable() ? this.isItemEqual(stack) : stack != null && this.item == stack.item; + } + public String getUnlocalizedName() { return this.item.getUnlocalizedName(this); } @@ -716,8 +729,16 @@ public final class ItemStack { for (Entry entry : (Set) multimap.entries()) { AttributeModifier attributemodifier = (AttributeModifier) entry.getValue(); double d0 = attributemodifier.getAmount(); - if (attributemodifier.getID() == Item.itemModifierUUID) { - d0 += (double) EnchantmentHelper.func_152377_a(this, EnumCreatureAttribute.UNDEFINED); + boolean flag = false; + + if (attributemodifier.getID() == Item.ATTACK_DAMAGE_MODIFIER) { + d0 = d0 + playerIn.getEntityAttribute(SharedMonsterAttributes.attackDamage).getBaseValue(); + d0 = d0 + (double)EnchantmentHelper.func_152377_a(this, EnumCreatureAttribute.UNDEFINED); + flag = true; + } else if (attributemodifier.getID() == Item.ATTACK_SPEED_MODIFIER) + { + d0 += playerIn.getEntityAttribute(SharedMonsterAttributes.ATTACK_SPEED).getBaseValue(); + flag = true; } double d1; @@ -726,8 +747,12 @@ public final class ItemStack { } else { d1 = d0 * 100.0D; } - - if (d0 > 0.0D) { + if (flag) { + arraylist.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted( + "attribute.modifier.plus." + attributemodifier.getOperation(), + new Object[] { DECIMALFORMAT.format(d1), + StatCollector.translateToLocal("attribute.name." + (String) entry.getKey()) })); + } else if (d0 > 0.0D) { arraylist.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted( "attribute.modifier.plus." + attributemodifier.getOperation(), new Object[] { DECIMALFORMAT.format(d1), diff --git a/src/main/java/net/minecraft/item/ItemSword.java b/src/main/java/net/minecraft/item/ItemSword.java index d2a07b0..7d71859 100644 --- a/src/main/java/net/minecraft/item/ItemSword.java +++ b/src/main/java/net/minecraft/item/ItemSword.java @@ -169,7 +169,9 @@ public class ItemSword extends Item { public Multimap getItemAttributeModifiers() { Multimap multimap = super.getItemAttributeModifiers(); multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), - new AttributeModifier(itemModifierUUID, "Weapon modifier", (double) this.attackDamage, 0)); + new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Weapon modifier", (double) this.attackDamage, 0)); + multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Weapon modifier", -2.4000000953674316D, 0)); + return multimap; } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/item/ItemTool.java b/src/main/java/net/minecraft/item/ItemTool.java index cd386d9..f474e33 100644 --- a/src/main/java/net/minecraft/item/ItemTool.java +++ b/src/main/java/net/minecraft/item/ItemTool.java @@ -5,6 +5,7 @@ import java.util.Set; import com.google.common.collect.Multimap; import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; @@ -44,18 +45,33 @@ import net.minecraft.world.World; public class ItemTool extends Item { private Set effectiveBlocks; protected float efficiencyOnProperMaterial = 4.0F; - private float damageVsEntity; + protected float damageVsEntity; + protected float attackSpeed; + protected Item.ToolMaterial toolMaterial; - protected ItemTool(float attackDamage, Item.ToolMaterial material, Set effectiveBlocks) { - this.toolMaterial = material; - this.effectiveBlocks = effectiveBlocks; - this.maxStackSize = 1; - this.setMaxDamage(material.getMaxUses()); - this.efficiencyOnProperMaterial = material.getEfficiencyOnProperMaterial(); - this.damageVsEntity = attackDamage + material.getDamageVsEntity(); - this.setCreativeTab(CreativeTabs.tabTools); - } + protected ItemTool(float attackDamageIn, float attackSpeedIn, Item.ToolMaterial materialIn, Set effectiveBlocksIn) + { + this.efficiencyOnProperMaterial = 4.0F; + this.toolMaterial = materialIn; + this.effectiveBlocks = effectiveBlocksIn; + this.maxStackSize = 1; + this.setMaxDamage(materialIn.getMaxUses()); + this.efficiencyOnProperMaterial = materialIn.getEfficiencyOnProperMaterial(); + this.damageVsEntity = attackDamageIn + materialIn.getDamageVsEntity(); + this.attackSpeed = attackSpeedIn; + this.setCreativeTab(CreativeTabs.tabTools); + } + + protected ItemTool(Item.ToolMaterial materialIn, Set effectiveBlocksIn) + { + this(0.0F, 0.0F, materialIn, effectiveBlocksIn); + } + + public float getStrVsBlock(ItemStack stack, IBlockState state) + { + return this.effectiveBlocks.contains(state.getBlock()) ? this.efficiencyOnProperMaterial : 1.0F; + } public float getStrVsBlock(ItemStack var1, Block block) { return this.effectiveBlocks.contains(block) ? this.efficiencyOnProperMaterial : 1.0F; @@ -124,10 +140,16 @@ public class ItemTool extends Item { : super.getIsRepairable(itemstack, itemstack1); } - public Multimap getItemAttributeModifiers() { - Multimap multimap = super.getItemAttributeModifiers(); - multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), - new AttributeModifier(itemModifierUUID, "Tool modifier", (double) this.damageVsEntity, 0)); - return multimap; - } + public Multimap getItemAttributeModifiers() + { + Multimap multimap = super.getItemAttributeModifiers(); + + // if (equipmentSlot == EntityEquipmentSlot.MAINHAND) + // { + multimap.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Tool modifier", (double)this.damageVsEntity, 0)); + multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", (double)this.attackSpeed, 0)); + // } + + return multimap; + } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/network/EnumConnectionState.java b/src/main/java/net/minecraft/network/EnumConnectionState.java index c328ea4..418cbc1 100644 --- a/src/main/java/net/minecraft/network/EnumConnectionState.java +++ b/src/main/java/net/minecraft/network/EnumConnectionState.java @@ -6,6 +6,7 @@ import com.google.common.collect.Maps; import java.util.Collection; import java.util.Map; + import net.minecraft.network.handshake.client.C00Handshake; import net.minecraft.network.login.client.C00PacketLoginStart; import net.minecraft.network.login.client.C01PacketEncryptionResponse; @@ -107,6 +108,7 @@ import net.minecraft.network.play.server.S46PacketSetCompressionLevel; import net.minecraft.network.play.server.S47PacketPlayerListHeaderFooter; import net.minecraft.network.play.server.S48PacketResourcePackSend; import net.minecraft.network.play.server.S49PacketUpdateEntityNBT; +import net.minecraft.network.play.server.SPacketCooldown; import net.lax1dude.eaglercraft.v1_8.log4j.LogManager; /** @@ -220,6 +222,9 @@ public enum EnumConnectionState { this.registerPacket(EnumPacketDirection.CLIENTBOUND, S47PacketPlayerListHeaderFooter.class); this.registerPacket(EnumPacketDirection.CLIENTBOUND, S48PacketResourcePackSend.class); this.registerPacket(EnumPacketDirection.CLIENTBOUND, S49PacketUpdateEntityNBT.class); + + this.registerPacket(EnumPacketDirection.CLIENTBOUND, SPacketCooldown.class); + this.registerPacket(EnumPacketDirection.SERVERBOUND, C00PacketKeepAlive.class); this.registerPacket(EnumPacketDirection.SERVERBOUND, C01PacketChatMessage.class); this.registerPacket(EnumPacketDirection.SERVERBOUND, C02PacketUseEntity.class); diff --git a/src/main/java/net/minecraft/network/play/INetHandlerPlayClient.java b/src/main/java/net/minecraft/network/play/INetHandlerPlayClient.java index b0acc01..8296f3e 100644 --- a/src/main/java/net/minecraft/network/play/INetHandlerPlayClient.java +++ b/src/main/java/net/minecraft/network/play/INetHandlerPlayClient.java @@ -72,6 +72,7 @@ import net.minecraft.network.play.server.S46PacketSetCompressionLevel; import net.minecraft.network.play.server.S47PacketPlayerListHeaderFooter; import net.minecraft.network.play.server.S48PacketResourcePackSend; import net.minecraft.network.play.server.S49PacketUpdateEntityNBT; +import net.minecraft.network.play.server.SPacketCooldown; /** * + @@ -503,4 +504,6 @@ public interface INetHandlerPlayClient extends INetHandler { void handleResourcePack(S48PacketResourcePackSend var1); void handleEntityNBT(S49PacketUpdateEntityNBT var1); + + void handleCooldown(SPacketCooldown var1); } \ No newline at end of file diff --git a/src/main/java/net/minecraft/network/play/server/SPacketCooldown.java b/src/main/java/net/minecraft/network/play/server/SPacketCooldown.java new file mode 100644 index 0000000..e217bd0 --- /dev/null +++ b/src/main/java/net/minecraft/network/play/server/SPacketCooldown.java @@ -0,0 +1,59 @@ +package net.minecraft.network.play.server; + +import java.io.IOException; +import net.minecraft.item.Item; +import net.minecraft.network.Packet; +import net.minecraft.network.PacketBuffer; +import net.minecraft.network.play.INetHandlerPlayClient; + +public class SPacketCooldown implements Packet +{ + private Item item; + private int ticks; + + public SPacketCooldown() + { + } + + public SPacketCooldown(Item itemIn, int ticksIn) + { + this.item = itemIn; + this.ticks = ticksIn; + } + + /** + * Reads the raw packet data from the data stream. + */ + public void readPacketData(PacketBuffer buf) throws IOException + { + this.item = Item.getItemById(buf.readVarIntFromBuffer()); + this.ticks = buf.readVarIntFromBuffer(); + } + + /** + * Writes the raw packet data to the data stream. + */ + public void writePacketData(PacketBuffer buf) throws IOException + { + buf.writeVarIntToBuffer(Item.getIdFromItem(this.item)); + buf.writeVarIntToBuffer(this.ticks); + } + + /** + * Passes this Packet on to the NetHandler for processing. + */ + public void processPacket(INetHandlerPlayClient handler) + { + handler.handleCooldown(this); + } + + public Item getItem() + { + return this.item; + } + + public int getTicks() + { + return this.ticks; + } +} diff --git a/src/main/java/net/minecraft/potion/Potion.java b/src/main/java/net/minecraft/potion/Potion.java index 2b2a93e..2929ea4 100644 --- a/src/main/java/net/minecraft/potion/Potion.java +++ b/src/main/java/net/minecraft/potion/Potion.java @@ -3,10 +3,10 @@ package net.minecraft.potion; import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; import com.google.common.collect.Maps; +import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; @@ -69,7 +69,7 @@ public class Potion { public static final Potion digSlowdown = (new Potion(4, new ResourceLocation("mining_fatigue"), true, 4866583)) .setPotionName("potion.digSlowDown").setIconIndex(3, 0); public static final Potion damageBoost = (new PotionAttackDamage(5, new ResourceLocation("strength"), false, - 9643043)).setPotionName("potion.damageBoost").setIconIndex(4, 0).registerPotionAttributeModifier( + 9643043, 3.0D)).setPotionName("potion.damageBoost").setIconIndex(4, 0).registerPotionAttributeModifier( SharedMonsterAttributes.attackDamage, "648D7064-6A60-4F59-8ABE-C2C23A6DD7A9", 2.5D, 2); public static final Potion heal = (new PotionHealth(6, new ResourceLocation("instant_health"), false, 16262179)) .setPotionName("potion.heal"); @@ -127,7 +127,7 @@ public class Potion { * + * The weakness Potion object. */ - public static final Potion weakness = (new PotionAttackDamage(18, new ResourceLocation("weakness"), true, 4738376)) + public static final Potion weakness = (new PotionAttackDamage(18, new ResourceLocation("weakness"), true, 4738376, -4.0D)) .setPotionName("potion.weakness").setIconIndex(5, 0).registerPotionAttributeModifier( SharedMonsterAttributes.attackDamage, "22653B89-116E-49DC-9B6B-9971489B5BE5", 2.0D, 0); /** diff --git a/src/main/java/net/minecraft/potion/PotionAttackDamage.java b/src/main/java/net/minecraft/potion/PotionAttackDamage.java index 4a2cb1d..ba8fdfc 100644 --- a/src/main/java/net/minecraft/potion/PotionAttackDamage.java +++ b/src/main/java/net/minecraft/potion/PotionAttackDamage.java @@ -33,12 +33,15 @@ import net.minecraft.util.ResourceLocation; * */ public class PotionAttackDamage extends Potion { - protected PotionAttackDamage(int potionID, ResourceLocation location, boolean badEffect, int potionColor) { + protected final double bonusPerLevel; + + protected PotionAttackDamage(int potionID, ResourceLocation location, boolean badEffect, int potionColor, double bonusPerLevelIn) { super(potionID, location, badEffect, potionColor); + this.bonusPerLevel = bonusPerLevelIn; + } - public double getAttributeModifierAmount(int modifier, AttributeModifier parAttributeModifier) { - return this.id == Potion.weakness.id ? (double) (-0.5F * (float) (modifier + 1)) - : 1.3D * (double) (modifier + 1); - } + public double getAttributeModifierAmount(int amplifier, AttributeModifier modifier) { + return this.bonusPerLevel * (double)(amplifier + 1); + } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/server/management/ItemInWorldManager.java b/src/main/java/net/minecraft/server/management/ItemInWorldManager.java index 405cd24..5b1fd24 100644 --- a/src/main/java/net/minecraft/server/management/ItemInWorldManager.java +++ b/src/main/java/net/minecraft/server/management/ItemInWorldManager.java @@ -301,7 +301,9 @@ public class ItemInWorldManager { public boolean tryUseItem(EntityPlayer entityplayer, World world, ItemStack itemstack) { if (this.gameType == WorldSettings.GameType.SPECTATOR) { return false; - } else { + } else if (entityplayer.getCooldownTracker().hasCooldown(itemstack.getItem())) { + return false; + } else { int i = itemstack.stackSize; int j = itemstack.getMetadata(); ItemStack itemstack1 = itemstack.useItemRightClick(world, entityplayer); @@ -366,6 +368,8 @@ public class ItemInWorldManager { if (itemstack == null) { return false; + } else if (entityplayer.getCooldownTracker().hasCooldown(itemstack.getItem())) { + return false; } else if (this.isCreative()) { int j = itemstack.getMetadata(); int i = itemstack.stackSize; diff --git a/src/main/java/net/minecraft/util/CombatRules.java b/src/main/java/net/minecraft/util/CombatRules.java new file mode 100644 index 0000000..097b9f3 --- /dev/null +++ b/src/main/java/net/minecraft/util/CombatRules.java @@ -0,0 +1,17 @@ +package net.minecraft.util; + +public class CombatRules +{ + public static float func_189427_a(float p_189427_0_, float p_189427_1_, float p_189427_2_) + { + float f = 2.0F + p_189427_2_ / 4.0F; + float f1 = MathHelper.clamp_float(p_189427_1_ - p_189427_0_ / f, p_189427_1_ * 0.2F, 20.0F); + return p_189427_0_ * (1.0F - f1 / 25.0F); + } + + public static float getDamageAfterMagicAbsorb(float p_188401_0_, float p_188401_1_) + { + float f = MathHelper.clamp_float(p_188401_1_, 0.0F, 20.0F); + return p_188401_0_ * (1.0F - f / 25.0F); + } +} diff --git a/src/main/java/net/minecraft/util/CooldownTracker.java b/src/main/java/net/minecraft/util/CooldownTracker.java new file mode 100644 index 0000000..29d1cf6 --- /dev/null +++ b/src/main/java/net/minecraft/util/CooldownTracker.java @@ -0,0 +1,89 @@ +package net.minecraft.util; + +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; + +import com.google.common.collect.Maps; + +import net.minecraft.item.Item; + +public class CooldownTracker +{ + private final Map cooldowns = Maps.newHashMap(); + private int ticks; + + public boolean hasCooldown(Item itemIn) + { + return this.getCooldown(itemIn, 0.0F) > 0.0F; + } + + public float getCooldown(Item itemIn, float partialTicks) + { + CooldownTracker.Cooldown cooldowntracker$cooldown = (CooldownTracker.Cooldown)this.cooldowns.get(itemIn); + + if (cooldowntracker$cooldown != null) + { + float f = (float)(cooldowntracker$cooldown.expireTicks - cooldowntracker$cooldown.createTicks); + float f1 = (float)cooldowntracker$cooldown.expireTicks - ((float)this.ticks + partialTicks); + return MathHelper.clamp_float(f1 / f, 0.0F, 1.0F); + } + else + { + return 0.0F; + } + } + + public void tick() + { + ++this.ticks; + + if (!this.cooldowns.isEmpty()) + { + Iterator> iterator = this.cooldowns.entrySet().iterator(); + + while (iterator.hasNext()) + { + Entry entry = (Entry)iterator.next(); + + if (((CooldownTracker.Cooldown)entry.getValue()).expireTicks <= this.ticks) + { + iterator.remove(); + this.notifyOnRemove((Item)entry.getKey()); + } + } + } + } + + public void setCooldown(Item itemIn, int ticksIn) + { + this.cooldowns.put(itemIn, new CooldownTracker.Cooldown(this.ticks, this.ticks + ticksIn)); + this.notifyOnSet(itemIn, ticksIn); + } + + public void removeCooldown(Item itemIn) + { + this.cooldowns.remove(itemIn); + this.notifyOnRemove(itemIn); + } + + protected void notifyOnSet(Item itemIn, int ticksIn) + { + } + + protected void notifyOnRemove(Item itemIn) + { + } + + class Cooldown + { + final int createTicks; + final int expireTicks; + + private Cooldown(int createTicksIn, int expireTicksIn) + { + this.createTicks = createTicksIn; + this.expireTicks = expireTicksIn; + } + } +} diff --git a/src/main/java/net/minecraft/util/CooldownTrackerServer.java b/src/main/java/net/minecraft/util/CooldownTrackerServer.java new file mode 100644 index 0000000..154028d --- /dev/null +++ b/src/main/java/net/minecraft/util/CooldownTrackerServer.java @@ -0,0 +1,27 @@ +package net.minecraft.util; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.Item; +import net.minecraft.network.play.server.SPacketCooldown; + +public class CooldownTrackerServer extends CooldownTracker +{ + private final EntityPlayerMP player; + + public CooldownTrackerServer(EntityPlayerMP playerIn) + { + this.player = playerIn; + } + + protected void notifyOnSet(Item itemIn, int ticksIn) + { + super.notifyOnSet(itemIn, ticksIn); + this.player.playerNetServerHandler.sendPacket(new SPacketCooldown(itemIn, ticksIn)); + } + + protected void notifyOnRemove(Item itemIn) + { + super.notifyOnRemove(itemIn); + this.player.playerNetServerHandler.sendPacket(new SPacketCooldown(itemIn, 0)); + } +} diff --git a/src/main/java/net/minecraft/util/EnumParticleTypes.java b/src/main/java/net/minecraft/util/EnumParticleTypes.java index d2706f8..8ff5bce 100644 --- a/src/main/java/net/minecraft/util/EnumParticleTypes.java +++ b/src/main/java/net/minecraft/util/EnumParticleTypes.java @@ -50,7 +50,10 @@ public enum EnumParticleTypes { SNOWBALL("snowballpoof", 31, false), SNOW_SHOVEL("snowshovel", 32, false), SLIME("slime", 33, false), HEART("heart", 34, false), BARRIER("barrier", 35, false), ITEM_CRACK("iconcrack_", 36, false, 2), BLOCK_CRACK("blockcrack_", 37, false, 1), BLOCK_DUST("blockdust_", 38, false, 1), WATER_DROP("droplet", 39, false), - ITEM_TAKE("take", 40, false), MOB_APPEARANCE("mobappearance", 41, true); + ITEM_TAKE("take", 40, false), MOB_APPEARANCE("mobappearance", 41, true), DRAGON_BREATH("dragonbreath", 42, false), + END_ROD("endRod", 43, false), + DAMAGE_INDICATOR("damageIndicator", 44, true), + SWEEP_ATTACK("sweepAttack", 45, true); public static final EnumParticleTypes[] _VALUES = values();