Skip to content

Commit

Permalink
Merge pull request #42 from BTW-Community/v3.2.1
Browse files Browse the repository at this point in the history
V3.2.1
  • Loading branch information
ammoore00 authored May 12, 2023
2 parents 568c173 + aa05d6f commit 4fd8ffe
Show file tree
Hide file tree
Showing 15 changed files with 183 additions and 137 deletions.
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ Version 3.X.0
[*]Changed black stone to be able to spawn nether mobs.
[/list]

Version 3.2.1
- Changed grassy clay to behave like regular grass blocks. It can spread grass, grass can spread to dirt clay blocks, and animals can eat grassy clay.
- Changed how grassy clay renders to only render clay in the dirt instead of in the grass as well.
- Removed the grassy clay overlay texture as it is no longer used.
- Fixed an issue where mahogany trees try to generate with mahogany wood instead of jungle wood without deco installed, crashing the game.

Version 3.2.0
- Updated to CE 2.0.2 and Deco 4.1.0.
- Refactored how tree generation is handled internally.
Expand Down
3 changes: 3 additions & 0 deletions changelog_betterbiomes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Version 3.2.1
- Fixed an issue where dark oak trees tried to generate in old growth woodland when deco was not installed, crashing the game

Version 3.2.0
- Updated to CE 2.0.2 and Deco 4.1.0.
- Refactored how tree generation is handled internally.
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ minecraft_version = 1.5.2
yarn_mappings = 1.5.2+build.202201092137
loader_version = 1.0.0

mod_version = 3.2.0
mod_version = 3.2.1
maven_group = betterterrain
archives_base_name = Better-Terrain-Addon

