金钱与告示牌商店
这是一个客户端可选的模组,添加了非物品形式的货币以及玩家/服务器告示牌商店。
金钱
玩家可以通过以下方式查看自己的余额:
/money
并可以在玩家之间转账资金。
告示牌商店
共有 4 种类型:
[buy](购买)从玩家处扣除金钱,并从库存中给予他们物品。
[sell](出售)从玩家的物品栏中收取物品,并将金钱从店主转移到玩家。
[server-buy](服务器购买)从玩家处扣除金钱并给予他们物品(无限库存)。
[server-sell](服务器出售)从玩家处收取物品并给予他们金钱(无限库存)。
商店存储方块
任何具有容器槽位和 ItemHandler 能力的方块都可以用作商店。这包括所有原版容器,如箱子、桶、漏斗、熔炉等,也包括模组添加的存储方块,甚至包括机器。(关于机器的说明:商店将其顶面作为插入和提取面。)
激活商店
告示牌的第一行必须是上述四种类型之一(只有管理员可以激活服务器商店)。
第二行和第三行可以是任意内容,建议写上描述。
最后一行是价格(允许使用小数,但不要使用千位分隔符或货币符号)。
接下来,将商店应该寻找的物品放入容器中。当商店激活时,容器中的所有物品都会被使用。这允许你将多个物品组合在一起进行交易以换取金钱,例如工具包。
设置好告示牌并放置好物品后,右键点击告示牌即可激活它。如果成功,类型和价格的颜色会发生变化。
查看商店信息
左键点击任何商店即可查看在售商品。(注意:如果你处于创造模式,这将破坏告示牌。)
聊天中的商店信息会为在售物品提供工具提示,这样工具和武器等物品可以显示其附魔效果。
售卖你尚未拥有的物品
你是否曾经想要某种稀有物品,一旦拥有就再也不需要了?是否觉得无法在不先拥有该物品的情况下请求它很荒谬?这个模组提供了解决方案。通过使用书与笔,你可以用 JSON 格式写下你想要的精确物品,商店在激活时将读取这本书。关键组成部分是第一页应以 "vending" 开头,然后在下一行开始你的 JSON。见下文示例。
商店保护
一旦商店被激活,容器将受到保护,防止非所有者或管理员打开和破坏。此外,不能在存储方块的相邻位置放置其他方块。这是为了防止其他玩家放置漏斗或管道来从你的商店中提取物品。请注意,由于保护仅在商店激活后才生效,你可以在激活商店之前设置自己的机器连接到存储方块。这是一种制作自维持商店的方法。
API
本模组提供了一个 API 包,供其他模组进行挂钩。如果你有关于在自己的模组中实现此功能的疑问,请通过 Discord 或 GitHub(链接如下)联系我。
原版客户端
如果你想纯服务端方式使用此模组,你需要将此模组的语言文件添加到客户端的资源包中。否则,大多数聊天消息对你的用户来说将不够 informative(信息丰富)。你可以在此处获取语言文件 HERE。
Money and Sign Shops
Is a a client-optional mod that adds non-item money and player/server sign shops.
Money
Players can see how much money they have with:
/money
as well as transfer funds between players
Sign Shops
come in 4 types:
[buy] which takes money from the player and gives them items from the storage stock
[sell] which takes items from the player inventory and transfers money from the shop owner to the player
[server-buy] which takes money from the player and gives them items (infinite stock)
[server-sell] which takes items from the player and gives them money (infinite stock)
Shop Storage Blocks
Any block with an inventory and an itemhandler capability can be used as a shop. this includes all vanilla containers such as chests, barrels, hoppers, furnaces, etc., but also includes modded storage including machines. (A note on Machines: the shop uses the top face as it's insert and extract face)
Activating a Shop
The first line of the shop must be one of the 4 types above (only admins can activate server shops).
The second and third lines can be anything you want. A description is a good idea.
The last line is the price (decimals are acceptable, no thousand operators or currency symbols though)
Next, put the items the shop should look for in the container. All items in the container are used when the shop is activated. This allows you to trade multiple items together for money, such as tool kits
once your sign is set and your items in place, right click the sign to activate it. If successful, the type and price will change color.
Viewing shop info
left click any shop to see what is for sale (Note: if you are in creative mode this will break the sign)
shop info in the chat will give tooltips for the items for sale so items like tools and weapons can show their enchantments
Vending Items You Don't Have
Do you ever want something rare that if you had, you would never need again? Does it seem silly that you can't request that item without having it first? well this mod has a solution. By using a Book and Quill, you can write in the exact item you want in JSON format and the shop will read the book when activating your shop. Key components are the first page should start with "vending" then start your JSON on a new line. see below
Shop Protections
once a shop is activated, the container is protected from opening and destruction by anyone who is not the owner or an admin. Additionally, blocks cannot be placed adjacent to the storage block. This is to prevent other players from placing hoppers or pipes to extract items from your shop. Note that, since the protections only kick in after the shop is activated, you can set up your own machines to connect to the storage block so long as you do so before the shop is activated. This is one way to make self-sustaining shops.
API
This mod has an API Package for hooks by other mods. If you have questions about implementing this with your own mod, please contact me via discord or github(links below).
Vanilla Clients
If you want to use this purely server-side you will want to add this mod's lang file to a resource pack for your clients. Otherwise most chat messages will not be as informative to your users. you can get the lang file HERE.
评论 0
登录后参与评分
还没有评论,来抢沙发吧