Skip to content

Commit

Permalink
wip: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
BlayTheNinth committed Feb 28, 2024
1 parent 13b6b62 commit 5c42b1c
Show file tree
Hide file tree
Showing 15 changed files with 65 additions and 127 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -653,36 +653,6 @@ public void buildRecipes(Consumer<FinishedRecipe> exporter) {
.requires(ModBlocks.compressedBlocks[CompressedBlockType.SOUL_SAND.ordinal()])
.unlockedBy("has_compressed_soul_sand", has(ModBlocks.compressedBlocks[CompressedBlockType.SOUL_SAND.ordinal()]))
.save(exporter);

// TODO shapeless(RecipeCategory.BUILDING_BLOCKS, ModItems.crushedAndesite, 9)
// TODO .requires(ModBlocks.compressedBlocks[CompressedBlockType.CRUSHED_ANDESITE.ordinal()])
// TODO .unlockedBy("has_compressed_crushed_andesite", has(ModBlocks.compressedBlocks[CompressedBlockType.CRUSHED_ANDESITE.ordinal()]))
// TODO .save(exporter);

// TODO shapeless(RecipeCategory.BUILDING_BLOCKS, ModItems.crushedDiorite, 9)
// TODO .requires(ModBlocks.compressedBlocks[CompressedBlockType.CRUSHED_DIORITE.ordinal()])
// TODO .unlockedBy("has_compressed_crushed_diorite", has(ModBlocks.compressedBlocks[CompressedBlockType.CRUSHED_DIORITE.ordinal()]))
// TODO .save(exporter);

// TODO shapeless(RecipeCategory.BUILDING_BLOCKS, ModItems.crushedGranite, 9)
// TODO .requires(ModBlocks.compressedBlocks[CompressedBlockType.CRUSHED_GRANITE.ordinal()])
// TODO .unlockedBy("has_compressed_crushed_granite", has(ModBlocks.compressedBlocks[CompressedBlockType.CRUSHED_GRANITE.ordinal()]))
// TODO .save(exporter);

// TODO shapeless(RecipeCategory.BUILDING_BLOCKS, ModItems.dust, 9)
// TODO .requires(ModBlocks.compressedBlocks[CompressedBlockType.DUST.ordinal()])
// TODO .unlockedBy("has_compressed_dust", has(ModBlocks.compressedBlocks[CompressedBlockType.DUST.ordinal()]))
// TODO .save(exporter);

// TODO shapeless(RecipeCategory.BUILDING_BLOCKS, ModItems.enderGravel, 9)
// TODO .requires(ModBlocks.compressedBlocks[CompressedBlockType.ENDER_GRAVEL.ordinal()])
// TODO .unlockedBy("has_compressed_ender_gravel", has(ModBlocks.compressedBlocks[CompressedBlockType.ENDER_GRAVEL.ordinal()]))
// TODO .save(exporter);

// TODO shapeless(RecipeCategory.BUILDING_BLOCKS, ModItems.netherGravel, 9)
// TODO .requires(ModBlocks.compressedBlocks[CompressedBlockType.NETHER_GRAVEL.ordinal()])
// TODO .unlockedBy("has_compressed_nether_gravel", has(ModBlocks.compressedBlocks[CompressedBlockType.NETHER_GRAVEL.ordinal()]))
// TODO .save(exporter);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class WoodenCrucibleBlockEntity extends BalmBlockEntity implements BalmFl
public int fill(Fluid fluid, int maxFill, boolean simulate) {
int result = super.fill(fluid, maxFill, simulate);
if (getAmount() > 1000) {
// TODO setAmount(1000);
setAmount(1000);
}
return result;
}
Expand Down Expand Up @@ -90,7 +90,7 @@ public boolean addItem(ItemStack itemStack, boolean isAutomated, boolean simulat
// Otherwise, try to add it as a recipe
WoodenCrucibleRecipe recipe = ExRegistries.getWoodenCrucibleRegistry().getRecipe(level, itemStack);
if (recipe != null) {
if (/*fluidTank.isEmpty() ||*/ recipe.matchesFluid(fluidTank.getFluid())) { // TODO isEmpty
if (fluidTank.isEmpty() || recipe.matchesFluid(fluidTank.getFluid())) {
int capacityLeft = fluidTank.getCapacity() - fluidTank.getAmount() - solidVolume;
if ((isAutomated && capacityLeft >= recipe.getAmount()) || (!isAutomated && capacityLeft > 0)) {
if (!simulate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,4 @@ private static ResourceLocation location(String path) {
return new ResourceLocation(ExCompressum.MOD_ID, path);
}

// TODO
/*@SubscribeEvent(priority = EventPriority.HIGHEST)
public static void onBake(ModelBakeEvent event) {
HeavySieveType[] sieveTypes = HeavySieveType.values;
for (HeavySieveType sieveType : sieveTypes) {
UnbakedModel model = event.getModelLoader().getModel(location("block/" + sieveType.getSerializedName() + "_sieve"));
model.getMaterials(event.getModelLoader()::getModel, Collections.emptySet());
}
}*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public static void initialize(BalmRenderers renderers) {
renderers.registerBlockEntityRenderer(ModBlockEntities.autoCompressedHammer::get, AutoHammerRenderer::compressed);
renderers.registerBlockEntityRenderer(ModBlockEntities.woodenCrucible::get, WoodenCrucibleRenderer::new);
renderers.registerBlockEntityRenderer(ModBlockEntities.bait::get, BaitRenderer::new);
// TODO renderers.registerBlockEntityRenderer(ModBlockEntities.manaSieve::get, AutoSieveRenderer::normal);

renderers.registerEntityRenderer(ModEntities.angryChicken::get, context -> new AngryChickenRenderer(context, new ChickenModel<>(context.bakeLayer(ModelLayers.CHICKEN)), 0.3f));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void render(WoodenCrucibleBlockEntity blockEntity, float partialTicks, Po
}

final var fluidTank = blockEntity.getFluidTank();
if (!fluidTank.getFluid().isSame(Fluids.EMPTY)) { // TODO fluidTank.isEmpty()
if (!fluidTank.isEmpty()) {
poseStack.pushPose();
float fillLevel = (float) fluidTank.getAmount() / (float) blockEntity.getFluidTank().getCapacity();
poseStack.translate(0f, fillLevel * 11 / 16f, 0f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.blay09.mods.excompressum.ExCompressum;
import net.blay09.mods.excompressum.config.ExCompressumConfig;
import net.blay09.mods.excompressum.tag.ModBlockTags;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.BlockTags;
import net.minecraft.world.InteractionHand;
Expand All @@ -16,7 +17,7 @@
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;

public class CompressedCrookItem extends DiggerItem implements ICompressedCrook {
public class CompressedCrookItem extends DiggerItem {

public static final String name = "compressed_crook";
public static final ResourceLocation registryName = new ResourceLocation(ExCompressum.MOD_ID, name);
Expand Down Expand Up @@ -54,18 +55,9 @@ private void pushEntity(ItemStack itemStack, Player player, Entity entity) {
}

@Override
public boolean isCorrectToolForDrops(BlockState block) {
return block.is(BlockTags.LEAVES);
}

@Override
public float getDestroySpeed(ItemStack item, BlockState block) {
return block.is(BlockTags.LEAVES) ? (float) (getTier().getSpeed() * ExCompressumConfig.getActive().tools.compressedCrookSpeedMultiplier) : 0f;
}

@Override
public boolean canCrook(ItemStack itemStack, Level level, BlockState state, Player player) {
return true;
public float getDestroySpeed(ItemStack itemStack, BlockState state) {
final var speed = ExCompressumConfig.getActive().tools.compressedCrookSpeedMultiplier;
return state.is(ModBlockTags.MINEABLE_WITH_CROOK) ? (float) (getTier().getSpeed() * speed) : 0f;
}

}
Original file line number Diff line number Diff line change
@@ -1,52 +1,13 @@
package net.blay09.mods.excompressum.item;

import net.blay09.mods.excompressum.ExCompressum;
import net.blay09.mods.excompressum.registry.ExRegistries;
import net.blay09.mods.excompressum.registry.ExNihilo;

import net.blay09.mods.excompressum.utils.StupidUtils;
import net.minecraft.tags.BlockTags;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.DiggerItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Tier;
import net.minecraft.world.item.crafting.RecipeManager;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;

import java.util.HashSet;

public class CompressedHammerItem extends DiggerItem implements ICompressedHammer {
public class CompressedHammerItem extends DiggerItem {

public CompressedHammerItem(Tier tier, Item.Properties properties) {
super(6f, -3.2f, tier, ModTags.MINEABLE_WITH_HAMMER, properties);
}

@Override
public boolean isCorrectToolForDrops(BlockState state) {
RecipeManager recipeManager = ExCompressum.proxy.get().getRecipeManager(null);
ItemStack itemStack = StupidUtils.getItemStackFromState(state);
return ExRegistries.getCompressedHammerRegistry().isHammerable(recipeManager, itemStack) || ExNihilo.getInstance().isHammerable(state);
}

@Override
public float getDestroySpeed(ItemStack stack, BlockState state) {
RecipeManager recipeManager = ExCompressum.proxy.get().getRecipeManager(null);
ItemStack itemStack = StupidUtils.getItemStackFromState(state);
if ((ExRegistries.getCompressedHammerRegistry().isHammerable(recipeManager, itemStack) || ExNihilo.getInstance().isHammerable(state))) {
return speed * 0.75f;
}
return 0.8f;
}

@Override
public boolean canHammer(ItemStack itemStack, Level level, BlockState state, Player player) {
return true;
}

@Override
public int getHammerLevel(ItemStack itemStack, Level level, BlockState state, Player player) {
return getTier().getLevel();
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,10 @@ public class ModItemTags {
public static final TagKey<Item> WOODEN_CROOKS = TagKey.create(Registries.ITEM, new ResourceLocation(ExCompressum.MOD_ID, "wooden_crooks"));
public static final TagKey<Item> WOODEN_COMPRESSED_CROOKS = TagKey.create(Registries.ITEM, new ResourceLocation(ExCompressum.MOD_ID, "wooden_compressed_crooks"));
public static final TagKey<Item> WOODEN_CRUCIBLES = TagKey.create(Registries.ITEM, new ResourceLocation(ExCompressum.MOD_ID, "wooden_crucibles"));

public static final TagKey<Item> CRUSHED_ANDESITES = TagKey.create(Registries.ITEM, new ResourceLocation(ExCompressum.MOD_ID, "crushed_andesites"));
public static final TagKey<Item> CRUSHED_DIORITES = TagKey.create(Registries.ITEM, new ResourceLocation(ExCompressum.MOD_ID, "crushed_diorites"));
public static final TagKey<Item> CRUSHED_GRANITES = TagKey.create(Registries.ITEM, new ResourceLocation(ExCompressum.MOD_ID, "crushed_granites"));
public static final TagKey<Item> CRUSHED_NETHERRACKS = TagKey.create(Registries.ITEM, new ResourceLocation(ExCompressum.MOD_ID, "crushed_netherracks"));
public static final TagKey<Item> CRUSHED_END_STONES = TagKey.create(Registries.ITEM, new ResourceLocation(ExCompressum.MOD_ID, "crushed_end_stones"));
public static final TagKey<Item> DUSTS = TagKey.create(Registries.ITEM, new ResourceLocation(ExCompressum.MOD_ID, "dusts"));

public static final TagKey<Item> CRUCIBLES = TagKey.create(Registries.ITEM, new ResourceLocation(ExCompressum.MOD_ID, "crucibles")); // TODO needed?
public static final TagKey<Item> CROOKS = TagKey.create(Registries.ITEM, new ResourceLocation(ExCompressum.MOD_ID, "crooks")); // TODO needed?
public static final TagKey<Item> COMPRESSED_CROOKS = TagKey.create(Registries.ITEM, new ResourceLocation(ExCompressum.MOD_ID, "compressed_crooks")); // TODO needed?
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"type": "minecraft:crafting_shapeless",
"result": {
"item": "exnihilosequentia:crushed_andesite",
"count": 9
},
"ingredients": [
{
"item": "excompressum:compressed_crushed_andesite"
}
],
"conditions": [
{
"type": "forge:item_exists",
"item": "exnihilosequentia:crushed_andesite"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"type": "minecraft:crafting_shapeless",
"result": {
"item": "exnihilosequentia:crushed_diorite",
"count": 9
},
"ingredients": [
{
"item": "excompressum:compressed_crushed_diorite"
}
],
"conditions": [
{
"type": "forge:item_exists",
"item": "exnihilosequentia:crushed_diorite"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"ingredients": [
{
"item": "excompressum:compressed_ender_gravel"
"item": "excompressum:compressed_crushed_end_stone"
}
],
"conditions": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"type": "minecraft:crafting_shapeless",
"result": {
"item": "exnihilosequentia:crushed_granite",
"count": 9
},
"ingredients": [
{
"item": "excompressum:compressed_crushed_granite"
}
],
"conditions": [
{
"type": "forge:item_exists",
"item": "exnihilosequentia:crushed_granite"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "excompressum:compressed_nether_gravel"
"item": "excompressum:compressed_crushed_netherrack"
}
],
"conditions": [
Expand Down

0 comments on commit 5c42b1c

Please sign in to comment.