فهرست منبع

make light source blocks transparent by default so that its own light can pass through

Kolja Strohm 10 ماه پیش
والد
کامیت
4ac05b84ff
2فایلهای تغییر یافته به همراه7 افزوده شده و 5 حذف شده
  1. 5 4
      FactoryCraft/LightSources.cpp
  2. 2 1
      Windows Version/data/blocks/blockTypes.json

+ 5 - 4
FactoryCraft/LightSources.cpp

@@ -63,7 +63,9 @@ LightSourceItemType* LightSourceItemType::setColor(int color)
 BasicLightSource::BasicLightSource(
     int typeId, Framework::Vec3<int> pos, int dimensionId)
     : Block(typeId, pos, dimensionId, false)
-{}
+{
+    transparent = true;
+}
 
 void BasicLightSource::setLight(int light)
 {
@@ -165,7 +167,7 @@ ItemType* BasicLightSourceBlockType::createItemType() const
                 getName(),
                 50,
                 getGroupNames()))
-        ->setColor(0x00F69A54);
+        ->setColor(lightColor);
 }
 
 void BasicLightSourceBlockType::setItemTypeName(Framework::Text itemTypeName)
@@ -262,8 +264,7 @@ Framework::JSON::JSONObject* BasicLightSourceBlockTypeFactory::toJsonObject(
 JSONObjectValidationBuilder* BasicLightSourceBlockTypeFactory::addToValidator(
     JSONObjectValidationBuilder* builder) const
 {
-    return BlockTypeFactoryBase::addToValidator(
-        builder
+    return BlockTypeFactoryBase::addToValidator(builder
             ->withRequiredAttribute("itemType",
                 Game::INSTANCE->zTypeRegistry()->getValidator<Framework::Text>(
                     ItemTypeNameFactory::TYPE_ID))

+ 2 - 1
Windows Version/data/blocks/blockTypes.json

@@ -1100,6 +1100,7 @@
       ]
     },
     "mapColor": "0xFFE25822",
-    "lightColor": "0x00E25822"
+    "lightColor": "0x00E25822",
+    "lightSource": true
   }
 ]