-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Cindershell entity of Creatures And Beats mod #57
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
src/main/java/cech12/ceramicbucket/compat/CreaturesAndBeastsCompat.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+262 Bytes
...resources/assets/ceramicbucket/textures/item/bucket_content/cnb/cindershell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.