Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/fix happiness #905

Merged
merged 8 commits into from
Apr 30, 2017
Merged

Hotfix/fix happiness #905

merged 8 commits into from
Apr 30, 2017

Conversation

Raycoms
Copy link
Contributor

@Raycoms Raycoms commented Apr 30, 2017

Fix crash with happiness 1

Changes proposed in this pull request:

Review please

@marchermans
Copy link
Contributor

Company Agrees.

@marchermans marchermans self-requested a review April 30, 2017 19:06
@@ -187,18 +187,26 @@ public void requestMaterialsIfRequired()
@SuppressWarnings("squid:S135")
private void requestMaterials()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR The Cyclomatic Complexity of this method "requestMaterials" is 16 which is greater than 15 authorized. rule

@MinecoloniesSonar
Copy link

SonarQube analysis reported 46 issues

  • MAJOR 5 major
  • MINOR 41 minor

Watch the comments in this conversation to review them.

Top 10 extra issues

Note: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:

  1. MAJOR CitizenData.java#L23: class "CitizenData" has 43 methods, which is greater than the 35 authorized. Split it into smaller classes. rule
  2. MAJOR AbstractEntityAIStructure.java#L57: Split this class into smaller and more specialized ones to reduce its dependencies on other classes from 29 to the maximum authorized 20 or less. rule
  3. MAJOR AbstractEntityAIStructure.java#L728: Refactor this method to reduce its Cognitive Complexity from 32 to the 20 allowed. rule
  4. MAJOR EntityAIStructureBuilder.java#L50: Split this class into smaller and more specialized ones to reduce its dependencies on other classes from 29 to the maximum authorized 20 or less. rule
  5. MINOR blockout: Add a 'package-info.java' file to document the 'blockout' package rule
  6. MINOR controls: Add a 'package-info.java' file to document the 'controls' package rule
  7. MINOR views: Add a 'package-info.java' file to document the 'views' package rule
  8. MINOR blocks: Add a 'package-info.java' file to document the 'blocks' package rule
  9. MINOR gui: Add a 'package-info.java' file to document the 'gui' package rule
  10. MINOR render: Add a 'package-info.java' file to document the 'render' package rule

Copy link
Contributor

@marchermans marchermans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good.
Company Aproves. Again.

@Raycoms Raycoms merged commit b7673d7 into release/1.10 Apr 30, 2017
@Raycoms Raycoms deleted the hotfix/fix-happiness branch April 30, 2017 19:10
Raycoms added a commit that referenced this pull request May 4, 2017
* save happiness and don't devidi through 0

* add constants

* check if citizenData != null first

* fix assets

* another hotfix, new citizen cause crash if happiness 1

* don't double request resources

* Fix prboblem with incorrect amount of entities requesting
marvin-bitterlich pushed a commit that referenced this pull request May 7, 2017
* merge guard improvements

* add that but have to remove imports

* Fix merge problems.

* merge builder changes

* Fix merge conflicts

* fix some things in placement handler, have to wait for 1.11 capabilities

* fix recipe handler

* merge saturation

* Hotfix/fix happiness (#905)

* save happiness and don't devidi through 0

* add constants

* check if citizenData != null first

* fix assets

* another hotfix, new citizen cause crash if happiness 1

* don't double request resources

* Fix prboblem with incorrect amount of entities requesting

* Fix crash with full inventory on food pickup

* fi xnullpointer

* delay warehouse more

* remove unnecessary import

* fix merge issues

* optimize imports

* merge hotfix
marvin-bitterlich pushed a commit that referenced this pull request May 8, 2017
* merge guard improvements

* add that but have to remove imports

* Fix merge problems.

* merge builder changes

* Fix merge conflicts

* fix some things in placement handler, have to wait for 1.11 capabilities

* fix recipe handler

* merge saturation

* Hotfix/fix happiness (#905)

* save happiness and don't devidi through 0

* add constants

* check if citizenData != null first

* fix assets

* another hotfix, new citizen cause crash if happiness 1

* don't double request resources

* Fix prboblem with incorrect amount of entities requesting

* Fix crash with full inventory on food pickup

* fi xnullpointer

* delay warehouse more

* remove unnecessary import

* fix merge issues

* optimize imports

* merge hotfix

* fix crashes and exceptions

* correct predicate chaining and fix flintNSteel

* Fix bug where things don't get dumped correctly

* Update InventoryUtils.java

* make marvin happy
Raycoms added a commit that referenced this pull request May 9, 2017
* merge guard improvements

* add that but have to remove imports

* Fix merge problems.

* merge builder changes

* Fix merge conflicts

* fix some things in placement handler, have to wait for 1.11 capabilities

* fix recipe handler

* merge saturation

* Hotfix/fix happiness (#905)

* save happiness and don't devidi through 0

* add constants

* check if citizenData != null first

* fix assets

* another hotfix, new citizen cause crash if happiness 1

* don't double request resources

* Fix prboblem with incorrect amount of entities requesting

* Fix crash with full inventory on food pickup

* fi xnullpointer

* delay warehouse more

* remove unnecessary import

* fix merge issues

* optimize imports

* merge hotfix

* fix crashes and exceptions

* correct predicate chaining and fix flintNSteel

* Fix bug where things don't get dumped correctly

* Update InventoryUtils.java

* make marvin happy

* fix citizenData null crash

* fix name

* improve creative tab

* Fix up nullpointer exception

* merge builder and lj positioning

* merge sonar fix

* fix merge bugs

* change creativetab
marvin-bitterlich pushed a commit that referenced this pull request May 11, 2017
* merge guard improvements

* add that but have to remove imports

* Fix merge problems.

* merge builder changes

* Fix merge conflicts

* fix some things in placement handler, have to wait for 1.11 capabilities

* fix recipe handler

* merge saturation

* Hotfix/fix happiness (#905)

* save happiness and don't devidi through 0

* add constants

* check if citizenData != null first

* fix assets

* another hotfix, new citizen cause crash if happiness 1

* don't double request resources

* Fix prboblem with incorrect amount of entities requesting

* Fix crash with full inventory on food pickup

* fi xnullpointer

* delay warehouse more

* remove unnecessary import

* fix merge issues

* optimize imports

* merge hotfix

* fix crashes and exceptions

* correct predicate chaining and fix flintNSteel

* Fix bug where things don't get dumped correctly

* Update InventoryUtils.java

* make marvin happy

* fix citizenData null crash

* fix name

* improve creative tab

* Fix up nullpointer exception

* merge builder and lj positioning

* merge sonar fix

* fix merge bugs

* change creativetab

* fix bug with dman dumping wrong
marvin-bitterlich added a commit that referenced this pull request May 11, 2017
* merge guard improvements

* add that but have to remove imports

* Fix merge problems.

* merge builder changes

* Fix merge conflicts

* fix some things in placement handler, have to wait for 1.11 capabilities

* fix recipe handler

* merge saturation

* Hotfix/fix happiness (#905)

* save happiness and don't devidi through 0

* add constants

* check if citizenData != null first

* fix assets

* another hotfix, new citizen cause crash if happiness 1

* don't double request resources

* Fix prboblem with incorrect amount of entities requesting

* Fix crash with full inventory on food pickup

* fi xnullpointer

* delay warehouse more

* remove unnecessary import

* fix merge issues

* optimize imports

* merge hotfix

* fix crashes and exceptions

* correct predicate chaining and fix flintNSteel

* Fix bug where things don't get dumped correctly

* Update InventoryUtils.java

* make marvin happy

* fix citizenData null crash

* fix name

* improve creative tab

* Fix up nullpointer exception

* merge builder and lj positioning

* merge sonar fix

* fix merge bugs

* change creativetab

* fix bug with dman dumping wrong
marvin-bitterlich added a commit that referenced this pull request May 25, 2017
* Create suppressing.MD (#876)

* Finishing Base Merge. (#883)

* Finishing Base Merge. (#886)

* Port/1.11/cap inventory interaction (#818)

* Updated the Inventory system to capabilities in 1.11

Signed-off-by: OrionOnline <oriondevelopment@outlook.com>

* Add CheckStyle and PMD as plugins to the build.gradle. (#784)

* Adding/Updating Style Data.

Added:
  * pmd.xml. Holds the PMD Configuration from the PMD Module of the SonarQube Server.

Updated:
  * checkstyle.xml. Holds the additional style checks SonarQube performs.

* Added PMD and Checkstyle gradle plugins.

Updated:
  * build.gradle to add PMD and Checkstyle Gradle-plugins.
  * CheckStyle.xml to reflect the Minecolonies coding style.

* Added PMD and Checkstyle gradle plugins.

Updated:
  * build.gradle to add PMD and Checkstyle Gradle-plugins.
  * CheckStyle.xml to reflect the Minecolonies coding style.

* Some small reformatting to trigger a new build.

* Shrink maximal line length to 180

* Switch to TeamCity (#792)

* Switch to TeamCity

Add support for TeamCity Branch and Build number, having Travis as a fallback

* Update build.gradle

* trigger a new build

* Some last merging fixes - and Formatting of course.

Signed-off-by: OrionOnline <oriondevelopment@outlook.com>

* Some last merging fixes - and Formatting of course.

Signed-off-by: OrionOnline <oriondevelopment@outlook.com>

* Small minor changes to make the base change work.

Signed-off-by: OrionOnline <oriondevelopment@outlook.com>

* Merge Fix/cap based interaction (#800)

* Fix the TransferItemsRequestMessage.

* Fix NPE when tools are searched in inventories with empty slots.

* Fix possible NPE in search for tools.

* Some NPE Fixes and Formatting.

* Removed getFirstFillableSlotInItemHandler and other related methods.

* Changed the way Sonar replacement is handled.
It is run once now at the end of a build.

* Fixing an Item Duplication bug when items are transferred.

Signed-off-by: OrionOnline <oriondevelopment@outlook.com>

* Fixing build error that are introduced by merging version/1.11 into the PR branch.

Signed-off-by: OrionOnline <oriondevelopment@outlook.com>

* Update build.properties

* Adding Changelog generation. (#896)

Signed-off-by: OrionOnline <oriondevelopment@outlook.com>

* Update build.properties (#898)

* Port to 1.11 guard builder (#934)

* merge guard improvements

* add that but have to remove imports

* Fix merge problems.

* merge builder changes

* Fix merge conflicts

* fix some things in placement handler, have to wait for 1.11 capabilities

* fix recipe handler

* merge saturation

* Hotfix/fix happiness (#905)

* save happiness and don't devidi through 0

* add constants

* check if citizenData != null first

* fix assets

* another hotfix, new citizen cause crash if happiness 1

* don't double request resources

* Fix prboblem with incorrect amount of entities requesting

* Fix crash with full inventory on food pickup

* fi xnullpointer

* delay warehouse more

* remove unnecessary import

* fix merge issues

* optimize imports

* merge hotfix

* 1.11 - Hotfix for the DMan (#945)

* Hotfix for the DMan not behaving properly cause it is not getting reported about the insertion result

* Fixing the compile error.

* Fix/crashes expceptions (#951)

* merge guard improvements

* add that but have to remove imports

* Fix merge problems.

* merge builder changes

* Fix merge conflicts

* fix some things in placement handler, have to wait for 1.11 capabilities

* fix recipe handler

* merge saturation

* Hotfix/fix happiness (#905)

* save happiness and don't devidi through 0

* add constants

* check if citizenData != null first

* fix assets

* another hotfix, new citizen cause crash if happiness 1

* don't double request resources

* Fix prboblem with incorrect amount of entities requesting

* Fix crash with full inventory on food pickup

* fi xnullpointer

* delay warehouse more

* remove unnecessary import

* fix merge issues

* optimize imports

* merge hotfix

* fix crashes and exceptions

* correct predicate chaining and fix flintNSteel

* Fix bug where things don't get dumped correctly

* Update InventoryUtils.java

* make marvin happy

* Fix/crashes expceptions (#954)

* merge guard improvements

* add that but have to remove imports

* Fix merge problems.

* merge builder changes

* Fix merge conflicts

* fix some things in placement handler, have to wait for 1.11 capabilities

* fix recipe handler

* merge saturation

* Hotfix/fix happiness (#905)

* save happiness and don't devidi through 0

* add constants

* check if citizenData != null first

* fix assets

* another hotfix, new citizen cause crash if happiness 1

* don't double request resources

* Fix prboblem with incorrect amount of entities requesting

* Fix crash with full inventory on food pickup

* fi xnullpointer

* delay warehouse more

* remove unnecessary import

* fix merge issues

* optimize imports

* merge hotfix

* fix crashes and exceptions

* correct predicate chaining and fix flintNSteel

* Fix bug where things don't get dumped correctly

* Update InventoryUtils.java

* make marvin happy

* fix citizenData null crash

* fix name

* improve creative tab

* Fix up nullpointer exception

* merge builder and lj positioning

* merge sonar fix

* fix merge bugs

* change creativetab

* bump version

* Bug/1.11 remove some warnings (#965)

* Suppress some warning

* remove more warnings

* Fix warnings for PlacementHandlers

* remove more warnings + sonar fixes

* fixes sonar

* more sonar

* Add package info

* Fix packages info

* Fix/crashes expceptions (#970) (#971)

* merge guard improvements

* add that but have to remove imports

* Fix merge problems.

* merge builder changes

* Fix merge conflicts

* fix some things in placement handler, have to wait for 1.11 capabilities

* fix recipe handler

* merge saturation

* Hotfix/fix happiness (#905)

* save happiness and don't devidi through 0

* add constants

* check if citizenData != null first

* fix assets

* another hotfix, new citizen cause crash if happiness 1

* don't double request resources

* Fix prboblem with incorrect amount of entities requesting

* Fix crash with full inventory on food pickup

* fi xnullpointer

* delay warehouse more

* remove unnecessary import

* fix merge issues

* optimize imports

* merge hotfix

* fix crashes and exceptions

* correct predicate chaining and fix flintNSteel

* Fix bug where things don't get dumped correctly

* Update InventoryUtils.java

* make marvin happy

* fix citizenData null crash

* fix name

* improve creative tab

* Fix up nullpointer exception

* merge builder and lj positioning

* merge sonar fix

* fix merge bugs

* change creativetab

* fix bug with dman dumping wrong

* fix tarzan climbin trees (#975)

Uhm I meant the lumberjack

* remove not release hut block (#972)

* Hotfix/low stats[port to 1.11] (#977)

* remove not release hut block

* fix bug where citizen start all up with 1

* 1.11 d-man delivery fix (#980)

* Fix forceTransferStack return value
Fix some java doc

* Fix javadoc

* Fix happiness calculation about housing

* Transfer for real instead of simulating

* Fix/builder duping (#984)

* remove not release hut block

* fix bug where citizen start all up with 1

* Fix problem with builder requesting double

* don't request solid placeholder if world is solid

* only teleport employed citizen

* recalculate after reload

* balance happiness depending on guards

* Sonar/warnings (#992)

* Fix Blockers

* first draft for translation constants

* fix formatting

* fix some constants and other issues

* formatting

* fix some ternaries

* sonar fixes

* add suppress

* add doc files

* reorder

* wtf java

* last fixes

* remove unused

* Stop crashing with other world events (#997)

* Feature/1.11 better chat (#994)

* Suppress some warning

* Add worker name to the message when chest is full

* remove warnings

* Builder say when then start/end a job

* Shorter chat version for colony owner

* D-man only say that the chest if full when ihe cannot swap
D-man say whose chest is full

* Change dman saying

* Compare itemstack properly

* Different message when pick axe requested level is greater than hut level

* D-man hold the item he will deliver or the item he did gather
Fix javadoc

* EntityCitizen does not know about BuildingFarmer now

* remove most of the Jobs from EnityCitizen

* dman hold the correct item

* Feature/builder pickup to 1.11 (#1000)

* make builder pickup things

extract from lj to interact

* sonar fix cast to double

* remove unused import

* remove double guard code

* unused import

* Update doc

* Refactor even smaller

* missing package keyword (#1008)

* Refactor/1.11 workorders (#1012)

* Suppress some warning

* Add worker name to the message when chest is full

* remove more warnings

* Fix warnings for PlacementHandlers

* Builder say when then start a job

* WorkOrderBuildHut extends WorkOrderBuildDecoration
instead of
WorkOrderBuildDecoration extends WorkOrderBuild

* revert WorkOrderBuildHut class to WorkOrderBuild

* Work Manager does not need to know about Construction tape and WorkOrderBuildDecoration

* JobBuilder class does not need to know about WorkOrderBuild

* remove duplicated code

* fix

* Fix javadoc

* sonar

* Fix sonar issue and suppress sonar warnings

* fix sonar issues

* sanar fixes

* add package info

* Sone suppress

* bug #1014 fix crash when a colony does not have any owner (#1016)

* Fix when colony does not have an owner

* remove logging

* Bugfix/#758 concurrency issue (#1025)

* Centralize the copying of the needed items list, and make it explicitly clear a copy is happening

* Remove duplicated methods, and unnecessary casts

* Change CopyOnWriteArrayList to ConcurrentLinkedQueue for current warehouse tasks.

The list is being modified often, and being treated like a queue. The ConcurrentLinkedQueue should be a better data structure for the situation and be more performant.

* Dismount entities before trying to teleport citizens (#1034)

* Put item icon in the builder resource tab (#1033)

* Check if citizen is jobless before triggering job death achievement (#1037)

* Port to 1.11 (waypoints, colony border, sounds, warehouse restriction) (#1032)

* merge changes to 1.11 for waypoints

* add dman sounds and basics

* first merge fixes

* also restrict to 1 warehouse per colony

* some last merge problems

* Fix javadoc error

* Add check for invalid line width (#1035)

* Feature/1.11 efficient dman (#1017)

* gather from the chest which have just been delivered

* Deliver mor ethan one stack at a time depending of the deliveryman hut's level

* * in BuildingBuilder override neededForWorker instead of using the custom requiresResourceForBuilding method
* Add container to building event when the builder did not have to build it

* register block in AbstractBuilding instead of adding container only, so that extending class could register any type of block, not only chests

* remove checkInWareHouseForFood method in favour of polymorphisme

* remove duplicated code

* javadoc

* language constant

* revert back some changes

* Used NBT Editor to replace stone brick monster eggs with stone brick (#1041)

* Feature/1.11 efficient dman 2 (#1043)

* gather from the chest which have just been delivered

* Deliver mor ethan one stack at a time depending of the deliveryman hut's level

* * in BuildingBuilder override neededForWorker instead of using the custom requiresResourceForBuilding method
* Add container to building event when the builder did not have to build it

* register block in AbstractBuilding instead of adding container only, so that extending class could register any type of block, not only chests

* remove checkInWareHouseForFood method in favour of polymorphisme

* remove duplicated code

* javadoc

* language constant

* revert back some changes

* Huts need food

* annotation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants