Add Forge DataFixer.

Unsure how useful this will be, but eh.
Dieser Commit ist enthalten in:
wizjany 2019-05-17 19:39:18 -04:00
Ursprung b0777f6b06
Commit feed5173ec
3 geänderte Dateien mit 2739 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -57,6 +57,7 @@
<allow pkg="io.netty.buffer"/> <allow pkg="io.netty.buffer"/>
<allow pkg="org.spongepowered.api" /> <allow pkg="org.spongepowered.api" />
<allow pkg="com.mojang.brigadier" /> <allow pkg="com.mojang.brigadier" />
<allow pkg="com.mojang.datafixers" />
</subpackage> </subpackage>
<subpackage name="sponge"> <subpackage name="sponge">

Datei-Diff unterdrückt, da er zu groß ist Diff laden

Datei anzeigen

@ -26,6 +26,7 @@ import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extension.platform.Capability;
import com.sk89q.worldedit.extension.platform.MultiUserPlatform; import com.sk89q.worldedit.extension.platform.MultiUserPlatform;
import com.sk89q.worldedit.extension.platform.Preference; import com.sk89q.worldedit.extension.platform.Preference;
import com.sk89q.worldedit.world.DataFixer;
import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.registry.Registries; import com.sk89q.worldedit.world.registry.Registries;
import net.minecraft.command.Commands; import net.minecraft.command.Commands;
@ -53,11 +54,13 @@ class ForgePlatform extends AbstractPlatform implements MultiUserPlatform {
private final ForgeWorldEdit mod; private final ForgeWorldEdit mod;
private final MinecraftServer server; private final MinecraftServer server;
private final ForgeDataFixer dataFixer;
private boolean hookingEvents = false; private boolean hookingEvents = false;
ForgePlatform(ForgeWorldEdit mod) { ForgePlatform(ForgeWorldEdit mod) {
this.mod = mod; this.mod = mod;
this.server = ServerLifecycleHooks.getCurrentServer(); this.server = ServerLifecycleHooks.getCurrentServer();
this.dataFixer = new ForgeDataFixer(getDataVersion());
} }
boolean isHookingEvents() { boolean isHookingEvents() {
@ -75,6 +78,11 @@ class ForgePlatform extends AbstractPlatform implements MultiUserPlatform {
return 1631; return 1631;
} }
@Override
public DataFixer getDataFixer() {
return dataFixer;
}
@Override @Override
public boolean isValidMobType(String type) { public boolean isValidMobType(String type) {
return net.minecraftforge.registries.ForgeRegistries.ENTITIES.containsKey(new ResourceLocation(type)); return net.minecraftforge.registries.ForgeRegistries.ENTITIES.containsKey(new ResourceLocation(type));