Skip to content

Commit

Permalink
enable generic injections and fix resulting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyfts committed Jan 22, 2024
1 parent 6b454f6 commit 74a8aca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ developmentEnvironmentUserName = Developer
# See https://github.com/bsideup/jabel for details on how this works.
enableModernJavaSyntax = true

# Enables injecting missing generics into the decompiled source code for a better coding experience
# Turns most publicly visible List, Map, etc. into proper List<Type>, Map<K, V> types
enableGenericInjection = true

# Generate a class with a String field for the mod version named as defined below.
# If generateGradleTokenClass is empty or not missing, no such class will be generated.
# If gradleTokenVersion is empty or missing, the field will not be present in the class.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/serverutils/command/CmdLeaderboard.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public CmdLeaderboard() {
@Override
public List<String> addTabCompletionOptions(ICommandSender sender, String[] args) {
if (args.length == 1) {
return getListOfStringsFromIterableMatchingLastWord(args, ServerUtilitiesCommon.LEADERBOARDS.keySet());
return matchFromIterable(args, ServerUtilitiesCommon.LEADERBOARDS.keySet());
}

return super.addTabCompletionOptions(sender, args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.util.Map;
import java.util.regex.Pattern;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.stats.StatList;
import net.minecraft.util.ChatComponentText;
Expand Down Expand Up @@ -260,9 +261,11 @@ public void onWorldTick(TickEvent.WorldTickEvent event) {
}

if (ServerUtilitiesConfig.world.show_playtime && event.world.getTotalWorldTime() % 20L == 7L) {
for (EntityPlayerMP player : (List<EntityPlayerMP>) event.world.playerEntities) {
new MessageUpdatePlayTime(player.func_147099_x().writeStat(StatList.minutesPlayedStat))
.sendTo(player);
for (EntityPlayer player : event.world.playerEntities) {
if (player instanceof EntityPlayerMP playerMP) {
new MessageUpdatePlayTime(playerMP.func_147099_x().writeStat(StatList.minutesPlayedStat))
.sendTo(playerMP);
}
}
}
}
Expand Down

0 comments on commit 74a8aca

Please sign in to comment.