Compare commits
No commits in common. "lsr" and "chessFix" have entirely different histories.
@ -5,7 +5,7 @@ read_globals = {
|
||||
"vector", "ItemStack",
|
||||
"default",
|
||||
"stairs", "doors", "xpanes",
|
||||
"xdecor",
|
||||
"xdecor", "xbg",
|
||||
table = {fields = {"copy"}},
|
||||
string = {fields = {"split"}},
|
||||
"unpack",
|
||||
|
521
CHESS_README.md
@ -1,521 +0,0 @@
|
||||
# Chess
|
||||
|
||||
## Introduction
|
||||
|
||||
You can play Chess in X-Decor-libre!
|
||||
|
||||
While the game of Chess is well-known and widespread and its
|
||||
rules are well-documented all over the Internet and elsewhere,
|
||||
the devil still lies in the detail.
|
||||
|
||||
In X-Decor-libre, the game of Chess is closely modeled after
|
||||
the FIDE Laws of Chess from January 2023. However, for a
|
||||
computer version of Chess, there are still some details
|
||||
that might need explanation.
|
||||
|
||||
## Objective
|
||||
|
||||
Chess is played between two players on a chessboard. One player plays
|
||||
with white pieces while the other one plays with black pieces.
|
||||
The goal of the game is to put the king of the opponent under attack
|
||||
in such a way they have no legal move. This is known as ‘checkmate’.
|
||||
It is not allowed to put one’s king in danger, to leave him in danger
|
||||
or to capture the opponent’s king.
|
||||
|
||||
## How to play
|
||||
|
||||
You need a chessboard to play. Craft yourself a chessboard like this:
|
||||
|
||||
BWB
|
||||
sss
|
||||
|
||||
B = Black Dye
|
||||
W = White Dye
|
||||
s = Wooden Slab (from apple tree)
|
||||
|
||||
Place the chessboard and examine it. You will see a close-up of the chessboard.
|
||||
|
||||
### The Chess interface
|
||||
|
||||
On the screen that pops up, you can choose to play against the
|
||||
computer (Singleplayer) or another player on the server (Multiplayer).
|
||||
You may also use the multiplayer option to play against yourself.
|
||||
The computer player is quite weak.
|
||||
|
||||
Click on the corresponding button to start the game.
|
||||
|
||||
Once the game has started, you see the following things:
|
||||
|
||||
To the left, the large chessboard consisting of 8×8 dark and white squares.
|
||||
The pieces are put on the chessboard. If there is no active game,
|
||||
the chessboard is empty.
|
||||
|
||||
During a game, the interface has the following meaning:
|
||||
|
||||
Above and below the chessboard, plaques show the name of the players.
|
||||
Above the chessboard is the player playing Black and below it
|
||||
the player playing White.
|
||||
An arrow left of the plaque shows whose turn it is. The name plaques
|
||||
may also show the “game status”, such as victory, checkmate (=loss),
|
||||
draw, being “in check”, etc.
|
||||
|
||||
On the right side, a list of moves that have been made is shown.
|
||||
It is written in a figurine long algebraic notation (see appendix).
|
||||
|
||||
The two boxes below the list of moves is where all the captured pieces
|
||||
go. This has no gameplay significance but it may serve as a visual
|
||||
aid to see how badly hurt the player's “armies” are. This section
|
||||
may change
|
||||
|
||||
The top right corner is used for starting a new game. Press
|
||||
“New Game” to start a new game. This ends the current game.
|
||||
|
||||
The bottom right corner right corner is used for special
|
||||
player actions, such as resigning or claiming a draw.
|
||||
|
||||
Note that during a game, the buttons only work for the two players
|
||||
playing Chess. They don’t work for anyone else.
|
||||
|
||||
## The rules of Chess
|
||||
|
||||
### Starting a game
|
||||
|
||||
Select Singleplayer or Multiplayer. In Singleplayer, you choose
|
||||
the color you play as by clicking the corresponding button.
|
||||
|
||||
White always plays first.
|
||||
|
||||
In multiplayer, anyone can make the first move.
|
||||
The player making the first move as White will play as White,
|
||||
the player making the first move as Black will play as Black.
|
||||
After that, the players are “locked” to their colors and
|
||||
nobody else can play as White or Black.
|
||||
|
||||
### The chessboard
|
||||
|
||||
The chessboard is a board of 8×8 squares alternating between light
|
||||
and dark squares. Each square is either empty or holds exactly one
|
||||
chess piece.
|
||||
|
||||
### The Chess pieces and how they move
|
||||
|
||||
Each player starts with the same pieces on opposing sides of the board,
|
||||
only their color is different.
|
||||
|
||||
There are 4 types of moves you can make:
|
||||
|
||||
* Normal move: You pick up the piece and place it to an empty square
|
||||
* Capturing move: You pick up the piece and place it on top of an opposing piece
|
||||
Your piece will land on that square and the opponent’s piece is removed
|
||||
* En passant: Special capturing move of the pawn (see below)
|
||||
* Castling: Special king+rook move (see below)
|
||||
|
||||
It is not possible to place your piece on your own pieces.
|
||||
It is not possible to capture a king or your own pieces.
|
||||
Any square on which a piece could capture another piece in theory
|
||||
(even if it is actually empty) is considered to be “attacked”.
|
||||
|
||||
For most pieces, the rules for making a normal move and
|
||||
a capturing move are identical. Only for the pawn it is different
|
||||
(read below).
|
||||
|
||||
If the square of the king is attacked, he and the player playing him
|
||||
is considered to be in “check”.
|
||||
If a player is in check, any move which would put or leave the own
|
||||
king under attack is not allowed.
|
||||
|
||||
#### How to actually move
|
||||
|
||||
Each move can be made by either clicking on the piece and then clicking again
|
||||
on the destination. The destination is either an empty square or a square
|
||||
occupied by an opponent’s piece (which will be captured).
|
||||
You can also do the same via drag-and-drop.
|
||||
|
||||
Once you made a valid move by placing the piece to its destination, it is
|
||||
final and cannot be taken back. This ends your move and it’s your
|
||||
opponent’s turn (exception: promotion, see below).
|
||||
|
||||
If you pick up a piece and put it back, nothing happens, it is still
|
||||
your turn and you can still do your move normally. Also, if you try
|
||||
to make an invalid move, nothing happens as well.
|
||||
|
||||
(Nerd info: For the purposes of the FIDE Laws of Chess, pieces are never
|
||||
considered “touched” here. Thus, article 4 of the FIDE Laws of Chess has
|
||||
no effect.)
|
||||
|
||||
#### Rook
|
||||
|
||||
The rook looks like a tower and can move to any of square that lies
|
||||
in a straight horizontal or vertical line from it.
|
||||
It cannot move beyond pieces that are in the way.
|
||||
|
||||
The rook can move on a square occupied by an opponent, which
|
||||
w
|
||||
|
||||
The rook may be involved in Castling, see “King” below.
|
||||
|
||||
#### Bishop
|
||||
|
||||
The bishop can move to any square on a diagonal line from it.
|
||||
It cannot move beyond pieces that are in the way.
|
||||
|
||||
#### Queen
|
||||
|
||||
The queen combines the powers of the rook and bishop and can
|
||||
move to any square in a straight horizontal, vertical
|
||||
or diagonal line from it.
|
||||
It cannot move beyond pieces that are in the way.
|
||||
|
||||
#### Knight
|
||||
|
||||
The knight looks like a horse and can move to any square closest to
|
||||
it that is not in its same horizontal line (also known as “rank”),
|
||||
vertical line (also known as “file”), or diagonal of the board.
|
||||
To illustrate this:
|
||||
|
||||
..X.X..
|
||||
.X...X.
|
||||
...n...
|
||||
.X...X.
|
||||
..X.X..
|
||||
|
||||
In this diagram, “n” represents the knight and the Xes are all the
|
||||
possible squares it can theoretically reach. The dots are empty
|
||||
squares.
|
||||
|
||||
Unlike the other pieces, pieces are never “in the way” of the knight.
|
||||
You might say the knight can “jump over” them, if you will.
|
||||
|
||||
#### King
|
||||
|
||||
The king can move exactly one square in any direction: horizontally,
|
||||
vertically or diagonally. Also, the king can never move to any square that
|
||||
is attacked by an opponent’s piece.
|
||||
|
||||
The king also has a special move called “Castling”.
|
||||
|
||||
##### Castling
|
||||
|
||||
Castling is a special move in which two pieces move at once.
|
||||
Both the king and a rook move horizontally from their starting positions.
|
||||
The king will move two squares horizontally and a rook will be
|
||||
moved next to him.
|
||||
|
||||
Each player has two possible castling moves available, involving each
|
||||
of the 2 starting rooks.
|
||||
|
||||
Castling has several conditions:
|
||||
|
||||
- The king must not have moved yet
|
||||
- The rook you wish to castle with must not have moved yet
|
||||
- All of the squares between king and rook must be empty
|
||||
- The king must not be under attack
|
||||
- The king’s destination as well the square it crosses must not be under attack
|
||||
- You can castle only horizontally
|
||||
|
||||
If all the conditions are met, here’s how you castle:
|
||||
|
||||
Place the king two squares towards the rook you want to castle with.
|
||||
This square is where the king will end up. The rook will then
|
||||
automatically move towards the king and “jump” to the square
|
||||
behind the king, from the rooks viewpoint.
|
||||
|
||||
**Remember**: You *must* move the king (not the rook) if you want
|
||||
to castle. If you move the rook instead, this is considered
|
||||
to be a regular move of the rook alone.
|
||||
|
||||
#### Pawn
|
||||
|
||||
The pawn has various ways to move.
|
||||
The pawn has a “walking direction”, it walks and captures towards
|
||||
the opponent’s side (i.e. the side on which the opponent’s
|
||||
pieces have started).
|
||||
|
||||
The pawn’s basic moves are:
|
||||
|
||||
1. Single step: The pawn moves one step vertically towards the
|
||||
opponent’s side. It is not possible to walk backwards.
|
||||
2. Double step: Like a single step, but it moves two squares instead.
|
||||
This is only possible from the pawn’s start position.
|
||||
|
||||
In both cases, the destination square must be empty as well as any crossed square.
|
||||
The pawn cannot capture by a single or double step, however.
|
||||
|
||||
The capturing move of the pawn is different. To capture, the pawn has to
|
||||
move one step diagonally towards the opponent’s side, either left or right.
|
||||
|
||||
To illustrate, in the following diagram, the X’es represent the
|
||||
squares attacked by a white pawn (w) and a black pawn (b):
|
||||
|
||||
.X.X..b..
|
||||
..w..X.X.
|
||||
|
||||
##### En passant capture
|
||||
|
||||
An en passant capture is a pawn move that is available if a pawn
|
||||
of the current player stands on a square left or right from an
|
||||
opposing pawn that has made a double step in the previous move.
|
||||
|
||||
In this situation, the first pawn may move as if the second pawn
|
||||
had made a single step instead. This will be considered as a
|
||||
capturing move and the opposing pawn will be removed from the board.
|
||||
|
||||
|
||||
Consider this example: Here, “w” represents a white pawn, “b” a black pawn and “.”
|
||||
an empty square. White moves upwards and Black downwards. Consider this starting
|
||||
position:
|
||||
|
||||
b.
|
||||
..
|
||||
.w
|
||||
|
||||
Now, White does a double step:
|
||||
|
||||
bw
|
||||
..
|
||||
..
|
||||
|
||||
Black decides to do an en passant capture. For this, the black pawn moves one
|
||||
diagonal step towards the square just crossed by the opponent. The white
|
||||
pawn is captured and removed.
|
||||
|
||||
..
|
||||
.b
|
||||
..
|
||||
|
||||
Remember! An 'en passant' capture is only possible in the move directly after
|
||||
a pawn’s double step. So if the chance for a particular en passant capture
|
||||
is not taken, it will be gone from that point on.
|
||||
|
||||
##### Promotion
|
||||
|
||||
When a pawn reaches the other end of the chessboard (from its viewpoint)
|
||||
it will be promoted. A promotion is considered to be part of the move.
|
||||
|
||||
When promotion happens, the boxes where normally the captured pieces go
|
||||
will turn into a prompt. The current player must choose a new
|
||||
piece to replace the pawn with:
|
||||
A queen, rook, bishop or knight of the same color.
|
||||
Just click the corresponding button. These buttons only work for the
|
||||
current player. Promotion is mandatory and no other moves are possible
|
||||
until it is completed.
|
||||
|
||||
Once a piece was selected, the pawn will be replaced replaced, which
|
||||
immediately activates its powers. This ends the move.
|
||||
|
||||
### The end of the game
|
||||
|
||||
There are various ways for the game of Chess to end. A game always
|
||||
ends in victory of one player, or in a draw.
|
||||
|
||||
#### Checkmate
|
||||
Checkmating your opponent is the primary goal of Chess.
|
||||
The player who has checkmated the opponent king wins the game and ends it.
|
||||
|
||||
You are checkmated when it’s your turn, your own king is in check
|
||||
(i.e. under attack) and you have no valid move available.
|
||||
This immediately ends the game and your opponent wins.
|
||||
|
||||
#### Stalemate
|
||||
If it’s a player’s turn, but they have no possible move and their
|
||||
king is not in check, the game immediately ends in a draw.
|
||||
This is called a “stalemate”.
|
||||
|
||||
#### Resign
|
||||
During the game, the possibility of resigning arises. Resigning
|
||||
basically means “giving up” and this leads to an instant loss
|
||||
and the victory of your opponent.
|
||||
Resigning is available after one’s name has been recorded on
|
||||
the name plaque. Resigning is possible even when it’s not your turn.
|
||||
|
||||
To resign, click the skull icon in the bottom right.
|
||||
|
||||
#### Dead position
|
||||
If during the game, on the board there are only the following pieces left,
|
||||
the game ends in a draw:
|
||||
|
||||
* king versus king
|
||||
* king versus king and bishop
|
||||
* king versus king and knight
|
||||
* king and bishop versus king and bishop, and both bishops stand on squares of the same color
|
||||
|
||||
This is called a “dead position”. For example, a board with only a white
|
||||
and a black king is a draw.
|
||||
|
||||
NOTE: In general, a dead position is any position from which neither player can
|
||||
give checkmate, no matter how they move, but only those 4 cases above
|
||||
lead to an instant draw in X-Decor-libre because it is tricky to
|
||||
determine whether any position is “dead”.
|
||||
|
||||
However, dead positions are still guaranteed to end the game eventually
|
||||
due to the 75-move rule.
|
||||
|
||||
#### 50-move rule
|
||||
If in the last 50 consecutive moves of each player, no piece was
|
||||
captured and no pawn was moved, the player whose turn it is can invoke
|
||||
the 50-move rule to draw the game instantly.
|
||||
|
||||
When it’s your turn, and you believe your *next* move will satisfy
|
||||
the condition of the 50-move rule, you may also invoke this rule
|
||||
to draw the game, but in this case, you still have to make the move.
|
||||
If this move satisfies the 50-move rule, the game is drawn.
|
||||
But if not, this counts as a normal move, your turn ends and the
|
||||
game continues as normal.
|
||||
|
||||
A button on the bottom right will appear when this rule is available.
|
||||
The button is not shown when there are too few such moves for this
|
||||
draw claim to be successful.
|
||||
|
||||
The icon represents a barricade, as if the game of Chess itself
|
||||
has been blocked. This one will instantly draw the game.
|
||||
If you still would have to make the game-drawing move, the
|
||||
icon represents half a barricade.
|
||||
Note the tooltip.
|
||||
|
||||
Note the latter icon is no guarantee you can actually draw the
|
||||
game in the next move, only that such a draw claim is plausible.
|
||||
|
||||
#### 75-move rule
|
||||
If in the last 75 consecutive moves of each player, no piece was captured
|
||||
and no pawn was moved, the game automatically ends in a draw.
|
||||
|
||||
Exception: If the last move has lead to a checkmate. In this case, checkmate
|
||||
takes precedence.
|
||||
|
||||
#### Threefold repetition rule
|
||||
If the current position has appeared at least 3 times in the game
|
||||
the current player can invoke the threefold repetition rule to draw
|
||||
the game instantly.
|
||||
|
||||
Two positions are considered to be the same “same” if a position in which
|
||||
the chessboard has the same pieces of the same color on the same squares,
|
||||
it is the same player's turn, the castling rights are the same
|
||||
and the vulnerability of pawns to en passant captures (if any) is the same.
|
||||
|
||||
Pawns are considered “vulnerable” to an en passant capture immediately
|
||||
after a double step turn, no matter if is actually in danger of
|
||||
being captured that way.
|
||||
|
||||
This rule can also be invoked when you think your *next* move will
|
||||
lead to the 3rd (or more) repeated position in the game. This
|
||||
works similar as for the 50-move rule.
|
||||
|
||||
Like for the 50-move rule, a button appears on the bottom right
|
||||
once this rule can be invoked.
|
||||
|
||||
If the 3 same position has already occurred, the icon will
|
||||
represent 3 chess squares stacked on top of each other.
|
||||
If the game-drawing move still has to be made, the top
|
||||
square is a “ghost square”.
|
||||
|
||||
#### Fivefold repetition rule
|
||||
If the same position (as defined above) has appeared at for
|
||||
least 5 times, the game is drawn.
|
||||
|
||||
#### No agreeing to draw
|
||||
|
||||
Unlike in other Chess programs, the players cannot agree to draw.
|
||||
|
||||
#### Game result
|
||||
|
||||
Once the game has ended, the game result is shown on the name plaques of the
|
||||
players as well in chat (to the players only). From this point on, everyone
|
||||
(even spectators) can start a new game with “New Game”.
|
||||
|
||||
|
||||
## Resetting the chessboard
|
||||
|
||||
While a game of Chess is ongoing, the chessboard can’t be dug and the game
|
||||
can’t be stopped by other players. But to prevent two players blocking a
|
||||
chessboard forever, there is a 5-minute timer. If no player makes a move
|
||||
for 5 minutes, then the chessboard can be reset and dug by anyone.
|
||||
|
||||
Exception: Players with the `protection_bypass` privilege can always
|
||||
dig the chessboard.
|
||||
|
||||
|
||||
## Appendix
|
||||
|
||||
### The Chess Notation
|
||||
|
||||
The list of moves is in a special notation called “algebraic notation”. There are many
|
||||
variants of it, so this section explains what it means in X-Decor-libre.
|
||||
|
||||
This mod uses a longform figurine algebraic notation. “figurine” means that
|
||||
icons are used for the chess pieces. “longform” means the start
|
||||
and end coordinates are shown in full.
|
||||
|
||||
Square coordinates are important in any Chess notation. In algebraic notation,
|
||||
each square is assigned coordinated with a letter from a to h,
|
||||
followed by a number from 1 to 8.
|
||||
Provided that the player playing White is on the “bottom” side of the chessboard,
|
||||
the squares are numbered from the bottom left square in ascending order.
|
||||
The horizontal lines (“ranks”) are numbered 1 to 8, starting from the bottom.
|
||||
The vertical lines (“files”) are numbered a to h, starting from the left.
|
||||
So from White's viewpoint, the bottom-left square is a1. The square above it
|
||||
is a2, then a3, a4, ... a8. The square right of a1 is b1, then c1, d1, ... h1.
|
||||
The top-right square is h8.
|
||||
|
||||
(Note that on a real chessboard, all of the coordinates are flipped from Black’s viewpoint
|
||||
because the board is rotated 180° from their view. In X-Decor-libre, this does not
|
||||
matter because the board is always aligned the same way.)
|
||||
|
||||
In the list of moves, each line shows 3 things: Move number, white’s move, black’s move (if made).
|
||||
The move number is a simple counter that increases after each move of *both* players, starting by 1.
|
||||
|
||||
In the notation, a move by a single player is called a “halfmove”. The two moves
|
||||
of each White and then Black are called a “fullmove”.
|
||||
|
||||
#### Normal moves
|
||||
|
||||
Normally, a halfmove is written like this, in this order:
|
||||
|
||||
1. Symbol of moved piece (called “figurine”)
|
||||
2. Start coordinates, a dash or cross, destination coordinates
|
||||
3. “e.p.”, if it was an en passant capture -OR- symbol of piece to which a pawn was promoted to
|
||||
|
||||
For number 1, the symbol is only shown if the piece is not a pawn.
|
||||
For number 2, the syntax for normal moves is like: “a1–a2”. This means the piece was moved from a1 to a2.
|
||||
The dash means it was a normal move.
|
||||
For capturing moves, the dash is replaced with a cross “×”. If it was an en passant capture, then
|
||||
“ e.p” is appended, like so: “a5×b4 e.p.”.
|
||||
If a pawn was promoted, the symbol of the new piece is appended.
|
||||
The figurines are always of the color of the player.
|
||||
|
||||
Both halfmoves on a line are separated by spacing.
|
||||
|
||||
#### Castling
|
||||
|
||||
When a player castles, it is notated the following way:
|
||||
|
||||
* “0–0” for castling with the rook on file h (“kingside castling”)
|
||||
* “0–0–0” for castling with the rook on file a (“queenside castling”)
|
||||
|
||||
#### Game completion
|
||||
|
||||
If the game completed, the end of the game showing the result is listed in a final separate line as:
|
||||
|
||||
* “1–0” if White won
|
||||
* “0–1” if Black won
|
||||
* “½–½” in case of a draw
|
||||
|
||||
#### Example
|
||||
|
||||
1. d2—d4 e7—e6
|
||||
2. ♔e1–d2 ♛d8–h4
|
||||
3. d4–d5 e6×d5
|
||||
...
|
||||
8. d8×d8♖ ♞b8-c6
|
||||
9. e2–e4 d4×e3 e.p.
|
||||
|
||||
Explanation of the moves:
|
||||
|
||||
* 1.: First fullmove: White moves pawn from d2 to d4, Black moves pawn from e7 to e6
|
||||
* 2.: Second fullmove: White moves king from e1 to d2, Black moves queen from d8 to h4
|
||||
* 3.: Third fullmove: White moves pawn from d4 to d5, Black moves pawn from d6 to d5 and captures
|
||||
* 8.: Eight fullmove: White moves pawn from d7 to d8, captures a piece and promotes it to rook, Black moves knight from b8 to c6
|
||||
* 9.: Ninth fullmove: White moves pawn from e2 to e4, black moves pawn from d4 to e3 and captures en passant
|
||||
|
||||
#### Other symbols
|
||||
|
||||
Other symbols are not used. So there are no special symbols for check and checkmate and no comments for moves considered good or bad.
|
4
LICENSE
@ -7,10 +7,6 @@
|
||||
│ Textures (radio and speaker) by │
|
||||
│ MCL <temp1@cubesoftware.xyz> (CC BY 4.0 Int'l) │
|
||||
│ │
|
||||
│ Textures (Chess icons for the Chess notation) │
|
||||
│ originally by Wikimedia user Cbnurnett, │
|
||||
│ scaled down and edited by Wuzzy (CC BY-SA 3.0 Unported) │
|
||||
│ │
|
||||
│ Textures (hanging candle) by │
|
||||
│ Wuzzy (CC0) │
|
||||
│ │
|
||||
|
18
README.md
@ -32,9 +32,9 @@ blocks with special features:
|
||||
in some food items. Collect the soup with a bowl
|
||||
* Lever: Pull the lever to activate doors next to it
|
||||
* Pressure Plate: Step on it to activate doors next to it
|
||||
* Chessboard: Play Chess against a player or the computer (see `CHESS_README.md`)
|
||||
|
||||
The radio and speaker are purely decorative and have no special functionality.
|
||||
The chessboard, radio and speaker are purely decorative
|
||||
and have no special functionality.
|
||||
|
||||
### X-Decor-libre vs X-Decor
|
||||
|
||||
@ -68,18 +68,9 @@ The following bugs of X-Decor (as of 01/07/2023) are fixed:
|
||||
* Show short item description in itemframe instead of itemstring
|
||||
* Minor typo fixes
|
||||
* Fix bad rope placement prediction
|
||||
* Fixed the broken Chess game
|
||||
|
||||
Maintenance updates:
|
||||
* HUGE rework of Chess to make it actually be like real Chess (more or less)
|
||||
* New supported Chess rules (based on the FIDE Laws of Chess)
|
||||
* En passant
|
||||
* Choose your pawn promotion
|
||||
* Fixed incomplete enforcement of castling rule
|
||||
* 50-turn rule and 75-turn rule
|
||||
* Threefold repetition rule and fivefold repetition rule
|
||||
* Announce the winner or loser, or a drawn game
|
||||
* Many technical improvements for Chess
|
||||
* Chess games were disabled because they were too broken
|
||||
* Renamed blocks:
|
||||
* "Empty Shelf" to "Plain Shelf"
|
||||
* "Slide Door" to "Paper Door"
|
||||
@ -105,7 +96,6 @@ Maintenance updates:
|
||||
* Add tooltip extensions for some interactive items (uses `tt` mod)
|
||||
* Add crafting guide support for `unified_inventory` mod (honey)
|
||||
* Rope no longer extends infinitely in Creative Mode
|
||||
* Added manual for Chess in `CHESS_README.md`
|
||||
|
||||
#### List of replaced files
|
||||
|
||||
@ -127,7 +117,7 @@ that X-Decor-libre replaces:
|
||||
|
||||
(see `LICENSE` file for licensing).
|
||||
|
||||
## Technical information
|
||||
### Technical information
|
||||
X-Decor-libre is a fork of X-Decor, from <https://github.com/minetest-mods/xdecor>,
|
||||
forked at Git commit ID 8b614b3513f2719d5975c883180c011cb7428c8d.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
local S = minetest.get_translator("xdecor")
|
||||
|
||||
xdecor.xbg = default.gui_bg .. default.gui_bg_img .. default.gui_slots
|
||||
xbg = default.gui_bg .. default.gui_bg_img .. default.gui_slots
|
||||
local default_inventory_size = 32
|
||||
|
||||
local default_inventory_formspecs = {
|
||||
@ -134,7 +134,7 @@ function xdecor.register(name, def)
|
||||
|
||||
inv:set_size("main", size)
|
||||
meta:set_string("formspec",
|
||||
(inventory.formspec or get_formspec_by_size(size)) .. xdecor.xbg)
|
||||
(inventory.formspec or get_formspec_by_size(size)) .. xbg)
|
||||
end
|
||||
|
||||
def.can_dig = def.can_dig or default_can_dig
|
||||
@ -157,27 +157,3 @@ function xdecor.register(name, def)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Registers aliases for a node that had a name collision
|
||||
-- with a node from the moreblocks mod
|
||||
function xdecor.register_legacy_aliases(original_basename, new_basename)
|
||||
minetest.register_alias("xdecor:"..original_basename, "xdecor:"..new_basename)
|
||||
minetest.register_alias("xdecor:"..original_basename.."_panel", "xdecor:"..new_basename.."_panel")
|
||||
minetest.register_alias("xdecor:"..original_basename.."_doublepanel", "xdecor:"..new_basename.."_doublepanel")
|
||||
minetest.register_alias("xdecor:"..original_basename.."_micropanel", "xdecor:"..new_basename.."_micropanel")
|
||||
minetest.register_alias("xdecor:"..original_basename.."_halfstair", "xdecor:"..new_basename.."_halfstair")
|
||||
minetest.register_alias("xdecor:"..original_basename.."_thinstair", "xdecor:"..new_basename.."_thinstair")
|
||||
minetest.register_alias("xdecor:"..original_basename.."_cube", "xdecor:"..new_basename.."_cube")
|
||||
minetest.register_alias("xdecor:"..original_basename.."_microslab", "xdecor:"..new_basename.."_microslab")
|
||||
minetest.register_alias("xdecor:"..original_basename.."_nanoslab", "xdecor:"..new_basename.."_nanoslab")
|
||||
if not minetest.get_modpath("moreblocks") then
|
||||
minetest.register_alias("stairs:slab_"..original_basename, "stairs:slab_"..new_basename)
|
||||
minetest.register_alias("stairs:stair_"..original_basename, "stairs:stair_"..new_basename)
|
||||
minetest.register_alias("stairs:stair_outer_"..original_basename, "stairs:stair_outer_"..new_basename)
|
||||
minetest.register_alias("stairs:stair_inner_"..original_basename, "stairs:stair_inner"..new_basename)
|
||||
end
|
||||
if minetest.get_modpath("stairsplus") and minetest.global_exists("stairsplus") and stairsplus.api then
|
||||
stairsplus.api.register_alias_all("xdecor:"..original_basename, "xdecor:"..new_basename)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1,46 +1,11 @@
|
||||
# textdomain: xdecor
|
||||
Weak Computer=
|
||||
Weak Computer 1=
|
||||
Weak Computer 2=
|
||||
Chess=
|
||||
Chess Debug=
|
||||
check=
|
||||
checkmate=
|
||||
resigned=
|
||||
winner=
|
||||
loser=
|
||||
draw=
|
||||
You have checkmated @1. You win!=
|
||||
You were checkmated by @1. You lose!=
|
||||
The game ended up in a stalemate! It's a draw!=
|
||||
The game ended up in a dead position! It's a draw!=
|
||||
No piece was captured and no pawn was moved for 75 consecutive moves of each player. It's a draw!=
|
||||
You have drawn the game by invoking the 50-move rule.=
|
||||
@1 has drawn the game by invoking the 50-move rule.=
|
||||
You have failed to make a game-drawing move. The game continues.=
|
||||
@1 made a draw claim using the 50-move rule but it was false. The game continues.=
|
||||
The exact same position has occured 5 times. It's a draw!=
|
||||
You have drawn the game by invoking the threefold repetition rule.=
|
||||
@1 has drawn the game by invoking the threefold repetition rule.=
|
||||
@1 made a draw claim using the threefold repetition rule but it was false. The game continues.=
|
||||
Chess Board=
|
||||
Someone else plays white pieces!=
|
||||
It's not your turn!=
|
||||
Someone else plays black pieces!=
|
||||
Black cannot move first!=
|
||||
@1 s=
|
||||
@1 min @2 s=
|
||||
You can't reset the chessboard, a game has been started. Try again in @1.=
|
||||
Resigning is not possible yet.=
|
||||
You have resigned.=
|
||||
@1 has resigned. You win!=
|
||||
You can't resign, you're not playing in this game.=
|
||||
You can't claim a draw, it's not your turn!=
|
||||
You're only a spectator in this game of Chess.=
|
||||
This isn't the time for promotion.=
|
||||
It's not your turn! This promotion is meant for the other player.=
|
||||
You can't dig the chessboard, a game has been started. Reset it first or dig it again in @1.=
|
||||
You can't dig the chessboard, a game has been started. Try it again in @1.=
|
||||
Dumb AI=
|
||||
You can't reset the chessboard, a game has been started. If you aren't a current player, try again in @1=
|
||||
You can't dig the chessboard, a game has been started. Reset it first if you're a current player, or dig it again in @1=
|
||||
Play a game of Chess against another player or the computer=
|
||||
White Pawn=
|
||||
Black Pawn=
|
||||
@ -54,27 +19,11 @@ White Queen=
|
||||
Black Queen=
|
||||
White King=
|
||||
Black King=
|
||||
Select a game mode=
|
||||
Select a mode:=
|
||||
Singleplayer=
|
||||
Multiplayer=
|
||||
Bot vs Bot=
|
||||
PROMOTION@nFOR BLACK!=
|
||||
Promote pawn to:=
|
||||
PROMOTION@nFOR WHITE!=
|
||||
DRAW CLAIM@nBY WHITE!=
|
||||
DRAW CLAIM@nBY BLACK!=
|
||||
The player has invoked the 50-move rule for the next move. The next move might draw the game.=
|
||||
The player has invoked the threefold-repetition rule for the next move. The next move might draw the game.=
|
||||
New game=
|
||||
Resign=
|
||||
Select a color:=
|
||||
White=
|
||||
Black=
|
||||
Invoke the 50-move rule for your next move=
|
||||
Invoke the 50-move rule and draw the game=
|
||||
Invoke the threefold repetition rule and draw the game=
|
||||
Invoke the threefold repetition rule for your next move=
|
||||
check=
|
||||
Light a fire below to heat it up=
|
||||
Use a bowl to eat the soup=
|
||||
Drop foods inside to make a soup=
|
||||
@ -185,8 +134,8 @@ Coal Stone Tile=
|
||||
Polished Desert Stone Block=
|
||||
Hardened Clay=
|
||||
Moon Brick=
|
||||
Runestone=
|
||||
Polished Stone Block=
|
||||
Runestone=
|
||||
Packed Ice=
|
||||
Wooden Tile=
|
||||
Table=
|
||||
@ -196,10 +145,6 @@ Television=
|
||||
Wood Framed Glass=
|
||||
Radio=
|
||||
Speaker=
|
||||
@1 Stair=
|
||||
Inner @1 Stair=
|
||||
Outer @1 Stair=
|
||||
@1 Slab=
|
||||
Rope=
|
||||
Nanoslab=
|
||||
Micropanel=
|
||||
@ -210,14 +155,19 @@ Panel=
|
||||
Slab=
|
||||
Double Panel=
|
||||
Half-Stair=
|
||||
Outer Stair=
|
||||
Stair=
|
||||
Inner Stair=
|
||||
Work Bench=
|
||||
For cutting blocks, repairing tools with a hammer, crafting and storing items=
|
||||
@1 @2=
|
||||
Hammer=
|
||||
Repairs tools at the work bench=
|
||||
Cut=
|
||||
Repair=
|
||||
Crafting=
|
||||
Storage=
|
||||
Back=
|
||||
@1 Stair=
|
||||
Inner @1 Stair=
|
||||
Outer @1 Stair=
|
||||
@1 Slab=
|
||||
|
@ -1,46 +1,11 @@
|
||||
# textdomain: xdecor
|
||||
Weak Computer=Schwacher Computer
|
||||
Weak Computer 1=Schwacher Computer 1
|
||||
Weak Computer 2=Schwacher Computer 2
|
||||
Chess=Schach
|
||||
Chess Debug=Schachdebug
|
||||
check=Schach
|
||||
checkmate=Schachmatt
|
||||
resigned=aufgegeben
|
||||
winner=Sieger
|
||||
loser=Verlierer
|
||||
draw=Remis
|
||||
You have checkmated @1. You win!=Sie haben @1 schachmatt gesetzt. Sieg!
|
||||
You were checkmated by @1. You lose!=Sie wurden von @1 schachmatt gesetzt. Niederlage!
|
||||
The game ended up in a stalemate! It's a draw!=Das Partie endete in einem Patt. Das ist ein Remis!
|
||||
The game ended up in a dead position! It's a draw!=Das Partie endete in einer toten Stellung. Das ist ein Remis!
|
||||
No piece was captured and no pawn was moved for 75 consecutive moves of each player. It's a draw!=Für 75 Züge in Folge von je beiden Spielern wurde keine Figur geschlagen und kein Bauer gezogen. Es ist ein Remis!
|
||||
You have drawn the game by invoking the 50-move rule.=Sie haben die Partie remis enden lassen, indem Sie die 50-Züge-Regel angewandt haben.
|
||||
@1 has drawn the game by invoking the 50-move rule.=@1 hat die Partie mittels der 50-Züge Regel remis enden lassen.
|
||||
You have failed to make a game-drawing move. The game continues.=Sie haben keinen Zug gemacht, der die Partie remis enden lässt. Die Partie geht weiter.
|
||||
@1 made a draw claim using the 50-move rule but it was false. The game continues.=@1 hat ein Remis mittels der 50-Züge-Regel beansprucht aber lag falsch. Die Partie geht weiter.
|
||||
The exact same position has occured 5 times. It's a draw!=Die exakt gleiche Stellung ist 5 mal aufgetreten. Das ist ein Remis!
|
||||
You have drawn the game by invoking the threefold repetition rule.=Sie haben die Partie remis enden lassen, indem Sie die Stellungswiederholungsregel angewandt haben.
|
||||
@1 has drawn the game by invoking the threefold repetition rule.=@1 hat die Partie remis mittels der Stellungswiederholungsregel enden lassen.
|
||||
@1 made a draw claim using the threefold repetition rule but it was false. The game continues.=@1 hat ein Remis mittels der Stellungswiederholungsregel beansprucht aber lag falsch. Die Partie geht weiter.
|
||||
Chess Board=Schachbrett
|
||||
Someone else plays white pieces!=Jemand anderes spielt Weiß!
|
||||
It's not your turn!=Sie sind nicht am Zug!
|
||||
Someone else plays black pieces!=Jemand anderes spielt Schwarz!
|
||||
Black cannot move first!=Schwarz darf nicht zuerst ziehen!
|
||||
@1 s=@1 s
|
||||
@1 min @2 s=@1 min @2 s
|
||||
You can't reset the chessboard, a game has been started. Try again in @1.=Sie können das Schachbrett nicht zurücksetzen, es wurde eine Partie gestartet. Versuchen Sie es erneut in @1.
|
||||
Resigning is not possible yet.=Aufgeben ist noch nicht möglich.
|
||||
You have resigned.=Sie haben aufgegeben.
|
||||
@1 has resigned. You win!=@1 hat aufgegeben. Sie haben gewonnen!
|
||||
You can't resign, you're not playing in this game.=Sie können nicht aufgeben, Sie spielen nicht in dieser Partie.
|
||||
You can't claim a draw, it's not your turn!=Sie können kein Remis beanspruchen, Sie sind nicht am Zug!
|
||||
You're only a spectator in this game of Chess.=Sie sind nur Zuschauer bei dieser Schachpartie.
|
||||
This isn't the time for promotion.=Jetzt ist nicht die Zeit für eine Umwandlung.
|
||||
It's not your turn! This promotion is meant for the other player.=Sie sind nicht am Zug! Diese Umwandlung ist für den anderen Spieler.
|
||||
You can't dig the chessboard, a game has been started. Reset it first or dig it again in @1.=Sie können das Schachbrett nicht abbauen, es wurde eine Partie gestartet. Setzen Sie es zuerst zurück oder bauen Sie es in @1 erneut ab.
|
||||
You can't dig the chessboard, a game has been started. Try it again in @1.=Sie können das Schachbrett nicht abbauen, es wurde eine Partie gestartet. Versuchen Sie es erneut in @1.
|
||||
Dumb AI=Dumme KI
|
||||
You can't reset the chessboard, a game has been started. If you aren't a current player, try again in @1=Das Schachbrett kann nicht zurückgesetzt werden, da ein Spiel im Gang ist. Versuchen Sie es in @1 erneut, falls Sie kein Mitspieler sind.
|
||||
You can't dig the chessboard, a game has been started. Reset it first if you're a current player, or dig it again in @1=Das Schachbrett ist während eines Schachspieles nicht abbaubar. Setzen Sie das Spiel zurück, falls Sie ein Mitspieler sind oder versuchen Sie es in @1 erneut.
|
||||
Play a game of Chess against another player or the computer=Für Schachspiele gegen einen anderen Spieler oder den Computer
|
||||
White Pawn=Weißer Bauer
|
||||
Black Pawn=Schwarzer Bauer
|
||||
@ -54,27 +19,11 @@ White Queen=Weiße Dame
|
||||
Black Queen=Schwarze Dame
|
||||
White King=Weißer König
|
||||
Black King=Schwarzer König
|
||||
Select a game mode=Wählen Sie einen Spielmodus
|
||||
Select a mode:=Modus wählen:
|
||||
Singleplayer=Einzelspieler
|
||||
Multiplayer=Mehrspieler
|
||||
Bot vs Bot=Bot vs. Bot
|
||||
PROMOTION@nFOR BLACK!=UMWANDLUNG@nFÜR SCHWARZ!
|
||||
Promote pawn to:=Bauer umwandeln zu:
|
||||
PROMOTION@nFOR WHITE!=UMWANDLUNG@nFÜR WEISS!
|
||||
DRAW CLAIM@nBY WHITE!=REMISANSPRUCH@nVON WEISS!
|
||||
DRAW CLAIM@nBY BLACK!=REMISANSPRUCH@nVON SCHWARZ!
|
||||
The player has invoked the 50-move rule for the next move. The next move might draw the game.=Der Spieler will für den nächsten Zug die 50-Züge-Regel anwenden. Der nächste Zug könnte die Partie remis enden lassen.
|
||||
The player has invoked the threefold-repetition rule for the next move. The next move might draw the game.=Der Spieler will für den nächsten Zug die Regel für wiederholte Stellungen anwenden. Der nächste Zug könnte die Partie remis enden lassen.
|
||||
New game=Neues Spiel
|
||||
Resign=Aufgeben
|
||||
Select a color:=Farbe wählen:
|
||||
White=Weiß
|
||||
Black=Schwarz
|
||||
Invoke the 50-move rule for your next move=50-Züge-Regel für den nächsten Zug anwenden
|
||||
Invoke the 50-move rule and draw the game=50-Züge-Regel anwenden und die Partie remis enden lassen
|
||||
Invoke the threefold repetition rule and draw the game=Stellungswiederholungsregel anwenden und die Partie remis enden lassen
|
||||
Invoke the threefold repetition rule for your next move=Stellungswiederholungsregel für den nächsten Zug anwenden
|
||||
check=Schach
|
||||
Light a fire below to heat it up=Entfachen Sie unten ein Feuer, um ihn zu erhitzen
|
||||
Use a bowl to eat the soup=Schüssel benutzen, um die Suppe zu essen
|
||||
Drop foods inside to make a soup=Nahrungsmittel einwerfen, um Suppe zu machen
|
||||
@ -96,7 +45,7 @@ Cauldron with Water (boiling)=Kessel mit Wasser (kochend)
|
||||
Cauldron with River Water (boiling)=Kessel mit Flusswasser (kochend)
|
||||
Cauldron with Soup (boiling)=Kessel mit Suppe (kochend)
|
||||
Bowl=Schüssel
|
||||
Bowl of soup=Schüssel mit Suppe
|
||||
Bowl of soup=Suppenschüssel
|
||||
Efficiency=Effizienz
|
||||
Durability=Haltbarkeit
|
||||
Sharpness=Schärfe
|
||||
@ -184,9 +133,9 @@ Cactus Brick=Kaktusziegel
|
||||
Coal Stone Tile=Kohlesteinkachel
|
||||
Polished Desert Stone Block=Hochglanzwüstensteinblock
|
||||
Hardened Clay=Gehärteter Ton
|
||||
Moon Brick=Mondziegel
|
||||
Runestone=Runenstein
|
||||
Moon Brick=Naturziegelwand
|
||||
Polished Stone Block=Hochglanzsteinblock
|
||||
Runestone=Runenstein
|
||||
Packed Ice=Packeis
|
||||
Wooden Tile=Holzkachel
|
||||
Table=Tisch
|
||||
@ -196,10 +145,6 @@ Television=Fernseher
|
||||
Wood Framed Glass=Holzrahmenglas
|
||||
Radio=Radio
|
||||
Speaker=Lautsprecher
|
||||
@1 Stair=@1treppe
|
||||
Inner @1 Stair=Innere @1treppe
|
||||
Outer @1 Stair=Äußere @1treppe
|
||||
@1 Slab=@1platte
|
||||
Rope=Seil
|
||||
Nanoslab=nanoplatte
|
||||
Micropanel=mikropaneel
|
||||
@ -210,14 +155,19 @@ Panel=paneel
|
||||
Slab=platte
|
||||
Double Panel=doppelpaneel
|
||||
Half-Stair=halbtreppe
|
||||
Outer Stair=Äußere Treppe
|
||||
Stair=Treppe
|
||||
Inner Stair=Innere Treppe
|
||||
Work Bench=Werkbank
|
||||
For cutting blocks, repairing tools with a hammer, crafting and storing items=Für Blockzuschnitt, Werkzeugreparatur mit Hammer, Fertigung und Lagerung
|
||||
@1 @2=@1@2
|
||||
Hammer=Hammer
|
||||
Repairs tools at the work bench=Repariert Werkzeuge an der Werkbank
|
||||
Cut=Zuschnitt
|
||||
Repair=Reparatur
|
||||
Crafting=Fertigung
|
||||
Storage=Lager
|
||||
Back=Zurück
|
||||
@1 Stair=@1treppe
|
||||
Inner @1 Stair=Innere @1treppe
|
||||
Outer @1 Stair=Äußere @1treppe
|
||||
@1 Slab=@1platte
|
||||
|
@ -1,46 +1,11 @@
|
||||
# textdomain: xdecor
|
||||
Weak Computer=
|
||||
Weak Computer 1=
|
||||
Weak Computer 2=
|
||||
Chess=Echecs
|
||||
Chess Debug=
|
||||
check=échec
|
||||
checkmate=
|
||||
resigned=
|
||||
winner=
|
||||
loser=
|
||||
draw=
|
||||
You have checkmated @1. You win!=
|
||||
You were checkmated by @1. You lose!=
|
||||
The game ended up in a stalemate! It's a draw!=
|
||||
The game ended up in a dead position! It's a draw!=
|
||||
No piece was captured and no pawn was moved for 75 consecutive moves of each player. It's a draw!=
|
||||
You have drawn the game by invoking the 50-move rule.=
|
||||
@1 has drawn the game by invoking the 50-move rule.=
|
||||
You have failed to make a game-drawing move. The game continues.=
|
||||
@1 made a draw claim using the 50-move rule but it was false. The game continues.=
|
||||
The exact same position has occured 5 times. It's a draw!=
|
||||
You have drawn the game by invoking the threefold repetition rule.=
|
||||
@1 has drawn the game by invoking the threefold repetition rule.=
|
||||
@1 made a draw claim using the threefold repetition rule but it was false. The game continues.=
|
||||
Chess Board=Echiquier
|
||||
Someone else plays white pieces!=Quelqu’un d’autre joue les pièces blanches !
|
||||
It's not your turn!=
|
||||
Someone else plays black pieces!=Quelqu’un d’autre joue les pièces noires !
|
||||
Black cannot move first!=
|
||||
@1 s=
|
||||
@1 min @2 s=
|
||||
You can't reset the chessboard, a game has been started. Try again in @1.=
|
||||
Resigning is not possible yet.=
|
||||
You have resigned.=
|
||||
@1 has resigned. You win!=
|
||||
You can't resign, you're not playing in this game.=
|
||||
You can't claim a draw, it's not your turn!=
|
||||
You're only a spectator in this game of Chess.=
|
||||
This isn't the time for promotion.=
|
||||
It's not your turn! This promotion is meant for the other player.=
|
||||
You can't dig the chessboard, a game has been started. Reset it first or dig it again in @1.=
|
||||
You can't dig the chessboard, a game has been started. Try it again in @1.=
|
||||
Dumb AI=IA stupide
|
||||
You can't reset the chessboard, a game has been started. If you aren't a current player, try again in @1=Vous ne pouvez pas mettre à zéro l’échiquier, une partie a été commencée. Si ce n’est pas votre tour de jouer, réessayez dans @1
|
||||
You can't dig the chessboard, a game has been started. Reset it first if you're a current player, or dig it again in @1=Vous ne pouvez pas récupérer l’échiquier, une partie à été commencée. Remettez le à zéro si vous c’est votre tour de jouer, ou réessayez dans @1
|
||||
Play a game of Chess against another player or the computer=
|
||||
White Pawn=Pion blanc
|
||||
Black Pawn=Pion noir
|
||||
@ -54,27 +19,11 @@ White Queen=Reine blanche
|
||||
Black Queen=Reine noire
|
||||
White King=Roi blanc
|
||||
Black King=Roi noir
|
||||
Select a game mode=
|
||||
Select a mode:=Sélectionnez un mode de jeu:
|
||||
Singleplayer=Solo
|
||||
Multiplayer=Multijoueur
|
||||
Bot vs Bot=
|
||||
PROMOTION@nFOR BLACK!=
|
||||
Promote pawn to:=
|
||||
PROMOTION@nFOR WHITE!=
|
||||
DRAW CLAIM@nBY WHITE!=
|
||||
DRAW CLAIM@nBY BLACK!=
|
||||
The player has invoked the 50-move rule for the next move. The next move might draw the game.=
|
||||
The player has invoked the threefold-repetition rule for the next move. The next move might draw the game.=
|
||||
New game=Nouvelle partie
|
||||
Resign=
|
||||
Select a color:=
|
||||
White=
|
||||
Black=
|
||||
Invoke the 50-move rule for your next move=
|
||||
Invoke the 50-move rule and draw the game=
|
||||
Invoke the threefold repetition rule and draw the game=
|
||||
Invoke the threefold repetition rule for your next move=
|
||||
check=échec
|
||||
Light a fire below to heat it up=
|
||||
Use a bowl to eat the soup=Utilisez un bol pour boire la soupe
|
||||
Drop foods inside to make a soup=Placez des ingrédients à l’intérieur pour faire une soupe
|
||||
@ -185,8 +134,8 @@ Coal Stone Tile=Carreau en charbon et pierre
|
||||
Polished Desert Stone Block=
|
||||
Hardened Clay=Argile durcie
|
||||
Moon Brick=Brique lunaire
|
||||
Runestone=Pierre runique
|
||||
Polished Stone Block=
|
||||
Runestone=Pierre runique
|
||||
Packed Ice=Glace compactée
|
||||
Wooden Tile=Carreau en bois
|
||||
Table=Table
|
||||
@ -196,10 +145,6 @@ Television=Télévision
|
||||
Wood Framed Glass=Verre encadré par du bois
|
||||
Radio=
|
||||
Speaker=
|
||||
@1 Stair=
|
||||
Inner @1 Stair=
|
||||
Outer @1 Stair=
|
||||
@1 Slab=
|
||||
Rope=Corde
|
||||
Nanoslab=
|
||||
Micropanel=
|
||||
@ -210,24 +155,26 @@ Panel=
|
||||
Slab=
|
||||
Double Panel=
|
||||
Half-Stair=
|
||||
Outer Stair=
|
||||
Stair=
|
||||
Inner Stair=
|
||||
Work Bench=Atelier
|
||||
For cutting blocks, repairing tools with a hammer, crafting and storing items=
|
||||
@1 @2=
|
||||
Hammer=Marteau
|
||||
Repairs tools at the work bench=
|
||||
Cut=Couper
|
||||
Repair=Réparer
|
||||
Crafting=Fabrication
|
||||
Storage=Stockage
|
||||
Back=Retour
|
||||
@1 Stair=
|
||||
Inner @1 Stair=
|
||||
Outer @1 Stair=
|
||||
@1 Slab=
|
||||
|
||||
|
||||
##### not used anymore #####
|
||||
|
||||
Dumb AI=IA stupide
|
||||
You can't reset the chessboard, a game has been started. If you aren't a current player, try again in @1=Vous ne pouvez pas mettre à zéro l’échiquier, une partie a été commencée. Si ce n’est pas votre tour de jouer, réessayez dans @1
|
||||
You can't dig the chessboard, a game has been started. Reset it first if you're a current player, or dig it again in @1=Vous ne pouvez pas récupérer l’échiquier, une partie à été commencée. Remettez le à zéro si vous c’est votre tour de jouer, ou réessayez dans @1
|
||||
Cauldron (idle)=Chaudron (inactif)
|
||||
Cauldron (active) - Drop foods inside to make a soup=Chaudron (actif) - Placez des ingrédients à l’intérieur pour faire une soupe
|
||||
Cauldron (active) - Use a bowl to eat the soup=Chaudron (actif) - Utilisez un bol pour boire la soupe
|
||||
|
@ -1,46 +1,11 @@
|
||||
# textdomain: xdecor
|
||||
Weak Computer=
|
||||
Weak Computer 1=
|
||||
Weak Computer 2=
|
||||
Chess=Scacchi
|
||||
Chess Debug=
|
||||
check=scacco
|
||||
checkmate=
|
||||
resigned=
|
||||
winner=
|
||||
loser=
|
||||
draw=
|
||||
You have checkmated @1. You win!=
|
||||
You were checkmated by @1. You lose!=
|
||||
The game ended up in a stalemate! It's a draw!=
|
||||
The game ended up in a dead position! It's a draw!=
|
||||
No piece was captured and no pawn was moved for 75 consecutive moves of each player. It's a draw!=
|
||||
You have drawn the game by invoking the 50-move rule.=
|
||||
@1 has drawn the game by invoking the 50-move rule.=
|
||||
You have failed to make a game-drawing move. The game continues.=
|
||||
@1 made a draw claim using the 50-move rule but it was false. The game continues.=
|
||||
The exact same position has occured 5 times. It's a draw!=
|
||||
You have drawn the game by invoking the threefold repetition rule.=
|
||||
@1 has drawn the game by invoking the threefold repetition rule.=
|
||||
@1 made a draw claim using the threefold repetition rule but it was false. The game continues.=
|
||||
Chess Board=Scacchiera
|
||||
Someone else plays white pieces!=Qualcun altro gioca con il bianco!
|
||||
It's not your turn!=
|
||||
Someone else plays black pieces!=Qualcun altro gioca con il nero!
|
||||
Black cannot move first!=
|
||||
@1 s=
|
||||
@1 min @2 s=
|
||||
You can't reset the chessboard, a game has been started. Try again in @1.=
|
||||
Resigning is not possible yet.=
|
||||
You have resigned.=
|
||||
@1 has resigned. You win!=
|
||||
You can't resign, you're not playing in this game.=
|
||||
You can't claim a draw, it's not your turn!=
|
||||
You're only a spectator in this game of Chess.=
|
||||
This isn't the time for promotion.=
|
||||
It's not your turn! This promotion is meant for the other player.=
|
||||
You can't dig the chessboard, a game has been started. Reset it first or dig it again in @1.=
|
||||
You can't dig the chessboard, a game has been started. Try it again in @1.=
|
||||
Dumb AI=AI stupida
|
||||
You can't reset the chessboard, a game has been started. If you aren't a current player, try again in @1=Non si può resettare la partita, un gioco è in corso. Se non si è uno dei giocatori, riprovare in @1
|
||||
You can't dig the chessboard, a game has been started. Reset it first if you're a current player, or dig it again in @1=Non si può scavare la scacchiera, una partita è in corso. Resettarla se si è uno dei giocatori, o riprovare in @1
|
||||
Play a game of Chess against another player or the computer=
|
||||
White Pawn=Pedone bianco
|
||||
Black Pawn=Pedone nero
|
||||
@ -54,27 +19,11 @@ White Queen=Regina bianca
|
||||
Black Queen=Regina nera
|
||||
White King=Re bianco
|
||||
Black King=Re nero
|
||||
Select a game mode=
|
||||
Select a mode:=Selezionare una modalità
|
||||
Singleplayer=Singolo giocatore
|
||||
Multiplayer=Multigiocatore
|
||||
Bot vs Bot=
|
||||
PROMOTION@nFOR BLACK!=
|
||||
Promote pawn to:=
|
||||
PROMOTION@nFOR WHITE!=
|
||||
DRAW CLAIM@nBY WHITE!=
|
||||
DRAW CLAIM@nBY BLACK!=
|
||||
The player has invoked the 50-move rule for the next move. The next move might draw the game.=
|
||||
The player has invoked the threefold-repetition rule for the next move. The next move might draw the game.=
|
||||
New game=Nuova partita
|
||||
Resign=
|
||||
Select a color:=
|
||||
White=
|
||||
Black=
|
||||
Invoke the 50-move rule for your next move=
|
||||
Invoke the 50-move rule and draw the game=
|
||||
Invoke the threefold repetition rule and draw the game=
|
||||
Invoke the threefold repetition rule for your next move=
|
||||
check=scacco
|
||||
Light a fire below to heat it up=
|
||||
Use a bowl to eat the soup=Utilizzare una ciotola per mangiare la zuppa
|
||||
Drop foods inside to make a soup=Mettere gli ingredienti all'interno per fare una zuppa
|
||||
@ -185,8 +134,8 @@ Coal Stone Tile=Mattonella di pietra di carbone
|
||||
Polished Desert Stone Block=
|
||||
Hardened Clay=Argilla indurita
|
||||
Moon Brick=Mattone lunare
|
||||
Runestone=Pietra runica
|
||||
Polished Stone Block=
|
||||
Runestone=Pietra runica
|
||||
Packed Ice=Ghiaccio compatto
|
||||
Wooden Tile=Mattonella di legno
|
||||
Table=Tavolo
|
||||
@ -196,10 +145,6 @@ Television=Televisione
|
||||
Wood Framed Glass=Cornice in legno con vetro
|
||||
Radio=
|
||||
Speaker=
|
||||
@1 Stair=
|
||||
Inner @1 Stair=
|
||||
Outer @1 Stair=
|
||||
@1 Slab=
|
||||
Rope=Corda
|
||||
Nanoslab=
|
||||
Micropanel=
|
||||
@ -210,24 +155,26 @@ Panel=
|
||||
Slab=
|
||||
Double Panel=
|
||||
Half-Stair=
|
||||
Outer Stair=
|
||||
Stair=
|
||||
Inner Stair=
|
||||
Work Bench=Banco da lavoro
|
||||
For cutting blocks, repairing tools with a hammer, crafting and storing items=
|
||||
@1 @2=
|
||||
Hammer=Martello
|
||||
Repairs tools at the work bench=
|
||||
Cut=Tagliare
|
||||
Repair=Riparare
|
||||
Crafting=Fabbricare
|
||||
Storage=Conservare
|
||||
Back=Indietro
|
||||
@1 Stair=
|
||||
Inner @1 Stair=
|
||||
Outer @1 Stair=
|
||||
@1 Slab=
|
||||
|
||||
|
||||
##### not used anymore #####
|
||||
|
||||
Dumb AI=AI stupida
|
||||
You can't reset the chessboard, a game has been started. If you aren't a current player, try again in @1=Non si può resettare la partita, un gioco è in corso. Se non si è uno dei giocatori, riprovare in @1
|
||||
You can't dig the chessboard, a game has been started. Reset it first if you're a current player, or dig it again in @1=Non si può scavare la scacchiera, una partita è in corso. Resettarla se si è uno dei giocatori, o riprovare in @1
|
||||
Cauldron (idle)=Calderone (inattivo)
|
||||
Cauldron (active) - Drop foods inside to make a soup=Calderone (attivo) - Mettere gli ingredienti all'interno per fare una zuppa.
|
||||
Cauldron (active) - Use a bowl to eat the soup=Calderone (actif) - Utilizzare una ciotola per mangiare la zuppa
|
||||
|
@ -2,8 +2,9 @@
|
||||
|
||||
|
||||
|
||||
# This adds a chessboard on which you can play Chess against other players or the computer.
|
||||
enable_xdecor_chess (Enable Chess) bool true
|
||||
# This adds a decorative chessboard.
|
||||
# Note: You can't play chess on it.
|
||||
enable_xdecor_chess (Enable Chessboard) bool true
|
||||
|
||||
# This enables the cauldron which you can use to store water and cook soup.
|
||||
enable_xdecor_cooking (Enable Cooking) bool true
|
||||
|
2328
src/chess.lua
132
src/chessbot.lua
@ -1,132 +0,0 @@
|
||||
local chessbot = {}
|
||||
|
||||
local realchess = xdecor.chess
|
||||
|
||||
-- Delay in seconds for a bot moving a piece (excluding choosing a promotion)
|
||||
local BOT_DELAY_MOVE = 1.0
|
||||
-- Delay in seconds for a bot promoting a piece
|
||||
local BOT_DELAY_PROMOTE = 1.0
|
||||
|
||||
local function best_move(moves)
|
||||
local value, choices = 0, {}
|
||||
|
||||
for from, _ in pairs(moves) do
|
||||
for to, val in pairs(_) do
|
||||
if val > value then
|
||||
value = val
|
||||
choices = {{
|
||||
from = from,
|
||||
to = to
|
||||
}}
|
||||
elseif val == value then
|
||||
choices[#choices + 1] = {
|
||||
from = from,
|
||||
to = to
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if #choices == 0 then
|
||||
return nil
|
||||
end
|
||||
local random = math.random(1, #choices)
|
||||
local choice_from, choice_to = choices[random].from, choices[random].to
|
||||
|
||||
return tonumber(choice_from), choice_to
|
||||
end
|
||||
|
||||
function chessbot.move(inv, meta)
|
||||
local board_t = realchess.board_to_table(inv)
|
||||
local lastMove = meta:get_string("lastMove")
|
||||
local gameResult = meta:get_string("gameResult")
|
||||
local botColor = meta:get_string("botColor")
|
||||
if botColor == "" then
|
||||
return
|
||||
end
|
||||
local currentBotColor, opponentColor
|
||||
local botName
|
||||
if botColor == "black" then
|
||||
currentBotColor = "black"
|
||||
opponentColor = "white"
|
||||
elseif botColor == "white" then
|
||||
currentBotColor = "white"
|
||||
opponentColor = "black"
|
||||
elseif botColor == "both" then
|
||||
opponentColor = lastMove
|
||||
if lastMove == "black" or lastMove == "" then
|
||||
currentBotColor = "white"
|
||||
else
|
||||
currentBotColor = "black"
|
||||
end
|
||||
end
|
||||
if currentBotColor == "white" then
|
||||
botName = meta:get_string("playerWhite")
|
||||
else
|
||||
botName = meta:get_string("playerBlack")
|
||||
end
|
||||
if (lastMove == opponentColor or ((botColor == "white" or botColor == "both") and lastMove == "")) and gameResult == "" then
|
||||
|
||||
local moves = realchess.get_theoretical_moves_for(meta, board_t, currentBotColor)
|
||||
local safe_moves, safe_moves_count = realchess.get_king_safe_moves(moves, board_t, currentBotColor)
|
||||
if safe_moves_count == 0 then
|
||||
-- No safe move: stalemate or checkmate
|
||||
end
|
||||
local choice_from, choice_to = best_move(safe_moves)
|
||||
if choice_from == nil then
|
||||
-- No best move: stalemate or checkmate
|
||||
return
|
||||
end
|
||||
|
||||
local pieceFrom = inv:get_stack("board", choice_from):get_name()
|
||||
local pieceTo = inv:get_stack("board", choice_to):get_name()
|
||||
|
||||
minetest.after(BOT_DELAY_MOVE, function()
|
||||
local gameResult = meta:get_string("gameResult")
|
||||
if gameResult ~= "" then
|
||||
return
|
||||
end
|
||||
local botColor = meta:get_string("botColor")
|
||||
if botColor == "" then
|
||||
return
|
||||
end
|
||||
local lastMove = meta:get_string("lastMove")
|
||||
local lastMoveTime = meta:get_int("lastMoveTime")
|
||||
if lastMoveTime > 0 or lastMove == "" then
|
||||
-- Set the bot name if not set already
|
||||
if currentBotColor == "black" and meta:get_string("playerBlack") == "" then
|
||||
meta:set_string("playerBlack", botName)
|
||||
elseif currentBotColor == "white" and meta:get_string("playerWhite") == "" then
|
||||
meta:set_string("playerWhite", botName)
|
||||
end
|
||||
|
||||
-- Make a move
|
||||
local moveOK = realchess.move(meta, "board", choice_from, "board", choice_to, botName)
|
||||
if not moveOK then
|
||||
minetest.log("error", "[xdecor] Chess: Bot tried to make an invalid move from "..
|
||||
realchess.index_to_notation(choice_from).." to "..realchess.index_to_notation(choice_to))
|
||||
end
|
||||
-- Bot resigns if it tried to make an invalid move
|
||||
if not moveOK then
|
||||
realchess.resign(meta, currentBotColor)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function chessbot.promote(inv, meta, pawnIndex)
|
||||
minetest.after(BOT_DELAY_PROMOTE, function()
|
||||
local lastMove = meta:get_string("lastMove")
|
||||
local color
|
||||
if lastMove == "black" or lastMove == "" then
|
||||
color = "white"
|
||||
else
|
||||
color = "black"
|
||||
end
|
||||
-- Always promote to queen
|
||||
realchess.promote_pawn(meta, color, "queen")
|
||||
end)
|
||||
end
|
||||
|
||||
return chessbot
|
@ -245,7 +245,6 @@ xdecor.register("cauldron_empty", {
|
||||
description = S("Cauldron"),
|
||||
_tt_help = S("For storing water and cooking soup"),
|
||||
groups = {cracky=2, oddly_breakable_by_hand=1,cauldron=1},
|
||||
is_ground_content = false,
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
tiles = {"xdecor_cauldron_top_empty.png", "xdecor_cauldron_sides.png"},
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
@ -262,7 +261,6 @@ xdecor.register("cauldron_empty", {
|
||||
xdecor.register("cauldron_idle", {
|
||||
description = S("Cauldron with Water (cold)"),
|
||||
groups = {cracky=2, oddly_breakable_by_hand=1, not_in_creative_inventory=1,cauldron=2},
|
||||
is_ground_content = false,
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
tiles = {"xdecor_cauldron_top_idle.png", "xdecor_cauldron_sides.png"},
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
@ -276,7 +274,6 @@ xdecor.register("cauldron_idle", {
|
||||
xdecor.register("cauldron_idle_river_water", {
|
||||
description = S("Cauldron with River Water (cold)"),
|
||||
groups = {cracky=2, oddly_breakable_by_hand=1, not_in_creative_inventory=1,cauldron=2},
|
||||
is_ground_content = false,
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
tiles = {"xdecor_cauldron_top_idle_river_water.png", "xdecor_cauldron_sides.png"},
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
@ -290,7 +287,6 @@ xdecor.register("cauldron_idle_river_water", {
|
||||
xdecor.register("cauldron_idle_soup", {
|
||||
description = S("Cauldron with Soup (cold)"),
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 1, not_in_creative_inventory = 1,cauldron=2},
|
||||
is_ground_content = false,
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
drop = "xdecor:cauldron_empty",
|
||||
tiles = {"xdecor_cauldron_top_idle_soup.png", "xdecor_cauldron_sides.png"},
|
||||
@ -311,7 +307,6 @@ xdecor.register("cauldron_idle_soup", {
|
||||
xdecor.register("cauldron_boiling", {
|
||||
description = S("Cauldron with Water (boiling)"),
|
||||
groups = {cracky=2, oddly_breakable_by_hand=1, not_in_creative_inventory=1,cauldron=3},
|
||||
is_ground_content = false,
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
drop = "xdecor:cauldron_empty",
|
||||
damage_per_second = 2,
|
||||
@ -335,7 +330,6 @@ xdecor.register("cauldron_boiling", {
|
||||
xdecor.register("cauldron_boiling_river_water", {
|
||||
description = S("Cauldron with River Water (boiling)"),
|
||||
groups = {cracky=2, oddly_breakable_by_hand=1, not_in_creative_inventory=1,cauldron=3},
|
||||
is_ground_content = false,
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
drop = "xdecor:cauldron_empty",
|
||||
damage_per_second = 2,
|
||||
@ -361,7 +355,6 @@ xdecor.register("cauldron_boiling_river_water", {
|
||||
xdecor.register("cauldron_soup", {
|
||||
description = S("Cauldron with Soup (boiling)"),
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 1, not_in_creative_inventory = 1,cauldron=3},
|
||||
is_ground_content = false,
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
drop = "xdecor:cauldron_empty",
|
||||
damage_per_second = 2,
|
||||
@ -403,7 +396,7 @@ minetest.register_craftitem("xdecor:bowl_soup", {
|
||||
description = S("Bowl of soup"),
|
||||
inventory_image = "xdecor_bowl_soup.png",
|
||||
wield_image = "xdecor_bowl_soup.png",
|
||||
groups = {},
|
||||
groups = {not_in_creative_inventory=1},
|
||||
stack_max = 1,
|
||||
on_use = minetest.item_eat(30, "xdecor:bowl")
|
||||
})
|
||||
|
@ -229,7 +229,6 @@ xdecor.register("enchantment_table", {
|
||||
"xdecor_enchantment_side.png", "xdecor_enchantment_side.png"
|
||||
},
|
||||
groups = {cracky = 1, level = 1},
|
||||
is_ground_content = false,
|
||||
light_source = 6,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
|
@ -34,7 +34,7 @@ function hive.set_formspec(meta, status)
|
||||
list[current_player;main;0,2.35;8,4;]
|
||||
listring[current_player;main]
|
||||
listring[context;honey] ]] ..
|
||||
xdecor.xbg .. default.get_hotbar_bg(0,2.35)
|
||||
xbg .. default.get_hotbar_bg(0,2.35)
|
||||
meta:set_string("formspec", formspec)
|
||||
end
|
||||
|
||||
@ -126,7 +126,6 @@ xdecor.register("hive", {
|
||||
"xdecor_hive_side.png", "xdecor_hive_side.png",
|
||||
"xdecor_hive_side.png", "xdecor_hive_front.png"},
|
||||
groups = {choppy=3, oddly_breakable_by_hand=2, flammable=1},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_construct = hive.construct,
|
||||
on_timer = hive.timer,
|
||||
|
@ -160,7 +160,6 @@ xdecor.register("itemframe", {
|
||||
description = S("Item Frame"),
|
||||
_tt_help = S("For presenting a single item"),
|
||||
groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_rotate = screwdriver.disallow,
|
||||
sunlight_propagates = true,
|
||||
|
@ -80,7 +80,7 @@ function mailbox:formspec(pos, owner, is_owner)
|
||||
"table[6,0.75;3.3,4;givers;" .. giver .. "]" ..
|
||||
"list[nodemeta:" .. spos .. ";mailbox;0,0.75;6,4;]" ..
|
||||
"listring[nodemeta:" .. spos .. ";mailbox]" ..
|
||||
xdecor.xbg .. default.get_hotbar_bg(0.75, 5.25)
|
||||
xbg .. default.get_hotbar_bg(0.75, 5.25)
|
||||
end
|
||||
|
||||
return "size[8,5]" ..
|
||||
@ -90,7 +90,7 @@ function mailbox:formspec(pos, owner, is_owner)
|
||||
minetest.colorize("#FFFF00", owner) or owner)) .. "]" ..
|
||||
"list[nodemeta:" .. spos .. ";drop;3.5,0;1,1;]" ..
|
||||
"listring[]" ..
|
||||
xdecor.xbg .. default.get_hotbar_bg(0, 1.25)
|
||||
xbg .. default.get_hotbar_bg(0, 1.25)
|
||||
end
|
||||
|
||||
function mailbox.dig(pos, player)
|
||||
@ -185,7 +185,6 @@ xdecor.register("mailbox", {
|
||||
"xdecor_mailbox_side.png", "xdecor_mailbox_side.png",
|
||||
"xdecor_mailbox.png", "xdecor_mailbox.png"},
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 1},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
can_dig = mailbox.dig,
|
||||
|
@ -63,7 +63,6 @@ function plate.register(material, desc, def)
|
||||
drawtype = "nodebox",
|
||||
node_box = xdecor.pixelbox(16, {{1, 0, 1, 14, 1, 14}}),
|
||||
groups = def.groups,
|
||||
is_ground_content = false,
|
||||
sounds = def.sounds,
|
||||
sunlight_propagates = true,
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
@ -76,7 +75,6 @@ function plate.register(material, desc, def)
|
||||
drawtype = "nodebox",
|
||||
node_box = xdecor.pixelbox(16, {{1, 0, 1, 14, 0.4, 14}}),
|
||||
groups = def.groups,
|
||||
is_ground_content = false,
|
||||
sounds = def.sounds,
|
||||
drop = "xdecor:pressure_" .. material .. "_off",
|
||||
sunlight_propagates = true,
|
||||
@ -104,7 +102,6 @@ xdecor.register("lever_off", {
|
||||
drawtype = "nodebox",
|
||||
node_box = xdecor.pixelbox(16, {{2, 1, 15, 12, 14, 1}}),
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 2},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
@ -130,7 +127,6 @@ xdecor.register("lever_on", {
|
||||
drawtype = "nodebox",
|
||||
node_box = xdecor.pixelbox(16, {{2, 1, 15, 12, 14, 1}}),
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 2, not_in_creative_inventory = 1},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
|
@ -67,7 +67,6 @@ xdecor.register("baricade", {
|
||||
inventory_image = "xdecor_baricade.png",
|
||||
tiles = {"xdecor_baricade.png"},
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
||||
is_ground_content = false,
|
||||
damage_per_second = 4,
|
||||
selection_box = xdecor.nodebox.slab_y(0.3),
|
||||
collision_box = xdecor.pixelbox(2, {{0, 0, 1, 2, 2, 0}})
|
||||
@ -78,7 +77,6 @@ xdecor.register("barrel", {
|
||||
tiles = {"xdecor_barrel_top.png", "xdecor_barrel_top.png", "xdecor_barrel_sides.png"},
|
||||
on_place = minetest.rotate_node,
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_wood_defaults()
|
||||
})
|
||||
|
||||
@ -101,7 +99,6 @@ local function register_storage(name, desc, def)
|
||||
on_place = def.on_place,
|
||||
on_blast = blast_storage,
|
||||
groups = def.groups or {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_wood_defaults()
|
||||
})
|
||||
end
|
||||
@ -173,7 +170,6 @@ xdecor.register("candle", {
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = false,
|
||||
groups = {dig_immediate = 3, attached_node = 1},
|
||||
is_ground_content = false,
|
||||
tiles = {
|
||||
{
|
||||
name = "xdecor_candle_floor.png",
|
||||
@ -201,7 +197,6 @@ xdecor.register("chair", {
|
||||
tiles = {"xdecor_wood.png"},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 2},
|
||||
is_ground_content = false,
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
node_box = xdecor.pixelbox(16, {
|
||||
{3, 0, 11, 2, 16, 2},
|
||||
@ -229,7 +224,6 @@ xdecor.register("cobweb", {
|
||||
walkable = false,
|
||||
selection_box = {type = "regular"},
|
||||
groups = {snappy = 3, flammable = 3},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_leaves_defaults()
|
||||
})
|
||||
|
||||
@ -260,7 +254,6 @@ for c, desc in pairs(curtain_colors) do
|
||||
drawtype = "signlike",
|
||||
paramtype2 = "colorwallmounted",
|
||||
groups = {dig_immediate = 3, flammable = 3},
|
||||
is_ground_content = false,
|
||||
selection_box = {type = "wallmounted"},
|
||||
on_rightclick = function(pos, node, _, itemstack)
|
||||
minetest.set_node(pos, {name = "xdecor:curtain_open_" .. c, param2 = node.param2})
|
||||
@ -276,7 +269,6 @@ for c, desc in pairs(curtain_colors) do
|
||||
paramtype2 = "colorwallmounted",
|
||||
walkable = false,
|
||||
groups = {dig_immediate = 3, flammable = 3, not_in_creative_inventory = 1},
|
||||
is_ground_content = false,
|
||||
selection_box = {type="wallmounted"},
|
||||
drop = "xdecor:curtain_" .. c,
|
||||
on_rightclick = function(pos, node, _, itemstack)
|
||||
@ -299,7 +291,6 @@ xdecor.register("cushion", {
|
||||
description = S("Cushion"),
|
||||
tiles = {"xdecor_cushion.png"},
|
||||
groups = {snappy = 3, flammable = 3, fall_damage_add_percent = -50},
|
||||
is_ground_content = false,
|
||||
on_place = minetest.rotate_node,
|
||||
node_box = xdecor.nodebox.slab_y(0.5),
|
||||
can_dig = xdecor.sit_dig,
|
||||
@ -314,7 +305,6 @@ xdecor.register("cushion_block", {
|
||||
description = S("Cushion Block"),
|
||||
tiles = {"xdecor_cushion.png"},
|
||||
groups = {snappy = 3, flammable = 3, fall_damage_add_percent = -75},
|
||||
is_ground_content = false,
|
||||
})
|
||||
|
||||
local function door_access(name)
|
||||
@ -431,7 +421,6 @@ xdecor.register("enderchest", {
|
||||
"xdecor_enderchest_side.png", "xdecor_enderchest_front.png"
|
||||
},
|
||||
groups = {cracky = 1, choppy = 1},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
on_construct = function(pos)
|
||||
@ -441,7 +430,7 @@ xdecor.register("enderchest", {
|
||||
list[current_player;main;0,5;8,4;]
|
||||
listring[current_player;enderchest]
|
||||
listring[current_player;main] ]]
|
||||
.. xdecor.xbg .. default.get_hotbar_bg(0,5))
|
||||
.. xbg .. default.get_hotbar_bg(0,5))
|
||||
|
||||
meta:set_string("infotext", S("Ender Chest"))
|
||||
end
|
||||
@ -472,7 +461,6 @@ xdecor.register("rooster", {
|
||||
inventory_image = "xdecor_rooster.png",
|
||||
walkable = false,
|
||||
groups = {snappy = 3, attached_node = 1},
|
||||
is_ground_content = false,
|
||||
tiles = {"xdecor_rooster.png"},
|
||||
sounds = default.node_sound_metal_defaults(),
|
||||
})
|
||||
@ -487,7 +475,6 @@ xdecor.register("lantern", {
|
||||
wield_image = "xdecor_lantern_inv.png",
|
||||
walkable = false,
|
||||
groups = {snappy = 3, attached_node = 3},
|
||||
is_ground_content = false,
|
||||
tiles = {
|
||||
{
|
||||
name = "xdecor_lantern.png",
|
||||
@ -562,7 +549,6 @@ xdecor.register("lantern_hanging", {
|
||||
wield_image = "xdecor_lantern_inv.png",
|
||||
walkable = false,
|
||||
groups = {snappy = 3, attached_node = 4, not_in_creative_inventory = 1},
|
||||
is_ground_content = false,
|
||||
tiles = {
|
||||
{
|
||||
name = "xdecor_lantern.png",
|
||||
@ -609,7 +595,6 @@ for l, desc in pairs(xdecor_lightbox) do
|
||||
description = desc,
|
||||
tiles = {"xdecor_" .. l .. "_lightbox.png"},
|
||||
groups = {cracky = 3, choppy = 3, oddly_breakable_by_hand = 2},
|
||||
is_ground_content = false,
|
||||
light_source = 13,
|
||||
sounds = default.node_sound_glass_defaults()
|
||||
})
|
||||
@ -629,7 +614,6 @@ for f, desc in pairs(xdecor_potted) do
|
||||
description = desc,
|
||||
walkable = false,
|
||||
groups = {snappy = 3, flammable = 3, plant = 1, flower = 1},
|
||||
is_ground_content = false,
|
||||
tiles = {"xdecor_" .. f .. "_pot.png"},
|
||||
inventory_image = "xdecor_" .. f .. "_pot.png",
|
||||
drawtype = "plantlike",
|
||||
@ -665,7 +649,6 @@ xdecor.register("painting_1", {
|
||||
paramtype2 = "wallmounted",
|
||||
sunlight_propagates = true,
|
||||
groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 2, attached_node = 1},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = painting_box,
|
||||
node_placement_prediction = "",
|
||||
@ -723,7 +706,6 @@ for i = 2, 4 do
|
||||
attached_node = 1,
|
||||
not_in_creative_inventory = 1
|
||||
},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = painting_box
|
||||
})
|
||||
@ -733,7 +715,6 @@ xdecor.register("stonepath", {
|
||||
description = S("Garden Stone Path"),
|
||||
tiles = {"default_stone.png"},
|
||||
groups = {snappy = 3},
|
||||
is_ground_content = false,
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
sunlight_propagates = true,
|
||||
@ -748,9 +729,8 @@ local function register_hard_node(name, desc, def)
|
||||
def = def or {}
|
||||
xdecor.register(name, {
|
||||
description = desc,
|
||||
tiles = def.tiles or {"xdecor_" .. name .. ".png"},
|
||||
tiles = {"xdecor_" .. name .. ".png"},
|
||||
groups = def.groups or {cracky = 1},
|
||||
is_ground_content = false,
|
||||
sounds = def.sounds or default.node_sound_stone_defaults()
|
||||
})
|
||||
end
|
||||
@ -760,34 +740,23 @@ register_hard_node("coalstone_tile", S("Coal Stone Tile"))
|
||||
register_hard_node("desertstone_tile", S("Polished Desert Stone Block"))
|
||||
register_hard_node("hard_clay", S("Hardened Clay"))
|
||||
register_hard_node("moonbrick", S("Moon Brick"))
|
||||
register_hard_node("stone_tile", S("Polished Stone Block"))
|
||||
register_hard_node("stone_rune", S("Runestone"))
|
||||
|
||||
-- renamed from stone_tile to fix naming collision with moreblocks
|
||||
-- mod for the registrations under the 'stairs:' namespace
|
||||
register_hard_node("stone_tile_x", S("Polished Stone Block"), {
|
||||
tiles = {"xdecor_stone_tile.png"},
|
||||
})
|
||||
xdecor.register_legacy_aliases("stone_tile", "stone_tile_x")
|
||||
|
||||
register_hard_node("packed_ice", S("Packed Ice"), {
|
||||
groups = {cracky = 1, cools_lava = 1, slippery = 3},
|
||||
sounds = default.node_sound_glass_defaults()
|
||||
})
|
||||
|
||||
-- renamed from wood_tile to fix naming collision with moreblocks
|
||||
-- mod for the registrations under the 'stairs:' namespace
|
||||
register_hard_node("wood_tile_x", S("Wooden Tile"), {
|
||||
register_hard_node("wood_tile", S("Wooden Tile"), {
|
||||
groups = {choppy = 1, wood = 1, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
tiles = {"xdecor_wood_tile.png"},
|
||||
sounds = default.node_sound_wood_defaults()
|
||||
})
|
||||
xdecor.register_legacy_aliases("wood_tile", "wood_tile_x")
|
||||
|
||||
xdecor.register("table", {
|
||||
description = S("Table"),
|
||||
tiles = {"xdecor_wood.png"},
|
||||
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = xdecor.pixelbox(16, {
|
||||
{0, 14, 0, 16, 2, 16}, {5.5, 0, 5.5, 5, 14, 6}
|
||||
@ -799,7 +768,6 @@ xdecor.register("tatami", {
|
||||
tiles = {"xdecor_tatami.png"},
|
||||
wield_image = "xdecor_tatami.png",
|
||||
groups = {snappy = 3, flammable = 3},
|
||||
is_ground_content = false,
|
||||
sunlight_propagates = true,
|
||||
node_box = xdecor.nodebox.slab_y(0.0625)
|
||||
})
|
||||
@ -809,7 +777,6 @@ xdecor.register("trampoline", {
|
||||
tiles = {"xdecor_trampoline.png", "mailbox_blank16.png", "xdecor_trampoline_sides.png"},
|
||||
use_texture_alpha = ALPHA_CLIP,
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 1, fall_damage_add_percent = -80, bouncy = 90},
|
||||
is_ground_content = false,
|
||||
node_box = xdecor.nodebox.slab_y(0.5),
|
||||
sounds = default.node_sound_defaults({
|
||||
footstep = {
|
||||
@ -824,7 +791,6 @@ xdecor.register("tv", {
|
||||
description = S("Television"),
|
||||
light_source = 11,
|
||||
groups = {cracky = 3, oddly_breakable_by_hand = 2},
|
||||
is_ground_content = false,
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
tiles = {
|
||||
"xdecor_television_left.png^[transformR270",
|
||||
@ -846,7 +812,6 @@ xdecor.register("woodframed_glass", {
|
||||
tiles = {"xdecor_woodframed_glass.png", "xdecor_woodframed_glass_detail.png"},
|
||||
use_texture_alpha = ALPHA_CLIP,
|
||||
groups = {cracky = 2, oddly_breakable_by_hand = 1},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
_xdecor_custom_noncube_tiles = {
|
||||
stair = {
|
||||
@ -916,7 +881,6 @@ for _, v in pairs(devices) do
|
||||
"xdecor_" .. v[1] .. "_front.png",
|
||||
},
|
||||
groups = {cracky = 2, not_cuttable = 1},
|
||||
is_ground_content = false,
|
||||
sounds = v[3],
|
||||
})
|
||||
end
|
||||
|
@ -88,10 +88,9 @@ minetest.register_craft({
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "xdecor:desertstone_tile 4",
|
||||
output = "xdecor:desertstone_tile",
|
||||
recipe = {
|
||||
{"default:desert_stone_block", "default:desert_stone_block"},
|
||||
{"default:desert_stone_block", "default:desert_stone_block"},
|
||||
{"default:desert_stone_block"},
|
||||
}
|
||||
})
|
||||
|
||||
@ -206,10 +205,9 @@ minetest.register_craft({
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "xdecor:stone_tile_x 4",
|
||||
output = "xdecor:stone_tile",
|
||||
recipe = {
|
||||
{"default:stone_block", "default:stone_block"},
|
||||
{"default:stone_block", "default:stone_block"},
|
||||
{"default:stone_block"},
|
||||
}
|
||||
})
|
||||
|
||||
@ -275,7 +273,7 @@ minetest.register_craft({
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "xdecor:wood_tile_x 2",
|
||||
output = "xdecor:wood_tile 2",
|
||||
recipe = {
|
||||
{"", "group:wood", ""},
|
||||
{"group:wood", "", "group:wood"},
|
||||
@ -379,7 +377,7 @@ minetest.register_craft({
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "xdecor:wood_tile_x",
|
||||
recipe = "xdecor:wood_tile",
|
||||
burntime = 10,
|
||||
})
|
||||
minetest.register_craft({
|
||||
|
@ -86,7 +86,6 @@ xdecor.register("rope", {
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
groups = {dig_immediate = 3, flammable = 3},
|
||||
is_ground_content = false,
|
||||
tiles = {"xdecor_rope.png"},
|
||||
inventory_image = "xdecor_rope_inv.png",
|
||||
wield_image = "xdecor_rope_inv.png",
|
||||
|
@ -1,12 +1,18 @@
|
||||
local workbench = {}
|
||||
local registered_cuttable_nodes = {}
|
||||
local special_cuts = {}
|
||||
local nodes = {}
|
||||
|
||||
screwdriver = screwdriver or {}
|
||||
local min, ceil = math.min, math.ceil
|
||||
local S = minetest.get_translator("xdecor")
|
||||
local FS = function(...) return minetest.formspec_escape(S(...)) end
|
||||
|
||||
-- Nodes allowed to be cut
|
||||
-- Only the regular, solid blocks without metas or explosivity can be cut
|
||||
for node, def in pairs(minetest.registered_nodes) do
|
||||
if xdecor.stairs_valid_def(def) then
|
||||
nodes[#nodes + 1] = node
|
||||
end
|
||||
end
|
||||
|
||||
-- Nodeboxes definitions
|
||||
workbench.defs = {
|
||||
@ -23,11 +29,13 @@ workbench.defs = {
|
||||
{ 0, 8, 8, 16, 8, 8 }}, S("Double Panel")},
|
||||
{"halfstair", 2, {{ 0, 0, 0, 8, 8, 16 },
|
||||
{ 0, 8, 8, 8, 8, 8 }}, S("Half-Stair")},
|
||||
{"stair_outer", 1, nil, nil},
|
||||
{"stair_outer", 1, nil, S("Outer Stair")},
|
||||
{"stair", 1, nil, S("Stair")},
|
||||
{"stair_inner", 1, nil, nil},
|
||||
{"stair_inner", 1, nil, S("Inner Stair")},
|
||||
}
|
||||
|
||||
local repairable_tools = {"pick", "axe", "shovel", "sword", "hoe", "armor", "shield"}
|
||||
|
||||
local custom_repairable = {}
|
||||
function xdecor:register_repairable(item)
|
||||
custom_repairable[item] = true
|
||||
@ -35,39 +43,13 @@ end
|
||||
|
||||
-- Tools allowed to be repaired
|
||||
function workbench:repairable(stack)
|
||||
-- Explicitly registeded as repairable: Overrides everything else
|
||||
if custom_repairable[stack] then
|
||||
return true
|
||||
end
|
||||
-- no repair if non-tool
|
||||
if not minetest.registered_tools[stack] then
|
||||
return false
|
||||
end
|
||||
-- no repair if disable_repair group
|
||||
if minetest.get_item_group(stack, "disable_repair") == 1 then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
if custom_repairable[stack] then return true end
|
||||
|
||||
-- Returns true if item can be cut into basic stairs and slabs
|
||||
function workbench:cuttable(itemname)
|
||||
local split = string.split(itemname, ":")
|
||||
if split and split[1] and split[2] then
|
||||
if minetest.registered_nodes["stairs:stair_"..split[2]] ~= nil or
|
||||
minetest.registered_nodes["stairs:slab_"..split[2]] ~= nil then
|
||||
for _, t in ipairs(repairable_tools) do
|
||||
if stack:find(t) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
if registered_cuttable_nodes[itemname] == true then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- Returns true if item can be cut into xdecor extended shapes (thinslab, panel, cube, etc.)
|
||||
function workbench:cuttable_extended(itemname)
|
||||
return registered_cuttable_nodes[itemname] == true
|
||||
end
|
||||
|
||||
-- method to allow other mods to check if an item is repairable
|
||||
@ -77,43 +59,18 @@ end
|
||||
|
||||
function workbench:get_output(inv, input, name)
|
||||
local output = {}
|
||||
local extended = workbench:cuttable_extended(input:get_name())
|
||||
for i = 1, #self.defs do
|
||||
local nbox = self.defs[i]
|
||||
local cuttype = nbox[1]
|
||||
local count = nbox[2] * input:get_count()
|
||||
local max_count = input:get_stack_max()
|
||||
if count > max_count then
|
||||
-- Limit count to maximum multiple to avoid waste
|
||||
count = nbox[2] * math.floor(max_count / nbox[2])
|
||||
end
|
||||
local was_cut = false
|
||||
if extended or nbox[3] == nil then
|
||||
local item = name .. "_" .. cuttype
|
||||
local count = min(nbox[2] * input:get_count(), input:get_stack_max())
|
||||
local item = name .. "_" .. nbox[1]
|
||||
|
||||
item = nbox[3] and item or "stairs:" .. cuttype .. "_" .. name:match(":(.*)")
|
||||
if minetest.registered_items[item] then
|
||||
item = nbox[3] and item or "stairs:" .. nbox[1] .. "_" .. name:match(":(.*)")
|
||||
output[i] = item .. " " .. count
|
||||
was_cut = true
|
||||
end
|
||||
end
|
||||
if not was_cut and special_cuts[input:get_name()] ~= nil then
|
||||
local cut = special_cuts[input:get_name()][cuttype]
|
||||
if cut then
|
||||
output[i] = cut .. " " .. count
|
||||
was_cut = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
inv:set_list("forms", output)
|
||||
end
|
||||
|
||||
function workbench:register_special_cut(nodename, cutlist)
|
||||
registered_cuttable_nodes[nodename] = true
|
||||
special_cuts[nodename] = cutlist
|
||||
end
|
||||
|
||||
local main_fs = "label[0.9,1.23;"..FS("Cut").."]"
|
||||
.."label[0.9,2.23;"..FS("Repair").."]"
|
||||
..[[ box[-0.05,1;2.05,0.9;#555555]
|
||||
@ -166,7 +123,7 @@ local formspecs = {
|
||||
function workbench:set_formspec(meta, id)
|
||||
meta:set_string("formspec",
|
||||
"size[8,7;]list[current_player;main;0,3.25;8,4;]" ..
|
||||
formspecs[id] .. xdecor.xbg .. default.get_hotbar_bg(0,3.25))
|
||||
formspecs[id] .. xbg .. default.get_hotbar_bg(0,3.25))
|
||||
end
|
||||
|
||||
function workbench.construct(pos)
|
||||
@ -228,8 +185,9 @@ end
|
||||
|
||||
function workbench.allow_put(pos, listname, index, stack, player)
|
||||
local stackname = stack:get_name()
|
||||
if (listname == "tool" and workbench:repairable(stackname)) or
|
||||
(listname == "input" and workbench:cuttable(stackname)) or
|
||||
if (listname == "tool" and stack:get_wear() > 0 and
|
||||
workbench:repairable(stackname)) or
|
||||
(listname == "input" and minetest.registered_nodes[stackname .. "_cube"]) or
|
||||
(listname == "hammer" and stackname == "xdecor:hammer") or
|
||||
listname == "storage" then
|
||||
return stack:get_count()
|
||||
@ -250,16 +208,7 @@ function workbench.on_put(pos, listname, index, stack, player)
|
||||
end
|
||||
|
||||
function workbench.allow_move(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
if (to_list == "storage" and from_list ~= "forms") then
|
||||
return count
|
||||
elseif (to_list == "hammer" and from_list == "tool") or (to_list == "tool" and from_list == "hammer") then
|
||||
local inv = minetest.get_inventory({type="node", pos=pos})
|
||||
local stack = inv:get_stack(from_list, from_index)
|
||||
if stack:get_name() == "xdecor:hammer" then
|
||||
return count
|
||||
end
|
||||
end
|
||||
return 0
|
||||
return (to_list == "storage" and from_list ~= "forms") and count or 0
|
||||
end
|
||||
|
||||
function workbench.on_move(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
@ -283,7 +232,7 @@ function workbench.on_take(pos, listname, index, stack, player)
|
||||
local stackname = stack:get_name()
|
||||
|
||||
if listname == "input" then
|
||||
if stackname == inputname and workbench:cuttable(inputname) then
|
||||
if stackname == inputname and minetest.registered_nodes[inputname .. "_cube"] then
|
||||
workbench:get_output(inv, input, stackname)
|
||||
else
|
||||
inv:set_list("forms", {})
|
||||
@ -307,7 +256,6 @@ xdecor.register("workbench", {
|
||||
description = S("Work Bench"),
|
||||
_tt_help = S("For cutting blocks, repairing tools with a hammer, crafting and storing items"),
|
||||
groups = {cracky = 2, choppy = 2, oddly_breakable_by_hand = 1},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
tiles = {
|
||||
"xdecor_workbench_top.png","xdecor_workbench_top.png",
|
||||
@ -328,25 +276,9 @@ xdecor.register("workbench", {
|
||||
allow_metadata_inventory_move = workbench.allow_move
|
||||
})
|
||||
|
||||
|
||||
minetest.register_on_mods_loaded(function()
|
||||
local cuttable_nodes = {}
|
||||
|
||||
-- Nodes allowed to be cut:
|
||||
-- Only the regular, solid blocks without metas or explosivity
|
||||
-- from the xdecor or default mods.
|
||||
for nodename, def in pairs(minetest.registered_nodes) do
|
||||
local nodenamesplit = string.split(nodename, ":")
|
||||
local modname = nodenamesplit[1]
|
||||
if (modname == "xdecor" or modname == "default") and xdecor.stairs_valid_def(def) then
|
||||
cuttable_nodes[#cuttable_nodes + 1] = nodename
|
||||
registered_cuttable_nodes[nodename] = true
|
||||
end
|
||||
end
|
||||
|
||||
for _, d in ipairs(workbench.defs) do
|
||||
for i = 1, #cuttable_nodes do
|
||||
local node = cuttable_nodes[i]
|
||||
for i = 1, #nodes do
|
||||
local node = nodes[i]
|
||||
local mod_name, item_name = node:match("^(.-):(.*)")
|
||||
local def = minetest.registered_nodes[node]
|
||||
|
||||
@ -437,7 +369,6 @@ for i = 1, #cuttable_nodes do
|
||||
tiles = tiles_special_cut,
|
||||
use_texture_alpha = def.use_texture_alpha,
|
||||
groups = groups,
|
||||
is_ground_content = def.is_ground_content,
|
||||
node_box = xdecor.pixelbox(16, d[3]),
|
||||
sunlight_propagates = true,
|
||||
on_place = minetest.rotate_node
|
||||
@ -455,13 +386,11 @@ for i = 1, #cuttable_nodes do
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
-- Craft items
|
||||
|
||||
minetest.register_tool("xdecor:hammer", {
|
||||
description = S("Hammer"),
|
||||
_tt_help = S("Repairs tools at the work bench"),
|
||||
inventory_image = "xdecor_hammer.png",
|
||||
wield_image = "xdecor_hammer.png",
|
||||
on_use = function() do
|
||||
@ -486,7 +415,3 @@ minetest.register_craft({
|
||||
{"group:wood", "group:wood"}
|
||||
}
|
||||
})
|
||||
|
||||
-- Special cuts for cushion block and cabinet
|
||||
workbench:register_special_cut("xdecor:cushion_block", { slab = "xdecor:cushion" })
|
||||
workbench:register_special_cut("xdecor:cabinet", { slab = "xdecor:cabinet_half" })
|
||||
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 472 B |
Before Width: | Height: | Size: 466 B |
Before Width: | Height: | Size: 340 B |
Before Width: | Height: | Size: 441 B |
Before Width: | Height: | Size: 200 B |
Before Width: | Height: | Size: 180 B |
Before Width: | Height: | Size: 210 B |
Before Width: | Height: | Size: 192 B |
Before Width: | Height: | Size: 195 B |
Before Width: | Height: | Size: 196 B |
Before Width: | Height: | Size: 161 B |
Before Width: | Height: | Size: 162 B |
Before Width: | Height: | Size: 213 B |
Before Width: | Height: | Size: 195 B |
Before Width: | Height: | Size: 167 B |
Before Width: | Height: | Size: 164 B |
Before Width: | Height: | Size: 380 B |