Skip to content

Commit

Permalink
Change primal shrooms behaviour (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoshy2002 authored Dec 15, 2024
1 parent 6d88ca3 commit 80b8136
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pluginManagement {
}

plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.29'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.30'
}


13 changes: 13 additions & 0 deletions src/main/java/tb/common/block/BlockAshroom.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,19 @@ public void func_149853_b(World w, Random r, int x, int y, int z) {
w.setBlockMetadataWithNotify(x, y, z, Math.min(growthStages, meta + 1), 3);
}

public boolean canBlockStay(World w, int x, int y, int z) {
// Only allow it to be placed on full Blocks
return (w.getBlock(x, y - 1, z)).isNormalCube();
}

@Override
public boolean onBlockActivated(World aWorld, int aX, int aY, int aZ, EntityPlayer aPlayer, int aSide, float pX,
float pY, float pZ) {
// Do nothing when right clicked
return false;

}

protected boolean func_150109_e(World p_150109_1_, int p_150109_2_, int p_150109_3_, int p_150109_4_) {
if (!this.canPlaceBlockAt(p_150109_1_, p_150109_2_, p_150109_3_, p_150109_4_)) {
if (p_150109_1_.getBlock(p_150109_2_, p_150109_3_, p_150109_4_) == this) {
Expand Down

0 comments on commit 80b8136

Please sign in to comment.