Skip to content

Commit

Permalink
Spawn eggs can be placed in the air
Browse files Browse the repository at this point in the history
  • Loading branch information
Cabbasca authored and Wide-Cat committed Aug 12, 2023
1 parent 899cffd commit bee3569
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package meteordevelopment.meteorclient.systems.modules.world;

import net.minecraft.item.SpawnEggItem;
import meteordevelopment.meteorclient.events.render.Render3DEvent;
import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.renderer.ShapeMode;
Expand Down Expand Up @@ -83,7 +84,7 @@ private void onTick(TickEvent.Post event) {
double r = customRange.get() ? range.get() : mc.interactionManager.getReachDistance();
hitResult = mc.getCameraEntity().raycast(r, 0, false);

if (!(hitResult instanceof BlockHitResult) || !(mc.player.getMainHandStack().getItem() instanceof BlockItem)) return;
if (!(hitResult instanceof BlockHitResult) || !(mc.player.getMainHandStack().getItem() instanceof BlockItem) && !(mc.player.getMainHandStack().getItem() instanceof SpawnEggItem)) return;

if (mc.options.useKey.isPressed()) {
BlockUtils.place(((BlockHitResult) hitResult).getBlockPos(), Hand.MAIN_HAND, mc.player.getInventory().selectedSlot, false, 0, true, true, false);
Expand All @@ -94,7 +95,7 @@ private void onTick(TickEvent.Post event) {
private void onRender(Render3DEvent event) {
if (!(hitResult instanceof BlockHitResult)
|| !mc.world.getBlockState(((BlockHitResult) hitResult).getBlockPos()).isReplaceable()
|| !(mc.player.getMainHandStack().getItem() instanceof BlockItem)
|| !(mc.player.getMainHandStack().getItem() instanceof BlockItem) && !(mc.player.getMainHandStack().getItem() instanceof SpawnEggItem)
|| !render.get()) return;

event.renderer.box(((BlockHitResult) hitResult).getBlockPos(), sideColor.get(), lineColor.get(), shapeMode.get(), 0);
Expand Down

0 comments on commit bee3569

Please sign in to comment.