use of net.minecraftforge.api.distmarker.OnlyIn in project Bookshelf by Darkhax-Minecraft.
the class PlayerUtils method getPlayerTexture.
/**
* Gets a resource location that is bound to a player skin texture.
*
* @param profile The profile to lookup.
* @return The texture to use for that profile.
*/
@OnlyIn(Dist.CLIENT)
public static ResourceLocation getPlayerTexture(GameProfile profile) {
// Validate the profile first.
if (profile != null) {
final Minecraft minecraft = Minecraft.getInstance();
// Load skin data about the profile.
final Map<Type, MinecraftProfileTexture> map = minecraft.getSkinManager().getInsecureSkinInformation(profile);
// If the loaded data has a skin, return that.
if (map.containsKey(Type.SKIN)) {
return minecraft.getSkinManager().registerTexture(map.get(Type.SKIN), Type.SKIN);
} else {
return DefaultPlayerSkin.getDefaultSkin(PlayerEntity.createPlayerUUID(profile));
}
}
// Default to the legacy steve skin.
return DefaultPlayerSkin.getDefaultSkin();
}
use of net.minecraftforge.api.distmarker.OnlyIn in project NetherEx by LogicTechCorp.
the class NetherEx method onRegisterParticleFactory.
@OnlyIn(Dist.CLIENT)
private void onRegisterParticleFactory(ParticleFactoryRegisterEvent event) {
ParticleManager particleManager = Minecraft.getInstance().particles;
particleManager.registerFactory(NetherExParticles.SPORE_CREEPER_EXPLOSION.get(), SporeCreeperExplosionParticle.Factory::new);
particleManager.registerFactory(NetherExParticles.SPORE_CREEPER_EXPLOSION_EMITTER.get(), new SporeCreeperExplosionEmitterParticle.Factory());
}
use of net.minecraftforge.api.distmarker.OnlyIn in project NetherEx by LogicTechCorp.
the class DullMirrorItem method addInformation.
@Override
@OnlyIn(Dist.CLIENT)
public void addInformation(ItemStack stack, World world, List<ITextComponent> tooltip, ITooltipFlag flag) {
CompoundNBT compound = stack.getTag();
if (compound != null) {
if (compound.contains("SpawnDimension")) {
DimensionType type = DimensionType.byName(new ResourceLocation(compound.getString("SpawnDimension")));
tooltip.add(new TranslationTextComponent("tooltip.netherex.dull_mirror.spawn_dimension", StringUtils.capitalize(type.getRegistryName().getPath().replace("_", " "))));
}
if (compound.contains("SpawnPoint")) {
BlockPos spawnPos = NBTUtil.readBlockPos(compound.getCompound("SpawnPoint"));
tooltip.add(new TranslationTextComponent("tooltip.netherex.dull_mirror.spawn_point", spawnPos.getX() + " " + spawnPos.getY() + " " + spawnPos.getZ()));
}
if (compound.contains("DeathPoint")) {
BlockPos deathPos = NBTUtil.readBlockPos(compound.getCompound("DeathPoint"));
tooltip.add(new TranslationTextComponent("tooltip.netherex.dull_mirror.death_point", deathPos.getX() + " " + deathPos.getY() + " " + deathPos.getZ()));
}
}
}
use of net.minecraftforge.api.distmarker.OnlyIn in project Overloaded by CJ-MC-Mods.
the class ItemFluidCore method registerModel.
@OnlyIn(Dist.CLIENT)
@Override
public void registerModel() {
ModelResourceLocation location = new ModelResourceLocation(getRegistryName(), null);
// ModelLoader.setCustomModelResourceLocation(this, 0, location);
ImageUtil.registerDynamicTexture(new ResourceLocation(MODID, "textures/item/fluid_core.png"), OverloadedConfig.INSTANCE.textureResolutions.itemResolution);
}
use of net.minecraftforge.api.distmarker.OnlyIn in project Overloaded by CJ-MC-Mods.
the class ItemLinkingCard method appendHoverText.
@OnlyIn(Dist.CLIENT)
@Override
public void appendHoverText(ItemStack stack, @Nullable World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
CompoundNBT tag = stack.getTag();
if (tag != null && tag.contains("TYPE")) {
String type = tag.getString("TYPE");
int x = tag.getInt("X");
int y = tag.getInt("Y");
int z = tag.getInt("Z");
String worldID = tag.getString("WORLD");
tooltip.add(new StringTextComponent(String.format("Bound to %s at %s: %d,%d,%d", type, worldID, x, y, z)));
}
super.appendHoverText(stack, worldIn, tooltip, flagIn);
}
Aggregations