GithubHelp home page GithubHelp logo

energy's Introduction

Energy

An Energy API for Fabric mods, originally written for TechReborn.

Uses Fabric's API Lookup and Transaction systems.

Conventions

To ensure good interop between all the mods using this API, here are a few conventions that should be followed.

  • Reference energy values
    • 1 coal = 4000
    • 1 plank = 750
  • The system is push-based.
    • This means that power sources are responsible for pushing power to nearby machines.
    • Machines and wires should NOT pull power from other sources.

Including the API in your project

Find the latest versions here

  • Version 3.x should be used for Minecraft 1.19.4 -> 1.20.4
  • Version 4.0.x should be used for Minecraft 1.20.5 or later
  • Version 4.1.x should be used for Minecraft 1.21 or later

Add the following into your dependencies block in build.gradle

include modApi('teamreborn:energy:<latest_version>')

Documentation

The API revolves around EnergyStorage. Make sure to check out the documentation.

A few examples follow to get you started.

Implementing energy-containing blocks

The easiest way, with fixed capacity and insertion/extraction limits:

public class MyBlockEntity extends BlockEntity {
    // Store a SimpleEnergyStorage in the block entity class.
    public final SimpleEnergyStorage energyStorage = new SimpleEnergyStorage(CAPACITY, MAX_INSERT, MAX_EXTRACT) {
        @Override
        protected void onFinalCommit() {
            markDirty();
        }
    };
    
    // Use the energy internally, for example in tick()
    public void tick() {
        if (!world.isClient && energyStorage.amount >= 10) {
            energyStorage.amount -= 10;
            // do something with the 10 energy we just used.
            markDirty();
        }
    }
    
    // Don't forget to save/read the energy in the block entity NBT.
}

// Don't forget to register the energy storage. Make sure to call this after you create the block entity type.
BlockEntityType<MyBlockEntity> MY_BLOCK_ENTITY;
EnergyStorage.SIDED.registerForBlockEntity((myBlockEntity, direction) -> myBlockEntity.energyStorage, MY_BLOCK_ENTITY);

SimpleSidedEnergyContainer may be used if the I/O limits are side-dependent.

If you know what you are doing, you can also implement EnergyStorage directly, but in most cases that's not necessary. Refer to the documentation of this API, of the Transaction API and API Lookup for details.

Usage example (blocks)

Get an energy storage:

@Nullable
EnergyStorage maybeStorage = EnergyStorage.SIDED.find(world, pos, direction);

Get an adjacent energy storage:

// Known things
World world; BlockPos currentPos; Direction adjacentDirection;
// Get adjacent energy storage, or null if there is none
@Nullable
EnergyStorage maybeStorage = EnergyStorage.SIDED.find(world, currentPos.offset(adjacentDirection), adjacentDirection.getOpposite());

Move energy between two storages:

EnergyStorage source, target;

long amountMoved = EnergyStorageUtil.move(
        source, // from source
        target, // into target
        Long.MAX_VALUE, // no limit on the amount
        null // create a new transaction for this operation 
);

Try to extract an exact amount of energy:

EnergyStorage source;
long amountToUse;

// Open a transaction: this allows cancelling the operation if it doesn't go as expected.
try (Transaction transaction = Transaction.openOuter()) {
    // Try to extract, will return how much was actually extracted
    long amountExtracted = source.extract(amountToUse, transaction);
    if (amountExtracted == amountToUse) {
        // "Commit" the transaction to make sure the change is applied.
        transaction.commit();
    } else {
        // Doing nothing "aborts" the transaction, cancelling the change.
    }
}

Creating chargeable items

The easiest way to create an item that can be charged by supported mods is by implementing SimpleEnergyItem on your item class. The functions should be self-explanatory.

For more complex items, EnergyStorage.ITEM may be used directly. Make sure you read the documentation of ContainerItemContext if you go down that path.

Charging items

Check out how you can create a ContainerItemContext, and use it to query an EnergyStorage implementation with EnergyStorage.SIDED.

