Skip to content

Commit

Permalink
Improved mod compatibility when sleeping in Atum
Browse files Browse the repository at this point in the history
  • Loading branch information
GirafiStudios committed Jul 12, 2020
1 parent f692d95 commit af6443d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ repositories {
name = "TheOneProbe"
url = "https://maven.tterrag.com"
}
flatDir { dirs 'deps' }
}

version = "${minecraft_version}-${mod_version}" + getBuildNumber()
Expand Down Expand Up @@ -76,6 +77,7 @@ dependencies {
compile fg.deobf("mcp.mobius.waila:Hwyla:${hwyla_version}_${minecraft_version}")
compileOnly fg.deobf("com.blamejared.crafttweaker:CraftTweaker-${minecraft_version}:${ct_version}")
compile "mcjty.theoneprobe:TheOneProbe-1.15:${top_version}:api"
runtimeOnly fg.deobf("flatdir:champions:1.15.2-2.0-beta4")
}


Expand Down
Binary file added deps/champions-1.15.2-2.0-beta4.jar
Binary file not shown.
Binary file removed libs/champions-1.12.2-1.0.11.3.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.teammetallurgy.atum.Atum;
import com.teammetallurgy.atum.integration.IModIntegration;
import com.teammetallurgy.atum.integration.IntegrationHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.MissingTextureSprite;
import net.minecraft.client.renderer.texture.SimpleTexture;
Expand All @@ -19,14 +18,14 @@ public class ChampionsHelper implements IModIntegration {

@OnlyIn(Dist.CLIENT)
public static boolean isChampion(Entity entity) {
if (IntegrationHandler.getConfigValue(CHAMPION_ID)) {
/*if (IntegrationHandler.getConfigValue(CHAMPION_ID)) {
CompoundNBT compound = new CompoundNBT();
entity.deserializeNBT(compound);
entity.deserializeNBT(compound); //TODO, breaks entities currently
if (compound.contains("ForgeCaps")) {
CompoundNBT forgeCaps = compound.getCompound("ForgeCaps");
return forgeCaps.contains("champions:championship");
return forgeCaps.contains("champions:champion");
}
}
}*/
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.IWorld;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.provider.BiomeProviderType;
Expand All @@ -37,6 +38,7 @@
import net.minecraft.world.server.ServerWorld;
import net.minecraft.world.storage.DerivedWorldInfo;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.world.SleepFinishedTimeEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

Expand Down Expand Up @@ -75,12 +77,14 @@ public boolean doesWaterVaporize() {
}
}

@Override
public void setWorldTime(long time) {
if (time == 24000L && this.world.getWorldInfo() instanceof DerivedWorldInfo) {
((DerivedWorldInfo) this.world.getWorldInfo()).delegate.setDayTime(time); //Workaround for making sleeping work in Atum
@SubscribeEvent
public static void onSleepFinished(SleepFinishedTimeEvent event) {
IWorld world = event.getWorld();
if (world.getDimension() instanceof AtumDimension) {
if (world.getWorldInfo() instanceof DerivedWorldInfo) {
((DerivedWorldInfo) world.getWorldInfo()).delegate.setDayTime(event.getNewTime()); //Workaround for making sleeping work in Atum
}
}
super.setWorldTime(time);
}

@Override
Expand Down

0 comments on commit af6443d

Please sign in to comment.