|
5 | 5 | ItemStack,
|
6 | 6 | world,
|
7 | 7 | system,
|
8 |
| - DynamicPropertiesDefinition, |
9 | 8 | Vector
|
10 | 9 | } from "@minecraft/server";
|
11 | 10 | import { GUIHandler } from "./GUIHandler";
|
@@ -148,6 +147,7 @@ world.beforeEvents.chatSend.subscribe(ev => {
|
148 | 147 | if(world.getDynamicProperty("textProximityChat"))
|
149 | 148 | {
|
150 | 149 | 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; |
151 | 151 | }
|
152 | 152 | });
|
153 | 153 |
|
@@ -179,19 +179,6 @@ world.afterEvents.playerSpawn.subscribe(ev => {
|
179 | 179 | }
|
180 | 180 | });
|
181 | 181 |
|
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 |
| - |
195 | 182 | function isEmptyOrSpaces(str) {
|
196 | 183 | return str === null || str.match(/^ *$/) !== null;
|
197 | 184 | }
|
0 commit comments