Skip to content

Commit

Permalink
as much more owl-drawing as I can do before I pass out
Browse files Browse the repository at this point in the history
  • Loading branch information
LemmaEOF committed Aug 18, 2023
1 parent 4c49a99 commit ae2755f
Show file tree
Hide file tree
Showing 29 changed files with 198 additions and 23 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ Spore bundle and sporebrush ash items - edited from assets in ["RPG Items - Retr
Springstool, glowcap, and paddle rhizome blocks - Cart3r
Mycoturge's journal, spore pouch, side sword, springstool shield, and arrow of grief items, relaxation effect icon - danidoom
Grief HUD animation - [email protected]
Springstool bounce sound effect - edited from sounds by [pbimal](https://freesound.org/people/pbimal/sounds/534111/) and [odeean](https://freesound.org/people/odeean/sounds/139476/) on FreeSound
Springstool bounce sound effect - edited from sounds by [pbimal](https://freesound.org/people/pbimal/sounds/534111/) and [odeean](https://freesound.org/people/odeean/sounds/139476/) on FreeSound
Glowcap buzz sound effect - edited from sounds by [EverydaySounds](https://freesound.org/people/EverydaySounds/sounds/125064/) and [deleted_user_14597403](https://freesound.org/people/deleted_user_14597403/sounds/678717/)
Binary file added artsrc/pot_cooking.ase
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ qm_build=23
loader_version=0.20.0-beta.11

# Mod Properties
mod_version = 0.1.3-blanketcon
mod_version = 0.1.4-blanketcon
maven_group = gay.lemmaeof
archives_base_name = mycoturgy

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/gay/lemmaeof/mycoturgy/Mycoturgy.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ public void onInitialize(ModContainer container) {
.conditionally(RandomChanceLootCondition.builder(0.1f)
.build()
)
.with(ItemEntry.builder(MycoturgyItems.GLITTERING_SPORES)
.with(ItemEntry.builder(MycoturgyItems.GLIMMERING_SPORES)
.build()
).build());
}
});

ItemContentRegistries.COMPOST_CHANCES.put(MycoturgyItems.GLITTERING_SPORES, 0.3f);
ItemContentRegistries.COMPOST_CHANCES.put(MycoturgyItems.GLIMMERING_SPORES, 0.3f);
ItemContentRegistries.COMPOST_CHANCES.put(MycoturgyItems.SPOREBRUSH, 0.65f);
ItemContentRegistries.COMPOST_CHANCES.put(MycoturgyItems.SPORE_BUNDLE, 0.85f);

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/gay/lemmaeof/mycoturgy/MycoturgyClient.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package gay.lemmaeof.mycoturgy;

import gay.lemmaeof.mycoturgy.patchouli.PotCookingPage;
import net.minecraft.client.item.ModelPredicateProviderRegistry;
import net.minecraft.client.item.UnclampedModelPredicateProvider;

Expand Down Expand Up @@ -42,6 +43,7 @@ public void onInitializeClient(ModContainer container) {
ColorProviderRegistry.BLOCK.register((state, world, pos, index) -> FluidRenderHandlerRegistry.INSTANCE.get(Fluids.WATER).getFluidColor(world, pos, Fluids.WATER.getDefaultState()), MycoturgyBlocks.MASON_JAR, MycoturgyBlocks.COOKING_POT);
HudRenderCallback.EVENT.register(HaustorBandHud::render);
ClientBookRegistry.INSTANCE.pageTypes.put(new Identifier(Mycoturgy.MODID, "jar_infusing"), JarInfusingPage.class);
ClientBookRegistry.INSTANCE.pageTypes.put(new Identifier(Mycoturgy.MODID, "pot_cooking"), PotCookingPage.class);
BlockEntityRendererFactories.register(MycoturgyBlocks.MASON_JAR_BLOCK_ENTITY, MasonJarBlockEntityRenderer::new);
BlockEntityRendererFactories.register(MycoturgyBlocks.COOKING_POT_BLOCK_ENTITY, CookingPotBlockEntityRenderer::new);
ModelPredicateProviderRegistry.register(MycoturgyItems.LACED_DAGGER, new Identifier("blocking"), blockingPredicate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,39 @@
import gay.lemmaeof.mycoturgy.block.entity.GlowcapBlockEntity;
import gay.lemmaeof.mycoturgy.component.HaustorComponent;
import gay.lemmaeof.mycoturgy.init.MycoturgyComponents;
import gay.lemmaeof.mycoturgy.init.MycoturgySounds;
import gay.lemmaeof.mycoturgy.util.VoxelMath;
import net.minecraft.block.Block;
import net.minecraft.block.BlockEntityProvider;
import net.minecraft.block.BlockState;
import net.minecraft.block.ShapeContext;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundCategory;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.DirectionProperty;
import net.minecraft.state.property.Properties;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.random.RandomGenerator;
import net.minecraft.util.shape.VoxelShape;
import net.minecraft.util.shape.VoxelShapes;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldView;
import org.jetbrains.annotations.Nullable;

public class ClingyGlowcapBlock extends Block implements BlockEntityProvider {
public static final DirectionProperty FACING = Properties.HORIZONTAL_FACING;
private static final VoxelShape[] SHAPES = VoxelMath.rotationsOf(VoxelShapes.union(
Block.createCuboidShape(6, 4, 6, 10, 14, 10),
Block.createCuboidShape(1, 13.925, 1, 15, 14.925, 15),
// Block.createCuboidShape(1.5, 9, 1.5, 14.9, 14, 14.5),
Block.createCuboidShape(6, 2, 0, 10, 6, 6),
Block.createCuboidShape(6, 2, 6, 10, 4, 8)
));

public ClingyGlowcapBlock(Settings settings) {
super(settings);
Expand All @@ -35,6 +48,17 @@ protected void appendProperties(StateManager.Builder<Block, BlockState> builder)
builder.add(FACING);
}

@Override
public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
return switch (state.get(FACING)) {
case NORTH -> SHAPES[0];
case SOUTH -> SHAPES[1];
case WEST -> SHAPES[2];
case EAST -> SHAPES[3];
default -> throw new IllegalStateException("Should not have up and down states here!");
};
}

@Nullable
@Override
public BlockState getPlacementState(ItemPlacementContext ctx) {
Expand All @@ -57,6 +81,18 @@ public void randomDisplayTick(BlockState state, World world, BlockPos pos, Rando
double g = (double) random.nextFloat() * -0.04D;
world.addParticle(ParticleTypes.END_ROD, d, e, f, 0.0D, g, 0.0D);
}
if (random.nextInt(100) == 0) {
world.playSound(
(double)pos.getX() + 0.5,
(double)pos.getY() + 0.5,
(double)pos.getZ() + 0.5,
MycoturgySounds.GLOWCAP_HUM,
SoundCategory.BLOCKS,
0.5F + random.nextFloat(),
random.nextFloat() * 0.1F + 0.95F,
false
);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package gay.lemmaeof.mycoturgy.block;

import gay.lemmaeof.mycoturgy.init.MycoturgyItems;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.CropBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.tag.BlockTags;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.state.StateManager;
Expand Down Expand Up @@ -65,4 +67,8 @@ protected boolean canPlantOnTop(BlockState floor, BlockView world, BlockPos pos)
return floor.isIn(BlockTags.MUSHROOM_GROW_BLOCK);
}

@Override
public ItemStack getPickStack(BlockView world, BlockPos pos, BlockState state) {
return new ItemStack(MycoturgyItems.GLIMMERING_SPORES);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public SpringstoolBlock(double bounceHeight, IntProperty x, IntProperty z, Setti
@Override
public void onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, float fallDistance) {
if (entity.bypassesLandingEffects()) {
super.onLandedUpon(world, state, pos, entity, fallDistance);
//no-op - no fall damage!
} else {
this.bounce(entity);
}
Expand Down
25 changes: 19 additions & 6 deletions src/main/java/gay/lemmaeof/mycoturgy/block/SturdyGlowcapBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import gay.lemmaeof.mycoturgy.block.entity.GlowcapBlockEntity;
import gay.lemmaeof.mycoturgy.component.HaustorComponent;
import gay.lemmaeof.mycoturgy.init.MycoturgyComponents;
import gay.lemmaeof.mycoturgy.init.MycoturgySounds;
import net.minecraft.block.Block;
import net.minecraft.block.BlockEntityProvider;
import net.minecraft.block.BlockState;
Expand All @@ -14,6 +15,7 @@
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundCategory;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.IntProperty;
import net.minecraft.util.math.BlockPos;
Expand All @@ -26,13 +28,12 @@

public class SturdyGlowcapBlock extends BigBlock implements BlockEntityProvider {
public static final IntProperty Y = IntProperty.of("y", 0, 2);
private static final VoxelShape LOWER_SHAPE = Block.createCuboidShape(6, 0, 6, 10, 19, 10);
private static final VoxelShape MIDDLE_SHAPE = Block.createCuboidShape(6, 0, 6, 10, 19, 10);
private static final VoxelShape LOWER_SHAPE = Block.createCuboidShape(6, 0, 6, 10, 16, 10);
private static final VoxelShape MIDDLE_SHAPE = Block.createCuboidShape(6, 0, 6, 10, 16, 10);
private static final VoxelShape UPPER_SHAPE = VoxelShapes.union(
Block.createCuboidShape(4, 6, 4, 12, 13, 12),
Block.createCuboidShape(5, 3, 5, 11, 6, 11),
Block.createCuboidShape(3, 13, 3, 13, 16, 13),
Block.createCuboidShape(1, 13, 1, 15, 13, 15)
Block.createCuboidShape(6, 0, 6, 10, 14, 10),
Block.createCuboidShape(1, 13.925, 1, 15, 14.925, 15)
// Block.createCuboidShape(1.5, 9, 1.5, 14.9, 14, 14.5)
);

public SturdyGlowcapBlock(Settings settings) {
Expand Down Expand Up @@ -62,6 +63,18 @@ public void randomDisplayTick(BlockState state, World world, BlockPos pos, Rando
double g = (double) random.nextFloat() * -0.04D;
world.addParticle(ParticleTypes.END_ROD, d, e, f, 0.0D, g, 0.0D);
}
if (random.nextInt(100) == 0) {
world.playSound(
(double)pos.getX() + 0.5,
(double)pos.getY() + 0.5,
(double)pos.getZ() + 0.5,
MycoturgySounds.GLOWCAP_HUM,
SoundCategory.BLOCKS,
0.5F + random.nextFloat(),
random.nextFloat() * 0.1F + 0.95F,
false
);
}
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/gay/lemmaeof/mycoturgy/init/MycoturgyItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
public class MycoturgyItems {
public static Item SPORE_BUNDLE;
public static Item SPOREBRUSH;
public static Item GLITTERING_SPORES;
public static Item GLIMMERING_SPORES;
public static Item SPOREBRUSH_ASH;
public static Item HAUSTORAL_BAND;
public static Item MYCOTURGE_JOURNAL;
Expand All @@ -45,7 +45,7 @@ public class MycoturgyItems {
public static void init() {
SPORE_BUNDLE = register("spore_bundle", new Item(new Item.Settings()));
SPOREBRUSH = register("sporebrush", new Item(new Item.Settings()));
GLITTERING_SPORES = register("glimmering_spores", new AliasedBlockItem(MycoturgyBlocks.SPOREBRUSH_CROP, new Item.Settings()));
GLIMMERING_SPORES = register("glimmering_spores", new AliasedBlockItem(MycoturgyBlocks.SPOREBRUSH_CROP, new Item.Settings()));
SPOREBRUSH_ASH = register("sporebrush_ash", new AliasedBlockItem(MycoturgyBlocks.SCATTERED_ASHES, new Item.Settings()));
HAUSTORAL_BAND = register("haustoral_band", new HaustoralBandItem(new Item.Settings().maxCount(1).rarity(Rarity.RARE)));
MYCOTURGE_JOURNAL = register("mycoturge_journal", new MycoturgeJournalItem(new Item.Settings().maxCount(1)));
Expand Down Expand Up @@ -79,7 +79,7 @@ public static void init() {
entries.addItem(MycoturgyBlocks.INFESTED_MOB_SPAWNER);
entries.addItem(SPORE_BUNDLE);
entries.addItem(SPOREBRUSH);
entries.addItem(GLITTERING_SPORES);
entries.addItem(GLIMMERING_SPORES);
entries.addItem(SPOREBRUSH_ASH);
entries.addItem(HAUSTORAL_BAND);
entries.addItem(MYCOTURGE_JOURNAL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

public class MycoturgySounds {
public static final SoundEvent SPRINGSTOOL_BOUNCE = register("springstool_bounce");
public static final SoundEvent GLOWCAP_HUM = register("glowcap_hum");

public static void init() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,10 @@ && getPipeFill(stack) > 0
@Override
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
if (!world.isClient && stack.getOrCreateNbt().containsUuid("LastHit")) {
int shareCooldown = stack.getNbt().getInt("ShareCooldown");
if (shareCooldown == 0) {
long lastTime = stack.getNbt().getLong("LastHitTime");
if (entity.getWorld().getTime() - lastTime > 600) {
stack.getNbt().remove("LastHit");
stack.getNbt().remove("ShareCooldown");
} else {
stack.getNbt().putInt("ShareCooldown", shareCooldown - 1);
stack.getNbt().remove("LastHitTime");
}
}
}
Expand Down Expand Up @@ -176,7 +174,7 @@ private void puff(ItemStack stack, int smoked, ServerPlayerEntity player) {
}
}
stack.getNbt().putUuid("LastHit", player.getUuid());
stack.getNbt().putInt("ShareCooldown", 600);
stack.getNbt().putLong("LastHitTime", player.getWorld().getTime());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
import net.minecraft.util.Identifier;

public class JarInfusingPage extends PageDoubleRecipeRegistry<JarInfusingRecipe> {
private static final Identifier CUSTOM_CRAFTING_TEXTURE = new Identifier(Mycoturgy.MODID, "textures/gui/custom_crafting.png");
private static final Identifier JAR_INFUSING_TEXTURE = new Identifier(Mycoturgy.MODID, "textures/gui/jar_infusing.png");

public JarInfusingPage() {
super(MycoturgyRecipes.JAR_INFUSING_RECIPE);
}

@Override
protected void drawRecipe(GuiGraphics graphics, JarInfusingRecipe recipe, int recipeX, int recipeY, int mouseX, int mouseY, boolean second) {
graphics.drawTexture(CUSTOM_CRAFTING_TEXTURE, recipeX, recipeY, 11.0F, 71.0F, 96, 24, 128, 128);
graphics.drawTexture(JAR_INFUSING_TEXTURE, recipeX, recipeY, 11.0F, 71.0F, 96, 24, 128, 128);
this.parent.drawCenteredStringNoShadow(graphics, this.getTitle(second).asOrderedText(), 58, recipeY - 10, this.book.headerColor);
this.parent.renderIngredient(graphics, recipeX + 4, recipeY + 4, mouseX, mouseY, recipe.getIngredients().get(0));
this.parent.renderItemStack(graphics, recipeX + 76, recipeY + 4, mouseX, mouseY, recipe.getResult(DynamicRegistryManager.EMPTY));
Expand Down
61 changes: 61 additions & 0 deletions src/main/java/gay/lemmaeof/mycoturgy/patchouli/PotCookingPage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package gay.lemmaeof.mycoturgy.patchouli;

import gay.lemmaeof.mycoturgy.Mycoturgy;
import gay.lemmaeof.mycoturgy.init.MycoturgyRecipes;
import gay.lemmaeof.mycoturgy.recipe.PotCookingRecipe;
import it.unimi.dsi.fastutil.ints.IntIntPair;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.DynamicRegistryManager;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import net.minecraft.world.World;
import vazkii.patchouli.client.book.page.abstr.PageDoubleRecipeRegistry;

public class PotCookingPage extends PageDoubleRecipeRegistry<PotCookingRecipe> {
private static final Identifier POT_COOKING_TEXTURE = new Identifier(Mycoturgy.MODID, "textures/gui/pot_cooking.png");
private static final IntIntPair[] POSITIONS = new IntIntPair[] {
IntIntPair.of(22, 4),
IntIntPair.of(58, 4),
IntIntPair.of(76, 32),
IntIntPair.of(58, 60),
IntIntPair.of(22, 60),
IntIntPair.of(4, 32)
};

public PotCookingPage() {
super(MycoturgyRecipes.POT_COOKING_RECIPE);
}

@Override
protected void drawRecipe(GuiGraphics graphics, PotCookingRecipe recipe, int recipeX, int recipeY, int mouseX, int mouseY, boolean second) {
graphics.drawTexture(POT_COOKING_TEXTURE, recipeX, recipeY, 0F, 0F, 96, 80, 128, 128);
this.parent.drawCenteredStringNoShadow(graphics, this.getTitle(second).asOrderedText(), 58, recipeY - 10, this.book.headerColor);
for (int i = 0; i < recipe.getIngredients().size(); i++) {
this.parent.renderIngredient(graphics, recipeX + POSITIONS[i].firstInt(), recipeY + POSITIONS[i].secondInt(), mouseX, mouseY, recipe.getIngredients().get(i));
}
this.parent.renderItemStack(graphics, recipeX + 40, recipeY + 32, mouseX, mouseY, recipe.getResult(DynamicRegistryManager.EMPTY));
if (recipe.getHyphaCost() > 0) {
this.parent.drawCenteredStringNoShadow(graphics, "" + recipe.getHyphaCost(), recipeX + 31, recipeY + 40, this.book.textColor);
if (this.parent.isMouseInRelativeRange(mouseX, mouseY, recipeX + 23, recipeY + 28, 16, 20)) {
this.parent.setTooltip(Text.translatable("text.mycoturgy.hypha_cost"));
}
}
if (recipe.getLamellaCost() > 0) {
this.parent.drawCenteredStringNoShadow(graphics, "" + recipe.getLamellaCost(), recipeX + 65, recipeY + 40, this.book.textColor);
if (this.parent.isMouseInRelativeRange(mouseX, mouseY, recipeX + 54, recipeY + 28, 16, 20)) {
this.parent.setTooltip(Text.translatable("text.mycoturgy.lamella_cost"));
}
}
}

@Override
protected ItemStack getRecipeOutput(World level, PotCookingRecipe recipe) {
return recipe.getResult(level.getRegistryManager());
}

@Override
protected int getRecipeHeight() {
return 100;
}
}
1 change: 1 addition & 0 deletions src/main/resources/assets/mycoturgy/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"mycoturgy.journal.page.splash.title": "Mycoturge's Journal",
"mycoturgy.journal.page.splash.text": "Sample Text! To be better formatted soon.",
"msg.mycoturgy.ashes": "Current ashes: %s",
"subtitle.mycoturgy.glowcap_hum": "Glowcap hums",
"subtitle.mycoturgy.springstool_bounce": "Springstool bounces",
"text.mycoturgy.hypha_cost": "Hypha Cost",
"text.mycoturgy.journal_intro": "Mycoturgy is the art of working with Sporebrush and Haustor energy.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
"rotation": [ -90, 0, 35 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
},
"ground": {
"rotation": [ 0, 0, 0 ],
"translation": [ 0, 2, 0 ],
"scale": [ 0.5, 0.5, 0.5 ]
}
},
"overrides": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Note: Laced Dagger",
"icon": "mycoturgy:laced_dagger",
"category": "mycoturgy:journal",
"advancement": "mycoturgy:research/meditate_laced_dagger",
"pages": [
{
"type": "text",
"text": "My experimentations with $(item)spores$() have found that contacting them can be quite a surprise to those not expecting it. This may be beneficial to put to use as a $(key)sidearm$() for self-defense.$(br)$(br)$(5)(Temporary recipe, bear with me)$()"
},
{
"type": "mycoturgy:pot_cooking",
"recipe": "mycoturgy:laced_dagger",
"text": "I should be sure to $(key)raise it in short bursts$() - too long and enemies will notice before I have time to $(key)counter their attacks$()."
}
]
}
4 changes: 4 additions & 0 deletions src/main/resources/assets/mycoturgy/sounds.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@
"springstool_bounce": {
"sounds": ["mycoturgy:springstool_bounce"],
"subtitle": "subtitle.mycoturgy.springstool_bounce"
},
"glowcap_hum": {
"sounds": ["mycoturgy:glowcap_hum"],
"subtitle": "subtitle.mycoturgy.glowcap_hum"
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ae2755f

Please sign in to comment.