Skip to content

Commit

Permalink
Updated addon for 1.20.50
Browse files Browse the repository at this point in the history
  • Loading branch information
SIsilicon committed Nov 14, 2023
1 parent 3d5b31c commit a03bb5d
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 48 deletions.
9 changes: 2 additions & 7 deletions RP/ui/how_to_play_screen.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"namespace": "how_to_play",
"selector_stack_panel/how_to_play_selector_pane": {
"how_to_play_selector_stack_panel/how_to_play_selector_pane": {
"modifications": [
{
"array_name": "controls",
Expand All @@ -26,17 +26,12 @@
"wedit:license_button@how_to_play.wedit:license_button": {
"$toggle_group_forced_index": 72
}
},
{
"minecraft_category@how_to_play_common.topic_category": {
"$category": "minecraft"
}
}
]
}
]
},
"section_content_panels/general_tips_sections": {
"how_to_play_section_content_panels/general_tips_sections": {
"modifications": [
{
"array_name": "controls",
Expand Down
6 changes: 3 additions & 3 deletions mc_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

"bp_uuid": "3cdb2ddf-662e-4f8f-a0a1-1293b91ccb2f",
"rp_uuid": "e304a4eb-f0a0-4979-ac17-7b0f46a555c8",
"version": [0, 8, 3],
"min_engine_version": [ 1, 20, 40 ]
"version": [0, 8, 4],
"min_engine_version": [ 1, 20, 50 ]
},
"bp_modules": [
{
Expand Down Expand Up @@ -38,7 +38,7 @@
"bp_dependencies": [
{
"module_name": "@minecraft/server",
"version": "1.7.0-beta"
"version": "1.8.0-beta"
},
{
"module_name": "@minecraft/server-ui",
Expand Down
64 changes: 38 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"typescript": "^4.7.4"
},
"dependencies": {
"@minecraft/server": "^1.7.0-beta.1.20.40-preview.24",
"@minecraft/server": "^1.8.0-beta.1.20.50-preview.23",
"@minecraft/server-admin": "^1.0.0-beta.1.19.80-stable",
"@minecraft/server-ui": "^1.2.0-beta.1.20.40-preview.24"
"@minecraft/server-ui": "^1.2.0-beta.1.20.50-preview.23"
}
}
14 changes: 6 additions & 8 deletions src/server/modules/biome_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ class BiomeDetector extends EventEmitter implements PooledResource {
reject(err);
}

events.set(this.entity, (ev: DataDrivenEntityTriggerBeforeEvent) => {
if (ev.id != "wedit:biome_update") return;
const onEvent = (ev: DataDrivenEntityTriggerAfterEvent) => {
try {
const biomeId = biomeScores.getScore(this.entity.scoreboardIdentity);
this.entity.triggerEvent("wedit:despawn");
Expand All @@ -172,8 +171,12 @@ class BiomeDetector extends EventEmitter implements PooledResource {
this.emit(errorEventSym);
reject(err);
} finally {
events.delete(this.entity);
world.afterEvents.dataDrivenEntityTriggerEvent.unsubscribe(onEvent);
}
};
world.afterEvents.dataDrivenEntityTriggerEvent.subscribe(onEvent, {
entities: [this.entity],
eventTypes: ["wedit:biome_update"]
});
});
}
Expand Down Expand Up @@ -223,11 +226,6 @@ async function getBiomeId(dim: Dimension, loc: Vector3) {
return await detector.detect(dim, loc);
}

const events = new Map<Entity, (ev: DataDrivenEntityTriggerAfterEvent) => void>();
world.afterEvents.dataDrivenEntityTriggerEvent.subscribe(ev => {
events.get(ev.entity)?.(ev);
});

const nameToId = {
ocean: 0,
plains: 1,
Expand Down
4 changes: 2 additions & 2 deletions src/server/util.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Block, Vector3, Dimension, Entity, Player, world } from "@minecraft/server";
import { Block, Vector3, Dimension, Entity, Player, world, BlockComponentTypeMap } from "@minecraft/server";
import { Server, RawText, addTickingArea as addTickArea, removeTickingArea as removeTickArea, Vector } from "@notbeer-api";
import config from "config.js";

Expand Down Expand Up @@ -94,7 +94,7 @@ export function canPlaceBlock(loc: Vector3, dim: Dimension) {
}

export function blockHasNBTData(block: Block) {
const components = [
const components: (keyof BlockComponentTypeMap)[] = [
"minecraft:inventory",
"minecraft:sign",
"minecraft:piston",
Expand Down

0 comments on commit a03bb5d

Please sign in to comment.