Giter Site home page Giter Site logo

notlin4 / appleskin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from squeek502/appleskin

0.0 0.0 0.0 783 KB

Food-related HUD improvements for Minecraft (AppleCore without the core)

Home Page: https://minecraft.curseforge.com/projects/appleskin

License: The Unlicense

Java 100.00%

appleskin's Introduction

Minecraft mod that adds various food-related HUD improvements formerly provided by AppleCore (basically, AppleCore without the core).

Features

  • Adds food value information to tooltips:

  • Adds a visualization of saturation and exhaustion to the HUD:

  • Adds a visualization of potential hunger/saturation restored while holding food:

  • Adds a visualization of potential health restored while holding food:

  • Adds hunger/saturation/exhaustion info to the debug overlay (F3)
  • Syncs the value of saturation and exhaustion to the client.

Building AppleSkin

  1. Clone the repository
  2. Open a command line and execute gradlew build

Note: To give the build a version number, use gradlew build -Pversion=<version> instead (example: gradlew build -Pversion=1.0.0).


For Mod Developers

Note: These instructions are Forge-specific. For Fabric, see the instructions in the relevant -fabric branch.

If followed, the directions below will make it so that your mod's Maven dependencies won't include AppleSkin at all, and your mod will load fine with or without AppleSkin installed.

To compile against the AppleSkin API, include the following in your build.gradle:

repositories {
	maven { url "https://maven.ryanliptak.com/" }
}

and add this to your dependencies block:

compileOnly fg.deobf("squeek.appleskin:appleskin-forge:<version>:api")

where <version> is replaced by the appropriate version found here:

https://maven.ryanliptak.com/squeek/appleskin/appleskin-forge

Once you're compiling against the AppleSkin API, you can create an event handler and only register it when appleskin is loaded. Here's an example implementation:

In your @Mod annotated class:

private void clientInit(final FMLClientSetupEvent event) {
    if (ModList.get().isLoaded("appleskin")) {
        MinecraftForge.EVENT_BUS.register(new AppleSkinEventHandler());
    }
}

and the AppleSkinEventHandler class:

public class AppleSkinEventHandler
{
	@SubscribeEvent
	public void onPreTooltipEvent(TooltipOverlayEvent.Pre event) {
		// hide the tooltip for regular apples
		if (event.itemStack.getItem() == Items.APPLE) {
			event.setCanceled(true);
		}
	}
}

(see the squeek.appleskin.api.event package for all the possible events that can be registered)


Note: if you want to test with the full AppleSkin mod in your development environment, you can also add the following to your dependencies:

runtimeOnly fg.deobf("squeek.appleskin:appleskin-forge:<version>")

while replacing <version> as mentioned above.

appleskin's People

Contributors

squeek502 avatar sagesse-cn avatar lordmzte avatar girafistudios avatar greg-21 avatar mrapplexz 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.