Search in sources :

Example 26 with ResourceLocation

use of net.minecraft.util.ResourceLocation in project MinecraftForge by MinecraftForge.

the class VanillaRegistryTests method testRegistryStates.

@Test
public void testRegistryStates() {
    final FMLControlledNamespacedRegistry<Block> blockVanilla = PersistentRegistryManager.PersistentRegistry.VANILLA.getRegistry(Block.class);
    final FMLControlledNamespacedRegistry<Block> blockActive = PersistentRegistryManager.PersistentRegistry.ACTIVE.getRegistry(Block.class);
    assertNotEquals("Registry states are distinct", blockActive, blockVanilla);
    final Block stoneActive = blockActive.getValue(new ResourceLocation("minecraft:stone"));
    final Block stoneVanilla = blockVanilla.getValue(new ResourceLocation("minecraft:stone"));
    assertEquals("Stone from active and vanilla are the same", stoneActive, stoneVanilla);
    int activeId = blockActive.getId(stoneActive);
    int vanillaId = blockVanilla.getId(stoneVanilla);
    assertEquals("Stone has correct id", 1, activeId);
    assertEquals("Stone has correct id", 1, vanillaId);
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) Block(net.minecraft.block.Block) Test(org.junit.Test)

Example 27 with ResourceLocation

use of net.minecraft.util.ResourceLocation in project MinecraftForge by MinecraftForge.

the class WRNormalMod method init.

@EventHandler
public void init(FMLPreInitializationEvent event) {
    EntityRegistry.registerModEntity(new ResourceLocation("wrnormal", "scale_test"), EntityScaleTest.class, "scale_test", 0, instance, 60, 3, true);
    proxy.registerRenders();
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) EventHandler(net.minecraftforge.fml.common.Mod.EventHandler)

Example 28 with ResourceLocation

use of net.minecraft.util.ResourceLocation in project MinecraftForge by MinecraftForge.

the class CustomSpriteTest method textureStitch.

@SubscribeEvent
public void textureStitch(TextureStitchEvent.Pre event) {
    DelegateSprite bottom = DelegateSprite.make("bottom", new ResourceLocation("textures/blocks/diamond_block.png"));
    DelegateSprite top = DelegateSprite.make("top", new ResourceLocation("textures/blocks/tnt_side.png"));
    TextureMap textureMap = event.getMap();
    textureMap.setTextureEntry(bottom);
    textureMap.setTextureEntry(top);
}
Also used : TextureMap(net.minecraft.client.renderer.texture.TextureMap) ResourceLocation(net.minecraft.util.ResourceLocation) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 29 with ResourceLocation

use of net.minecraft.util.ResourceLocation in project Minechem by iopleke.

the class ClientProxy method registerFonts.

@Override
public void registerFonts() {
    try {
        GLFont.fromTTF(Compendium.Fontbox.tracer(), 22.0f, new ResourceLocation(Compendium.Naming.id, "fonts/daniel.ttf"));
        GLFont.fromTTF(Compendium.Fontbox.tracer(), 22.0f, new ResourceLocation(Compendium.Naming.id, "fonts/notethis.ttf"));
        GLFont.fromTTF(Compendium.Fontbox.tracer(), 22.0f, new ResourceLocation(Compendium.Naming.id, "fonts/ampersand.ttf"));
    } catch (FontException font) {
        LogHelper.exception(font, Level.ERROR);
    }
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) FontException(net.afterlifelochie.fontbox.font.FontException)

Example 30 with ResourceLocation

use of net.minecraft.util.ResourceLocation in project Minechem by iopleke.

the class EnhancedFontRenderer method readGlyphSizes.

private void readGlyphSizes() {
    try {
        InputStream inputstream = Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation("font/glyph_sizes.bin")).getInputStream();
        inputstream.read(this.glyphWidth);
    } catch (IOException ioexception) {
        throw new RuntimeException(ioexception);
    }
}
Also used : InputStream(java.io.InputStream) ResourceLocation(net.minecraft.util.ResourceLocation) IOException(java.io.IOException)

Aggregations

ResourceLocation (net.minecraft.util.ResourceLocation)272 ItemStack (net.minecraft.item.ItemStack)51 Block (net.minecraft.block.Block)47 Item (net.minecraft.item.Item)32 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)31 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)30 IBlockState (net.minecraft.block.state.IBlockState)17 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)15 ArrayList (java.util.ArrayList)14 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)14 Map (java.util.Map)11 EntityPlayer (net.minecraft.entity.player.EntityPlayer)11 ShaderLayer (blusunrize.immersiveengineering.api.shader.ShaderCase.ShaderLayer)10 IOException (java.io.IOException)10 TileEntity (net.minecraft.tileentity.TileEntity)9 IBakedModel (net.minecraft.client.renderer.block.model.IBakedModel)8 EnumFacing (net.minecraft.util.EnumFacing)8 BlockPos (net.minecraft.util.math.BlockPos)8 Random (java.util.Random)7 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)7