Skip to content

Commit a391461

Browse files
committed
small dupe fix
1 parent 386e174 commit a391461

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

src/lib/assets/player-json.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export const playerJson = {
8181
"duration": 3,
8282
"amplifier": 255,
8383
"visible": false,
84-
"display_on_screen_animation": true
84+
"display_on_screen_animation": false
8585
},
8686
{
8787
"effect": "fire_resistance",
@@ -108,7 +108,7 @@ export const playerJson = {
108108
"duration": 1,
109109
"amplifier": 255,
110110
"visible": false,
111-
"display_on_screen_animation": true
111+
"display_on_screen_animation": false
112112
},
113113
{
114114
"effect": "fire_resistance",
@@ -128,7 +128,7 @@ export const playerJson = {
128128
"duration": 1,
129129
"amplifier": 1,
130130
"visible": false,
131-
"display_on_screen_animation": true
131+
"display_on_screen_animation": false
132132
}
133133
]
134134
}

src/modules/anticheat/dupe.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { system, world } from '@minecraft/server'
2+
import { MinecraftBlockTypes } from '@minecraft/vanilla-data'
3+
import { Vec } from 'lib'
4+
5+
world.afterEvents.pistonActivate.subscribe(event => {
6+
const blocks = event.piston.getAttachedBlocksLocations()
7+
8+
system.runTimeout(
9+
() => {
10+
if (!event.block.isValid) return
11+
for (const blockl of blocks) {
12+
const block = event.block.dimension.getBlock(blockl)
13+
if (block?.typeId === MinecraftBlockTypes.Hopper) {
14+
const nearbyPlayers = event.block.dimension.getPlayers({ location: event.block.location, maxDistance: 20 })
15+
console.warn(
16+
`PISTON DUPE DETECTED!!! ${Vec.string(event.block.location)}\n${nearbyPlayers.map(e => e.name).join('\n')}`,
17+
)
18+
event.block.dimension.createExplosion(event.block.location, 1, { breaksBlocks: true })
19+
return
20+
}
21+
}
22+
},
23+
'piston dupe prevent',
24+
2,
25+
)
26+
})

src/modules/anticheat/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
import './dupe'
12
import './forbidden-items'
23
import './whitelist'

0 commit comments

Comments
 (0)