mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-27 15:30:58 -04:00
Restrict scale for players in /model
This commit is contained in:
parent
3bf2de0d22
commit
faa46585ad
@ -43,6 +43,7 @@ namespace MCGalaxy.Commands.CPE {
|
||||
protected override void SetBotData(Player p, PlayerBot bot, string model) {
|
||||
bool changedAxisScale;
|
||||
model = ParseModel(p, bot, model, out changedAxisScale);
|
||||
if (model == null) return;
|
||||
Entities.UpdateModel(bot, model);
|
||||
|
||||
p.Message("You changed the model of bot " + bot.ColoredName + " %Sto a &c" + model);
|
||||
@ -52,6 +53,7 @@ namespace MCGalaxy.Commands.CPE {
|
||||
protected override void SetPlayerData(Player p, Player who, string model) {
|
||||
bool changedAxisScale;
|
||||
model = ParseModel(p, who, model, out changedAxisScale);
|
||||
if (model == null) return;
|
||||
Entities.UpdateModel(who, model);
|
||||
|
||||
if (p != who) {
|
||||
@ -98,6 +100,14 @@ namespace MCGalaxy.Commands.CPE {
|
||||
changedAxisScale = true;
|
||||
return ParseModelScale(dst, entity, model, "Z scale", ref entity.ScaleZ);
|
||||
}
|
||||
|
||||
float max = ModelInfo.MaxScale(entity);
|
||||
// restrict player model scale, but bots can have unlimited model scale
|
||||
if (ModelInfo.GetRawScale(model) > max) {
|
||||
dst.Message("%WScale must be {0} or less for {1} model",
|
||||
max, ModelInfo.GetRawModel(model));
|
||||
return null;
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user