예제 #1
0
 public DecorativeTypeZMinus(string name, string shape, string modname) : base(name + shape + "z-", false)
 {
     this.ParentType  = name + shape;
     this.IsPlaceable = true;
     if (MeshManager.GetMesh(modname, shape + "z-", out string mesh))
     {
         this.Mesh = mesh;
     }
 }
예제 #2
0
 public AdvancedBatteryBlock() : base("Advanced Battery", false)
 {
     this.IsPlaceable = true;
     if (MeshManager.GetMesh(Entry.ModName, "battery2", out string mesh))
     {
         this.Mesh = mesh;
     }
     this.Icon = Utilities.MultiCombine(Entry.ModIconDirectory, "battery2.png");
     PowerManager.ValidateBlockID(this.TypeName, new AdvancedBattery());
 }
예제 #3
0
 public SawmillBlock() : base("Sawmill", true)
 {
     if (MeshManager.GetMesh(Entry.ModName, "sawmill", out string mesh))
     {
         this.Mesh = mesh;
     }
     //this.Colliders = Helpers.Colliders.GetColliders("twohigh");
     this.Icon        = Utilities.MultiCombine(Entry.ModIconDirectory, "sawmill.png");
     this.IsPlaceable = true;
     PowerManager.ValidateBlockID(this.TypeName, new Sawmill());
 }
예제 #4
0
        public StoneCrusherBlock() : base("Stone Crusher", false)
        {
            this.IsPlaceable = true;
            this.Icon        = NewColonyAPI.Helpers.Utilities.MultiCombine(Entry.ModIconDirectory, "crusher.png");

            if (MeshManager.GetMesh(Entry.ModName, "crusher", out string mesh))
            {
                this.Mesh = mesh;
            }
            PowerManager.ValidateBlockID(this.TypeName, new StoneCrusher());
        }
예제 #5
0
        public PowerLineBaseZMinusYMinus() : base("PowerLineBaseZMinusYMinus", false)
        {
            if (MeshManager.GetMesh(NewColonyAPIEntry.ModName, "newpowerlinel", out string mesh))
            {
                this.Mesh = mesh;
            }
            this.MeshRotationEuler = new Pipliz.Vector3Int(0, 0, 90);
            this.IsPlaceable       = true;

            this.OnRemove = new ItemTypes.ItemTypeRawDrops[] { new ItemTypes.ItemTypeRawDrops("PowerLineBase", 1, 1) };
            PowerManager.ValidateBlockID(this.TypeName, new PowerLine(this.TypeName));
        }
예제 #6
0
        public PowerLineBaseXZY() : base("PowerLineBaseXZY", false)
        {
            if (MeshManager.GetMesh(NewColonyAPIEntry.ModName, "newpowerlineall", out string mesh))
            {
                this.Mesh = mesh;
            }
            this.IsPlaceable = true;

            this.OnRemove = new ItemTypes.ItemTypeRawDrops[] { new ItemTypes.ItemTypeRawDrops("PowerLineBase", 1, 1) };

            PowerManager.ValidateBlockID(this.TypeName, new PowerLine(this.TypeName));
        }
예제 #7
0
        public PowerLineBase() : base("PowerLineBase", false)
        {
            if (MeshManager.GetMesh(NewColonyAPIEntry.ModName, "newpowerlinebase", out string mesh))
            {
                this.Mesh = mesh;
            }

            this.IsPlaceable = true;
            this.Icon        = Utilities.MultiCombine(NewColonyAPIEntry.ModIconDirectory, "powerlinebase.png");

            PowerManager.ValidateBlockID(this.TypeName, new PowerLine(this.TypeName));
        }
예제 #8
0
        public DecorativeType(string name, string shape, string icon, string modname) : base(name + shape, false)
        {
            this.OnPlaceAudio  = "stonePlace";
            this.OnRemoveAudio = "stonePlace";

            this.Icon        = icon;
            this.IsRotatable = true;
            if (MeshManager.GetMesh(modname, shape, out string mesh))
            {
                this.Mesh = mesh;
            }
        }
