Commit Graph
119 Commits
Author SHA1 Message Date
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
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 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
pupnewfster cf8ef8ad5f Move configuration capability checking from CapabilityUtils to TileEntityComponentConfig 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 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 8d3f8df49c Updating to 14.23.5.2808; naming fixes where necessary 2019-02-24 12:21:48 -07:00
Xander 0ab57d0ffd assign chunkloading tickets to the security tile's owner, where available 2018-03-24 13:40:09 +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
aidancbrady b40cd5c20e Merge branch '1.11' into 1.12
* 1.11:
  add a couple of comments [no-ci]
  add Anchor Upgrade to Entangleporter
  Store Quantum Entangleporter frequency (name and public/private only) in the itemstack when dismantled. Displayed in the sneak key info tooltip.
  Increase Entangleporter frequency to be able to store as much as ultimate tiers can transmit.
  static field access to Class access

Conflicts:
	src/main/java/mekanism/common/frequency/Frequency.java
	src/main/java/mekanism/common/tile/TileEntityQuantumEntangloporter.java
2017-08-05 19:43:27 -07:00
Xander 5ef8cf367c add a couple of comments [no-ci] 2017-08-06 09:34:58 +08: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
Tom Elfring b72d6efab3 Java 7 and 8 cleanup
Diamond operator <>
Lambdas and method references
2017-08-05 17:50:38 +02:00
Tom Elfring 69e163abd9 Merge remote-tracking branch 'upstream/1.11' into 1.12_firstpass 2017-07-26 19:38:35 +02:00
Chris Anderson ba83e8d357 Fix issue with entities not sending energy on sides correctly 2017-07-24 20:28:07 -06:00
Chris Anderson 62eeb4d548 Merge branch '1.11' of github.com:aidancbrady/Mekanism into issue-4560
# Conflicts:
#	src/main/java/mekanism/common/tile/component/TileComponentConfig.java
2017-07-24 19:11:02 -06:00
Chris Anderson e3de87ff45 Fixes #4560 2017-07-24 19:05:20 -06:00
aidancbrady 77e46985ac Fix crash 2017-07-23 20:58:01 -07:00
aidancbrady 7db697213c Minor cleanup 2017-07-23 18:02:49 -07:00
Richard Carter bc3274825a Some performance-oriented refactoring of TileComponentConfig
Add new type "SideConfig" which is observable, this could come in handy
later.
Add hasSideForData method in componentConfig, which is much more
efficient than calling getSidesForData().contains.
Refactor duplicate calls to getConfig into single instances. getConfig
is a nontrivial method.
2017-07-23 20:14:34 -04:00
Tom Elfring df68b1e36a Merge remote-tracking branch 'upstream/1.11' into 1.12_firstpass 2017-07-23 13:56:41 +02:00
Xander a5e816dddc Add util method to get Username from UUID, without nulls 2017-07-21 20:35:41 +08:00
Tom Elfring a13ce7910d Update mappings to 20170616 2017-06-16 20:26:39 +02:00
aidancbrady ba3c37b6c3 Updated Forge 2017-05-24 09:56:21 -07:00
aidancbrady 3f9cd82c5e Add missing side check 2017-05-09 12:16:49 -04:00
aidancbrady 21c49c1643 Advanced item handing, adding inventory-searching to basic item ejection- no longer will items get jammed
Also, fixed transmitter tooltips
2017-04-28 14:54:26 -04:00
aidancbrady 808f0cdf8a More refactoring, gave Rotary Condensentrator and Electrolytic Separator sound effects. Need to fix bugs 2017-04-27 22:51:44 -04:00
aidancbrady 2c161ed4ce Better machine hierarchy to avoid repetition 2017-04-27 22:00:59 -04:00
aidancbrady 1c31d9c2d3 Fix minor NBT glitch 2017-04-26 12:44:38 -04:00
aidancbrady 6f2b84e547 Totally refactor frequencies to use UUIDs instead of player usernames 2017-04-24 14:15:43 -04:00
aidancbrady a9d438c962 Fixed Quantum Entangloporters 2017-04-22 14:36:04 -04:00
aidancbrady b97b7184c1 Completely refactor inventory management to allow IItemHandler support. Likely many bugs to fix, but it's a start 2017-04-19 16:16:09 -04:00
aidancbrady c9cbb405d4 More API fixes 2017-04-13 16:15:26 -04:00
aidancbrady 4733420eee API improvements 2017-04-12 20:23:16 -04:00
aidancbrady 6eb8e59f3c Fix more ItemStack issues 2017-04-03 20:12:02 -04:00
aidancbrady 01ab160ff9 Transition from null stacks to ItemStack.EMPTY 2017-03-29 01:08:36 -04:00
aidancbrady 6a42eb64e3 Update to 1.11.2. Untested, still using outdated MCMP 2017-03-25 20:35:26 -04:00
aidancbrady 98f57257e9 Fix #4192 2017-02-11 16:19:48 -05:00
aidancbrady c510ce7d8c Merge branch '1.7.10' into 1.10
* 1.7.10:
  Added version-based handling, bump version to 9.1.1
  Bump up Dynamic Tank max storage, fixed Factory container issue
  Add config option to disable block protections
  Fixed chunk churning issue with frames
  Restrict Thermal Evaporation Plant output to needed
  Going back to MIT, thanks to the concerns of @bshelden and @asiekierka

