Skip to content

Commit

Permalink
Fixed multiple bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
LudoCrypt committed Jul 26, 2022
1 parent de2ac37 commit 02b0939
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fabric_version=0.58.0+1.19
config_version=7.0.73
modmenu_version=4.0.4
satin_version=1.9.0
limlib_version=6.3.0
limlib_version=6.3.1

mod_version = 1.2.3
maven_group = net.ludocrypt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Box;
import net.minecraft.util.math.Direction;
import net.minecraft.util.registry.RegistryEntry;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.TeleportTarget;
import net.minecraft.world.World;

Expand All @@ -35,7 +35,7 @@ public static DimensionalPaintingEntity create(World world, BlockPos pos) {
public static DimensionalPaintingEntity create(World world, BlockPos pos, Direction direction, PaintingVariant variant) {
if (variant instanceof DimensionalPaintingVariant) {
DimensionalPaintingEntity entity = create(world, pos);
((PaintingEntityAccessor) entity).callSetVariant(RegistryEntry.of(variant));
((PaintingEntityAccessor) entity).callSetVariant(Registry.PAINTING_VARIANT.getEntry(Registry.PAINTING_VARIANT.getKey(variant).get()).get());
entity.setFacing(direction);
return entity;
}
Expand All @@ -46,7 +46,7 @@ public static DimensionalPaintingEntity create(World world, BlockPos pos, Direct
public static PaintingEntity createRegular(World world, BlockPos pos, Direction direction, PaintingVariant variant) {
PaintingEntity entity = new PaintingEntity(EntityType.PAINTING, world);
entity.setPosition(pos.getX(), pos.getY(), pos.getZ());
((PaintingEntityAccessor) entity).callSetVariant(RegistryEntry.of(variant));
((PaintingEntityAccessor) entity).callSetVariant(Registry.PAINTING_VARIANT.getEntry(Registry.PAINTING_VARIANT.getKey(variant).get()).get());
((AbstractDecorationEntityAccessor) entity).callSetFacing(direction);
return entity;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public static void manageServerToClientPackets() {
client.execute(() -> {
SoundEvent id = CornerRadioRegistry.getCurrent(client);
if (client.world.getBlockState(pos).isOf(CornerBlocks.TUNED_RADIO)) {
List<PaintingEntity> closestPaintings = client.world.getEntitiesByClass(PaintingEntity.class, Box.from(Vec3d.of(pos)).expand(16.0D), (entity) -> entity.getVariant() instanceof DimensionalPaintingVariant).stream().sorted(Comparator.comparing((entity) -> entity.squaredDistanceTo(Vec3d.of(pos)))).toList();
List<PaintingEntity> closestPaintings = client.world.getEntitiesByClass(PaintingEntity.class, Box.from(Vec3d.of(pos)).expand(16.0D), (entity) -> entity.getVariant().value() instanceof DimensionalPaintingVariant).stream().sorted(Comparator.comparing((entity) -> entity.squaredDistanceTo(Vec3d.of(pos)))).toList();
if (!closestPaintings.isEmpty()) {
id = CornerRadioRegistry.getCurrent(((DimensionalPaintingVariant) closestPaintings.get(0).getVariant()).radioRedirect);
id = CornerRadioRegistry.getCurrent(((DimensionalPaintingVariant) closestPaintings.get(0).getVariant().value()).radioRedirect);
}
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 02b0939

Please sign in to comment.