Skip to content

Commit

Permalink
Merge branch 'develop' into crouchingMode
Browse files Browse the repository at this point in the history
  • Loading branch information
oniatus authored Nov 5, 2017
2 parents 79fd7fa + 248167f commit 1c14c6d
Show file tree
Hide file tree
Showing 378 changed files with 13,759 additions and 4,442 deletions.
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ For more information about playing like hot keys or server hosting see the [dedi
We have gone to great lengths to make developing and modding Terasology as easy as possible. We use Gradle to automate just about everything. As long as you have a [Java 8 SDK](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) running from source is a two step process:

* Clone the code or download a zip
* Run `gradlew game` (on Unixes, including Mac OS X, run `./gradlew` everywhere you see `gradlew`) in the root of the project directory
* Run `gradlew game` (on Unixes, including macOS, run `./gradlew` everywhere you see `gradlew`) in the root of the project directory

That's really it! If you want the project set up in IntelliJ (our favored IDE) you run `gradlew idea` then load the generated project config. Then you get a bunch of run configurations and other stuff for free!

Expand Down
5 changes: 5 additions & 0 deletions config/gradle/common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ repositories {
url "http://artifactory.terasology.org/artifactory/virtual-repo-live"
}
}

// snowplow for telemetry
maven {
url "http://maven.snplow.com/releases"
}
}

