Search in sources :

Example 46 with Identifier

use of net.minecraft.util.Identifier in project bewitchment by MoriyaShiine.

the class WerewolfEntityRenderer method getTexture.

@Override
public Identifier getTexture(WerewolfEntity entity) {
    if (TEXTURES == null) {
        int variants = entity.getVariants();
        TEXTURES = new Identifier[variants];
        for (int i = 0; i < variants; i++) {
            TEXTURES[i] = new Identifier(Bewitchment.MODID, "textures/entity/living/werewolf/" + i + ".png");
        }
    }
    return TEXTURES[entity.getDataTracker().get(BWHostileEntity.VARIANT)];
}
Also used : Identifier(net.minecraft.util.Identifier)

Example 47 with Identifier

use of net.minecraft.util.Identifier in project bewitchment by MoriyaShiine.

the class OilCraftingProcessor method setup.

@Override
public void setup(IVariableProvider variables) {
    String recipeId = variables.get("recipe").asString();
    RecipeManager manager = MinecraftClient.getInstance().world.getRecipeManager();
    recipe = (OilRecipe) manager.get(new Identifier(recipeId)).filter(recipe -> recipe.getType().equals(BWRecipeTypes.OIL_RECIPE_TYPE)).orElseThrow(IllegalArgumentException::new);
}
Also used : BWRecipeTypes(moriyashiine.bewitchment.common.registry.BWRecipeTypes) IVariableProvider(vazkii.patchouli.api.IVariableProvider) ItemStack(net.minecraft.item.ItemStack) IVariable(vazkii.patchouli.api.IVariable) Identifier(net.minecraft.util.Identifier) IComponentProcessor(vazkii.patchouli.api.IComponentProcessor) MinecraftClient(net.minecraft.client.MinecraftClient) RecipeManager(net.minecraft.recipe.RecipeManager) OilRecipe(moriyashiine.bewitchment.common.recipe.OilRecipe) Identifier(net.minecraft.util.Identifier) RecipeManager(net.minecraft.recipe.RecipeManager)

Example 48 with Identifier

use of net.minecraft.util.Identifier in project bewitchment by MoriyaShiine.

the class RitualProcessor method setup.

@Override
public void setup(IVariableProvider variables) {
    String recipeId = variables.get("recipe").asString();
    RecipeManager manager = MinecraftClient.getInstance().world.getRecipeManager();
    recipe = (RitualRecipe) manager.get(new Identifier(recipeId)).filter(recipe -> recipe.getType().equals(BWRecipeTypes.RITUAL_RECIPE_TYPE)).orElseThrow(IllegalArgumentException::new);
}
Also used : BWRecipeTypes(moriyashiine.bewitchment.common.registry.BWRecipeTypes) IVariableProvider(vazkii.patchouli.api.IVariableProvider) ItemStack(net.minecraft.item.ItemStack) IVariable(vazkii.patchouli.api.IVariable) I18n(net.minecraft.client.resource.language.I18n) TranslatableText(net.minecraft.text.TranslatableText) RitualRecipe(moriyashiine.bewitchment.common.recipe.RitualRecipe) Identifier(net.minecraft.util.Identifier) IComponentProcessor(vazkii.patchouli.api.IComponentProcessor) MinecraftClient(net.minecraft.client.MinecraftClient) RecipeManager(net.minecraft.recipe.RecipeManager) Identifier(net.minecraft.util.Identifier) RecipeManager(net.minecraft.recipe.RecipeManager)

Example 49 with Identifier

use of net.minecraft.util.Identifier in project WK by witches-kitchen.

the class ParticlePacketHandler method send.

public static void send(ServerPlayerEntity player, final BlockPos pos, final Identifier particle, @Nullable final Identifier sound, final byte range) {
    final PacketByteBuf data = PacketByteBufs.create();
    data.writeBlockPos(pos);
    data.writeIdentifier(particle);
    data.writeIdentifier(sound == null ? new Identifier("") : sound);
    data.writeByte(range);
    ServerPlayNetworking.send(player, CHANNEL, data);
}
Also used : Identifier(net.minecraft.util.Identifier) PacketByteBuf(net.minecraft.network.PacketByteBuf)

Example 50 with Identifier

use of net.minecraft.util.Identifier in project WK by witches-kitchen.

the class WKBlocks method registerBlock.

// this is used to register all blocks as a modBlock and to also register all but blackthorn leaves as leaves blocks. this is used to tell the client how to render these blocks.
public static void registerBlock(String id, Block block, ItemGroup tab) {
    modBlocks.add(block);
    if (block instanceof LeavesBlock && id != "blackthorn_leaves") {
        // this logic needs work to not label blackthorn leaves as those able to be color mapped differently
        leafBlocks.add(block);
    } else {
    }
    Registry.register(Registry.BLOCK, new Identifier(WK.MODID, id), block);
    Registry.register(Registry.ITEM, new Identifier(WK.MODID, id), new BlockItem(block, new FabricItemSettings().group(tab)));
    if (WKConfig.get().debugMode) {
        WK.logger.info("Witches Kitchen Base Blocks: Successfully Loaded");
    }
}
Also used : Identifier(net.minecraft.util.Identifier) FabricItemSettings(net.fabricmc.fabric.api.item.v1.FabricItemSettings) BlockItem(net.minecraft.item.BlockItem)

Aggregations

Identifier (net.minecraft.util.Identifier)343 NbtList (net.minecraft.nbt.NbtList)36 ItemStack (net.minecraft.item.ItemStack)31 Item (net.minecraft.item.Item)28 NbtCompound (net.minecraft.nbt.NbtCompound)22 NbtElement (net.minecraft.nbt.NbtElement)22 Inject (org.spongepowered.asm.mixin.injection.Inject)22 IOException (java.io.IOException)18 Block (net.minecraft.block.Block)18 MinecraftClient (net.minecraft.client.MinecraftClient)15 BlockItem (net.minecraft.item.BlockItem)15 BlockPos (net.minecraft.util.math.BlockPos)15 Map (java.util.Map)12 BlockState (net.minecraft.block.BlockState)12 ArrayList (java.util.ArrayList)11 VertexConsumer (net.minecraft.client.render.VertexConsumer)11 ResourceManager (net.minecraft.resource.ResourceManager)11 SoundEvent (net.minecraft.sound.SoundEvent)11 ServerPlayerEntity (net.minecraft.server.network.ServerPlayerEntity)10 LiteralText (net.minecraft.text.LiteralText)10