Compare commits
2 Commits
6655e603e3
...
7f02401df4
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f02401df4 | |||
| 1d418ec614 |
@@ -120,6 +120,9 @@ public class BlockEntityButterflyPinBoard : BlockEntityDisplay
|
|||||||
double height = (1 - (BoardMargin * 2)) / Rows;
|
double height = (1 - (BoardMargin * 2)) / Rows;
|
||||||
|
|
||||||
int column = GameMath.Clamp((int)((local.X - BoardMargin) / width), 0, Columns - 1);
|
int column = GameMath.Clamp((int)((local.X - BoardMargin) / width), 0, Columns - 1);
|
||||||
|
if (IsNorthSouthVariant())
|
||||||
|
column = (Columns - 1) - column;
|
||||||
|
|
||||||
int rowFromBottom = GameMath.Clamp((int)((local.Y - BoardMargin) / height), 0, Rows - 1);
|
int rowFromBottom = GameMath.Clamp((int)((local.Y - BoardMargin) / height), 0, Rows - 1);
|
||||||
int rowFromTop = Rows - 1 - rowFromBottom;
|
int rowFromTop = Rows - 1 - rowFromBottom;
|
||||||
|
|
||||||
@@ -205,6 +208,12 @@ public class BlockEntityButterflyPinBoard : BlockEntityDisplay
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool IsNorthSouthVariant()
|
||||||
|
{
|
||||||
|
string side = Block?.Variant?["side"] ?? "south";
|
||||||
|
return side is "north" or "south";
|
||||||
|
}
|
||||||
|
|
||||||
public float GetRenderScale()
|
public float GetRenderScale()
|
||||||
{
|
{
|
||||||
return RenderScale;
|
return RenderScale;
|
||||||
|
|||||||
@@ -25,10 +25,10 @@
|
|||||||
"decorative": ["pinboard2x2-south"]
|
"decorative": ["pinboard2x2-south"]
|
||||||
},
|
},
|
||||||
"shapebytype": {
|
"shapebytype": {
|
||||||
"*-north": { "base": "butterflypins:block/pinboard-2x2", "rotateY": 180 },
|
"*-north": { "base": "dusiulkaspinboard:block/pinboard-2x2", "rotateY": 180 },
|
||||||
"*-east": { "base": "butterflypins:block/pinboard-2x2", "rotateY": 90 },
|
"*-east": { "base": "dusiulkaspinboard:block/pinboard-2x2", "rotateY": 90 },
|
||||||
"*-south": { "base": "butterflypins:block/pinboard-2x2", "rotateY": 0 },
|
"*-south": { "base": "dusiulkaspinboard:block/pinboard-2x2", "rotateY": 0 },
|
||||||
"*-west": { "base": "butterflypins:block/pinboard-2x2", "rotateY": 270 }
|
"*-west": { "base": "dusiulkaspinboard:block/pinboard-2x2", "rotateY": 270 }
|
||||||
},
|
},
|
||||||
"blockmaterial": "Wood",
|
"blockmaterial": "Wood",
|
||||||
"drawtype": "json",
|
"drawtype": "json",
|
||||||
@@ -25,10 +25,10 @@
|
|||||||
"decorative": ["pinboard3x3-south"]
|
"decorative": ["pinboard3x3-south"]
|
||||||
},
|
},
|
||||||
"shapebytype": {
|
"shapebytype": {
|
||||||
"*-north": { "base": "butterflypins:block/pinboard-3x3", "rotateY": 180 },
|
"*-north": { "base": "dusiulkaspinboard:block/pinboard-3x3", "rotateY": 180 },
|
||||||
"*-east": { "base": "butterflypins:block/pinboard-3x3", "rotateY": 90 },
|
"*-east": { "base": "dusiulkaspinboard:block/pinboard-3x3", "rotateY": 90 },
|
||||||
"*-south": { "base": "butterflypins:block/pinboard-3x3", "rotateY": 0 },
|
"*-south": { "base": "dusiulkaspinboard:block/pinboard-3x3", "rotateY": 0 },
|
||||||
"*-west": { "base": "butterflypins:block/pinboard-3x3", "rotateY": 270 }
|
"*-west": { "base": "dusiulkaspinboard:block/pinboard-3x3", "rotateY": 270 }
|
||||||
},
|
},
|
||||||
"blockmaterial": "Wood",
|
"blockmaterial": "Wood",
|
||||||
"drawtype": "json",
|
"drawtype": "json",
|
||||||
BIN
ButterflyPins/modicon.png
Normal file
BIN
ButterflyPins/modicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 61 KiB |
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://moddbcdn.vintagestory.at/schema/modinfo.latest.json",
|
"$schema": "https://moddbcdn.vintagestory.at/schema/modinfo.latest.json",
|
||||||
"type": "Code",
|
"type": "Code",
|
||||||
"modid": "butterflypins",
|
"modid": "dusiulkaspinboard",
|
||||||
"name": "Butterfly Pins",
|
"name": "Butterfly Pins",
|
||||||
"authors": [
|
"authors": [
|
||||||
"OrekiWoof"
|
"OrekiWoof"
|
||||||
@@ -11,5 +11,6 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"game": "1.21.0"
|
"game": "1.21.0"
|
||||||
},
|
},
|
||||||
"side": "Universal"
|
"requiredOnServer": true,
|
||||||
|
"requiredOnClient": true
|
||||||
}
|
}
|
||||||
|
|||||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 OrekiWoof
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
Reference in New Issue
Block a user