-
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.
- Loading branch information
Showing
14 changed files
with
260 additions
and
90 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
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 |
---|---|---|
@@ -1 +1 @@ | ||
Mixin Implementation Report generated on 2023-05-12 15:14:07 | ||
Mixin Implementation Report generated on 2023-11-05 21:42:25 |
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
[15:14:07] [main/INFO] (FabricLoader) Loading for game Minecraft 1.5.2 | ||
[15:14:07] [main/INFO] (Fabric|Loader) [FabricLoaderImpl] Loading 4 mods: minecraft@1.5.2, betterterrain@3.2.1, java@8, fabricloader@1.0.0 | ||
[15:14:07] [main/INFO] (mixin) SpongePowered MIXIN Subsystem Version=0.8.2 Source=file:/C:/Users/abiga/.gradle/caches/modules-2/files-2.1/net.fabricmc/sponge-mixin/0.9.2+mixin.0.8.2/12c437eebf031967eaa7daad861e115932772cc7/sponge-mixin-0.9.2+mixin.0.8.2.jar Service=Knot/Fabric Env=CLIENT | ||
[15:14:07] [main/INFO] (Fabric|MixinBootstrap) Loaded Fabric development mappings for mixin remapper! | ||
[21:42:24] [main/INFO] (FabricLoader) Loading for game Minecraft 1.5.2 | ||
[21:42:24] [main/INFO] (Fabric|Loader) [FabricLoaderImpl] Loading 5 mods: minecraft@1.5.2, betterterrain@3.2.1, java@8, fabricloader@1.0.0, decoaddon@4.1.0 | ||
[21:42:24] [main/INFO] (mixin) SpongePowered MIXIN Subsystem Version=0.8.2 Source=file:/C:/Users/abiga/.gradle/caches/modules-2/files-2.1/net.fabricmc/sponge-mixin/0.9.2+mixin.0.8.2/12c437eebf031967eaa7daad861e115932772cc7/sponge-mixin-0.9.2+mixin.0.8.2.jar Service=Knot/Fabric Env=CLIENT | ||
[21:42:24] [main/INFO] (Fabric|MixinBootstrap) Loaded Fabric development mappings for mixin remapper! | ||
[21:42:25] [main/WARN] (mixin) @Mixin target net/minecraft/src/SlotRepair is public in decoaddon.inventory.mixins.json:SlotRepairMixin and should be specified in value |
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
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
103 changes: 103 additions & 0 deletions
103
src/main/java/betterterrain/mixins/StructureVillagePiecesMixin.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,103 @@ | ||
package betterterrain.mixins; | ||
|
||
import betterterrain.structure.mapgen.BTAMapGenVillage; | ||
import betterterrain.world.BTAWorldChunkManager; | ||
import net.minecraft.src.*; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Overwrite; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Random; | ||
|
||
@Mixin(StructureVillagePieces.class) | ||
public abstract class StructureVillagePiecesMixin { | ||
/** | ||
* @author Dawnraider00 / TheLadyDawn | ||
* @reason Changing of conditional statement which would otherwise require complicated mixin in order to preserve determinism in world generation | ||
*/ | ||
@Overwrite | ||
private static StructureComponent getNextVillageStructureComponent(ComponentVillageStartPiece componentVillageStartPiece, List list, Random rand, int par3, int par4, int par5, int par6, int par7) { | ||
if (par7 > 50) { | ||
return null; | ||
} else if (Math.abs(par3 - componentVillageStartPiece.getBoundingBox().minX) <= 112 && Math.abs(par5 - componentVillageStartPiece.getBoundingBox().minZ) <= 112) { | ||
ComponentVillage var8 = getNextVillageComponent(componentVillageStartPiece, list, rand, par3, par4, par5, par6, par7 + 1); | ||
|
||
if (var8 != null) { | ||
int var9 = (var8.getBoundingBox().minX + var8.getBoundingBox().maxX) / 2; | ||
int var10 = (var8.getBoundingBox().minZ + var8.getBoundingBox().maxZ) / 2; | ||
int var11 = var8.getBoundingBox().maxX - var8.getBoundingBox().minX; | ||
int var12 = var8.getBoundingBox().maxZ - var8.getBoundingBox().minZ; | ||
int var13 = var11 > var12 ? var11 : var12; | ||
|
||
List villageSpawnBiomesList; | ||
|
||
if (componentVillageStartPiece.getWorldChunkManager() instanceof BTAWorldChunkManager) { | ||
System.out.println("BTAWorld"); | ||
villageSpawnBiomesList = MapGenVillage.villageSpawnBiomes; | ||
} else { | ||
System.out.println("Regular World"); | ||
villageSpawnBiomesList = MapGenVillage.villageSpawnBiomes; | ||
} | ||
|
||
if (componentVillageStartPiece.getWorldChunkManager().areBiomesViable(var9, var10, var13 / 2 + 4, villageSpawnBiomesList)) { | ||
list.add(var8); | ||
componentVillageStartPiece.field_74932_i.add(var8); | ||
return var8; | ||
} | ||
} | ||
|
||
return null; | ||
} else { | ||
return null; | ||
} | ||
} | ||
|
||
/** | ||
* @author Dawnraider00 / TheLadyDawn | ||
* @reason Changing of conditional statement which would otherwise require complicated mixin in order to preserve determinism in world generation | ||
*/ | ||
@Overwrite | ||
private static StructureComponent getNextComponentVillagePath(ComponentVillageStartPiece componentVillageStartPiece, List list, Random rand, int par3, int par4, int par5, int par6, int par7) { | ||
if (par7 > 3 + componentVillageStartPiece.terrainType) { | ||
return null; | ||
} else if (Math.abs(par3 - componentVillageStartPiece.getBoundingBox().minX) <= 112 && Math.abs(par5 - componentVillageStartPiece.getBoundingBox().minZ) <= 112) { | ||
StructureBoundingBox var8 = ComponentVillagePathGen.func_74933_a(componentVillageStartPiece, list, rand, par3, par4, par5, par6); | ||
|
||
if (var8 != null && var8.minY > 10) { | ||
ComponentVillagePathGen var9 = new ComponentVillagePathGen(componentVillageStartPiece, par7, rand, var8, par6); | ||
int var10 = (var9.getBoundingBox().minX + var9.getBoundingBox().maxX) / 2; | ||
int var11 = (var9.getBoundingBox().minZ + var9.getBoundingBox().maxZ) / 2; | ||
int var12 = var9.getBoundingBox().maxX - var9.getBoundingBox().minX; | ||
int var13 = var9.getBoundingBox().maxZ - var9.getBoundingBox().minZ; | ||
int var14 = var12 > var13 ? var12 : var13; | ||
|
||
List villageSpawnBiomesList; | ||
|
||
if (componentVillageStartPiece.getWorldChunkManager() instanceof BTAWorldChunkManager) { | ||
System.out.println("BTAWorld"); | ||
villageSpawnBiomesList = MapGenVillage.villageSpawnBiomes; | ||
} else { | ||
System.out.println("Regular World"); | ||
villageSpawnBiomesList = MapGenVillage.villageSpawnBiomes; | ||
} | ||
|
||
if (componentVillageStartPiece.getWorldChunkManager().areBiomesViable(var10, var11, var14 / 2 + 4, villageSpawnBiomesList)) { | ||
list.add(var9); | ||
componentVillageStartPiece.field_74930_j.add(var9); | ||
return var9; | ||
} | ||
} | ||
|
||
return null; | ||
} else { | ||
return null; | ||
} | ||
} | ||
|
||
@Shadow | ||
private static ComponentVillage getNextVillageComponent(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { | ||
throw new IllegalStateException(); | ||
} | ||
} |
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
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