Commit Graph
181 Commits
Author SHA1 Message Date
Karl Meinkopf 38ff4a5d19 Update auto-sorting in factories 2026-03-19 17:38:23 +01:00
mckuhei b032fb98a5 Handle number better in OC integration (#8211) 2024-08-22 09:52:39 +08:00
Thiakil 75ed07209f fix issues with the change-factory-type slot. Closes #5675
- Container Slot will only accept valid items
- Factory item inputs explicitly rejected
- More efficient recipe type getter (should fix nbt related fails)
- Output slot changed to an output
2019-12-01 13:57:04 +08:00
Richard Freimer d9b58b592f Code cleanup (#5582)
* IntelliJ code analysis Verbose or redundant code constructs

* Move some more I18n calls to using LangUtils to have less deprecation warnings

* Minor cleanup

* Make some inner classes static that do not depend on information about the containing class

* Fix mismatched lang key entries

* Address review comments
2019-07-27 11:39:58 -04:00
pupnewfster b97f3c433f Change TileEntityBasicBlock#canSetFacing and setFacing to use EnumFacing instead of an int 2019-07-08 11:49:17 -04:00
Thiakil ac70101edf Merge PR Optimized Component Ejector. Closes #5537
Additional: half tickDelay in ejector component since we're only ejecting on a timer now
2019-07-06 12:22:32 +08:00
Richard Freimer b49e45a03d Void gases from machines on load if invalid, as discussed in #5502 (#5519) 2019-06-12 17:55:36 -04:00
pupnewfster 180183fcbd Fix purification chamber being able to accept wrong gases directly from IGasItems #5502
Also improved handling overall for how IGasItem is treated by the GasConversionHandler, so that we better obey the gastank we are going to try and insert into
2019-06-08 11:28:38 -04:00
Richard Freimer 4dd1e81c27 Use sendToAllTracking for update packets (#5496)
* Don't check Y height for sending update packets. Seems to fix compat with cubic chunks #5262

* First pass transitioning from using sendToReceivers to using built in forge stuff

* Make code cleaner to read with helper methods

* Fix accidental extra code from a local branch issue I had

* Further improve readability

* Rename method

* shortcut if player not in same dimension & use EMP.server for the reference
2019-06-08 16:51:37 +08:00
Richard Freimer eb2de11b72 Check ItemStack NBT for comparison in more places (#5491)
* Check NBT in a bunch more item comparision checks
* Fix Gas conversion checking stack size when comparing itemstacks
2019-05-27 12:08:09 +08:00
Richard Freimer 7438ad4d9e Use Recipe Generics in more places, and some general readability improvements (#5490)
* Use Recipe generics in more places

* Use Recipe generics in even more places

* Use Recipe generics for IMCHandler

* Turns out I was wrong about the old enum names being used

* More Recipe generics for getting recipes

* Pass MachineType as constructor parameter up the chain

* Minor readability cleanup

* Use method to get block name while in external classes

* Improve readability of some references to internal enum classes

* More missed recipe generics to reduce number of casts

* Make sure to check NBT for the recipes, and switch back to for loops from streams
2019-05-25 10:42:21 -04:00
Richard Freimer c8d2fbbac8 Add comparator support for a large number of blocks (#5474)
* Add comparator support to a lot of various blocks. Closes #5447

* Add comparator support for various generator blocks

* Cleanup some old calculations not using the new utils method
2019-05-13 15:50:02 -04:00
Richard Freimer 80b07bc4b3 Code cleanup (#5468)
* remove direct guava predicates from BlockStateMachine

* cleanup blockstatebasic

* fix a large number of e.printStacktrace calls, narrow ComputerIntegration exception signature

* fix simple todos, remove invalid todos, unify some duplicate rendering code

* use a generic method to get around unchecked warning

* remove some redundant uses of hasCapability

* experimental OptionalCapability class. not in use yet

* nullable checks/annotations & remove duplicate field controlType in factory TE

* Inline various redundant variables

* Remove unused list

* Cleanup BlockStateGenerator

* Replace string constants with pointers to the proper mod id constant

* As 9.7.5 breaks backwards compat API wise for the DynamicNetwork this is as good a time as any to remove this deprecated method

* Use two argument constructor instead of appending a ':' inbetween

* Convert other BlockState type classes to using suppliers for tile entity creation
2019-05-13 11:43:42 -04:00
Richard Freimer 0d4b50908f Formatting and code readability cleanup (#5467)
* First pass reformatting code to be more readable (common still not done)

* Replace google common collect calls with Java calls where possible

* Remove a bunch of unnecessary parenthesis leaving clarifying ones

* Add some missing @Nonnull annotations

* Fix checking wrong type

* Remove unnecessary continue/return statements and simplify comparision check

* Pass exception instead of directly printing stack trace

* Work on cleaning up common, through config so far

* Work on cleaning up common, through integration so far

* Work on cleaning up common, through network so far

* Work on cleaning up common, through tier so far

* Remove empty constructors that get created by default anyways

* Work on cleaning up common, through transmitters so far

* Work on cleaning up common, through utils so far

* Finish cleaning up spacing for common
2019-05-11 14:13:24 -04:00
Xander 4c4e88dca5 Improve Itemstack equality checks (#5451)
* fix bad stacking check for Digital Miner. #5449

* map to forge's stack stackability check so caps are accounted for

* check nbt when taking a defined item

* fix bad reference equality check for empty

* Switch sorting to using our stackable method

* Fix bad stack check for robit #5454

* Improve stack compare for robit smelting
2019-05-04 12:59:47 -04:00
Matej Zajo Kralik 36aa81dcf4 Add support for configuring machine energy storage. (#5418)
* Add support for configurable machines storage.

* Make factories and tooltips use machine storage from config. Renaming.

- Renamed config instance members, to reduce redundancy
- Made machines get Storage and Usage from MachineType
- Other miscellaneous cosmetic changes on the matter

* Update ItemBlockMachine.java

* Tweak factories to always have storage needed to run all processes.

* Add storage config to PacketConfigSync.
2019-05-01 13:15:55 -04:00
Richard Freimer 075673fc56 Improve Compat with TOP (#5427)
* Make TOP display full capacity of fluid and gas networks. Also fix some capabilities not returning the proper. TOP Gas integration now displays the gas color as well.

* Ensure no repercussions for getting MechanicalPipe's TOP network tanks

* Ensure no repercussions for getting PressurizedTube's TOP network tanks

* Display hydrogen with a slightly incorrect color so TOP renders properly

* Fix dynamic valve having item handler always disabled instead of just when multiblock is not made

* Fix a few itemhandlers that should not be disabled for side == null TOP compat

* Always expose networks buffer instead of local buffer if there is a network
2019-04-30 22:12:43 +08:00
pupnewfster dccc32db85 Check NBT for factory sorting. Fixes #5436 2019-04-27 14:55:34 -04:00
pupnewfster ba89f446f9 Actually obey the update cache param, and use the more advanced helper method in Container as well 2019-04-26 14:39:40 -04:00
Xander 0dba7cb584 use getters & setters for InfuseStorage (#5416)
* use getters & setters for InfuseStorage to prevent type/amount discrepancies

* Fix a few checks when reading from network/NBT

* Fix some spacing I screwed up by accident

* fix metallurgic infuser gui texture for dark gauge
2019-04-20 13:38:41 +08:00
Richard Freimer f3fdf00064 Factory recipe check (#5399)
* Fixes null pointer on no recipe found #5392
Compare the recipe against the cache

* Add a few missing secondary input checks

* Don't set the cached recipe when only checking if an item can be inserted
2019-04-15 10:10:16 -04:00
Richard Freimer da71637053 Port ToMe25's PR for sawing factories (#5383)
* Port remainder of #5327 implementing #5236 sawing factories

* Add missing blockstate files for sawing factories

* Inline helper method

* Revert a bit of minor formatting changes to make dif easier to read

* remove redundant mcmeta for sawing front textures

* de-dupe sawmill factory textures (left+right are the same)
2019-04-12 10:22:16 -04:00
pupnewfster d6a0d989e0 Fix JEI error from a circular enum dependency 2019-04-10 21:26:18 -04:00
Richard Freimer 9d98ef575d Port config rewrite (#5378)
Port Config system, Remove some unused code, Refactored various Tier enums out into their own package
2019-04-11 07:18:59 +08:00
Richard Freimer a3ae18703b Port factory insertion (#5346)
* Port dfd5252cd and improve factory auto sort performance
* Fix comparing against wrong item causing being unable to insert into factory at all
* Only auto sort into a slot if the recipe output will stack with the current output
* Make factory slot insertion obey changes to checking output items as well
2019-04-08 10:59:29 -06:00
pupnewfster 66d0bca37c Remove usage of TUBE_CONNECTION_CAPABILITY, in favor of using toggleable capabilities 2019-04-02 12:50:14 -07:00
pupnewfster cf8ef8ad5f Move configuration capability checking from CapabilityUtils to TileEntityComponentConfig 2019-04-02 12:50:14 -07:00
pupnewfster 1f5353bd04 Obey the configuration tabs of various machines 2019-04-02 12:50:14 -07:00
temp1011 ff9c32ff6b cleanup stackutils (#127)
* second round of cleanup

* hash stacks in a better way (cherry picked from https://github.com/mekanism-mod/Mekanism/commit/54e80b305726204ffb620d3518f66539a0d7e937)

* add some comments

* rename method for clarity

* don't crash on null registry name
2019-03-27 17:08:36 -04:00
pupnewfster 21017efc68 Don't reference main class from API package
https://github.com/mekanism-mod/Mekanism/commit/7c50d1e7cc3dd915979304b46e77a36068ac457d
2019-03-21 10:53:28 -04:00
Dave Smith 2c6d666b89 Improve performance by reducing unnecessary lighting updates (#32)
Introduce 5 second delay on changing ambient lighting when a machine shuts off. IActiveState now has a concept of wasActiveRecently to enable rendering/block updates to have some wiggle room.
2019-03-14 12:38:16 -06:00
Dave Smith 4381be10ea Dss mekanica rename (#50)
Introduce mekanica rename
2019-03-12 12:23:20 -06:00
Dave Smith c92069f716 Fix #5209; now using FluidStacks everywhere, including all more efficient encodings over network 2019-03-11 14:00:40 -06:00
Dave Smith e0b7ea62a4 The Great Reformat; moving to google-java-style w/ 4 space indent and 120 column line wrap 2019-03-09 22:47:13 -07:00
Richard Freimer 083c764b7b Dedupe a bunch of code (#27)
* Initial work on deduplicating code for tiles
* Dedupe Energy Cube and Induction Matrix Container
* Dedupe Robit Gui
* Move robit gui code into its own subpackage
* Dedupe DM Filter guis
* Dedupe fluid storage containers
* Move filter guis into one package
* Dedupe filter select
* Dedupe Some Transport Filters
* Further Dedupe Some Text Filter Code
* Dedupe Miner ItemStack/Material GUI Filters
* Move gui filter implementations into a sub package
* Dedupe Gui Transport ItemStack/Material Filters
* Fix copy pasting wrong buttons
* Dedupe Gui Type filter some
* Dedupe Gui Filter code some
* Dedupe Gui Oredictionificator Filter
* Dedupe generator containers
* Dedupe Mekanism Tools, pickaxe, shovel, paxel
* Dedupe code in TileEntityDigitalMiner
2019-03-09 20:13:52 -07:00
Richard Freimer 7902163645 Fix spam of Null Pointers 2019-03-07 22:19:16 -07:00
Dave Smith 95ca29fa19 Squashed commit of the following:
commit 0d4dc5991e572793134c0c1af8bb35db528071ad
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 19:25:28 2019 -0500

    IntelliJ inspections, Unused Import

commit c757d3236b6304b1d3295ad392b88677bccf3003
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 19:09:24 2019 -0500

    IntelliJ inspections, Constant conditions & exceptions

commit c63a821ef9fc705941052a876cc1ef950471912e
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 17:41:31 2019 -0500

    IntelliJ inspections, @NotNull/@Nullable problems

commit 506bbfd3241336082b17e5d47f8cec496666dcff
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 16:50:46 2019 -0500

    IntelliJ inspections, Unused label

commit bad10c2428346b5feb1816e4a78d7cc2bc1259f0
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 15:33:54 2019 -0500

    IntelliJ inspections, Unused assignment

commit bfe633afbfb6380d0f5ee2e8ab14f8981a455681
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 15:32:02 2019 -0500

    IntelliJ inspections, 'equals()' between objects of inconvertible types

commit 6d179f8639fad1a7c3fa01467c003a8fd309da09
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 15:29:28 2019 -0500

    IntelliJ inspections, Unused import

commit c21f1cfa5566308237dc8bddb8b79908e272a637
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 15:25:41 2019 -0500

    IntelliJ inspections, Unused import

commit e5d9e03af582c7315b057861b8f0019e46157dee
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 15:23:10 2019 -0500

    IntelliJ inspections, Redundant 'throws' clause

commit 1c589ba5740411a5595e9fda177696670bc7b7df
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 15:21:07 2019 -0500

    IntelliJ inspections, Static member referenced by instance variable

commit 6c17e9ca7fb22a0e285337133659e826f3bfdfee
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 15:20:02 2019 -0500

    IntelliJ inspections, Catch block may ignore exception

commit 42b3cd788ceb7d6ce657d582bbbd8345a2ec5676
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 15:16:29 2019 -0500

    IntelliJ inspections, Unnecessary label on 'break' statement

commit f6abc3c66f3aca147edb274720cdb94bff568b0b
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 15:15:29 2019 -0500

    IntelliJ inspections, Too weak variable type leads to unnecessary cast

commit 6356d1fea8d55907ae1c7b011223fbbc07236c1f
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 15:11:17 2019 -0500

    IntelliJ inspections, Redundant type cast

commit 559c1a2ff523fd7e23f3750d5c801af73876f1d0
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 15:04:45 2019 -0500

    IntelliJ inspections, Redundant type arguments

commit ae816ec2a79cf4c8fee776db651a54f68c1dacaa
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 15:01:27 2019 -0500

    IntelliJ inspections, Redundant Collection operation

commit 1da69b8baff922b98a32163c7d5f90aa77a6a8bc
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 15:00:55 2019 -0500

    IntelliJ inspections, Redundant array creation

commit 7e3ef81a3597c596d2206c93442e950ac9183de0
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 15:00:11 2019 -0500

    IntelliJ inspections, Condition is covered by further condition

commit f298bbb9f31ecbe935ef6cbf98b56951434a05f8
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 14:58:10 2019 -0500

    IntelliJ inspections, Redundant 'Collection.addAll()' call

commit ce715c5cd724c4dc71ff2cb53e5bc12f16289f12
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 14:56:56 2019 -0500

    IntelliJ inspections, 'Collection.toArray()' call style

commit 0bde4b0eb23ac5d8f40a410ed55315e4a422a30c
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 14:55:40 2019 -0500

    IntelliJ inspections, Calls to 'Arrays.asList()' with too few arguments

commit 6d06d11dcf9c077ed6b216a0bbd61434b10fc610
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 14:52:26 2019 -0500

    IntelliJ inspections, Pointless arithmetic expression

commit 6501d725af1eda5127489f77fd723396002b29b2
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 14:42:32 2019 -0500

    IntelliJ inspections, Anonymous type can be replaced with lambda

commit 85341ae5df9d63fb0ad7281c260c77d064adf0c2
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 14:41:40 2019 -0500

    IntelliJ inspections, Explicit type can be replaced with <>

commit 7e2feae7189b92cb513499aed113d4a2634622c6
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 14:38:47 2019 -0500

    IntelliJ inspections, Unnecessary 'null' check before method call

commit 2c75a38fe9a969f832cd5777f4fad81ef47d037b
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 14:37:33 2019 -0500

    IntelliJ inspections, 'switch' statement with too few branches

commit 2e2aff57f7910aef5a68f41a1918e2c8a98509ec
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 14:34:50 2019 -0500

    IntelliJ inspections, Simplifiable conditional statement

commit 243f6a975f8b3da5e70a5c1a116db2aedd10900e
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 14:33:09 2019 -0500

    IntelliJ inspections, Duplicate condition in 'if' statement

commit a80c67fc30b737990e7805a8741dce120232badc
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 14:32:17 2019 -0500

    IntelliJ inspections, Unnecessary semicolon

commit 5a7220ee574c9d38d71db07e4fa995a56fee1eed
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 14:31:58 2019 -0500

    IntelliJ inspections, Unnecessary enum/interface modifier

commit f3a66f4462033d2f446c2961a1ad8e9cfde3ed36
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 14:30:36 2019 -0500

    IntelliJ inspections, Unnecessary conversion to String

commit 1662540be864db4669cd80c8c46a9b35be202b62
Author: pupnewfster <[email protected]>
Date:   Thu Mar 7 14:29:33 2019 -0500

    IntelliJ inspections, C styled array declaration
2019-03-07 21:53:20 -07:00
Dave Smith c78ae6dd1d Fix #15; completely overhaul the sound system to mirror Minecraft usage 2019-03-06 13:53:59 -07:00
Thiakil da0497b8f1 try to avoid creating an nbt tag where its only going to be read 2019-02-26 06:43:19 -07:00
Dave Smith 8d3f8df49c Updating to 14.23.5.2808; naming fixes where necessary 2019-02-24 12:21:48 -07:00
Xander f2a14a2831 account for the fact that factories have more than one process when caching 2018-04-25 21:59:10 +08:00
Xander b42a6b7ff9 cache factory recipe to avoid continuous lookup 2018-04-25 20:33:05 +08:00
Xander c481c70c6c Save infusion storage and gas tanks in machines. Fixes #4819 2018-03-25 12:22:56 +08:00
Aidan bed953f0f0 Merge branch '1.12' into nonnull-network 2017-11-16 12:09:46 -05:00
Xander Victory a86539f1a0 add gas handler methods for retrieving the tank infos regardless of side. 2017-11-10 15:23:48 +08:00
Xander Victory 2411a1be4d change ArrayList<Object> to a non null list implementation for network data 2017-11-08 15:08:51 +08:00
Joseph C. Sible 6cafac7166 Make combining factories work again 2017-10-02 21:19:00 -04:00
aidancbrady b295d65456 Fixed machine energy usage bug. May be worth porting back to 1.11 2017-08-16 22:55:51 -04:00
Tom Elfring 34e81bb65d Remove ~350 unsave casts 2017-08-05 19:48:12 +02:00
Tom Elfring babbe59cab Cleanup
Removed unused imports
Add/remove all methods used for arrays
Removed manual array copy
2017-08-05 18:12:45 +02:00