-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Terasology engine #5192
Terasology engine #5192
Conversation
e6f7849
to
0ebf391
Compare
0ebf391
to
ad475b3
Compare
is there a way to retrigger the jenkins build, apart from force pushing? |
Under the checks tab on GitHub you should be able to re-run the tests if they fail. That appears to trigger a Jenkins re-run, as of recently (give https://github.com/MovingBlocks/Terasology/pull/5188/checks?check_run_id=19397149388 a try, for example). Some of the core contributors can force retrigger a build from the Jenkins UI but this relies on being added to a manual whitelist in the Logistics repository right now. If you're on that list then you can sign-in to Jenkins with your GitHub account to do that. |
ok now checks are green. @BenjaminAmos @jdrueckert you mind merging? |
Alternatively, instead of force pushing, you can create an empty commit using the |
engine/src/main/java/org/terasology/engine/world/time/WorldTimeImpl.java
Outdated
Show resolved
Hide resolved
/** | ||
* The mono 16 bit format | ||
*/ | ||
private static final int FORMAT_MONO16 = 1; | ||
|
||
/** | ||
* The stereo 16 bit format | ||
*/ | ||
private static final int FORMAT_STEREO16 = 2; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove these constants? They still appear to be relevant. It may be unused now but it could have been useful in the future.
convbuffer[ptr + 0] = (byte) (bigEndian ? val >>> 8 : val); | ||
convbuffer[ptr + 1] = (byte) (bigEndian ? val : val >>> 8); | ||
CONVBUFFER[ptr] = (byte) (bigEndian ? val >>> 8 : val); | ||
CONVBUFFER[ptr + 1] = (byte) (bigEndian ? val : val >>> 8); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, the ptr + 0
may have been for clarity. It helps to keep the lines in alignment.
private String join(String[] words, String sep) { | ||
return Arrays.stream(words).collect(joining(sep)); | ||
private String join(String[] words) { | ||
return String.join(" ", words); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're going to change the purpose of the method, you might as well re-name it too. joinWithWhitespace
seems more appropriate now than just a generic join
.
if (hibernationSettings.isPresent()) { | ||
hibernationSettings.get().setHibernationAllowed(false); | ||
} | ||
hibernationSettings.ifPresent(hibernationManager -> hibernationManager.setHibernationAllowed(false)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using functional methods, whilst more concise, have in the past caused performance issues. Streams and List#forEach
were particularly poor in comparison to a for-each loop, Since this is in network code, I am slightly concerned about the potential impact here.
@@ -448,7 +444,7 @@ public void registerNetworkEntity(EntityRef entity) { | |||
netComponent.setNetworkId(nextNetId++); | |||
entity.saveComponent(netComponent); | |||
netIdToEntityId.put(netComponent.getNetworkId(), entity.getId()); | |||
switch (netComponent.replicateMode) { | |||
switch (java.util.Objects.requireNonNull(netComponent.replicateMode)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why this is fully-qualified? Usually you'd add an import for this, unless the name conflicts with another imported class.
/** unused since Linux 2.6 */ | ||
LIB(4), | ||
/** data + stack */ | ||
DATA(5), | ||
/** unused since Linux 2.6 */ | ||
DT(6); | ||
DATA(5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that this says unused but as an enum the order of members matters. Removing enum members will re-order the existing ones, which might cause them to have the wrong ordinal values. It's quite normal for structs mapping low-level OS fields to contain "unused" or obsolete values. It's to maintain ABI compatibility.
engine/src/main/java/org/terasology/engine/world/chunks/blockdata/ExtraBlockDataManager.java
Show resolved
Hide resolved
engine/src/main/java/org/terasology/engine/world/time/WorldTimeImpl.java
Outdated
Show resolved
Hide resolved
apart from one, reverted as mentioned in your review @BenjaminAmos . |
engine/src/main/java/org/terasology/engine/audio/formats/OggReader.java
Outdated
Show resolved
Hide resolved
17a7d00
to
e0ef9e0
Compare
@BenjaminAmos i did your requested change, but still it shows "change requested". it means you need to close this? |
if (!nuiManager.isOpen("engine:console") && message.getType() != CoreMessageType.CHAT | ||
&& message.getType() != CoreMessageType.NOTIFICATION || !nuiManager.isOpen("engine:chat")) { | ||
// make sure the message isn't already shown in the chat overlay | ||
// make sure the message isn't already shown in the chat overlay | ||
if (!nuiManager.isOpen("engine:console") | ||
&& (message.getType() != CoreMessageType.CHAT | ||
&& message.getType() != CoreMessageType.NOTIFICATION | ||
|| !nuiManager.isOpen("engine:chat"))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a difficult condition to parse. I think you have rearranged it correctly but if a bug appears in this area then we might have to re-visit it.
checkstyle and pmd warnings handled. drop the whole class as it seems not to be used?
fix checkstyle and pmd warnings.
fix checkstyle, pmd warnings.
fix checkstyle, pmd warnings.
fix checkstyle, pmd warnings, like "unchecked assignment" of TeraArray.Factory<? extends TeraArray>[] slotFactories;
fix checkstyle, pmd warnings.
fix checkstyle, pmd warnings.
fix checkstyle, pmd warnings.
e0ef9e0
to
16f402b
Compare
inttelij, checkstyle, pmd warnings removed: