Coder Social home page Coder Social logo

Comments (5)

SiverDX avatar SiverDX commented on August 14, 2024

Logic:

@Override
public boolean canCast(Level world, BlockPos pos, Player player) {
if (!world.getCapability(IReputation.INSTANCE).isPresent()) return false;
if (!world.getCapability(IReputation.INSTANCE).resolve().get().canPray(player, getRegistryName(), world.getGameTime())) {
player.displayClientMessage(Component.translatable("eidolon.message.prayer_cooldown"), true);
return false;
}

@Override
public void pray(UUID player, ResourceLocation spell, long time) {
getPrayerTimes().computeIfAbsent(player, (p) -> new HashMap<>()).put(spell, time);
}
@Override
public boolean canPray(UUID player, ResourceLocation spell, long time) {
Map<ResourceLocation, Long> times = getPrayerTimes().computeIfAbsent(player, (p) -> new HashMap<>());
return !times.containsKey(spell) || times.get(spell) < time - 21000;
}

The /time command seems to set/use the dayTime not gameTime

There isn't much which progresses gameTime (not even sleeping I think)

https://github.com/search?q=repo%3ANikitaCartes-archive%2FMinecraftDeobfuscated-Mojang+setGameTime&type=code

from eidolon-repraised.

oitsjustjose avatar oitsjustjose commented on August 14, 2024

Ah - I did take a look at your repo references last night and it all checked out, but I didn't realize setGameTime was practically never called by anything. I wonder what the /time command is even doing then 🤔

Anyways, thanks! I'll give the game some time to just tick and see if I can continue as planned!

from eidolon-repraised.

SiverDX avatar SiverDX commented on August 14, 2024

Yeah sleeping also sets the daytime

https://github.com/NikitaCartes-archive/MinecraftDeobfuscated-Mojang/blob/e6032598b55f5df3c49c5dc08eaf75b7ddb20336/minecraft/src/net/minecraft/server/level/ServerLevel.java#L324-L334

from eidolon-repraised.

Alexthw46 avatar Alexthw46 commented on August 14, 2024

If you need to test, you can pray in creative to not trigger the cooldown. If the cooldown was only tied to the skippable day/night cycle, you could just abuse the rituals to speed run so the original author opted for this around 18 min timer. Prayers of different type have separate timers

from eidolon-repraised.

oitsjustjose avatar oitsjustjose commented on August 14, 2024

Yeah sleeping also sets the daytime

Super odd, I didn't really think of that.

If you need to test, you can pray in creative to not trigger the cooldown. If the cooldown was only tied to the skippable day/night cycle, you could just abuse the rituals to speed run so the original author opted for this around 18 min timer. Prayers of different type have separate timers

Good to know!

I was just chilling out in my test world for a bit debugging another issue, and tried again in survival and it worked just fine!

from eidolon-repraised.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.