energy's People

Contributors

drcrazy avatar gabrielolvh avatar modmuss50 avatar prospector avatar technici4n avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

energy's Issues

side for getMaxStoredPower?

I see that getStored takes a side parameter, but getMaxStoredPower does not, which seems wrong since that breaks the isolation of sides

Version 0.1.2 not indexed

Hello, today i tried to use this library for one of my mods and couldn't get it to work with the latest version (0.1.2). Chaging it to 0.1.1 solved the issue but it seems that 0.1.2 isn't published in any mavon repo or something. (I'm sorry for my weird language).

Steps to reproduce

  1. Create a fabric project (by cloning the example mod)
  2. add the dependencies to teamreborn:energy:0.1.2 so that dependencies in build.gradle look like this:
dependencies {
    // To change the versions see the gradle.properties file
    minecraft "com.mojang:minecraft:${project.minecraft_version}"
    mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
    modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

    // Fabric API. This is technically optional, but you probably want it anyway.
    modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

    // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
    // You may need to force-disable transitiveness on them.

    // Energy API
    modApi  'teamreborn:energy:0.1.2'
    include 'teamreborn:energy:0.1.2'
}

Expected result

This should include the latest version in my project

What actually happens

gradle fails with the following:

A problem occurred configuring root project 'oxidized'.
> Could not resolve all files for configuration ':modCompileClasspath'.
   > Could not find teamreborn:energy:0.1.2.
     Searched in the following locations:
       - file:/home/jules/prg/oxidized/build/loom-cache/energy-0.1.2.jar
       - file:/home/jules/prg/oxidized/build/loom-cache/energy.jar
       - file:/home/jules/prg/oxidized/.gradle/loom-cache/remapped_mods/teamreborn/energy/0.1.2/energy-0.1.2.pom
       - https://maven.fabricmc.net/teamreborn/energy/0.1.2/energy-0.1.2.pom
       - https://libraries.minecraft.net/teamreborn/energy/0.1.2/energy-0.1.2.pom
       - https://repo.maven.apache.org/maven2/teamreborn/energy/0.1.2/energy-0.1.2.pom
       - file:/home/jules/.gradle/caches/fabric-loom/0.1.2/energy-0.1.2.jar
       - file:/home/jules/prg/oxidized/.gradle/loom-cache/0.1.2/energy-0.1.2.jar
     Required by:
         project :

include modAPI leads to crash

Issue:
The use of

include modApi('teamreborn:energy:2.1.0')

leads to the game crashing, whereas

modCompileOnly "teamreborn:energy:2.1.0"
modRuntimeOnly "teamreborn:energy:2.1.0"

works without any problem, and the mod beeing recognized/present.

If any other modRuntimes are added, the following line may change to show any arbitrary modid:
Could not execute entrypoint stage 'client' due to errors, provided by 'fabric-networking-v0'!

Crashlog:
crash-2022-01-19_10.29.15-client.txt

Steps to reproduce:

  1. Clone the fabric example mod and update to following values
fabric_version=0.46.1+1.18
minecraft_version=1.18.1
yarn_mappings=1.18.1+build.1
loader_version=0.12.12
  1. Add reference to this API according to readme
  2. Setup / Build
  3. Run the client

crash

[02/01/2022 17:55:01 PM] [Render thread/INFO] Failed to find module info for USERSDIR\temp\natives-055c324afd1444499818e4ac1bdf94a4\SAPIWrapper_x64.dll
[02/01/2022 17:55:01 PM] ---- Minecraft Crash Report ----
[02/01/2022 17:55:01 PM] // Don't be sad, have a hug! <3
[02/01/2022 17:55:01 PM]
[02/01/2022 17:55:01 PM] Time: 1/2/22, 5:55 PM
[02/01/2022 17:55:01 PM] Description: Initializing game
[02/01/2022 17:55:01 PM]
[02/01/2022 17:55:01 PM] java.lang.IllegalStateException: Config not yet available
[02/01/2022 17:55:01 PM] at me.jellysquid.mods.sodium.client.SodiumClientMod.options(SodiumClientMod.java:34)
[02/01/2022 17:55:01 PM] at net.minecraft.class_310.handler$eie000$postInit(class_310.java:17976)
[02/01/2022 17:55:01 PM] at net.minecraft.class_310.(class_310.java:637)
[02/01/2022 17:55:01 PM] at net.minecraft.client.main.Main.main(Main.java:199)
[02/01/2022 17:55:01 PM] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[02/01/2022 17:55:01 PM] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[02/01/2022 17:55:01 PM] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[02/01/2022 17:55:01 PM] at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[02/01/2022 17:55:01 PM] at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:608)
[02/01/2022 17:55:01 PM] at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:77)
[02/01/2022 17:55:01 PM] at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
[02/01/2022 17:55:01 PM]
[02/01/2022 17:55:01 PM]
[02/01/2022 17:55:01 PM] A detailed walkthrough of the error, its code path and all known details is as follows:
[02/01/2022 17:55:01 PM] ---------------------------------------------------------------------------------------
[02/01/2022 17:55:01 PM]
[02/01/2022 17:55:01 PM] -- Head --
[02/01/2022 17:55:01 PM] Thread: Render thread
[02/01/2022 17:55:01 PM] Stacktrace:
[02/01/2022 17:55:01 PM] at me.jellysquid.mods.sodium.client.SodiumClientMod.options(SodiumClientMod.java:34)
[02/01/2022 17:55:01 PM] at net.minecraft.class_310.handler$eie000$postInit(class_310.java:17976)
[02/01/2022 17:55:01 PM] at net.minecraft.class_310.(class_310.java:637)
[02/01/2022 17:55:01 PM]
[02/01/2022 17:55:01 PM] -- Initialization --
[02/01/2022 17:55:01 PM] Details:
[02/01/2022 17:55:01 PM] Modules:
[02/01/2022 17:55:01 PM] ADVAPI32.dll:Advanced Windows 32 Base API:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] COMCTL32.dll:User Experience Controls Library:6.10 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] CRYPT32.dll:Crypto API32:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] CRYPTBASE.dll:Base cryptographic API DLL:10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] CRYPTSP.dll:Cryptographic Service Provider API:10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] ColorAdapterClient.dll:Microsoft Color Adapter Client:10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] CoreMessaging.dll:Microsoft CoreMessaging Dll:10.0.19041.746:Microsoft Corporation
[02/01/2022 17:55:01 PM] CoreUIComponents.dll:Microsoft Core UI Components Dll:10.0.19041.546:Microsoft Corporation
[02/01/2022 17:55:01 PM] DBGHELP.DLL:Windows Image Helper:10.0.19041.867 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] DEVOBJ.dll:Device Information Set DLL:10.0.19041.1151 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] DNSAPI.dll:DNS Client API DLL:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] GDI32.dll:GDI Client DLL:10.0.19041.1202 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] GLU32.dll:OpenGL Utility Library DLL:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] HID.DLL:Hid User Library:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] IMM32.DLL:Multi-User Windows IMM32 API Client DLL:10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] IPHLPAPI.DLL:IP Helper API:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] KERNEL32.DLL:Windows NT BASE API Client DLL:10.0.19041.1348 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] KERNELBASE.dll:Windows NT BASE API Client DLL:10.0.19041.1348 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] MMDevApi.dll:MMDevice API:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] MSACM32.dll:Microsoft ACM Audio Filter:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] MSASN1.dll:ASN.1 Runtime APIs:10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] MSCTF.dll:MSCTF Server DLL:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] MpOav.dll:IOfficeAntiVirus Module:4.18.2111.5 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] NLAapi.dll:Network Location Awareness 2:10.0.19041.1151 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] NSI.dll:NSI User-mode interface DLL:10.0.19041.610 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] NTASN1.dll:Microsoft ASN.1 API:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] Ole32.dll:Microsoft OLE for Windows:10.0.19041.1320 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] OleAut32.dll:OLEAUT32.DLL:10.0.19041.985 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] Oleacc.dll:Active Accessibility Core Component:7.2.19041.746 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] OpenAL.dll
[02/01/2022 17:55:01 PM] PROPSYS.dll:Microsoft Property System:7.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] PSAPI.DLL:Process Status Helper:10.0.19041.546 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] Pdh.dll:Windows Performance Data Helper DLL:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] RPCRT4.dll:Remote Procedure Call Runtime:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] SAPIWrapper_x64.dll
[02/01/2022 17:55:01 PM] SETUPAPI.DLL:Windows Setup API:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] SHCORE.dll:SHCORE:10.0.19041.1 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] SHELL32.dll:Windows Shell Common Dll:10.0.19041.964 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] WS2_32.dll:Windows Socket 2.0 32-Bit DLL:10.0.19041.1081 (WinBuild.160101.0800):Microsoft Corporation
[02/01/2022 17:55:01 PM] advanced_runtime_resource_pack: Runtime Resource Pack 0.5.4
[02/01/2022 17:55:01 PM] team_reborn_energy: Energy 2.0.0-beta1
[02/01/2022 17:55:02 PM] Oh no. Minecraft crashed. Please check the logs for any errors and provide these logs when asking for support.
[02/01/2022 17:55:02 PM] Checking for updated files!

