Skip to content

Commit

Permalink
2.0.0a6 Release Commit
Browse files Browse the repository at this point in the history
This commit marks the point of the repo at which the 2.0.0a6 release was
made.
  • Loading branch information
RlonRyan committed Jan 14, 2017
1 parent d28ee1a commit a0503d7
Show file tree
Hide file tree
Showing 16 changed files with 92 additions and 80 deletions.
1 change: 1 addition & 0 deletions build.gradle
Expand Up @@ -12,6 +12,7 @@ buildscript {
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.2-SNAPSHOT'
classpath 'gradle.plugin.com.rlonryan:QuikMod:1.0.18'
}
}
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Sun Nov 20 14:53:20 MST 2016
#Fri Jan 13 21:44:51 MST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip
19 changes: 11 additions & 8 deletions gradlew
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
Expand Down Expand Up @@ -154,16 +154,19 @@ if $cygwin ; then
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save ( ) {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")

# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
exec "$JAVACMD" "$@"
2 changes: 1 addition & 1 deletion lib/AgriPlants
2 changes: 1 addition & 1 deletion lib/InfinityLib
4 changes: 2 additions & 2 deletions mod.properties
Expand Up @@ -11,7 +11,7 @@ package = com.infinityraider.agricraft
# Version
version_major = 2
version_minor = 0
version_patch = 0-0.4.0-a5
version_patch = 0-0.5.0-a6

# Core
version_minecraft = 1.10.2
Expand All @@ -24,4 +24,4 @@ mod_class = AgriCraft.java
reference_class = reference/Reference.java

# Update Tracker
update_url = https://agricraft.github.io/versions/1.10/update.json
update_url = https://agricraft.github.io/versions/1.11/update.json
Expand Up @@ -7,6 +7,7 @@
import com.infinityraider.agricraft.api.fertilizer.IAgriFertilizable;
import com.infinityraider.agricraft.api.misc.IAgriHarvestable;
import com.infinityraider.agricraft.api.misc.IAgriWeedable;
import com.infinityraider.agricraft.api.plant.IAgriPlant;
import com.infinityraider.agricraft.api.seed.AgriSeed;
import com.infinityraider.agricraft.api.seed.IAgriSeedAcceptor;
import com.infinityraider.agricraft.api.seed.IAgriSeedProvider;
Expand Down Expand Up @@ -59,7 +60,11 @@ default boolean isFertile() {
return this.getSeed().filter(this::isFertile).isPresent();
}

boolean isFertile(AgriSeed seed);
default boolean isFertile(AgriSeed seed) {
return isFertile(seed.getPlant());
}

boolean isFertile(IAgriPlant plant);

/**
* @return if this crop is fully grown
Expand Down
Expand Up @@ -15,7 +15,7 @@
*/
public interface IAgriSoilRegistry {

boolean isSoil(IAgriSoil plant);
boolean isSoil(IAgriSoil soil);

Optional<IAgriSoil> getSoil(String id);

Expand All @@ -33,9 +33,9 @@ default Optional<IAgriSoil> getSoil(FuzzyStack stack) {
.findFirst();
}

boolean addSoil(IAgriSoil plant);
boolean addSoil(IAgriSoil soil);

boolean removeSoil(IAgriSoil plant);
boolean removeSoil(IAgriSoil soil);

List<IAgriSoil> getSoils();

Expand Down
Expand Up @@ -12,50 +12,50 @@

/**
*
*
*
*/
public class SoilRegistry implements IAgriSoilRegistry {
private static final IAgriSoilRegistry INSTANCE = new SoilRegistry();
private final ConcurrentMap<String, IAgriSoil> soils;

public SoilRegistry() {
this.soils = new ConcurrentHashMap<>();
}
public static IAgriSoilRegistry getInstance() {
return INSTANCE;
}

@Override
public boolean isSoil(IAgriSoil plant) {
return this.soils.containsKey(plant.getId());
}

@Override
public Optional<IAgriSoil> getSoil(String id) {
return Optional.ofNullable(this.soils.get(id));
}

@Override
public boolean addSoil(IAgriSoil plant) {
return this.soils.putIfAbsent(plant.getId(), plant) == null;
}

@Override
public boolean removeSoil(IAgriSoil plant) {
return this.soils.remove(plant.getId()) != null;
}

@Override
public List<IAgriSoil> getSoils() {
return new ArrayList<>(this.soils.values());
}

@Override
public List<String> getSoilIds() {
return new ArrayList<>(this.soils.keySet());
}

private static final IAgriSoilRegistry INSTANCE = new SoilRegistry();

private final ConcurrentMap<String, IAgriSoil> soils;

public SoilRegistry() {
this.soils = new ConcurrentHashMap<>();
}

public static IAgriSoilRegistry getInstance() {
return INSTANCE;
}

@Override
public boolean isSoil(IAgriSoil soil) {
return this.soils.containsKey(soil.getId());
}

@Override
public Optional<IAgriSoil> getSoil(String id) {
return Optional.ofNullable(this.soils.get(id));
}

@Override
public boolean addSoil(IAgriSoil soil) {
return this.soils.putIfAbsent(soil.getId(), soil) == null;
}

@Override
public boolean removeSoil(IAgriSoil soil) {
return this.soils.remove(soil.getId()) != null;
}

@Override
public List<IAgriSoil> getSoils() {
return new ArrayList<>(this.soils.values());
}

@Override
public List<String> getSoilIds() {
return new ArrayList<>(this.soils.keySet());
}

}
Expand Up @@ -302,9 +302,9 @@ public Optional<IAgriStat> removeStat() {
}

@Override
public boolean isFertile(AgriSeed seed) {
public boolean isFertile(IAgriPlant plant) {
return worldObj.isAirBlock(this.getPos().add(0, 1, 0))
&& seed.getPlant().getGrowthRequirement().isMet(this.worldObj, pos);
&& plant.getGrowthRequirement().isMet(this.worldObj, pos);
}

@SideOnly(Side.CLIENT)
Expand All @@ -329,7 +329,7 @@ public Optional<IAgriSoil> getSoil() {
public boolean spawn() {
if (!hasPlant()) {
for (IAgriPlant p : PlantRegistry.getInstance().getPlants()) {
if (p.getSpawnChance() > this.getRandom().nextDouble()) {
if (p.getSpawnChance() > this.getRandom().nextDouble() && this.isFertile(p)) {
this.setCrossCrop(false);
this.setStat(new PlantStats());
this.setPlant(p);
Expand Down Expand Up @@ -560,7 +560,7 @@ public void addServerDebugInfo(List<String> list) {
list.add(" - Fertile: " + this.isFertile());
list.add(" - Mature: " + this.isMature());
list.add(" - AgriSoil: " + this.plant.getGrowthRequirement().getSoils().stream()
.findFirst().map(IAgriSoil::getId).orElse("Any")
.findFirst().map(IAgriSoil::getId).orElse("None")
);
} else {
list.add(" - This crop has no plant");
Expand Down
Expand Up @@ -138,7 +138,7 @@ protected final IGrowthRequirement initGrowthRequirementJSON() {
}

if (this.plant.getRequirement().getSoils().isEmpty()) {
AgriCore.getLogger("AgriCraft").warn("{0} has no valid soils to plant on!", this.plant.getPlantName());
AgriCore.getLogger("AgriCraft").warn("Plant: \"{0}\" has no valid soils to plant on!", this.plant.getPlantName());
}

this.plant.getRequirement().getSoils().stream()
Expand Down
Expand Up @@ -138,7 +138,7 @@ private static void registerCustomWoodRecipes() {

private static void initWoodList() {
if (woodList.isEmpty()) {
ReflectionHelper.forEachIn(AgriBlocks.getInstance(), BlockCustomWood.class, (BlockCustomWood b) -> {
ReflectionHelper.forEachValueIn(AgriBlocks.getInstance(), BlockCustomWood.class, (BlockCustomWood b) -> {
AgriCore.getLogger("AgriCraft").debug("Block: {0} Item: {1}", b, Item.getItemFromBlock(b));
Optional.ofNullable(Item.getItemFromBlock(b))
.filter(i -> i instanceof ItemBlockCustomWood)
Expand Down
Expand Up @@ -51,17 +51,17 @@ public static void renderHashTagPattern(ITessellator tessellator, TextureAtlasSp
tessellator.drawScaledFaceDouble(0, minY, 16, maxY, EnumFacing.EAST, icon, 12);
}

// TODO: Find way to do without translations.
public static void renderCrossPattern(ITessellator tessellator, TextureAtlasSprite icon, int layer) {
int minY = 12 * layer;
int maxY = 12 * (layer + 1);
tessellator.drawScaledFaceDouble(-2, minY, 10, maxY, EnumFacing.NORTH, icon, 3.999F);
tessellator.drawScaledFaceDouble(6, minY, 18, maxY, EnumFacing.NORTH, icon, 4.001F);
tessellator.drawScaledFaceDouble(-2, minY, 10, maxY, EnumFacing.EAST, icon, 3.999F);
tessellator.drawScaledFaceDouble(6, minY, 18, maxY, EnumFacing.EAST, icon, 4.001F);
tessellator.drawScaledFaceDouble(-2, minY, 10, maxY, EnumFacing.NORTH, icon, 11.999F);
tessellator.drawScaledFaceDouble(6, minY, 18, maxY, EnumFacing.NORTH, icon, 12.001F);
tessellator.drawScaledFaceDouble(-2, minY, 10, maxY, EnumFacing.EAST, icon, 11.999F);
tessellator.drawScaledFaceDouble(6, minY, 18, maxY, EnumFacing.EAST, icon, 12.001F);
int minY = 16 * layer;
int maxY = 16 * (layer + 1);
tessellator.pushMatrix();
tessellator.translate(0.5, 0, 0.5);
tessellator.rotate(45, 0, 1, 0);
tessellator.translate(-0.5, 0, -0.5);
tessellator.drawScaledFaceDouble(0, minY, 16, maxY, EnumFacing.NORTH, icon, 8);
tessellator.drawScaledFaceDouble(0, minY, 16, maxY, EnumFacing.EAST, icon, 8);
tessellator.popMatrix();
}

public static void renderStemPlant(ITessellator tessellator, TextureAtlasSprite vineIcon, TextureAtlasSprite fruitIcon, int stage, Block vine) {
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/changelog.txt
@@ -1,7 +1,10 @@
Changelog
---------
2.0.0a6
- ADDED: Seed item configurability, allows for meta-sensitive seeds.
- ADDED: Seed item configurability, allows for meta-sensitive seeds.
- FIXED: Plants spawning on infertile soil.
- FIXED: Invalid texture message displaying {0} instead of invalid texture entry.
- FIXED: Render type 'cross' rendering as 'hash' instead.
- FIXED: Default melon texture is wheat.
- FIXED: Growth & Gain stats randomly switching places.
- FIXED: Crash caused by sprinklers and class casting.
Expand Down

0 comments on commit a0503d7

Please sign in to comment.