enable creator experiments in the world if custom blocks exist
This commit is contained in:
parent
2d3650f001
commit
a4a293ef52
|
@ -450,6 +450,15 @@ func (w *WorldState) SaveAndReset() {
|
|||
ld.Generator = 2
|
||||
}
|
||||
|
||||
if w.bp != nil {
|
||||
if ld.Experiments == nil {
|
||||
ld.Experiments = map[string]any{}
|
||||
}
|
||||
ld.Experiments["data_driven_items"] = 1
|
||||
ld.Experiments["experiments_ever_used"] = 1
|
||||
ld.Experiments["saved_with_toggled_experiments"] = 1
|
||||
}
|
||||
|
||||
provider.SaveSettings(s)
|
||||
provider.Close()
|
||||
w.worldCounter += 1
|
||||
|
@ -503,13 +512,6 @@ func (w *WorldState) SaveAndReset() {
|
|||
PackId: w.bp.Manifest.Header.UUID,
|
||||
Version: w.bp.Manifest.Header.Version,
|
||||
}})
|
||||
|
||||
if ld.Experiments == nil {
|
||||
ld.Experiments = map[string]any{}
|
||||
}
|
||||
ld.Experiments["data_driven_items"] = true
|
||||
ld.Experiments["experiments_ever_used"] = true
|
||||
ld.Experiments["saved_with_toggled_experiments"] = true
|
||||
}
|
||||
|
||||
if w.saveImage {
|
||||
|
|
|
@ -63,7 +63,7 @@ func dmp_struct(level int, in any, w_type bool) (s string) {
|
|||
s += "\t"
|
||||
}
|
||||
|
||||
struct_entry := func(ii reflect.Value) {
|
||||
if ii.Kind() == reflect.Struct {
|
||||
s += "{\n"
|
||||
for i := 0; i < ii.NumField(); i++ {
|
||||
field := ii.Type().Field(i)
|
||||
|
@ -75,10 +75,6 @@ func dmp_struct(level int, in any, w_type bool) (s string) {
|
|||
}
|
||||
}
|
||||
s += t_base + "}\n"
|
||||
}
|
||||
|
||||
if ii.Kind() == reflect.Struct {
|
||||
struct_entry(ii)
|
||||
} else if ii.Kind() == reflect.Slice {
|
||||
var t reflect.Type
|
||||
if ii.Len() > 0 {
|
||||
|
|
|
@ -190,6 +190,11 @@ func (p *ProxyContext) Run(ctx context.Context, server_address string) (err erro
|
|||
logrus.Infof(locale.Loc("listening_on", locale.Strmap{"Address": p.Listener.Addr()}))
|
||||
logrus.Infof(locale.Loc("help_connect", nil))
|
||||
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
p.Listener.Close()
|
||||
}()
|
||||
|
||||
var c net.Conn
|
||||
c, err = p.Listener.Accept()
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue