-
-
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.
- Loading branch information
Showing
9 changed files
with
67 additions
and
4 deletions.
There are no files selected for viewing
Binary file added
BIN
+638 Bytes
src/client/resources/assets/universal_ores/textures/block/basalt_gold_ore_side.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Binary file added
BIN
+277 Bytes
...lient/resources/assets/universal_ores/textures/block/basalt_quartz_ore_side.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
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
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
38 changes: 38 additions & 0 deletions
38
src/main/java/fr/hugman/universal_ores/block/DropExperienceRotatedPillarBlock.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 fr.hugman.universal_ores.block; | ||
|
||
import com.mojang.serialization.MapCodec; | ||
import com.mojang.serialization.codecs.RecordCodecBuilder; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.block.PillarBlock; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.server.world.ServerWorld; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.intprovider.IntProvider; | ||
|
||
public class DropExperienceRotatedPillarBlock extends PillarBlock { | ||
public static final MapCodec<DropExperienceRotatedPillarBlock> CODEC = RecordCodecBuilder.mapCodec( | ||
instance -> instance.group(IntProvider.createValidatingCodec(0, 10).fieldOf("experience").forGetter(block -> block.experienceDropped), createSettingsCodec()) | ||
.apply(instance, DropExperienceRotatedPillarBlock::new) | ||
); | ||
|
||
private final IntProvider experienceDropped; | ||
|
||
@Override | ||
public MapCodec<? extends DropExperienceRotatedPillarBlock> getCodec() { | ||
return CODEC; | ||
} | ||
|
||
public DropExperienceRotatedPillarBlock(IntProvider experienceDropped, Settings settings) { | ||
super(settings); | ||
this.experienceDropped = experienceDropped; | ||
} | ||
|
||
|
||
@Override | ||
protected void onStacksDropped(BlockState state, ServerWorld world, BlockPos pos, ItemStack tool, boolean dropExperience) { | ||
super.onStacksDropped(state, world, pos, tool, dropExperience); | ||
if (dropExperience) { | ||
this.dropExperienceWhenMined(world, pos, tool, this.experienceDropped); | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/fr/hugman/universal_ores/block/UniversalOresBlockTypes.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,14 @@ | ||
package fr.hugman.universal_ores.block; | ||
|
||
import com.mojang.serialization.MapCodec; | ||
import fr.hugman.universal_ores.UniversalOres; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.Registry; | ||
|
||
public class UniversalOresBlockTypes { | ||
public static final MapCodec<DropExperienceRotatedPillarBlock> DROP_EXPERIENCE_ROTATED_PILLAR = register("drop_experience_rotated_pillar", DropExperienceRotatedPillarBlock.CODEC); | ||
|
||
public static MapCodec<DropExperienceRotatedPillarBlock> register(String id, MapCodec<DropExperienceRotatedPillarBlock> codec) { | ||
return Registry.register(Registries.BLOCK_TYPE, UniversalOres.id(id), codec); | ||
} | ||
} |
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