Skip to content

Commit

Permalink
stop sending break_bedrock stat to prevent disconneting player
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Apr 15, 2020
1 parent c9c61ea commit 78cb367
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
6 changes: 3 additions & 3 deletions patches/net/minecraft/block/BlockPistonBase.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
}
}

+ // TISCM break_bedrock stats
+ // TISCM break_bedrock stat
+ private void tryAddNearestPlayerStats(World worldIn, BlockPos pos)
+ {
+ if (worldIn.getBlockState(pos).getBlock() == Blocks.BEDROCK)
Expand All @@ -54,7 +54,7 @@
{
if (id != 1 || iblockstate.isAir() || !canPush(iblockstate, worldIn, blockpos, enumfacing.getOpposite(), false, enumfacing) || iblockstate.getPushReaction() != EnumPushReaction.NORMAL && block != Blocks.PISTON && block != Blocks.STICKY_PISTON)
{
+ // TISCM break_bedrock stats
+ // TISCM break_bedrock stat
+ tryAddNearestPlayerStats(worldIn, pos.offset(enumfacing));
+
worldIn.removeBlock(pos.offset(enumfacing));
Expand All @@ -64,7 +64,7 @@
}
else
{
+ // TISCM break_bedrock stats
+ // TISCM break_bedrock stat
+ tryAddNearestPlayerStats(worldIn, pos.offset(enumfacing));
+
worldIn.removeBlock(pos.offset(enumfacing));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
}
}

+ // TISCM break_bedrock stats
+ // TISCM break_bedrock stat
+ public void addStatsToNearestPlayersInDimensionNear(DimensionType dimension, BlockPos pos, double radius, ResourceLocation stat, int amount)
+ {
+ Comparator<Pair<Double, EntityPlayerMP>> comparator = (a, b) ->
Expand Down
2 changes: 1 addition & 1 deletion patches/net/minecraft/stats/StatList.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
public static final ResourceLocation SLEEP_IN_BED = registerCustom("sleep_in_bed", IStatFormater.DEFAULT);
public static final ResourceLocation OPEN_SHULKER_BOX = registerCustom("open_shulker_box", IStatFormater.DEFAULT);

+ // TISCM break_bedrock stats
+ // TISCM break_bedrock stat
+ public static final ResourceLocation BREAK_BEDROCK = registerCustom("break_bedrock", IStatFormater.DEFAULT);
+
public static void boot()
Expand Down
16 changes: 16 additions & 0 deletions patches/net/minecraft/stats/StatisticsManagerServer.java.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- a/net/minecraft/stats/StatisticsManagerServer.java
+++ b/net/minecraft/stats/StatisticsManagerServer.java
@@ -247,7 +247,12 @@

for (Stat<?> stat : this.getDirty())
{
- object2intmap.put(stat, this.getValue(stat));
+ // TISCM break_bedrock stat
+ // yeet before send or disconnect u
+ if (!stat.getName().equals("minecraft.custom:minecraft.break_bedrock"))
+ {
+ object2intmap.put(stat, this.getValue(stat));
+ }
}
}

0 comments on commit 78cb367

Please sign in to comment.