Commit Graph
25 Commits
Author SHA1 Message Date
Richard Freimer 0f5ef4e11e Make EnergyNetwork capacity be a double (#5589)
* Support having capacity of network as a double and fix mean capacity for tube networks of multiple different tiers

* Less duplicate code for calculating capacities. Also less division then remultiplication

* Minor cleanup

* Reduce a small amount of duplicate code from universal cable
2019-08-04 20:01:27 -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
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 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 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
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
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
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
aidancbrady 69cad9dade Fixed box blacklist 2017-04-24 23:57:49 -04:00
aidancbrady 076fc3c383 Merge branch 'development' into 1.8.9
* development:
  Bump API version numbers
  Remove Lead Dust clone
  Separate vertical and horizontal textures for small transmitters

Conflicts:
	src/main/java/mekanism/api/energy/package-info.java
	src/main/java/mekanism/api/gas/package-info.java
	src/main/java/mekanism/api/infuse/package-info.java
	src/main/java/mekanism/api/lasers/package-info.java
	src/main/java/mekanism/api/package-info.java
	src/main/java/mekanism/api/reactor/package-info.java
	src/main/java/mekanism/api/recipe/package-info.java
	src/main/java/mekanism/api/transmitters/package-info.java
	src/main/java/mekanism/api/util/package-info.java
	src/main/java/mekanism/common/item/ItemOtherDust.java
	src/main/java/mekanism/common/multipart/PartThermodynamicConductor.java
	src/main/resources/assets/mekanism/textures/blocks/models/PressurizedTubeHorizontalAdvanced.png
	src/main/resources/assets/mekanism/textures/blocks/models/PressurizedTubeHorizontalBasic.png
	src/main/resources/assets/mekanism/textures/blocks/models/PressurizedTubeHorizontalElite.png
	src/main/resources/assets/mekanism/textures/blocks/models/PressurizedTubeHorizontalUltimate.png
	src/main/resources/assets/mekanism/textures/blocks/models/PressurizedTubeVerticalAdvanced.png
	src/main/resources/assets/mekanism/textures/blocks/models/PressurizedTubeVerticalBasic.png
	src/main/resources/assets/mekanism/textures/blocks/models/PressurizedTubeVerticalElite.png
	src/main/resources/assets/mekanism/textures/blocks/models/PressurizedTubeVerticalUltimate.png
	src/main/resources/assets/mekanism/textures/blocks/models/SmallTransmitterHorizontalAdvanced.png
	src/main/resources/assets/mekanism/textures/blocks/models/SmallTransmitterHorizontalBasic.png
	src/main/resources/assets/mekanism/textures/blocks/models/SmallTransmitterHorizontalElite.png
	src/main/resources/assets/mekanism/textures/blocks/models/SmallTransmitterHorizontalUltimate.png
	src/main/resources/assets/mekanism/textures/blocks/models/SmallTransmitterVerticalAdvanced.png
	src/main/resources/assets/mekanism/textures/blocks/models/SmallTransmitterVerticalBasic.png
	src/main/resources/assets/mekanism/textures/blocks/models/SmallTransmitterVerticalElite.png
	src/main/resources/assets/mekanism/textures/blocks/models/SmallTransmitterVerticalUltimate.png
	src/main/resources/assets/mekanism/textures/blocks/models/multipart/SmallTransmitterHorizontalAdvanced.png
	src/main/resources/assets/mekanism/textures/blocks/models/multipart/SmallTransmitterHorizontalBasic.png
	src/main/resources/assets/mekanism/textures/blocks/models/multipart/SmallTransmitterHorizontalElite.png
	src/main/resources/assets/mekanism/textures/blocks/models/multipart/SmallTransmitterHorizontalUltimate.png
	src/main/resources/assets/mekanism/textures/blocks/models/multipart/SmallTransmitterVerticalAdvanced.png
	src/main/resources/assets/mekanism/textures/blocks/models/multipart/SmallTransmitterVerticalBasic.png
	src/main/resources/assets/mekanism/textures/blocks/models/multipart/SmallTransmitterVerticalElite.png
	src/main/resources/assets/mekanism/textures/blocks/models/multipart/SmallTransmitterVerticalUltimate.png
2016-05-02 23:08:40 -04:00
Ben Spiers 84336ec4d1 Merge branch 'development' into 1.8.9
Huge merge with 202 conflicts, hopefully not *too* broken.
2016-03-18 04:24:19 +00:00
aidancbrady 87438dcc7f Boiler work, added heat info tab, worked on polishing heat interactions among machines 2016-02-27 13:32:48 -05:00
Ben Spiers 9b8d9d92d6 Start update to 1.8.9
Fix all references to cpw.mods.fml namespace
2016-01-14 19:22:48 +00:00
aidancbrady 42ce42aee2 Moved debug reference to MekanismAPI, fixed RC recipe 2015-06-15 12:39:48 -04:00
Ben Spiers fab95e8900 Re-organise imports.
I went for what seemed like a good level of organisation:

Java
__________
Mekanism
__________
Minecraft
Forge
FML
__________
Netty
LWJGL
__________
Other APIs
__________
Static Imports.
2014-09-03 19:00:03 +01:00
Ben Spiers 725b7463f0 Make the mod classes significantly less godlike.
Move Config variables into their own class, (in api because other stuff in API references config, may make sense to move it back to common later), and move Blocks and Items into final variables in their own classes. It looks a lot cleaner this way and my OCD can finally rest now.
2014-08-01 01:35:06 +01:00
Ben Spiers 700cc76c35 Fix a different, unrelated OreDict issue. 2014-07-13 19:58:00 +01:00
tterrag1098 321fa4ed50 Some work on GUIs, mostly sfx 2014-05-06 02:57:39 -04:00
Ben Spiers 31938e8b68 Under 1300 errors left now, started on packet/network stuffs. 2014-04-20 21:15:44 +01:00
Ben Spiers db7121454a Re-add an updated ic2, alter CC and update DepLoader. Fix more of the things.
1792 errors. A good night's work, I think.
2014-04-20 04:34:19 +01:00
Ben Spiers ab47724473 Move the directory structure around to a more conventional one and start out on the 1.7 update.
3797 errors. We have a long way to go.
2014-04-20 03:44:06 +01:00