Skip to content

Commit

Permalink
tweaks and textures
Browse files Browse the repository at this point in the history
  • Loading branch information
lumiscosity committed Jun 22, 2024
1 parent 4272f22 commit f486b34
Show file tree
Hide file tree
Showing 13 changed files with 4 additions and 10 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 3 additions & 9 deletions src/main/java/com/lumiscosity/rounded/blocks/TroughBlock.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.lumiscosity.rounded.blocks;

import com.lumiscosity.rounded.misc.RegisterSounds;
import com.mojang.serialization.MapCodec;
import net.minecraft.block.*;
import net.minecraft.entity.Entity;
Expand All @@ -16,7 +15,6 @@
import net.minecraft.registry.tag.TagKey;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.stat.Stats;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.IntProperty;
Expand All @@ -32,7 +30,6 @@
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldAccess;
import net.minecraft.world.WorldEvents;
import net.minecraft.world.event.GameEvent;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -75,8 +72,6 @@ public static void playEffects(WorldAccess world, BlockPos pos) {
BlockState blockState = world.getBlockState(pos);
world.playSound(null, pos, TROUGH_FILL, SoundCategory.BLOCKS);
double d = blockState.getOutlineShape(world, pos).getEndingCoord(Direction.Axis.Y, 0.5, 0.5) + 0.03125;
double e = 0.13125F;
double f = 0.7375F;
Random random = world.getRandom();

for (int i = 0; i < 10; i++) {
Expand Down Expand Up @@ -112,7 +107,7 @@ protected VoxelShape getCollisionShape(BlockState state, BlockView world, BlockP

@Override
protected void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify) {
if ((Integer)state.get(LEVEL) == 7) {
if (state.get(LEVEL) == 7) {
world.scheduleBlockTick(pos, state.getBlock(), 20);
}
}
Expand Down Expand Up @@ -200,7 +195,7 @@ protected boolean canPathfindThrough(BlockState state, NavigationType type) {
@Override
public SidedInventory getInventory(BlockState state, WorldAccess world, BlockPos pos) {
int i = state.get(LEVEL);
return (SidedInventory)(i < 7 ? new TroughBlock.TroughInventory(state, world, pos) : new TroughBlock.DummyInventory());
return i < 7 ? new TroughInventory(state, world, pos) : new DummyInventory();
}

static class TroughInventory extends SimpleInventory implements SidedInventory {
Expand Down Expand Up @@ -228,7 +223,7 @@ public int[] getAvailableSlots(Direction side) {

@Override
public boolean canInsert(int slot, ItemStack stack, @Nullable Direction dir) {
return !this.dirty && dir == Direction.UP && ComposterBlock.ITEM_TO_LEVEL_INCREASE_CHANCE.containsKey(stack.getItem());
return !this.dirty && dir == Direction.UP && stack.isIn(TagKey.of(RegistryKeys.ITEM, Identifier.of(MOD_ID, "trough_feed")));
}

@Override
Expand All @@ -242,7 +237,6 @@ public void markDirty() {
if (!itemStack.isEmpty()) {
this.dirty = true;
BlockState blockState = TroughBlock.addToTrough(null, this.state, this.world, this.pos, itemStack);
this.world.syncWorldEvent(WorldEvents.COMPOSTER_USED, this.pos, blockState != this.state ? 1 : 0);
this.removeStack(0);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/data/rounded/recipe/trough.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}
},
"pattern": [
"X X",,
"X X",
"# #",
"OOO"
],
Expand Down

0 comments on commit f486b34

Please sign in to comment.