Skip to content

Commit

Permalink
Support Cindershell entity of Creatures And Beats mod #57
Browse files Browse the repository at this point in the history
  • Loading branch information
cech12 committed Jun 12, 2021
1 parent 1a14104 commit a605baa
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package cech12.ceramicbucket.compat;

import cech12.ceramicbucket.api.data.ObtainableEntityType;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.fluid.Fluid;
import net.minecraft.fluid.Fluids;
import net.minecraft.tags.FluidTags;
import net.minecraft.util.ResourceLocation;

import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;

public class CreaturesAndBeastsCompat extends ModCompat.Mod implements ModCompat.EntityTypeObtainingMod {

private final List<ObtainableEntityType> obtainableEntityTypes = new ArrayList<>();

public CreaturesAndBeastsCompat() {
super("cnb");
this.obtainableEntityTypes.add(new ObtainableEntityType.Builder(new ResourceLocation(this.name, "cindershell"), Fluids.LAVA).addFluidTag(FluidTags.LAVA).build());
}

@Override
public List<ObtainableEntityType> getObtainableEntityTypes() {
return this.obtainableEntityTypes;
}

//TODO let only children be spawned out of a "creative" bucket

@Override
public boolean canEntityBeObtained(@Nonnull Fluid fluid, @Nonnull Entity entity) {
//only support children to be obtainable
return ModCompat.EntityTypeObtainingMod.super.canEntityBeObtained(fluid, entity)
&& entity instanceof LivingEntity && ((LivingEntity) entity).isChild();
}

}
1 change: 1 addition & 0 deletions src/main/java/cech12/ceramicbucket/compat/ModCompat.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class ModCompat {
new CavesAndCliffs117ConceptCompat(),
new CavesAndCliffsBackportCompat(),
new CombustiveFishingCompat(),
new CreaturesAndBeastsCompat(),
new EnvironmentalCompat(),
new FinsAndTrailsCompat(),
new MilkAllTheMobs(),
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a605baa

Please sign in to comment.