mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-27 23:47:38 +01:00
Random stuff
- Multiply by 31 in some hash functions - Remove unused render utility classes
This commit is contained in:
parent
e33ab160ac
commit
446b24f1cf
4 changed files with 6 additions and 49 deletions
|
@ -52,7 +52,7 @@ public class RedstoneLinkNetworkHandler {
|
|||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return item.hashCode() ^ color;
|
||||
return (item.hashCode() * 31) ^ color;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
package com.simibubi.create.foundation;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class OptionalUtil {
|
||||
|
||||
public static <T> Optional<T> thenTry(Optional<T> first, Optional<T> thenTry) {
|
||||
if (first.isPresent()) {
|
||||
return first;
|
||||
} else {
|
||||
return thenTry;
|
||||
}
|
||||
}
|
||||
|
||||
public static <T> Optional<T> thenTryLazy(Supplier<Optional<T>> first, Supplier<Optional<T>> thenTry) {
|
||||
Optional<T> one = first.get();
|
||||
if (one.isPresent()) {
|
||||
return one;
|
||||
} else {
|
||||
return thenTry.get();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
package com.simibubi.create.foundation.render.backend;
|
||||
|
||||
public class ShaderLoadingException extends RuntimeException {
|
||||
|
||||
public ShaderLoadingException() {
|
||||
}
|
||||
|
||||
public ShaderLoadingException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public ShaderLoadingException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public ShaderLoadingException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
public ShaderLoadingException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
|
||||
super(message, cause, enableSuppression, writableStackTrace);
|
||||
}
|
||||
}
|
|
@ -49,7 +49,11 @@ public class Pair<F, S> {
|
|||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return (first == null ? 0 : first.hashCode()) ^ (second == null ? 0 : second.hashCode());
|
||||
return (nullHash(first) * 31) ^ nullHash(second);
|
||||
}
|
||||
|
||||
int nullHash(Object o) {
|
||||
return o == null ? 0 : o.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue