Comments (5)
You're setting the time in all dimensions, which you shouldn't be.
And our code most definitly sets to the same time as vanilla does:
long j = this.levelData.getDayTime() + 24000L;
this.setDayTime(j - j % 24000L);
long j = this.getDayTime() + 24000L;
this.setDayTime(net.minecraftforge.event.ForgeEventFactory.onSleepFinished(this, j - j % 24000L, this.getDayTime()));
So you're gunna need to provide more context to what you're doing.
from minecraftforge.
Ok, so more context :
My mod is plagued by this bug : https://bugs.mojang.com/browse/MC-188578
so when trying to solved it I found out that the command /time set .... was using something different than the bed ( what I used in fact), so I used the SleepFinishedTimeEvent to set the time on every level and it works.
So I think there is an issue with level.setDayTime as it seems to only work in the Overworld
from minecraftforge.
the setDayTime does nothing in the DerivedLevelData maybe that the issue ?
from minecraftforge.
I just found out that doing this
sleepFinishedEvent.getLevel().getServer().getLevel(Level.OVERWORLD).setDayTime(sleepFinishedEvent.getNewTime());
instead of that
for (ServerLevel serverlevel : sleepFinishedEvent.getLevel().getServer().getAllLevels()) {
serverlevel.setDayTime(sleepFinishedEvent.getNewTime());
}
also works
from minecraftforge.
You're correct, I was mistaken thought Mojang had properly desynced world times. Guess they haven't anyways, no if you're sleeping in other dimensions and want the world time to pass in the overworld looks like you have to explicitly set it.
from minecraftforge.
Related Issues (20)
- Forge 47.2.0 is incompatible with GraalVM HOT 3
- world/serverconfig configs keep resetting to default every time after restart, how can I disable this? HOT 1
- Minecraft
- [1.20.6] Can't open villager GUI
- [1.20.6] `EventNetworkChannel` not working HOT 1
- [SECURITY] Vulnerabilities in Forge 47.2.X HOT 1
- [1.20.6] ATs still use SRG mappings HOT 1
- Vault Block crash in 1.20.6 HOT 2
- [1.20.6] getArmorTexture bug HOT 1
- [1.20.6] DeferredRegister for ArmorMaterial is broken HOT 2
- update mcp for 1.20.6 HOT 1
- finalizeSpawn() is always passed null SpawnGroupData
- forge 1.20.6 patches the stencil enable into the wrong spot
- [1.20.6] Shield does not work HOT 3
- Forge Crashes HOT 1
- Crash when mods folder contains jar file without mods.toml HOT 6
- The game crashed whilst unexpected error Error: java.lang.IllegalStateException: Missing registry: ResourceKey[minecraft:root / minecraft:dimension_type] HOT 1
- [1.20.6] Potion Brewing is broken
- [1.20.6] Cancelling MobSpawnEvent.FinalizeSpawn for a spawner causes NullPointerException
- 1.20.1 Forge Redstone differs from Vanilla and Fabric HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minecraftforge.