Skip to content

Commit

Permalink
Merge branch 'architectury-1.17.1' into architectury-1.18.1
Browse files Browse the repository at this point in the history
  • Loading branch information
UnlikePaladin committed Nov 5, 2023
2 parents 6ce48bf + a56882e commit f33726f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@ public static Identifier getLogId(Block block, String postFix) {
if (idExists(id, ResourceType.CLIENT_RESOURCES, IdLocation.TEXTURES)) {
return id;
}
id = new Identifier(namespace, "block/alpha_oak_log");
if (idExists(id, ResourceType.CLIENT_RESOURCES, IdLocation.TEXTURES)) {
return id;
}
}
return new Identifier(namespace, "block/" + path);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity pl
List<PFMMirrorEntity> mirrorBlockEntities;
if (!world.isClient && !(mirrorBlockEntities = world.getNonSpectatingEntities(PFMMirrorEntity.class, new Box(pos))).isEmpty()) {
mirrorBlockEntities.forEach(pfmMirrorEntity -> {
pfmMirrorEntity.remove(Entity.RemovalReason.KILLED);
((PFMMirrorEntity)pfmMirrorEntity).remove(Entity.RemovalReason.KILLED);
});
world.updateNeighbors(pos, state.getBlock());
}
Expand All @@ -58,7 +58,7 @@ public BlockState getStateForNeighborUpdate(BlockState state, Direction directio
if (!(world.getNonSpectatingEntities(PFMMirrorEntity.class, new Box(pos)).isEmpty())) {
mirrorBlockEntities.addAll(world.getNonSpectatingEntities(PFMMirrorEntity.class, new Box(pos)));
mirrorBlockEntities.forEach(pfmMirrorEntity -> {
pfmMirrorEntity.remove(Entity.RemovalReason.KILLED);
((Entity)pfmMirrorEntity).remove(Entity.RemovalReason.KILLED);
});
}
PFMMirrorEntity.createMirror((ServerWorld) world, pos, state.get(FACING).getOpposite());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.unlikepaladin.pfm.compat.imm_ptl.PFMMirrorBlockIP;
import com.unlikepaladin.pfm.compat.imm_ptl.shape.BlockPortalShape;
import net.minecraft.block.BlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.server.world.ServerWorld;
Expand Down Expand Up @@ -123,7 +124,7 @@ else if (blockPortalShape != null) {
wallValid = false;
}
if (!wallValid) {
remove(RemovalReason.DISCARDED);
((Entity)this).remove(RemovalReason.DISCARDED);
}
}

Expand All @@ -135,13 +136,9 @@ public static boolean isMirrorBlock(World world, BlockPos blockPos, Direction fa
return false;
}

public static PFMMirrorEntity createMirror(
ServerWorld world,
BlockPos glassPos,
Direction facing
) {
public static void createMirror(ServerWorld world, BlockPos glassPos, Direction facing) {
if (!isMirrorBlock(world, glassPos, facing.getOpposite())) {
return null;
return;
}

BlockPortalShape shape = BlockPortalShape.findArea(
Expand All @@ -151,15 +148,15 @@ public static PFMMirrorEntity createMirror(
);

if (shape == null) {
return null;
return;
}

PFMMirrorEntity pfmMirrorEntity = PFMMirrorEntity.entityType.create(world);
double distanceToCenter = -0.452;

Box wallBox = getWallBox(world, shape.area.stream());
if (wallBox == null) {
return null;
return;
}
pfmMirrorEntity.facing = facing;
Vec3d pos = Helper.getBoxSurfaceInversed(wallBox, facing.getOpposite()).getCenter();
Expand All @@ -172,7 +169,7 @@ public static PFMMirrorEntity createMirror(
facing.getAxis()
)
);
pfmMirrorEntity.setPosition(pos);
((Entity)pfmMirrorEntity).setPos(pos.x, pos.y, pos.z);
pfmMirrorEntity.setDestination(pos);
pfmMirrorEntity.dimensionTo = world.getRegistryKey();

Expand All @@ -181,7 +178,6 @@ public static PFMMirrorEntity createMirror(
pfmMirrorEntity.blockPortalShape = shape;
world.spawnEntity(pfmMirrorEntity);

return pfmMirrorEntity;
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public Optional<WoodVariant> getVariantFromBlock(Block baseBlock, Identifier blo
}
String namespace = blockId.getNamespace();
if (name != null && !namespace.equals("securitycraft") &&
!namespace.equals("absentbydesign") && !(namespace.equals("terrestria") && path.contains("sakura")) && !(namespace.equals("betternether") && path.contains("nether_mushroom")) && !namespace.equals("chipped")) {
!namespace.equals("absentbydesign") && !(namespace.equals("terrestria") && path.contains("sakura")) && !(namespace.equals("betternether") && path.contains("nether_mushroom")) && !namespace.equals("chipped") && !(namespace.equals("regions_unexplored") && path.contains("alpha"))) {

BlockState state = baseBlock.getDefaultState();
//can't check if the block is a full one, so I do this. Adding some checks here
Expand Down

0 comments on commit f33726f

Please sign in to comment.