Skip to content

Commit bf5b6ee

Browse files
committed
Fixed addon for 1.20.40
1 parent f660ae0 commit bf5b6ee

File tree

3 files changed

+5
-18
lines changed

3 files changed

+5
-18
lines changed

VoiceCraft.Addon.BP/manifest.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"uuid": "87b49038-e613-4216-b265-6101b83376e2",
2525
"version": [
2626
1,
27-
0,
28-
0
27+
4,
28+
1
2929
]
3030
},
3131
"modules": [
@@ -53,7 +53,7 @@
5353
"dependencies": [
5454
{
5555
"module_name": "@minecraft/server",
56-
"version": "1.6.0-beta"
56+
"version": "1.7.0-beta"
5757
},
5858
{
5959
"module_name": "@minecraft/server-net",

VoiceCraft.Addon.BP/scripts/GUIHandler.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class GUIHandler {
133133
}
134134

135135
function isEmptyOrSpaces(str) {
136-
return str === null || str.match(/^ *$/) !== null;
136+
return !str || str.match(/^ *$/) !== null;
137137
}
138138

139139
export { GUIHandler };

VoiceCraft.Addon.BP/scripts/main.js

+1-14
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
ItemStack,
66
world,
77
system,
8-
DynamicPropertiesDefinition,
98
Vector
109
} from "@minecraft/server";
1110
import { GUIHandler } from "./GUIHandler";
@@ -148,6 +147,7 @@ world.beforeEvents.chatSend.subscribe(ev => {
148147
if(world.getDynamicProperty("textProximityChat"))
149148
{
150149
ev.setTargets(world.getAllPlayers().filter(x => x.dimension.id === ev.sender.dimension.id && Vector.distance(x.location, ev.sender.location) <= world.getDynamicProperty("textProximityDistance")));
150+
ev.sendToTargets = true;
151151
}
152152
});
153153

@@ -179,19 +179,6 @@ world.afterEvents.playerSpawn.subscribe(ev => {
179179
}
180180
});
181181

182-
world.afterEvents.worldInitialize.subscribe((ev) => {
183-
const dynamicProperties = new DynamicPropertiesDefinition();
184-
dynamicProperties.defineString("autoConnectIP", 15);
185-
dynamicProperties.defineNumber("autoConnectPort");
186-
dynamicProperties.defineString("autoConnectServerKey", 36);
187-
dynamicProperties.defineNumber("textProximityDistance");
188-
dynamicProperties.defineBoolean("sendBindedMessage");
189-
dynamicProperties.defineBoolean("textProximityChat");
190-
dynamicProperties.defineBoolean("serverSettingsHudDisplay");
191-
dynamicProperties.defineBoolean("displayServerAddressOnHud");
192-
ev.propertyRegistry.registerWorldDynamicProperties(dynamicProperties);
193-
});
194-
195182
function isEmptyOrSpaces(str) {
196183
return str === null || str.match(/^ *$/) !== null;
197184
}

0 commit comments

Comments
 (0)