This commit is contained in:
SeanOMik 2022-05-08 15:39:06 -04:00
parent 529a5463ba
commit a705cdfaf4
10 changed files with 60 additions and 60 deletions

View File

@ -518,16 +518,16 @@ public class EntityTamableFox extends EntityFox {
return super.r(entity); return super.r(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) { if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1);
}
} }
super.die(damageSource); super.die(damageSource);

View File

@ -518,16 +518,16 @@ public class EntityTamableFox extends EntityFox {
return super.r(entity); return super.r(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) { if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1);
}
} }
super.die(damageSource); super.die(damageSource);

View File

@ -520,16 +520,16 @@ public class EntityTamableFox extends EntityFox {
return super.r(entity); return super.r(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) { if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1);
}
} }
super.die(damageSource); super.die(damageSource);

View File

@ -512,16 +512,16 @@ public class EntityTamableFox extends EntityFox {
return super.r(entity); return super.r(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) { if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1);
}
} }
super.die(damageSource); super.die(damageSource);

View File

@ -512,16 +512,16 @@ public class EntityTamableFox extends EntityFox {
return super.r(entity); return super.r(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) { if (!this.world.isClientSide && this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES) && this.getOwner() instanceof EntityPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUniqueID(), 1);
}
} }
super.die(damageSource); super.die(damageSource);

View File

@ -543,17 +543,17 @@ public class EntityTamableFox extends Fox {
return super.isAlliedTo(entity); return super.isAlliedTo(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
@Override @Override
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) { if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1);
}
} }
super.die(damageSource); super.die(damageSource);

View File

@ -540,17 +540,17 @@ public class EntityTamableFox extends Fox {
return super.isAlliedTo(entity); return super.isAlliedTo(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
@Override @Override
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) { if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1);
}
} }
super.die(damageSource); super.die(damageSource);

View File

@ -562,17 +562,17 @@ public class EntityTamableFox extends Fox {
return super.isAlliedTo(entity); return super.isAlliedTo(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
@Override @Override
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) { if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1);
}
} }
super.die(damageSource); super.die(damageSource);

View File

@ -562,17 +562,17 @@ public class EntityTamableFox extends Fox {
return super.isAlliedTo(entity); return super.isAlliedTo(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
@Override @Override
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) { if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1);
}
} }
super.die(damageSource); super.die(damageSource);

View File

@ -560,17 +560,17 @@ public class EntityTamableFox extends Fox {
return super.isAlliedTo(entity); return super.isAlliedTo(entity);
} }
// When the fox dies, show a chat message. // When the fox dies, show a chat message, and remove the player's stored tamed foxed.
@Override @Override
public void die(DamageSource damageSource) { public void die(DamageSource damageSource) {
if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) { if (!this.getCommandSenderWorld().isClientSide && this.getCommandSenderWorld().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) {
this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID()); this.getOwner().sendMessage(this.getCombatTracker().getDeathMessage(), getOwnerUUID());
}
// Remove the amount of foxes the player has tamed if the limit is enabled. // Remove the amount of foxes the player has tamed if the limit is enabled.
if (Config.getMaxPlayerFoxTames() > 0) { if (Config.getMaxPlayerFoxTames() > 0) {
SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin); SQLiteHelper sqliteHelper = SQLiteHelper.getInstance(Utils.tamableFoxesPlugin);
sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1); sqliteHelper.removePlayerFoxAmount(this.getOwner().getUUID(), 1);
}
} }
super.die(damageSource); super.die(damageSource);