mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-29 08:27:03 +01:00
Merge pull request #1889 from vemerion/fix-milk
Change to use Forge milk
This commit is contained in:
commit
6bb6727fc8
7 changed files with 30 additions and 18 deletions
|
@ -10,7 +10,7 @@
|
||||||
"item": "minecraft:bucket"
|
"item": "minecraft:bucket"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fluid": "create:milk",
|
"fluid": "minecraft:milk",
|
||||||
"amount": 1000
|
"amount": 1000
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
{
|
|
||||||
"replace": false,
|
|
||||||
"values": [
|
|
||||||
"create:flowing_milk",
|
|
||||||
"create:milk"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -19,9 +19,14 @@ import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockDisplayReader;
|
import net.minecraft.world.IBlockDisplayReader;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
import net.minecraftforge.common.Tags;
|
import net.minecraftforge.common.ForgeMod;
|
||||||
|
import net.minecraftforge.event.RegistryEvent;
|
||||||
|
import net.minecraftforge.event.RegistryEvent.MissingMappings.Mapping;
|
||||||
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||||
import net.minecraftforge.fluids.FluidAttributes;
|
import net.minecraftforge.fluids.FluidAttributes;
|
||||||
import net.minecraftforge.fluids.ForgeFlowingFluid;
|
import net.minecraftforge.fluids.ForgeFlowingFluid;
|
||||||
|
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
|
||||||
|
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
|
||||||
|
|
||||||
public class AllFluids {
|
public class AllFluids {
|
||||||
|
|
||||||
|
@ -37,11 +42,6 @@ public class AllFluids {
|
||||||
.tag(AllTags.forgeFluidTag("tea"))
|
.tag(AllTags.forgeFluidTag("tea"))
|
||||||
.register();
|
.register();
|
||||||
|
|
||||||
public static final FluidEntry<VirtualFluid> MILK = REGISTRATE.virtualFluid("milk")
|
|
||||||
.lang(f -> "fluid.create.milk", "Milk")
|
|
||||||
.tag(Tags.Fluids.MILK)
|
|
||||||
.register();
|
|
||||||
|
|
||||||
public static final FluidEntry<ForgeFlowingFluid.Flowing> HONEY =
|
public static final FluidEntry<ForgeFlowingFluid.Flowing> HONEY =
|
||||||
REGISTRATE.standardFluid("honey", NoColorFluidAttributes::new)
|
REGISTRATE.standardFluid("honey", NoColorFluidAttributes::new)
|
||||||
.lang(f -> "fluid.create.honey", "Honey")
|
.lang(f -> "fluid.create.honey", "Honey")
|
||||||
|
@ -116,5 +116,19 @@ public class AllFluids {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventBusSubscriber(modid = Create.ID, bus = Bus.FORGE)
|
||||||
|
public static class MissingMappingsSubscriber {
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void missingMappings(RegistryEvent.MissingMappings<Fluid> event) {
|
||||||
|
for (Mapping<Fluid> mapping : event.getMappings(Create.ID)) {
|
||||||
|
if (mapping.key.getPath().equals("milk"))
|
||||||
|
mapping.remap(ForgeMod.MILK.get());
|
||||||
|
else if (mapping.key.getPath().equals("flowing_milk"))
|
||||||
|
mapping.remap(ForgeMod.FLOWING_MILK.get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,7 @@ import net.minecraft.util.SoundEvent;
|
||||||
import net.minecraft.world.gen.feature.Feature;
|
import net.minecraft.world.gen.feature.Feature;
|
||||||
import net.minecraft.world.gen.placement.Placement;
|
import net.minecraft.world.gen.placement.Placement;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
|
import net.minecraftforge.common.ForgeMod;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.event.world.BiomeLoadingEvent;
|
import net.minecraftforge.event.world.BiomeLoadingEvent;
|
||||||
import net.minecraftforge.eventbus.api.EventPriority;
|
import net.minecraftforge.eventbus.api.EventPriority;
|
||||||
|
@ -108,6 +109,8 @@ public class Create {
|
||||||
|
|
||||||
DistExecutor.unsafeRunWhenOn(Dist.CLIENT,
|
DistExecutor.unsafeRunWhenOn(Dist.CLIENT,
|
||||||
() -> () -> CreateClient.addClientListeners(forgeEventBus, modEventBus));
|
() -> () -> CreateClient.addClientListeners(forgeEventBus, modEventBus));
|
||||||
|
|
||||||
|
ForgeMod.enableMilkFluid();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void init(final FMLCommonSetupEvent event) {
|
public static void init(final FMLCommonSetupEvent event) {
|
||||||
|
|
|
@ -13,6 +13,7 @@ import net.minecraft.item.MilkBucketItem;
|
||||||
import net.minecraft.potion.PotionUtils;
|
import net.minecraft.potion.PotionUtils;
|
||||||
import net.minecraft.potion.Potions;
|
import net.minecraft.potion.Potions;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.ForgeMod;
|
||||||
import net.minecraftforge.common.util.LazyOptional;
|
import net.minecraftforge.common.util.LazyOptional;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
|
||||||
|
@ -105,7 +106,7 @@ public class GenericItemFilling {
|
||||||
|
|
||||||
private static boolean canFillBucketInternally(FluidStack availableFluid) {
|
private static boolean canFillBucketInternally(FluidStack availableFluid) {
|
||||||
return availableFluid.getFluid()
|
return availableFluid.getFluid()
|
||||||
.isSame(AllFluids.MILK.get().getFlowing());
|
.isSame(ForgeMod.MILK.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemStack fillItem(World world, int requiredAmount, ItemStack stack, FluidStack availableFluid) {
|
public static ItemStack fillItem(World world, int requiredAmount, ItemStack stack, FluidStack availableFluid) {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import com.simibubi.create.AllRecipeTypes;
|
||||||
|
|
||||||
import net.minecraft.data.DataGenerator;
|
import net.minecraft.data.DataGenerator;
|
||||||
import net.minecraft.item.Items;
|
import net.minecraft.item.Items;
|
||||||
|
import net.minecraftforge.common.ForgeMod;
|
||||||
|
|
||||||
public class EmptyingRecipeGen extends ProcessingRecipeGen {
|
public class EmptyingRecipeGen extends ProcessingRecipeGen {
|
||||||
|
|
||||||
|
@ -27,7 +28,7 @@ public class EmptyingRecipeGen extends ProcessingRecipeGen {
|
||||||
|
|
||||||
MILK_BUCKET = create("milk_bucket", b -> b
|
MILK_BUCKET = create("milk_bucket", b -> b
|
||||||
.require(Items.MILK_BUCKET)
|
.require(Items.MILK_BUCKET)
|
||||||
.output(AllFluids.MILK.get(), 1000)
|
.output(ForgeMod.MILK.get(), 1000)
|
||||||
.output(Items.BUCKET))
|
.output(Items.BUCKET))
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
"item": "minecraft:glass_bottle"
|
"item": "minecraft:glass_bottle"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fluid": "create:milk",
|
"fluid": "minecraft:milk",
|
||||||
"amount": 250
|
"amount": 250
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue