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

Gabriel2 #32

Draft
wants to merge 57 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
17bbc58
Test Commot W
Cordoncharge83 Nov 28, 2023
7bd9b5b
Yahiewi med amine
Yahiewi Nov 28, 2023
62f261e
hello
Ihebsmai Nov 28, 2023
de6e56b
Create testjiji
Jihene556 Nov 28, 2023
82e9f8d
Merge branch 'develop' of https://github.com/Cordoncharge83/WeatherMa…
Ihebsmai Nov 28, 2023
c79dd69
Create TestOussama
Oussama1928 Nov 28, 2023
45c291a
Delete TestOussama
Oussama1928 Nov 28, 2023
e4b9c9f
haya aad
Oussama1928 Nov 28, 2023
7066617
currentWeatherMethod to determine rain/hail/snow depending on the tem…
Dec 8, 2023
a26364f
added beginning of temp
Ewwweee Dec 16, 2023
513e647
Merge branch 'Gabriel' of https://github.com/Cordoncharge83/WeatherMa…
Dec 16, 2023
87d45e7
I add a method that looks like triggerEvents() but with this new met…
Dec 16, 2023
8c55d69
some correction on the currentWeather method
Dec 16, 2023
159931d
some correction on the currentWeather method
Dec 16, 2023
79716eb
last version of currentWeather methode, i hope ;)
Dec 16, 2023
aaf8af0
Added temperature variations
Ewwweee Dec 16, 2023
751b965
Merge pull request #2 from Cordoncharge83/Gabriel
Ewwweee Dec 16, 2023
4442083
ras
Dec 16, 2023
dd7e08e
Merge branch 'develop' into currentWeatherMethod
Ewwweee Dec 16, 2023
f52591b
Merge pull request #3 from Cordoncharge83/currentWeatherMethod
Ewwweee Dec 16, 2023
3869517
pb commit
Ewwweee Dec 16, 2023
ee74431
Merge pull request #4 from Cordoncharge83/Gabriel
Ewwweee Dec 16, 2023
a25dfbc
correction
Dec 17, 2023
6d76292
correction
Dec 17, 2023
9df40b6
oussama
Oussama1928 Dec 17, 2023
7b45907
oussama
Oussama1928 Dec 17, 2023
dcb12ca
correction
Dec 17, 2023
ffb475f
Merge branch 'develop' into currentWeatherMethod
Ewwweee Dec 17, 2023
2b03271
Merge pull request #5 from Cordoncharge83/currentWeatherMethod
Ewwweee Dec 17, 2023
834bb9d
Meaa
Ewwweee Dec 17, 2023
ac5d5a0
Merge branch 'develop' into Gabriel
Ewwweee Dec 17, 2023
e2eccd4
Merge pull request #6 from Cordoncharge83/Gabriel
Ewwweee Dec 17, 2023
0693ba4
Update increaseHumidity
Ihebsmai Dec 17, 2023
e188d31
melt, freeze, evaporate
Ewwweee Dec 17, 2023
f84e742
Merge branch 'develop' into Gabriel
Ewwweee Dec 17, 2023
179cc0a
Merge pull request #7 from Cordoncharge83/Gabriel
Ewwweee Dec 17, 2023
bd26bbb
final add temp and change block according to the temp
Ewwweee Dec 17, 2023
c7fb87e
Update increaseHumidity
Ihebsmai Dec 17, 2023
14b0344
some correction on curWeather and a new command chWeather that change…
Dec 17, 2023
76838d1
Merge branch 'develop' of https://github.com/Cordoncharge83/WeatherMa…
Dec 17, 2023
40cc2e2
Update IncreasedHumidity.2
Ihebsmai Dec 17, 2023
347cba8
it is working
Dec 17, 2023
08a3afe
Merge branch 'develop' of https://github.com/Cordoncharge83/WeatherMa…
Dec 17, 2023
b7d5c35
minor correction
Dec 17, 2023
a1d412d
Update HumidityEvent
Ihebsmai Dec 17, 2023
425e318
final correction
Dec 17, 2023
94540f6
Merge branch 'develop' of https://github.com/Cordoncharge83/WeatherMa…
Dec 17, 2023
d5dd34a
ee
Ewwweee Dec 17, 2023
c0bc2d7
me
Ewwweee Dec 17, 2023
1f18ef2
Merge pull request #8 from Cordoncharge83/Gabriel2
Ewwweee Dec 17, 2023
307ee22
final correction
Dec 17, 2023
d95e996
last
Dec 17, 2023
1c9b8f0
Final
Ewwweee Dec 17, 2023
082b8b2
me
Ewwweee Dec 17, 2023
af096b5
Merge branch 'develop' into Gabriel2
Ewwweee Dec 17, 2023
abb63ae
Merge pull request #9 from Cordoncharge83/Gabriel2
Ewwweee Dec 17, 2023
2a5cff6
Final
Ewwweee Dec 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added IhebTesting
Empty file.
1 change: 1 addition & 0 deletions TestOussama
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sah sah sah

Choose a reason for hiding this comment

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

This file is not needed.

1 change: 1 addition & 0 deletions TestPush
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ijfjverzhjbtrkubt:lhbtr

Choose a reason for hiding this comment

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

This file is also not needed.

1 change: 1 addition & 0 deletions TestYahia
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TEjsfsidfjzuifnhnhjdfs

Choose a reason for hiding this comment

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

I do not believe that this file serves any useful purpose either.

3 changes: 2 additions & 1 deletion module.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"dependencies": [
{ "id": "MarkovChains", "minVersion": "1.5.0" },
{ "id": "CoreAssets", "minVersion": "2.1.0" },
{ "id": "FlowingLiquids", "minVersion": "1.2.0" }
{ "id": "FlowingLiquids", "minVersion": "1.2.0" },
{ "id": "ClimateConditions", "minVersion": "1.0.0"}
],
"isAugmentation": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

package org.terasology.weatherManager.events;

import org.terasology.gestalt.entitysystem.event.Event;

/**
* Event which is called when the weather changes to hail (frozen raindrop fall)
*/
public class HumidityDecreaseEvent implements Event {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

package org.terasology.weatherManager.events;

import org.terasology.gestalt.entitysystem.event.Event;

/**
* Event which is called when the weather changes to hail (frozen raindrop fall)
*/
public class HumidityIncreaseEvent implements Event {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

package org.terasology.weatherManager.events;

import org.terasology.gestalt.entitysystem.event.Event;

/**
* Event which is called when the weather changes to hail (frozen raindrop fall)
*/
public class TemperatureDecreaseEvent implements Event {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

package org.terasology.weatherManager.events;

import org.terasology.gestalt.entitysystem.event.Event;

/**
* Event which is called when the weather changes to hail (frozen raindrop fall)
*/
public class TemperatureIncreaseEvent implements Event {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

package org.terasology.weatherManager.events;

import org.terasology.gestalt.entitysystem.event.Event;

/**
* Event which is called when the weather changes to hail (frozen raindrop fall)
*/
public class TemperatureStagnateEvent implements Event {
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import static org.terasology.weatherManager.systems.WeatherManagerSystem.MELT_SNOW;
import static org.terasology.weatherManager.systems.WeatherManagerSystem.PLACE_SNOW;
import static org.terasology.weatherManager.systems.WeatherManagerSystem.PLACE_WATER;
import static org.terasology.weatherManager.systems.WeatherManagerSystem.FREEZE_WATER;

@RegisterSystem(RegisterMode.AUTHORITY)
public class BlockPlacingWeatherSystem extends BaseComponentSystem {
Expand Down Expand Up @@ -96,6 +97,13 @@ public void onPlaceEvent(PeriodicActionTriggeredEvent event, EntityRef worldEnti
evaporateWater(playerPos);
}
break;
case FREEZE_WATER:
for (Client currentPlayer : networkSystem.getPlayers()) {
LocationComponent locComp = currentPlayer.getEntity().getComponent(LocationComponent.class);
playerPos.set(locComp.getWorldPosition(position), RoundingMode.FLOOR);
freezeWater(playerPos);
}
break;
}
}

Expand Down Expand Up @@ -144,6 +152,15 @@ private void placeSnow(Vector3ic playerPos) {
}
}

private void freezeWater(Vector3ic playerPos) {
int x = getValueToPlaceBlock(playerPos.x());
int z = getValueToPlaceBlock(playerPos.z());
Vector3i spotToPlace = findSpot(water, x, z, playerPos.y());
if (spotToPlace != null) {
worldProvider.setBlock(spotToPlace, snow);
}
}

private void meltSnow(Vector3ic playerPos) {
int x = getValueToPlaceBlock(playerPos.x());
int z = getValueToPlaceBlock(playerPos.z());
Expand Down Expand Up @@ -175,3 +192,4 @@ private int getValueToPlaceBlock(int initial) {
return initial + rand.nextInt(SNOW_BLOCK_RANGE * 2) - SNOW_BLOCK_RANGE;
}
}

Loading