Skip to content

Commit

Permalink
Merge branch 'develop' into spike/jmx
Browse files Browse the repository at this point in the history
  • Loading branch information
keturn authored Dec 5, 2021
2 parents 47cdb25 + 1f0349f commit 7b2feb8
Show file tree
Hide file tree
Showing 230 changed files with 1,081 additions and 512 deletions.
20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

54 changes: 54 additions & 0 deletions .github/ISSUE_TEMPLATE/crash-bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: 🐛 Crash/Bug Report
about: Create a crash or bug report to help us improve Terasology
title: Crash/Bug on trying to ...
labels: 'Status: Needs Investigation, Topic: Stabilization, Type: Bug'
assignees: ''

---

<!-- Thanks for taking the time to submit a thorough issue report for Terasology! :-)
Note that for suggestions, general questions & support you can approach us on Discord: https://discord.gg/terasology -->

### General Info

Terasology Launcher Version:
Terasology Version:
Operating System:
Onboard / Dedicated Graphics:
Java Version:

### What you were trying to do

A clear and concise description of what you expected to happen.

### What actually happened

A clear and concise description of what didn't match your expectations, a.k.a. the crash or malfunction you faced.

### How to reproduce

1. Select Terasology version '...'
1. Start Terasology
1. Select gameplay '...'
1. Add modules '...'
1. Start game
1. Do '...'
1. See error

### Log details

Note, that the crash reporter often provides multiple tabs with different logs.
Please attach (a link to) all of them.

### Screenshots

If applicable, add screenshots to help explain your problem.

### Workaround

If applicable, describe any workaround you found to avoid the issue

### Additional Infos / Context

Feel free to add any other context about the problem here.
50 changes: 50 additions & 0 deletions .github/ISSUE_TEMPLATE/documentation-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: 📜 Documentation Request
about: Report a need for additional documentation for Terasology
title: Request for documentation for ...
labels: 'Category: Doc, Status: Needs Discussion'
assignees: ''

---

<!-- Thanks for taking the time to submit a thorough request for Terasology! :-)
Note that for suggestions, general questions & support you can approach us on Discord: https://discord.gg/terasology -->

### Documentation Topic

Please use any of the following prompts to provide a clear and concise description of what you need more documentation about. You can also provide a custom description.

* I was trying to understand the concept of ...
* I want to know more about how to use module ...
* I need more information for troubleshooting issues related to ...
* I expected ... to be documented clearer / more present.

### Documentation Type

- type: dropdown
id: documentation-type
attributes:
label: "Documentation Type"
description: Where / How should the information you need be provided?
options:
- In-Game (Item / Notification)
- In-Game (NPC Interaction)
- In-Game (Menu / World Creation)
- Loading Screen
- In-Code (JavaDoc / Comments)
- Module Documentation
- Terasology Wiki
- Tutorial Module
- Terasology Website
- Terasology Forum
- Discord Channel Descriptions / Pins

Please use any of the following prompts to provide a clear and concise description of any alternative documentation types you've considered. You can also provide a custom description.

* We could use ..., but ...
* I thought about ..., but ...
* ... won't be sufficient, because ...

### Additional notes

Feel free to add any other context or screenshots about your feature request here.
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/improvement-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: ✨ Improvement Request
about: Suggest an improvement for Terasology
title: Request for improving ...
labels: 'Status: Needs Discussion, Type: Improvement'
assignees: ''

---

<!-- Thanks for taking the time to submit a thorough request for Terasology! :-)
Note that for suggestions, general questions & support you can approach us on Discord: https://discord.gg/terasology -->

### Motivation

Is your feature request related to a problem? Please use any of the following prompts to provide a clear and concise description of what the problem is. You can also provide a custom description.

* I feel frustrated when ...
* I'm about to uninstall Terasology when ...
* I feel disappointed when ...

### Proposal

Please use any of the following prompts to provide a clear and concise description of what you would like to happen instead. You can also provide a custom description.

* I wish there was ...
* It would be fun to ...
* I would play for hours if ...

### Alternatives

Please use any of the following prompts to provide a clear and concise description of any alternative solutions or features you've considered. You can also provide a custom description.

* We could use ..., but ...
* I thought about ..., but ...
* ... won't be sufficient, because ...

### Additional notes

Feel free to add any other context or screenshots about your feature request here.
44 changes: 44 additions & 0 deletions .github/ISSUE_TEMPLATE/roadmap-draft.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: 🛤️ Roadmap Draft
about: Document the roadmap for a bigger effort within Terasology
title: Roadmap for ...
labels: 'Category: Doc, Status: Needs Discussion'
assignees: ''

---

<!-- Thanks for taking the time to submit a thorough roadmap draft for Terasology! :-)
Note that for suggestions, general questions & support you can approach us on Discord: https://discord.gg/terasology -->

### Motivation

* Is there a specific problem this effort will solve?
* Is there a specific need this effort will satisfy?
* How did you get the idea for this effort?
* What will be the benefits of this effort?

### Proposal

* On a high level, what will the effort entail? (there's space for a fine-granular task breakdown farther down)
* Which areas of Terasology will the effort affect?
* What is the "Definition of Done" for this effort?

### Concerns

* Is there specific expertise that will be needed for this effort?
* Does this effort have dependencies on other efforts?
* Do you expect this effort to conflict with any other efforts?
* What are potential drawbacks of the effort?
* What are maintenance or continuous efforts that will persist beyond the completion of this effort?


### Task Breakdown

* What are the individual tasks that need to be done to complete the effort?
* Can you roughly estimate how hard the individual tasks would be for a software developer with 2 years of on-the-job Java development expertise, but no in-depth expertise in special areas such as rendering or AI?
* Which tasks are inter-dependent?
* Which tasks can be done in parallel?

### Additional notes

Feel free to add any other context or screenshots about your roadmap draft here.
20 changes: 14 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ properties([
* - Git Forensics Plugin (https://plugins.jenkins.io/git-forensics/)
* To compare code scans and static analysis against a reference build from the base branch.
* - JUnit Plugin (https://plugins.jenkins.io/junit/)
* To record the results of our test suites from JUnit format.
* To record the results of our test suites from JUnit format.
*
*/

Expand Down Expand Up @@ -123,16 +123,24 @@ pipeline {
// this is wrong in our case, so explicitly set `develop` as default
// TODO: does this also work for PRs with different base branch?
discoverGitReferenceBuild(defaultBranch: 'develop')
recordIssues skipBlames: true, enabledForFailure: true,
recordIssues(skipBlames: true, enabledForFailure: true,
tool: checkStyle(pattern: '**/build/reports/checkstyle/*.xml'),
qualityGates: [
[threshold: 1, type: 'NEW_HIGH', unstable: false], // mark stage "failed" on new high findings
[threshold: 1, type: 'NEW_NORMAL', unstable: false], // mark stage "failed" on new normal findings
[threshold: 1, type: 'TOTAL_HIGH', unstable: true], // mark stage "unstable" on existing high findings
[threshold: 1, type: 'TOTAL_NORMAL', unstable: true] // mark stage "unstable" on existing normal findings
])

recordIssues(skipBlames: true, enabledForFailure: true,
tools: [
checkStyle(pattern: '**/build/reports/checkstyle/*.xml'),
spotBugs(pattern: '**/build/reports/spotbugs/main/*.xml', useRankAsPriority: true),
pmdParser(pattern: '**/build/reports/pmd/*.xml')
]
])

recordIssues skipBlames: true, enabledForFailure: true,
recordIssues(skipBlames: true, enabledForFailure: true,
tool: taskScanner(includePattern: '**/*.java,**/*.groovy,**/*.gradle', \
lowTags: 'WIBNIF', normalTags: 'TODO', highTags: 'ASAP')
lowTags: 'WIBNIF', normalTags: 'TODO', highTags: 'ASAP'))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.terasology.gestalt.entitysystem.component.Component;


public final class StringComponent implements Component<StringComponent>{
public final class StringComponent implements Component<StringComponent> {
public static String staticValue = "Test";
public String value;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id" : "unittest",
"version" : "5.2.0-SNAPSHOT",
"version" : "5.3.0-SNAPSHOT",
"displayName" : "Terasology Engine Test",
"description" : "Engine unit test content"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@
import org.junit.jupiter.api.Test;
import org.reflections.Reflections;
import org.terasology.engine.context.internal.ContextImpl;
import org.terasology.gestalt.assets.ResourceUrn;
import org.terasology.engine.entitySystem.entity.EntityRef;
import org.terasology.engine.entitySystem.entity.internal.PojoEntityManager;
import org.terasology.engine.entitySystem.event.AbstractConsumableEvent;
import org.terasology.engine.entitySystem.event.Event;
import org.terasology.engine.entitySystem.event.EventPriority;
import org.terasology.engine.entitySystem.event.ReceiveEvent;
import org.terasology.engine.entitySystem.event.Priority;
import org.terasology.engine.entitySystem.event.internal.EventReceiver;
import org.terasology.engine.entitySystem.event.internal.EventSystemImpl;
import org.terasology.engine.entitySystem.metadata.ComponentLibrary;
import org.terasology.engine.entitySystem.metadata.EntitySystemLibrary;
import org.terasology.engine.entitySystem.prefab.internal.PojoPrefabManager;
import org.terasology.unittest.stubs.IntegerComponent;
import org.terasology.unittest.stubs.StringComponent;
import org.terasology.engine.entitySystem.systems.BaseComponentSystem;
import org.terasology.engine.persistence.typeHandling.TypeHandlerLibraryImpl;
import org.terasology.engine.registry.CoreRegistry;
import org.terasology.gestalt.assets.ResourceUrn;
import org.terasology.gestalt.entitysystem.event.Event;
import org.terasology.gestalt.entitysystem.event.ReceiveEvent;
import org.terasology.persistence.typeHandling.TypeHandlerLibrary;
import org.terasology.unittest.stubs.IntegerComponent;
import org.terasology.unittest.stubs.StringComponent;

import java.util.List;

Expand Down Expand Up @@ -250,15 +251,17 @@ public static class TestHighPriorityEventHandler extends BaseComponentSystem {

List<Received> receivedList = Lists.newArrayList();

@ReceiveEvent(components = StringComponent.class, priority = EventPriority.PRIORITY_HIGH)
@Priority(EventPriority.PRIORITY_HIGH)
@ReceiveEvent(components = StringComponent.class)
public void handleStringEvent(TestEvent event, EntityRef entity) {
receivedList.add(new Received(event, entity));
if (cancel) {
event.consume();
}
}

@ReceiveEvent(components = IntegerComponent.class, priority = EventPriority.PRIORITY_HIGH)
@Priority(EventPriority.PRIORITY_HIGH)
@ReceiveEvent(components = IntegerComponent.class)
public void handleIntegerEvent(TestEvent event, EntityRef entity) {
receivedList.add(new Received(event, entity));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import org.terasology.engine.entitySystem.entity.EntityManager;
import org.terasology.engine.entitySystem.entity.EntityRef;
import org.terasology.engine.entitySystem.entity.lifecycleEvents.OnActivatedComponent;
import org.terasology.engine.entitySystem.event.Event;
import org.terasology.engine.logic.characters.events.CreateVisualCharacterEvent;
import org.terasology.engine.logic.players.LocalPlayer;
import org.terasology.engine.registry.InjectionHelper;
import org.terasology.gestalt.entitysystem.event.Event;

import java.util.ArrayList;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.terasology.engine.TerasologyTestingEnvironment;
import org.terasology.engine.core.Time;
import org.terasology.engine.entitySystem.entity.EntityRef;
import org.terasology.engine.entitySystem.event.ReceiveEvent;
import org.terasology.gestalt.entitysystem.event.ReceiveEvent;

import java.util.ArrayList;
import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

package org.terasology.engine.math;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

public class SideBitTest {

@Test
public void testSideToBits() {
Assertions.assertEquals(SideBitFlag.getSides(Side.TOP), (byte) 0b000001);
Assertions.assertEquals(SideBitFlag.getSides(Side.LEFT), (byte) 0b000010);
Assertions.assertEquals(SideBitFlag.getSides(Side.FRONT), (byte) 0b000100);
Assertions.assertEquals(SideBitFlag.getSides(Side.BOTTOM), (byte) 0b001000);
Assertions.assertEquals(SideBitFlag.getSides(Side.RIGHT), (byte) 0b010000);
Assertions.assertEquals(SideBitFlag.getSides(Side.BACK), (byte) 0b100000);

Assertions.assertEquals(SideBitFlag.getSides(Side.BACK, Side.BOTTOM), (byte) (0b100000 | 0b001000));
Assertions.assertEquals(SideBitFlag.getSides(Side.BACK, Side.RIGHT), (byte) (0b100000 | 0b010000));

Assertions.assertEquals(SideBitFlag.getSides(Side.BACK, Side.RIGHT, Side.TOP, Side.TOP), (byte) (0b100000 | 0b010000 | 0b000001));
}

@Test
public void testReverseBits() {
Assertions.assertEquals(SideBitFlag.getReverse(SideBitFlag.getSides(Side.TOP)), SideBitFlag.getSide(Side.BOTTOM));
Assertions.assertEquals(SideBitFlag.getReverse(SideBitFlag.getSides(Side.LEFT)), SideBitFlag.getSide(Side.RIGHT));
Assertions.assertEquals(SideBitFlag.getReverse(SideBitFlag.getSides(Side.FRONT)), SideBitFlag.getSide(Side.BACK));
Assertions.assertEquals(SideBitFlag.getReverse(SideBitFlag.getSides(Side.BOTTOM)), SideBitFlag.getSide(Side.TOP));
Assertions.assertEquals(SideBitFlag.getReverse(SideBitFlag.getSides(Side.RIGHT)), SideBitFlag.getSide(Side.LEFT));
Assertions.assertEquals(SideBitFlag.getReverse(SideBitFlag.getSides(Side.BACK)), SideBitFlag.getSide(Side.FRONT));

Assertions.assertEquals(SideBitFlag.getReverse(SideBitFlag.getSides(Side.TOP, Side.BOTTOM)), SideBitFlag.getSides(Side.BOTTOM,
Side.TOP));
Assertions.assertEquals(SideBitFlag.getReverse(SideBitFlag.getSides(Side.LEFT, Side.RIGHT)), SideBitFlag.getSides(Side.LEFT,
Side.RIGHT));
Assertions.assertEquals(SideBitFlag.getReverse(SideBitFlag.getSides(Side.FRONT, Side.BACK)), SideBitFlag.getSides(Side.FRONT,
Side.BACK));
Assertions.assertEquals(SideBitFlag.getReverse(SideBitFlag.getSides(Side.BOTTOM, Side.TOP)), SideBitFlag.getSides(Side.BOTTOM,
Side.TOP));
Assertions.assertEquals(SideBitFlag.getReverse(SideBitFlag.getSides(Side.RIGHT, Side.LEFT)), SideBitFlag.getSides(Side.RIGHT,
Side.LEFT));
Assertions.assertEquals(SideBitFlag.getReverse(SideBitFlag.getSides(Side.BACK, Side.FRONT)), SideBitFlag.getSides(Side.BACK,
Side.FRONT));
}

@Test
public void testAddSide() {
Assertions.assertEquals(SideBitFlag.addSide(SideBitFlag.getSides(Side.BACK, Side.BOTTOM), Side.TOP),
SideBitFlag.getSides(Side.BACK, Side.BOTTOM, Side.TOP));
Assertions.assertEquals(SideBitFlag.addSide(SideBitFlag.getSides(Side.BACK, Side.BOTTOM), Side.RIGHT),
SideBitFlag.getSides(Side.BACK, Side.BOTTOM, Side.RIGHT));
Assertions.assertEquals(SideBitFlag.addSide(SideBitFlag.getSides(Side.BACK, Side.BOTTOM, Side.TOP), Side.TOP),
SideBitFlag.getSides(Side.BACK, Side.BOTTOM, Side.TOP));
}
}
Loading

0 comments on commit 7b2feb8

Please sign in to comment.