switc
This commit is contained in:
parent
7b232a057e
commit
758b466d8e
95737
javascript/classes.js
95737
javascript/classes.js
File diff suppressed because it is too large
Load Diff
|
@ -13,28 +13,40 @@ import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldSettings;
|
import net.minecraft.world.WorldSettings;
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||||
*
|
*
|
||||||
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
|
* 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
|
* 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
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (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
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractClientPlayer extends EntityPlayer {
|
public abstract class AbstractClientPlayer extends EntityPlayer {
|
||||||
private NetworkPlayerInfo playerInfo;
|
private NetworkPlayerInfo playerInfo;
|
||||||
|
public float rotateElytraX;
|
||||||
|
public float rotateElytraY;
|
||||||
|
public float rotateElytraZ;
|
||||||
|
|
||||||
public long eaglerHighPolyAnimationTick = System.currentTimeMillis();
|
public long eaglerHighPolyAnimationTick = System.currentTimeMillis();
|
||||||
public float eaglerHighPolyAnimationFloat1 = 0.0f;
|
public float eaglerHighPolyAnimationFloat1 = 0.0f;
|
||||||
|
@ -48,7 +60,8 @@ public abstract class AbstractClientPlayer extends EntityPlayer {
|
||||||
super(worldIn, playerProfile);
|
super(worldIn, playerProfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Returns true if the player is in spectator mode.
|
* Returns true if the player is in spectator mode.
|
||||||
*/
|
*/
|
||||||
public boolean isSpectator() {
|
public boolean isSpectator() {
|
||||||
|
@ -57,7 +70,8 @@ public abstract class AbstractClientPlayer extends EntityPlayer {
|
||||||
return networkplayerinfo != null && networkplayerinfo.getGameType() == WorldSettings.GameType.SPECTATOR;
|
return networkplayerinfo != null && networkplayerinfo.getGameType() == WorldSettings.GameType.SPECTATOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Checks if this instance of AbstractClientPlayer has any
|
* Checks if this instance of AbstractClientPlayer has any
|
||||||
* associated player data.
|
* associated player data.
|
||||||
*/
|
*/
|
||||||
|
@ -73,7 +87,8 @@ public abstract class AbstractClientPlayer extends EntityPlayer {
|
||||||
return this.playerInfo;
|
return this.playerInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Returns true if the player has an associated skin.
|
* Returns true if the player has an associated skin.
|
||||||
*/
|
*/
|
||||||
public boolean hasSkin() {
|
public boolean hasSkin() {
|
||||||
|
@ -81,7 +96,8 @@ public abstract class AbstractClientPlayer extends EntityPlayer {
|
||||||
return networkplayerinfo != null && networkplayerinfo.hasLocationSkin();
|
return networkplayerinfo != null && networkplayerinfo.hasLocationSkin();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Returns true if the username has an associated skin.
|
* Returns true if the username has an associated skin.
|
||||||
*/
|
*/
|
||||||
public ResourceLocation getLocationSkin() {
|
public ResourceLocation getLocationSkin() {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package net.minecraft.client.entity;
|
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.lan.LANClientNetworkManager;
|
||||||
import net.lax1dude.eaglercraft.v1_8.sp.socket.ClientIntegratedServerNetworkManager;
|
import net.lax1dude.eaglercraft.v1_8.sp.socket.ClientIntegratedServerNetworkManager;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
@ -30,6 +31,7 @@ import net.minecraft.entity.passive.EntityHorse;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemElytra;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.network.play.client.C01PacketChatMessage;
|
import net.minecraft.network.play.client.C01PacketChatMessage;
|
||||||
import net.minecraft.network.play.client.C03PacketPlayer;
|
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.IInteractionObject;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||||
*
|
*
|
||||||
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
|
* 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
|
* 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
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (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
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -108,20 +119,23 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
this.statWriter = statWriter;
|
this.statWriter = statWriter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Called when the entity is attacked.
|
* Called when the entity is attacked.
|
||||||
*/
|
*/
|
||||||
public boolean attackEntityFrom(DamageSource source, float amount) {
|
public boolean attackEntityFrom(DamageSource source, float amount) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Heal living entity (param: amount of half-hearts)
|
* Heal living entity (param: amount of half-hearts)
|
||||||
*/
|
*/
|
||||||
public void heal(float healAmount) {
|
public void heal(float healAmount) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Called when a player mounts an entity. e.g. mounts a pig,
|
* Called when a player mounts an entity. e.g. mounts a pig,
|
||||||
* mounts a boat.
|
* mounts a boat.
|
||||||
*/
|
*/
|
||||||
|
@ -133,7 +147,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Called to update the entity's position/logic.
|
* Called to update the entity's position/logic.
|
||||||
*/
|
*/
|
||||||
public void onUpdate() {
|
public void onUpdate() {
|
||||||
|
@ -151,7 +166,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* called every tick when the player is on foot. Performs all
|
* called every tick when the player is on foot. Performs all
|
||||||
* the things that normally happen during movement.
|
* the things that normally happen during movement.
|
||||||
*/
|
*/
|
||||||
|
@ -226,7 +242,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Called when player presses the drop item key
|
* Called when player presses the drop item key
|
||||||
*/
|
*/
|
||||||
public EntityItem dropOneItem(boolean dropAll) {
|
public EntityItem dropOneItem(boolean dropAll) {
|
||||||
|
@ -238,14 +255,16 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Joins the passed in entity item with the world. Args:
|
* Joins the passed in entity item with the world. Args:
|
||||||
* entityItem
|
* entityItem
|
||||||
*/
|
*/
|
||||||
protected void joinEntityItemWithWorld(EntityItem itemIn) {
|
protected void joinEntityItemWithWorld(EntityItem itemIn) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Sends a chat message from the player. Args: chatMessage
|
* Sends a chat message from the player. Args: chatMessage
|
||||||
*/
|
*/
|
||||||
public void sendChatMessage(String message) {
|
public void sendChatMessage(String message) {
|
||||||
|
@ -258,7 +277,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Swings the item the player is holding.
|
* Swings the item the player is holding.
|
||||||
*/
|
*/
|
||||||
public void swingItem() {
|
public void swingItem() {
|
||||||
|
@ -270,7 +290,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
this.sendQueue.addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.PERFORM_RESPAWN));
|
this.sendQueue.addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.PERFORM_RESPAWN));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Deals damage to the entity. If its a EntityPlayer then will
|
* Deals damage to the entity. If its a EntityPlayer then will
|
||||||
* take damage from the armor first and then health second with
|
* take damage from the armor first and then health second with
|
||||||
* the reduced value. Args: damageAmount
|
* the reduced value. Args: damageAmount
|
||||||
|
@ -281,7 +302,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* set current crafting inventory back to the 2x2 square
|
* set current crafting inventory back to the 2x2 square
|
||||||
*/
|
*/
|
||||||
public void closeScreen() {
|
public void closeScreen() {
|
||||||
|
@ -295,7 +317,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
this.mc.displayGuiScreen((GuiScreen) null);
|
this.mc.displayGuiScreen((GuiScreen) null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Updates health locally.
|
* Updates health locally.
|
||||||
*/
|
*/
|
||||||
public void setPlayerSPHealth(float health) {
|
public void setPlayerSPHealth(float health) {
|
||||||
|
@ -320,7 +343,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Adds a value to a statistic field.
|
* Adds a value to a statistic field.
|
||||||
*/
|
*/
|
||||||
public void addStat(StatBase stat, int amount) {
|
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).
|
* Sends the player's abilities to the server (if there is one).
|
||||||
*/
|
*/
|
||||||
public void sendPlayerAbilities() {
|
public void sendPlayerAbilities() {
|
||||||
this.sendQueue.addToSendQueue(new C13PacketPlayerAbilities(this.capabilities));
|
this.sendQueue.addToSendQueue(new C13PacketPlayerAbilities(this.capabilities));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* returns true if this is an EntityPlayerSP, or the logged in
|
* returns true if this is an EntityPlayerSP, or the logged in
|
||||||
* player.
|
* player.
|
||||||
*/
|
*/
|
||||||
|
@ -424,7 +450,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Returns true if the block at the given BlockPos and the block
|
* Returns true if the block at the given BlockPos and the block
|
||||||
* above it are NOT full cubes.
|
* above it are NOT full cubes.
|
||||||
*/
|
*/
|
||||||
|
@ -433,7 +460,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
&& !this.worldObj.getBlockState(pos.up()).getBlock().isNormalCube();
|
&& !this.worldObj.getBlockState(pos.up()).getBlock().isNormalCube();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Set sprinting switch for Entity.
|
* Set sprinting switch for Entity.
|
||||||
*/
|
*/
|
||||||
public void setSprinting(boolean sprinting) {
|
public void setSprinting(boolean sprinting) {
|
||||||
|
@ -441,7 +469,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
this.sprintingTicksLeft = sprinting ? 600 : 0;
|
this.sprintingTicksLeft = sprinting ? 600 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Sets the current XP, total XP, and level number.
|
* Sets the current XP, total XP, and level number.
|
||||||
*/
|
*/
|
||||||
public void setXPStats(float currentXP, int maxXP, int level) {
|
public void setXPStats(float currentXP, int maxXP, int level) {
|
||||||
|
@ -450,14 +479,16 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
this.experienceLevel = level;
|
this.experienceLevel = level;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Send a chat message to the CommandSender
|
* Send a chat message to the CommandSender
|
||||||
*/
|
*/
|
||||||
public void addChatMessage(IChatComponent ichatcomponent) {
|
public void addChatMessage(IChatComponent ichatcomponent) {
|
||||||
this.mc.ingameGUI.getChatGUI().printChatMessage(ichatcomponent);
|
this.mc.ingameGUI.getChatGUI().printChatMessage(ichatcomponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Returns {@code true} if the CommandSender is allowed to
|
* Returns {@code true} if the CommandSender is allowed to
|
||||||
* execute the command, {@code false} if not
|
* execute the command, {@code false} if not
|
||||||
*/
|
*/
|
||||||
|
@ -465,7 +496,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
return i <= 0;
|
return i <= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Get the position in the world. <b>{@code null} is not
|
* Get the position in the world. <b>{@code null} is not
|
||||||
* allowed!</b> If you are not an entity in the world, return
|
* allowed!</b> If you are not an entity in the world, return
|
||||||
* the coordinates 0, 0, 0
|
* 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);
|
this.worldObj.playSound(this.posX, this.posY, this.posZ, name, volume, pitch, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Returns whether the entity is in a server world
|
* Returns whether the entity is in a server world
|
||||||
*/
|
*/
|
||||||
public boolean isServerWorld() {
|
public boolean isServerWorld() {
|
||||||
|
@ -502,7 +535,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
this.mc.displayGuiScreen(new GuiCommandBlock(cmdBlockLogic));
|
this.mc.displayGuiScreen(new GuiCommandBlock(cmdBlockLogic));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Displays the GUI for interacting with a book.
|
* Displays the GUI for interacting with a book.
|
||||||
*/
|
*/
|
||||||
public void displayGUIBook(ItemStack bookStack) {
|
public void displayGUIBook(ItemStack bookStack) {
|
||||||
|
@ -513,7 +547,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Displays the GUI for interacting with a chest inventory.
|
* Displays the GUI for interacting with a chest inventory.
|
||||||
* Args: chestInventory
|
* Args: chestInventory
|
||||||
*/
|
*/
|
||||||
|
@ -558,7 +593,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
this.mc.displayGuiScreen(new GuiMerchant(this.inventory, villager, this.worldObj));
|
this.mc.displayGuiScreen(new GuiMerchant(this.inventory, villager, this.worldObj));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Called when the player performs a critical hit on the Entity.
|
* Called when the player performs a critical hit on the Entity.
|
||||||
* Args: entity that was hit critically
|
* Args: entity that was hit critically
|
||||||
*/
|
*/
|
||||||
|
@ -570,7 +606,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
this.mc.effectRenderer.emitParticleAtEntity(entityHit, EnumParticleTypes.CRIT_MAGIC);
|
this.mc.effectRenderer.emitParticleAtEntity(entityHit, EnumParticleTypes.CRIT_MAGIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Returns if this entity is sneaking.
|
* Returns if this entity is sneaking.
|
||||||
*/
|
*/
|
||||||
public boolean isSneaking() {
|
public boolean isSneaking() {
|
||||||
|
@ -598,7 +635,8 @@ public class EntityPlayerSP extends AbstractClientPlayer {
|
||||||
return this.mc.getRenderViewEntity() == this;
|
return this.mc.getRenderViewEntity() == this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Called frequently so the entity can update its state every
|
* Called frequently so the entity can update its state every
|
||||||
* tick as required. For example, zombies and skeletons use this
|
* tick as required. For example, zombies and skeletons use this
|
||||||
* to react to sunlight and start to burn.
|
* 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.capabilities.isFlying && this.isCurrentViewEntity()) {
|
||||||
if (this.movementInput.sneak) {
|
if (this.movementInput.sneak) {
|
||||||
this.motionY -= (double) (this.capabilities.getFlySpeed() * 3.0F);
|
this.motionY -= (double) (this.capabilities.getFlySpeed() * 3.0F);
|
||||||
|
|
|
@ -22,6 +22,7 @@ import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemArmor;
|
import net.minecraft.item.ItemArmor;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemBow;
|
import net.minecraft.item.ItemBow;
|
||||||
|
import net.minecraft.item.ItemElytra;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.ItemSword;
|
import net.minecraft.item.ItemSword;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
@ -39,22 +40,31 @@ import net.minecraft.world.EnumDifficulty;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldServer;
|
import net.minecraft.world.WorldServer;
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||||
*
|
*
|
||||||
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
|
* 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
|
* 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
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (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
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -71,11 +81,13 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
protected final EntityAITasks targetTasks;
|
protected final EntityAITasks targetTasks;
|
||||||
private EntityLivingBase attackTarget;
|
private EntityLivingBase attackTarget;
|
||||||
private EntitySenses senses;
|
private EntitySenses senses;
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Equipment (armor and held item) for this entity.
|
* Equipment (armor and held item) for this entity.
|
||||||
*/
|
*/
|
||||||
private ItemStack[] equipment = new ItemStack[5];
|
private ItemStack[] equipment = new ItemStack[5];
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Chances for each equipment piece from dropping when this
|
* Chances for each equipment piece from dropping when this
|
||||||
* entity dies.
|
* entity dies.
|
||||||
*/
|
*/
|
||||||
|
@ -109,7 +121,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
this.getAttributeMap().registerAttribute(SharedMonsterAttributes.followRange).setBaseValue(16.0D);
|
this.getAttributeMap().registerAttribute(SharedMonsterAttributes.followRange).setBaseValue(16.0D);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Returns new PathNavigateGround instance
|
* Returns new PathNavigateGround instance
|
||||||
*/
|
*/
|
||||||
protected PathNavigate getNewNavigator(World worldIn) {
|
protected PathNavigate getNewNavigator(World worldIn) {
|
||||||
|
@ -132,28 +145,32 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
return this.navigator;
|
return this.navigator;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* returns the EntitySenses Object for the EntityLiving
|
* returns the EntitySenses Object for the EntityLiving
|
||||||
*/
|
*/
|
||||||
public EntitySenses getEntitySenses() {
|
public EntitySenses getEntitySenses() {
|
||||||
return this.senses;
|
return this.senses;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Gets the active target the Task system uses for tracking
|
* Gets the active target the Task system uses for tracking
|
||||||
*/
|
*/
|
||||||
public EntityLivingBase getAttackTarget() {
|
public EntityLivingBase getAttackTarget() {
|
||||||
return this.attackTarget;
|
return this.attackTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Sets the active target the Task system uses for tracking
|
* Sets the active target the Task system uses for tracking
|
||||||
*/
|
*/
|
||||||
public void setAttackTarget(EntityLivingBase entitylivingbaseIn) {
|
public void setAttackTarget(EntityLivingBase entitylivingbaseIn) {
|
||||||
this.attackTarget = entitylivingbaseIn;
|
this.attackTarget = entitylivingbaseIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Returns true if this entity can attack entities of the
|
* Returns true if this entity can attack entities of the
|
||||||
* specified class.
|
* specified class.
|
||||||
*/
|
*/
|
||||||
|
@ -161,7 +178,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
return cls != EntityGhast.class;
|
return cls != EntityGhast.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* This function applies the benefits of growing back wool and
|
* This function applies the benefits of growing back wool and
|
||||||
* faster growing up to the acting entity. (This function is
|
* faster growing up to the acting entity. (This function is
|
||||||
* used in the AIEatGrass)
|
* used in the AIEatGrass)
|
||||||
|
@ -174,7 +192,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
this.dataWatcher.addObject(15, Byte.valueOf((byte) 0));
|
this.dataWatcher.addObject(15, Byte.valueOf((byte) 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Get number of ticks, at least during which the living entity
|
* Get number of ticks, at least during which the living entity
|
||||||
* will be silent.
|
* will be silent.
|
||||||
*/
|
*/
|
||||||
|
@ -182,7 +201,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
return 80;
|
return 80;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Plays living's sound at its position
|
* Plays living's sound at its position
|
||||||
*/
|
*/
|
||||||
public void playLivingSound() {
|
public void playLivingSound() {
|
||||||
|
@ -193,7 +213,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Gets called every tick from main Entity class
|
* Gets called every tick from main Entity class
|
||||||
*/
|
*/
|
||||||
public void onEntityUpdate() {
|
public void onEntityUpdate() {
|
||||||
|
@ -207,7 +228,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
this.worldObj.theProfiler.endSection();
|
this.worldObj.theProfiler.endSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Get the experience points the entity currently has.
|
* Get the experience points the entity currently has.
|
||||||
*/
|
*/
|
||||||
protected int getExperiencePoints(EntityPlayer var1) {
|
protected int getExperiencePoints(EntityPlayer var1) {
|
||||||
|
@ -227,7 +249,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Spawns an explosion particle around the Entity's location
|
* Spawns an explosion particle around the Entity's location
|
||||||
*/
|
*/
|
||||||
public void spawnExplosionParticle() {
|
public void spawnExplosionParticle() {
|
||||||
|
@ -263,21 +286,19 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
private boolean canSkipUpdate() {
|
private boolean canSkipUpdate() {
|
||||||
if (this.isChild()) {
|
if (this.isChild()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
} else if (this.hurtTime > 0) {
|
||||||
else if (this.hurtTime > 0) {
|
|
||||||
return false;
|
return false;
|
||||||
} else if (this.ticksExisted < 20)
|
} else if (this.ticksExisted < 20) {
|
||||||
{
|
return false;
|
||||||
return false;
|
} else {
|
||||||
} else {
|
|
||||||
World world = this.getEntityWorld();
|
World world = this.getEntityWorld();
|
||||||
|
|
||||||
if (world == null) {
|
if (world == null) {
|
||||||
return false;
|
return false;
|
||||||
} else if (world.playerEntities.size() != 1) {
|
} else if (world.playerEntities.size() != 1) {
|
||||||
return false ;
|
return false;
|
||||||
} else {
|
} 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 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 d1 = Math.max(Math.abs(this.posZ - entity.posZ) - 16.0D, 0.0D);
|
||||||
double d2 = d0 * d0 + d1 * d1;
|
double d2 = d0 * d0 + d1 * d1;
|
||||||
|
@ -286,8 +307,7 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onUpdateMinimal()
|
private void onUpdateMinimal() {
|
||||||
{
|
|
||||||
++this.entityAge;
|
++this.entityAge;
|
||||||
|
|
||||||
if (this instanceof EntityMob) {
|
if (this instanceof EntityMob) {
|
||||||
|
@ -300,7 +320,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
this.despawnEntity();
|
this.despawnEntity();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Called to update the entity's position/logic.
|
* Called to update the entity's position/logic.
|
||||||
*/
|
*/
|
||||||
public void onUpdate() {
|
public void onUpdate() {
|
||||||
|
@ -310,7 +331,7 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
super.onUpdate();
|
super.onUpdate();
|
||||||
if (!this.worldObj.isRemote) {
|
if (!this.worldObj.isRemote) {
|
||||||
this.updateLeashedState();
|
this.updateLeashedState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -319,7 +340,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Returns the sound this mob makes while it's alive.
|
* Returns the sound this mob makes while it's alive.
|
||||||
*/
|
*/
|
||||||
protected String getLivingSound() {
|
protected String getLivingSound() {
|
||||||
|
@ -330,7 +352,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Drop 0-2 items of this living's type
|
* Drop 0-2 items of this living's type
|
||||||
*/
|
*/
|
||||||
protected void dropFewItems(boolean var1, int i) {
|
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
|
* (abstract) Protected helper method to write subclass entity
|
||||||
* data to NBT.
|
* data to NBT.
|
||||||
*/
|
*/
|
||||||
|
@ -397,7 +421,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* (abstract) Protected helper method to read subclass entity
|
* (abstract) Protected helper method to read subclass entity
|
||||||
* data from NBT.
|
* data from NBT.
|
||||||
*/
|
*/
|
||||||
|
@ -436,7 +461,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
this.moveForward = parFloat1;
|
this.moveForward = parFloat1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* set the movespeed used for the new AI system
|
* set the movespeed used for the new AI system
|
||||||
*/
|
*/
|
||||||
public void setAIMoveSpeed(float f) {
|
public void setAIMoveSpeed(float f) {
|
||||||
|
@ -444,7 +470,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
this.setMoveForward(f);
|
this.setMoveForward(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Called frequently so the entity can update its state every
|
* Called frequently so the entity can update its state every
|
||||||
* tick as required. For example, zombies and skeletons use this
|
* tick as required. For example, zombies and skeletons use this
|
||||||
* to react to sunlight and start to burn.
|
* to react to sunlight and start to burn.
|
||||||
|
@ -467,7 +494,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
this.worldObj.theProfiler.endSection();
|
this.worldObj.theProfiler.endSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Tests if this entity should pickup a weapon or an armor.
|
* Tests if this entity should pickup a weapon or an armor.
|
||||||
* Entity drops current weapon or armor if the new one is
|
* Entity drops current weapon or armor if the new one is
|
||||||
* better.
|
* better.
|
||||||
|
@ -538,7 +566,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Determines if an entity can be despawned, used on idle far
|
* Determines if an entity can be despawned, used on idle far
|
||||||
* away entities
|
* away entities
|
||||||
*/
|
*/
|
||||||
|
@ -546,7 +575,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Makes the entity despawn if requirements are reached
|
* Makes the entity despawn if requirements are reached
|
||||||
*/
|
*/
|
||||||
protected void despawnEntity() {
|
protected void despawnEntity() {
|
||||||
|
@ -607,7 +637,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
protected void updateAITasks() {
|
protected void updateAITasks() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* The speed it takes to move the entityliving's rotationPitch
|
* The speed it takes to move the entityliving's rotationPitch
|
||||||
* through the faceEntity method. This is only currently use in
|
* through the faceEntity method. This is only currently use in
|
||||||
* wolves.
|
* wolves.
|
||||||
|
@ -616,7 +647,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
return 40;
|
return 40;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Changes pitch and yaw so that the entity calling the function
|
* Changes pitch and yaw so that the entity calling the function
|
||||||
* is facing the entity provided as an argument.
|
* 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);
|
this.rotationYaw = this.updateRotation(this.rotationYaw, f, parFloat1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Arguments: current rotation, intended rotation, max
|
* Arguments: current rotation, intended rotation, max
|
||||||
* increment.
|
* increment.
|
||||||
*/
|
*/
|
||||||
|
@ -657,7 +690,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
return parFloat1 + f;
|
return parFloat1 + f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Checks if the entity's current position is a valid location
|
* Checks if the entity's current position is a valid location
|
||||||
* to spawn this entity.
|
* to spawn this entity.
|
||||||
*/
|
*/
|
||||||
|
@ -665,7 +699,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Checks that the entity is not colliding with any blocks /
|
* Checks that the entity is not colliding with any blocks /
|
||||||
* liquids
|
* liquids
|
||||||
*/
|
*/
|
||||||
|
@ -675,21 +710,24 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
&& !this.worldObj.isAnyLiquid(this.getEntityBoundingBox());
|
&& !this.worldObj.isAnyLiquid(this.getEntityBoundingBox());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Returns render size modifier
|
* Returns render size modifier
|
||||||
*/
|
*/
|
||||||
public float getRenderSizeModifier() {
|
public float getRenderSizeModifier() {
|
||||||
return 1.0F;
|
return 1.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Will return how many at most can spawn in a chunk at once.
|
* Will return how many at most can spawn in a chunk at once.
|
||||||
*/
|
*/
|
||||||
public int getMaxSpawnedInChunk() {
|
public int getMaxSpawnedInChunk() {
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* The maximum height from where the entity is alowed to jump
|
* The maximum height from where the entity is alowed to jump
|
||||||
* (used in pathfinder)
|
* (used in pathfinder)
|
||||||
*/
|
*/
|
||||||
|
@ -707,14 +745,16 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Returns the item that this EntityLiving is holding, if any.
|
* Returns the item that this EntityLiving is holding, if any.
|
||||||
*/
|
*/
|
||||||
public ItemStack getHeldItem() {
|
public ItemStack getHeldItem() {
|
||||||
return this.equipment[0];
|
return this.equipment[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* 0: Tool in Hand; 1-4: Armor
|
* 0: Tool in Hand; 1-4: Armor
|
||||||
*/
|
*/
|
||||||
public ItemStack getEquipmentInSlot(int i) {
|
public ItemStack getEquipmentInSlot(int i) {
|
||||||
|
@ -725,7 +765,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
return this.equipment[i + 1];
|
return this.equipment[i + 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Sets the held item, or an armor slot. Slot 0 is held item.
|
* Sets the held item, or an armor slot. Slot 0 is held item.
|
||||||
* Slot 1-4 is armor. Params: Item, slot
|
* Slot 1-4 is armor. Params: Item, slot
|
||||||
*/
|
*/
|
||||||
|
@ -733,7 +774,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
this.equipment[i] = itemstack;
|
this.equipment[i] = itemstack;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* returns the inventory of this entity (only used in
|
* returns the inventory of this entity (only used in
|
||||||
* EntityPlayerMP it seems)
|
* EntityPlayerMP it seems)
|
||||||
*/
|
*/
|
||||||
|
@ -741,7 +783,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
return this.equipment;
|
return this.equipment;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Drop the equipment for this entity.
|
* Drop the equipment for this entity.
|
||||||
*/
|
*/
|
||||||
protected void dropEquipment(boolean flag, int i) {
|
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
|
* Gives armor or weapon for entity based on given
|
||||||
* DifficultyInstance
|
* 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() != Item.getItemFromBlock(Blocks.pumpkin) && stack.getItem() != Items.skull) {
|
||||||
if (stack.getItem() instanceof ItemArmor) {
|
if (stack.getItem() instanceof ItemArmor) {
|
||||||
switch (((ItemArmor) stack.getItem()).armorType) {
|
switch (((ItemArmor) stack.getItem()).armorType) {
|
||||||
case 0:
|
case 0:
|
||||||
return 4;
|
return 4;
|
||||||
case 1:
|
case 1:
|
||||||
return 3;
|
return 3;
|
||||||
case 2:
|
case 2:
|
||||||
return 2;
|
return 2;
|
||||||
case 3:
|
case 3:
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stack.getItem() instanceof ItemElytra) {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Gets the vanilla armor Item that can go in the slot specified
|
* Gets the vanilla armor Item that can go in the slot specified
|
||||||
* for the given tier.
|
* for the given tier.
|
||||||
*/
|
*/
|
||||||
public static Item getArmorItemForSlot(int armorSlot, int itemTier) {
|
public static Item getArmorItemForSlot(int armorSlot, int itemTier) {
|
||||||
switch (armorSlot) {
|
switch (armorSlot) {
|
||||||
case 4:
|
case 4:
|
||||||
if (itemTier == 0) {
|
if (itemTier == 0) {
|
||||||
return Items.leather_helmet;
|
return Items.leather_helmet;
|
||||||
} else if (itemTier == 1) {
|
} else if (itemTier == 1) {
|
||||||
return Items.golden_helmet;
|
return Items.golden_helmet;
|
||||||
} else if (itemTier == 2) {
|
} else if (itemTier == 2) {
|
||||||
return Items.chainmail_helmet;
|
return Items.chainmail_helmet;
|
||||||
} else if (itemTier == 3) {
|
} else if (itemTier == 3) {
|
||||||
return Items.iron_helmet;
|
return Items.iron_helmet;
|
||||||
} else if (itemTier == 4) {
|
} else if (itemTier == 4) {
|
||||||
return Items.diamond_helmet;
|
return Items.diamond_helmet;
|
||||||
}
|
}
|
||||||
case 3:
|
case 3:
|
||||||
if (itemTier == 0) {
|
if (itemTier == 0) {
|
||||||
return Items.leather_chestplate;
|
return Items.leather_chestplate;
|
||||||
} else if (itemTier == 1) {
|
} else if (itemTier == 1) {
|
||||||
return Items.golden_chestplate;
|
return Items.golden_chestplate;
|
||||||
} else if (itemTier == 2) {
|
} else if (itemTier == 2) {
|
||||||
return Items.chainmail_chestplate;
|
return Items.chainmail_chestplate;
|
||||||
} else if (itemTier == 3) {
|
} else if (itemTier == 3) {
|
||||||
return Items.iron_chestplate;
|
return Items.iron_chestplate;
|
||||||
} else if (itemTier == 4) {
|
} else if (itemTier == 4) {
|
||||||
return Items.diamond_chestplate;
|
return Items.diamond_chestplate;
|
||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
if (itemTier == 0) {
|
if (itemTier == 0) {
|
||||||
return Items.leather_leggings;
|
return Items.leather_leggings;
|
||||||
} else if (itemTier == 1) {
|
} else if (itemTier == 1) {
|
||||||
return Items.golden_leggings;
|
return Items.golden_leggings;
|
||||||
} else if (itemTier == 2) {
|
} else if (itemTier == 2) {
|
||||||
return Items.chainmail_leggings;
|
return Items.chainmail_leggings;
|
||||||
} else if (itemTier == 3) {
|
} else if (itemTier == 3) {
|
||||||
return Items.iron_leggings;
|
return Items.iron_leggings;
|
||||||
} else if (itemTier == 4) {
|
} else if (itemTier == 4) {
|
||||||
return Items.diamond_leggings;
|
return Items.diamond_leggings;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
if (itemTier == 0) {
|
if (itemTier == 0) {
|
||||||
return Items.leather_boots;
|
return Items.leather_boots;
|
||||||
} else if (itemTier == 1) {
|
} else if (itemTier == 1) {
|
||||||
return Items.golden_boots;
|
return Items.golden_boots;
|
||||||
} else if (itemTier == 2) {
|
} else if (itemTier == 2) {
|
||||||
return Items.chainmail_boots;
|
return Items.chainmail_boots;
|
||||||
} else if (itemTier == 3) {
|
} else if (itemTier == 3) {
|
||||||
return Items.iron_boots;
|
return Items.iron_boots;
|
||||||
} else if (itemTier == 4) {
|
} else if (itemTier == 4) {
|
||||||
return Items.diamond_boots;
|
return Items.diamond_boots;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Enchants Entity's current equipments based on given
|
* Enchants Entity's current equipments based on given
|
||||||
* DifficultyInstance
|
* DifficultyInstance
|
||||||
*/
|
*/
|
||||||
|
@ -908,7 +958,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Called only once on an entity when first time spawned, via
|
* Called only once on an entity when first time spawned, via
|
||||||
* egg, mob spawner, natural spawning etc, but not called when
|
* egg, mob spawner, natural spawning etc, but not called when
|
||||||
* entity is reloaded from nbt. Mainly used for initializing
|
* entity is reloaded from nbt. Mainly used for initializing
|
||||||
|
@ -920,7 +971,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
return livingdata;
|
return livingdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* returns true if all the conditions for steering the entity
|
* returns true if all the conditions for steering the entity
|
||||||
* are met. For pigs, this is true if it is being ridden by a
|
* 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
|
* player and the player is holding a carrot-on-a-stick
|
||||||
|
@ -929,7 +981,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Enable the Entity persistence
|
* Enable the Entity persistence
|
||||||
*/
|
*/
|
||||||
public void enablePersistence() {
|
public void enablePersistence() {
|
||||||
|
@ -952,7 +1005,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
return this.persistenceRequired;
|
return this.persistenceRequired;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* First layer of player interaction
|
* First layer of player interaction
|
||||||
*/
|
*/
|
||||||
public final boolean interactFirst(EntityPlayer entityplayer) {
|
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
|
* Called when a player interacts with a mob. e.g. gets milk
|
||||||
* from a cow, gets into the saddle on a pig.
|
* from a cow, gets into the saddle on a pig.
|
||||||
*/
|
*/
|
||||||
|
@ -991,7 +1046,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Applies logic related to leashes, for example dragging the
|
* Applies logic related to leashes, for example dragging the
|
||||||
* entity or breaking the leash.
|
* entity or breaking the leash.
|
||||||
*/
|
*/
|
||||||
|
@ -1011,7 +1067,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Removes the leash from this entity
|
* Removes the leash from this entity
|
||||||
*/
|
*/
|
||||||
public void clearLeashed(boolean sendPacket, boolean dropLead) {
|
public void clearLeashed(boolean sendPacket, boolean dropLead) {
|
||||||
|
@ -1042,7 +1099,8 @@ public abstract class EntityLiving extends EntityLivingBase {
|
||||||
return this.leashedToEntity;
|
return this.leashedToEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Sets the entity to be leashed to.
|
* Sets the entity to be leashed to.
|
||||||
*/
|
*/
|
||||||
public void setLeashedToEntity(Entity entityIn, boolean sendAttachNotification) {
|
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
|
* Returns whether the entity is in a server world
|
||||||
*/
|
*/
|
||||||
public boolean isServerWorld() {
|
public boolean isServerWorld() {
|
||||||
return super.isServerWorld() && !this.isAIDisabled();
|
return super.isServerWorld() && !this.isAIDisabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Set whether this Entity's AI is disabled
|
* Set whether this Entity's AI is disabled
|
||||||
*/
|
*/
|
||||||
public void setNoAI(boolean disable) {
|
public void setNoAI(boolean disable) {
|
||||||
this.dataWatcher.updateObject(15, Byte.valueOf((byte) (disable ? 1 : 0)));
|
this.dataWatcher.updateObject(15, Byte.valueOf((byte) (disable ? 1 : 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Get whether this Entity's AI is disabled
|
* Get whether this Entity's AI is disabled
|
||||||
*/
|
*/
|
||||||
public boolean isAIDisabled() {
|
public boolean isAIDisabled() {
|
||||||
|
|
|
@ -1242,6 +1242,19 @@ public abstract class EntityLivingBase extends Entity {
|
||||||
return this.attributeMap;
|
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
|
* Get this Entity's EnumCreatureAttribute
|
||||||
|
|
|
@ -1109,6 +1109,7 @@ public class Item {
|
||||||
(new ItemSeeds(EaglerItems.getEaglerBlock("beetroots"), Blocks.farmland))
|
(new ItemSeeds(EaglerItems.getEaglerBlock("beetroots"), Blocks.farmland))
|
||||||
.setUnlocalizedName("beetroot_seeds"));
|
.setUnlocalizedName("beetroot_seeds"));
|
||||||
registerEaglerItem(436, "beetroot_soup", (new ItemSoup(6)).setUnlocalizedName("beetroot_soup"));
|
registerEaglerItem(436, "beetroot_soup", (new ItemSoup(6)).setUnlocalizedName("beetroot_soup"));
|
||||||
|
registerEaglerItem(443, "elytra", (new ItemElytra()).setUnlocalizedName("elytra"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -33,6 +33,7 @@ import net.minecraft.inventory.ContainerRepair;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.ItemEditableBook;
|
import net.minecraft.item.ItemEditableBook;
|
||||||
|
import net.minecraft.item.ItemElytra;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.ItemWritableBook;
|
import net.minecraft.item.ItemWritableBook;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
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 net.lax1dude.eaglercraft.v1_8.sp.server.voice.IntegratedVoiceService;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
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.LogManager;
|
||||||
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||||
*
|
*
|
||||||
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
|
* 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
|
* 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
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (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
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -147,7 +159,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|
||||||
playerIn.playerNetServerHandler = this;
|
playerIn.playerNetServerHandler = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Like the old updateEntity(), except more generic.
|
* Like the old updateEntity(), except more generic.
|
||||||
*/
|
*/
|
||||||
public void update() {
|
public void update() {
|
||||||
|
@ -182,7 +195,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|
||||||
return this.netManager;
|
return this.netManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Kick a player from the server with a reason
|
* Kick a player from the server with a reason
|
||||||
*/
|
*/
|
||||||
public void kickPlayerFromServer(String reason) {
|
public void kickPlayerFromServer(String reason) {
|
||||||
|
@ -191,7 +205,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|
||||||
this.netManager.closeChannel(chatcomponenttext);
|
this.netManager.closeChannel(chatcomponenttext);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Processes player movement input. Includes walking, strafing,
|
* Processes player movement input. Includes walking, strafing,
|
||||||
* jumping, sneaking; excludes riding and toggling
|
* jumping, sneaking; excludes riding and toggling
|
||||||
* flying/sprinting
|
* flying/sprinting
|
||||||
|
@ -208,7 +223,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|
||||||
|| !Floats.isFinite(parC03PacketPlayer.getPitch()) || !Floats.isFinite(parC03PacketPlayer.getYaw());
|
|| !Floats.isFinite(parC03PacketPlayer.getPitch()) || !Floats.isFinite(parC03PacketPlayer.getYaw());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Processes clients perspective on player positioning and/or
|
* Processes clients perspective on player positioning and/or
|
||||||
* orientation
|
* orientation
|
||||||
*/
|
*/
|
||||||
|
@ -440,7 +456,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|
||||||
.sendPacket(new S08PacketPlayerPosLook(x, y, z, yaw, pitch, relativeSet));
|
.sendPacket(new S08PacketPlayerPosLook(x, y, z, yaw, pitch, relativeSet));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Processes the player initiating/stopping digging on a
|
* Processes the player initiating/stopping digging on a
|
||||||
* particular spot, as well as a player dropping items?. (0:
|
* particular spot, as well as a player dropping items?. (0:
|
||||||
* initiated, 1: reinitiated, 2? , 3-4 drop item (respectively
|
* initiated, 1: reinitiated, 2? , 3-4 drop item (respectively
|
||||||
|
@ -452,64 +469,65 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|
||||||
BlockPos blockpos = c07packetplayerdigging.getPosition();
|
BlockPos blockpos = c07packetplayerdigging.getPosition();
|
||||||
this.playerEntity.markPlayerActive();
|
this.playerEntity.markPlayerActive();
|
||||||
switch (c07packetplayerdigging.getStatus()) {
|
switch (c07packetplayerdigging.getStatus()) {
|
||||||
case DROP_ITEM:
|
case DROP_ITEM:
|
||||||
if (!this.playerEntity.isSpectator()) {
|
if (!this.playerEntity.isSpectator()) {
|
||||||
this.playerEntity.dropOneItem(false);
|
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));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
case DROP_ALL_ITEMS:
|
||||||
default:
|
if (!this.playerEntity.isSpectator()) {
|
||||||
throw new IllegalArgumentException("Invalid player action");
|
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,
|
* Processes block placement and block activation (anvil,
|
||||||
* furnace, etc.)
|
* furnace, etc.)
|
||||||
*/
|
*/
|
||||||
|
@ -630,7 +648,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|
||||||
public void handleResourcePackStatus(C19PacketResourcePackStatus var1) {
|
public void handleResourcePackStatus(C19PacketResourcePackStatus var1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Invoked when disconnecting, the parameter is a ChatComponent
|
* Invoked when disconnecting, the parameter is a ChatComponent
|
||||||
* describing the reason for termination
|
* describing the reason for termination
|
||||||
*/
|
*/
|
||||||
|
@ -679,7 +698,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Updates which quickbar slot is selected
|
* Updates which quickbar slot is selected
|
||||||
*/
|
*/
|
||||||
public void processHeldItemChange(C09PacketHeldItemChange c09packethelditemchange) {
|
public void processHeldItemChange(C09PacketHeldItemChange c09packethelditemchange) {
|
||||||
|
@ -692,7 +712,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Process chat messages (broadcast back to clients) and
|
* Process chat messages (broadcast back to clients) and
|
||||||
* commands (executes)
|
* commands (executes)
|
||||||
*/
|
*/
|
||||||
|
@ -735,7 +756,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Handle commands that start with a /
|
* Handle commands that start with a /
|
||||||
*/
|
*/
|
||||||
private void handleSlashCommand(String command) {
|
private void handleSlashCommand(String command) {
|
||||||
|
@ -747,7 +769,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|
||||||
this.playerEntity.swingItem();
|
this.playerEntity.swingItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Processes a range of action-types: sneaking, sprinting,
|
* Processes a range of action-types: sneaking, sprinting,
|
||||||
* waking from sleep, opening the inventory or setting jump
|
* waking from sleep, opening the inventory or setting jump
|
||||||
* height of the horse the player is riding
|
* height of the horse the player is riding
|
||||||
|
@ -755,39 +778,53 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|
||||||
public void processEntityAction(C0BPacketEntityAction c0bpacketentityaction) {
|
public void processEntityAction(C0BPacketEntityAction c0bpacketentityaction) {
|
||||||
this.playerEntity.markPlayerActive();
|
this.playerEntity.markPlayerActive();
|
||||||
switch (c0bpacketentityaction.getAction()) {
|
switch (c0bpacketentityaction.getAction()) {
|
||||||
case START_SNEAKING:
|
case START_SNEAKING:
|
||||||
this.playerEntity.setSneaking(true);
|
this.playerEntity.setSneaking(true);
|
||||||
break;
|
break;
|
||||||
case STOP_SNEAKING:
|
case STOP_SNEAKING:
|
||||||
this.playerEntity.setSneaking(false);
|
this.playerEntity.setSneaking(false);
|
||||||
break;
|
break;
|
||||||
case START_SPRINTING:
|
case START_SPRINTING:
|
||||||
this.playerEntity.setSprinting(true);
|
this.playerEntity.setSprinting(true);
|
||||||
break;
|
break;
|
||||||
case STOP_SPRINTING:
|
case STOP_SPRINTING:
|
||||||
this.playerEntity.setSprinting(false);
|
this.playerEntity.setSprinting(false);
|
||||||
break;
|
break;
|
||||||
case STOP_SLEEPING:
|
case STOP_SLEEPING:
|
||||||
this.playerEntity.wakeUpPlayer(false, true, true);
|
this.playerEntity.wakeUpPlayer(false, true, true);
|
||||||
this.hasMoved = false;
|
this.hasMoved = false;
|
||||||
break;
|
break;
|
||||||
case RIDING_JUMP:
|
case RIDING_JUMP:
|
||||||
if (this.playerEntity.ridingEntity instanceof EntityHorse) {
|
if (this.playerEntity.ridingEntity instanceof EntityHorse) {
|
||||||
((EntityHorse) this.playerEntity.ridingEntity).setJumpPower(c0bpacketentityaction.getAuxData());
|
((EntityHorse) this.playerEntity.ridingEntity).setJumpPower(c0bpacketentityaction.getAuxData());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case OPEN_INVENTORY:
|
case OPEN_INVENTORY:
|
||||||
if (this.playerEntity.ridingEntity instanceof EntityHorse) {
|
if (this.playerEntity.ridingEntity instanceof EntityHorse) {
|
||||||
((EntityHorse) this.playerEntity.ridingEntity).openGUI(this.playerEntity);
|
((EntityHorse) this.playerEntity.ridingEntity).openGUI(this.playerEntity);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
case START_FALL_FLYING:
|
||||||
throw new IllegalArgumentException("Invalid client command!");
|
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
|
* Processes interactions ((un)leashing, opening command block
|
||||||
* GUI) and attacks on an entity with players currently equipped
|
* GUI) and attacks on an entity with players currently equipped
|
||||||
* item
|
* item
|
||||||
|
@ -824,7 +861,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Processes the client status updates: respawn attempt from
|
* Processes the client status updates: respawn attempt from
|
||||||
* player, opening statistics or achievements, or acquiring
|
* player, opening statistics or achievements, or acquiring
|
||||||
* 'open inventory' achievement
|
* 'open inventory' achievement
|
||||||
|
@ -833,46 +871,48 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|
||||||
this.playerEntity.markPlayerActive();
|
this.playerEntity.markPlayerActive();
|
||||||
C16PacketClientStatus.EnumState c16packetclientstatus$enumstate = c16packetclientstatus.getStatus();
|
C16PacketClientStatus.EnumState c16packetclientstatus$enumstate = c16packetclientstatus.getStatus();
|
||||||
switch (c16packetclientstatus$enumstate) {
|
switch (c16packetclientstatus$enumstate) {
|
||||||
case PERFORM_RESPAWN:
|
case PERFORM_RESPAWN:
|
||||||
if (this.playerEntity.playerConqueredTheEnd) {
|
if (this.playerEntity.playerConqueredTheEnd) {
|
||||||
this.playerEntity = this.serverController.getConfigurationManager()
|
this.playerEntity = this.serverController.getConfigurationManager()
|
||||||
.recreatePlayerEntity(this.playerEntity, 0, true);
|
.recreatePlayerEntity(this.playerEntity, 0, true);
|
||||||
} else if (this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled()) {
|
} else if (this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled()) {
|
||||||
if (this.serverController.isSinglePlayer()
|
if (this.serverController.isSinglePlayer()
|
||||||
&& this.playerEntity.getName().equals(this.serverController.getServerOwner())) {
|
&& this.playerEntity.getName().equals(this.serverController.getServerOwner())) {
|
||||||
this.playerEntity.playerNetServerHandler
|
this.playerEntity.playerNetServerHandler
|
||||||
.kickPlayerFromServer("You have died. Game over, man, it\'s game over!");
|
.kickPlayerFromServer("You have died. Game over, man, it\'s game over!");
|
||||||
this.serverController.deleteWorldAndStopServer();
|
this.serverController.deleteWorldAndStopServer();
|
||||||
|
} else {
|
||||||
|
this.playerEntity.playerNetServerHandler
|
||||||
|
.kickPlayerFromServer("You have died. Game over, man, it\'s game over!");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.playerEntity.playerNetServerHandler
|
if (this.playerEntity.getHealth() > 0.0F) {
|
||||||
.kickPlayerFromServer("You have died. Game over, man, it\'s game over!");
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (this.playerEntity.getHealth() > 0.0F) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.playerEntity = this.serverController.getConfigurationManager()
|
this.playerEntity = this.serverController.getConfigurationManager()
|
||||||
.recreatePlayerEntity(this.playerEntity, 0, false);
|
.recreatePlayerEntity(this.playerEntity, 0, false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case REQUEST_STATS:
|
case REQUEST_STATS:
|
||||||
this.playerEntity.getStatFile().func_150876_a(this.playerEntity);
|
this.playerEntity.getStatFile().func_150876_a(this.playerEntity);
|
||||||
break;
|
break;
|
||||||
case OPEN_INVENTORY_ACHIEVEMENT:
|
case OPEN_INVENTORY_ACHIEVEMENT:
|
||||||
this.playerEntity.triggerAchievement(AchievementList.openInventory);
|
this.playerEntity.triggerAchievement(AchievementList.openInventory);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Processes the client closing windows (container)
|
* Processes the client closing windows (container)
|
||||||
*/
|
*/
|
||||||
public void processCloseWindow(C0DPacketCloseWindow c0dpacketclosewindow) {
|
public void processCloseWindow(C0DPacketCloseWindow c0dpacketclosewindow) {
|
||||||
this.playerEntity.closeContainer();
|
this.playerEntity.closeContainer();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Executes a container/inventory slot manipulation as indicated
|
* Executes a container/inventory slot manipulation as indicated
|
||||||
* by the packet. Sends the serverside result if they didn't
|
* by the packet. Sends the serverside result if they didn't
|
||||||
* match the indicated result and prevents further manipulation
|
* 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
|
* Enchants the item identified by the packet given some
|
||||||
* convoluted conditions (matching window, which
|
* convoluted conditions (matching window, which
|
||||||
* should/shouldn't be in use?)
|
* 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.
|
* Update the server with an ItemStack in a slot.
|
||||||
*/
|
*/
|
||||||
public void processCreativeInventoryAction(C10PacketCreativeInventoryAction c10packetcreativeinventoryaction) {
|
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
|
* Received in response to the server requesting to confirm that
|
||||||
* the client-side open container matches the servers' after a
|
* the client-side open container matches the servers' after a
|
||||||
* mismatched container-slot manipulation. It will unlock the
|
* mismatched container-slot manipulation. It will unlock the
|
||||||
|
@ -1037,7 +1080,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Updates a players' ping statistics
|
* Updates a players' ping statistics
|
||||||
*/
|
*/
|
||||||
public void processKeepAlive(C00PacketKeepAlive c00packetkeepalive) {
|
public void processKeepAlive(C00PacketKeepAlive c00packetkeepalive) {
|
||||||
|
@ -1052,7 +1096,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|
||||||
return System.nanoTime() / 1000000L;
|
return System.nanoTime() / 1000000L;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Processes a player starting/stopping flying
|
* Processes a player starting/stopping flying
|
||||||
*/
|
*/
|
||||||
public void processPlayerAbilities(C13PacketPlayerAbilities c13packetplayerabilities) {
|
public void processPlayerAbilities(C13PacketPlayerAbilities c13packetplayerabilities) {
|
||||||
|
@ -1060,7 +1105,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|
||||||
&& this.playerEntity.capabilities.allowFlying;
|
&& this.playerEntity.capabilities.allowFlying;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Retrieves possible tab completions for the requested command
|
* Retrieves possible tab completions for the requested command
|
||||||
* string and sends them to the client
|
* string and sends them to the client
|
||||||
*/
|
*/
|
||||||
|
@ -1075,7 +1121,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|
||||||
this.playerEntity.playerNetServerHandler.sendPacket(new S3APacketTabComplete(fuckOff));
|
this.playerEntity.playerNetServerHandler.sendPacket(new S3APacketTabComplete(fuckOff));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Updates serverside copy of client settings: language, render
|
* Updates serverside copy of client settings: language, render
|
||||||
* distance, chat visibility, chat colours, difficulty, and
|
* distance, chat visibility, chat colours, difficulty, and
|
||||||
* whether to show the cape
|
* whether to show the cape
|
||||||
|
@ -1084,7 +1131,8 @@ public class NetHandlerPlayServer implements INetHandlerPlayServer, ITickable {
|
||||||
this.playerEntity.handleClientSettings(c15packetclientsettings);
|
this.playerEntity.handleClientSettings(c15packetclientsettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Synchronizes serverside and clientside book contents and
|
* Synchronizes serverside and clientside book contents and
|
||||||
* signing
|
* signing
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -7,22 +7,31 @@ import net.minecraft.network.Packet;
|
||||||
import net.minecraft.network.PacketBuffer;
|
import net.minecraft.network.PacketBuffer;
|
||||||
import net.minecraft.network.play.INetHandlerPlayServer;
|
import net.minecraft.network.play.INetHandlerPlayServer;
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
* This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code.
|
||||||
*
|
*
|
||||||
* Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!"
|
* 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
|
* 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
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
* DISCLAIMED.
|
||||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
|
||||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
* DIRECT,
|
||||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
* (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
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
|
@ -45,7 +54,8 @@ public class C0BPacketEntityAction implements Packet<INetHandlerPlayServer> {
|
||||||
this.auxData = auxData;
|
this.auxData = auxData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Reads the raw packet data from the data stream.
|
* Reads the raw packet data from the data stream.
|
||||||
*/
|
*/
|
||||||
public void readPacketData(PacketBuffer parPacketBuffer) throws IOException {
|
public void readPacketData(PacketBuffer parPacketBuffer) throws IOException {
|
||||||
|
@ -54,7 +64,8 @@ public class C0BPacketEntityAction implements Packet<INetHandlerPlayServer> {
|
||||||
this.auxData = parPacketBuffer.readVarIntFromBuffer();
|
this.auxData = parPacketBuffer.readVarIntFromBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Writes the raw packet data to the data stream.
|
* Writes the raw packet data to the data stream.
|
||||||
*/
|
*/
|
||||||
public void writePacketData(PacketBuffer parPacketBuffer) throws IOException {
|
public void writePacketData(PacketBuffer parPacketBuffer) throws IOException {
|
||||||
|
@ -63,7 +74,8 @@ public class C0BPacketEntityAction implements Packet<INetHandlerPlayServer> {
|
||||||
parPacketBuffer.writeVarIntToBuffer(this.auxData);
|
parPacketBuffer.writeVarIntToBuffer(this.auxData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**+
|
/**
|
||||||
|
* +
|
||||||
* Passes this Packet on to the NetHandler for processing.
|
* Passes this Packet on to the NetHandler for processing.
|
||||||
*/
|
*/
|
||||||
public void processPacket(INetHandlerPlayServer inethandlerplayserver) {
|
public void processPacket(INetHandlerPlayServer inethandlerplayserver) {
|
||||||
|
@ -79,6 +91,8 @@ public class C0BPacketEntityAction implements Packet<INetHandlerPlayServer> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static enum Action {
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue