Commit Graph
371 Commits
Author SHA1 Message Date
Thiakil 8de341d3c4 Give Entangloporter its own config for fluid/gas buffer instead of using ultimate tank's output config. #5558 2019-07-08 18:54:13 +08:00
pupnewfster 33957bde59 Fix a tiny bit of math broken by #5496 2019-06-08 10:22:00 -04:00
pupnewfster de9450a863 Fix API version number as #5496 had not been merged for the version it was bumping API to 2019-06-08 09:15:20 -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
Thiakil 68b448b62c fix incorrect ArrayList constructor usage 2019-06-04 09:56:43 +08:00
Richard Freimer d19f1cd7eb Transporter performance improvements (#5488)
* Improve performance of predicted insert. Don't copy stacks nearly as often

* Cache what stack is in the slots and update comments

* Cleanup up pathfinder code some

* Clean up a bit more mainly TileComponentEjector

* Fix crash caused by an earlier commit

* Minor cleanup

* Minor cleanup

* Slightly clean up TileEntityBin and fix creative bin auto eject lowering item count

* Partially cleanup getpaths, and prep work for better handling of AcceptorData with mulitple TransitResponses

* Scratch previous attempted idea of combining responses

* Use EnumMap instead of HashMap for keeping track of side data for Ejector and prep for an eventual change to TransitResponse of inserting into more than one slot at a time if the stack would be best split among multiple

* Change some more HashMaps to EnumMaps

* Make it easier to read component ejector for gas and fluids

* Inline getStacksToDest so that it can bail even earlier in cases when destination is full

* Don't create a copy of the stack if it won't be inserted AND also fix having broken inserting across multiple slots

* Replace a bunch of other HashMap instances with EnumMap where possible

* Make a couple sets more generic

* Use Int2ObjectMap for int based cache & tidy clamping

* ensure EnumMap doesnt throw NPE

* FastUtil map changes
2019-05-28 09:31:33 -04: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 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
pupnewfster 40620ec23b Fix loading gas tank's with null gas stored. Fixes #5470 2019-05-12 12:39:39 -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 31b06c0ab0 Keybindings optimisations (#5389)
* Shift keybinds to a builder pattern to avoid the array length issue, use Bitsets for the boolean arrays, remove unused and redundant constructor

* Use proper lang keys for KeyBinding creation instead of pre-localising

* WIP tidy keyhandler tick method

* more key handler tidying

* tweak handler to use translation placeholders so languages can reconfigure the foo: bar display

* add todo

* move tank, bow & flamethrower keys to use string format placeholders

* fix NPE on configurator changes

* nullable annotations

* prefix keybind lang keys with modid

* make datafixers into their own thing

* make a datafixer base class

* remove keybind fixer, options datafixers dont work

* Revert "remove keybind fixer, options datafixers dont work"

This reverts commit c57f6c1b05ed6b26e7fb7774bada4ca53f6c655e.

* datafix the keybinds to the new format

* documentation

* Remove unused import and extra dash from runClient args
2019-05-10 16:58:57 -04:00
Xander ad47302b26 Cleanup DynamicNetwork API (#5460)
* Change unused map (values) to use a set

* bump api version

* make DynamicNetwork fields non public and weaker type

* remove overhead of a set in CME avoidance

* Minor cleaning
2019-05-10 11:56:22 -04:00
Richard Freimer b3663a37a9 Emitting logic overhaul (#5422)
* First pass improving performance of EnergyNetwork emitting
Only sends power once per tick per accept now. Lots of comments of design included so that I have a backup of my thought process/solutions if I run into some blocker.

* Optimized implementation slightly, still more to be done

* Cleanup some comments

* Move send energy to acceptor logic to CableUtils
Replace old emit logic in CableUtils with using the newer logic

* Inline getConnections to slightly cut down on number of operations ran

* Fix a couple bugs with targets that have multiple sides
Also improve performance reducing frequency at amountPerChanged needs to be ran

* Improve performance of CableUtils.emit by faking we have one 6 sided target as opposed to having 6 one sided targets

* Allow simulating insertion into the EnergyAcceptorWrapper for IC2

* Fix using wrong value for total acceptor count when acceptors have multiple sides

* Use an EnumMap instead of a HashMap for the Target

* First pass converting gas and fluid network emission to target system

* Improve general fluid and gas emitting using the utility method
Change a couple things to using Sets rather than lists for emitting so that we can ensure each side is only done once.

* Document and cleanup method/variable names of target classes

* Start deduplicating emitting code into a EmitUtils file
Logic for Gas and Fluid emitting fully generic now

* Partially extract how we keep track of the split to make it easier to deduplicate the common code

* Start moving shifting needed to given to the targets themselves

* Use generics to deduplicate a lot of the remaining duplication in the new emitting code

* Fix having broke energy emitting and also further cleanup some code

* Half the number of loops the HeatNetwork does onUpdate

* Fix potentially divide by zero errors

* Deprecate and remove implementations of getAcceptors as it is no longer needed

* Never round up from doubles for sending power stops energy networks going negative.

* Fix more spots where we were accidentally rounding upwards/clamping improperly for energy

* Cleanup impl to use less memory and adjust better as sending if
the possible amount changed/should be adjusted
Also removed the need for a specific IntegerTypeTarget intermediary class

* Cleanup the docs of some of the changed things

* Given tickEmit is private now we already know it is only being called serverside

* Improve documentation slightly and rename a method to be more accurate

* Remove limit on IC2 given it uses doubles as well now

* Rename amountPer to amountPerTarget
2019-04-30 10:25:23 -04:00
Xander bbcea85fc4 Respect NONE connection mode for Pipe Connections (#5387)
* prevent Out of Bounds exception in factory ItemMeshDefinition

* prevent Out of Bounds error in item stack display name

* Respect NONE connection between pipes. Fixes #4781

* prevent fluid/gas pipes from connecting if their contents arent the same (part 1)

* prevent some case of incorrect network merges that would convert/void a fluid/gas

* Add a way to check if a network is compatible with an buffer
Used for checking the orphan's buffer against the external network

* rename some generic type variables for readability

* introduce BUFFER generic type variable

* Fix missing null check causing new pipes not being able to be added to a network

* More checks for when there is an invalid factory

* bump api version & use a constant for all

* add default method to not break binary compat

* Refresh if a connection exists if a transmitter failed to combine two networks
Fallback to the network's buffer as if we have not saved any data yet the TE's buffer may still be null

* Add a way to get the pipes buffer falling back to the network, rather than doing it from the same method. This ensures that there is no accidental leakage where the count of the buffer matters

* Return a null buffer for pressurized tube buffer if the stack is empty

* Allow merging of networks when they are able to connect again
Visuals still need a minor update to sync the type it should be rendering

* Update network visuals when networks merge

* allow unconnected sides to have their mode set - except logistical transporters which already used that function, they only can un-NONE their unconnected sides
2019-04-20 13:38:14 +08:00
Richard Freimer ec7144b493 Port 8de559998 ensure some edge cases with GasTank stack having 0 amount can't happen (#5361) 2019-04-08 14:26:00 -06:00
Richard Freimer df67af26ac When creating fluids from gases set their alpha value to no transparency (#5353)
* When creating fluids from gases set their alpha value to no transparency
 Fixes https://github.com/mekanica/mekanica/issues/157

* Remove unneeded bitshifting
2019-04-07 19:16:53 -04:00
Richard Freimer 0b060ead4b Box blacklist (#5345)
* Ported a bunch of cardboard box blacklist commits

* Added a couple wrapper methods to make it a little easier to read
2019-04-05 19:24:42 -04:00
pupnewfster 66d0bca37c Remove usage of TUBE_CONNECTION_CAPABILITY, in favor of using toggleable capabilities 2019-04-02 12:50:14 -07:00
Aidan 934788e0e7 Transit request overhaul (#135)
* Fix a pretty glaring issue in Pos3D equality checks
* TransitRequest/TransitResponse overhaul. Items can now be pulled from multiple slots at once by Logistical Transporter and Logistical Sorter. getTopStacks() is now buildInventoryMap() and is more comprehensive of a total inventory. Note this is entirely untested and may have some issues to work out!
* Cache hash code of HashedItem
* Remove ISidedInventory/IInventory implementations
2019-03-29 08:00:18 -06: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 045358436f Overhaul solar generation to be more realistic; helps with #46 2019-03-18 22:11:27 -06:00
pupnewfster 0018ac6548 Fix various Deprecated method calls 2019-03-17 21:30:36 -06:00
pupnewfster f65682a402 Added a few new constructors to OreGas to make creating them easier 2019-03-15 09:12:14 -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
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
pupnewfster a148f71358 Easier changing of gas colors 2019-03-07 12:10:39 -07:00
Dave Smith 9475b27785 Fix issue #4; when updating function calls for latest forge in 8d3f8df49c, API was inadvertently broken 2019-02-26 13:17:56 -07:00
Dave Smith 8d3f8df49c Updating to 14.23.5.2808; naming fixes where necessary 2019-02-24 12:21:48 -07:00
Thiakil 9b15e379b9 Complain to log if orphan transmitter clash & make sure Orphan pathfinder doesnt load chunks 2018-06-15 17:58:39 +08:00
Thiakil 2657f7b957 Clean up uncommitted transmitter network changes. Might fix networks failing! 2018-04-26 17:43:48 +08:00
Xander 1415288bcf fix String#toLowerCase() calls to toLowerCase(Locale.ROOT). Fixes #4957 2018-03-24 17:09:44 +08:00
Xander Victory 17ce49434f Relax Gas registry phase requirements so that BC integration works. Now just logs if it was registered without a valid texture entry. Fixes #4827 2017-11-27 09:23:34 +08:00
Xander 41727312bf use built in world method to check if block is loaded 2017-11-19 17:39:06 +08:00
aidancbrady 4ef4f8614d Cleanup, bump version to 9.4.2, bump MC version to 1.12.2 2017-11-16 12:34:04 -05:00
Aidan 09e8e9aed7 Merge pull request #4801 from thiakil/wrench-compat
Wrench compat
2017-11-16 12:11:48 -05:00
Aidan 801676b965 Merge pull request #4803 from thiakil/api-update
Api update
2017-11-16 12:10:57 -05:00
Aidan bed953f0f0 Merge branch '1.12' into nonnull-network 2017-11-16 12:09:46 -05:00
Xander 12a87b798a Missed GasTankInfo interface in commit 2017-11-11 12:09:13 +08:00
Xander Victory 8bbef9544c add default method to gas interface to maintain binary compat 2017-11-10 15:28:14 +08: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 cbe9cdc3f2 implement tinted ore gasses, fix GuiGauge to render the tinted gas 2017-11-09 12:08:41 +08:00
Xander 58c80cf150 fix localisation of colours in configurator mode changing 2017-11-08 21:58:25 +08:00
Xander Victory 532744f598 basic tint support for gasses 2017-11-08 16:59:45 +08:00
Xander Victory fdbeef9cb2 change late sprite getting to try the registered icon name 2017-11-08 15:30:53 +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
Xander Victory 2d9a02b29e null safety for silly mods that somehow register gasses after the texture stitch 2017-11-08 11:49:03 +08:00
Xander Victory 9d70d06454 check loader state instead of relying on boolean 2017-11-08 11:49:02 +08:00
Xander Victory f4bbb5b35c Ensure gasses are registered in preinit or init (prevent textures not being set) 2017-11-08 11:49:00 +08:00
Xander Victory 64b2e421f7 add recipe adding methods to the API, and a handler to get the internal class. 2017-11-08 11:48:59 +08:00
Xander Victory 26a28c13db add (String, ResourceLocation) constructor to Gas 2017-11-08 11:48:58 +08:00