Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code cleanup #54

Merged
merged 20 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions CHANGELOG-2.1.1.0.md

This file was deleted.

6 changes: 3 additions & 3 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependencies {
api("com.github.GTNewHorizons:CropLoadCore:0.1.10:dev")
api("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")

devOnlyNonPublishable("com.github.GTNewHorizons:GT5-Unofficial:5.09.44.91:dev")
devOnlyNonPublishable("com.github.GTNewHorizons:GT5-Unofficial:5.09.44.96:dev")
compileOnly(deobf("https://media.forgecdn.net/files/2499/612/BiomesOPlenty-1.7.10-2.1.0.2308-universal.jar"))
compileOnly("com.github.GTNewHorizons:twilightforest:2.5.1:dev") {
transitive = false
Expand All @@ -13,7 +13,7 @@ dependencies {
compileOnly("com.github.GTNewHorizons:Natura:2.5.7:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.2.41:dev") {
compileOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.2.43:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:Galacticraft:3.0.74-GTNH:dev") {
Expand All @@ -26,6 +26,6 @@ dependencies {
//runtimeOnly("com.github.GTNewHorizons:twilightforest:2.5.1:dev")
//runtimeOnly("com.github.GTNewHorizons:TinkersConstruct:1.10.12-GTNH:dev")
//runtimeOnly("com.github.GTNewHorizons:Natura:2.5.7:dev")
//runtimeOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.2.41:dev")
//runtimeOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.2.43:dev")
//runtimeOnly("com.github.GTNewHorizons:Galacticraft:3.0.74-GTNH:dev")
}
29 changes: 14 additions & 15 deletions src/main/java/com/github/bartimaeusnek/cropspp/CCropUtility.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,26 +43,25 @@ public static boolean isRainingOn(ICropTile crop) {
return false;
}

// If somthing goin on
if (world.isRaining()) {
BiomeGenBase biomegenbase = world.getBiomeGenForCoords(cord.posX, cord.posZ);
if (!world.isRaining()) {
return false;
}

if (biomegenbase == null) {
return false;
}
// If somthing goin on
BiomeGenBase biomegenbase = world.getBiomeGenForCoords(cord.posX, cord.posZ);

// No rain
if (!biomegenbase.canSpawnLightningBolt()) {
return false;
}
if (biomegenbase == null) {
return false;
}

// Is raining on block
if (world.canBlockSeeTheSky(cord.posX, cord.posY + 1, cord.posZ)) {
return true;
}
// No rain
if (!biomegenbase.canSpawnLightningBolt()) {
return false;
}

return false;
// Is raining on block
return world.canBlockSeeTheSky(cord.posX, cord.posY + 1, cord.posZ);

}

public static void damageEntity(Entity ent, float damage) {
Expand Down
190 changes: 84 additions & 106 deletions src/main/java/com/github/bartimaeusnek/cropspp/Cropspp.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.github.bartimaeusnek.croploadcore.ModsLoaded;
import com.github.bartimaeusnek.cropspp.GTHandler.CropItemList;
import com.github.bartimaeusnek.cropspp.GTHandler.GTHandler;
import com.github.bartimaeusnek.cropspp.GTHandler.machines.CropGeneExtractor;
Expand Down Expand Up @@ -51,109 +50,90 @@ public final class Cropspp {
@EventHandler
public void preInit(FMLPreInitializationEvent preinit) {
CropLoader.load(preinit);
if (ModsLoaded.GT) {
new CropWeedPicker(12528, "Basic CropWeedPicker", "Basic CropWeedPicker", 1);
CropItemList.cropGeneExtractorLV.set(
new CropGeneExtractor(12501, "Basic Crop Gene Extractor", "Basic Crop Gene Extractor", 1)
.getStackForm(1L));
CropItemList.cropGeneExtractorMV.set(
new CropGeneExtractor(12502, "Advanced Crop Gene Extractor I", "Advanced Crop Gene Extractor I", 2)
.getStackForm(1L));
CropItemList.cropGeneExtractorHV.set(
new CropGeneExtractor(
12503,
"Advanced Crop Gene Extractor II",
"Advanced Crop Gene Extractor II",
3).getStackForm(1L));
CropItemList.cropGeneExtractorEV.set(
new CropGeneExtractor(
12504,
"Advanced Crop Gene Extractor III",
"Advanced Crop Gene Extractor III",
4).getStackForm(1L));
CropItemList.cropGeneExtractorIV.set(
new CropGeneExtractor(
12505,
"Advanced Crop Gene Extractor IV",
"Advanced Crop Gene Extractor IV",
5).getStackForm(1L));
CropItemList.cropGeneExtractorLuV.set(
new CropGeneExtractor(12506, "Advanced Crop Gene Extractor V", "Advanced Crop Gene Extractor V", 6)
.getStackForm(1L));
CropItemList.cropGeneExtractorZPM.set(
new CropGeneExtractor(
12507,
"Advanced Crop Gene Extractor VI",
"Advanced Crop Gene Extractor VI",
7).getStackForm(1L));
CropItemList.cropGeneExtractorUV.set(
new CropGeneExtractor(
12508,
"Advanced Crop Gene Extractor VII",
"Advanced Crop Gene Extractor VII",
8).getStackForm(1L));
if (ModsLoaded.dreamcraft) CropItemList.cropGeneExtractorUHV.set(
new CropGeneExtractor(
12509,
"Advanced Crop Gene Extractor IIX",
"Advanced Crop Gene Extractor IIX",
9).getStackForm(1L));
new CropWeedPicker(12528, "Basic CropWeedPicker", "Basic CropWeedPicker", 1);
CropItemList.cropGeneExtractorLV.set(
new CropGeneExtractor(12501, "Basic Crop Gene Extractor", "Basic Crop Gene Extractor", 1)
.getStackForm(1L));
CropItemList.cropGeneExtractorMV.set(
new CropGeneExtractor(12502, "Advanced Crop Gene Extractor I", "Advanced Crop Gene Extractor I", 2)
.getStackForm(1L));
CropItemList.cropGeneExtractorHV.set(
new CropGeneExtractor(12503, "Advanced Crop Gene Extractor II", "Advanced Crop Gene Extractor II", 3)
.getStackForm(1L));
CropItemList.cropGeneExtractorEV.set(
new CropGeneExtractor(12504, "Advanced Crop Gene Extractor III", "Advanced Crop Gene Extractor III", 4)
.getStackForm(1L));
CropItemList.cropGeneExtractorIV.set(
new CropGeneExtractor(12505, "Advanced Crop Gene Extractor IV", "Advanced Crop Gene Extractor IV", 5)
.getStackForm(1L));
CropItemList.cropGeneExtractorLuV.set(
new CropGeneExtractor(12506, "Advanced Crop Gene Extractor V", "Advanced Crop Gene Extractor V", 6)
.getStackForm(1L));
CropItemList.cropGeneExtractorZPM.set(
new CropGeneExtractor(12507, "Advanced Crop Gene Extractor VI", "Advanced Crop Gene Extractor VI", 7)
.getStackForm(1L));
CropItemList.cropGeneExtractorUV.set(
new CropGeneExtractor(12508, "Advanced Crop Gene Extractor VII", "Advanced Crop Gene Extractor VII", 8)
.getStackForm(1L));
CropItemList.cropGeneExtractorUHV.set(
new CropGeneExtractor(12509, "Advanced Crop Gene Extractor IIX", "Advanced Crop Gene Extractor IIX", 9)
.getStackForm(1L));

CropItemList.cropReplicatorLV.set(
new CropReplicator(12510, "Basic Crop Replicator", "Basic Crop Replicator", 1).getStackForm(1L));
CropItemList.cropReplicatorMV.set(
new CropReplicator(12511, "Advanced Crop Replicator I", "Advanced Crop Replicator I", 2)
.getStackForm(1L));
CropItemList.cropReplicatorHV.set(
new CropReplicator(12512, "Advanced Crop Replicator II", "Advanced Crop Replicator II", 3)
.getStackForm(1L));
CropItemList.cropReplicatorEV.set(
new CropReplicator(12513, "Advanced Crop Replicator III", "Advanced Crop Replicator III", 4)
.getStackForm(1L));
CropItemList.cropReplicatorIV.set(
new CropReplicator(12514, "Advanced Crop Replicator IV", "Advanced Crop Replicator IV", 5)
.getStackForm(1L));
CropItemList.cropReplicatorLuV.set(
new CropReplicator(12515, "Advanced Crop Replicator V", "Advanced Crop Replicator V", 6)
.getStackForm(1L));
CropItemList.cropReplicatorZPM.set(
new CropReplicator(12516, "Advanced Crop Replicator VI", "Advanced Crop Replicator VI", 7)
.getStackForm(1L));
CropItemList.cropReplicatorUV.set(
new CropReplicator(12517, "Advanced Crop Replicator VII", "Advanced Crop Replicator VII", 8)
.getStackForm(1L));
if (ModsLoaded.dreamcraft) CropItemList.cropReplicatorUHV.set(
new CropReplicator(12518, "Advanced Crop Replicator IIX", "Advanced Crop Replicator IIX", 9)
.getStackForm(1L));
CropItemList.cropReplicatorLV
.set(new CropReplicator(12510, "Basic Crop Replicator", "Basic Crop Replicator", 1).getStackForm(1L));
CropItemList.cropReplicatorMV.set(
new CropReplicator(12511, "Advanced Crop Replicator I", "Advanced Crop Replicator I", 2)
.getStackForm(1L));
CropItemList.cropReplicatorHV.set(
new CropReplicator(12512, "Advanced Crop Replicator II", "Advanced Crop Replicator II", 3)
.getStackForm(1L));
CropItemList.cropReplicatorEV.set(
new CropReplicator(12513, "Advanced Crop Replicator III", "Advanced Crop Replicator III", 4)
.getStackForm(1L));
CropItemList.cropReplicatorIV.set(
new CropReplicator(12514, "Advanced Crop Replicator IV", "Advanced Crop Replicator IV", 5)
.getStackForm(1L));
CropItemList.cropReplicatorLuV.set(
new CropReplicator(12515, "Advanced Crop Replicator V", "Advanced Crop Replicator V", 6)
.getStackForm(1L));
CropItemList.cropReplicatorZPM.set(
new CropReplicator(12516, "Advanced Crop Replicator VI", "Advanced Crop Replicator VI", 7)
.getStackForm(1L));
CropItemList.cropReplicatorUV.set(
new CropReplicator(12517, "Advanced Crop Replicator VII", "Advanced Crop Replicator VII", 8)
.getStackForm(1L));
CropItemList.cropReplicatorUHV.set(
new CropReplicator(12518, "Advanced Crop Replicator IIX", "Advanced Crop Replicator IIX", 9)
.getStackForm(1L));

CropItemList.cropSynthesiserLV.set(
new CropSynthesiser(12519, "Basic Crop Synthesiser", "Basic Crop Synthesiser", 1).getStackForm(1L));
CropItemList.cropSynthesiserMV.set(
new CropSynthesiser(12520, "Advanced Crop Synthesiser I", "Advanced Crop Synthesiser I", 2)
.getStackForm(1L));
CropItemList.cropSynthesiserHV.set(
new CropSynthesiser(12521, "Advanced Crop Synthesiser II", "Advanced Crop Synthesiser II", 3)
.getStackForm(1L));
CropItemList.cropSynthesiserEV.set(
new CropSynthesiser(12522, "Advanced Crop Synthesiser III", "Advanced Crop Synthesiser III", 4)
.getStackForm(1L));
CropItemList.cropSynthesiserIV.set(
new CropSynthesiser(12523, "Advanced Crop Synthesiser IV", "Advanced Crop Synthesiser IV", 5)
.getStackForm(1L));
CropItemList.cropSynthesiserLuV.set(
new CropSynthesiser(12524, "Advanced Crop Synthesiser V", "Advanced Crop Synthesiser V", 6)
.getStackForm(1L));
CropItemList.cropSynthesiserZPM.set(
new CropSynthesiser(12525, "Advanced Crop Synthesiser VI", "Advanced Crop Synthesiser VI", 7)
.getStackForm(1L));
CropItemList.cropSynthesiserUV.set(
new CropSynthesiser(12526, "Advanced Crop Synthesiser VII", "Advanced Crop Synthesiser VII", 8)
.getStackForm(1L));
CropItemList.cropSynthesiserUHV.set(
new CropSynthesiser(12527, "Advanced Crop Synthesiser IIX", "Advanced Crop Synthesiser IIX", 9)
.getStackForm(1L));
new CppFluids();

CropItemList.cropSynthesiserLV.set(
new CropSynthesiser(12519, "Basic Crop Synthesiser", "Basic Crop Synthesiser", 1).getStackForm(1L));
CropItemList.cropSynthesiserMV.set(
new CropSynthesiser(12520, "Advanced Crop Synthesiser I", "Advanced Crop Synthesiser I", 2)
.getStackForm(1L));
CropItemList.cropSynthesiserHV.set(
new CropSynthesiser(12521, "Advanced Crop Synthesiser II", "Advanced Crop Synthesiser II", 3)
.getStackForm(1L));
CropItemList.cropSynthesiserEV.set(
new CropSynthesiser(12522, "Advanced Crop Synthesiser III", "Advanced Crop Synthesiser III", 4)
.getStackForm(1L));
CropItemList.cropSynthesiserIV.set(
new CropSynthesiser(12523, "Advanced Crop Synthesiser IV", "Advanced Crop Synthesiser IV", 5)
.getStackForm(1L));
CropItemList.cropSynthesiserLuV.set(
new CropSynthesiser(12524, "Advanced Crop Synthesiser V", "Advanced Crop Synthesiser V", 6)
.getStackForm(1L));
CropItemList.cropSynthesiserZPM.set(
new CropSynthesiser(12525, "Advanced Crop Synthesiser VI", "Advanced Crop Synthesiser VI", 7)
.getStackForm(1L));
CropItemList.cropSynthesiserUV.set(
new CropSynthesiser(12526, "Advanced Crop Synthesiser VII", "Advanced Crop Synthesiser VII", 8)
.getStackForm(1L));
if (ModsLoaded.dreamcraft) CropItemList.cropSynthesiserUHV.set(
new CropSynthesiser(12527, "Advanced Crop Synthesiser IIX", "Advanced Crop Synthesiser IIX", 9)
.getStackForm(1L));
new CppFluids();
}
CppItems.register_Items();
CppItems.OreDictItems();
}
Expand All @@ -168,10 +148,8 @@ public void init(FMLInitializationEvent init) {
public void postInit(FMLPostInitializationEvent postinit) {
CropLoader.register();
CropLoader.registerBaseSeed();
if (ModsLoaded.GT) {
final GTHandler GTHandler = new GTHandler();
GTHandler.run();
}
final GTHandler GTHandler = new GTHandler();
GTHandler.run();
}

@EventHandler
Expand Down
Loading