add files

This commit is contained in:
eaglercraft 2024-02-14 20:52:11 -08:00
commit 784a776dbb
7211 changed files with 811080 additions and 0 deletions

View file

@ -0,0 +1,51 @@
package net.minecraft.scoreboard;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumChatFormatting;
/**+
* 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.
*
* 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)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class GoalColor implements IScoreObjectiveCriteria {
private final String goalName;
public GoalColor(String parString1, EnumChatFormatting parEnumChatFormatting) {
this.goalName = parString1 + parEnumChatFormatting.getFriendlyName();
IScoreObjectiveCriteria.INSTANCES.put(this.goalName, this);
}
public String getName() {
return this.goalName;
}
public int func_96635_a(List<EntityPlayer> parList) {
return 0;
}
public boolean isReadOnly() {
return false;
}
public IScoreObjectiveCriteria.EnumRenderType getRenderType() {
return IScoreObjectiveCriteria.EnumRenderType.INTEGER;
}
}

View file

@ -0,0 +1,107 @@
package net.minecraft.scoreboard;
import java.util.List;
import java.util.Map;
import com.google.common.collect.Maps;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumChatFormatting;
/**+
* 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.
*
* 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)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public interface IScoreObjectiveCriteria {
Map<String, IScoreObjectiveCriteria> INSTANCES = Maps.newHashMap();
IScoreObjectiveCriteria DUMMY = new ScoreDummyCriteria("dummy");
IScoreObjectiveCriteria TRIGGER = new ScoreDummyCriteria("trigger");
IScoreObjectiveCriteria deathCount = new ScoreDummyCriteria("deathCount");
IScoreObjectiveCriteria playerKillCount = new ScoreDummyCriteria("playerKillCount");
IScoreObjectiveCriteria totalKillCount = new ScoreDummyCriteria("totalKillCount");
IScoreObjectiveCriteria health = new ScoreHealthCriteria("health");
IScoreObjectiveCriteria[] field_178792_h = new IScoreObjectiveCriteria[] {
new GoalColor("teamkill.", EnumChatFormatting.BLACK),
new GoalColor("teamkill.", EnumChatFormatting.DARK_BLUE),
new GoalColor("teamkill.", EnumChatFormatting.DARK_GREEN),
new GoalColor("teamkill.", EnumChatFormatting.DARK_AQUA),
new GoalColor("teamkill.", EnumChatFormatting.DARK_RED),
new GoalColor("teamkill.", EnumChatFormatting.DARK_PURPLE),
new GoalColor("teamkill.", EnumChatFormatting.GOLD), new GoalColor("teamkill.", EnumChatFormatting.GRAY),
new GoalColor("teamkill.", EnumChatFormatting.DARK_GRAY),
new GoalColor("teamkill.", EnumChatFormatting.BLUE), new GoalColor("teamkill.", EnumChatFormatting.GREEN),
new GoalColor("teamkill.", EnumChatFormatting.AQUA), new GoalColor("teamkill.", EnumChatFormatting.RED),
new GoalColor("teamkill.", EnumChatFormatting.LIGHT_PURPLE),
new GoalColor("teamkill.", EnumChatFormatting.YELLOW),
new GoalColor("teamkill.", EnumChatFormatting.WHITE) };
IScoreObjectiveCriteria[] field_178793_i = new IScoreObjectiveCriteria[] {
new GoalColor("killedByTeam.", EnumChatFormatting.BLACK),
new GoalColor("killedByTeam.", EnumChatFormatting.DARK_BLUE),
new GoalColor("killedByTeam.", EnumChatFormatting.DARK_GREEN),
new GoalColor("killedByTeam.", EnumChatFormatting.DARK_AQUA),
new GoalColor("killedByTeam.", EnumChatFormatting.DARK_RED),
new GoalColor("killedByTeam.", EnumChatFormatting.DARK_PURPLE),
new GoalColor("killedByTeam.", EnumChatFormatting.GOLD),
new GoalColor("killedByTeam.", EnumChatFormatting.GRAY),
new GoalColor("killedByTeam.", EnumChatFormatting.DARK_GRAY),
new GoalColor("killedByTeam.", EnumChatFormatting.BLUE),
new GoalColor("killedByTeam.", EnumChatFormatting.GREEN),
new GoalColor("killedByTeam.", EnumChatFormatting.AQUA),
new GoalColor("killedByTeam.", EnumChatFormatting.RED),
new GoalColor("killedByTeam.", EnumChatFormatting.LIGHT_PURPLE),
new GoalColor("killedByTeam.", EnumChatFormatting.YELLOW),
new GoalColor("killedByTeam.", EnumChatFormatting.WHITE) };
String getName();
int func_96635_a(List<EntityPlayer> var1);
boolean isReadOnly();
IScoreObjectiveCriteria.EnumRenderType getRenderType();
public static enum EnumRenderType {
INTEGER("integer"), HEARTS("hearts");
private static final Map<String, IScoreObjectiveCriteria.EnumRenderType> field_178801_c = Maps.newHashMap();
private final String field_178798_d;
private EnumRenderType(String parString2) {
this.field_178798_d = parString2;
}
public String func_178796_a() {
return this.field_178798_d;
}
public static IScoreObjectiveCriteria.EnumRenderType func_178795_a(String parString1) {
IScoreObjectiveCriteria.EnumRenderType iscoreobjectivecriteria$enumrendertype = (IScoreObjectiveCriteria.EnumRenderType) field_178801_c
.get(parString1);
return iscoreobjectivecriteria$enumrendertype == null ? INTEGER : iscoreobjectivecriteria$enumrendertype;
}
static {
for (IScoreObjectiveCriteria.EnumRenderType iscoreobjectivecriteria$enumrendertype : values()) {
field_178801_c.put(iscoreobjectivecriteria$enumrendertype.func_178796_a(),
iscoreobjectivecriteria$enumrendertype);
}
}
}
}

View file

@ -0,0 +1,117 @@
package net.minecraft.scoreboard;
import java.util.Comparator;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
/**+
* 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.
*
* 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)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class Score {
/**+
* Used for sorting score by points
*/
public static final Comparator<Score> scoreComparator = new Comparator<Score>() {
public int compare(Score score, Score score1) {
return score.getScorePoints() > score1.getScorePoints() ? 1
: (score.getScorePoints() < score1.getScorePoints() ? -1
: score1.getPlayerName().compareToIgnoreCase(score.getPlayerName()));
}
};
private final Scoreboard theScoreboard;
private final ScoreObjective theScoreObjective;
private final String scorePlayerName;
private int scorePoints;
private boolean locked;
private boolean field_178818_g;
public Score(Scoreboard theScoreboardIn, ScoreObjective theScoreObjectiveIn, String scorePlayerNameIn) {
this.theScoreboard = theScoreboardIn;
this.theScoreObjective = theScoreObjectiveIn;
this.scorePlayerName = scorePlayerNameIn;
this.field_178818_g = true;
}
public void increseScore(int amount) {
if (this.theScoreObjective.getCriteria().isReadOnly()) {
throw new IllegalStateException("Cannot modify read-only score");
} else {
this.setScorePoints(this.getScorePoints() + amount);
}
}
public void decreaseScore(int amount) {
if (this.theScoreObjective.getCriteria().isReadOnly()) {
throw new IllegalStateException("Cannot modify read-only score");
} else {
this.setScorePoints(this.getScorePoints() - amount);
}
}
public void func_96648_a() {
if (this.theScoreObjective.getCriteria().isReadOnly()) {
throw new IllegalStateException("Cannot modify read-only score");
} else {
this.increseScore(1);
}
}
public int getScorePoints() {
return this.scorePoints;
}
public void setScorePoints(int points) {
int i = this.scorePoints;
this.scorePoints = points;
if (i != points || this.field_178818_g) {
this.field_178818_g = false;
this.getScoreScoreboard().func_96536_a(this);
}
}
public ScoreObjective getObjective() {
return this.theScoreObjective;
}
/**+
* Returns the name of the player this score belongs to
*/
public String getPlayerName() {
return this.scorePlayerName;
}
public Scoreboard getScoreScoreboard() {
return this.theScoreboard;
}
public boolean isLocked() {
return this.locked;
}
public void setLocked(boolean locked) {
this.locked = locked;
}
public void func_96651_a(List<EntityPlayer> parList) {
this.setScorePoints(this.theScoreObjective.getCriteria().func_96635_a(parList));
}
}

