
net.minecraft.server.BlockDataAbstract Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of walk-server Show documentation
Show all versions of walk-server Show documentation
A spigot fork to kotlin structure and news.
package net.minecraft.server;
import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.collect.Iterables;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map.Entry;
public abstract class BlockDataAbstract implements IBlockData {
private static final Joiner a = Joiner.on(',');
private static final Function, String> b = new Function() {
public String a(Entry entry) {
if (entry == null) {
return "";
} else {
IBlockState iblockstate = entry.getKey();
return iblockstate.a() + "=" + iblockstate.a(entry.getValue());
}
}
public Object apply(Object object) {
return this.a((Entry) object);
}
};
public BlockDataAbstract() {
}
protected static T a(Collection collection, T t0) {
Iterator iterator = collection.iterator();
do {
if (!iterator.hasNext()) {
return iterator.next();
}
} while (!iterator.next().equals(t0));
if (iterator.hasNext()) {
return iterator.next();
} else {
return collection.iterator().next();
}
}
public > IBlockData a(IBlockState iblockstate) {
return this.set(iblockstate, a(iblockstate.c(), this.get(iblockstate)));
}
public String toString() {
StringBuilder stringbuilder = new StringBuilder();
stringbuilder.append(Block.REGISTRY.c(this.getBlock()));
if (!this.b().isEmpty()) {
stringbuilder.append("[");
BlockDataAbstract.a.appendTo(stringbuilder, Iterables.transform(this.b().entrySet(), BlockDataAbstract.b));
stringbuilder.append("]");
}
return stringbuilder.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy