Skip to content

Commit

Permalink
experiencing agony
Browse files Browse the repository at this point in the history
a lot of things happened
  • Loading branch information
adenator0 committed Dec 8, 2024
1 parent 8902cff commit 2d6979e
Show file tree
Hide file tree
Showing 15 changed files with 92 additions and 17 deletions.
Binary file added gcpdot_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gcpdot_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gcpdot_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gcpdot_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gcpdot_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gcpdot_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 2 additions & 4 deletions src/main/java/com/nuclearcrackhead/serverboss/SVBCR.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package com.nuclearcrackhead.serverboss;

import com.nuclearcrackhead.serverboss.registry.ModBlocks;
import com.nuclearcrackhead.serverboss.registry.ModFluids;
import com.nuclearcrackhead.serverboss.registry.ModItems;
import com.nuclearcrackhead.serverboss.registry.ModDamageTypes;
import com.nuclearcrackhead.serverboss.registry.*;
import net.fabricmc.api.ModInitializer;

import net.minecraft.util.Identifier;
Expand All @@ -25,5 +22,6 @@ public void onInitialize() {
ModFluids.init();
ModBlocks.init();
ModDamageTypes.init();
ModSounds.init();
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package com.nuclearcrackhead.serverboss.content.block;

import com.nuclearcrackhead.serverboss.SVBCR;
import com.nuclearcrackhead.serverboss.registry.ModDamageTypes;
import com.nuclearcrackhead.serverboss.registry.ModSounds;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.Block;
import com.mojang.serialization.MapCodec;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.entity.damage.DamageSource;

public class Agony extends Block {
public static final MapCodec<Agony> CODEC = createCodec(Agony::new);
Expand All @@ -25,11 +27,16 @@ public Agony(AbstractBlock.Settings settings) {

public void onSteppedOn(World world, BlockPos pos, BlockState state, Entity entity) {
if (!entity.bypassesSteppingEffects() && entity instanceof LivingEntity livingEntity) {
//DamageSource damageSource = new DamageSource(
//DamageSource damageSource = new DamageSource( //this sucks
// world.getRegistryManager()
// .get(RegistryKeys.DAMAGE_TYPE) //incoherent as hell
// .get(RegistryKeys.DAMAGE_TYPE)
// .entryOf(ModDamageTypes.AGONY_DAMAGE));
livingEntity.serverDamage(entity.getDamageSources().create(ModDamageTypes.AGONY_DAMAGE, null), livingEntity.getMaxHealth() / 7);
if (!world.isClient) {
//todo find a better way to do this so that it doesnt run every single tick
//world.playSound(null, pos, ModSounds.BLOCK_AGONY_ACTIVATE_FANGSNAP, SoundCategory.BLOCKS);
//world.playSound(null, pos, ModSounds.BLOCK_AGONY_ACTIVATE_ZOMBIESTEP, SoundCategory.BLOCKS);
}
}

super.onSteppedOn(world, pos, state, entity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class Sludge extends TranslucentBlock {
private static final double field_31103 = 0.05;
private static final int TICKS_PER_SECOND = 20;
protected static final VoxelShape SHAPE = Block.createCuboidShape((double)1.0F, (double)0.0F, (double)1.0F, (double)15.0F, (double)15.0F, (double)15.0F);
protected static final VoxelShape LINESHAPE = Block.createCuboidShape(0.0, 0.0, 0.0, 16.0, 15.0, 16.0);

public MapCodec<Sludge> getCodec() {
return CODEC;
Expand All @@ -43,6 +44,11 @@ protected VoxelShape getCollisionShape(BlockState state, BlockView world, BlockP
return SHAPE;
}

@Override
protected VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos pos, ShapeContext context) {
return LINESHAPE;
}

/*public void onLandedUpon(World world, BlockState state, BlockPos pos, Entity entity, float fallDistance) {
entity.playSound(SoundEvents.BLOCK_HONEY_BLOCK_SLIDE, 1.0F, 1.0F);
if (!world.isClient) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.nuclearcrackhead.serverboss.registry;

import com.nuclearcrackhead.serverboss.SVBCR;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Identifier;

public class ModSounds {
private ModSounds() {
//don't instantiate this again
}

public static final SoundEvent BLOCK_AGONY_ACTIVATE_FANGSNAP = registerSound("block.agony.activate_fangsnap");
public static final SoundEvent BLOCK_AGONY_ACTIVATE_ZOMBIESTEP = registerSound("block.agony.activate_zombiestep");

private static SoundEvent registerSound(String id) {
Identifier identifier = Identifier.of(SVBCR.MOD_ID, id);
return Registry.register(Registries.SOUND_EVENT, identifier, SoundEvent.of(identifier));
}

public static void init() {
//wawa
}

}
22 changes: 13 additions & 9 deletions src/main/resources/assets/svbcr/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"block.svbcr.example_block": "Example Block",
"block.svbcr.agony": "Agony",
"item.svbcr.example_item": "Example Item",
"block.svbcr.radioactive": "Radioactive Waste",
"block.svbcr.sludge": "Sludge",
"block.svbcr.wastebarrel": "Large Radioactive Waste Barrel",
"item.svbcr.radioactive_bucket": "Radioactive Waste Barrel",
"death.attack.agony": "%s was crushed by grief",
"death.attack.agony.player": "%s was crushed by grief whilst trying to escape %s"
"block.svbcr.agony": "Agony",
"block.svbcr.example_block": "Example Block",
"block.svbcr.radioactive": "Radioactive Waste",
"block.svbcr.sludge": "Sludge",
"block.svbcr.wastebarrel": "Large Radioactive Waste Barrel",

"death.attack.agony": "%s was crushed by grief",
"death.attack.agony.player": "%s was crushed by grief whilst trying to escape %s",

"item.svbcr.example_item": "Example Item",
"item.svbcr.radioactive_bucket": "Radioactive Waste Barrel",

"subtitles.block.agony.activate": "Agony"
}
24 changes: 24 additions & 0 deletions src/main/resources/assets/svbcr/sounds.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"block.agony.activate_fangsnap": {
"subtitle": "subtitles.block.agony.activate",
"sounds": [
{
"name": "entity.evoker_fangs.attack",
"type": "event",
"volume": 0.5,
"pitch": 0.5
}
]
},
"block.agony.activate_zombiestep": {
"subtitle": "subtitles.block.agony.activate",
"sounds": [
{
"name": "entity.zombie_villager.step",
"type": "event",
"volume": 0.5,
"pitch": 0.5
}
]
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/main/resources/resourcepacks/reworks/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"pack": {
"description": "Retextures of vanilla blocks to match SVB:CR",
"pack_format": 48,
"supported_formats": [
0,
2147483647
]
}
}
Binary file added src/main/resources/resourcepacks/reworks/pack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2d6979e

Please sign in to comment.