Fixed 1.19 building
This commit is contained in:
@@ -120,7 +120,7 @@ https://fabricmc.net/wiki/tutorial:setup
|
|||||||
4. Import the project into eclipse
|
4. Import the project into eclipse
|
||||||
|
|
||||||
## Switching Versions
|
## Switching Versions
|
||||||
This branch support 6 built versions:
|
This branch support 9 built versions:
|
||||||
- 1.19.4
|
- 1.19.4
|
||||||
- 1.19.3
|
- 1.19.3
|
||||||
- 1.19.2
|
- 1.19.2
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton;
|
|||||||
import net.minecraft.client.gui.screens.OptionsScreen;
|
import net.minecraft.client.gui.screens.OptionsScreen;
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
#if PRE_MC_1_19_1
|
#if PRE_MC_1_19
|
||||||
import net.minecraft.network.chat.TranslatableComponent;
|
import net.minecraft.network.chat.TranslatableComponent;
|
||||||
#endif
|
#endif
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
@@ -69,7 +69,7 @@ public class MixinOptionsScreen extends Screen {
|
|||||||
// For now it goes to the client option by default
|
// For now it goes to the client option by default
|
||||||
(buttonWidget) -> Objects.requireNonNull(minecraft).setScreen(ConfigGui.getScreen(this, "client")),
|
(buttonWidget) -> Objects.requireNonNull(minecraft).setScreen(ConfigGui.getScreen(this, "client")),
|
||||||
// Add a title to the screen
|
// Add a title to the screen
|
||||||
#if PRE_MC_1_19_1
|
#if PRE_MC_1_19
|
||||||
new TranslatableComponent("text.autoconfig." + ModInfo.ID + ".title")));
|
new TranslatableComponent("text.autoconfig." + ModInfo.ID + ".title")));
|
||||||
#else
|
#else
|
||||||
Component.translatable("text.autoconfig." + ModInfo.ID + ".title")));
|
Component.translatable("text.autoconfig." + ModInfo.ID + ".title")));
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import com.seibel.lod.common.wrappers.world.WorldWrapper;
|
|||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraftforge.client.event.InputEvent;
|
import net.minecraftforge.client.event.InputEvent;
|
||||||
import net.minecraftforge.event.TickEvent;
|
import net.minecraftforge.event.TickEvent;
|
||||||
#if PRE_MC_1_19_1
|
#if PRE_MC_1_19
|
||||||
import net.minecraftforge.event.world.BlockEvent;
|
import net.minecraftforge.event.world.BlockEvent;
|
||||||
import net.minecraftforge.event.world.ChunkEvent;
|
import net.minecraftforge.event.world.ChunkEvent;
|
||||||
import net.minecraftforge.event.world.WorldEvent;
|
import net.minecraftforge.event.world.WorldEvent;
|
||||||
@@ -70,7 +70,7 @@ public class ForgeClientProxy
|
|||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void chunkLoadEvent(ChunkEvent.Load event)
|
public void chunkLoadEvent(ChunkEvent.Load event)
|
||||||
{
|
{
|
||||||
#if PRE_MC_1_19_1
|
#if PRE_MC_1_19
|
||||||
clientApi.clientChunkLoadEvent(new ChunkWrapper(event.getChunk(), event.getWorld()), WorldWrapper.getWorldWrapper(event.getWorld()));
|
clientApi.clientChunkLoadEvent(new ChunkWrapper(event.getChunk(), event.getWorld()), WorldWrapper.getWorldWrapper(event.getWorld()));
|
||||||
#else
|
#else
|
||||||
clientApi.clientChunkLoadEvent(new ChunkWrapper(event.getChunk(), event.getLevel()), WorldWrapper.getWorldWrapper(event.getLevel()));
|
clientApi.clientChunkLoadEvent(new ChunkWrapper(event.getChunk(), event.getLevel()), WorldWrapper.getWorldWrapper(event.getLevel()));
|
||||||
@@ -78,7 +78,7 @@ public class ForgeClientProxy
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
#if PRE_MC_1_19_1
|
#if PRE_MC_1_19
|
||||||
public void worldSaveEvent(WorldEvent.Save event)
|
public void worldSaveEvent(WorldEvent.Save event)
|
||||||
#else
|
#else
|
||||||
public void worldSaveEvent(LevelEvent.Save event)
|
public void worldSaveEvent(LevelEvent.Save event)
|
||||||
@@ -89,7 +89,7 @@ public class ForgeClientProxy
|
|||||||
|
|
||||||
/** This is also called when a new dimension loads */
|
/** This is also called when a new dimension loads */
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
#if PRE_MC_1_19_1
|
#if PRE_MC_1_19
|
||||||
public void worldLoadEvent(WorldEvent.Load event)
|
public void worldLoadEvent(WorldEvent.Load event)
|
||||||
#else
|
#else
|
||||||
public void worldLoadEvent(LevelEvent.Load event)
|
public void worldLoadEvent(LevelEvent.Load event)
|
||||||
@@ -97,7 +97,7 @@ public class ForgeClientProxy
|
|||||||
{
|
{
|
||||||
if (Minecraft.getInstance().screen instanceof TitleScreen) return;
|
if (Minecraft.getInstance().screen instanceof TitleScreen) return;
|
||||||
if (Minecraft.getInstance().getConnection() == null) return; // In 1.19.3, the multiplayer world load is called twice. The first time is before it actually connects to the multiplayer server (so stuff like ip and name arent sent out yet)
|
if (Minecraft.getInstance().getConnection() == null) return; // In 1.19.3, the multiplayer world load is called twice. The first time is before it actually connects to the multiplayer server (so stuff like ip and name arent sent out yet)
|
||||||
#if PRE_MC_1_19_1
|
#if PRE_MC_1_19
|
||||||
if (event.getWorld() != null) {
|
if (event.getWorld() != null) {
|
||||||
eventApi.worldLoadEvent(WorldWrapper.getWorldWrapper(event.getWorld()));
|
eventApi.worldLoadEvent(WorldWrapper.getWorldWrapper(event.getWorld()));
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,7 @@ public class ForgeClientProxy
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
#if PRE_MC_1_19_1
|
#if PRE_MC_1_19
|
||||||
public void worldUnloadEvent(WorldEvent.Unload event)
|
public void worldUnloadEvent(WorldEvent.Unload event)
|
||||||
{
|
{
|
||||||
eventApi.worldUnloadEvent(WorldWrapper.getWorldWrapper(event.getWorld()));
|
eventApi.worldUnloadEvent(WorldWrapper.getWorldWrapper(event.getWorld()));
|
||||||
@@ -131,7 +131,7 @@ public class ForgeClientProxy
|
|||||||
event.getClass() == BlockEvent.FluidPlaceBlockEvent.class ||
|
event.getClass() == BlockEvent.FluidPlaceBlockEvent.class ||
|
||||||
event.getClass() == BlockEvent.PortalSpawnEvent.class)
|
event.getClass() == BlockEvent.PortalSpawnEvent.class)
|
||||||
{
|
{
|
||||||
#if PRE_MC_1_19_1
|
#if PRE_MC_1_19
|
||||||
IChunkWrapper chunk = new ChunkWrapper(event.getWorld().getChunk(event.getPos()), event.getWorld());
|
IChunkWrapper chunk = new ChunkWrapper(event.getWorld().getChunk(event.getPos()), event.getWorld());
|
||||||
DimensionTypeWrapper dimType = DimensionTypeWrapper.getDimensionTypeWrapper(event.getWorld().dimensionType());
|
DimensionTypeWrapper dimType = DimensionTypeWrapper.getDimensionTypeWrapper(event.getWorld().dimensionType());
|
||||||
#else
|
#else
|
||||||
@@ -145,7 +145,7 @@ public class ForgeClientProxy
|
|||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onKeyInput(#if PRE_MC_1_19_1 InputEvent.KeyInputEvent event #else InputEvent.Key event #endif)
|
public void onKeyInput(#if PRE_MC_1_19 InputEvent.KeyInputEvent event #else InputEvent.Key event #endif)
|
||||||
{
|
{
|
||||||
if (Minecraft.getInstance().player == null) return;
|
if (Minecraft.getInstance().player == null) return;
|
||||||
if (event.getAction() != GLFW.GLFW_PRESS) return;
|
if (event.getAction() != GLFW.GLFW_PRESS) return;
|
||||||
|
|||||||
@@ -49,14 +49,14 @@ import net.minecraftforge.fml.loading.FMLLoader;
|
|||||||
import net.minecraftforge.fml.ExtensionPoint;
|
import net.minecraftforge.fml.ExtensionPoint;
|
||||||
#elif MC_1_17_1
|
#elif MC_1_17_1
|
||||||
import net.minecraftforge.fmlclient.ConfigGuiHandler;
|
import net.minecraftforge.fmlclient.ConfigGuiHandler;
|
||||||
#elif POST_MC_1_19_1
|
#elif POST_MC_1_19
|
||||||
import net.minecraftforge.client.ConfigScreenHandler;
|
import net.minecraftforge.client.ConfigScreenHandler;
|
||||||
#else // 1.18+ untill 1.19
|
#else // 1.18+ untill 1.19
|
||||||
import net.minecraftforge.client.ConfigGuiHandler;
|
import net.minecraftforge.client.ConfigGuiHandler;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// these imports change due to forge refactoring classes in 1.19
|
// these imports change due to forge refactoring classes in 1.19
|
||||||
#if POST_MC_1_19_1
|
#if POST_MC_1_19
|
||||||
import net.minecraft.util.RandomSource;
|
import net.minecraft.util.RandomSource;
|
||||||
import net.minecraft.client.renderer.RenderType;
|
import net.minecraft.client.renderer.RenderType;
|
||||||
import net.minecraftforge.client.model.data.ModelData;
|
import net.minecraftforge.client.model.data.ModelData;
|
||||||
@@ -109,7 +109,7 @@ public class ForgeMain implements LodForgeMethodCaller
|
|||||||
#if PRE_MC_1_17_1
|
#if PRE_MC_1_17_1
|
||||||
ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.CONFIGGUIFACTORY,
|
ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.CONFIGGUIFACTORY,
|
||||||
() -> (client, parent) -> ConfigGui.getScreen(parent, ""));
|
() -> (client, parent) -> ConfigGui.getScreen(parent, ""));
|
||||||
#elif POST_MC_1_19_1
|
#elif POST_MC_1_19
|
||||||
ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class,
|
ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class,
|
||||||
() -> new ConfigScreenHandler.ConfigScreenFactory((client, parent) -> ConfigGui.getScreen(parent, "")));
|
() -> new ConfigScreenHandler.ConfigScreenFactory((client, parent) -> ConfigGui.getScreen(parent, "")));
|
||||||
#else
|
#else
|
||||||
@@ -120,21 +120,21 @@ public class ForgeMain implements LodForgeMethodCaller
|
|||||||
MinecraftForge.EVENT_BUS.register(forgeClientProxy);
|
MinecraftForge.EVENT_BUS.register(forgeClientProxy);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if PRE_MC_1_19_1
|
#if PRE_MC_1_19_
|
||||||
private final ModelDataMap modelData = new ModelDataMap.Builder().build();
|
private final ModelDataMap modelData = new ModelDataMap.Builder().build();
|
||||||
#else
|
#else
|
||||||
private final ModelData modelData = ModelData.EMPTY;
|
private final ModelData modelData = ModelData.EMPTY;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
#if PRE_MC_1_19_1
|
#if PRE_MC_1_19
|
||||||
public List<BakedQuad> getQuads(MinecraftClientWrapper mc, Block block, BlockState blockState, Direction direction, Random random) {
|
public List<BakedQuad> getQuads(MinecraftClientWrapper mc, Block block, BlockState blockState, Direction direction, Random random) {
|
||||||
return mc.getModelManager().getBlockModelShaper().getBlockModel(block.defaultBlockState()).getQuads(blockState, direction, random, modelData);
|
return mc.getModelManager().getBlockModelShaper().getBlockModel(block.defaultBlockState()).getQuads(blockState, direction, random, modelData);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
public List<BakedQuad> getQuads(MinecraftClientWrapper mc, Block block, BlockState blockState, Direction direction, RandomSource random)
|
public List<BakedQuad> getQuads(MinecraftClientWrapper mc, Block block, BlockState blockState, Direction direction, RandomSource random)
|
||||||
{
|
{
|
||||||
return mc.getModelManager().getBlockModelShaper().getBlockModel(block.defaultBlockState()).getQuads(blockState, direction, random, modelData #if POST_MC_1_19_1, RenderType.solid() #endif);
|
return mc.getModelManager().getBlockModelShaper().getBlockModel(block.defaultBlockState()).getQuads(blockState, direction, random, modelData #if POST_MC_1_19, RenderType.solid() #endif);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import com.seibel.lod.core.wrapperInterfaces.config.ILodConfigWrapperSingleton;
|
|||||||
import net.minecraft.client.gui.screens.OptionsScreen;
|
import net.minecraft.client.gui.screens.OptionsScreen;
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
import net.minecraft.network.chat.Component;
|
import net.minecraft.network.chat.Component;
|
||||||
#if PRE_MC_1_19_1
|
#if PRE_MC_1_19
|
||||||
import net.minecraft.network.chat.TranslatableComponent;
|
import net.minecraft.network.chat.TranslatableComponent;
|
||||||
#endif
|
#endif
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
@@ -69,7 +69,7 @@ public class MixinOptionsScreen extends Screen {
|
|||||||
// For now it goes to the client option by default
|
// For now it goes to the client option by default
|
||||||
(buttonWidget) -> Objects.requireNonNull(minecraft).setScreen(ConfigGui.getScreen(this, "client")),
|
(buttonWidget) -> Objects.requireNonNull(minecraft).setScreen(ConfigGui.getScreen(this, "client")),
|
||||||
// Add a title to the screen
|
// Add a title to the screen
|
||||||
#if PRE_MC_1_19_1
|
#if PRE_MC_1_19
|
||||||
new TranslatableComponent("text.autoconfig." + ModInfo.ID + ".title")));
|
new TranslatableComponent("text.autoconfig." + ModInfo.ID + ".title")));
|
||||||
#else
|
#else
|
||||||
Component.translatable("text.autoconfig." + ModInfo.ID + ".title")));
|
Component.translatable("text.autoconfig." + ModInfo.ID + ".title")));
|
||||||
|
|||||||
Reference in New Issue
Block a user