generated from MisileLab/Base-repository
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: MisileLab <[email protected]>
- Loading branch information
Showing
9 changed files
with
156 additions
and
111 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
projects/bdsxs/patches/overcooker/0002-a-furnace-recipe-overcooker.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
From d3b7efd81d099cabb5626532852bef835b19a116 Mon Sep 17 00:00:00 2001 | ||
From: MisileLab <[email protected]> | ||
Date: Sun, 5 Nov 2023 23:25:54 +0900 | ||
Subject: [PATCH] a furnace recipe - overcooker | ||
|
||
--- | ||
scripts/overcooker/main.ts | 15 ++++++++++++++- | ||
1 file changed, 14 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/scripts/overcooker/main.ts b/scripts/overcooker/main.ts | ||
index 6dcd1a0d..287f33ec 100644 | ||
--- a/scripts/overcooker/main.ts | ||
+++ b/scripts/overcooker/main.ts | ||
@@ -2,6 +2,13 @@ import { GameType } from "bdsx/bds/player"; | ||
import { MobEffectIds, MobEffectInstance } from "../../bdsx/bds/effects"; | ||
import { CANCEL } from "../../bdsx/common"; | ||
import { events } from "../../bdsx/event"; | ||
+import { ItemStack } from "bdsx/bds/inventory"; | ||
+ | ||
+const Recipes = { | ||
+ "furnace": { | ||
+ "minecraft:chicken": "minecraft:cooked_chicken" | ||
+ } | ||
+} | ||
|
||
events.playerJoin.on((e)=>{ | ||
// this is debug | ||
@@ -14,7 +21,13 @@ events.blockInteractedWith.on((e)=>{ | ||
} | ||
const block = e.player.getRegion().getBlock(e.blockPos); | ||
if (block.blockLegacy.getCommandName() == "minecraft:furnace") { | ||
- | ||
+ let item = e.player.getInventory().getContainer().getSlots().get(0); | ||
+ let name = item.getName(); | ||
+ if (item == null || Recipes.furnace[name] == undefined) { | ||
+ return CANCEL; | ||
+ } | ||
+ e.player.getInventory().getContainer().getItem(0).load(ItemStack.constructWith(Recipes.furnace[name], 1).save()) | ||
+ e.player.sendInventory() | ||
} else { | ||
return CANCEL; | ||
} | ||
-- | ||
2.42.0.windows.2 | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.