Skip to content

Commit

Permalink
Reverted 1.7.10 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ata4 committed Aug 19, 2014
1 parent 9ba53ae commit 8061ff5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public class DragonMountsConfig {
private boolean debug = false;

public DragonMountsConfig(Configuration config) {
eggsInChests = config.getBoolean("eggsInChests", "server", eggsInChests, "Spawns dragon eggs in generated chests when enabled");
dragonEntityID = config.getInt("dragonEntityID", "server", dragonEntityID, -1, 255, "Overrides the entity ID for dragons to fix problems with manual IDs from other mods.\nSet to -1 for automatic assignment (recommended).\nWarning: wrong values may cause crashes and loss of data!");
debug = config.getBoolean("debug", "client", debug, "Debug mode. Unless you're a developer or are told to activate it, you don't want to set this to true.");
eggsInChests = config.get("server", "eggsInChests", eggsInChests, "Spawns dragon eggs in generated chests when enabled").getBoolean(eggsInChests);
dragonEntityID = config.get("server", "dragonEntityID", dragonEntityID, "Overrides the entity ID for dragons to fix problems with manual IDs from other mods.\nSet to -1 for automatic assignment (recommended).\nWarning: wrong values may cause crashes and loss of data!").getInt(dragonEntityID);
debug = config.get("client", "debug", debug, "Debug mode. Unless you're a developer or are told to activate it, you don't want to set this to true.").getBoolean(debug);

if (config.hasChanged()) {
config.save();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import net.minecraft.entity.DataWatcher;
import net.minecraft.entity.DataWatcher.WatchableObject;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAITasks;
import net.minecraft.entity.ai.EntityAITasks.EntityAITaskEntry;
import net.minecraft.entity.ai.attributes.IAttributeInstance;
Expand Down Expand Up @@ -234,17 +233,11 @@ private void renderEntityInfo() {
text.printf("Size: %s (w:%s h:%s)\n", scale, width, height);

// tamed flag/owner name
//String tamedString = dragon.getOwnerName();
String tamedString;
if (dragon.isTamed()) {
EntityLivingBase player = dragon.getOwner();
if (player != null) {
tamedString = "yes (" + player.getCommandSenderName() + ")";
} else {
tamedString = "yes (" + StringUtils.abbreviate(dragon.func_152113_b(), 22) + ")";
}
} else {
String tamedString = dragon.getOwnerName();
if (tamedString.isEmpty()) {
tamedString = "no";
} else {
tamedString = "yes (" + tamedString + ")";
}
text.println("Tamed: " + tamedString);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,8 +451,7 @@ public boolean interact(EntityPlayer player) {
return true;
}

//if (!isOwner(player)) {
if (!func_152114_e(player)) {
if (!isOwner(player)) {
if (isServer()) {
// that's not your dragon!
player.addChatMessage(new ChatComponentTranslation("dragon.owned"));
Expand Down Expand Up @@ -503,8 +502,7 @@ public void tamedFor(EntityPlayer player, boolean successful) {
setTamed(true);
setPathToEntity(null);
setAttackTarget(null);
//setOwner(player.getCommandSenderName());
func_152115_b(player.getUniqueID().toString());
setOwner(player.getCommandSenderName());
playTameEffect(true);
worldObj.setEntityState(this, (byte) 7);
} else {
Expand Down Expand Up @@ -537,11 +535,11 @@ public boolean isBreedingItem(ItemStack item) {
@Override
public float getEyeHeight() {
float eyeHeight = super.getEyeHeight();

if (isSitting()) {
eyeHeight *= 0.8f;
}

return eyeHeight;
}

Expand Down Expand Up @@ -770,6 +768,14 @@ public DragonBreed getBreed() {
public void setBreed(DragonBreed breed) {
getBreedHelper().setBreed(breed);
}

public boolean isOwner(EntityPlayer player) {
return player.getCommandSenderName().equalsIgnoreCase(getOwnerName());
}

public boolean isRiddenByOwner() {
return riddenByEntity == getOwner();
}

public EntityPlayer getRidingPlayer() {
if (riddenByEntity instanceof EntityPlayer) {
Expand Down Expand Up @@ -843,7 +849,7 @@ public boolean isInvulnerableTo(DamageSource src) {

return getBreed().isImmuneToDamage(src);
}

/**
* Returns the entity's health relative to the maximum health.
*
Expand Down

0 comments on commit 8061ff5

Please sign in to comment.