View file

@ -0,0 +1,50 @@
package net.minecraft.scoreboard;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
/**+
* 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.
*
* 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)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class ScoreDummyCriteria implements IScoreObjectiveCriteria {
private final String dummyName;
public ScoreDummyCriteria(String name) {
this.dummyName = name;
IScoreObjectiveCriteria.INSTANCES.put(name, this);
}
public String getName() {
return this.dummyName;
}
public int func_96635_a(List<EntityPlayer> var1) {
return 0;
}
public boolean isReadOnly() {
return false;
}
public IScoreObjectiveCriteria.EnumRenderType getRenderType() {
return IScoreObjectiveCriteria.EnumRenderType.INTEGER;
}
}

View file

@ -0,0 +1,54 @@
package net.minecraft.scoreboard;
import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MathHelper;
/**+
* 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.
*
* 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)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class ScoreHealthCriteria extends ScoreDummyCriteria {
public ScoreHealthCriteria(String name) {
super(name);
}
public int func_96635_a(List<EntityPlayer> list) {
float f = 0.0F;
for (EntityPlayer entityplayer : list) {
f += entityplayer.getHealth() + entityplayer.getAbsorptionAmount();
}
if (list.size() > 0) {
f /= (float) list.size();
}
return MathHelper.ceiling_float_int(f);
}
public boolean isReadOnly() {
return true;
}
public IScoreObjectiveCriteria.EnumRenderType getRenderType() {
return IScoreObjectiveCriteria.EnumRenderType.HEARTS;
}
}

View file

@ -0,0 +1,67 @@
package net.minecraft.scoreboard;
/**+
* 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.
*
* 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)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class ScoreObjective {
private final Scoreboard theScoreboard;
private final String name;
private final IScoreObjectiveCriteria objectiveCriteria;
private IScoreObjectiveCriteria.EnumRenderType renderType;
private String displayName;
public ScoreObjective(Scoreboard theScoreboardIn, String nameIn, IScoreObjectiveCriteria objectiveCriteriaIn) {
this.theScoreboard = theScoreboardIn;
this.name = nameIn;
this.objectiveCriteria = objectiveCriteriaIn;
this.displayName = nameIn;
this.renderType = objectiveCriteriaIn.getRenderType();
}
public Scoreboard getScoreboard() {
return this.theScoreboard;
}
public String getName() {
return this.name;
}
public IScoreObjectiveCriteria getCriteria() {
return this.objectiveCriteria;
}
public String getDisplayName() {
return this.displayName;
}
public void setDisplayName(String nameIn) {
this.displayName = nameIn;
this.theScoreboard.func_96532_b(this);
}
public IScoreObjectiveCriteria.EnumRenderType getRenderType() {
return this.renderType;
}
public void setRenderType(IScoreObjectiveCriteria.EnumRenderType type) {
this.renderType = type;
this.theScoreboard.func_96532_b(this);
}
}

View file

@ -0,0 +1,178 @@
package net.minecraft.scoreboard;
import java.util.Collection;
import java.util.Set;
import com.google.common.collect.Sets;
import net.minecraft.util.EnumChatFormatting;
/**+
* 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.
*
* 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)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class ScorePlayerTeam extends Team {
private final Scoreboard theScoreboard;
private final String registeredName;
/**+
* A set of all team member usernames.
*/
private final Set<String> membershipSet = Sets.newHashSet();
private String teamNameSPT;
private String namePrefixSPT = "";
private String colorSuffix = "";
private boolean allowFriendlyFire = true;
private boolean canSeeFriendlyInvisibles = true;
private Team.EnumVisible nameTagVisibility = Team.EnumVisible.ALWAYS;
private Team.EnumVisible deathMessageVisibility = Team.EnumVisible.ALWAYS;
private EnumChatFormatting chatFormat = EnumChatFormatting.RESET;
public ScorePlayerTeam(Scoreboard theScoreboardIn, String name) {
this.theScoreboard = theScoreboardIn;
this.registeredName = name;
this.teamNameSPT = name;
}
/**+
* Retrieve the name by which this team is registered in the
* scoreboard
*/
public String getRegisteredName() {
return this.registeredName;
}
public String getTeamName() {
return this.teamNameSPT;
}
public void setTeamName(String name) {
if (name == null) {
throw new IllegalArgumentException("Name cannot be null");
} else {
this.teamNameSPT = name;
this.theScoreboard.sendTeamUpdate(this);
}
}
public Collection<String> getMembershipCollection() {
return this.membershipSet;
}
/**+
* Returns the color prefix for the player's team name
*/
public String getColorPrefix() {
return this.namePrefixSPT;
}
public void setNamePrefix(String prefix) {
if (prefix == null) {
throw new IllegalArgumentException("Prefix cannot be null");
} else {
this.namePrefixSPT = prefix;
this.theScoreboard.sendTeamUpdate(this);
}
}
/**+
* Returns the color suffix for the player's team name
*/
public String getColorSuffix() {
return this.colorSuffix;
}
public void setNameSuffix(String suffix) {
this.colorSuffix = suffix;
this.theScoreboard.sendTeamUpdate(this);
}
public String formatString(String input) {
return this.getColorPrefix() + input + this.getColorSuffix();
}
/**+
* Returns the player name including the color prefixes and
* suffixes
*/
public static String formatPlayerName(Team parTeam, String parString1) {
return parTeam == null ? parString1 : parTeam.formatString(parString1);
}
public boolean getAllowFriendlyFire() {
return this.allowFriendlyFire;
}
public void setAllowFriendlyFire(boolean friendlyFire) {
this.allowFriendlyFire = friendlyFire;
this.theScoreboard.sendTeamUpdate(this);
}
public boolean getSeeFriendlyInvisiblesEnabled() {
return this.canSeeFriendlyInvisibles;
}
public void setSeeFriendlyInvisiblesEnabled(boolean friendlyInvisibles) {
this.canSeeFriendlyInvisibles = friendlyInvisibles;
this.theScoreboard.sendTeamUpdate(this);
}
public Team.EnumVisible getNameTagVisibility() {
return this.nameTagVisibility;
}
public Team.EnumVisible getDeathMessageVisibility() {
return this.deathMessageVisibility;
}
public void setNameTagVisibility(Team.EnumVisible parEnumVisible) {
this.nameTagVisibility = parEnumVisible;
this.theScoreboard.sendTeamUpdate(this);
}
public void setDeathMessageVisibility(Team.EnumVisible parEnumVisible) {
this.deathMessageVisibility = parEnumVisible;
this.theScoreboard.sendTeamUpdate(this);
}
public int func_98299_i() {
int i = 0;
if (this.getAllowFriendlyFire()) {
i |= 1;
}
if (this.getSeeFriendlyInvisiblesEnabled()) {
i |= 2;
}
return i;
}
public void func_98298_a(int parInt1) {
this.setAllowFriendlyFire((parInt1 & 1) > 0);
this.setSeeFriendlyInvisiblesEnabled((parInt1 & 2) > 0);
}
public void setChatFormat(EnumChatFormatting parEnumChatFormatting) {
this.chatFormat = parEnumChatFormatting;
}
public EnumChatFormatting getChatFormat() {
return this.chatFormat;
}
}

View file

@ -0,0 +1,443 @@
package net.minecraft.scoreboard;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumChatFormatting;
/**+
* 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.
*
* 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)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class Scoreboard {
private final Map<String, ScoreObjective> scoreObjectives = Maps.newHashMap();
private final Map<IScoreObjectiveCriteria, List<ScoreObjective>> scoreObjectiveCriterias = Maps.newHashMap();
private final Map<String, Map<ScoreObjective, Score>> entitiesScoreObjectives = Maps.newHashMap();
/**+
* Index 0 is tab menu, 1 is sidebar, and 2 is below name
*/
private final ScoreObjective[] objectiveDisplaySlots = new ScoreObjective[19];
private final Map<String, ScorePlayerTeam> teams = Maps.newHashMap();
private final Map<String, ScorePlayerTeam> teamMemberships = Maps.newHashMap();
private static String[] field_178823_g = null;
/**+
* Returns a ScoreObjective for the objective name
*/
public ScoreObjective getObjective(String name) {
return (ScoreObjective) this.scoreObjectives.get(name);
}
/**+
* Create and returns the score objective for the given name and
* ScoreCriteria
*/
public ScoreObjective addScoreObjective(String name, IScoreObjectiveCriteria criteria) {
if (name.length() > 16) {
throw new IllegalArgumentException("The objective name \'" + name + "\' is too long!");
} else {
ScoreObjective scoreobjective = this.getObjective(name);
if (scoreobjective != null) {
throw new IllegalArgumentException("An objective with the name \'" + name + "\' already exists!");
} else {
scoreobjective = new ScoreObjective(this, name, criteria);
Object object = (List) this.scoreObjectiveCriterias.get(criteria);
if (object == null) {
object = Lists.newArrayList();
this.scoreObjectiveCriterias.put(criteria, (List<ScoreObjective>) object);
}
((List) object).add(scoreobjective);
this.scoreObjectives.put(name, scoreobjective);
this.onScoreObjectiveAdded(scoreobjective);
return scoreobjective;
}
}
}
/**+
* Returns all the objectives for the given criteria
*/
public Collection<ScoreObjective> getObjectivesFromCriteria(IScoreObjectiveCriteria criteria) {
Collection collection = (Collection) this.scoreObjectiveCriterias.get(criteria);
return collection == null ? Lists.newArrayList() : Lists.newArrayList(collection);
}
/**+
* Returns if the entity has the given ScoreObjective
*/
public boolean entityHasObjective(String name, ScoreObjective parScoreObjective) {
Map map = (Map) this.entitiesScoreObjectives.get(name);
if (map == null) {
return false;
} else {
Score score = (Score) map.get(parScoreObjective);
return score != null;
}
}
/**+
* Returns the value of the given objective for the given entity
* name
*/
public Score getValueFromObjective(String name, ScoreObjective objective) {
if (name.length() > 40) {
throw new IllegalArgumentException("The player name \'" + name + "\' is too long!");
} else {
Object object = (Map) this.entitiesScoreObjectives.get(name);
if (object == null) {
object = Maps.newHashMap();
this.entitiesScoreObjectives.put(name, (Map<ScoreObjective, Score>) object);
}
Score score = (Score) ((Map) object).get(objective);
if (score == null) {
score = new Score(this, objective, name);
((Map) object).put(objective, score);
}
return score;
}
}
/**+
* Returns an array of Score objects, sorting by
* Score.getScorePoints()
*/
public Collection<Score> getSortedScores(ScoreObjective objective) {
ArrayList arraylist = Lists.newArrayList();
for (Map map : this.entitiesScoreObjectives.values()) {
Score score = (Score) map.get(objective);
if (score != null) {
arraylist.add(score);
}
}
Collections.sort(arraylist, Score.scoreComparator);
return arraylist;
}
public Collection<ScoreObjective> getScoreObjectives() {
return this.scoreObjectives.values();
}
public Collection<String> getObjectiveNames() {
return this.entitiesScoreObjectives.keySet();
}
/**+
* Remove the given ScoreObjective for the given Entity name.
*/
public void removeObjectiveFromEntity(String name, ScoreObjective objective) {
if (objective == null) {
Map map = (Map) this.entitiesScoreObjectives.remove(name);
if (map != null) {
this.func_96516_a(name);
}
} else {
Map map2 = (Map) this.entitiesScoreObjectives.get(name);
if (map2 != null) {
Score score = (Score) map2.remove(objective);
if (map2.size() < 1) {
Map map1 = (Map) this.entitiesScoreObjectives.remove(name);
if (map1 != null) {
this.func_96516_a(name);
}
} else if (score != null) {
this.func_178820_a(name, objective);
}
}
}
}
public Collection<Score> getScores() {
Collection collection = this.entitiesScoreObjectives.values();
ArrayList arraylist = Lists.newArrayList();
for (Map map : (Collection<Map>) collection) {
arraylist.addAll(map.values());
}
return arraylist;
}
public Map<ScoreObjective, Score> getObjectivesForEntity(String name) {
Object object = (Map) this.entitiesScoreObjectives.get(name);
if (object == null) {
object = Maps.newHashMap();
}
return (Map<ScoreObjective, Score>) object;
}
public void removeObjective(ScoreObjective parScoreObjective) {
this.scoreObjectives.remove(parScoreObjective.getName());
for (int i = 0; i < 19; ++i) {
if (this.getObjectiveInDisplaySlot(i) == parScoreObjective) {
this.setObjectiveInDisplaySlot(i, (ScoreObjective) null);
}
}
List list = (List) this.scoreObjectiveCriterias.get(parScoreObjective.getCriteria());
if (list != null) {
list.remove(parScoreObjective);
}
for (Map map : this.entitiesScoreObjectives.values()) {
map.remove(parScoreObjective);
}
this.func_96533_c(parScoreObjective);
}
/**+
* 0 is tab menu, 1 is sidebar, 2 is below name
*/
public void setObjectiveInDisplaySlot(int parInt1, ScoreObjective parScoreObjective) {
this.objectiveDisplaySlots[parInt1] = parScoreObjective;
}
/**+
* 0 is tab menu, 1 is sidebar, 2 is below name
*/
public ScoreObjective getObjectiveInDisplaySlot(int parInt1) {
return this.objectiveDisplaySlots[parInt1];
}
/**+
* Retrieve the ScorePlayerTeam instance identified by the
* passed team name
*/
public ScorePlayerTeam getTeam(String parString1) {
return (ScorePlayerTeam) this.teams.get(parString1);
}
public ScorePlayerTeam createTeam(String parString1) {
if (parString1.length() > 16) {
throw new IllegalArgumentException("The team name \'" + parString1 + "\' is too long!");
} else {
ScorePlayerTeam scoreplayerteam = this.getTeam(parString1);
if (scoreplayerteam != null) {
throw new IllegalArgumentException("A team with the name \'" + parString1 + "\' already exists!");
} else {
scoreplayerteam = new ScorePlayerTeam(this, parString1);
this.teams.put(parString1, scoreplayerteam);
this.broadcastTeamCreated(scoreplayerteam);
return scoreplayerteam;
}
}
}
/**+
* Removes the team from the scoreboard, updates all player
* memberships and broadcasts the deletion to all players
*/
public void removeTeam(ScorePlayerTeam parScorePlayerTeam) {
this.teams.remove(parScorePlayerTeam.getRegisteredName());
for (String s : parScorePlayerTeam.getMembershipCollection()) {
this.teamMemberships.remove(s);
}
this.func_96513_c(parScorePlayerTeam);
}
/**+
* Adds a player to the given team
*/
public boolean addPlayerToTeam(String player, String newTeam) {
if (player.length() > 40) {
throw new IllegalArgumentException("The player name \'" + player + "\' is too long!");
} else if (!this.teams.containsKey(newTeam)) {
return false;
} else {
ScorePlayerTeam scoreplayerteam = this.getTeam(newTeam);
if (this.getPlayersTeam(player) != null) {
this.removePlayerFromTeams(player);
}
this.teamMemberships.put(player, scoreplayerteam);
scoreplayerteam.getMembershipCollection().add(player);
return true;
}
}
public boolean removePlayerFromTeams(String parString1) {
ScorePlayerTeam scoreplayerteam = this.getPlayersTeam(parString1);
if (scoreplayerteam != null) {
this.removePlayerFromTeam(parString1, scoreplayerteam);
return true;
} else {
return false;
}
}
/**+
* Removes the given username from the given ScorePlayerTeam. If
* the player is not on the team then an IllegalStateException
* is thrown.
*/
public void removePlayerFromTeam(String parString1, ScorePlayerTeam parScorePlayerTeam) {
if (this.getPlayersTeam(parString1) != parScorePlayerTeam) {
throw new IllegalStateException(
"Player is either on another team or not on any team. Cannot remove from team \'"
+ parScorePlayerTeam.getRegisteredName() + "\'.");
} else {
this.teamMemberships.remove(parString1);
parScorePlayerTeam.getMembershipCollection().remove(parString1);
}
}
/**+
* Retrieve all registered ScorePlayerTeam names
*/
public Collection<String> getTeamNames() {
return this.teams.keySet();
}
/**+
* Retrieve all registered ScorePlayerTeam instances
*/
public Collection<ScorePlayerTeam> getTeams() {
return this.teams.values();
}
/**+
* Gets the ScorePlayerTeam object for the given username.
*/
public ScorePlayerTeam getPlayersTeam(String parString1) {
return (ScorePlayerTeam) this.teamMemberships.get(parString1);
}
/**+
* Called when a score objective is added
*/
public void onScoreObjectiveAdded(ScoreObjective scoreObjectiveIn) {
}
public void func_96532_b(ScoreObjective parScoreObjective) {
}
public void func_96533_c(ScoreObjective parScoreObjective) {
}
public void func_96536_a(Score parScore) {
}
public void func_96516_a(String parString1) {
}
public void func_178820_a(String parString1, ScoreObjective parScoreObjective) {
}
/**+
* This packet will notify the players that this team is
* created, and that will register it on the client
*/
public void broadcastTeamCreated(ScorePlayerTeam playerTeam) {
}
/**+
* This packet will notify the players that this team is updated
*/
public void sendTeamUpdate(ScorePlayerTeam playerTeam) {
}
public void func_96513_c(ScorePlayerTeam playerTeam) {
}
/**+
* Returns 'list' for 0, 'sidebar' for 1, 'belowName for 2,
* otherwise null.
*/
public static String getObjectiveDisplaySlot(int parInt1) {
switch (parInt1) {
case 0:
return "list";
case 1:
return "sidebar";
case 2:
return "belowName";
default:
if (parInt1 >= 3 && parInt1 <= 18) {
EnumChatFormatting enumchatformatting = EnumChatFormatting.func_175744_a(parInt1 - 3);
if (enumchatformatting != null && enumchatformatting != EnumChatFormatting.RESET) {
return "sidebar.team." + enumchatformatting.getFriendlyName();
}
}
return null;
}
}
/**+
* Returns 0 for (case-insensitive) 'list', 1 for 'sidebar', 2
* for 'belowName', otherwise -1.
*/
public static int getObjectiveDisplaySlotNumber(String parString1) {
if (parString1.equalsIgnoreCase("list")) {
return 0;
} else if (parString1.equalsIgnoreCase("sidebar")) {
return 1;
} else if (parString1.equalsIgnoreCase("belowName")) {
return 2;
} else {
if (parString1.startsWith("sidebar.team.")) {
String s = parString1.substring("sidebar.team.".length());
EnumChatFormatting enumchatformatting = EnumChatFormatting.getValueByName(s);
if (enumchatformatting != null && enumchatformatting.getColorIndex() >= 0) {
return enumchatformatting.getColorIndex() + 3;
}
}
return -1;
}
}
public static String[] getDisplaySlotStrings() {
if (field_178823_g == null) {
field_178823_g = new String[19];
for (int i = 0; i < 19; ++i) {
field_178823_g[i] = getObjectiveDisplaySlot(i);
}
}
return field_178823_g;
}
public void func_181140_a(Entity parEntity) {
if (parEntity != null && !(parEntity instanceof EntityPlayer) && !parEntity.isEntityAlive()) {
String s = parEntity.getUniqueID().toString();
this.removeObjectiveFromEntity(s, (ScoreObjective) null);
this.removePlayerFromTeams(s);
}
}
}

View file

@ -0,0 +1,275 @@
package net.minecraft.scoreboard;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.WorldSavedData;
/**+
* 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.
*
* 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)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class ScoreboardSaveData extends WorldSavedData {
private static final Logger logger = LogManager.getLogger();
private Scoreboard theScoreboard;
private NBTTagCompound delayedInitNbt;
public ScoreboardSaveData() {
this("scoreboard");
}
public ScoreboardSaveData(String name) {
super(name);
}
public void setScoreboard(Scoreboard scoreboardIn) {
this.theScoreboard = scoreboardIn;
if (this.delayedInitNbt != null) {
this.readFromNBT(this.delayedInitNbt);
}
}
/**+
* reads in data from the NBTTagCompound into this MapDataBase
*/
public void readFromNBT(NBTTagCompound nbttagcompound) {
if (this.theScoreboard == null) {
this.delayedInitNbt = nbttagcompound;
} else {
this.readObjectives(nbttagcompound.getTagList("Objectives", 10));
this.readScores(nbttagcompound.getTagList("PlayerScores", 10));
if (nbttagcompound.hasKey("DisplaySlots", 10)) {
this.readDisplayConfig(nbttagcompound.getCompoundTag("DisplaySlots"));
}
if (nbttagcompound.hasKey("Teams", 9)) {
this.readTeams(nbttagcompound.getTagList("Teams", 10));
}
}
}
protected void readTeams(NBTTagList parNBTTagList) {
for (int i = 0; i < parNBTTagList.tagCount(); ++i) {
NBTTagCompound nbttagcompound = parNBTTagList.getCompoundTagAt(i);
String s = nbttagcompound.getString("Name");
if (s.length() > 16) {
s = s.substring(0, 16);
}
ScorePlayerTeam scoreplayerteam = this.theScoreboard.createTeam(s);
String s1 = nbttagcompound.getString("DisplayName");
if (s1.length() > 32) {
s1 = s1.substring(0, 32);
}
scoreplayerteam.setTeamName(s1);
if (nbttagcompound.hasKey("TeamColor", 8)) {
scoreplayerteam.setChatFormat(EnumChatFormatting.getValueByName(nbttagcompound.getString("TeamColor")));
}
scoreplayerteam.setNamePrefix(nbttagcompound.getString("Prefix"));
scoreplayerteam.setNameSuffix(nbttagcompound.getString("Suffix"));
if (nbttagcompound.hasKey("AllowFriendlyFire", 99)) {
scoreplayerteam.setAllowFriendlyFire(nbttagcompound.getBoolean("AllowFriendlyFire"));
}
if (nbttagcompound.hasKey("SeeFriendlyInvisibles", 99)) {
scoreplayerteam.setSeeFriendlyInvisiblesEnabled(nbttagcompound.getBoolean("SeeFriendlyInvisibles"));
}
if (nbttagcompound.hasKey("NameTagVisibility", 8)) {
Team.EnumVisible team$enumvisible = Team.EnumVisible
.func_178824_a(nbttagcompound.getString("NameTagVisibility"));
if (team$enumvisible != null) {
scoreplayerteam.setNameTagVisibility(team$enumvisible);
}
}
if (nbttagcompound.hasKey("DeathMessageVisibility", 8)) {
Team.EnumVisible team$enumvisible1 = Team.EnumVisible
.func_178824_a(nbttagcompound.getString("DeathMessageVisibility"));
if (team$enumvisible1 != null) {
scoreplayerteam.setDeathMessageVisibility(team$enumvisible1);
}
}
this.func_96502_a(scoreplayerteam, nbttagcompound.getTagList("Players", 8));
}
}
protected void func_96502_a(ScorePlayerTeam parScorePlayerTeam, NBTTagList parNBTTagList) {
for (int i = 0; i < parNBTTagList.tagCount(); ++i) {
this.theScoreboard.addPlayerToTeam(parNBTTagList.getStringTagAt(i), parScorePlayerTeam.getRegisteredName());
}
}
protected void readDisplayConfig(NBTTagCompound parNBTTagCompound) {
for (int i = 0; i < 19; ++i) {
if (parNBTTagCompound.hasKey("slot_" + i, 8)) {
String s = parNBTTagCompound.getString("slot_" + i);
ScoreObjective scoreobjective = this.theScoreboard.getObjective(s);
this.theScoreboard.setObjectiveInDisplaySlot(i, scoreobjective);
}
}
}
protected void readObjectives(NBTTagList nbt) {
for (int i = 0; i < nbt.tagCount(); ++i) {
NBTTagCompound nbttagcompound = nbt.getCompoundTagAt(i);
IScoreObjectiveCriteria iscoreobjectivecriteria = (IScoreObjectiveCriteria) IScoreObjectiveCriteria.INSTANCES
.get(nbttagcompound.getString("CriteriaName"));
if (iscoreobjectivecriteria != null) {
String s = nbttagcompound.getString("Name");
if (s.length() > 16) {
s = s.substring(0, 16);
}
ScoreObjective scoreobjective = this.theScoreboard.addScoreObjective(s, iscoreobjectivecriteria);
scoreobjective.setDisplayName(nbttagcompound.getString("DisplayName"));
scoreobjective.setRenderType(
IScoreObjectiveCriteria.EnumRenderType.func_178795_a(nbttagcompound.getString("RenderType")));
}
}
}
protected void readScores(NBTTagList nbt) {
for (int i = 0; i < nbt.tagCount(); ++i) {
NBTTagCompound nbttagcompound = nbt.getCompoundTagAt(i);
ScoreObjective scoreobjective = this.theScoreboard.getObjective(nbttagcompound.getString("Objective"));
String s = nbttagcompound.getString("Name");
if (s.length() > 40) {
s = s.substring(0, 40);
}
Score score = this.theScoreboard.getValueFromObjective(s, scoreobjective);
score.setScorePoints(nbttagcompound.getInteger("Score"));
if (nbttagcompound.hasKey("Locked")) {
score.setLocked(nbttagcompound.getBoolean("Locked"));
}
}
}
/**+
* write data to NBTTagCompound from this MapDataBase, similar
* to Entities and TileEntities
*/
public void writeToNBT(NBTTagCompound nbttagcompound) {
if (this.theScoreboard == null) {
logger.warn("Tried to save scoreboard without having a scoreboard...");
} else {
nbttagcompound.setTag("Objectives", this.objectivesToNbt());
nbttagcompound.setTag("PlayerScores", this.scoresToNbt());
nbttagcompound.setTag("Teams", this.func_96496_a());
this.func_96497_d(nbttagcompound);
}
}
protected NBTTagList func_96496_a() {
NBTTagList nbttaglist = new NBTTagList();
for (ScorePlayerTeam scoreplayerteam : this.theScoreboard.getTeams()) {
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setString("Name", scoreplayerteam.getRegisteredName());
nbttagcompound.setString("DisplayName", scoreplayerteam.getTeamName());
if (scoreplayerteam.getChatFormat().getColorIndex() >= 0) {
nbttagcompound.setString("TeamColor", scoreplayerteam.getChatFormat().getFriendlyName());
}
nbttagcompound.setString("Prefix", scoreplayerteam.getColorPrefix());
nbttagcompound.setString("Suffix", scoreplayerteam.getColorSuffix());
nbttagcompound.setBoolean("AllowFriendlyFire", scoreplayerteam.getAllowFriendlyFire());
nbttagcompound.setBoolean("SeeFriendlyInvisibles", scoreplayerteam.getSeeFriendlyInvisiblesEnabled());
nbttagcompound.setString("NameTagVisibility", scoreplayerteam.getNameTagVisibility().field_178830_e);
nbttagcompound.setString("DeathMessageVisibility",
scoreplayerteam.getDeathMessageVisibility().field_178830_e);
NBTTagList nbttaglist1 = new NBTTagList();
for (String s : scoreplayerteam.getMembershipCollection()) {
nbttaglist1.appendTag(new NBTTagString(s));
}
nbttagcompound.setTag("Players", nbttaglist1);
nbttaglist.appendTag(nbttagcompound);
}
return nbttaglist;
}
protected void func_96497_d(NBTTagCompound parNBTTagCompound) {
NBTTagCompound nbttagcompound = new NBTTagCompound();
boolean flag = false;
for (int i = 0; i < 19; ++i) {
ScoreObjective scoreobjective = this.theScoreboard.getObjectiveInDisplaySlot(i);
if (scoreobjective != null) {
nbttagcompound.setString("slot_" + i, scoreobjective.getName());
flag = true;
}
}
if (flag) {
parNBTTagCompound.setTag("DisplaySlots", nbttagcompound);
}
}
protected NBTTagList objectivesToNbt() {
NBTTagList nbttaglist = new NBTTagList();
for (ScoreObjective scoreobjective : this.theScoreboard.getScoreObjectives()) {
if (scoreobjective.getCriteria() != null) {
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setString("Name", scoreobjective.getName());
nbttagcompound.setString("CriteriaName", scoreobjective.getCriteria().getName());
nbttagcompound.setString("DisplayName", scoreobjective.getDisplayName());
nbttagcompound.setString("RenderType", scoreobjective.getRenderType().func_178796_a());
nbttaglist.appendTag(nbttagcompound);
}
}
return nbttaglist;
}
protected NBTTagList scoresToNbt() {
NBTTagList nbttaglist = new NBTTagList();
for (Score score : this.theScoreboard.getScores()) {
if (score.getObjective() != null) {
NBTTagCompound nbttagcompound = new NBTTagCompound();
nbttagcompound.setString("Name", score.getPlayerName());
nbttagcompound.setString("Objective", score.getObjective().getName());
nbttagcompound.setInteger("Score", score.getScorePoints());
nbttagcompound.setBoolean("Locked", score.isLocked());
nbttaglist.appendTag(nbttagcompound);
}
}
return nbttaglist;
}
}

