File tree Expand file tree Collapse file tree
Nukkit-MOT/src/main/java/org/CreadoresProgram/ViaBedrockDetect
Nukkit/src/main/java/org/CreadoresProgram/ViaBedrockDetect
Pocketmine/plugin/src/org/CreadoresProgram/ViaBedrockDetect
ViaProxy/src/main/java/org/CreadoresProgram/ViaBedrockDetect Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66import java .util .stream .Collectors ;
77public class NukkitMain extends PluginBase {
88 private static NukkitMain instance ;
9+ private static String deviceModelVP = "ViaProxyBedrock" ;
910 public static NukkitMain getInstance (){
1011 return instance ;
1112 }
@@ -17,7 +18,7 @@ public void onDisable(){
1718 this .getLogger ().info ("§cBye!" );
1819 }
1920 public boolean isJavaPlayer (Player player ){
20- return player .isJavaClient () || player .getLoginChainData ().getDeviceModel ().equals ("ViaProxyBedrock" );
21+ return player .isJavaClient () || player .getLoginChainData ().getDeviceModel ().equals (deviceModelVP );
2122 }
2223 public List <Player > getJavaPlayers (){
2324 return this .getServer ().getOnlinePlayers ().values ().stream ().filter (player -> isJavaPlayer (player )).collect (Collectors .toList ());
Original file line number Diff line number Diff line change 66import java .util .stream .Collectors ;
77public class NukkitMain extends PluginBase {
88 private static NukkitMain instance ;
9+ private static String deviceModelVP = "ViaProxyBedrock" ;
910 public static NukkitMain getInstance (){
1011 return instance ;
1112 }
@@ -17,7 +18,7 @@ public void onDisable(){
1718 this .getLogger ().info ("§cBye!" );
1819 }
1920 public boolean isJavaPlayer (Player player ){
20- return player .getLoginChainData ().getDeviceModel ().equals ("ViaProxyBedrock" );
21+ return player .getLoginChainData ().getDeviceModel ().equals (deviceModelVP );
2122 }
2223 public List <Player > getJavaPlayers (){
2324 return this .getServer ().getOnlinePlayers ().values ().stream ().filter (player -> isJavaPlayer (player )).collect (Collectors .toList ());
Original file line number Diff line number Diff line change 55use pocketmine \player \Player ;
66class PocketmineMain extends PluginBase{
77 private static ?self $ instance = null ;
8+ private static string $ deviceModelVP = "ViaProxyBedrock " ;
9+ private static string $ deviceModelP = "DeviceModel " ;
10+ private static string $ deviceOSP = "DeviceOS " ;
11+ private static string $ defDeviceModel = "" ;
812 public static function getInstance () : ?self {
913 return self ::$ instance ;
1014 }
@@ -16,8 +20,8 @@ public function onDisable() : void{
1620 }
1721 public function isJavaPlayer (Player $ player ) : bool {
1822 $ extraData = $ player ->getNetworkSession ()->getPlayerInfo ()->getExtraData ();
19- $ deviceModel = $ extraData [" DeviceModel " ] ?? "" ;
20- return ($ deviceModel == " ViaProxyBedrock " );
23+ $ deviceModel = $ extraData [self :: $ deviceModelP ] ?? self :: $ defDeviceModel ;
24+ return ($ deviceModel == self :: $ deviceModelVP );
2125 }
2226 public function getJavaPlayers () : array {
2327 return array_filter ($ this ->getServer ()->getOnlinePlayers (), fn ($ player ) => $ this ->isJavaPlayer ($ player ));
Original file line number Diff line number Diff line change 1010import java .util .Map ;
1111public class ViaProxyMain extends ViaProxyPlugin {
1212 private String prefix = "[ViaBedrockDetect] " ;
13+ private String DeviceOs = "DeviceOS" ;
14+ private String DeviceModel = "DeviceModel" ;
15+ private String DeviceModelVal = "ViaProxyBedrock" ;
1316 @ Override
1417 public void onEnable (){
1518 System .out .println (prefix + "Loading ViaBedrockDetect..." );
@@ -26,8 +29,8 @@ public void onViaLoading(ViaLoadingEvent event){
2629 @ Override
2730 public Map <String , Object > getClientPlayerSkin (final UserConnection user ){
2831 final Map <String , Object > claims = super .getClientPlayerSkin (user );
29- claims .put ("DeviceOS" , BuildPlatform .UWP .getValue ());
30- claims .put (" DeviceModel" , "ViaProxyBedrock" );
32+ claims .put (DeviceOs , BuildPlatform .UWP .getValue ());
33+ claims .put (DeviceModel , DeviceModelVal );
3134 return claims ;
3235 }
3336 });
You can’t perform that action at this time.
0 commit comments