1
0
Fork 0
This commit is contained in:
HoosierTransfer 2024-05-03 10:28:03 -04:00
parent 7b232a057e
commit 758b466d8e
9 changed files with 48637 additions and 47999 deletions

File diff suppressed because it is too large Load Diff

View File

@ -13,28 +13,40 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraft.world.WorldSettings;
/**+
/**
* +
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
*
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
* Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team
*
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights
* Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public abstract class AbstractClientPlayer extends EntityPlayer {
private NetworkPlayerInfo playerInfo;
public float rotateElytraX;
public float rotateElytraY;
public float rotateElytraZ;
public long eaglerHighPolyAnimationTick = System.currentTimeMillis();
public float eaglerHighPolyAnimationFloat1 = 0.0f;
@ -48,7 +60,8 @@ public abstract class AbstractClientPlayer extends EntityPlayer {
super(worldIn, playerProfile);
}
/**+
/**
* +
* Returns true if the player is in spectator mode.
*/
public boolean isSpectator() {
@ -57,7 +70,8 @@ public abstract class AbstractClientPlayer extends EntityPlayer {
return networkplayerinfo != null && networkplayerinfo.getGameType() == WorldSettings.GameType.SPECTATOR;
}
/**+
/**
* +
* Checks if this instance of AbstractClientPlayer has any
* associated player data.
*/
@ -73,7 +87,8 @@ public abstract class AbstractClientPlayer extends EntityPlayer {
return this.playerInfo;
}
/**+
/**
* +
* Returns true if the player has an associated skin.
*/
public boolean hasSkin() {
@ -81,7 +96,8 @@ public abstract class AbstractClientPlayer extends EntityPlayer {
return networkplayerinfo != null && networkplayerinfo.hasLocationSkin();
}
/**+
/**
* +
* Returns true if the username has an associated skin.
*/
public ResourceLocation getLocationSkin() {

View File

@ -1,5 +1,6 @@
package net.minecraft.client.entity;
import net.hoosiertransfer.EaglerItems;
import net.lax1dude.eaglercraft.v1_8.sp.lan.LANClientNetworkManager;
import net.lax1dude.eaglercraft.v1_8.sp.socket.ClientIntegratedServerNetworkManager;
import net.minecraft.client.Minecraft;
@ -30,6 +31,7 @@ import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemElytra;
import net.minecraft.item.ItemStack;
import net.minecraft.network.play.client.C01PacketChatMessage;
import net.minecraft.network.play.client.C03PacketPlayer;
@ -54,22 +56,31 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.world.IInteractionObject;
import net.minecraft.world.World;
/**+
/**
* +
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
*
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
* Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team
*
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights
* Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
@ -108,20 +119,23 @@ public class EntityPlayerSP extends AbstractClientPlayer {
this.statWriter = statWriter;
}
/**+
/**
* +
* Called when the entity is attacked.
*/
public boolean attackEntityFrom(DamageSource source, float amount) {
return false;
}
/**+
/**
* +
* Heal living entity (param: amount of half-hearts)
*/
public void heal(float healAmount) {
}
/**+
/**
* +
* Called when a player mounts an entity. e.g. mounts a pig,
* mounts a boat.
*/
@ -133,7 +147,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
}
/**+
/**
* +
* Called to update the entity's position/logic.
*/
public void onUpdate() {
@ -151,7 +166,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
}
}
/**+
/**
* +
* called every tick when the player is on foot. Performs all
* the things that normally happen during movement.
*/
@ -226,7 +242,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
}
/**+
/**
* +
* Called when player presses the drop item key
*/
public EntityItem dropOneItem(boolean dropAll) {
@ -238,14 +255,16 @@ public class EntityPlayerSP extends AbstractClientPlayer {
return null;
}
/**+
/**
* +
* Joins the passed in entity item with the world. Args:
* entityItem
*/
protected void joinEntityItemWithWorld(EntityItem itemIn) {
}
/**+
/**
* +
* Sends a chat message from the player. Args: chatMessage
*/
public void sendChatMessage(String message) {
@ -258,7 +277,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
}
}
/**+
/**
* +
* Swings the item the player is holding.
*/
public void swingItem() {
@ -270,7 +290,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
this.sendQueue.addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.PERFORM_RESPAWN));
}
/**+
/**
* +
* Deals damage to the entity. If its a EntityPlayer then will
* take damage from the armor first and then health second with
* the reduced value. Args: damageAmount
@ -281,7 +302,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
}
}
/**+
/**
* +
* set current crafting inventory back to the 2x2 square
*/
public void closeScreen() {
@ -295,7 +317,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
this.mc.displayGuiScreen((GuiScreen) null);
}
/**+
/**
* +
* Updates health locally.
*/
public void setPlayerSPHealth(float health) {
@ -320,7 +343,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
}
/**+
/**
* +
* Adds a value to a statistic field.
*/
public void addStat(StatBase stat, int amount) {
@ -332,14 +356,16 @@ public class EntityPlayerSP extends AbstractClientPlayer {
}
}
/**+
/**
* +
* Sends the player's abilities to the server (if there is one).
*/
public void sendPlayerAbilities() {
this.sendQueue.addToSendQueue(new C13PacketPlayerAbilities(this.capabilities));
}
/**+
/**
* +
* returns true if this is an EntityPlayerSP, or the logged in
* player.
*/
@ -424,7 +450,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
}
}
/**+
/**
* +
* Returns true if the block at the given BlockPos and the block
* above it are NOT full cubes.
*/
@ -433,7 +460,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
&& !this.worldObj.getBlockState(pos.up()).getBlock().isNormalCube();
}
/**+
/**
* +
* Set sprinting switch for Entity.
*/
public void setSprinting(boolean sprinting) {
@ -441,7 +469,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
this.sprintingTicksLeft = sprinting ? 600 : 0;
}
/**+
/**
* +
* Sets the current XP, total XP, and level number.
*/
public void setXPStats(float currentXP, int maxXP, int level) {
@ -450,14 +479,16 @@ public class EntityPlayerSP extends AbstractClientPlayer {
this.experienceLevel = level;
}
/**+
/**
* +
* Send a chat message to the CommandSender
*/
public void addChatMessage(IChatComponent ichatcomponent) {
this.mc.ingameGUI.getChatGUI().printChatMessage(ichatcomponent);
}
/**+
/**
* +
* Returns {@code true} if the CommandSender is allowed to
* execute the command, {@code false} if not
*/
@ -465,7 +496,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
return i <= 0;
}
/**+
/**
* +
* Get the position in the world. <b>{@code null} is not
* allowed!</b> If you are not an entity in the world, return
* the coordinates 0, 0, 0
@ -478,7 +510,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
this.worldObj.playSound(this.posX, this.posY, this.posZ, name, volume, pitch, false);
}
/**+
/**
* +
* Returns whether the entity is in a server world
*/
public boolean isServerWorld() {
@ -502,7 +535,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
this.mc.displayGuiScreen(new GuiCommandBlock(cmdBlockLogic));
}
/**+
/**
* +
* Displays the GUI for interacting with a book.
*/
public void displayGUIBook(ItemStack bookStack) {
@ -513,7 +547,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
}
/**+
/**
* +
* Displays the GUI for interacting with a chest inventory.
* Args: chestInventory
*/
@ -558,7 +593,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
this.mc.displayGuiScreen(new GuiMerchant(this.inventory, villager, this.worldObj));
}
/**+
/**
* +
* Called when the player performs a critical hit on the Entity.
* Args: entity that was hit critically
*/
@ -570,7 +606,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
this.mc.effectRenderer.emitParticleAtEntity(entityHit, EnumParticleTypes.CRIT_MAGIC);
}
/**+
/**
* +
* Returns if this entity is sneaking.
*/
public boolean isSneaking() {
@ -598,7 +635,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
return this.mc.getRenderViewEntity() == this;
}
/**+
/**
* +
* Called frequently so the entity can update its state every
* tick as required. For example, zombies and skeletons use this
* to react to sunlight and start to burn.
@ -707,6 +745,19 @@ public class EntityPlayerSP extends AbstractClientPlayer {
}
}
if (this.movementInput.jump && !flag && !this.onGround && this.motionY < 0.0D && !this.isElytraFlying()
&& !this.capabilities.isFlying) {
ItemStack itemstack = this.getCurrentArmor(2);
if (itemstack != null && itemstack.getItem() == EaglerItems.getEaglerItem("elytra")
&& ((ItemElytra) EaglerItems.getEaglerItem("elytra")).isBroken(itemstack)) {
this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this,
C0BPacketEntityAction.Action.START_FALL_FLYING));
// TODO Eltrya sound
// this.mc.getSoundHandler().playSound(new ElytraSound(this));
}
}
if (this.capabilities.isFlying && this.isCurrentViewEntity()) {
if (this.movementInput.sneak) {
this.motionY -= (double) (this.capabilities.getFlySpeed() * 3.0F);

View File

@ -22,6 +22,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemBow;
import net.minecraft.item.ItemElytra;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.nbt.NBTTagCompound;
@ -39,22 +40,31 @@ import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
/**+
/**
* +
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
*
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
* Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team
*
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights
* Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
@ -71,11 +81,13 @@ public abstract class EntityLiving extends EntityLivingBase {
protected final EntityAITasks targetTasks;
private EntityLivingBase attackTarget;
private EntitySenses senses;
/**+
/**
* +
* Equipment (armor and held item) for this entity.
*/
private ItemStack[] equipment = new ItemStack[5];
/**+
/**
* +
* Chances for each equipment piece from dropping when this
* entity dies.
*/
@ -109,7 +121,8 @@ public abstract class EntityLiving extends EntityLivingBase {
this.getAttributeMap().registerAttribute(SharedMonsterAttributes.followRange).setBaseValue(16.0D);
}
/**+
/**
* +
* Returns new PathNavigateGround instance
*/
protected PathNavigate getNewNavigator(World worldIn) {
@ -132,28 +145,32 @@ public abstract class EntityLiving extends EntityLivingBase {
return this.navigator;
}
/**+
/**
* +
* returns the EntitySenses Object for the EntityLiving
*/
public EntitySenses getEntitySenses() {
return this.senses;
}
/**+
/**
* +
* Gets the active target the Task system uses for tracking
*/
public EntityLivingBase getAttackTarget() {
return this.attackTarget;
}
/**+
/**
* +
* Sets the active target the Task system uses for tracking
*/
public void setAttackTarget(EntityLivingBase entitylivingbaseIn) {
this.attackTarget = entitylivingbaseIn;
}
/**+
/**
* +
* Returns true if this entity can attack entities of the
* specified class.
*/
@ -161,7 +178,8 @@ public abstract class EntityLiving extends EntityLivingBase {
return cls != EntityGhast.class;
}
/**+
/**
* +
* This function applies the benefits of growing back wool and
* faster growing up to the acting entity. (This function is
* used in the AIEatGrass)
@ -174,7 +192,8 @@ public abstract class EntityLiving extends EntityLivingBase {
this.dataWatcher.addObject(15, Byte.valueOf((byte) 0));
}
/**+
/**
* +
* Get number of ticks, at least during which the living entity
* will be silent.
*/
@ -182,7 +201,8 @@ public abstract class EntityLiving extends EntityLivingBase {
return 80;
}
/**+
/**
* +
* Plays living's sound at its position
*/
public void playLivingSound() {
@ -193,7 +213,8 @@ public abstract class EntityLiving extends EntityLivingBase {
}
/**+
/**
* +
* Gets called every tick from main Entity class
*/
public void onEntityUpdate() {
@ -207,7 +228,8 @@ public abstract class EntityLiving extends EntityLivingBase {
this.worldObj.theProfiler.endSection();
}
/**+
/**
* +
* Get the experience points the entity currently has.
*/
protected int getExperiencePoints(EntityPlayer var1) {
@ -227,7 +249,8 @@ public abstract class EntityLiving extends EntityLivingBase {
}
}
/**+
/**
* +
* Spawns an explosion particle around the Entity's location
*/
public void spawnExplosionParticle() {
@ -263,21 +286,19 @@ public abstract class EntityLiving extends EntityLivingBase {
private boolean canSkipUpdate() {
if (this.isChild()) {
return false;
}
else if (this.hurtTime > 0) {
} else if (this.hurtTime > 0) {
return false;
} else if (this.ticksExisted < 20)
{
return false;
} else {
} else if (this.ticksExisted < 20) {
return false;
} else {
World world = this.getEntityWorld();
if (world == null) {
return false;
} else if (world.playerEntities.size() != 1) {
return false ;
return false;
} else {
Entity entity = (Entity)world.playerEntities.get(0);
Entity entity = (Entity) world.playerEntities.get(0);
double d0 = Math.max(Math.abs(this.posX - entity.posX) - 16.0D, 0.0D);
double d1 = Math.max(Math.abs(this.posZ - entity.posZ) - 16.0D, 0.0D);
double d2 = d0 * d0 + d1 * d1;
@ -286,8 +307,7 @@ public abstract class EntityLiving extends EntityLivingBase {
}
}
private void onUpdateMinimal()
{
private void onUpdateMinimal() {
++this.entityAge;
if (this instanceof EntityMob) {
@ -300,7 +320,8 @@ public abstract class EntityLiving extends EntityLivingBase {
this.despawnEntity();
}
/**+
/**
* +
* Called to update the entity's position/logic.
*/
public void onUpdate() {
@ -319,7 +340,8 @@ public abstract class EntityLiving extends EntityLivingBase {
return f;
}
/**+
/**
* +
* Returns the sound this mob makes while it's alive.
*/
protected String getLivingSound() {
@ -330,7 +352,8 @@ public abstract class EntityLiving extends EntityLivingBase {
return null;
}
/**+
/**
* +
* Drop 0-2 items of this living's type
*/
protected void dropFewItems(boolean var1, int i) {
@ -348,7 +371,8 @@ public abstract class EntityLiving extends EntityLivingBase {
}
/**+
/**
* +
* (abstract) Protected helper method to write subclass entity
* data to NBT.
*/
@ -397,7 +421,8 @@ public abstract class EntityLiving extends EntityLivingBase {
}
/**+
/**
* +
* (abstract) Protected helper method to read subclass entity
* data from NBT.
*/
@ -436,7 +461,8 @@ public abstract class EntityLiving extends EntityLivingBase {
this.moveForward = parFloat1;
}
/**+
/**
* +
* set the movespeed used for the new AI system
*/
public void setAIMoveSpeed(float f) {
@ -444,7 +470,8 @@ public abstract class EntityLiving extends EntityLivingBase {
this.setMoveForward(f);
}
/**+
/**
* +
* Called frequently so the entity can update its state every
* tick as required. For example, zombies and skeletons use this
* to react to sunlight and start to burn.
@ -467,7 +494,8 @@ public abstract class EntityLiving extends EntityLivingBase {
this.worldObj.theProfiler.endSection();
}
/**+
/**
* +
* Tests if this entity should pickup a weapon or an armor.
* Entity drops current weapon or armor if the new one is
* better.
@ -538,7 +566,8 @@ public abstract class EntityLiving extends EntityLivingBase {
return true;
}
/**+
/**
* +
* Determines if an entity can be despawned, used on idle far
* away entities
*/
@ -546,7 +575,8 @@ public abstract class EntityLiving extends EntityLivingBase {
return true;
}
/**+
/**
* +
* Makes the entity despawn if requirements are reached
*/
protected void despawnEntity() {
@ -607,7 +637,8 @@ public abstract class EntityLiving extends EntityLivingBase {
protected void updateAITasks() {
}
/**+
/**
* +
* The speed it takes to move the entityliving's rotationPitch
* through the faceEntity method. This is only currently use in
* wolves.
@ -616,7 +647,8 @@ public abstract class EntityLiving extends EntityLivingBase {
return 40;
}
/**+
/**
* +
* Changes pitch and yaw so that the entity calling the function
* is facing the entity provided as an argument.
*/
@ -640,7 +672,8 @@ public abstract class EntityLiving extends EntityLivingBase {
this.rotationYaw = this.updateRotation(this.rotationYaw, f, parFloat1);
}
/**+
/**
* +
* Arguments: current rotation, intended rotation, max
* increment.
*/
@ -657,7 +690,8 @@ public abstract class EntityLiving extends EntityLivingBase {
return parFloat1 + f;
}
/**+
/**
* +
* Checks if the entity's current position is a valid location
* to spawn this entity.
*/
@ -665,7 +699,8 @@ public abstract class EntityLiving extends EntityLivingBase {
return true;
}
/**+
/**
* +
* Checks that the entity is not colliding with any blocks /
* liquids
*/
@ -675,21 +710,24 @@ public abstract class EntityLiving extends EntityLivingBase {
&& !this.worldObj.isAnyLiquid(this.getEntityBoundingBox());
}
/**+
/**
* +
* Returns render size modifier
*/
public float getRenderSizeModifier() {
return 1.0F;
}
/**+
/**
* +
* Will return how many at most can spawn in a chunk at once.
*/
public int getMaxSpawnedInChunk() {
return 4;
}
/**+
/**
* +
* The maximum height from where the entity is alowed to jump
* (used in pathfinder)
*/
@ -707,14 +745,16 @@ public abstract class EntityLiving extends EntityLivingBase {
}
}
/**+
/**
* +
* Returns the item that this EntityLiving is holding, if any.
*/
public ItemStack getHeldItem() {
return this.equipment[0];
}
/**+
/**
* +
* 0: Tool in Hand; 1-4: Armor
*/
public ItemStack getEquipmentInSlot(int i) {
@ -725,7 +765,8 @@ public abstract class EntityLiving extends EntityLivingBase {
return this.equipment[i + 1];
}
/**+
/**
* +
* Sets the held item, or an armor slot. Slot 0 is held item.
* Slot 1-4 is armor. Params: Item, slot
*/
@ -733,7 +774,8 @@ public abstract class EntityLiving extends EntityLivingBase {
this.equipment[i] = itemstack;
}
/**+
/**
* +
* returns the inventory of this entity (only used in
* EntityPlayerMP it seems)
*/
@ -741,7 +783,8 @@ public abstract class EntityLiving extends EntityLivingBase {
return this.equipment;
}
/**+
/**
* +
* Drop the equipment for this entity.
*/
protected void dropEquipment(boolean flag, int i) {
@ -770,7 +813,8 @@ public abstract class EntityLiving extends EntityLivingBase {
}
/**+
/**
* +
* Gives armor or weapon for entity based on given
* DifficultyInstance
*/
@ -811,83 +855,89 @@ public abstract class EntityLiving extends EntityLivingBase {
if (stack.getItem() != Item.getItemFromBlock(Blocks.pumpkin) && stack.getItem() != Items.skull) {
if (stack.getItem() instanceof ItemArmor) {
switch (((ItemArmor) stack.getItem()).armorType) {
case 0:
return 4;
case 1:
return 3;
case 2:
return 2;
case 3:
return 1;
case 0:
return 4;
case 1:
return 3;
case 2:
return 2;
case 3:
return 1;
}
}
if (stack.getItem() instanceof ItemElytra) {
return 3;
}
return 0;
} else {
return 4;
}
}
/**+
/**
* +
* Gets the vanilla armor Item that can go in the slot specified
* for the given tier.
*/
public static Item getArmorItemForSlot(int armorSlot, int itemTier) {
switch (armorSlot) {
case 4:
if (itemTier == 0) {
return Items.leather_helmet;
} else if (itemTier == 1) {
return Items.golden_helmet;
} else if (itemTier == 2) {
return Items.chainmail_helmet;
} else if (itemTier == 3) {
return Items.iron_helmet;
} else if (itemTier == 4) {
return Items.diamond_helmet;
}
case 3:
if (itemTier == 0) {
return Items.leather_chestplate;
} else if (itemTier == 1) {
return Items.golden_chestplate;
} else if (itemTier == 2) {
return Items.chainmail_chestplate;
} else if (itemTier == 3) {
return Items.iron_chestplate;
} else if (itemTier == 4) {
return Items.diamond_chestplate;
}
case 2:
if (itemTier == 0) {
return Items.leather_leggings;
} else if (itemTier == 1) {
return Items.golden_leggings;
} else if (itemTier == 2) {
return Items.chainmail_leggings;
} else if (itemTier == 3) {
return Items.iron_leggings;
} else if (itemTier == 4) {
return Items.diamond_leggings;
}
case 1:
if (itemTier == 0) {
return Items.leather_boots;
} else if (itemTier == 1) {
return Items.golden_boots;
} else if (itemTier == 2) {
return Items.chainmail_boots;
} else if (itemTier == 3) {
return Items.iron_boots;
} else if (itemTier == 4) {
return Items.diamond_boots;
}
default:
return null;
case 4:
if (itemTier == 0) {
return Items.leather_helmet;
} else if (itemTier == 1) {
return Items.golden_helmet;
} else if (itemTier == 2) {
return Items.chainmail_helmet;
} else if (itemTier == 3) {
return Items.iron_helmet;
} else if (itemTier == 4) {
return Items.diamond_helmet;
}
case 3:
if (itemTier == 0) {
return Items.leather_chestplate;
} else if (itemTier == 1) {
return Items.golden_chestplate;
} else if (itemTier == 2) {
return Items.chainmail_chestplate;
} else if (itemTier == 3) {
return Items.iron_chestplate;
} else if (itemTier == 4) {
return Items.diamond_chestplate;
}
case 2:
if (itemTier == 0) {
return Items.leather_leggings;
} else if (itemTier == 1) {
return Items.golden_leggings;
} else if (itemTier == 2) {
return Items.chainmail_leggings;
} else if (itemTier == 3) {
return Items.iron_leggings;
} else if (itemTier == 4) {
return Items.diamond_leggings;
}
case 1:
if (itemTier == 0) {
return Items.leather_boots;
} else if (itemTier == 1) {
return Items.golden_boots;
} else if (itemTier == 2) {
return Items.chainmail_boots;
} else if (itemTier == 3) {
return Items.iron_boots;
} else if (itemTier == 4) {
return Items.diamond_boots;
}
default:
return null;
}
}
/**+
/**
* +
* Enchants Entity's current equipments based on given
* DifficultyInstance
*/
@ -908,7 +958,8 @@ public abstract class EntityLiving extends EntityLivingBase {
}
/**+
/**
* +
* Called only once on an entity when first time spawned, via
* egg, mob spawner, natural spawning etc, but not called when
* entity is reloaded from nbt. Mainly used for initializing
@ -920,7 +971,8 @@ public abstract class EntityLiving extends EntityLivingBase {
return livingdata;
}
/**+
/**
* +
* returns true if all the conditions for steering the entity
* are met. For pigs, this is true if it is being ridden by a
* player and the player is holding a carrot-on-a-stick
@ -929,7 +981,8 @@ public abstract class EntityLiving extends EntityLivingBase {
return false;
}
/**+
/**
* +
* Enable the Entity persistence
*/
public void enablePersistence() {
@ -952,7 +1005,8 @@ public abstract class EntityLiving extends EntityLivingBase {
return this.persistenceRequired;
}
/**+
/**
* +
* First layer of player interaction
*/
public final boolean interactFirst(EntityPlayer entityplayer) {
@ -983,7 +1037,8 @@ public abstract class EntityLiving extends EntityLivingBase {
}
}
/**+
/**
* +
* Called when a player interacts with a mob. e.g. gets milk
* from a cow, gets into the saddle on a pig.
*/
@ -991,7 +1046,8 @@ public abstract class EntityLiving extends EntityLivingBase {
return false;
}
/**+
/**
* +
* Applies logic related to leashes, for example dragging the
* entity or breaking the leash.
*/
@ -1011,7 +1067,8 @@ public abstract class EntityLiving extends EntityLivingBase {
}
}
/**+
/**
* +
* Removes the leash from this entity
*/
public void clearLeashed(boolean sendPacket, boolean dropLead) {
@ -1042,7 +1099,8 @@ public abstract class EntityLiving extends EntityLivingBase {
return this.leashedToEntity;
}
/**+
/**
* +
* Sets the entity to be leashed to.
*/
public void setLeashedToEntity(Entity entityIn, boolean sendAttachNotification) {
@ -1108,21 +1166,24 @@ public abstract class EntityLiving extends EntityLivingBase {
}
}
/**+
/**
* +
* Returns whether the entity is in a server world
*/
public boolean isServerWorld() {
return super.isServerWorld() && !this.isAIDisabled();
}
/**+
/**
* +
* Set whether this Entity's AI is disabled
*/
public void setNoAI(boolean disable) {
this.dataWatcher.updateObject(15, Byte.valueOf((byte) (disable ? 1 : 0)));
}
/**+
/**
* +
* Get whether this Entity's AI is disabled
*/
public boolean isAIDisabled() {

View File

@ -1242,6 +1242,19 @@ public abstract class EntityLivingBase extends Entity {
return this.attributeMap;
}
public boolean isElytraFlying() {
return this.getFlag(7);
}
public void setElytraFlying() {
this.setFlag(7, true);
}
public void clearElytraFlying() {
this.setFlag(7, true);
this.setFlag(7, false);
}
/**
* +
* Get this Entity's EnumCreatureAttribute

View File

@ -1109,6 +1109,7 @@ public class Item {
(new ItemSeeds(EaglerItems.getEaglerBlock("beetroots"), Blocks.farmland))
.setUnlocalizedName("beetroot_seeds"));
registerEaglerItem(436, "beetroot_soup", (new ItemSoup(6)).setUnlocalizedName("beetroot_soup"));
registerEaglerItem(443, "elytra", (new ItemElytra()).setUnlocalizedName("elytra"));
}
/**

View File

@ -0,0 +1,41 @@
package net.minecraft.item;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.world.World;
public class ItemElytra extends Item {
public ItemElytra() {
this.maxStackSize = 1;
this.setMaxDamage(432);
this.setCreativeTab(CreativeTabs.tabTransport);
// this.addPropertyOverride(new ResourceLocation("broken"), new
// IItemPropertyGetter() {
// public float apply(ItemStack stack, @Nullable World worldIn, @Nullable
// EntityLivingBase entityIn) {
// return ItemElytra.isBroken(stack) ? 0.0F : 1.0F;
// }
// });
}
public boolean isBroken(ItemStack stack) {
return stack.getItemDamage() < stack.getMaxDamage() - 1;
}
public boolean getIsRepairable(ItemStack toRepair, ItemStack repair) {
return repair.getItem() == Items.leather;
}
public ItemStack onItemRightClick(ItemStack itemstack, World var2, EntityPlayer entityplayer) {
int i = EntityLiving.getArmorPosition(itemstack) - 1;
ItemStack itemstack1 = entityplayer.getCurrentArmor(i);
if (itemstack1 == null) {
entityplayer.setCurrentItemOrArmor(i, itemstack.copy());
itemstack.stackSize = 0;
}
return itemstack;
}
}

View File

@ -33,6 +33,7 @@ import net.minecraft.inventory.ContainerRepair;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemEditableBook;
import net.minecraft.item.ItemElytra;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemWritableBook;
import net.minecraft.nbt.NBTTagCompound;
@ -93,25 +94,36 @@ import net.lax1dude.eaglercraft.v1_8.sp.server.socket.IntegratedServerPlayerNetw
import net.lax1dude.eaglercraft.v1_8.sp.server.voice.IntegratedVoiceService;
import org.apache.commons.lang3.StringUtils;
import net.hoosiertransfer.EaglerItems;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
/**+
/**
* +
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
*
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
* Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team
*
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights
* Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
@ -147,7 +159,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
playerIn.playerNetServerHandler = this;
}
/**+
/**
* +
* Like the old updateEntity(), except more generic.
*/
public void update() {
@ -182,7 +195,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
return this.netManager;
}
/**+
/**
* +
* Kick a player from the server with a reason
*/
public void kickPlayerFromServer(String reason) {
@ -191,7 +205,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
this.netManager.closeChannel(chatcomponenttext);
}
/**+
/**
* +
* Processes player movement input. Includes walking, strafing,
* jumping, sneaking; excludes riding and toggling
* flying/sprinting
@ -208,7 +223,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|| !Floats.isFinite(parC03PacketPlayer.getPitch()) || !Floats.isFinite(parC03PacketPlayer.getYaw());
}
/**+
/**
* +
* Processes clients perspective on player positioning and/or
* orientation
*/
@ -440,7 +456,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
.sendPacket(new S08PacketPlayerPosLook(x, y, z, yaw, pitch, relativeSet));
}
/**+
/**
* +
* Processes the player initiating/stopping digging on a
* particular spot, as well as a player dropping items?. (0:
* initiated, 1: reinitiated, 2? , 3-4 drop item (respectively
@ -452,64 +469,65 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
BlockPos blockpos = c07packetplayerdigging.getPosition();
this.playerEntity.markPlayerActive();
switch (c07packetplayerdigging.getStatus()) {
case DROP_ITEM:
if (!this.playerEntity.isSpectator()) {
this.playerEntity.dropOneItem(false);
}
return;
case DROP_ALL_ITEMS:
if (!this.playerEntity.isSpectator()) {
this.playerEntity.dropOneItem(true);
}
return;
case RELEASE_USE_ITEM:
this.playerEntity.stopUsingItem();
return;
case START_DESTROY_BLOCK:
case ABORT_DESTROY_BLOCK:
case STOP_DESTROY_BLOCK:
double d0 = this.playerEntity.posX - ((double) blockpos.getX() + 0.5D);
double d1 = this.playerEntity.posY - ((double) blockpos.getY() + 0.5D) + 1.5D;
double d2 = this.playerEntity.posZ - ((double) blockpos.getZ() + 0.5D);
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
if (d3 > 36.0D) {
return;
} else if (blockpos.getY() >= this.serverController.getBuildLimit()) {
return;
} else {
if (c07packetplayerdigging.getStatus() == C07PacketPlayerDigging.Action.START_DESTROY_BLOCK) {
if (!this.serverController.isBlockProtected(worldserver, blockpos, this.playerEntity)
&& worldserver.getWorldBorder().contains(blockpos)) {
this.playerEntity.theItemInWorldManager.onBlockClicked(blockpos,
c07packetplayerdigging.getFacing());
} else {
this.playerEntity.playerNetServerHandler
.sendPacket(new S23PacketBlockChange(worldserver, blockpos));
}
} else {
if (c07packetplayerdigging.getStatus() == C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK) {
this.playerEntity.theItemInWorldManager.blockRemoving(blockpos);
} else if (c07packetplayerdigging
.getStatus() == C07PacketPlayerDigging.Action.ABORT_DESTROY_BLOCK) {
this.playerEntity.theItemInWorldManager.cancelDestroyingBlock();
}
if (worldserver.getBlockState(blockpos).getBlock().getMaterial() != Material.air) {
this.playerEntity.playerNetServerHandler
.sendPacket(new S23PacketBlockChange(worldserver, blockpos));
}
case DROP_ITEM:
if (!this.playerEntity.isSpectator()) {
this.playerEntity.dropOneItem(false);
}
return;
}
default:
throw new IllegalArgumentException("Invalid player action");
case DROP_ALL_ITEMS:
if (!this.playerEntity.isSpectator()) {
this.playerEntity.dropOneItem(true);
}
return;
case RELEASE_USE_ITEM:
this.playerEntity.stopUsingItem();
return;
case START_DESTROY_BLOCK:
case ABORT_DESTROY_BLOCK:
case STOP_DESTROY_BLOCK:
double d0 = this.playerEntity.posX - ((double) blockpos.getX() + 0.5D);
double d1 = this.playerEntity.posY - ((double) blockpos.getY() + 0.5D) + 1.5D;
double d2 = this.playerEntity.posZ - ((double) blockpos.getZ() + 0.5D);
double d3 = d0 * d0 + d1 * d1 + d2 * d2;
if (d3 > 36.0D) {
return;
} else if (blockpos.getY() >= this.serverController.getBuildLimit()) {
return;
} else {
if (c07packetplayerdigging.getStatus() == C07PacketPlayerDigging.Action.START_DESTROY_BLOCK) {
if (!this.serverController.isBlockProtected(worldserver, blockpos, this.playerEntity)
&& worldserver.getWorldBorder().contains(blockpos)) {
this.playerEntity.theItemInWorldManager.onBlockClicked(blockpos,
c07packetplayerdigging.getFacing());
} else {
this.playerEntity.playerNetServerHandler
.sendPacket(new S23PacketBlockChange(worldserver, blockpos));
}
} else {
if (c07packetplayerdigging.getStatus() == C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK) {
this.playerEntity.theItemInWorldManager.blockRemoving(blockpos);
} else if (c07packetplayerdigging
.getStatus() == C07PacketPlayerDigging.Action.ABORT_DESTROY_BLOCK) {
this.playerEntity.theItemInWorldManager.cancelDestroyingBlock();
}
if (worldserver.getBlockState(blockpos).getBlock().getMaterial() != Material.air) {
this.playerEntity.playerNetServerHandler
.sendPacket(new S23PacketBlockChange(worldserver, blockpos));
}
}
return;
}
default:
throw new IllegalArgumentException("Invalid player action");
}
}
/**+
/**
* +
* Processes block placement and block activation (anvil,
* furnace, etc.)
*/
@ -630,7 +648,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
public void handleResourcePackStatus(C19PacketResourcePackStatus var1) {
}
/**+
/**
* +
* Invoked when disconnecting, the parameter is a ChatComponent
* describing the reason for termination
*/
@ -679,7 +698,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
}
}
/**+
/**
* +
* Updates which quickbar slot is selected
*/
public void processHeldItemChange(C09PacketHeldItemChange c09packethelditemchange) {
@ -692,7 +712,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
}
}
/**+
/**
* +
* Process chat messages (broadcast back to clients) and
* commands (executes)
*/
@ -735,7 +756,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
}
}
/**+
/**
* +
* Handle commands that start with a /
*/
private void handleSlashCommand(String command) {
@ -747,7 +769,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
this.playerEntity.swingItem();
}
/**+
/**
* +
* Processes a range of action-types: sneaking, sprinting,
* waking from sleep, opening the inventory or setting jump
* height of the horse the player is riding
@ -755,39 +778,53 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
public void processEntityAction(C0BPacketEntityAction c0bpacketentityaction) {
this.playerEntity.markPlayerActive();
switch (c0bpacketentityaction.getAction()) {
case START_SNEAKING:
this.playerEntity.setSneaking(true);
break;
case STOP_SNEAKING:
this.playerEntity.setSneaking(false);
break;
case START_SPRINTING:
this.playerEntity.setSprinting(true);
break;
case STOP_SPRINTING:
this.playerEntity.setSprinting(false);
break;
case STOP_SLEEPING:
this.playerEntity.wakeUpPlayer(false, true, true);
this.hasMoved = false;
break;
case RIDING_JUMP:
if (this.playerEntity.ridingEntity instanceof EntityHorse) {
((EntityHorse) this.playerEntity.ridingEntity).setJumpPower(c0bpacketentityaction.getAuxData());
}
break;
case OPEN_INVENTORY:
if (this.playerEntity.ridingEntity instanceof EntityHorse) {
((EntityHorse) this.playerEntity.ridingEntity).openGUI(this.playerEntity);
}
break;
default:
throw new IllegalArgumentException("Invalid client command!");
case START_SNEAKING:
this.playerEntity.setSneaking(true);
break;
case STOP_SNEAKING:
this.playerEntity.setSneaking(false);
break;
case START_SPRINTING:
this.playerEntity.setSprinting(true);
break;
case STOP_SPRINTING:
this.playerEntity.setSprinting(false);
break;
case STOP_SLEEPING:
this.playerEntity.wakeUpPlayer(false, true, true);
this.hasMoved = false;
break;
case RIDING_JUMP:
if (this.playerEntity.ridingEntity instanceof EntityHorse) {
((EntityHorse) this.playerEntity.ridingEntity).setJumpPower(c0bpacketentityaction.getAuxData());
}
break;
case OPEN_INVENTORY:
if (this.playerEntity.ridingEntity instanceof EntityHorse) {
((EntityHorse) this.playerEntity.ridingEntity).openGUI(this.playerEntity);
}
break;
case START_FALL_FLYING:
if (!this.playerEntity.onGround && this.playerEntity.motionY < 0.0D
&& !this.playerEntity.isElytraFlying() && !this.playerEntity.isInWater()) {
ItemStack itemstack = this.playerEntity.getCurrentArmor(2);
if (itemstack != null && itemstack.getItem() == EaglerItems.getEaglerItem("elytra")
&& ((ItemElytra) EaglerItems.getEaglerItem("elytra")).isBroken(itemstack)) {
this.playerEntity.setElytraFlying();
}
} else {
this.playerEntity.clearElytraFlying();
}
break;
default:
throw new IllegalArgumentException("Invalid client command!");
}
}
/**+
/**
* +
* Processes interactions ((un)leashing, opening command block
* GUI) and attacks on an entity with players currently equipped
* item
@ -824,7 +861,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
}
/**+
/**
* +
* Processes the client status updates: respawn attempt from
* player, opening statistics or achievements, or acquiring
* 'open inventory' achievement
@ -833,46 +871,48 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
this.playerEntity.markPlayerActive();
C16PacketClientStatus.EnumState c16packetclientstatus$enumstate = c16packetclientstatus.getStatus();
switch (c16packetclientstatus$enumstate) {
case PERFORM_RESPAWN:
if (this.playerEntity.playerConqueredTheEnd) {
this.playerEntity = this.serverController.getConfigurationManager()
.recreatePlayerEntity(this.playerEntity, 0, true);
} else if (this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled()) {
if (this.serverController.isSinglePlayer()
&& this.playerEntity.getName().equals(this.serverController.getServerOwner())) {
this.playerEntity.playerNetServerHandler
.kickPlayerFromServer("You have died. Game over, man, it\'s game over!");
this.serverController.deleteWorldAndStopServer();
case PERFORM_RESPAWN:
if (this.playerEntity.playerConqueredTheEnd) {
this.playerEntity = this.serverController.getConfigurationManager()
.recreatePlayerEntity(this.playerEntity, 0, true);
} else if (this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled()) {
if (this.serverController.isSinglePlayer()
&& this.playerEntity.getName().equals(this.serverController.getServerOwner())) {
this.playerEntity.playerNetServerHandler
.kickPlayerFromServer("You have died. Game over, man, it\'s game over!");
this.serverController.deleteWorldAndStopServer();
} else {
this.playerEntity.playerNetServerHandler
.kickPlayerFromServer("You have died. Game over, man, it\'s game over!");
}
} else {
this.playerEntity.playerNetServerHandler
.kickPlayerFromServer("You have died. Game over, man, it\'s game over!");
}
} else {
if (this.playerEntity.getHealth() > 0.0F) {
return;
}
if (this.playerEntity.getHealth() > 0.0F) {
return;
}
this.playerEntity = this.serverController.getConfigurationManager()
.recreatePlayerEntity(this.playerEntity, 0, false);
}
break;
case REQUEST_STATS:
this.playerEntity.getStatFile().func_150876_a(this.playerEntity);
break;
case OPEN_INVENTORY_ACHIEVEMENT:
this.playerEntity.triggerAchievement(AchievementList.openInventory);
this.playerEntity = this.serverController.getConfigurationManager()
.recreatePlayerEntity(this.playerEntity, 0, false);
}
break;
case REQUEST_STATS:
this.playerEntity.getStatFile().func_150876_a(this.playerEntity);
break;
case OPEN_INVENTORY_ACHIEVEMENT:
this.playerEntity.triggerAchievement(AchievementList.openInventory);
}
}
/**+
/**
* +
* Processes the client closing windows (container)
*/
public void processCloseWindow(C0DPacketCloseWindow c0dpacketclosewindow) {
this.playerEntity.closeContainer();
}
/**+
/**
* +
* Executes a container/inventory slot manipulation as indicated
* by the packet. Sends the serverside result if they didn't
* match the indicated result and prevents further manipulation
@ -920,7 +960,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
}
/**+
/**
* +
* Enchants the item identified by the packet given some
* convoluted conditions (matching window, which
* should/shouldn't be in use?)
@ -935,7 +976,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
}
/**+
/**
* +
* Update the server with an ItemStack in a slot.
*/
public void processCreativeInventoryAction(C10PacketCreativeInventoryAction c10packetcreativeinventoryaction) {
@ -986,7 +1028,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
}
/**+
/**
* +
* Received in response to the server requesting to confirm that
* the client-side open container matches the servers' after a
* mismatched container-slot manipulation. It will unlock the
@ -1037,7 +1080,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
}
/**+
/**
* +
* Updates a players' ping statistics
*/
public void processKeepAlive(C00PacketKeepAlive c00packetkeepalive) {
@ -1052,7 +1096,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
return System.nanoTime() / 1000000L;
}
/**+
/**
* +
* Processes a player starting/stopping flying
*/
public void processPlayerAbilities(C13PacketPlayerAbilities c13packetplayerabilities) {
@ -1060,7 +1105,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
&& this.playerEntity.capabilities.allowFlying;
}
/**+
/**
* +
* Retrieves possible tab completions for the requested command
* string and sends them to the client
*/
@ -1075,7 +1121,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
this.playerEntity.playerNetServerHandler.sendPacket(new S3APacketTabComplete(fuckOff));
}
/**+
/**
* +
* Updates serverside copy of client settings: language, render
* distance, chat visibility, chat colours, difficulty, and
* whether to show the cape
@ -1084,7 +1131,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
this.playerEntity.handleClientSettings(c15packetclientsettings);
}
/**+
/**
* +
* Synchronizes serverside and clientside book contents and
* signing
*/

View File

@ -7,22 +7,31 @@ import net.minecraft.network.Packet;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.INetHandlerPlayServer;
/**+
/**
* +
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
*
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
* Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team
*
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
* EaglercraftX 1.8 patch files (c) 2022-2024 lax1dude, ayunami2000. All Rights
* Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
@ -45,7 +54,8 @@ public class C0BPacketEntityAction implements Packet<INetHandlerPlayServer> {
this.auxData = auxData;
}
/**+
/**
* +
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer parPacketBuffer) throws IOException {
@ -54,7 +64,8 @@ public class C0BPacketEntityAction implements Packet<INetHandlerPlayServer> {
this.auxData = parPacketBuffer.readVarIntFromBuffer();
}
/**+
/**
* +
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer parPacketBuffer) throws IOException {
@ -63,7 +74,8 @@ public class C0BPacketEntityAction implements Packet<INetHandlerPlayServer> {
parPacketBuffer.writeVarIntToBuffer(this.auxData);
}
/**+
/**
* +
* Passes this Packet on to the NetHandler for processing.
*/
public void processPacket(INetHandlerPlayServer inethandlerplayserver) {
@ -79,6 +91,8 @@ public class C0BPacketEntityAction implements Packet<INetHandlerPlayServer> {
}
public static enum Action {
START_SNEAKING, STOP_SNEAKING, STOP_SLEEPING, START_SPRINTING, STOP_SPRINTING, RIDING_JUMP, OPEN_INVENTORY;
START_SNEAKING, STOP_SNEAKING, STOP_SLEEPING, START_SPRINTING, STOP_SPRINTING, RIDING_JUMP, OPEN_INVENTORY,
NOTHING,
START_FALL_FLYING;
}
}