Expand Down
2 changes: 1 addition & 1 deletion run/.mixin.out/audit/mixin_implementation_report.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Mixin Implementation Report generated on 2023-04-14 20:31:21
Mixin Implementation Report generated on 2023-05-12 15:14:07
Binary file modified run/logs/debug-1.log.gz
Binary file not shown.
134 changes: 68 additions & 66 deletions run/logs/debug.log

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions run/logs/latest.log
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[20:31:20] [main/INFO] (FabricLoader) Loading for game Minecraft 1.5.2
[20:31:20] [main/INFO] (Fabric|Loader) [FabricLoaderImpl] Loading 4 mods: [email protected], [email protected].0, java@8, [email protected]
[20:31:21] [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=SERVER
[20:31:21] [main/INFO] (Fabric|MixinBootstrap) Loaded Fabric development mappings for mixin remapper!
[15:14:07] [main/INFO] (FabricLoader) Loading for game Minecraft 1.5.2
[15:14:07] [main/INFO] (Fabric|Loader) [FabricLoaderImpl] Loading 4 mods: [email protected], [email protected].1, java@8, [email protected]
[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!
3 changes: 2 additions & 1 deletion src/main/java/betterbiomes/BetterBiomesMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ public class BetterBiomesMod extends BTAAddon {
public static final AddonVersion V3_0_0 = new AddonVersion(3, 0, 0, getInstance());
public static final AddonVersion V3_1_0 = new AddonVersion(3, 1, 0, getInstance());
public static final AddonVersion V3_2_0 = new AddonVersion(3, 2, 0, getInstance());
public static final AddonVersion V3_2_1 = new AddonVersion(3, 2, 1, getInstance());

private BetterBiomesMod() {
super("Better Biomes", "betterbiomes", "3.2.0", "BB");
super("Better Biomes", "betterbiomes", "3.2.1", "BB");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ public class BetterBiomesConfiguration extends BiomeConfiguration {
public static final BTABiome iceMarsh = new IceMarshBiome(ICE_MARSH_ID, "betterbiomes:ice_marsh", Climate.SNOWY)
.setBiomeName("Ice Marsh")
.setSpawnsWitchHuts()
.setSpawnsSugarCane()
.setSurfaceBuilder(new SwampSurfaceBuilder(false))
.setTemperatureRainfall(0.1F, 0.3F)
.setMinMaxHeight(-0.1F, 0.3F)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public void initTreeGrowerMap() {
this.treeGrowers.put(TreeGrowers.BIG_OAK_TREE, 6);
this.treeGrowers.put(BTATreeGrowers.TALL_OAK_TREE, 10);
this.treeGrowers.put(BTATreeGrowers.BIG_BIRCH_TREE, 1);
this.treeGrowers.put(BTATreeGrowers.DARK_OAK_TREE, 1);

this.decoTreeGrowers.put(BTATreeGrowers.HUGE_OAK_TREE, 3);
this.decoTreeGrowers.put(TreeGrowers.BIG_OAK_TREE, 6);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/betterterrain/BTAMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class BTAMod extends BTWAddon {
public static Material netherSand;

private BTAMod() {
super("Better Terrain", "3.2.0", "BTA");
super("Better Terrain", "3.2.1", "BTA");
this.currentVersion = BTAVersion.fromString(this.getVersionString());
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/betterterrain/BTAVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public enum BTAVersion {

V3_1_0(3, 1, 0),

V3_2_0(3, 2, 0);
V3_2_0(3, 2, 0),
V3_2_1(3, 2, 1);

private final int major;
private final int minor;
Expand Down
64 changes: 50 additions & 14 deletions src/main/java/betterterrain/mixins/ClayBlockMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import betterterrain.BTAMod;
import betterterrain.block.util.ClayHelper;
import btw.BTWAddon;
import btw.block.BTWBlocks;
import btw.block.blocks.ClayBlock;
import btw.block.blocks.GrassBlock;
import btw.item.BTWItems;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
Expand All @@ -15,9 +17,11 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import java.util.List;
import java.util.Random;

@Mixin(ClayBlock.class)
public abstract class ClayBlockMixin extends Block {

protected ClayBlockMixin(int blockID, Material material) {
super(blockID, material);
}
Expand Down Expand Up @@ -62,6 +66,47 @@ public void dropComponentItemsOnBadBreak(World world, int x, int y, int z, int m

this.dropItemsIndividually(world, x, y, z, BTWItems.clayPile.itemID, 1, 0, chance);
}

@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
if (world.getBlockMetadata(x, y, z) == ClayHelper.GRASS_TYPE) {
if (!GrassBlock.canGrassSurviveAtLocation(world, x, y, z)) {
// convert back to dirt in low light
world.setBlockMetadataWithNotify(x, y, z, ClayHelper.DIRT_TYPE);
} else if (GrassBlock.canGrassSpreadFromLocation(world, x, y, z)) {
if (rand.nextFloat() <= GrassBlock.GROWTH_CHANCE) {
GrassBlock.checkForGrassSpreadFromLocation(world, x, y, z);
}
}
}
}

@Override
public boolean getCanGrassSpreadToBlock(World world, int x, int y, int z) {
return world.getBlockMetadata(x, y, z) == ClayHelper.DIRT_TYPE;
}

@Override
public boolean spreadGrassToBlock(World world, int x, int y, int z) {
if (world.getBlockMetadata(x, y, z) == ClayHelper.DIRT_TYPE) {
world.setBlockMetadataWithNotify(x, y, z, ClayHelper.GRASS_TYPE);
return true;
}

return false;
}

@Override
public boolean canBeGrazedOn(IBlockAccess blockAccess, int x, int y, int z, EntityAnimal animal) {
return blockAccess.getBlockMetadata(x, y, z) == ClayHelper.GRASS_TYPE;
}

@Override
public void onGrazed(World world, int x, int y, int z, EntityAnimal animal) {
if (world.getBlockMetadata(x, y, z) == ClayHelper.GRASS_TYPE) {
world.setBlockMetadataWithNotify(x, y, z, ClayHelper.DIRT_TYPE);
}
}

@Override
public float getMovementModifier(World world, int x, int y, int z) {
Expand Down Expand Up @@ -99,24 +144,21 @@ public boolean canWildVegetationGrowOnBlock(World world, int x, int y, int z) {
Icon sandyClayIcon;
@Environment(EnvType.CLIENT)
Icon redSandyClayIcon;
@Environment(EnvType.CLIENT)
Icon grassyClayOverlay;

@Environment(EnvType.CLIENT)
public void registerIcons(IconRegister var1) {
super.registerIcons(var1);
sandyClayIcon = var1.registerIcon("btaBlockSandyClay");
redSandyClayIcon = var1.registerIcon("btaBlockRedSandyClay");
grassyClayOverlay = var1.registerIcon("btaOverlayGrassyClay");
}

@Environment(EnvType.CLIENT)
@Override
public Icon getIcon(int side, int meta) {
if (meta == 1) {
if (meta == ClayHelper.SAND_TYPE) {
return sandyClayIcon;
}
else if (meta == 2) {
else if (meta == ClayHelper.RED_SAND_TYPE) {
return redSandyClayIcon;
}
else {
Expand All @@ -129,14 +171,12 @@ else if (meta == 2) {
public boolean renderBlock(RenderBlocks render, int x, int y, int z) {
int meta = render.blockAccess.getBlockMetadata(x, y, z);

if (meta == 0)
super.renderBlock(render, x, y, z);
else if (meta == 1)
if (meta == ClayHelper.SAND_TYPE)
this.renderBlockWithTexture(render, x, y, z, sandyClayIcon);
else if (meta == 2)
else if (meta == ClayHelper.RED_SAND_TYPE)
this.renderBlockWithTexture(render, x, y, z, redSandyClayIcon);
else
Block.grass.renderBlock(render, x, y, z);
super.renderBlock(render, x, y, z);

return true;
}
Expand All @@ -156,10 +196,6 @@ public boolean shouldSideBeRendered(IBlockAccess blockAccess, int x, int y, int
public void renderBlockSecondPass(RenderBlocks var1, int var2, int var3, int var4, boolean var5) {
if (var1.blockAccess.getBlockMetadata(var2, var3, var4) == 3) {
Block.grass.renderBlockSecondPass(var1, var2, var3, var4, var5);

var1.setRenderAllFaces(false);
this.renderBlockWithTexture(var1, var2, var3, var4, grassyClayOverlay);
var1.setRenderAllFaces(true);
}
}

Expand Down
Loading

0 comments on commit 4fd8ffe

Please sign in to comment.