Пример #1
0
  @Override
  public void postInit(FMLPostInitializationEvent event) {
    ClientProxyCore.registerInventoryTabs();
    ClientProxyCore.registerEntityRenderers();
    ClientProxyCore.registerItemRenderers();

    // ClientProxyCore.playerList = GLAllocation.generateDisplayLists(1);
  }
Пример #2
0
  public static void renderLiquidOverlays(float partialTicks) {
    Minecraft minecraft = FMLClientHandler.instance().getClient();

    if (ClientProxyCore.isInsideOfFluid(minecraft.thePlayer, GalacticraftCore.fluidOil)) {
      minecraft.getTextureManager().bindTexture(ClientProxyCore.underOilTexture);
    } else {
      return;
    }

    Tessellator tessellator = Tessellator.instance;
    float f1 = minecraft.thePlayer.getBrightness(partialTicks) / 3.0F;
    GL11.glColor4f(f1, f1, f1, 1.0F);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glPushMatrix();
    float f2 = 4.0F;
    float f3 = -1.0F;
    float f4 = 1.0F;
    float f5 = -1.0F;
    float f6 = 1.0F;
    float f7 = -0.5F;
    float f8 = -minecraft.thePlayer.rotationYaw / 64.0F;
    float f9 = minecraft.thePlayer.rotationPitch / 64.0F;
    tessellator.startDrawingQuads();
    tessellator.addVertexWithUV(f3, f5, f7, f2 + f8, f2 + f9);
    tessellator.addVertexWithUV(f4, f5, f7, 0.0F + f8, f2 + f9);
    tessellator.addVertexWithUV(f4, f6, f7, 0.0F + f8, 0.0F + f9);
    tessellator.addVertexWithUV(f3, f6, f7, f2 + f8, 0.0F + f9);
    tessellator.draw();
    GL11.glPopMatrix();
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    GL11.glDisable(GL11.GL_BLEND);
  }
Пример #3
0
 @Override
 public void init(FMLInitializationEvent event) {
   Class[][] commonTypes = {
     {MusicTicker.MusicType.class, ResourceLocation.class, int.class, int.class},
   };
   MUSIC_TYPE_MARS =
       EnumHelper.addEnum(
           commonTypes,
           MusicTicker.MusicType.class,
           "MARS_JC",
           new ResourceLocation(GalacticraftCore.ASSET_DOMAIN, "galacticraft.musicSpace"),
           12000,
           24000);
   ClientProxyCore.registerHandlers();
   ClientProxyCore.registerTileEntityRenderers();
   ClientProxyCore.registerBlockHandlers();
   ClientProxyCore.setupCapes();
 }
Пример #4
0
  public static void setupCapes() {
    try {
      ClientProxyCore.updateCapeList();
    } catch (Exception e) {
      FMLLog.severe("Error while setting up Galacticraft donor capes");
      e.printStackTrace();
    }

    if (Loader.isModLoaded("CoFHCore")) {
      for (Entry<String, String> e : ClientProxyCore.capeMap.entrySet()) {
        try {
          Object capeRegistry =
              Class.forName("cofh.api.core.RegistryAccess").getField("capeRegistry").get(null);
          Class.forName("cofh.api.core.ISimpleRegistry")
              .getMethod("register", String.class, String.class)
              .invoke(capeRegistry, e.getKey(), e.getValue());
        } catch (Exception e1) {
          e1.printStackTrace();
          break;
        }
      }
    }
  }