Can setStored be avoided?

I can't think of a case where external objects setting stored energy is useful, but maybe there is one?

I have a use case where setting the stored energy is slower than it would be to insert or extract directly, and would ideally be able to override that behavior

Custom energy types on SimpleEnergyItem

Hello,

I was wondering if there's a way to have SimpleEnergyItems be unregistered from the "default" energy type? Currently, I have two energy items that are extended from a class that implements SimpleEnergyItem (and other behaviors that are not relevant to the issue).
All is dandy for the first item, since it is meant to use the default energy type. However, for the second, it's meant to use a custom energy type; I registered it manually to it - however, it's still registered to the default type (as all items that implement SimpleEnergyItem do), essentially allowing unintended 1:1 energy transferral.

Even if unregistering is an option, It'd be nice to have custom energy types support, since I wouldn't consider having what's essentially the same logic registered to other id enough to deem it complex/advanced to warrant having to use EnergyStorage.ITEM directly.

EDIT: Not long after I posted this, I found out I just had to register an empty EnergyStorage for the default type and it'd work ๐Ÿ˜… Hopefully the request for built-in support, thus requiring no additional setup, is worth keeping the issue open.

Minecraft Crash With Energy Api

I am trying to make a mod that uses this api but when I include it it makes the game crash at launch
I have those versions

