Update preprocessor and replace 1.13.2 subproject with 1.14.4-forge
The new preprocessor version brings first-party support for fabric, in particular for automatically fetching mappings loom and for automatically remapping between MC versions via intermediary mappings. This will come in handy when updating to 1.15. It also supports automatic remapping between fabric and forge on the same MC version (by going mcp<->srg<->mojang<->intermediary<->yarn). Therefore this commit replaces the previous 1.13.2 (forge) subproject with a 1.14.4-forge one. Instead of manually providing full mappings for 1.14.4-fabric to 1.13.2-forge and partial (classes) for 1.13.2-forge to 1.12.2-forge, we now only need partial (classes) for 1.12.2-forge to 1.14.4-forge and preprocessor will take care of the forge to fabric step (in fact, our mapping file for that is currently completely empty). In an attempt to write an IDE (IntelliJ) plugin for quicker and easier working with the preprocessor (e.g. immediately mapping single files from within the IDE, jumping between different versions for the same file), the preprocessor gradle plugin declaration now requires you to explicitly specify variables in the common.gradle and the overall relationship between projects in the build.gradle (latter is required anyway, so the plugin can know where it should map between forge and fabric and which subprojects are which versions). Since that necessitated some changes to the build.gradle file, I took the opportunity to convert it to Kotlin. As such we now also use Gradle's newer plugin-block with the pluginManagement-block instead of manually declaring buildScript (not for the common.gradle though), which imo is nicer anyway and comes with various advantages (see gradle docs). There were also some remapping bugs fixed and some new ones introduced (e.g. manually declared inner class mappings seem to no longer function properly under certain conditions). There's also support for remapping Kotlin now. Just saying.
This commit is contained in:
@@ -25,30 +25,34 @@ import net.minecraft.stat.StatHandler;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.Box;
|
||||
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
import com.replaymod.core.events.KeyBindingEventCallback;
|
||||
import com.replaymod.core.events.PreRenderCallback;
|
||||
import com.replaymod.core.events.PreRenderHandCallback;
|
||||
import com.replaymod.replay.events.RenderSpectatorCrosshairCallback;
|
||||
import de.johni0702.minecraft.gui.versions.callbacks.PreTickCallback;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.tag.Tag;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.hit.HitResult;
|
||||
//#else
|
||||
//$$ import com.replaymod.core.versions.MCVer;
|
||||
//$$ import com.replaymod.replay.events.ReplayChatMessageEvent;
|
||||
//$$ import net.minecraft.util.math.RayTraceResult;
|
||||
//$$ import net.minecraft.util.text.ITextComponent;
|
||||
//$$ import net.minecraft.world.World;
|
||||
//$$ import net.minecraftforge.client.event.EntityViewRenderEvent;
|
||||
//$$ import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
//$$ import net.minecraftforge.client.event.RenderHandEvent;
|
||||
//$$ import net.minecraftforge.common.MinecraftForge;
|
||||
//$$ import net.minecraftforge.eventbus.api.EventPriority;
|
||||
//$$ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
//$$ import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||
//$$ import net.minecraftforge.event.TickEvent;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11400
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.tag.Tag;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.hit.HitResult;
|
||||
//#else
|
||||
//$$ import com.replaymod.replay.events.ReplayChatMessageEvent;
|
||||
//$$ import net.minecraft.util.math.RayTraceResult;
|
||||
//$$ import net.minecraft.util.text.ITextComponent;
|
||||
//$$ import net.minecraft.world.World;
|
||||
//$$
|
||||
//#if MC>=11300
|
||||
//$$ import net.minecraft.util.math.RayTraceFluidMode;
|
||||
@@ -622,7 +626,7 @@ public class CameraEntity
|
||||
|
||||
private EventHandler() {}
|
||||
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
{ on(PreTickCallback.EVENT, this::onPreClientTick); }
|
||||
private void onPreClientTick() {
|
||||
//#else
|
||||
@@ -633,7 +637,7 @@ public class CameraEntity
|
||||
updateArmYawAndPitch();
|
||||
}
|
||||
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
{ on(PreRenderCallback.EVENT, this::onRenderUpdate); }
|
||||
private void onRenderUpdate() {
|
||||
//#else
|
||||
@@ -644,11 +648,11 @@ public class CameraEntity
|
||||
update();
|
||||
}
|
||||
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
{ on(KeyBindingEventCallback.EVENT, CameraEntity.this::handleInputEvents); }
|
||||
//#endif
|
||||
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
{ on(RenderSpectatorCrosshairCallback.EVENT, this::shouldRenderSpectatorCrosshair); }
|
||||
private Boolean shouldRenderSpectatorCrosshair() {
|
||||
return canSpectate(mc.targetedEntity);
|
||||
@@ -678,7 +682,7 @@ public class CameraEntity
|
||||
}
|
||||
}
|
||||
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
{ on(PreRenderHandCallback.EVENT, this::onRenderHand); }
|
||||
private boolean onRenderHand() {
|
||||
// Unless we are spectating another player, don't render our hand
|
||||
@@ -693,13 +697,13 @@ public class CameraEntity
|
||||
//$$ @SubscribeEvent
|
||||
//$$ public void onRenderHand(RenderHandEvent event) {
|
||||
//$$ // Unless we are spectating another player, don't render our hand
|
||||
//$$ if (getRenderViewEntity(mc) == CameraEntity.this || !(getRenderViewEntity(mc) instanceof EntityPlayer)) {
|
||||
//$$ if (getRenderViewEntity(mc) == CameraEntity.this || !(getRenderViewEntity(mc) instanceof PlayerEntity)) {
|
||||
//$$ event.setCanceled(true);
|
||||
//$$ }
|
||||
//$$ }
|
||||
//#endif
|
||||
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
private void onRenderHandMonitor() {
|
||||
//#else
|
||||
//$$ @SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
@@ -753,7 +757,7 @@ public class CameraEntity
|
||||
|
||||
private boolean heldItemTooltipsWasTrue;
|
||||
|
||||
//#if MC>=11400
|
||||
//#if FABRIC>=1
|
||||
// FIXME fabric
|
||||
//#else
|
||||
//$$ @SubscribeEvent
|
||||
|
||||
Reference in New Issue
Block a user