Skip to content

Commit

Permalink
V4: Bug Fixes & Improvements
Browse files Browse the repository at this point in the history
Fixed: Custom blocks can't be opened in caves.
Improved: Dropped-type custom blocks can be created when there are no other items dropped within a 1-block range, instead of 5.
Simplified: Removed the credit link display.
  • Loading branch information
paul90317 committed Sep 22, 2023
1 parent 542cb21 commit 1855a3e
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 10 deletions.
Empty file added easy_gui/__init__.py
Empty file.
4 changes: 1 addition & 3 deletions easy_gui/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import json
from zipfile import ZipFile
from os import path
from . import Tag,Display
import Tag,Display


def template(code: str, pattern: dict[str, int | str]) -> str:
Expand Down Expand Up @@ -182,7 +182,6 @@ def codeGen(tile_id: str, slot: str | int, object: dict) -> tuple[str, str]:
load_func = data.get('load', '')
destroy_func = data.get('destroy', '')
tick_func = data.get('tick', '')
website = data.get('website','')
for slots, object in data['slot'].items():
slots = str(slots).split(',')
for slot in slots:
Expand Down Expand Up @@ -215,7 +214,6 @@ def codeGen(tile_id: str, slot: str | int, object: dict) -> tuple[str, str]:
"id": tile_id,
'text': container_item.Name,
'itemtype': 'dropped_item' if itemtype=='drop' else 'spawn_egg',
'website': website
}),
f'data/eg/functions/tile/{tile_id}/made_by.mcfunction')

Expand Down
2 changes: 1 addition & 1 deletion easy_gui/template/game/load.mcfunction
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
scoreboard objectives add eg.n dummy
scoreboard objectives add eg.temp dummy
tellraw @a ["The following blocks is made by ",{"text": "Easy GUI V3","color": "light_purple","clickEvent": {"action": "open_url","value": "https://github.com/paul90317/Minecraft-Easy-GUI"},"bold": true,"hoverEvent": {"action": "show_text","value": "GitHub"}}]
tellraw @a ["The following blocks is made by ",{"text": "Easy GUI","color": "light_purple","clickEvent": {"action": "open_url","value": "https://github.com/paul90317/Minecraft-Easy-GUI"},"bold": true,"hoverEvent": {"action": "show_text","value": "GitHub"}}]
function #eg:made_by
2 changes: 1 addition & 1 deletion easy_gui/template/game/made_by.mcfunction
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tellraw @a [" - ",<text>,{"text": " (<id>) ","color": "white"},{"text": "website","color": "blue","clickEvent": {"action": "open_url","value": "<website>"},"hoverEvent": {"action": "show_text","value": "click"}}," ",{"text": "give","color": "yellow","hoverEvent": {"action": "show_text","value": "click"},"clickEvent": {"action": "run_command","value": "/function eg:tile/<id>/<itemtype>"}}]
tellraw @a [" - ",<text>,{"text": " (<id>) ","color": "white"}," ",{"text": "give","color": "yellow","hoverEvent": {"action": "show_text","value": "click"},"clickEvent": {"action": "run_command","value": "/function eg:tile/<id>/<itemtype>"}}]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
scoreboard players set @s eg.temp 0
execute unless block ~ ~ ~ air run scoreboard players set @s eg.temp 1
execute unless block ~ ~ ~ #eg:air run scoreboard players set @s eg.temp 1
scoreboard players set @s eg.n 0
execute at @e[type=item, distance=..5] run scoreboard players add @s eg.n 1
execute at @e[type=item, distance=..1] run scoreboard players add @s eg.n 1
scoreboard players set @s[scores={eg.n=2..}] eg.temp 1
execute if score @s eg.temp matches 1 run tag @s add egno
execute if score @s eg.temp matches 0 run function eg:tile/<id>/try_spawn/load
3 changes: 0 additions & 3 deletions tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ item:
HideFlags: 127
AttributeModifiers: []
CustomModelData: 54621503

website: https://modrinth.com/datapack/upgradable-backpack
```
* `id` is for tikc mcfunction to recongnize what GUI block it is.
* `type` is `drop` or `spawn_egg`. `drop` means that it summon GUI item when you drop the block on the ground; `spawn_egg` means the item is a spawn_egg.
* `item` is the item of the GUI block, it's in Minecraft item NBT format. The item also show at the buttom of the GUI block when it turn into the GUI block. You can make texture of it by adding `CustomModelData` tag.
* `website` is a link, it shows when the game loads. It very useful for users to credit on you.
## Events
```yaml
load: 'say load'
Expand Down

0 comments on commit 1855a3e

Please sign in to comment.