예제 #9
0
 public plasterblockspike() : base("plasterblockspike", false)
 {
     this.SideAll     = "plasterblock";
     this.IsPlaceable = true;
     this.Icon        = Utilities.MultiCombine(Entry.ModIconDirectory, "plasterblockspike.png");
     this.Categories  = new System.Collections.Generic.List <string> {
         "decorative"
     };
     if (MeshManager.GetMesh(Entry.ModName, "spike", out string mesh))
     {
         this.Mesh = mesh;
     }
 }
예제 #10
0
 public override void OnBeforeRender(ICoreClientAPI capi, ItemStack itemstack, EnumItemRenderTarget target, ref ItemRenderInfo renderinfo)
 {
     base.OnBeforeRender(capi, itemstack, target, ref renderinfo);
     if (itemstack.Attributes.GetOrAddTreeAttribute("toolparts").Count > 0)
     {
         MeshRef meshRef = MeshManager.GetMesh(api.World as ClientMain, itemstack);
         System.Console.WriteLine("MeshRef exists: {0}", meshRef != null);
         if (meshRef != null)
         {
             renderinfo.ModelRef = meshRef;
         }
     }
 }
예제 #11
0
 public GeoDasherBlock() : base("Geo Dasher", false)
 {
     this.IsPlaceable     = true;
     this.IsRotatable     = true;
     this.RotatableXMinus = "Geo Dasherx-";
     this.RotatableXPlus  = "Geo Dasherx+";
     this.RotatableZMinus = "Geo Dasherz-";
     this.RotatableZPlus  = "Geo Dasherz+";
     this.Icon            = NewColonyAPI.Helpers.Utilities.MultiCombine(Entry.ModIconDirectory, "geodasher.png");
     if (MeshManager.GetMesh(Entry.ModName, "gate", out string mesh))
     {
         this.Mesh = mesh;
     }
 }
예제 #12
0
 public HalfSlabBottom() : base("HalfSlabBottom", false)
 {
     this.SideAll     = "planks";
     this.IsPlaceable = true;
     this.Icon        = "halfslab.png";
     this.Categories  = new System.Collections.Generic.List <string> {
         "decorative"
     };
     if (MeshManager.GetMesh(Entry.ModName, "halfslabbottom2", out string mesh))
     {
         this.Mesh = mesh;
     }
     this.Colors = new string[] { "#ff0000->#eeeeee" };
 }
예제 #13
0
 public GeneratorBlock() : base("Generator", false)
 {
     this.IsPlaceable = true;
     this.Icon        = NewColonyAPI.Helpers.Utilities.MultiCombine(Entry.ModIconDirectory, "generator.png");
     if (MeshManager.GetMesh(Entry.ModName, "generator", out string mesh))
     {
         this.Mesh = mesh;
     }
     this.IsRotatable     = true;
     this.RotatableXMinus = this.TypeName + "X-";
     this.RotatableXPlus  = this.TypeName + "X+";
     this.RotatableZMinus = this.TypeName + "Z-";
     this.RotatableZPlus  = this.TypeName + "Z+";
     PowerManager.ValidateBlockID(this.TypeName, new BasicGenerator());
 }
예제 #14
0
 public GeneratorBlockLit() : base("GeneratorLit", false)
 {
     this.IsPlaceable     = true;
     this.IsRotatable     = true;
     this.RotatableXMinus = "GeneratorLitX-";
     this.RotatableXPlus  = "GeneratorLitX+";
     this.RotatableZMinus = "GeneratorLitZ-";
     this.RotatableZPlus  = "GeneratorLitZ+";
     if (MeshManager.GetMesh(Entry.ModName, "generator", out string mesh))
     {
         this.Mesh = mesh;
     }
     PowerManager.ValidateBlockID(this.TypeName, new BasicGenerator());
     this.OnRemove = new ItemTypes.ItemTypeRawDrops[] { new ItemTypes.ItemTypeRawDrops("Generator", 1, 1) };
 }
예제 #15
0
 public GreatWater() : base("GreatWater", false)
 {
     this.IsPlaceable   = false;
     this.SideAll       = "greatwater";
     this.BlocksPathing = false;
     if (MeshManager.GetMesh(NewColonyAPIEntry.ModName, "block", out string mesh))
     {
         this.Mesh = mesh;
     }
     this.CollidePlayer  = false;
     this.IsSolid        = false;
     this.IsDestructible = false;
     this.OnRemoveAmount = 0;
     this.UseHeightMap   = true;
     this.UseNormalMap   = true;
 }
