34 lines
931 B
C#
34 lines
931 B
C#
|
// DEBUG WorldGen System for testing
|
|||
|
using Terraria;
|
|||
|
using Terraria.ModLoader;
|
|||
|
using Microsoft.Xna.Framework.Input;
|
|||
|
using Terraria.ID;
|
|||
|
using Microsoft.Xna.Framework;
|
|||
|
using Terraria.GameContent.Generation;
|
|||
|
using continuity.Content.Tiles;
|
|||
|
|
|||
|
#if DEBUG
|
|||
|
namespace continuity.Utilities
|
|||
|
{
|
|||
|
public class WorldGenWorld : ModSystem
|
|||
|
{
|
|||
|
public static bool JustPressed(Keys key) {
|
|||
|
return Main.keyState.IsKeyDown(key) && !Main.oldKeyState.IsKeyDown(key);
|
|||
|
}
|
|||
|
|
|||
|
public override void PostUpdateWorld() {
|
|||
|
if (JustPressed(Keys.D1))
|
|||
|
TestMethod((int)Main.MouseWorld.X / 16, (int)Main.MouseWorld.Y / 16);
|
|||
|
}
|
|||
|
|
|||
|
// implement whatever test code you want here.
|
|||
|
private void TestMethod(int x, int y) {
|
|||
|
Dust.QuickBox(new Vector2(x, y) * 16, new Vector2(x + 1, y + 1) * 16, 2, Color.YellowGreen, null);
|
|||
|
|
|||
|
// Code to test placed here:
|
|||
|
WorldGen.OreRunner(x, y, 8, 2, (ushort)ModContent.TileType<CoalTile>());
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
#endif
|