Skip to content

Commit

Permalink
Merge branch 'master' into future
Browse files Browse the repository at this point in the history
  • Loading branch information
gnembon committed Mar 24, 2022
2 parents d9c227f + d1f3886 commit 7c353d4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/main/java/carpet/fakes/MinecraftServerInterface.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import java.util.Map;
import java.util.function.BooleanSupplier;

import net.minecraft.core.RegistryAccess;
import net.minecraft.resources.ResourceKey;
//import net.minecraft.server.ServerResources;
import net.minecraft.server.level.ServerLevel;
Expand All @@ -13,5 +15,5 @@ public interface MinecraftServerInterface
void forceTick(BooleanSupplier sup);
LevelStorageSource.LevelStorageAccess getCMSession();
Map<ResourceKey<Level>, ServerLevel> getCMWorlds();
void reloadAfterReload();
void reloadAfterReload(RegistryAccess newRegs);
}
4 changes: 2 additions & 2 deletions src/main/java/carpet/mixins/MinecraftServer_scarpetMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ public void tickTasks(BooleanSupplier booleanSupplier_1, CallbackInfo ci)
}

@Override
public void reloadAfterReload()
public void reloadAfterReload(RegistryAccess newRegs)
{
resources.managers().updateRegistryTags(registryAccess());
resources.managers().updateRegistryTags(newRegs);
getPlayerList().saveAll();
getPlayerList().reloadResources();
functionManager.replaceLibrary(this.resources.managers().getFunctionLibrary());
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/carpet/script/api/Auxiliary.java
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@ else if (fdesc.type == FileArgument.Type.JSON)
addeds.add(ValueConversions.of(registryKey.location()));
}
}
((MinecraftServerInterface)server).reloadAfterReload();
((MinecraftServerInterface)server).reloadAfterReload(data.registryAccess());
return ListValue.wrap(addeds);
});
}
Expand Down

0 comments on commit 7c353d4

Please sign in to comment.