Skip to content

Commit

Permalink
Merge pull request #543 from Yoghurt4C/webpadorupadorupadoru-1
Browse files Browse the repository at this point in the history
fix misfiring injection
  • Loading branch information
Roadhog360 authored Oct 31, 2024
2 parents eafd973 + 3f79263 commit 4ac423e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void hhheheheheeh(CallbackInfo ctx) {

@Redirect(method = "areAllPlayersAsleep", at = @At(value = "FIELD", target = "Lnet/minecraft/world/WorldServer;playerEntities:Ljava/util/List;", opcode = Opcodes.GETFIELD))
public List<EntityPlayer> baited(WorldServer instance) {
return INSTANCE.sleepyPlayers;
return INSTANCE.sleepyPlayers.isEmpty() ? this.playerEntities : INSTANCE.sleepyPlayers;
}

@Inject(method = "areAllPlayersAsleep", at = @At(value = "INVOKE", target = "Ljava/util/List;iterator()Ljava/util/Iterator;"), cancellable = true)
Expand All @@ -76,7 +76,7 @@ public void turbofast(CallbackInfoReturnable<Boolean> ctx) {

@Inject(method = "wakeAllPlayers", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/EntityPlayer;wakeUpPlayer(ZZZ)V"), locals = LocalCapture.CAPTURE_FAILHARD)
public void broadcast(CallbackInfo ctx, Iterator iterator, EntityPlayer player) {
if (INSTANCE.percentrillo > 0 && INSTANCE.percentrillo < 101) {
if (INSTANCE.percentrillo > 0 && INSTANCE.percentrillo < 100) {
player.addChatMessage(new ChatComponentTranslation("sleep.skipping_night"));
}
}
Expand Down

0 comments on commit 4ac423e

Please sign in to comment.