Conflicts:
	build.properties
	src/main/java/mekanism/api/MekanismConfig.java
	src/main/java/mekanism/common/CommonProxy.java
	src/main/java/mekanism/common/Mekanism.java
	src/main/java/mekanism/common/ThreadGetData.java
	src/main/java/mekanism/common/block/BlockBounding.java
	src/main/java/mekanism/common/item/ItemBlockEnergyCube.java
	src/main/java/mekanism/common/item/ItemBlockGasTank.java
	src/main/java/mekanism/common/item/ItemBlockMachine.java
	src/main/java/mekanism/common/network/PacketConfigSync.java
	src/main/java/mekanism/generators/common/MekanismGenerators.java
	src/main/java/mekanism/generators/common/item/ItemBlockGenerator.java
	src/main/java/mekanism/tools/common/MekanismTools.java
2016-11-27 13:33:57 -05:00
aidancbrady 2d04343683 Fixed CTM crash, fixed Chunk Loader CPU usage, added new BioFuel recipes 2016-09-05 15:07:22 -04:00
Clienthax 03191f198b Add config option to disable block protections 2016-08-15 02:58:15 +01:00
aidancbrady 8e1ee9a581 Chunk Loader Upgrades. They work with Digital Miners and automatically adjust to their mining radius. 2016-08-10 15:37:29 -04:00
aidancbrady 4958c40380 Fixed Tesla crash, added chunk loading system to allow for ease of future additions 2016-08-08 16:56:32 -04:00
aidancbrady ecba0eaa87 Merge branch 'development' into 1.9.4
* development:
  Fixed side output issue

Conflicts:
	src/main/java/mekanism/common/tile/component/TileComponentEjector.java
2016-07-15 15:13:28 -04:00
aidancbrady ca52ba521b Fixed side output issue 2016-07-15 00:06:15 -04:00
aidancbrady e6da7fdc9c Update to latest Forge, use Capability standards. Need to port to new fluid system 2016-06-23 16:34:27 -04:00
aidancbrady a5f4457677 Merge branch 'development' into 1.9.4
* development:
  Update pt_BR.lang
  Allow shift-right clicking machines with upgrades
  Fixed NBT reference losses
  Fixed Thermal Evaporation Controller computer integration
  Add config option for transmitter alloy upgrades
  Fixed transmitter crash, fixed entangloporter frequency issue, fixed PRC muffling upgrades

Conflicts:
	src/main/java/mekanism/client/render/RenderPartTransmitter.java
	src/main/java/mekanism/common/FluidNetwork.java
	src/main/java/mekanism/common/item/ItemAlloy.java
	src/main/java/mekanism/common/item/ItemUpgrade.java
	src/main/java/mekanism/common/util/PipeUtils.java
2016-06-15 20:41:32 -04:00
aidancbrady 6340bb3cdc Fixed NBT reference losses 2016-06-10 11:30:03 -04:00
aidancbrady fa24e0e780 Isolate MDK, update build script. Gonna try to get this pushing to the dev server 2016-05-28 19:14:18 -07:00