mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-26 14:54:12 -04:00
Fix /os env weather being case sensitive.
This commit is contained in:
parent
4b96f51fb7
commit
4645049cf6
34
Blocks/Block.CoreProps.cs
Normal file
34
Blocks/Block.CoreProps.cs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2015 MCGalaxy
|
||||||
|
|
||||||
|
Dual-licensed under the Educational Community License, Version 2.0 and
|
||||||
|
the GNU General Public License, Version 3 (the "Licenses"); you may
|
||||||
|
not use this file except in compliance with the Licenses. You may
|
||||||
|
obtain a copy of the Licenses at
|
||||||
|
|
||||||
|
http://www.opensource.org/licenses/ecl2.php
|
||||||
|
http://www.gnu.org/licenses/gpl-3.0.html
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing,
|
||||||
|
software distributed under the Licenses are distributed on an "AS IS"
|
||||||
|
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
||||||
|
or implied. See the Licenses for the specific language governing
|
||||||
|
permissions and limitations under the Licenses.
|
||||||
|
*/
|
||||||
|
using System;
|
||||||
|
using MCGalaxy.Blocks;
|
||||||
|
|
||||||
|
namespace MCGalaxy {
|
||||||
|
public sealed partial class Block {
|
||||||
|
public static BlockProps[] Properties = new BlockProps[256];
|
||||||
|
|
||||||
|
static void SetDefaultProperties() {
|
||||||
|
for (int i = 0; i < 256; i++) {
|
||||||
|
Properties[i] = new BlockProps((byte)i);
|
||||||
|
// Fallback for unrecognised physics blocks
|
||||||
|
if (i >= Block.CpeCount)
|
||||||
|
Properties[i].ConvertId = Block.orange;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -30,7 +30,24 @@ namespace MCGalaxy.Blocks {
|
|||||||
/// <summary> Block name used for in commands. </summary>
|
/// <summary> Block name used for in commands. </summary>
|
||||||
public string Name;
|
public string Name;
|
||||||
|
|
||||||
|
/// <summary> Whether this block is considered a tdoor. </summary>
|
||||||
|
public bool IsTDoor;
|
||||||
|
/// <summary> Whether this block is considered a message block. </summary>
|
||||||
|
public bool IsMessageBlock;
|
||||||
|
/// <summary> Whether this block is considered a portal. </summary>
|
||||||
|
public bool IsPortal;
|
||||||
|
|
||||||
|
/// <summary> Whether walkinhg through this block causes the death of that player. </summary>
|
||||||
|
public bool CausesDeath;
|
||||||
|
|
||||||
|
/// <summary> Whether light passes through this block. </summary>
|
||||||
|
public bool LightPasses;
|
||||||
|
|
||||||
|
/// <summary> Whether this block is an OP block (cannot be replaced by physics changes). </summary>
|
||||||
|
public bool OPBlock;
|
||||||
|
|
||||||
public BlockProps(byte type) {
|
public BlockProps(byte type) {
|
||||||
|
this = default(BlockProps);
|
||||||
ConvertId = type;
|
ConvertId = type;
|
||||||
SaveConvertId = type;
|
SaveConvertId = type;
|
||||||
Name = "unknown";
|
Name = "unknown";
|
||||||
|
@ -103,11 +103,11 @@ namespace MCGalaxy.Commands
|
|||||||
string col = value == "" ? "normal" : value;
|
string col = value == "" ? "normal" : value;
|
||||||
Command.all.Find("env").Use(p, "l " + type.ToLower() + " " + col);
|
Command.all.Find("env").Use(p, "l " + type.ToLower() + " " + col);
|
||||||
} else if (type == "WEATHER") {
|
} else if (type == "WEATHER") {
|
||||||
if (value == "SUN" || value == "NORMAL") {
|
if (value.CaselessEq("SUN") || value.CaselessEq("NORMAL")) {
|
||||||
Command.all.Find("env").Use(p, "weather 0");
|
Command.all.Find("env").Use(p, "weather 0");
|
||||||
} else if (value == "RAIN") {
|
} else if (value.CaselessEq("RAIN")) {
|
||||||
Command.all.Find("env").Use(p, "weather 1");
|
Command.all.Find("env").Use(p, "weather 1");
|
||||||
} else if (value == "SNOW") {
|
} else if (value.CaselessEq("SNOW")) {
|
||||||
Command.all.Find("env").Use(p, "weather 2");
|
Command.all.Find("env").Use(p, "weather 2");
|
||||||
} else {
|
} else {
|
||||||
Player.SendMessage(p, "/os env weather [sun/rain/snow/normal] -- Changes the weather of your map.");
|
Player.SendMessage(p, "/os env weather [sun/rain/snow/normal] -- Changes the weather of your map.");
|
||||||
@ -116,7 +116,7 @@ namespace MCGalaxy.Commands
|
|||||||
Player.SendMessage(p, "/os env [fog/cloud/sky/shadow/sun] [hex color code] -- Changes env colors of your map");
|
Player.SendMessage(p, "/os env [fog/cloud/sky/shadow/sun] [hex color code] -- Changes env colors of your map");
|
||||||
Player.SendMessage(p, "/os env level -- Sets the water height of your map");
|
Player.SendMessage(p, "/os env level -- Sets the water height of your map");
|
||||||
Player.SendMessage(p, "/os env cloudheight -- Sets the cloud height of your map");
|
Player.SendMessage(p, "/os env cloudheight -- Sets the cloud height of your map");
|
||||||
Player.SendMessage(p, "/os env maxcfog -- Sets the max fog distance in your map");
|
Player.SendMessage(p, "/os env maxfog -- Sets the max fog distance in your map");
|
||||||
Player.SendMessage(p, "/os env horizon -- Sets what block the \"ocean\" shows outside your map");
|
Player.SendMessage(p, "/os env horizon -- Sets what block the \"ocean\" shows outside your map");
|
||||||
Player.SendMessage(p, "/os env border -- Sets what block replaces the \"bedrock\" below sea level in your map");
|
Player.SendMessage(p, "/os env border -- Sets what block replaces the \"bedrock\" below sea level in your map");
|
||||||
Player.SendMessage(p, "/os env weather [sun/rain/snow/normal] -- Changes the weather of your map.");
|
Player.SendMessage(p, "/os env weather [sun/rain/snow/normal] -- Changes the weather of your map.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user