Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
MehVahdJukaar committed Dec 27, 2024
2 parents 820cfc1 + 65908f1 commit 0db2bee
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public class ModMapMarkers {
Supplementaries.res("flag"), FlagMarker::new, FlagMarker::getFromWorld, ColoredDecoration::new);
public static final CustomDecorationType<CustomMapDecoration, NetherPortalMarker> NETHER_PORTAL_DECORATION_TYPE = CustomDecorationType.withWorldMarker(
Supplementaries.res("nether_portal"), NetherPortalMarker::new, NetherPortalMarker::getFromWorld, CustomMapDecoration::new);
public static final CustomDecorationType<CustomMapDecoration, AetherPortalMarker> AETHER_PORTAL_DECORATION_TYPE = CustomDecorationType.withWorldMarker(
Supplementaries.res("aether_portal"), AetherPortalMarker::new, AetherPortalMarker::getFromWorld, CustomMapDecoration::new);
public static final CustomDecorationType<CustomMapDecoration, BeaconMarker> BEACON_DECORATION_TYPE = CustomDecorationType.withWorldMarker(
Supplementaries.res("beacon"), BeaconMarker::new, BeaconMarker::getFromWorld, CustomMapDecoration::new);
public static final CustomDecorationType<ColoredDecoration, CeilingBannerMarker> BANNER_DECORATION_TYPE = CustomDecorationType.withWorldMarker(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package net.mehvahdjukaar.supplementaries.common.misc.map_markers.markers;

import net.mehvahdjukaar.moonlight.api.map.markers.SimpleMapBlockMarker;
import net.mehvahdjukaar.moonlight.api.util.Utils;
import net.mehvahdjukaar.supplementaries.common.misc.map_markers.ModMapMarkers;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import org.jetbrains.annotations.Nullable;

public class AetherPortalMarker extends SimpleMapBlockMarker {

public AetherPortalMarker() {
super(ModMapMarkers.AETHER_PORTAL_DECORATION_TYPE);
}

@Nullable
public static AetherPortalMarker getFromWorld(BlockGetter world, BlockPos pos) {
if (Utils.getID(getType().toString().equals("aether:aether_portal")) {
var m = new AetherPortalMarker();
m.setPos(pos);
return m;
} else {
return null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
"block.supplementaries.netherite_door": "下界合金门",
"block.supplementaries.netherite_trapdoor": "下界合金活板门",
"block.supplementaries.notice_board": "布告栏",
"block.supplementaries.pancake": "煎饼",
"block.supplementaries.pancake": "松饼",
"block.supplementaries.pancake.desc": "Hlzfss - Pancake Music",
"block.supplementaries.pedestal": "展示台",
"block.supplementaries.planter": "种植盆",
Expand Down Expand Up @@ -392,7 +392,7 @@
"item.supplementaries.flute": "竹笛",
"item.supplementaries.hat_stand": "帽架",
"item.supplementaries.key": "钥匙",
"item.supplementaries.pancake_disc": "煎饼",
"item.supplementaries.pancake_disc": "松饼",
"item.supplementaries.quiver": "箭袋",
"item.supplementaries.red_merchant_spawn_egg": "红商人刷怪蛋",
"item.supplementaries.rope_arrow": "绳索箭矢",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"custom_type": "supplementaries:aether_portal"
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ public static boolean addToContainerItem(Player player, ItemStack containerStack
}
} else {
int i = stack.getCount() - result.getCount();
slot.safeTake(i, i, player);
int takenCount = 0;
do{
ItemStack taken = slot.safeTake(i, i, player);
takenCount = taken.getCount();
i -= takenCount;
}
while (takenCount != 0 && i > 0);
containerStack.setTag(newTag);
return true;
}
Expand Down

0 comments on commit 0db2bee

Please sign in to comment.