mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +01:00
Inform console about fake player
This commit is contained in:
parent
5bdbef0165
commit
96a835c475
3 changed files with 12 additions and 5 deletions
|
@ -42,6 +42,7 @@ import ellpeck.actuallyadditions.recipe.HairyBallHandler;
|
||||||
import ellpeck.actuallyadditions.recipe.TreasureChestHandler;
|
import ellpeck.actuallyadditions.recipe.TreasureChestHandler;
|
||||||
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
import ellpeck.actuallyadditions.tile.TileEntityBase;
|
||||||
import ellpeck.actuallyadditions.update.UpdateChecker;
|
import ellpeck.actuallyadditions.update.UpdateChecker;
|
||||||
|
import ellpeck.actuallyadditions.util.FakePlayerUtil;
|
||||||
import ellpeck.actuallyadditions.util.ModUtil;
|
import ellpeck.actuallyadditions.util.ModUtil;
|
||||||
import ellpeck.actuallyadditions.util.Util;
|
import ellpeck.actuallyadditions.util.Util;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
|
@ -109,6 +110,8 @@ public class ActuallyAdditions{
|
||||||
proxy.postInit(event);
|
proxy.postInit(event);
|
||||||
|
|
||||||
ModUtil.LOGGER.info("PostInitialization Finished.");
|
ModUtil.LOGGER.info("PostInitialization Finished.");
|
||||||
|
|
||||||
|
FakePlayerUtil.info();
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
|
|
@ -19,14 +19,18 @@ import java.util.UUID;
|
||||||
|
|
||||||
public class FakePlayerUtil{
|
public class FakePlayerUtil{
|
||||||
|
|
||||||
private static final String fakeName = "EllpecksActuallyAdditionsFakePlayer";
|
private static final String FAKE_NAME = "EllpecksActuallyAdditionsFakePlayer";
|
||||||
private static GameProfile fakeProfile = new GameProfile(UUID.nameUUIDFromBytes(fakeName.getBytes()), fakeName);
|
private static final GameProfile FAKE_PROFILE = new GameProfile(UUID.nameUUIDFromBytes(FAKE_NAME.getBytes()), FAKE_NAME);
|
||||||
private static FakePlayer theFakePlayer;
|
private static FakePlayer theFakePlayer;
|
||||||
|
|
||||||
public static FakePlayer newFakePlayer(World world){
|
public static void info(){
|
||||||
|
ModUtil.LOGGER.info(ModUtil.NAME+"' Fake Player: '"+FAKE_PROFILE.getName()+"', UUID: "+FAKE_PROFILE.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FakePlayer getFakePlayer(World world){
|
||||||
if(world instanceof WorldServer){
|
if(world instanceof WorldServer){
|
||||||
if(theFakePlayer == null){
|
if(theFakePlayer == null){
|
||||||
theFakePlayer = new FakePlayer((WorldServer)world, fakeProfile);
|
theFakePlayer = new FakePlayer((WorldServer)world, FAKE_PROFILE);
|
||||||
}
|
}
|
||||||
return theFakePlayer;
|
return theFakePlayer;
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,7 +149,7 @@ public class WorldUtil{
|
||||||
|
|
||||||
try{
|
try{
|
||||||
//Blocks
|
//Blocks
|
||||||
stack.tryPlaceItemIntoWorld(FakePlayerUtil.newFakePlayer(world), world, x, y, z, side == ForgeDirection.UNKNOWN ? 0 : side.ordinal(), 0, 0, 0);
|
stack.tryPlaceItemIntoWorld(FakePlayerUtil.getFakePlayer(world), world, x, y, z, side == ForgeDirection.UNKNOWN ? 0 : side.ordinal(), 0, 0, 0);
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
catch(Exception e){
|
catch(Exception e){
|
||||||
|
|
Loading…
Reference in a new issue