예제 #16
0
        public static void AddModels(Simulation Simulation)
        {
            Simulation.Statics.Add(new StaticDescription(new Vector3(0, 0.5f, 0), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(ZeroMeshHandle)), 0.1f)));        //Origin Zero Marker

            Simulation.Statics.Add(new StaticDescription(new Vector3(9.5f, 0.5f, -10f), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(OneMeshHandle)), 0.1f)));   //(10, 10) One Marker
            Simulation.Statics.Add(new StaticDescription(new Vector3(10.5f, 0.5f, -10f), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(ZeroMeshHandle)), 0.1f))); //(10, 10) Zero Marker

            Simulation.Statics.Add(new StaticDescription(new Vector3(1, 0.5f, 0), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(OneMeshHandle)), 0.1f)));         //X One
            Simulation.Statics.Add(new StaticDescription(new Vector3(2, 0.5f, 0), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(TwoMeshHandle)), 0.1f)));         //X Two
            Simulation.Statics.Add(new StaticDescription(new Vector3(3, 0.5f, 0), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(ThreeMeshHandle)), 0.1f)));       //X Three
            Simulation.Statics.Add(new StaticDescription(new Vector3(4, 0.5f, 0), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(FourMeshHandle)), 0.1f)));        //X Four
            Simulation.Statics.Add(new StaticDescription(new Vector3(5, 0.5f, 0), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(FiveMeshHandle)), 0.1f)));        //X Five
            Simulation.Statics.Add(new StaticDescription(new Vector3(6, 0.5f, 0), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(SixMeshHandle)), 0.1f)));         //X Six
            Simulation.Statics.Add(new StaticDescription(new Vector3(7, 0.5f, 0), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(SevenMeshHandle)), 0.1f)));       //X Seven
            Simulation.Statics.Add(new StaticDescription(new Vector3(8, 0.5f, 0), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(EightMeshHandle)), 0.1f)));       //X Eight
            Simulation.Statics.Add(new StaticDescription(new Vector3(9, 0.5f, 0), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(NineMeshHandle)), 0.1f)));        //X Nine

            Simulation.Statics.Add(new StaticDescription(new Vector3(0, 0.5f, -1), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(OneMeshHandle)), 0.1f)));        //Z One
            Simulation.Statics.Add(new StaticDescription(new Vector3(0, 0.5f, -2), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(TwoMeshHandle)), 0.1f)));        //Z Two
            Simulation.Statics.Add(new StaticDescription(new Vector3(0, 0.5f, -3), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(ThreeMeshHandle)), 0.1f)));      //Z Three
            Simulation.Statics.Add(new StaticDescription(new Vector3(0, 0.5f, -4), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(FourMeshHandle)), 0.1f)));       //Z Four
            Simulation.Statics.Add(new StaticDescription(new Vector3(0, 0.5f, -5), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(FiveMeshHandle)), 0.1f)));       //Z Five
            Simulation.Statics.Add(new StaticDescription(new Vector3(0, 0.5f, -6), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(SixMeshHandle)), 0.1f)));        //Z Six
            Simulation.Statics.Add(new StaticDescription(new Vector3(0, 0.5f, -7), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(SevenMeshHandle)), 0.1f)));      //Z Seven
            Simulation.Statics.Add(new StaticDescription(new Vector3(0, 0.5f, -8), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(EightMeshHandle)), 0.1f)));      //Z Eight
            Simulation.Statics.Add(new StaticDescription(new Vector3(0, 0.5f, -9), new CollidableDescription(Simulation.Shapes.Add(MeshManager.GetMesh(NineMeshHandle)), 0.1f)));       //Z Nine
        }
