Skip to content

Commit

Permalink
Remapped to mojmap
Browse files Browse the repository at this point in the history
fixed travelers backpack incompat
  • Loading branch information
B1n-ry committed Jan 1, 2025
1 parent 673070d commit e08d2b6
Show file tree
Hide file tree
Showing 85 changed files with 1,999 additions and 1,978 deletions.
12 changes: 1 addition & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,6 @@ repositories {
includeGroup "maven.modrinth"
}
}
exclusiveContent {
forRepository {
maven {
url "https://cursemaven.com"
}
}
filter {
includeGroup "curse.maven"
}
}

maven { url 'https://maven.ladysnake.org/releases' } // Trinkets, cca
maven { url 'https://jitpack.io' } // Apoli
Expand All @@ -101,7 +91,7 @@ repositories {
dependencies {
// Important constants idk
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// Required dependencies
Expand Down
11 changes: 5 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ org.gradle.parallel=true

# Fabric Properties
minecraft_version=1.21.1
yarn_mappings=1.21.1+build.3
loader_version=0.16.9

# Mod Properties
Expand All @@ -14,14 +13,14 @@ org.gradle.parallel=true

# Dependencies
fabric_version=0.110.0+1.21.1
config_version=15.0.128
config_version=15.0.140

# Bundled
lib_gui_version=11.0.0+1.21
lib_gui_version=11.1.0+1.21
permissions_version=0.3.1

# Compat mods
modmenu_version=11.0.1
modmenu_version=11.0.3
protection_api_version=1.0.0

# Extra soulbound/drop rule modification mods
Expand All @@ -31,13 +30,13 @@ org.gradle.parallel=true
# Inventory compat
trinkets_version=3.10.0
# inventorio_version=GX7qPAzO
travelers_backpack_version=DRssSA0N
travelers_backpack_version=1.21.1-10.1.6
# numismatic_version=0.2.14+1.20.3
# apoli_version=2.12.0-alpha.12+mc.1.21.x
# origins_version=v1.12.10
levelz_version=2.0.2+1.21.1
# beans_backpacks_version=bsSV8DuI
accessories_version=1.0.0-beta.30+1.21
accessories_version=1.1.0-beta.19+1.21.1

# Dev dependencies
cca_version=6.1.0
Expand Down
26 changes: 13 additions & 13 deletions src/main/java/com/b1n_ry/yigd/DeathHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
import com.b1n_ry.yigd.events.DelayGraveGenerationEvent;
import com.b1n_ry.yigd.impl.ServerPlayerEntityImpl;
import com.b1n_ry.yigd.util.DropRule;
import net.minecraft.component.type.ProfileComponent;
import net.minecraft.entity.damage.DamageSource;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3d;
import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.item.component.ResolvableProfile;
import net.minecraft.world.phys.Vec3;

import java.util.UUID;

public class DeathHandler {
public void onPlayerDeath(ServerPlayerEntity player, ServerWorld world, Vec3d pos, DamageSource deathSource) {
public void onPlayerDeath(ServerPlayer player, ServerLevel world, Vec3 pos, DamageSource deathSource) {
YigdConfig config = YigdConfig.getConfig();

UUID killerId;
if (deathSource.getAttacker() instanceof ServerPlayerEntity killer) {
killerId = killer.getUuid();
if (deathSource.getEntity() instanceof ServerPlayer killer) {
killerId = killer.getUUID();
} else {
killerId = null;
}
Expand Down Expand Up @@ -57,10 +57,10 @@ public void onPlayerDeath(ServerPlayerEntity player, ServerWorld world, Vec3d po
inventoryComponent.applyLoss();
}

ProfileComponent profile = new ProfileComponent(player.getGameProfile());
Vec3d graveGenerationPos = !config.graveConfig.generateOnLastGroundPos ? pos : ((ServerPlayerEntityImpl) player).youre_in_grave_danger$getLastGroundPos();
ResolvableProfile profile = new ResolvableProfile(player.getGameProfile());
Vec3 graveGenerationPos = !config.graveConfig.generateOnLastGroundPos ? pos : ((ServerPlayerEntityImpl) player).youre_in_grave_danger$getLastGroundPos();
GraveComponent graveComponent = new GraveComponent(profile, inventoryComponent, expComponent,
world, graveGenerationPos.add(0D, .5D, 0D), deathSource.getDeathMessage(player), killerId); // Will keep track of player grave (if enabled)
world, graveGenerationPos.add(0D, .5D, 0D), deathSource.getLocalizedDeathMessage(player), killerId); // Will keep track of player grave (if enabled)

if (!graveComponent.isEmpty()) {
graveComponent.backUp();
Expand All @@ -70,7 +70,7 @@ public void onPlayerDeath(ServerPlayerEntity player, ServerWorld world, Vec3d po

respawnComponent.primeForRespawn(profile);

Direction playerDirection = player.getHorizontalFacing();
Direction playerDirection = player.getDirection();

if (!DelayGraveGenerationEvent.EVENT.invoker()
.skipGenerationCall(graveComponent, playerDirection, context, respawnComponent, "vanilla")) {
Expand Down
44 changes: 22 additions & 22 deletions src/main/java/com/b1n_ry/yigd/Yigd.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroups;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -38,13 +38,13 @@ public class Yigd implements ModInitializer {

public static Logger LOGGER = LoggerFactory.getLogger("YIGD");

public static GraveBlock GRAVE_BLOCK = new GraveBlock(AbstractBlock.Settings.create().strength(-1.0f, 3600000.0f).nonOpaque());
public static GraveBlock GRAVE_BLOCK = new GraveBlock(BlockBehaviour.Properties.of().strength(-1.0f, 3600000.0f).noOcclusion());
public static BlockEntityType<GraveBlockEntity> GRAVE_BLOCK_ENTITY;


// Optional registries
public static DeathScrollItem DEATH_SCROLL_ITEM = new DeathScrollItem(new Item.Settings());
public static GraveKeyItem GRAVE_KEY_ITEM = new GraveKeyItem(new Item.Settings());
public static DeathScrollItem DEATH_SCROLL_ITEM = new DeathScrollItem(new Item.Properties());
public static GraveKeyItem GRAVE_KEY_ITEM = new GraveKeyItem(new Item.Properties());

/**
* Any runnable added to this list will be executed on the end of the current server tick.
Expand All @@ -60,22 +60,22 @@ public class Yigd implements ModInitializer {
public void onInitialize() {
AutoConfig.register(YigdConfig.class, GsonConfigSerializer::new);

GRAVE_BLOCK_ENTITY = Registry.register(Registries.BLOCK_ENTITY_TYPE, Identifier.of(MOD_ID, "grave_block_entity"), BlockEntityType.Builder.create(GraveBlockEntity::new, GRAVE_BLOCK).build());
GRAVE_BLOCK_ENTITY = Registry.register(BuiltInRegistries.BLOCK_ENTITY_TYPE, ResourceLocation.fromNamespaceAndPath(MOD_ID, "grave_block_entity"), BlockEntityType.Builder.of(GraveBlockEntity::new, GRAVE_BLOCK).build());

Registry.register(Registries.BLOCK, Identifier.of(MOD_ID, "grave"), GRAVE_BLOCK);
Registry.register(Registries.ITEM, Identifier.of(MOD_ID, "grave"), new BlockItem(GRAVE_BLOCK, new Item.Settings()));
Registry.register(BuiltInRegistries.BLOCK, ResourceLocation.fromNamespaceAndPath(MOD_ID, "grave"), GRAVE_BLOCK);
Registry.register(BuiltInRegistries.ITEM, ResourceLocation.fromNamespaceAndPath(MOD_ID, "grave"), new BlockItem(GRAVE_BLOCK, new Item.Properties()));

Registry.register(Registries.DATA_COMPONENT_TYPE, Identifier.of(Yigd.MOD_ID, "grave_location"), GraveCompassHelper.GRAVE_LOCATION);
Registry.register(Registries.DATA_COMPONENT_TYPE, Identifier.of(Yigd.MOD_ID, "grave_id"), GraveComponent.GRAVE_ID);
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, ResourceLocation.fromNamespaceAndPath(Yigd.MOD_ID, "grave_location"), GraveCompassHelper.GRAVE_LOCATION);
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, ResourceLocation.fromNamespaceAndPath(Yigd.MOD_ID, "grave_id"), GraveComponent.GRAVE_ID);

Registry.register(Registries.ITEM, Identifier.of(MOD_ID, "death_scroll"), DEATH_SCROLL_ITEM);
Registry.register(Registries.ITEM, Identifier.of(MOD_ID, "grave_key"), GRAVE_KEY_ITEM);
Registry.register(BuiltInRegistries.ITEM, ResourceLocation.fromNamespaceAndPath(MOD_ID, "death_scroll"), DEATH_SCROLL_ITEM);
Registry.register(BuiltInRegistries.ITEM, ResourceLocation.fromNamespaceAndPath(MOD_ID, "grave_key"), GRAVE_KEY_ITEM);

ItemGroupEvents.modifyEntriesEvent(ItemGroups.FUNCTIONAL).register(entries -> {
entries.add(GRAVE_BLOCK.asItem());
ItemGroupEvents.modifyEntriesEvent(CreativeModeTabs.FUNCTIONAL_BLOCKS).register(entries -> {
entries.accept(GRAVE_BLOCK.asItem());

entries.add(DEATH_SCROLL_ITEM.getDefaultStack());
entries.add(GRAVE_KEY_ITEM.getDefaultStack());
entries.accept(DEATH_SCROLL_ITEM.getDefaultInstance());
entries.accept(GRAVE_KEY_ITEM.getDefaultInstance());
});

PacketInitializer.init();
Expand Down
Loading

0 comments on commit e08d2b6

Please sign in to comment.