-
So I've been trying to figure out what the correct way of lighting up an anvil instance is, and I can't really figure it out. InstanceManager instanceManager = MinecraftServer.getInstanceManager();
SwagCraftMap mapManager = new SwagCraftMap();
Instance lobby = mapManager.getMapInstance();
// Relight
LightingChunk.relight(lobby, lobby.getChunks());
// Create fullbright dimension
DimensionType fullbright = DimensionType.builder(NamespaceID.from("minestom:full_bright"))
.ambientLight(2.0f)
.build();
MinecraftServer.getDimensionTypeManager().addDimension(fullbright);
// Create the instance
InstanceContainer instanceContainer = instanceManager.createInstanceContainer(fullbright);
GlobalEventHandler globalEventHandler = MinecraftServer.getGlobalEventHandler();
globalEventHandler.addListener(AsyncPlayerConfigurationEvent.class, event -> {
final Player player = event.getPlayer();
event.setSpawningInstance(lobby);
}); Calling |
Beta Was this translation helpful? Give feedback.
Answered by
para-dise
Feb 17, 2024
Replies: 1 comment
-
Turns out the solution was DimensionType fullbright = DimensionType.builder(NamespaceID.from("swagcraft:void"))
.ambientLight(2.0f)
.build();
MinecraftServer.getDimensionTypeManager().addDimension(fullbright);
return MinecraftServer.getInstanceManager().createInstanceContainer(
fullbright,
new AnvilLoader(
"maps/" + game.getName()
)
); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
para-dise
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Turns out the solution was