Skip to content

Commit

Permalink
Merge pull request #321 from GrowthcraftCE/bugfix/319-Stomach-Drop-Co…
Browse files Browse the repository at this point in the history
…nfig

[WORLD-BREAKING] Converted Pasteurized Milk to Condensed
  • Loading branch information
Alatyami authored Mar 1, 2020
2 parents f8bd9e6 + 8966110 commit 1d30fbe
Show file tree
Hide file tree
Showing 25 changed files with 94 additions and 77 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Growthcraft
===========
[![](http://cf.way2muchnoise.eu/versions/growthcraft-community-edition_latest.svg)](https://minecraft.curseforge.com/projects/growthcraft-community-edition/)
[![Growthcraft Version](https://img.shields.io/badge/Growthcraft-4.1.3-orange.svg)](https://github.com/GrowthcraftCE/Growthcraft-1.12)
[![Growthcraft Version](https://img.shields.io/badge/Growthcraft-4.1.3.100-orange.svg)](https://github.com/GrowthcraftCE/Growthcraft-1.12)
[![Forge Version](https://img.shields.io/badge/Minecraft%20Forge-14.23.4.2768-yellow.svg)](http://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.12.2.html)
[![Java Version](https://img.shields.io/badge/JAVA-8-blue.svg)](https://www.java.com/en/)
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FGrowthcraftCE%2FGrowthcraft-1.12%2Fbadge%3Fref%3Ddevelopment&style=flat)](https://actions-badge.atrox.dev/GrowthcraftCE/Growthcraft-1.12/goto?ref=development)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.logging.level=warn

# Growthcraft Version
mod_version=4.1.3
mod_version=4.1.3.100

# Minecraft Versions
minecraft_version=1.12.2
Expand Down
24 changes: 12 additions & 12 deletions licensing/forge-1.11.2-13.20.1.2386-changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11312,46 +11312,46 @@ Build 4.1.4.272:
Build 4.1.4.271:
LexManos: New Plant API that allows for custom plants/soils.

Build 4.1.3.270:
Build 4.1.3.100.270:
LexManos: Added new hooks for modifying the items generated in chests during world gen.

Build 4.1.3.269:
Build 4.1.3.100.269:
LexManos: Redirect a lot of functions through WorldProvider for Mystcraft, allowing them to be overriden by the provider.

Build 4.1.3.268:
Build 4.1.3.100.268:
CovertJaguar: Fixed Entity Item render helper

Build 4.1.3.267:
Build 4.1.3.100.267:
ohai.iChun: Fix pick block key giving invalid spawn eggs
ohai.iChun: Logic derped
ohai.iChun: Logic derp (again)

Build 4.1.3.266:
Build 4.1.3.100.266:
LexManos: Added side sensitivity to standard EntityDiggingFX, added Block functions to override spawning of digging and breaking effects.

Build 4.1.3.265:
Build 4.1.3.100.265:
LexManos: Fix potential NPE in Custom item entity span code caused by item id misconfigurations.

Build 4.1.3.264:
Build 4.1.3.100.264:
LexManos: Fix recursion issue with new special item entity code.

Build 4.1.3.263:
Build 4.1.3.100.263:
Christian:
Update FML: 6c746ec
6c746ec Tidy code
aacbfeb Change version.properties search slightly, allow access to found file from the preinit event
1513b36 Add in the capability to read an internal version as <modid>.version from a file in the zip call versi
35852a6 Fix up reversed assignment for version fallback

Build 4.1.3.261:
Build 4.1.3.100.261:
pahimar: Changes to how PotionEffects are removed, now each PotionEffect can specify which ItemStacks can remove it's effect
pahimar: Inverted logic derp

Build 4.1.3.260:
Build 4.1.3.100.260:
LexManos: Package all of paulscode/ with the universal jar to help mac users who cant understand how to merge folders -.-

Build 4.1.3.259:
LexManos: Bump version to 4.1.3 to mark the end of todays changes.
Build 4.1.3.100.259:
LexManos: Bump version to 4.1.3.100 to mark the end of todays changes.

Build 4.1.1.258:
LexManos: Fix potential issue with custom events where the constructor is not visible from the EventBus class, Should never arise but meh.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/growthcraft/core/shared/Reference.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ private Reference() {

public static final String MODID = "growthcraft";
public static final String NAME = "GrowthcraftCore";
public static final String VERSION = "4.1.3";
public static final String VERSION = "4.1.3.100";
}
22 changes: 11 additions & 11 deletions src/main/java/growthcraft/milk/common/Init.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static void preInitBlocks() {
GrowthcraftMilkBlocks.blockFluidButterMilk = GrowthcraftMilkFluids.butterMilk.getFluidBlockDefinition();
GrowthcraftMilkBlocks.blockFluidCream = GrowthcraftMilkFluids.cream.getFluidBlockDefinition();
GrowthcraftMilkBlocks.blockFluidMilkCurds = GrowthcraftMilkFluids.curds.getFluidBlockDefinition();
GrowthcraftMilkBlocks.blockFluidPasteurizedMilk = GrowthcraftMilkFluids.pasteurizedMilk.getFluidBlockDefinition();
GrowthcraftMilkBlocks.blockFluidCondensedMilk = GrowthcraftMilkFluids.condensedMilk.getFluidBlockDefinition();
GrowthcraftMilkBlocks.blockFluidSkimMilk = GrowthcraftMilkFluids.skimMilk.getFluidBlockDefinition();
GrowthcraftMilkBlocks.blockFluidWhey = GrowthcraftMilkFluids.whey.getFluidBlockDefinition();

Expand Down Expand Up @@ -221,7 +221,7 @@ public static void registerItems(IForgeRegistry<Item> registry) {
GrowthcraftMilkItems.waxedCheeseSlice.registerItem(registry);
GrowthcraftMilkItems.simpleCheeseSlice.getItem().setCreativeTab(tabGrowthcraft);
GrowthcraftMilkItems.simpleCheeseSlice.registerItem(registry);
GrowthcraftMilkItems.agedCheeseBlockItem.registerItem(registry, GrowthcraftMilkBlocks.agedCheeseBlock.getBlock().getRegistryName() /*new ResourceLocation(Reference.MODID, "cheese_aged")*/);
GrowthcraftMilkItems.agedCheeseBlockItem.registerItem(registry, GrowthcraftMilkBlocks.agedCheeseBlock.getBlock().getRegistryName());
GrowthcraftMilkItems.waxedCheeseBlockItem.registerItem(registry, GrowthcraftMilkBlocks.waxedCheeseBlock.getBlock().getRegistryName());
GrowthcraftMilkItems.agedCheeseCurdsItem.registerItem(registry, GrowthcraftMilkBlocks.agedCheeseCurds.getBlock().getRegistryName());
GrowthcraftMilkItems.waxedCheeseCurdsItem.registerItem(registry, GrowthcraftMilkBlocks.waxedCheeseCurds.getBlock().getRegistryName());
Expand Down Expand Up @@ -503,9 +503,9 @@ public static void preInitFluids() {
.setFoodBottle(foodBottleWhey).build()
.setCreativeTab(GrowthcraftCoreApis.tabGrowthcraft).setItemColor(0x94a860);

FluidPasteurizedMilk fluidPasteurizedMilk = new FluidPasteurizedMilk("fluid_pasteurized_milk");
GrowthcraftMilkFluids.pasteurizedMilk = new FluidDetailsBuilder(fluidPasteurizedMilk)
.setFluidBlockClass(BlockFluidPasteurizedMilk.class).build()
FluidCondensedMilk fluidCondensedMilk = new FluidCondensedMilk("fluid_condensed_milk");
GrowthcraftMilkFluids.condensedMilk = new FluidDetailsBuilder(fluidCondensedMilk)
.setFluidBlockClass(BlockFluidCondensedMilk.class).build()
.setCreativeTab(GrowthcraftCoreApis.tabGrowthcraft).setItemColor(0xFFFFFA);

/* Kumis */
Expand Down Expand Up @@ -574,7 +574,7 @@ public static void registerFluidBlocks(IForgeRegistry<Block> registry) {
GrowthcraftMilkFluids.rennet.registerBlocks(registry, Reference.MODID, "rennet");
GrowthcraftMilkFluids.skimMilk.registerBlocks(registry, Reference.MODID, "skim_milk");
GrowthcraftMilkFluids.whey.registerBlocks(registry, Reference.MODID, "whey");
GrowthcraftMilkFluids.pasteurizedMilk.registerBlocks(registry, Reference.MODID, "pasteurized_milk");
GrowthcraftMilkFluids.condensedMilk.registerBlocks(registry, Reference.MODID, "condensed_milk");

CoreRegistry.instance().fluidDictionary().addFluidTags(GrowthcraftMilkFluids.cream.getFluid(), MilkFluidTags.CREAM);
CoreRegistry.instance().fluidDictionary().addFluidTags(GrowthcraftMilkFluids.curds.getFluid(), MilkFluidTags.MILK_CURDS);
Expand All @@ -589,7 +589,7 @@ public static void registerFluidBlocks(IForgeRegistry<Block> registry) {
Residue.newDefault(0.0F)
);

GrowthcraftCellarApis.boozeBuilderFactory.create(GrowthcraftMilkFluids.pasteurizedMilk.getFluid())
GrowthcraftCellarApis.boozeBuilderFactory.create(GrowthcraftMilkFluids.condensedMilk.getFluid())
.brewsFrom(GrowthcraftMilkFluids.skimMilk.asFluidStack(250), new ItemStack(Items.SUGAR), false, TickUtils.minutes(1), new Residue(GrowthcraftMilkItems.starterCulture.asStack(1), 1.0f));

GrowthcraftCellarApis.boozeBuilderFactory.create(GrowthcraftMilkFluids.skimMilk.getFluid())
Expand Down Expand Up @@ -745,7 +745,7 @@ public static void registerFermentation(
.setTipsy(BoozeUtils.alcoholToTipsy(alcoholRate), TickUtils.seconds(tipsyDuration))
.addPotionEntry(potionEffect, TickUtils.minutes(potionDuration), 0);
} catch (Exception ex) {

GrowthcraftMilk.logger.warn(String.format("Recipe for %s failed to register. %s", outputFluid.getUnlocalizedName(), ex));
}
}

Expand All @@ -759,7 +759,7 @@ public static void registerFluidItems(IForgeRegistry<Item> registry) {
GrowthcraftMilkFluids.rennet.registerItems(registry, Reference.MODID, "rennet");
GrowthcraftMilkFluids.skimMilk.registerItems(registry, Reference.MODID, "skim_milk");
GrowthcraftMilkFluids.whey.registerItems(registry, Reference.MODID, "whey");
GrowthcraftMilkFluids.pasteurizedMilk.registerItems(registry, Reference.MODID, "pasteurized_milk");
GrowthcraftMilkFluids.condensedMilk.registerItems(registry, Reference.MODID, "condensed_milk");

registerCheeseFluidItems(registry, GrowthcraftMilkFluids.cheesesSimple);
registerCheeseFluidItems(registry, GrowthcraftMilkFluids.cheesesAged);
Expand All @@ -777,7 +777,7 @@ public static void registerFluidRenders() {
GrowthcraftMilkFluids.rennet.registerRenderer();
GrowthcraftMilkFluids.skimMilk.registerRenderer();
GrowthcraftMilkFluids.whey.registerRenderer();
GrowthcraftMilkFluids.pasteurizedMilk.registerRenderer();
GrowthcraftMilkFluids.condensedMilk.registerRenderer();
registerCheeseRenders(GrowthcraftMilkFluids.cheesesSimple);
registerCheeseRenders(GrowthcraftMilkFluids.cheesesAged);
registerCheeseRenders(GrowthcraftMilkFluids.cheesesWaxed);
Expand All @@ -796,7 +796,7 @@ public static void registerFluidColorHandlers() {
GrowthcraftMilkFluids.rennet.registerColorHandlers();
GrowthcraftMilkFluids.skimMilk.registerColorHandlers();
GrowthcraftMilkFluids.whey.registerColorHandlers();
GrowthcraftMilkFluids.pasteurizedMilk.registerColorHandlers();
GrowthcraftMilkFluids.condensedMilk.registerColorHandlers();
registerCheeseColorHandlers(GrowthcraftMilkFluids.cheesesSimple);
registerCheeseColorHandlers(GrowthcraftMilkFluids.cheesesAged);
registerCheeseColorHandlers(GrowthcraftMilkFluids.cheesesWaxed);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import net.minecraft.block.material.Material;
import net.minecraftforge.fluids.Fluid;

public class BlockFluidPasteurizedMilk extends GrowthcraftBlockFluid {
public class BlockFluidCondensedMilk extends GrowthcraftBlockFluid {

public BlockFluidPasteurizedMilk(Fluid fluidPasteurizedMilk) {
super(fluidPasteurizedMilk, Material.WATER);
public BlockFluidCondensedMilk(Fluid fluidCondensedMilk) {
super(fluidCondensedMilk, Material.WATER);
refreshColor();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import growthcraft.milk.shared.Reference;
import net.minecraft.util.ResourceLocation;

public class FluidPasteurizedMilk extends GrowthcraftFluid {
public class FluidCondensedMilk extends GrowthcraftFluid {

public FluidPasteurizedMilk(String unlocalizedName) {
public FluidCondensedMilk(String unlocalizedName) {
super(unlocalizedName, new ResourceLocation(Reference.MODID, "blocks/fluids/" + unlocalizedName + "_still"), new ResourceLocation(Reference.MODID, "blocks/fluids/" + unlocalizedName + "_flow"));
this.setUnlocalizedName(unlocalizedName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@ public void onEntityDrops(LivingDropsEvent event) {
EntityAgeable eventEntity = (EntityAgeable) event.getEntity();
int randomDrop = random.nextInt(100);

if (GrowthcraftMilk.config.getBabyCowsOnlyDropStomach() && eventEntity.getGrowingAge() > 0) {
return;
}

if (randomDrop <= GrowthcraftMilk.config.getStomachDropChance()) {
ItemStack itemStackStomach = GrowthcraftMilkItems.stomach.asStack();
EntityItem entityItem = new EntityItem(eventEntity.world, eventEntity.posX, eventEntity.posY, eventEntity.posZ, itemStackStomach);
event.getDrops().add(entityItem);
addDrops(event, eventEntity, GrowthcraftMilkItems.stomach.asStack());
}

}
}

private void addDrops(LivingDropsEvent event, EntityAgeable eventEntity, ItemStack stack) {
if ((GrowthcraftMilk.config.shouldBabyCowsDropStomach() && eventEntity.getGrowingAge() == 0)
|| GrowthcraftMilk.config.shouldAdultCowsDropStomach()) {
EntityItem entityItem = new EntityItem(eventEntity.world, eventEntity.posX, eventEntity.posY, eventEntity.posZ, stack);
event.getDrops().add(entityItem);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ public class GrowthcraftMilkConfig extends GrowthcraftConfiguration {

private int thistleDropChance = 2;

private int stomachDropChance = 50;
private boolean babyCowDropStomachOnly = true;
private int stomachDropChance = 10;
private boolean babyCowDropStomach = true;
private boolean adultCowDropStomach = true;

public GrowthcraftMilkConfig() {
super();
Expand All @@ -60,11 +61,18 @@ protected void initGeneralConfig() {
"Percentage that cow stomach will drop when a cow is killed. Set to -1 to disable. "
);

babyCowDropStomachOnly = getConfiguration().getBoolean(
"babyCowDropStomachOnly",
babyCowDropStomach = getConfiguration().getBoolean(
"babyCowDropStomach",
Configuration.CATEGORY_GENERAL,
babyCowDropStomachOnly,
"Set to true to only drop stomach from baby cows."
babyCowDropStomach,
"Set to true to drop stomach from baby cows."
);

adultCowDropStomach = getConfiguration().getBoolean(
"adultCowDropStomach",
Configuration.CATEGORY_GENERAL,
adultCowDropStomach,
"Set to true to drop stomach from adult cows."
);

}
Expand All @@ -77,8 +85,10 @@ public int getStomachDropChance() {
return stomachDropChance;
}

public boolean getBabyCowsOnlyDropStomach() {
return babyCowDropStomachOnly;
public boolean shouldBabyCowsDropStomach() {
return babyCowDropStomach;
}

public boolean shouldAdultCowsDropStomach() { return adultCowDropStomach; }

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class GrowthcraftMilkBlocks {
public static GrowthcraftBlockFluidDefinition blockFluidButterMilk;
public static GrowthcraftBlockFluidDefinition blockFluidCream;
public static GrowthcraftBlockFluidDefinition blockFluidMilkCurds;
public static GrowthcraftBlockFluidDefinition blockFluidPasteurizedMilk;
public static GrowthcraftBlockFluidDefinition blockFluidCondensedMilk;
public static GrowthcraftBlockFluidDefinition blockFluidSkimMilk;
public static GrowthcraftBlockFluidDefinition blockFluidWhey;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class GrowthcraftMilkFluids {
public static FluidDetails rennet;
public static FluidDetails skimMilk;
public static FluidDetails whey;
public static FluidDetails pasteurizedMilk;
public static FluidDetails condensedMilk;

public static BoozeDefinition[] kumisBooze;
public static FluidDetails kumis;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"model": "forge:fluid"
},
"variants": {
"fluid_pasteurized_milk": [
"fluid_condensed_milk": [
{
"custom": {
"fluid": "fluid_pasteurized_milk"
"fluid": "fluid_condensed_milk"
}
}
]
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/assets/growthcraft_milk/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fluid.fluid_rennet=Rennet

fluid.fluid_skim_milk=Skim Milk
fluid.fluid_whey=Whey
fluid.fluid_pasteurized_milk=Pasteurized Milk
fluid.fluid_condensed_milk=Condensed Milk

# Items
item.bottlefluid_milk.name=Milk Bottle
Expand All @@ -50,7 +50,7 @@ item.bottlefluid_milk_curds.name=Milk Curds Bottle
item.bottlefluid_rennet.name=Rennet Bottle
item.bottlefluid_skim_milk.name=Skim Milk Bottle
item.bottlefluid_whey.name=Whey Bottle
item.bottlefluid_pasteurized_milk.name=Pasteurized Milk Bottle
item.bottlefluid_condensed_milk.name=Condensed Milk Bottle

item.butter.salted.name=Salted Butter
item.butter.unsalted.name=Butter
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/assets/growthcraft_milk/lang/ko_kr.lang
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fluid.fluid_rennet=치즈 효소

fluid.fluid_skim_milk=탈지유
fluid.fluid_whey=단백질 빠진 맑은 우유
fluid.fluid_pasteurized_milk=저온 살균 우유
fluid.fluid_condensed_milk=저온 살균 우유

# Items
item.bottlefluid_milk.name=우유병
Expand All @@ -31,7 +31,7 @@ item.bottlefluid_milk_curds.name=응고된 우유병
item.bottlefluid_rennet.name=치즈 효소 병
item.bottlefluid_skim_milk.name=탈지유 병
item.bottlefluid_whey.name=단백질 빠진 맑은 우유병
item.bottlefluid_pasteurized_milk.name=저온 살균 우유병
item.bottlefluid_condensed_milk.name=저온 살균 우유병

item.butter.salted.name=가염 버터
item.butter.unsalted.name=버터
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/assets/growthcraft_milk/lang/tr_tr.lang
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fluid.fluid_rennet=Peynir Mayası

fluid.fluid_skim_milk=Yağsız Süt
fluid.fluid_whey=Peynir Altı Suyu
fluid.fluid_pasteurized_milk=Pastörize Süt
fluid.fluid_condensed_milk=Pastörize Süt

# Items
item.bottlefluid_milk.name=Süt Şişesi
Expand All @@ -50,7 +50,7 @@ item.bottlefluid_milk_curds.name=Süt Loru Şişesi
item.bottlefluid_rennet.name=Peynir Mayası Şişesi
item.bottlefluid_skim_milk.name=Yağsız Süt Şişesi
item.bottlefluid_whey.name=Peynir Altı Suyu Şişesi
item.bottlefluid_pasteurized_milk.name=Pastörize Süt Şişesi
item.bottlefluid_condensed_milk.name=Pastörize Süt Şişesi

item.butter.salted.name=Tuzlu Yağ
item.butter.unsalted.name=Tuzsuz Yağ
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/assets/growthcraft_milk/lang/zh_cn.lang
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ fluid.fluid_rennet=凝乳酶

fluid.fluid_skim_milk=脱脂奶
fluid.fluid_whey=乳清
fluid.fluid_pasteurized_milk=巴氏奶
fluid.fluid_condensed_milk=巴氏奶

# Items
item.bottlefluid_milk.name=牛奶瓶
Expand All @@ -31,7 +31,7 @@ item.bottlefluid_milk_curds.name=凝乳瓶
item.bottlefluid_rennet.name=凝乳酶瓶
item.bottlefluid_skim_milk.name=脱脂奶瓶
item.bottlefluid_whey.name=乳清瓶
item.bottlefluid_pasteurized_milk.name=巴氏奶瓶
item.bottlefluid_condensed_milk.name=巴氏奶瓶

item.butter.salted.name=咸黄油
item.butter.unsalted.name=黄油
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "minecraft:item_nbt",
"item": "forge:bucketFilled",
"nbt": {
"FluidName": "fluid_pasteurized_milk",
"FluidName": "fluid_condensed_milk",
"Amount": 1000
}
},
Expand All @@ -24,7 +24,7 @@

],
"result": {
"item": "growthcraft_milk:bottlefluid_pasteurized_milk",
"item": "growthcraft_milk:bottlefluid_condensed_milk",
"count": 4
}

Expand Down
Loading

0 comments on commit 1d30fbe

Please sign in to comment.