Fix fake player problem with some plugins.
This commit is contained in:
44
patches/net/minecraftforge/common/util/FakePlayer.java.patch
Normal file
44
patches/net/minecraftforge/common/util/FakePlayer.java.patch
Normal file
@ -0,0 +1,44 @@
|
||||
--- ../src-base/minecraft/net/minecraftforge/common/util/FakePlayer.java
|
||||
+++ ../src-work/minecraft/net/minecraftforge/common/util/FakePlayer.java
|
||||
@@ -3,9 +3,11 @@
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
+import cpw.mods.fml.common.gameevent.PlayerEvent;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.network.play.client.C15PacketClientSettings;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.management.ItemInWorldManager;
|
||||
import net.minecraft.stats.StatBase;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
@@ -13,13 +15,29 @@
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
+import net.minecraftforge.cauldron.configuration.CauldronConfig;
|
||||
+import net.minecraftforge.event.ForgeEventFactory;
|
||||
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.HashSet;
|
||||
+import java.util.concurrent.ConcurrentSkipListSet;
|
||||
+
|
||||
//Preliminary, simple Fake Player class
|
||||
public class FakePlayer extends EntityPlayerMP
|
||||
{
|
||||
+ static public ArrayList<FakePlayer> fakePlayers=new ArrayList<>();
|
||||
+ static public boolean BukkitInited=false;
|
||||
public FakePlayer(WorldServer world, GameProfile name)
|
||||
{
|
||||
super(FMLCommonHandler.instance().getMinecraftServerInstance(), world, name, new ItemInWorldManager(world));
|
||||
+ //KCauldronX Start
|
||||
+ if(MinecraftServer.cauldronConfig.fakePlayerLogin.getValue())
|
||||
+ if(!BukkitInited) {
|
||||
+ fakePlayers.add(this);
|
||||
+ }else{
|
||||
+ PlayerEvent.PlayerLoggedInEvent join=new PlayerEvent.PlayerLoggedInEvent(this);
|
||||
+ }
|
||||
+ //KCauldronX End
|
||||
}
|
||||
|
||||
@Override public boolean canCommandSenderUseCommand(int i, String s){ return false; }
|
Reference in New Issue
Block a user