This repository has been archived by the owner on Aug 30, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace WorldHelpers#setBiome in CyclopsCore so that EvilCraft and other dependencies can update the biome as intended
- Loading branch information
Showing
5 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/uk/bobbytables/jeidsi/compat/cyclopscore/mixins/MixinWorldHelpers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package uk.bobbytables.jeidsi.compat.cyclopscore.mixins; | ||
|
||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.world.World; | ||
import net.minecraft.world.biome.Biome; | ||
import net.minecraft.world.chunk.Chunk; | ||
import net.minecraftforge.fml.common.network.NetworkRegistry; | ||
import org.cyclops.cyclopscore.helper.WorldHelpers; | ||
import org.dimdev.jeid.INewChunk; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Overwrite; | ||
import uk.bobbytables.jeidsi.network.JEIDsIPacketHandler; | ||
import uk.bobbytables.jeidsi.network.client.BiomeChangeMessage; | ||
|
||
@Mixin(WorldHelpers.class) | ||
public class MixinWorldHelpers { | ||
@Overwrite | ||
public static void setBiome(World world, BlockPos pos, Biome biome) { | ||
Chunk chunk = world.getChunk(pos); | ||
((INewChunk) chunk).getIntBiomeArray()[(pos.getZ() & 0xF) << 4 | pos.getX() & 0xF] = Biome.getIdForBiome(biome); | ||
chunk.markDirty(); | ||
if (!world.isRemote) { | ||
JEIDsIPacketHandler.INSTANCE.sendToAllAround( | ||
new BiomeChangeMessage(pos.getX(), pos.getZ(), Biome.getIdForBiome(biome)), | ||
new NetworkRegistry.TargetPoint(world.provider.getDimension(), pos.getX(), 128.0D, pos.getZ(), 128.0D) | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"package": "uk.bobbytables.jeidsi.compat.cyclopscore", | ||
"required": true, | ||
"refmap": "mixins.jeidsi.refmap.json", | ||
"target": "@env(DEFAULT)", | ||
"minVersion": "0.6", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": [ | ||
"mixins.MixinWorldHelpers" | ||
] | ||
} |