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);
}
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();
}
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);
}
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);
}
}
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);
}
}
Aggregations