mirror of
https://github.com/ViaVersion/ViaAprilFools.git
synced 2025-01-08 19:17:40 +01:00
Updated Via API usage
This commit is contained in:
parent
315e81c286
commit
c1b741846d
@ -15,9 +15,8 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package net.raphimc.viaaprilfools.api;
|
||||
package net.raphimc.viaaprilfools.api.data;
|
||||
|
||||
import com.viaversion.viabackwards.api.data.BackwardsMappingDataLoader;
|
||||
import com.viaversion.viabackwards.api.data.BackwardsMappings;
|
||||
import com.viaversion.viaversion.api.protocol.Protocol;
|
||||
import com.viaversion.viaversion.libs.opennbt.tag.builtin.CompoundTag;
|
||||
@ -28,24 +27,23 @@ import java.util.logging.Logger;
|
||||
|
||||
public class AprilFoolsMappings extends BackwardsMappings {
|
||||
|
||||
private static final BackwardsMappingDataLoader LOADER = new BackwardsMappingDataLoader(AprilFoolsMappings.class, "assets/viaaprilfools/data/");
|
||||
|
||||
public AprilFoolsMappings(String unmappedVersion, String mappedVersion, @Nullable Class<? extends Protocol<?, ?, ?, ?>> vvProtocolClass) {
|
||||
super(unmappedVersion, mappedVersion, vvProtocolClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @Nullable CompoundTag readMappingsFile(String name) {
|
||||
return LOADER.loadNBTFromDir(name);
|
||||
return VAFMappingDataLoader.INSTANCE.loadNBTFromDir(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected @Nullable CompoundTag readUnmappedIdentifiersFile(String name) {
|
||||
return LOADER.loadNBT(name, true);
|
||||
return VAFMappingDataLoader.INSTANCE.loadNBT(name, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Logger getLogger() {
|
||||
return ViaAprilFools.getPlatform().getLogger();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* This file is part of ViaAprilFools - https://github.com/RaphiMC/ViaAprilFools
|
||||
* Copyright (C) 2021-2024 RK_01/RaphiMC and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package net.raphimc.viaaprilfools.api.data;
|
||||
|
||||
import com.viaversion.viabackwards.api.data.BackwardsMappingDataLoader;
|
||||
import net.raphimc.viaaprilfools.ViaAprilFools;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class VAFMappingDataLoader extends BackwardsMappingDataLoader {
|
||||
|
||||
public static final VAFMappingDataLoader INSTANCE = new VAFMappingDataLoader();
|
||||
|
||||
public VAFMappingDataLoader() {
|
||||
super(AprilFoolsMappings.class, "assets/viaaprilfools/data/");
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getDataFolder() {
|
||||
return ViaAprilFools.getPlatform().getDataFolder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Logger getLogger() {
|
||||
return ViaAprilFools.getPlatform().getLogger();
|
||||
}
|
||||
|
||||
}
|
@ -28,7 +28,7 @@ import com.viaversion.viaversion.api.type.types.chunk.ChunkType1_14;
|
||||
import com.viaversion.viaversion.protocols.protocol1_14to1_13_2.ClientboundPackets1_14;
|
||||
import com.viaversion.viaversion.protocols.protocol1_14to1_13_2.Protocol1_14To1_13_2;
|
||||
import com.viaversion.viaversion.protocols.protocol1_14to1_13_2.ServerboundPackets1_14;
|
||||
import net.raphimc.viaaprilfools.api.AprilFoolsMappings;
|
||||
import net.raphimc.viaaprilfools.api.data.AprilFoolsMappings;
|
||||
import net.raphimc.viaaprilfools.protocols.protocol1_14to3D_Shareware.packets.BlockItemPackets3D_Shareware;
|
||||
import net.raphimc.viaaprilfools.protocols.protocol1_14to3D_Shareware.packets.EntityPackets3D_Shareware;
|
||||
import net.raphimc.viaaprilfools.protocols.protocol1_14to3D_Shareware.storage.ChunkCenterTracker3D_Shareware;
|
||||
|
@ -35,7 +35,7 @@ import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.provider.PlayerA
|
||||
import com.viaversion.viaversion.rewriter.RecipeRewriter;
|
||||
import com.viaversion.viaversion.rewriter.StatisticsRewriter;
|
||||
import com.viaversion.viaversion.rewriter.TagRewriter;
|
||||
import net.raphimc.viaaprilfools.api.AprilFoolsMappings;
|
||||
import net.raphimc.viaaprilfools.api.data.AprilFoolsMappings;
|
||||
import net.raphimc.viaaprilfools.protocols.protocol1_16to20w14infinite.metadata.MetadataRewriter1_16to20w14infinite;
|
||||
import net.raphimc.viaaprilfools.protocols.protocol1_16to20w14infinite.packets.BlockItemPackets20w14infinite;
|
||||
import net.raphimc.viaaprilfools.protocols.protocol1_16to20w14infinite.packets.EntityPackets20w14infinite;
|
||||
|
Loading…
Reference in New Issue
Block a user