Git Product home page Git Product logo

ultralight-forge-1.8.9's Introduction

Ultralight Forge 1.8.9

An example of the Ultralight HTML renderer in Minecraft Forge 1.8.9 A few general modding tips are also included

demo.mp4

What works

  • Rendering HTML
  • Mouse input
  • Keyboard input
  • Java/JavaScript interop (implementation not shown)

QuickStart

This example can be run out of the box. Simply

  • Clone this repo
  • Run the gradle task runClient
  • Join a world, any world
  • Press right shift to open the demo GUI

General Modding

Audio

  • Step 1 Place your audio file under assets/<modID>/sounds in .ogg format

  • Step 2 Register your file in sounds.json with the following format

  "whatever.name":{
  "category": "master",
  "sounds":[
    {
      "name":"<modID>:my_sound","stream":false
    }
   ]
  }

The above will look for the file my_sound.ogg under assets/<modID>/sounds/ and make it accessible by whatever.name The category is trivial.

  • Step 3 Play your sound file using the accessible name
    Minecraft.getMinecraft().thePlayer.playSound("<modID>:whatever.name", volume, pitch);

Notes

  • You can play vanilla minecraft sounds with example above. Simply replace <modID> with minecraft. A complete list of vanilla sounds can be found here
  • It's good practice to name audio files using snake case

Rendering Textures

Your image can be anywhere under assets/<modID>. Reference that image relatively in the code like so

    public static final ResourceLocation myImage = new ResourceLocation(MODID, path);

The above will look for an image at assets/<modID>/path. Drawing can then be done with the convenient RenderUtils class.

RenderUtils.drawTexture(resourceLocation, x, y, width, height, rgbaCombined);

If you are drawing without a gui active (aka directly to the screen), make sure to fix your x & y coordinates using the ScaledResolution class

Gradle tasks

  • build Builds the mod into a usable jar file under build/libs
  • runClient Runs the mod in minecraft on the fly

ultralight-forge-1.8.9's People

Contributors

daveh355 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.