Skip to content

Commit

Permalink
🎨 improve coupling
Browse files Browse the repository at this point in the history
  • Loading branch information
H2Sxxa committed Aug 23, 2023
1 parent d00c69f commit 3d001cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import javax.annotation.Nullable;

import io.github.teamgensouspark.kekkai.enums.EnumTouhouCapacity;
import io.github.teamgensouspark.kekkai.utils.KekkaiHelper;
import net.katsstuff.teamnightclipse.danmakucore.capability.dancoredata.IDanmakuCoreData;
import net.katsstuff.teamnightclipse.danmakucore.javastuff.TouhouHelper;
import net.minecraft.entity.player.EntityPlayer;

public class KekkaiCapacities {
Expand All @@ -17,11 +17,11 @@ public KekkaiCapacities(EntityPlayer player) {
}

public IDanmakuCoreData getDanmakuCoreData() {
return TouhouHelper.getDanmakuCoreData(player).orElseGet(null);
return KekkaiHelper.getDanmakuCoreData(player);
}

public KekkaiCapacities getSyncPlayer(Consumer<IDanmakuCoreData> consumer) {
TouhouHelper.changeAndSyncPlayerData(consumer, player);
KekkaiHelper.changeAndSyncPlayerData(consumer, player);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.katsstuff.teamnightclipse.danmakucore.javastuff.TouhouHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

Expand All @@ -23,4 +24,8 @@ public static void changeAndSyncEntityData(Consumer<IDanmakuCoreData> operator,
public static void changeAndSyncPlayerData(Consumer<IDanmakuCoreData> operator, EntityPlayer target) {
TouhouHelper.changeAndSyncPlayerData(operator, target);
}

public static IDanmakuCoreData getDanmakuCoreData(ICapabilityProvider provider) {
return TouhouHelper.getDanmakuCoreData(provider).orElseGet(null);
}
}

0 comments on commit 3d001cd

Please sign in to comment.