예제 #17
0
        public BaseItem(string name, string meshname, string hexcode, Rotation rotation, bool lit) : base()
        {
            if (rotation == Rotation.Base)
            {
                this.IsPlaceable = true;
                this.IsRotatable = true;
                this.Icon        = NewColonyAPI.Helpers.Utilities.MultiCombine(Entry.ModIconDirectory, name + ".png");
                this.Categories  = new List <string>()
                {
                    "decorative"
                };
                if (MeshManager.GetMesh(Entry.ModName, meshname, out string mesh))
                {
                    this.Mesh = mesh;
                }

                if (lit)
                {
                    this.TypeName        = name + "lit";
                    this.SideAll         = "ColouredLettersLit";
                    this.RotatableXMinus = name + "litxminus";
                    this.RotatableXPlus  = name + "litxplus";
                    this.RotatableZMinus = name + "litzminus";
                    this.RotatableZPlus  = name + "litzplus";
                }
                else
                {
                    this.TypeName        = name;
                    this.SideAll         = "ColouredLetters";
                    this.RotatableXMinus = name + "xminus";
                    this.RotatableXPlus  = name + "xplus";
                    this.RotatableZMinus = name + "zminus";
                    this.RotatableZPlus  = name + "zplus";
                }
            }

            switch (rotation)
            {
            case Rotation.XMinus:
                if (lit)
                {
                    this.ParentType = name + "lit";
                    this.TypeName   = name + "litxminus";
                    this.Torches    = new Torches[]
                    {
                        new Torches()
                        {
                            color     = "#" + hexcode,
                            range     = 1,
                            intensity = 10f,
                            volume    = 1f
                        }
                    };
                }
                else
                {
                    this.ParentType = name;
                    this.TypeName   = name + "xminus";
                }
                this.OnRemove          = new ItemTypes.ItemTypeRawDrops[] { new ItemTypes.ItemTypeRawDrops(this.ParentType, 1, 1) };
                this.Colors            = new string[] { "#ff0000->#" + hexcode };
                this.MeshRotationEuler = new Pipliz.Vector3Int(0, 90, 0);
                break;

            case Rotation.XPlus:
                if (lit)
                {
                    this.ParentType = name + "lit";
                    this.TypeName   = name + "litxplus";
                    this.Torches    = new Torches[]
                    {
                        new Torches()
                        {
                            color     = "#" + hexcode,
                            range     = 1,
                            intensity = 10f,
                            volume    = 1f
                        }
                    };
                }
                else
                {
                    this.ParentType = name;
                    this.TypeName   = name + "xplus";
                }
                this.OnRemove          = new ItemTypes.ItemTypeRawDrops[] { new ItemTypes.ItemTypeRawDrops(this.ParentType, 1, 1) };
                this.Colors            = new string[] { "#ff0000->#" + hexcode };
                this.MeshRotationEuler = new Pipliz.Vector3Int(0, 270, 0);
                break;

            case Rotation.ZMinus:
                if (lit)
                {
                    this.ParentType = name + "lit";
                    this.TypeName   = name + "litzminus";
                    this.Torches    = new Torches[]
                    {
                        new Torches()
                        {
                            color     = "#" + hexcode,
                            range     = 1,
                            intensity = 10f,
                            volume    = 1f
                        }
                    };
                }
                else
                {
                    this.ParentType = name;
                    this.TypeName   = name + "zminus";
                }
                this.OnRemove = new ItemTypes.ItemTypeRawDrops[] { new ItemTypes.ItemTypeRawDrops(this.ParentType, 1, 1) };
                this.Colors   = new string[] { "#ff0000->#" + hexcode };
                //this.MeshRotationEuler = new Pipliz.Vector3Int(0, 0, 0);
                break;

            case Rotation.ZPlus:

                if (lit)
                {
                    this.ParentType = name + "lit";
                    this.TypeName   = name + "litzplus";
                    this.Torches    = new Torches[]
                    {
                        new Torches()
                        {
                            color     = "#" + hexcode,
                            range     = 1,
                            intensity = 10f,
                            volume    = 1f
                        }
                    };
                }
                else
                {
                    this.ParentType = name;
                    this.TypeName   = name + "zplus";
                }
                this.OnRemove          = new ItemTypes.ItemTypeRawDrops[] { new ItemTypes.ItemTypeRawDrops(this.ParentType, 1, 1) };
                this.Colors            = new string[] { "#ff0000->#" + hexcode };
                this.MeshRotationEuler = new Pipliz.Vector3Int(0, 180, 0);
                break;
            }
        }