use of com.mojang.authlib.GameProfile in project Pearcel-Mod by MiningMark48.
the class BlockPearcelSpike method onEntityWalk.
@Override
public void onEntityWalk(World worldIn, BlockPos pos, Entity entityIn) {
if (entityIn instanceof EntityLivingBase) {
if (fakePlayer == null) {
if (!worldIn.isRemote) {
fakePlayer = FakePlayerFactory.get((WorldServer) worldIn, new GameProfile(UUID.randomUUID(), ModBlocks.pearcel_spike.getLocalizedName()));
}
}
if (!(entityIn instanceof EntityPlayer)) {
((EntityLivingBase) entityIn).addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 20, 1));
entityIn.attackEntityFrom(DamageSource.causePlayerDamage(fakePlayer), spike_damage);
}
}
super.onEntityWalk(worldIn, pos, entityIn);
}
use of com.mojang.authlib.GameProfile in project acidisland by tastybento.
the class SkullBlock method getPlayerProfile.
// Credits: dori99xd
public static GameProfile getPlayerProfile(String textureValue, String textureSignature, String ownerUUID, String ownerName) {
// Create a new GameProfile with .schematic informations or with fake informations
GameProfile newSkinProfile = new GameProfile(ownerUUID == null ? UUID.randomUUID() : UUID.fromString(ownerUUID), ownerName == null ? getRandomString(16) : null);
// Insert textures properties
newSkinProfile.getProperties().put("textures", new Property("textures", textureValue, textureSignature));
return newSkinProfile;
}
use of com.mojang.authlib.GameProfile in project PneumaticCraft by MineMaarten.
the class GuiSecurityStationInventory method getAccessText.
private List<String> getAccessText() {
List<String> textList = new ArrayList<String>();
textList.add(" ");
textList.add("");
for (GameProfile user : te.sharedUsers) {
textList.add(EnumChatFormatting.BLACK + "-" + user.getName());
}
return textList;
}
use of com.mojang.authlib.GameProfile in project PneumaticCraft by MineMaarten.
the class TileEntitySecurityStation method hasPlayerHacked.
public boolean hasPlayerHacked(EntityPlayer player) {
for (int i = 0; i < hackedUsers.size(); i++) {
GameProfile user = hackedUsers.get(i);
if (gameProfileEquals(user, player.getGameProfile())) {
if (user.getId() == null && player.getGameProfile().getId() != null) {
hackedUsers.set(i, player.getGameProfile());
Log.info("Legacy conversion: Security Station hacked username '" + player.getCommandSenderName() + "' is now using UUID '" + player.getGameProfile().getId() + "'.");
}
return true;
}
}
return false;
}
use of com.mojang.authlib.GameProfile in project PneumaticCraft by MineMaarten.
the class TileEntitySecurityStation method readFromPacket.
@Override
public void readFromPacket(NBTTagCompound tag) {
super.readFromPacket(tag);
sharedUsers.clear();
NBTTagList sharedList = tag.getTagList("SharedUsers", 10);
for (int i = 0; i < sharedList.tagCount(); ++i) {
NBTTagCompound tagCompound = sharedList.getCompoundTagAt(i);
sharedUsers.add(new GameProfile(tagCompound.hasKey("uuid") ? UUID.fromString(tagCompound.getString("uuid")) : null, tagCompound.getString("name")));
}
hackedUsers.clear();
NBTTagList hackedList = tag.getTagList("HackedUsers", 10);
for (int i = 0; i < hackedList.tagCount(); ++i) {
NBTTagCompound tagCompound = hackedList.getCompoundTagAt(i);
hackedUsers.add(new GameProfile(tagCompound.hasKey("uuid") ? UUID.fromString(tagCompound.getString("uuid")) : null, tagCompound.getString("name")));
}
}
Aggregations