mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-01 15:37:24 +00:00
Fix fabric
This commit is contained in:
parent
bd253ea5d2
commit
6984dc29d0
@ -26,8 +26,8 @@ dependencies {
|
|||||||
|
|
||||||
modImplementation("net.fabricmc:fabric-loader:${Versions.Mod.fabricLoader}")
|
modImplementation("net.fabricmc:fabric-loader:${Versions.Mod.fabricLoader}")
|
||||||
|
|
||||||
modImplementation("org.incendo", "cloud-fabric", Versions.Fabric.cloud)
|
// modImplementation("org.incendo", "cloud-fabric", Versions.Fabric.cloud)
|
||||||
include("org.incendo", "cloud-fabric", Versions.Fabric.cloud)
|
// include("org.incendo", "cloud-fabric", Versions.Fabric.cloud)
|
||||||
|
|
||||||
modRuntimeOnly("net.fabricmc.fabric-api", "fabric-api", Versions.Fabric.fabricAPI)
|
modRuntimeOnly("net.fabricmc.fabric-api", "fabric-api", Versions.Fabric.fabricAPI)
|
||||||
}
|
}
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
package com.dfsek.terra.mod.mixin.fix;
|
|
||||||
|
|
||||||
import net.minecraft.entity.passive.BeeEntity.MoveToFlowerGoal;
|
|
||||||
import net.minecraft.entity.passive.BeeEntity.MoveToHiveGoal;
|
|
||||||
import net.minecraft.util.math.random.CheckedRandom;
|
|
||||||
import net.minecraft.util.math.random.Random;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
|
||||||
|
|
||||||
import com.dfsek.terra.mod.CommonPlatform;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bees spawning uses world.random without synchronization. This causes issues when spawning bees during world generation.
|
|
||||||
*/
|
|
||||||
@Mixin({
|
|
||||||
MoveToHiveGoal.class,
|
|
||||||
MoveToFlowerGoal.class
|
|
||||||
})
|
|
||||||
public class BeeMoveGoalsUnsynchronizedRandomAccessFix {
|
|
||||||
@Redirect(method = "<init>",
|
|
||||||
at = @At(value = "FIELD", target = "Lnet/minecraft/world/World;random:Lnet/minecraft/util/math/random/Random;"))
|
|
||||||
public Random redirectRandomAccess(World instance) {
|
|
||||||
return new CheckedRandom(CommonPlatform.get().getServer().getTicks()); // replace with new random seeded by tick time.
|
|
||||||
}
|
|
||||||
}
|
|
@ -9,7 +9,6 @@
|
|||||||
"access.StateAccessor",
|
"access.StateAccessor",
|
||||||
"access.StructureAccessorAccessor",
|
"access.StructureAccessorAccessor",
|
||||||
"access.VillagerTypeAccessor",
|
"access.VillagerTypeAccessor",
|
||||||
"fix.BeeMoveGoalsUnsynchronizedRandomAccessFix",
|
|
||||||
"fix.NetherFossilOptimization",
|
"fix.NetherFossilOptimization",
|
||||||
"implementations.compat.GenerationSettingsFloraFeaturesMixin",
|
"implementations.compat.GenerationSettingsFloraFeaturesMixin",
|
||||||
"implementations.terra.BiomeMixin",
|
"implementations.terra.BiomeMixin",
|
||||||
|
@ -15,10 +15,10 @@ dependencies {
|
|||||||
minecraft("com.mojang:minecraft:${Versions.Mod.minecraft}")
|
minecraft("com.mojang:minecraft:${Versions.Mod.minecraft}")
|
||||||
mappings("net.fabricmc:yarn:${Versions.Mod.yarn}:v2")
|
mappings("net.fabricmc:yarn:${Versions.Mod.yarn}:v2")
|
||||||
|
|
||||||
modImplementation("org.incendo", "cloud-fabric", Versions.Fabric.cloud) {
|
// modImplementation("org.incendo", "cloud-fabric", Versions.Fabric.cloud) {
|
||||||
exclude("net.fabricmc")
|
// exclude("net.fabricmc")
|
||||||
exclude("net.fabricmc.fabric-api")
|
// exclude("net.fabricmc.fabric-api")
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
loom {
|
loom {
|
||||||
|
@ -4,9 +4,9 @@ import com.dfsek.terra.api.command.CommandSender;
|
|||||||
import com.dfsek.terra.api.event.events.platform.CommandRegistrationEvent;
|
import com.dfsek.terra.api.event.events.platform.CommandRegistrationEvent;
|
||||||
|
|
||||||
import net.minecraft.server.command.ServerCommandSource;
|
import net.minecraft.server.command.ServerCommandSource;
|
||||||
import org.incendo.cloud.SenderMapper;
|
//import org.incendo.cloud.SenderMapper;
|
||||||
import org.incendo.cloud.execution.ExecutionCoordinator;
|
//import org.incendo.cloud.execution.ExecutionCoordinator;
|
||||||
import org.incendo.cloud.fabric.FabricServerCommandManager;
|
//import org.incendo.cloud.fabric.FabricServerCommandManager;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -17,16 +17,16 @@ public final class LifecycleEntryPoint {
|
|||||||
public static void initialize(String modName, LifecyclePlatform platform) {
|
public static void initialize(String modName, LifecyclePlatform platform) {
|
||||||
logger.info("Initializing Terra {} mod...", modName);
|
logger.info("Initializing Terra {} mod...", modName);
|
||||||
|
|
||||||
FabricServerCommandManager<CommandSender> manager = new FabricServerCommandManager<>(
|
// FabricServerCommandManager<CommandSender> manager = new FabricServerCommandManager<>(
|
||||||
ExecutionCoordinator.simpleCoordinator(),
|
// ExecutionCoordinator.simpleCoordinator(),
|
||||||
SenderMapper.create(
|
// SenderMapper.create(
|
||||||
serverCommandSource -> (CommandSender) serverCommandSource,
|
// serverCommandSource -> (CommandSender) serverCommandSource,
|
||||||
commandSender -> (ServerCommandSource) commandSender)
|
// commandSender -> (ServerCommandSource) commandSender)
|
||||||
);
|
// );
|
||||||
|
//
|
||||||
|
//
|
||||||
manager.brigadierManager().setNativeNumberSuggestions(false);
|
// manager.brigadierManager().setNativeNumberSuggestions(false);
|
||||||
|
//
|
||||||
platform.getEventManager().callEvent(new CommandRegistrationEvent(manager));
|
// platform.getEventManager().callEvent(new CommandRegistrationEvent(manager));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user