Commit Graph
2731 Commits
Author SHA1 Message Date
Xander 8bdc452c7c fix bad BlockBasicType constructor param names 2019-06-09 23:03:18 +08:00
ToMe25 20b612bae9 BlockBasic Property changes (#5484)
* Make most BasicBlocks Opaque
* Fix some Opacity Stuff
* Changed Osmium Block, Bronze Block, Steel Block and Block Basic Standard Resistance
* Changed Osmium Block Hardness
2019-06-09 20:17:21 +08:00
Richard Freimer c9a9acbb81 Simulate amount the network has room for, rather than the amount that rate it can transfer at (#5513)
* Simulate amount the network has room for, rather than the amount that rate it can transfer at. Fixes #5512

* Double check the insert to the pipe/tube with a simulation
2019-06-09 00:20:05 -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
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 55e8980b4a Add non null params to the super call on DummyWorld, add try/catch around its construction in case something else goes bad 2019-06-08 12:51:16 +08:00
Thiakil a30326ba41 Run OreDictManager recipes at lowest priority to try catch mods adding to oredict during recipe event 2019-06-08 12:50:00 +08:00
pupnewfster 33cc2033ff Fix copy paste error making removeAllRecipes for metallurgic infuser not work. Closes #5507 2019-06-07 17:24:38 -04:00
Thiakil 75d1fd7f12 add DummyWorld to use in Log crafting recipe checks 2019-06-07 21:55:44 +08:00
Thiakil 28c13c8322 Use reference map instead of EnumMap for nullable key. Closes #5504 2019-06-07 21:37:22 +08:00
Thiakil 9132aa7f32 ensure canConnectMutual checks a block is loaded. Closes #5505 2019-06-07 20:57:04 +08:00
Thiakil 68b448b62c fix incorrect ArrayList constructor usage 2019-06-04 09:56:43 +08:00
Thiakil cab79bfe06 attempt to fix race conditions with FoamFix parallel model loading, crash if fields aren't found (https://discordapp.com/channels/554379889122213888/560583846509281280/584510666883334144) 2019-06-02 11:25:52 +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 72951d2c66 Cleanup a bit of infusion code (#5493)
* Cleanup a bit of infusion code

* Empty item stacks already return 0 for their count

* Go back to not assuming null and empty tag are the same

* Reorder which order the arguments are passed to equalsWildcard for consistency with the rest of the class as it is a symmetrical method anyways
2019-05-27 12:51:50 -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 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
Thiakil 8861e52abf Finish the Recipe generics port 2019-05-22 23:00:33 +08:00
pupnewfster 99df6a3926 Fix creative gas tank actually withdrawing gas when auto eject is false and a tube is pulling out of it 2019-05-22 09:53:08 -04:00
Thiakil 253be28e8d minor nullable annotation for completeness 2019-05-22 21:45:26 +08:00
Thiakil 65ed1cf062 some turbine nullable fluidstack fixes. Closes #5485 2019-05-22 21:36:10 +08:00
pupnewfster b4572a2023 Add support for adding/removing item to gas conversions via crafttweaker
also run formatter to fix spacing/ensure import order is correct
2019-05-20 13:21:42 -04:00
ToMe25 d6bca945fe Make Refined Obsidian usable for Nether Portals (#5479)
* Make Refined Obsidian usable for Nether Portals

* Fix spacing changes

* Remove some duplicate code

* Fix a small param passing error
2019-05-20 10:07:52 -04:00
Richard Freimer 2809912037 Induction matrix optimization (#5462)
* Initial work improving performance of Induction Matrix

* Have the MatrixData handle more things internally

* Internalize more logic in MatrixData

* Cleanup readability of two methods

* Initial work at queueing energy addition/removal to the matrix. Allows for only reading/writing to the cells once per tick instead of potentially multiple times.

* Streamline the energy queuing, add some comments about it, and fix some backwards logic

* Improvements to bounds by allowing passing the simulation variable
Makes the code cleaner to read

* Better handling if something passes a negative value to add/remove

* Cleanup UpdateProtocol loopThrough method

* Minor cleanup/spacing of UpdateProtocol. Also save queued matrix energy when structure gets destroyed.

* Minor cleanup/spacing of various update protocols to improve readability

* Minorly improve readability of TileEntityMultiblock

* Remove some TODO's as it already properly handles removing/adding cells

* Fix creative energy cube output limit

* Fix having added extra parenthesis in merge

* Add basic comparator support for Induction Port

* Cleanup the variables slightly
2019-05-20 10:03:10 -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
pupnewfster 52796ff18f Only mark the chargepad as active if it has energy. Fixes #5472 2019-05-13 12:57:25 -04:00
pupnewfster ef6e17e377 Don't auto clear configuration card after pasting. Closes #5442 2019-05-13 12:47:18 -04:00
ToMe25 aa1050352b Atomic Disassembler Grass Path Block Tweak (#5471)
* implement #4464

* fix some changed language files

Just fix accidentally uploading old versions of some lang files

* implment a suggested change
2019-05-13 11:49:21 -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
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
Thiakil 91ef2a5c3d add energy storage settings category to config gui. closes #5465 2019-05-11 11:51:09 +08: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
Matej Zajo Kralik 352fddbf00 Logistical sorter - single item & muffling upgrade (#5446)
* Add single item functionality, update tooltips

* Wrap tooltips, use prefixes in lang files.

* Fix broken ItemStack sizeMode, code cleanup, gui improvements.

* LogisticalSorter muffling upgrade support

* Code style changes and cleanup, proper translation

* Fix lights on side of sorter
2019-05-10 16:48:11 -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
Thiakil 0a9c253f0f skip acceptor if it's TileEntity is null, because the tile has unloaded (reported on discord) 2019-05-06 19:51:18 +08:00
Richard Freimer e3161cf2db Miner cleanup (#5456)
* Cleanup readability of firing events

* Minor cleanup of MinerUtils

* Cleanup fallback system for MinerUtils and inline fallbackGetSilkTouch

* restore block drops backwards compatibility

* handle shulker boxes in digital miner

* use fake player in a few more event spots & add helper for getting a block's state for placement

* Change default placement so that logs face upwards
2019-05-04 15:17:12 -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
pupnewfster 82d62ef96f Fix valid fuel check for Gas Generator. Fixes #5448 2019-05-04 12:37:12 -04:00
pupnewfster da012bcf7d Only rename the dropped item if the TE is nameable. Fixes #5455 2019-05-03 14:09:22 -04:00
pupnewfster 20c426d03e Fix returning simulated IC2 power acceptance as EU instead of J. Fixes #5450 2019-05-03 11:58:24 -04:00
Richard Freimer d5db11eea3 Port #4952 by @danielzgtg Item drop compatibility (#5384)
* Port #4952 by @danielzgtg Item drop compatibility

* Make the dif slightly easier to read by reordering a couple things

* Extract some of the drop logic into super classes to make it easier to read what is going on

* Add missing Nonnull annotation

* Inline the patched harvest block method

* Remove unneeded listener for BlockBounding and fix bounding blocks being set to air not removing the full thing

* Make it easier to tell at a glance that it passes it as false for willHarvest

* give BlockMekanismSimple a better name
2019-05-02 11:16:26 -04:00
pupnewfster 36d1a9c501 Always request a render update because the rotation may have changed. Fixes #4942 2019-05-01 14:10:48 -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
ToMe25 14d60702b6 Add some more ore processing compatibility (#5445)
* Add some more Compatibility

* Implement the requested Changes.

* Merged the two Mystical Agriculture Recipe Methods

sorry wasn't seeing that line of your comment

* Added support for BoP and Forestry Gems 

Forestry: Apatite
Biomes O' Plenty: Amber, Amethyst, Malachite and Tanzanite
2019-05-01 12:42:04 -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
Richard Freimer 445556fef7 Use security utils for checking access to teleporter and quantum entangloporter (#5431)
* Use security utils for checking access to teleporter and quantum entangloporter
Also add the security tab to the corresponding gui's

* Ensure tile gets saved when security mode changes
2019-04-30 22:13:25 +08: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