@@ -0,0 +1,1830 @@
+/*%0A * Copyright 2018 MovingBlocks%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage org.terasology.persistence.typeHandling.gson;%0A%0Aimport com.google.gson.Gson;%0Aimport com.google.gson.TypeAdapter;%0Aimport com.google.gson.TypeAdapterFactory;%0Aimport com.google.gson.reflect.TypeToken;%0Aimport org.terasology.persistence.typeHandling.TypeHandler;%0Aimport org.terasology.persistence.typeHandling.TypeSerializationLibrary;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Apublic class GsonTypeHandlerAdapterFactory implements TypeAdapterFactory %7B%0A    private Map%3CClass%3C?%3E, TypeHandler%3C?%3E%3E typeHandlerMap;%0A%0A    public GsonTypeHandlerAdapterFactory() %7B%0A        typeHandlerMap = new HashMap%3C%3E();%0A    %7D%0A%0A    public %3CT%3E void addTypeHandler(Class%3CT%3E type, TypeHandler%3CT%3E typeHandler) %7B%0A        typeHandlerMap.put(type, typeHandler);%0A    %7D%0A%0A    public boolean containsTypeHandlerFor(Class%3C?%3E type) %7B%0A        return typeHandlerMap.containsKey(type);%0A    %7D%0A%0A    @SuppressWarnings(%22unchecked%22)%0A    @Override%0A    public %3CT%3E TypeAdapter%3CT%3E create(Gson gson, TypeToken%3CT%3E type) %7B%0A        Class%3C? super T%3E rawType = type.getRawType();%0A%0A        if (!containsTypeHandlerFor(rawType)) %7B%0A            return null;%0A        %7D%0A%0A        return new GsonTypeHandlerAdapter%3C%3E((TypeHandler%3CT%3E) typeHandlerMap.get(rawType), gson, type);%0A    %7D%0A%7D%0A

Add GsonTypeHandlerAdapterFactory