Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-26 00:00:28 +01:00
Remove some more unncessary/doubled map check
Dieser Commit ist enthalten in:
Ursprung
449ec15309
Commit
033d3bcd4d
@ -33,9 +33,7 @@ public class EntityTracker extends StoredObject {
|
||||
}
|
||||
|
||||
public Optional<Entity1_11Types.EntityType> get(int id) {
|
||||
if (!has(id))
|
||||
return Optional.absent();
|
||||
return Optional.of(clientEntityTypes.get(id));
|
||||
return Optional.fromNullable(clientEntityTypes.get(id));
|
||||
}
|
||||
|
||||
public void addHologram(int entId) {
|
||||
|
@ -28,9 +28,7 @@ public class EntityTracker extends StoredObject {
|
||||
}
|
||||
|
||||
public Optional<Entity1_12Types.EntityType> get(int id) {
|
||||
if (!has(id))
|
||||
return Optional.absent();
|
||||
return Optional.of(clientEntityTypes.get(id));
|
||||
return Optional.fromNullable(clientEntityTypes.get(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -46,12 +46,6 @@ public class PaintingProvider implements Provider {
|
||||
// Handle older versions
|
||||
if (!motive.startsWith("minecraft:"))
|
||||
motive = "minecraft:" + motive.toLowerCase();
|
||||
|
||||
Integer index = paintings.get(motive);
|
||||
if (index != null) {
|
||||
return Optional.of(index);
|
||||
}
|
||||
|
||||
return Optional.absent();
|
||||
return Optional.fromNullable(paintings.get(motive));
|
||||
}
|
||||
}
|
@ -28,9 +28,7 @@ public class EntityTracker extends StoredObject {
|
||||
}
|
||||
|
||||
public Optional<Entity1_13Types.EntityType> get(int id) {
|
||||
if (!has(id))
|
||||
return Optional.absent();
|
||||
return Optional.of(clientEntityTypes.get(id));
|
||||
return Optional.fromNullable(clientEntityTypes.get(id));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -173,12 +173,7 @@ public enum MetaIndex {
|
||||
|
||||
private static Optional<MetaIndex> getIndex(Entity1_10Types.EntityType type, int index) {
|
||||
Pair pair = new Pair<>(type, index);
|
||||
MetaIndex metaIndex = metadataRewrites.get(pair);
|
||||
if (metaIndex != null) {
|
||||
return Optional.of(metaIndex);
|
||||
}
|
||||
|
||||
return Optional.absent();
|
||||
return Optional.fromNullable(metadataRewrites.get(pair));
|
||||
}
|
||||
|
||||
public static MetaIndex searchIndex(Entity1_10Types.EntityType type, int index) {
|
||||
|
@ -57,11 +57,14 @@ public class CommandBlockStorage extends StoredObject {
|
||||
if (blocks == null)
|
||||
return Optional.absent();
|
||||
|
||||
CompoundTag tag = blocks.get(position).clone();
|
||||
CompoundTag tag = blocks.get(position);
|
||||
if (tag == null)
|
||||
return Optional.absent();
|
||||
|
||||
tag = tag.clone();
|
||||
tag.put(new ByteTag("powered", (byte) 0));
|
||||
tag.put(new ByteTag("auto", (byte) 0));
|
||||
tag.put(new ByteTag("conditionMet", (byte) 0));
|
||||
|
||||
return Optional.of(tag);
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ public abstract class Config implements ConfigurationProvider {
|
||||
public List<Integer> getIntegerList(String key) {
|
||||
Object o = this.config.get(key);
|
||||
if (o != null) {
|
||||
return (List<Integer>) this.config.get(key);
|
||||
return (List<Integer>) o;
|
||||
} else {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren