• Recently Browsing

    No registered users viewing this page.

  • Posts

    • Okay. You should first implement the cooldown timer without thinking about the HUD representation. If it needs to cool down for X ticks you should count down from X to 0 (or up from 0 to X, doesn't really matter). Then when drawing the HUD you represent that as a ratio (e.g. if 50 ticks have passed and you want to count down for 500 ticks that's 50/500 == 0.1 == 10%). You then multiply your total bar size (in the HUD) by that ratio, e.g. if your bar should be 180 wide you multiply 180 * 0.1 in this case => your bar is then 18 pixels in size at this point. If you want a smooth animation here you should also incorporate the partial ticks value. In your case using it is very simple, simply add (or subtract, if you are animating the bar from full to 0) it to your counter value before multiplying by the ratio (since you are changing your actual value by just 1 every tick you can use this simple formula, otherwise it would have to be actualValue = lastTickValue + (currentValue - lastTickValue) * partialTicks).
    • ---- Minecraft Crash Report ---- WARNING: coremods are present:   llibrary (llibrary-core-1.0.11-1.12.2.jar)   iceandfire (iceandfire-1.8.4.jar)   ForgelinPlugin (Forgelin-1.8.4.jar) Contact their authors BEFORE contacting forge // Don't do that. Time: 4/2/20 9:49 AM Description: There was a severe problem during mod loading that has caused the game to fail net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Redstone Flux (redstoneflux) Caused by: java.lang.RuntimeException:  RedstoneFlux has detected that the following OLD API classes from CoFHLib are being repacked!     cofh.api.energy.ItemEnergyContainer, loaded from: buildcraft-7.1.23.jar     cofh.api.energy.EnergyStorage, loaded from: buildcraft-7.1.23.jar     cofh.api.energy.TileEnergyHandler, loaded from: buildcraft-7.1.23.jar     cofh.api.energy.IEnergyConnection, loaded from: buildcraft-7.1.23.jar     cofh.api.energy.IEnergyProvider, loaded from: buildcraft-7.1.23.jar     cofh.api.energy.IEnergyHandler, loaded from: buildcraft-7.1.23.jar     cofh.api.energy.IEnergyStorage, loaded from: buildcraft-7.1.23.jar     cofh.api.energy.IEnergyContainerItem, loaded from: buildcraft-7.1.23.jar     cofh.api.energy.IEnergyReceiver, loaded from: buildcraft-7.1.23.jar To prevent this crash, add "-Dcofh.rf.crashOnOldAPI=false" to your command line arguments.     at cofh.redstoneflux.internal.OldAPIChecker.check(OldAPIChecker.java:64)     at cofh.redstoneflux.RedstoneFlux.preInit(RedstoneFlux.java:18)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:637)     at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)     at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)     at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)     at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)     at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)     at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)     at com.google.common.eventbus.EventBus.post(EventBus.java:217)     at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219)     at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)     at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)     at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)     at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)     at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)     at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)     at com.google.common.eventbus.EventBus.post(EventBus.java:217)     at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136)     at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:629)     at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252)     at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:467)     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378)     at net.minecraft.client.main.Main.main(SourceFile:123)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     at java.lang.reflect.Method.invoke(Method.java:497)     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details:     Minecraft Version: 1.12.2     Operating System: Windows 10 (amd64) version 10.0     Java Version: 1.8.0_51, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 393944112 bytes (375 MB) / 1073741824 bytes (1024 MB) up to 2147483648 bytes (2048 MB)     JVM Flags: 8 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0     FML: MCP 9.42 Powered by Forge 14.23.5.2847 35 mods loaded, 35 mods active     States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored     | State | ID                 | Version      | Source                                    | Signature                                |     |:----- |:------------------ |:------------ |:----------------------------------------- |:---------------------------------------- |     | LCH   | minecraft          | 1.12.2       | minecraft.jar                             | None                                     |     | LCH   | mcp                | 9.42         | minecraft.jar                             | None                                     |     | LCH   | FML                | 8.0.99.99    | forge-1.12.2-14.23.5.2847.jar             | None                                     |     | LCH   | forge              | 14.23.5.2847 | forge-1.12.2-14.23.5.2847.jar             | None                                     |     | LCH   | baubles            | 1.5.2        | Baubles-1.12-1.5.2.jar                    | None                                     |     | LCH   | bdlib              | 1.14.3.12    | bdlib-1.14.3.12-mc1.12.2.jar              | None                                     |     | LCH   | buildinggadgets    | 2.7.4        | BuildingGadgets-2.7.4.jar                 | None                                     |     | LCH   | clumps             | 3.1.2        | Clumps-3.1.2.jar                          | None                                     |     | LCE   | redstoneflux       | 2.1.0        | RedstoneFlux-1.12-2.1.0.6-universal.jar   | 8a6abf2cb9e141b866580d369ba6548732eff25f |     | LC    | cofhcore           | 4.6.3        | CoFHCore-1.12.2-4.6.3.27-universal.jar    | None                                     |     | LC    | cofhworld          | 1.3.1        | CoFHWorld-1.12.2-1.3.1.7-universal.jar    | 8a6abf2cb9e141b866580d369ba6548732eff25f |     | LC    | craftingstation    | @VERSION@    | craftingstation-0.1.7b.jar                | None                                     |     | LC    | ebwizardry         | 4.2.7        | ElectroblobsWizardry-4.2.7-MC1.12.2.jar   | None                                     |     | LC    | enchdesc           | 1.1.19       | EnchantmentDescriptions-1.12.2-1.1.19.jar | d476d1b22b218a10d845928d1665d45fce301b27 |     | LC    | fastfurnace        | 1.3.1        | FastFurnace-1.12.2-1.3.1.jar              | None                                     |     | LC    | jei                | 4.15.0.291   | jei_1.12.2-4.15.0.291.jar                 | None                                     |     | LC    | forestry           | 5.8.2.409    | forestry_1.12.2-5.8.2.409.jar             | None                                     |     | LC    | forgelin           | 1.8.4        | Forgelin-1.8.4.jar                        | None                                     |     | LC    | gendustry          | 1.6.5.8      | gendustry-1.6.5.8-mc1.12.2.jar            | None                                     |     | LC    | gendustryjei       | 1.0.2        | gendustryjei-1.0.2.jar                    | None                                     |     | LC    | llibrary           | 1.7.19       | llibrary-1.7.19-1.12.2.jar                | b9f30a813bee3b9dd5652c460310cfcd54f6b7ec |     | LC    | iceandfire         | 1.8.4        | iceandfire-1.8.4.jar                      | None                                     |     | LC    | mcjtylib_ng        | 3.5.4        | mcjtylib-1.12-3.5.4.jar                   | None                                     |     | LC    | megaloot           | 0.2.40       | megaloot-1.12.2-0.2.40.jar                | None                                     |     | LC    | oreexcavation      | 1.4.143      | OreExcavation-1.4.143.jar                 | None                                     |     | LC    | orespawn           | 3.3.1        | OreSpawn-1.12-3.3.1.172.jar               | d476d1b22b218a10d845928d1665d45fce301b27 |     | LC    | refinedstorage     | 1.6.15       | refinedstorage-1.6.15.jar                 | 57893d5b90a7336e8c63fe1c1e1ce472c3d59578 |     | LC    | rftools            | 7.72         | rftools-1.12-7.72.jar                     | None                                     |     | LC    | rftoolsdim         | 5.71         | rftoolsdim-1.12-5.71.jar                  | None                                     |     | LC    | silentlib          | 3.0.13       | SilentLib-1.12.2-3.0.13+167.jar           | None                                     |     | LC    | silentgear         | 0.6.5        | SilentGear-1.12.2-0.6.7+76.jar            | None                                     |     | LC    | beneath            | 1.6.0        | The Beneath-1.12.2-1.6.0.jar              | 220f10d3a93b3ff5fbaa7434cc629d863d6751b9 |     | LC    | travellersbackpack | 1.0.20.20    | TravellersBackpack-1.12.2-1.0.20.20.jar   | None                                     |     | LC    | waystones          | 4.1.0        | Waystones_1.12.2-4.1.0.jar                | None                                     |     | LC    | xnet               | 1.8.2        | xnet-1.12-1.8.2.jar                       | None                                     |     Loaded coremods (and transformers):  llibrary (llibrary-core-1.0.11-1.12.2.jar)   net.ilexiconn.llibrary.server.core.plugin.LLibraryTransformer   net.ilexiconn.llibrary.server.core.patcher.LLibraryRuntimePatcher iceandfire (iceandfire-1.8.4.jar)   com.github.alexthe666.iceandfire.patcher.IceAndFireRuntimePatcher ForgelinPlugin (Forgelin-1.8.4.jar)        List of loaded APIs:          * Baubles|API (1.4.0.2) from Baubles-1.12-1.5.2.jar         * cofhapi (2.5.0) from CoFHCore-1.12.2-4.6.3.27-universal.jar         * ComputerCraft|API (1.79) from ComputerCraft1.79.jar         * ComputerCraft|API|FileSystem (1.79) from ComputerCraft1.79.jar         * ComputerCraft|API|Lua (1.79) from ComputerCraft1.79.jar         * ComputerCraft|API|Media (1.79) from ComputerCraft1.79.jar         * ComputerCraft|API|Peripheral (1.79) from ComputerCraft1.79.jar         * ComputerCraft|API|Permissions (1.79) from ComputerCraft1.79.jar         * ComputerCraft|API|Redstone (1.79) from ComputerCraft1.79.jar         * ComputerCraft|API|Turtle (1.79) from ComputerCraft1.79.jar         * ForestryAPI|apiculture (5.0.0) from forestry_1.12.2-5.8.2.409.jar         * ForestryAPI|arboriculture (4.3.0) from forestry_1.12.2-5.8.2.409.jar         * ForestryAPI|book (5.8.1) from forestry_1.12.2-5.8.2.409.jar         * ForestryAPI|circuits (3.1.0) from forestry_1.12.2-5.8.2.409.jar         * ForestryAPI|climate (5.0.0) from forestry_1.12.2-5.8.2.409.jar         * ForestryAPI|core (5.7.0) from forestry_1.12.2-5.8.2.409.jar         * ForestryAPI|farming (5.8.0) from forestry_1.12.2-5.8.2.409.jar         * ForestryAPI|food (1.1.0) from forestry_1.12.2-5.8.2.409.jar         * ForestryAPI|fuels (3.0.0) from forestry_1.12.2-5.8.2.409.jar         * ForestryAPI|genetics (5.7.0) from forestry_1.12.2-5.8.2.409.jar         * ForestryAPI|gui (5.8.0) from forestry_1.12.2-5.8.2.409.jar         * ForestryAPI|hives (4.1.0) from forestry_1.12.2-5.8.2.409.jar         * ForestryAPI|lepidopterology (1.4.0) from forestry_1.12.2-5.8.2.409.jar         * ForestryAPI|mail (3.1.0) from forestry_1.12.2-5.8.2.409.jar         * ForestryAPI|modules (5.7.0) from forestry_1.12.2-5.8.2.409.jar         * ForestryAPI|multiblock (3.0.0) from forestry_1.12.2-5.8.2.409.jar         * ForestryAPI|recipes (5.4.0) from forestry_1.12.2-5.8.2.409.jar         * ForestryAPI|storage (5.0.0) from forestry_1.12.2-5.8.2.409.jar         * ForestryAPI|world (2.1.0) from forestry_1.12.2-5.8.2.409.jar         * gendustryAPI (2.3.0) from gendustry-1.6.5.8-mc1.12.2.jar         * JustEnoughItemsAPI (4.13.0) from jei_1.12.2-4.15.0.291.jar         * redstonefluxapi (2.1.0) from RedstoneFlux-1.12-2.1.0.6-universal.jar
    • I've seen some ways on how to go about doing this for extended sword reach (checks entities in surrounding AABB, checks if the length of the vector from the player's eye to an entity is within said range, checks the angle, then hits the entity). I found an example of this being applied in the Aether mod's source code (here) which with just a few changes works well in 1.15.2. The thing is, I was trying to think of another ways to make this work. For instance, I'd like to use the player's eyesight vector and ray trace from there to a certain length (say, 8 blocks' distance) and check if the ray hits an entity's bounding box. This way, I wouldn't need to check all the surrounding entities. Endermen use the canEntityBeSeen method, and that one draws a vector and checks that it doesn't collide with any blocks. The problem is, this method already knows the position of both the enderman in question and the player. One option was to use a method found in the Minecraft class, but of course, that would only work client-side.   Also, by the way, is there any replacement for onEntitySwing on 1.15.2? I've been using onItemRightClick for now to test, but I want to check for entities using it (so a skeleton, for instance, can use it as a sword). Which method would I have to override?
    • Thank you so much!! This worked super well! I read a bunch of both of your other replies on other topics and they really help.   Also, in my case do I still need the "has item recipe" condition? Emeralds don't really have a crafting recipe, if that's what that condition does.   Here is my code for others who want to add this same feature: { "parent": "minecraft:recipes/root", "requirements": [ [ "has_item" ] ], "criteria": { "has_item": { "trigger": "minecraft:inventory_changed", "conditions": { "items": [ { "item": "minecraft:emerald" } ] } } }, "rewards": { "recipes": [ "standardmaterials:emerald_sword", "standardmaterials:emerald_pickaxe", "standardmaterials:emerald_axe", "standardmaterials:emerald_shovel", "standardmaterials:emerald_hoe" ] } }  
  • Topics

  • Who's Online (See full list)