Update menyelesaikan #1
1. **Survival Mode** – Pemain otomatis masuk . 2. **Village Generation** – Rumah desa (cobblestone, papan kayu, jendela, pintu) & pohon oak dibuat prosedural di . 3. **Ore & Terrain** – Semua ore vanilla (Coal–Emerald) dengan varian deepslate muncul sesuai kedalaman; bukit/gunung dibentuk via noise trigonometri. 4. **Mob Spawner** – Spawner periodik (babi, sapi, domba, zombie, skeleton) di sekitar pemain, cap maksimal 25 mob aktif. 5. **Struktur Baru** – Rumah kayu & cobblestone, aman dari batas chunk. 6. **Vegetasi** – Rumput, pakis, dan bunga dandelion otomatis di permukaan. 7. **Spawn Point** – Pemain baru spawn acak namun dekat pemain aktif lain. 8. **Cave Generation** – 3D noise carver untuk terowongan goa. 9. **Item Cleanup** – Auto-bersih item drop tiap 15 menit, notifikasi peringatan 5 menit sebelumnya. 10. **Auto Optimization** – + dijalankan tiap sesi cleanup untuk jaga performa server.
This commit is contained in:
@@ -532,6 +532,61 @@ func (p *Player) handleCheatCommand(name string, args []string) bool {
|
||||
p.Message(fmt.Sprintf("- %s | %s | %s", entry.Name, timeStr, entry.Reason))
|
||||
}
|
||||
return true
|
||||
|
||||
case "gamemode", "gm":
|
||||
if len(args) < 1 {
|
||||
p.Message("Usage: /gamemode <survival/creative/adventure/spectator/0/1/2/3> [player]")
|
||||
return true
|
||||
}
|
||||
modeStr := strings.ToLower(args[0])
|
||||
var mode world.GameMode
|
||||
switch modeStr {
|
||||
case "survival", "s", "0":
|
||||
mode = world.GameModeSurvival
|
||||
case "creative", "c", "1":
|
||||
mode = world.GameModeCreative
|
||||
case "adventure", "a", "2":
|
||||
mode = world.GameModeAdventure
|
||||
case "spectator", "sp", "3":
|
||||
mode = world.GameModeSpectator
|
||||
default:
|
||||
p.Message("Unknown gamemode: " + args[0])
|
||||
return true
|
||||
}
|
||||
|
||||
target := p
|
||||
if len(args) >= 2 {
|
||||
targetName := args[1]
|
||||
found := false
|
||||
for other := range p.tx.Players() {
|
||||
if otherP, ok := other.(*Player); ok && strings.EqualFold(otherP.Name(), targetName) {
|
||||
target = otherP
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
p.Message("Player not found: " + targetName)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
target.SetGameMode(mode)
|
||||
modeName := "survival"
|
||||
if mode == world.GameModeCreative {
|
||||
modeName = "creative"
|
||||
} else if mode == world.GameModeAdventure {
|
||||
modeName = "adventure"
|
||||
} else if mode == world.GameModeSpectator {
|
||||
modeName = "spectator"
|
||||
}
|
||||
if target == p {
|
||||
p.Message("Your game mode has been set to " + modeName)
|
||||
} else {
|
||||
p.Message(fmt.Sprintf("Set %s's game mode to %s", target.Name(), modeName))
|
||||
target.Message("Your game mode has been set to " + modeName)
|
||||
}
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user