dependencies {
Expand Down
13 changes: 10 additions & 3 deletions docs/Credits.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ Contributors
[Rez 'zproc' N.](https://github.com/zproc),
[Christoph "Chrisk" Köbke](https://github.com/ChrisKoebke),
[Maternal](http://forum.terasology.org/members/maternal.810/),
[Trekmarvel](https://github.com/Trekmarvel)
* Design Team:
[Trekmarvel](https://github.com/Trekmarvel),
[quaternius](https://github.com/quaternius) ([Twitter](https://twitter.com/quaternius))
* Design Team:
[Rasmus 'Cervator' Praestholm](https://github.com/Cervator),
[Overdhose](https://github.com/Overdhose),
[Cynthia 'woodspeople' Kurtz](http://forum.terasology.org/members/woodspeople.34/),
Expand Down Expand Up @@ -199,7 +200,13 @@ Contributors
[Vizaxo](https://github.com/Vizaxo),
[theobisproject](https://github.com/theobisproject),
[omomthings](https://github.com/omomthings),
[njd5475](https://github.com/njd5475)
[njd5475](https://github.com/njd5475),
[Owl-A](https://github.com/Owl-A),
[niksoc](https://github.com/niksoc),
[TheFlash98](https://github.com/TheFlash98),
[Dane99](https://github.com/Dane99),
[Derpthemeus](https://github.com/Derpthemeus),
[Aaron Harris](https://github.com/aaron-harris)
* GUI Team:
[Anton "small-jeeper" Kireev](https://github.com/small-jeeper),
[miniME89](https://github.com/miniME89),
Expand Down
14 changes: 13 additions & 1 deletion docs/Modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ Here's a list of modules bundled with the game by default (this line-up will cha
*Note about "Tutorial" modules:* These are more likely for some time to be for developers/modders to learn about different kinds of content and systems, not for players to actually learn stuff in-game. That's usually handled by actual content modules including their own in-game help system.

* [AdvancedBehaviors](https://github.com/Terasology/AdvancedBehaviors) - adds behavior trees and logic for NPCs!
* [AdventureAssets](https://github.com/Terasology/AdventureAssets) - a set of assets for adventure time!
* [Alchemy](https://github.com/Terasology/Alchemy) - create alchemical potions!
* [AlterationEffects](https://github.com/Terasology/AlterationEffects) - module for storing some buff/debuff type effects
* [Anatomy](https://github.com/Terasology/Anatomy) - an anatomical system meant to provide an alternative to typical HP only systems
* [AnotherWorld](https://github.com/Terasology/AnotherWorld) - world gen module, includes features like ore placement and caves, used by WoodAndStone's world
* [AnotherWorldPlants](https://github.com/Terasology/AnotherWorldPlants) - farming and tree growth for AnotherWorld
* [BlockDetector](https://github.com/Terasology/BlockDetector) - adds a simple little tool that can detect specific blocks (beeping in proximity)
Expand All @@ -34,7 +36,8 @@ Here's a list of modules bundled with the game by default (this line-up will cha
* [ChrisVolume1OST](https://github.com/Terasology/ChrisVolume1OST) - official game soundtrack by Chris Köbke - volume 1
* [ChrisVolume2OST](https://github.com/Terasology/ChrisVolume2OST) - official game soundtrack by Chris Köbke - volume 2
* [Cities](https://github.com/Terasology/Cities) - procedural city placer and plot organizer, also places roads to connect cities. Later split into Static and Dynamic variants
* [ClimateConditions](https://github.com/Terasology/ClimateConditions) - A library module for managing temperature, humidity, and other climate factors
* [ClimateConditions](https://github.com/Terasology/ClimateConditions) - A library module for managing temperature, humidity, and other climate factors
* [CombatSystem](https://github.com/Terasology/CombatSystem) - an advanced physics-based combat system
* [CommonWorld](https://github.com/Terasology/CommonWorld) - general world generation utility module
* [ComputerMonitors](https://github.com/Terasology/ComputerMonitors) - allows for the creation of functional multi-block monitors in-game - ModularComputers puts them to work!
* [Cooking](https://github.com/Terasology/Cooking) - cook stuff!
Expand All @@ -57,7 +60,9 @@ Here's a list of modules bundled with the game by default (this line-up will cha
* [GooeysQuests](https://github.com/Terasology/GooeysQuests) - spawn our mascot Gooey (console: `spawnPrefab gooey`) then `e` click to interact for commands and quests!
* [GrowingFlora](https://github.com/Terasology/GrowingFlora) - organically growing (step by step) trees and such
* [Hunger](https://github.com/Terasology/Hunger) - makes the player slowly gets hungry (needs actual GUI work and ways to then actually eat food though). Console `hungerCheck` for stats
* [Inferno](https://github.com/Terasology/Inferno) - live on in an underworld after death!
* [InGameHelp](https://github.com/Terasology/InGameHelp) - system for showing help in-game, default key `P`
* [InGameHelpAPI](https://github.com/Terasology/InGameHelpAPI) - separate API module for IGH to allow support but not forced activation for the help system
* [IRLCorp](https://github.com/Terasology/IRLCorp) - Industrialized Reduction of Labor Corporation - Helping workmen everywhere
* [ItemRendering](https://github.com/Terasology/ItemRendering) - a library for displaying "holographic" items in the world
* [JoshariasSurvival](https://github.com/Terasology/JoshariasSurvival) - formerly known as TerraTech - gameplay template for a machine-centric survival style
Expand All @@ -66,6 +71,7 @@ Here's a list of modules bundled with the game by default (this line-up will cha
* [LegacyMusic](https://github.com/Terasology/LegacyMusic) - older music pieces predating the official soundtrack
* [LightAndShadow](https://github.com/Terasology/LightAndShadow) - main module for the Light & Shadow gameplay
* [LightAndShadowResources](https://github.com/Terasology/LightAndShadowResources) - IMMA FIRIN’ MAH LASR!! Art assets for the Light & Shadow concept
* [Lost](https://github.com/Terasology/Lost) - gameplay template for a survival / exploration focused setting
* [Machines](https://github.com/Terasology/Machines) - machine infrastructure library module
* [Malicious](https://github.com/Terasology/Malicious) - a series of module security tests to check that modules cannot do naughty things when running
* [ManualLabor](https://github.com/Terasology/ManualLabor) - tools and logic for manual labor (digging, chopping, etc)
Expand Down Expand Up @@ -93,10 +99,14 @@ Here's a list of modules bundled with the game by default (this line-up will cha
* [Portals](https://github.com/Terasology/Portals) - allows placement of portal blocks that'll spawn Oreons `give portal`
* [PotentialEnergyDevices](https://github.com/Terasology/PotentialEnergyDevices) - A library for creating entities that build up potential energy
* [Potions](https://github.com/Terasology/Potions) - contains a set of assorted potions the player can consume to gain various effects
* [Projectile](https://github.com/Terasology/Projectile) - supported a variety of projectiles such as grenades and fireballs
* [QuestExamples](https://github.com/Terasology/QuestExamples) - samples for developers to help create quests
* [Rails](https://github.com/Terasology/Rails) - railroads and trains! Press `E` to start a caboose or enter a cart. Use the wrench to attach carts
* [Sample](https://github.com/Terasology/Sample) - miscellaneous example content showcasing module usage
* [Scenario](https://github.com/Terasology/Scenario) - a scenario making toolset
* [Seasons](https://github.com/Terasology/Seasons) - adds seasons to the game
* [SegmentedPaths](https://github.com/Terasology/SegmentedPaths) - utility module for structured paths
* [Sensors](https://github.com/Terasology/Sensors) - used for sensing other entities, involved in collision detection and combat-y things
* [ShatteredPlanes](https://github.com/Terasology/ShatteredPlanes) - a world generator focused on canyons, sky islands, and other somewhat radical terrain features
* [Signalling](https://github.com/Terasology/Signalling) - circuitry implementation based on BlockNetwork, similar to redstone
* [SimpleFarming](https://github.com/Terasology/SimpleFarming) - easy to understand growing of foods
Expand All @@ -118,7 +128,9 @@ Here's a list of modules bundled with the game by default (this line-up will cha
* [Valentines](https://github.com/Terasology/Valentines) - What is love? Gooey don't hurt me, don't hurt me, no more ... ♫
* [WeatherManager](https://github.com/Terasology/WeatherManager) - simple weather foundation, tracks whether, maintains a single cloud layer, and so on
* [WildAnimals](https://github.com/Terasology/WildAnimals) - a module containing animals, initially a deer you can spawn in-world via console with `spawnPrefab deer` then watch wander idly
* [WildAnimalsGenome](https://github.com/Terasology/WildAnimalsGenome) - bridge module using Genome to bring more advanced features to WildAnimals
* [WoodAndStone](https://github.com/Terasology/WoodAndStone) - big content module including "from scratch" crafting, starting with wood here
* [WoodAndStoneCraftingJournal](https://github.com/Terasology/WoodAndStoneCraftingJournal) - a Journal bridging module for WoodCrafting and StoneCrafting (no direct relation with the WoodAndStone module)
* [Workstation](https://github.com/Terasology/Workstation) - workstations offer a way to use blocks in-world for advanced purposes
* [WorkstationCrafting](https://github.com/Terasology/WorkstationCrafting) - an extension to Workstation focused on crafting more advanced recipe-based stuff
* [WorkstationInGameHelp](https://github.com/Terasology/WorkstationInGameHelp) - bridging module to bring in-game help to workstation screens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
*/
public class HeadlessEnvironment extends Environment {

protected static final WorldTime worldTime = new WorldTimeImpl();
protected static final WorldTime WORLD_TIME = new WorldTimeImpl();
private static final Logger logger = LoggerFactory.getLogger(HeadlessEnvironment.class);

/**
Expand Down Expand Up @@ -314,7 +314,7 @@ protected void setupComponentManager() {
protected void setupWorldProvider() {
WorldProvider worldProvider = mock(WorldProvider.class);
when(worldProvider.getWorldInfo()).thenReturn(new WorldInfo());
when(worldProvider.getTime()).thenReturn(worldTime);
when(worldProvider.getTime()).thenReturn(WORLD_TIME);
context.put(WorldProvider.class, worldProvider);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ public abstract class TerasologyTestingEnvironment {

private static HeadlessEnvironment env;

protected EngineTime mockTime;
private EngineEntityManager engineEntityManager;
private ComponentSystemManager componentSystemManager;
protected EngineTime mockTime;

@BeforeClass
public static void setupEnvironment() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private ModuleManagerFactory() {
}

public static ModuleManager create() throws Exception {
ModuleManager moduleManager = new ModuleManagerImpl();
ModuleManager moduleManager = new ModuleManagerImpl("");
try (Reader reader = new InputStreamReader(ModuleManagerFactory.class.getResourceAsStream("/module.txt"), TerasologyConstants.CHARSET)) {
ModuleMetadata metadata = new ModuleMetadataReader().read(reader);
moduleManager.getRegistry().add(ClasspathModule.create(metadata, ModuleManagerFactory.class));
Expand Down
2 changes: 1 addition & 1 deletion engine-tests/src/main/resources/module.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id" : "unittest",
"version" : "1.4.1-SNAPSHOT",
"version" : "1.5.1-SNAPSHOT",
"displayName" : "Terasology Engine Test",
"description" : "Engine unit test content"
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ public void testSubscribedRemove() throws Exception {
SimpleUri id = new SimpleUri("engine-tests:TestSetting");
Setting setting = new MockSetting(id);
config.add(setting);
setting.subscribe(propertyChangeEvent -> {});
setting.subscribe(propertyChangeEvent -> {
});

assertFalse(config.remove(id));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

class MockSetting<T> implements Setting<T> {
private final SimpleUri id;
private boolean isSubscribedTo = false;
private boolean isSubscribedTo;

MockSetting(SimpleUri id) {
this.id = id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ public void testSetEventCall() {

Random random = new FastRandom();

final int MAX_SET_VALUE_COUNT = 50;
final int maxSetValueCount = 50;
int expectedEventCallCount = 0;

for (int i = 0; i < MAX_SET_VALUE_COUNT; i++) {
for (int i = 0; i < maxSetValueCount; i++) {
int randomInt = random.nextInt(-50, 150);
expectedEventCallCount += setting.setValue(randomInt) ? 1 : 0;
}
Expand All @@ -109,15 +109,15 @@ public void testSetEventCall() {

@Test
public void testSubscribe() {
final int SUBSCRIBER_COUNT = 10;
final int subscriberCount = 10;

for (int i = 0; i < SUBSCRIBER_COUNT; i++) {
for (int i = 0; i < subscriberCount; i++) {
setting.subscribe(propertyChangeEvent -> eventCallCount++);
}

setting.setValue(30);

assertEquals(SUBSCRIBER_COUNT, eventCallCount);
assertEquals(subscriberCount, eventCallCount);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@

package org.terasology.engine;

import com.google.common.collect.Iterables;
import org.junit.Before;
import org.junit.Test;
import org.terasology.context.Context;
import org.terasology.entitySystem.entity.EntityManager;
import org.terasology.entitySystem.event.internal.EventSystem;
import org.terasology.entitySystem.systems.RenderSystem;
import org.terasology.entitySystem.systems.UpdateSubscriberSystem;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class ComponentSystemManagerTest {

private ComponentSystemManager systemUnderTest;

@Before
public void setUp() {
Context context = mock(Context.class);
EntityManager entityManager = mock(EntityManager.class);
when(entityManager.getEventSystem()).thenReturn(mock(EventSystem.class));
when(context.get(EntityManager.class)).thenReturn(entityManager);
systemUnderTest = new ComponentSystemManager(context);
}

@Test
public void testRegisterUpdateSubscriberAddsSubscriber() {
UpdateSubscriberSystem system = mock(UpdateSubscriberSystem.class);

systemUnderTest.register(system);

assertThat(Iterables.size(systemUnderTest.iterateUpdateSubscribers()), is(1));
}

@Test
public void testShutdownRemovesUpdateSubscribers() {
UpdateSubscriberSystem system = mock(UpdateSubscriberSystem.class);

systemUnderTest.register(system);
systemUnderTest.shutdown();

assertThat(Iterables.size(systemUnderTest.iterateUpdateSubscribers()), is(0));
}

@Test
public void testRegisterRenderSystemAddsRenderSubscriber() {
RenderSystem system = mock(RenderSystem.class);

systemUnderTest.register(system);

assertThat(Iterables.size(systemUnderTest.iterateRenderSubscribers()), is(1));
}

@Test
public void testShutdownRemovesRenderSubscribers() {
//see https://github.com/MovingBlocks/Terasology/issues/3087#issuecomment-326409756
RenderSystem system = mock(RenderSystem.class);

systemUnderTest.register(system);
systemUnderTest.shutdown();

assertThat(Iterables.size(systemUnderTest.iterateRenderSubscribers()), is(0));
}

}
Loading

0 comments on commit 1c14c6d

Please sign in to comment.