org.gradle.jvmargs=-Xmx1G
org.gradle.parallel=true

minecraft_version=1.19
loader_version=0.14.19

fabric_version=0.58.0+1.19
energy_version=2.3.0

I am using the official Mappings if that makes a difference

and this is what shows in the crash report


[21:25:22] [Render thread/ERROR] (FabricLoader) Minecraft has crashed!
net.fabricmc.loader.impl.FormattedException: java.lang.NoClassDefFoundError: Could not initialize class net.minecraft.client.Minecraft
	at net.fabricmc.loader.impl.FormattedException.ofLocalized(FormattedException.java:63) ~[fabric-loader-0.14.19.jar:?]
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:464) ~[fabric-loader-0.14.19.jar:?]
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.14.19.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) [fabric-loader-0.14.19.jar:?]
	at net.fabricmc.devlaunchinjector.Main.main(Main.java:86) [dev-launch-injector-0.2.1+build.8.jar:?]
Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.minecraft.client.Minecraft
	at net.minecraft.client.main.Main.main(Main.java:207) ~[minecraft-merged-project-root-1.19-loom.mappings.1_19.layered+hash.2198-v2.jar:?]
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:462) ~[fabric-loader-0.14.19.jar:?]
	... 3 more
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.NullPointerException [in thread "Render thread"]
	at net.fabricmc.loader.impl.FabricLoaderImpl.isDevelopmentEnvironment(FabricLoaderImpl.java:402) ~[fabric-loader-0.14.19.jar:?]
	at net.minecraft.client.Minecraft.<clinit>(Minecraft.java:250) ~[minecraft-merged-project-root-1.19-loom.mappings.1_19.layered+hash.2198-v2.jar:?]
	at net.minecraft.client.main.Main.main(Main.java:198) ~[minecraft-merged-project-root-1.19-loom.mappings.1_19.layered+hash.2198-v2.jar:?]
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:462) ~[fabric-loader-0.14.19.jar:?]
	... 3 more
[21:25:22] [Client Shutdown Thread/ERROR] (Minecraft) Caught previously unhandled exception :
java.lang.NoClassDefFoundError: Could not initialize class net.minecraft.client.Minecraft
	at net.minecraft.client.main.Main$2.run(Main.java:177) ~[minecraft-merged-project-root-1.19-loom.mappings.1_19.layered+hash.2198-v2.jar:?]
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.NullPointerException [in thread "Render thread"]
	at net.fabricmc.loader.impl.FabricLoaderImpl.isDevelopmentEnvironment(FabricLoaderImpl.java:402) ~[fabric-loader-0.12.12.jar:?]
	at net.minecraft.client.Minecraft.<clinit>(Minecraft.java:250) ~[minecraft-merged-project-root-1.19-loom.mappings.1_19.layered+hash.2198-v2.jar:?]
	at net.minecraft.client.main.Main.main(Main.java:198) ~[minecraft-merged-project-root-1.19-loom.mappings.1_19.layered+hash.2198-v2.jar:?]
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:462) ~[fabric-loader-0.12.12.jar:?]
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) ~[fabric-loader-0.12.12.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) ~[fabric-loader-0.12.12.jar:?]
	at net.fabricmc.devlaunchinjector.Main.main(Main.java:86) ~[dev-launch-injector-0.2.1+build.8.jar:?]

Minecraft not registering this addon

I've put the zip file in the mods folder but its not registering and the stuff in the addon isn't appearing
i used fabric and i used this for the lifts mod
other mods i have include: Minecraft transit railway, and bits and chisels
i am using the new launcher and java 16

EnergyHolder interface getTier should have its name changed

While yarn mappings of MC use getMaterial in the tool classes to get their material, official mappings use getTier to do that, causing an error if you try to extend TieredItem (or anything that extends it like SwordItem or PickaxeItem) and try implementing EnergyHolder, which is extremely impractical. simply changing getTier() to getEnergyTier() would solve this problem.

Consider defining that the system is push-based

It is not completely clear currently whether cables should try to pull from generators, or whether generators should directly push energy into cables. The ForgeEnergy/RF systems are push-based and I think it makes more sense.

Custom Cable Type

I'm making an energy mod and ran into a cable problem. I need to create my own cables to transmit energy. Could you tell me how?

image

v0.1.2 for 1.16.5?

I am having the same issue as is described in this issue. Except I am on 1.16.5.
build.gradle

dependencies {
	// To change the versions see the gradle.properties file
	minecraft "com.mojang:minecraft:${project.minecraft_version}"
	mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
	modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
	// Energy API
	modImplementation modApi("teamreborn:energy:${project.energy_api_version}")
	// Fabric API. This is technically optional, but you probably want it anyway.
	modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

	// PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
	// You may need to force-disable transitiveness on them.
}

gradle.properties

# Fabric Properties
	# check these on https://fabricmc.net/versions.html
	minecraft_version=1.16.5
	yarn_mappings=1.16.5+build.10
	loader_version=0.12.1

	#Fabric api
	fabric_version=0.40.6+1.16
	#energy api
	energy_api_version=0.1.2

Remove "count == 1" assertions

We should remove these assertions from SimpleBatteryItem, they are not particularly useful and can cause crashes when such items are stacked accidentally (for example by megane for rendering purposes).

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.