View file

@ -0,0 +1,78 @@
package net.minecraft.scoreboard;
import java.util.Collection;
import java.util.Map;
import com.google.common.collect.Maps;
/**+
* 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.
*
* 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)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public abstract class Team {
/**+
* Same as ==
*/
public boolean isSameTeam(Team other) {
return other == null ? false : this == other;
}
public abstract String getRegisteredName();
public abstract String formatString(String var1);
public abstract boolean getSeeFriendlyInvisiblesEnabled();
public abstract boolean getAllowFriendlyFire();
public abstract Team.EnumVisible getNameTagVisibility();
public abstract Collection<String> getMembershipCollection();
public abstract Team.EnumVisible getDeathMessageVisibility();
public static enum EnumVisible {
ALWAYS("always", 0), NEVER("never", 1), HIDE_FOR_OTHER_TEAMS("hideForOtherTeams", 2),
HIDE_FOR_OWN_TEAM("hideForOwnTeam", 3);
private static Map<String, Team.EnumVisible> field_178828_g = Maps.newHashMap();
public final String field_178830_e;
public final int field_178827_f;
public static String[] func_178825_a() {
return (String[]) field_178828_g.keySet().toArray(new String[field_178828_g.size()]);
}
public static Team.EnumVisible func_178824_a(String parString1) {
return (Team.EnumVisible) field_178828_g.get(parString1);
}
private EnumVisible(String parString2, int parInt2) {
this.field_178830_e = parString2;
this.field_178827_f = parInt2;
}
static {
for (Team.EnumVisible team$enumvisible : values()) {
field_178828_g.put(team$enumvisible.field_178830_e, team$enumvisible);
}
}
}
}