aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/entityviewer/NameModifier.java
blob: 9978882d24e19c41695e9127ac8032c49c433132 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package io.github.moulberry.notenoughupdates.miscfeatures.entityviewer;

import com.google.gson.JsonObject;
import net.minecraft.entity.EntityLivingBase;

public class NameModifier extends EntityViewerModifier {
	@Override
	public EntityLivingBase applyModifier(EntityLivingBase base, JsonObject info) {
		if (base instanceof GUIClientPlayer) {
			((GUIClientPlayer) base).setName(info.get("name").getAsString());
		}
		base.setCustomNameTag(info.get("name").getAsString());
		return base;
	}
}