-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate upstream changes, fix stats involving blocks/items
- Loading branch information
Showing
62 changed files
with
532 additions
and
1,344 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
versions/1.0.0-client/src/main/java/net/lostluma/server_stats/Constants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package net.lostluma.server_stats; | ||
|
||
public class Constants { | ||
public static final String MOD_ID = "server_stats"; | ||
public static final String STATS_PACKET_CHANNEL = MOD_ID + "|s"; | ||
} |
30 changes: 30 additions & 0 deletions
30
...0-client/src/main/java/net/lostluma/server_stats/mixin/client/LocalPlayerEntityMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package net.lostluma.server_stats.mixin.client; | ||
|
||
import net.lostluma.server_stats.stats.Stats; | ||
import net.minecraft.client.entity.living.player.InputPlayerEntity; | ||
import net.minecraft.client.entity.living.player.LocalPlayerEntity; | ||
import net.minecraft.entity.living.player.PlayerEntity; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin({ InputPlayerEntity.class, LocalPlayerEntity.class }) | ||
public class LocalPlayerEntityMixin { | ||
private PlayerEntity getPlayer() { | ||
return (PlayerEntity) (Object) this; | ||
} | ||
|
||
@Inject(method = "incrementStat(Lnet/minecraft/stat/Stat;I)V", at = @At("HEAD")) | ||
private void incrementStat(net.minecraft.stat.Stat vanillaStat, int amount, CallbackInfo callbackInfo) { | ||
if (vanillaStat == null) { | ||
return; | ||
} | ||
|
||
var stat = Stats.byVanillaId(vanillaStat.id); | ||
|
||
if (stat != null) { | ||
this.getPlayer().server_stats$incrementStat(stat, amount); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ver_stats/mixin/server/EntitiesMixin.java → ...ver_stats/mixin/common/EntitiesMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
.../src/main/java/net/lostluma/server_stats/mixin/server/stats/FishingBobberEntityMixin.java
This file was deleted.
Oops, something went wrong.
52 changes: 0 additions & 52 deletions
52
...0.0-client/src/main/java/net/lostluma/server_stats/mixin/server/stats/ItemStackMixin.java
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
...0.0-client/src/main/java/net/lostluma/server_stats/mixin/server/stats/MinecraftMixin.java
This file was deleted.
Oops, something went wrong.
120 changes: 0 additions & 120 deletions
120
...-client/src/main/java/net/lostluma/server_stats/mixin/server/stats/PlayerEntityMixin.java
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
...0-client/src/main/java/net/lostluma/server_stats/mixin/server/stats/block/BlockMixin.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.